diff --git a/build/css/dark.css b/build/css/dark.css index f593901..c5455c7 100644 --- a/build/css/dark.css +++ b/build/css/dark.css @@ -1,3 +1,3 @@ -/* Numara Calculator 5.1.0 */ +/* Numara Calculator 5.1.1 */ 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 2e6aa7f..be9091d 100644 --- a/build/css/light.css +++ b/build/css/light.css @@ -1,3 +1,3 @@ -/* Numara Calculator 5.1.0 */ +/* Numara Calculator 5.1.1 */ 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 bd15134..96b47df 100644 --- a/build/css/numara.css +++ b/build/css/numara.css @@ -1,8 +1,8 @@ -/* Numara Calculator 5.1.0 */ +/* Numara Calculator 5.1.1 */ -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 .uk-search-icon:not(.uk-search-icon-flip)~.uk-search-input{padding-left:40px}.uk-search-default .uk-search-icon-flip~.uk-search-input{padding-right:40px}.uk-search-navbar{width:400px}.uk-search-navbar .uk-search-input{height:40px;background:0 0;font-size:1.5rem}.uk-search-navbar .uk-search-icon{width:40px}.uk-search-navbar .uk-search-icon:not(.uk-search-icon-flip)~.uk-search-input{padding-left:40px}.uk-search-navbar .uk-search-icon-flip~.uk-search-input{padding-right:40px}.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:80px}.uk-search-large .uk-search-icon:not(.uk-search-icon-flip)~.uk-search-input{padding-left:80px}.uk-search-large .uk-search-icon-flip~.uk-search-input{padding-right:80px}.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}.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} +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:40px}.uk-search-medium:has(.uk-search-icon:not(.uk-search-icon-flip)) .uk-search-input{padding-left:40px}.uk-search-medium:has(.uk-search-icon-flip) .uk-search-input{padding-right:40px}.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:80px}.uk-search-large:has(.uk-search-icon:not(.uk-search-icon-flip)) .uk-search-input{padding-left:80px}.uk-search-large:has(.uk-search-icon-flip) .uk-search-input{padding-right:80px}.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: uikit/dist/css/uikit.min.css: - (*! UIkit 3.20.10 | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License *) + (*! UIkit 3.21.1 | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License *) */ diff --git a/build/index.html b/build/index.html index 6c199f6..042497e 100644 --- a/build/index.html +++ b/build/index.html @@ -155,12 +155,12 @@

Rename page

-
  • +
  • diff --git a/build/js/numara.js b/build/js/numara.js index 6319af1..71c25ee 100644 --- a/build/js/numara.js +++ b/build/js/numara.js @@ -1,77 +1,77 @@ /** * Numara Calculator - * Version 5.1.0 + * Version 5.1.1 * 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 Lte=Object.create;var Lx=Object.defineProperty;var Pte=Object.getOwnPropertyDescriptor;var Rte=Object.getOwnPropertyNames;var qte=Object.getPrototypeOf,zte=Object.prototype.hasOwnProperty;var Te=(e,t)=>()=>(e&&(t=e(e=0)),t);var dt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),La=(e,t)=>{for(var r in t)Lx(e,r,{get:t[r],enumerable:!0})},yO=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Rte(t))!zte.call(e,i)&&i!==r&&Lx(e,i,{get:()=>t[i],enumerable:!(n=Pte(t,i))||n.enumerable});return e};var jr=(e,t,r)=>(r=e!=null?Lte(qte(e)):{},yO(t||!e||!e.__esModule?Lx(r,"default",{value:e,enumerable:!0}):r,e)),An=e=>yO(Lx({},"__esModule",{value:!0}),e);var v=Te(()=>{});function Ute(e,t){this.fun=e,this.array=t}function wO(e){var t=Math.floor((Date.now()-Xc.now())*.001),r=Xc.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+=sS)),[n,i]}var yEe,Xc,aS,sS,bO=Te(()=>{v();x();g();Ute.prototype.run=function(){this.fun.apply(null,this.array)};yEe={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},Xc={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Xc.now===void 0&&(aS=Date.now(),Xc.timing&&Xc.timing.navigationStart&&(aS=Xc.timing.navigationStart),Xc.now=()=>Date.now()-aS);sS=1e9;wO.bigint=function(e){var t=wO(e);return typeof BigInt>"u"?t[0]*sS+t[1]:BigInt(t[0]*sS)+BigInt(t[1])}});var g=Te(()=>{bO()});function Hte(){if(DO)return Wv;DO=!0,Wv.byteLength=l,Wv.toByteArray=s,Wv.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=N);var D=w===N?0:4-w%4;return[w,D]}function l(y){var N=u(y),w=N[0],D=N[1];return(w+D)*3/4-D}function a(y,N,w){return(N+w)*3/4-w}function s(y){var N,w=u(y),D=w[0],b=w[1],O=new r(a(y,D,b)),M=0,I=b>0?D-4:D,F;for(F=0;F>16&255,O[M++]=N>>8&255,O[M++]=N&255;return b===2&&(N=t[y.charCodeAt(F)]<<2|t[y.charCodeAt(F+1)]>>4,O[M++]=N&255),b===1&&(N=t[y.charCodeAt(F)]<<10|t[y.charCodeAt(F+1)]<<4|t[y.charCodeAt(F+2)]>>2,O[M++]=N>>8&255,O[M++]=N&255),O}function f(y){return e[y>>18&63]+e[y>>12&63]+e[y>>6&63]+e[y&63]}function p(y,N,w){for(var D,b=[],O=N;OI?I:M+O));return D===1?(N=y[w-1],b.push(e[N>>2]+e[N<<4&63]+"==")):D===2&&(N=(y[w-2]<<8)+y[w-1],b.push(e[N>>10]+e[N>>4&63]+e[N<<2&63]+"=")),b.join("")}return Wv}function $te(){if(NO)return Px;NO=!0;return Px.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)},Px.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,N=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+=N,l/=256,i-=8);for(u=u<0;e[r+y]=u&255,y+=N,u/=256,s-=8);e[r+y-N]|=w*128},Px}function Wte(){if(SO)return Kc;SO=!0;let e=Hte(),t=$te(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Kc.Buffer=u,Kc.SlowBuffer=b,Kc.INSPECT_MAX_BYTES=50;let n=2147483647;Kc.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(Je(fe,ArrayBuffer)||fe&&Je(fe.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Je(fe,SharedArrayBuffer)||fe&&Je(fe.buffer,SharedArrayBuffer)))return N(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 pe=w(fe);if(pe)return pe;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:D(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),pe=ne.write(fe,J);return pe!==j&&(ne=ne.slice(0,pe)),ne}function h(fe){let J=fe.length<0?0:D(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 b(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(Je(J,Uint8Array)&&(J=u.from(J,J.offset,J.byteLength)),Je(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,pe=j.length;for(let we=0,Le=Math.min(ne,pe);wepe.length?(u.isBuffer(Le)||(Le=u.from(Le)),Le.copy(pe,we)):Uint8Array.prototype.set.call(pe,Le,we);else if(u.isBuffer(Le))Le.copy(pe,we);else throw new TypeError('"list" argument must be an Array of Buffers');we+=Le.length}return pe};function O(fe,J){if(u.isBuffer(fe))return fe.length;if(ArrayBuffer.isView(fe)||Je(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 pe=!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(pe)return ne?-1:be(fe).length;J=(""+J).toLowerCase(),pe=!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 X(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,pe,we){if(Je(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),pe===void 0&&(pe=0),we===void 0&&(we=this.length),j<0||ne>J.length||pe<0||we>this.length)throw new RangeError("out of range index");if(pe>=we&&j>=ne)return 0;if(pe>=we)return-1;if(j>=ne)return 1;if(j>>>=0,ne>>>=0,pe>>>=0,we>>>=0,this===J)return 0;let Le=we-pe,Qe=ne-j,it=Math.min(Le,Qe),Xe=this.slice(pe,we),pt=J.slice(j,ne);for(let Y=0;Y2147483647?j=2147483647:j<-2147483648&&(j=-2147483648),j=+j,ot(j)&&(j=pe?0:fe.length-1),j<0&&(j=fe.length+j),j>=fe.length){if(pe)return-1;j=fe.length-1}else if(j<0)if(pe)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,pe);if(typeof J=="number")return J=J&255,typeof Uint8Array.prototype.indexOf=="function"?pe?Uint8Array.prototype.indexOf.call(fe,J,j):Uint8Array.prototype.lastIndexOf.call(fe,J,j):C(fe,[J],j,ne,pe);throw new TypeError("val must be string, number or Buffer")}function C(fe,J,j,ne,pe){let we=1,Le=fe.length,Qe=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;we=2,Le/=2,Qe/=2,j/=2}function it(pt,Y){return we===1?pt[Y]:pt.readUInt16BE(Y*we)}let Xe;if(pe){let pt=-1;for(Xe=j;XeLe&&(j=Le-Qe),Xe=j;Xe>=0;Xe--){let pt=!0;for(let Y=0;Ype&&(ne=pe)):ne=pe;let we=J.length;ne>we/2&&(ne=we/2);let Le;for(Le=0;Le>>0,isFinite(ne)?(ne=ne>>>0,pe===void 0&&(pe="utf8")):(pe=ne,ne=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let we=this.length-j;if((ne===void 0||ne>we)&&(ne=we),J.length>0&&(ne<0||j<0)||j>this.length)throw new RangeError("Attempt to write outside buffer bounds");pe||(pe="utf8");let Le=!1;for(;;)switch(pe){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 z(this,J,j,ne);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,J,j,ne);default:if(Le)throw new TypeError("Unknown encoding: "+pe);pe=(""+pe).toLowerCase(),Le=!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=[],pe=J;for(;pe239?4:we>223?3:we>191?2:1;if(pe+Qe<=j){let it,Xe,pt,Y;switch(Qe){case 1:we<128&&(Le=we);break;case 2:it=fe[pe+1],(it&192)===128&&(Y=(we&31)<<6|it&63,Y>127&&(Le=Y));break;case 3:it=fe[pe+1],Xe=fe[pe+2],(it&192)===128&&(Xe&192)===128&&(Y=(we&15)<<12|(it&63)<<6|Xe&63,Y>2047&&(Y<55296||Y>57343)&&(Le=Y));break;case 4:it=fe[pe+1],Xe=fe[pe+2],pt=fe[pe+3],(it&192)===128&&(Xe&192)===128&&(pt&192)===128&&(Y=(we&15)<<18|(it&63)<<12|(Xe&63)<<6|pt&63,Y>65535&&Y<1114112&&(Le=Y))}}Le===null?(Le=65533,Qe=1):Le>65535&&(Le-=65536,ne.push(Le>>>10&1023|55296),Le=56320|Le&1023),ne.push(Le),pe+=Qe}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 pe="";for(let we=J;wene&&(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 pe=this[J],we=1,Le=0;for(;++Le>>0,j=j>>>0,ne||he(J,j,this.length);let pe=this[J+--j],we=1;for(;j>0&&(we*=256);)pe+=this[J+--j]*we;return pe},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,Be(J,"offset");let j=this[J],ne=this[J+7];(j===void 0||ne===void 0)&<(J,this.length-8);let pe=j+this[++J]*2**8+this[++J]*2**16+this[++J]*2**24,we=this[++J]+this[++J]*2**8+this[++J]*2**16+ne*2**24;return BigInt(pe)+(BigInt(we)<>>0,Be(J,"offset");let j=this[J],ne=this[J+7];(j===void 0||ne===void 0)&<(J,this.length-8);let pe=j*2**24+this[++J]*2**16+this[++J]*2**8+this[++J],we=this[++J]*2**24+this[++J]*2**16+this[++J]*2**8+ne;return(BigInt(pe)<>>0,j=j>>>0,ne||he(J,j,this.length);let pe=this[J],we=1,Le=0;for(;++Le=we&&(pe-=Math.pow(2,8*j)),pe},u.prototype.readIntBE=function(J,j,ne){J=J>>>0,j=j>>>0,ne||he(J,j,this.length);let pe=j,we=1,Le=this[J+--pe];for(;pe>0&&(we*=256);)Le+=this[J+--pe]*we;return we*=128,Le>=we&&(Le-=Math.pow(2,8*j)),Le},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,Be(J,"offset");let j=this[J],ne=this[J+7];(j===void 0||ne===void 0)&<(J,this.length-8);let pe=this[J+4]+this[J+5]*2**8+this[J+6]*2**16+(ne<<24);return(BigInt(pe)<>>0,Be(J,"offset");let j=this[J],ne=this[J+7];(j===void 0||ne===void 0)&<(J,this.length-8);let pe=(j<<24)+this[++J]*2**16+this[++J]*2**8+this[++J];return(BigInt(pe)<>>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,pe,we){if(!u.isBuffer(fe))throw new TypeError('"buffer" argument must be a Buffer instance');if(J>pe||Jfe.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(J,j,ne,pe){if(J=+J,j=j>>>0,ne=ne>>>0,!pe){let Qe=Math.pow(2,8*ne)-1;De(this,J,j,ne,Qe,0)}let we=1,Le=0;for(this[j]=J&255;++Le>>0,ne=ne>>>0,!pe){let Qe=Math.pow(2,8*ne)-1;De(this,J,j,ne,Qe,0)}let we=ne-1,Le=1;for(this[j+we]=J&255;--we>=0&&(Le*=256);)this[j+we]=J/Le&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 ye(fe,J,j,ne,pe){We(J,ne,pe,fe,j,7);let we=Number(J&BigInt(4294967295));fe[j++]=we,we=we>>8,fe[j++]=we,we=we>>8,fe[j++]=we,we=we>>8,fe[j++]=we;let Le=Number(J>>BigInt(32)&BigInt(4294967295));return fe[j++]=Le,Le=Le>>8,fe[j++]=Le,Le=Le>>8,fe[j++]=Le,Le=Le>>8,fe[j++]=Le,j}function ce(fe,J,j,ne,pe){We(J,ne,pe,fe,j,7);let we=Number(J&BigInt(4294967295));fe[j+7]=we,we=we>>8,fe[j+6]=we,we=we>>8,fe[j+5]=we,we=we>>8,fe[j+4]=we;let Le=Number(J>>BigInt(32)&BigInt(4294967295));return fe[j+3]=Le,Le=Le>>8,fe[j+2]=Le,Le=Le>>8,fe[j+1]=Le,Le=Le>>8,fe[j]=Le,j+8}u.prototype.writeBigUInt64LE=ut(function(J,j=0){return ye(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,pe){if(J=+J,j=j>>>0,!pe){let it=Math.pow(2,8*ne-1);De(this,J,j,ne,it-1,-it)}let we=0,Le=1,Qe=0;for(this[j]=J&255;++we>0)-Qe&255;return j+ne},u.prototype.writeIntBE=function(J,j,ne,pe){if(J=+J,j=j>>>0,!pe){let it=Math.pow(2,8*ne-1);De(this,J,j,ne,it-1,-it)}let we=ne-1,Le=1,Qe=0;for(this[j+we]=J&255;--we>=0&&(Le*=256);)J<0&&Qe===0&&this[j+we+1]!==0&&(Qe=1),this[j+we]=(J/Le>>0)-Qe&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 ye(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 Ne(fe,J,j,ne,pe,we){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,pe){return J=+J,j=j>>>0,pe||Ne(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,pe){return J=+J,j=j>>>0,pe||Ne(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,pe){if(!u.isBuffer(J))throw new TypeError("argument should be a Buffer");if(ne||(ne=0),!pe&&pe!==0&&(pe=this.length),j>=J.length&&(j=J.length),j||(j=0),pe>0&&pe=this.length)throw new RangeError("Index out of range");if(pe<0)throw new RangeError("sourceEnd out of bounds");pe>this.length&&(pe=this.length),J.length-j>>0,ne=ne===void 0?this.length:ne>>>0,J||(J=0);let we;if(typeof J=="number")for(we=j;we2**32?pe=Ee(String(j)):typeof j=="bigint"&&(pe=String(j),(j>BigInt(2)**BigInt(32)||j<-(BigInt(2)**BigInt(32)))&&(pe=Ee(pe)),pe+="n"),ne+=` It must be ${J}. Received ${pe}`,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){Be(J,"offset"),(fe[J]===void 0||fe[J+j]===void 0)&<(J,fe.length-(j+1))}function We(fe,J,j,ne,pe,we){if(fe>j||fe3?J===0||J===BigInt(0)?Qe=`>= 0${Le} and < 2${Le} ** ${(we+1)*8}${Le}`:Qe=`>= -(2${Le} ** ${(we+1)*8-1}${Le}) and < 2 ** ${(we+1)*8-1}${Le}`:Qe=`>= ${J}${Le} and <= ${j}${Le}`,new Oe.ERR_OUT_OF_RANGE("value",Qe,fe)}ze(ne,pe,we)}function Be(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?(Be(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,pe=null,we=[];for(let Le=0;Le55295&&j<57344){if(!pe){if(j>56319){(J-=3)>-1&&we.push(239,191,189);continue}else if(Le+1===ne){(J-=3)>-1&&we.push(239,191,189);continue}pe=j;continue}if(j<56320){(J-=3)>-1&&we.push(239,191,189),pe=j;continue}j=(pe-55296<<10|j-56320)+65536}else pe&&(J-=3)>-1&&we.push(239,191,189);if(pe=null,j<128){if((J-=1)<0)break;we.push(j)}else if(j<2048){if((J-=2)<0)break;we.push(j>>6|192,j&63|128)}else if(j<65536){if((J-=3)<0)break;we.push(j>>12|224,j>>6&63|128,j&63|128)}else if(j<1114112){if((J-=4)<0)break;we.push(j>>18|240,j>>12&63|128,j>>6&63|128,j&63|128)}else throw new Error("Invalid code point")}return we}function Ue(fe){let J=[];for(let j=0;j>8,pe=j%256,we.push(pe),we.push(ne);return we}function Re(fe){return e.toByteArray(de(fe))}function ke(fe,J,j,ne){let pe;for(pe=0;pe=J.length||pe>=fe.length);++pe)J[pe+j]=fe[pe];return pe}function Je(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 et=function(){let fe="0123456789abcdef",J=new Array(256);for(let j=0;j<16;++j){let ne=j*16;for(let pe=0;pe<16;++pe)J[ne+pe]=fe[j]+fe[pe]}return J}();function ut(fe){return typeof BigInt>"u"?Lt:fe}function Lt(){throw new Error("BigInt not supported")}return Kc}var Wv,DO,Px,NO,Kc,SO,Jc,k,EEe,AEe,EO=Te(()=>{v();x();g();Wv={},DO=!1;Px={},NO=!1;Kc={},SO=!1;Jc=Wte();Jc.Buffer;Jc.SlowBuffer;Jc.INSPECT_MAX_BYTES;Jc.kMaxLength;k=Jc.Buffer,EEe=Jc.INSPECT_MAX_BYTES,AEe=Jc.kMaxLength});var x=Te(()=>{EO()});var Hm=dt((uS,lS)=>{v();x();g();(function(e,t){typeof uS=="object"&&typeof lS<"u"?lS.exports=t():typeof define=="function"&&define.amd?define("uikit",t):(e=typeof globalThis<"u"?globalThis:e||self,e.UIkit=t())})(uS,function(){"use strict";let{hasOwnProperty:e,toString:t}=Object.prototype;function r(m,S){return e.call(m,S)}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,(S,_)=>_.toUpperCase())),l=be(m=>m.charAt(0).toUpperCase()+m.slice(1));function a(m,S){var _;return(_=m?.startsWith)==null?void 0:_.call(m,S)}function s(m,S){var _;return(_=m?.endsWith)==null?void 0:_.call(m,S)}function f(m,S){var _;return(_=m?.includes)==null?void 0:_.call(m,S)}function p(m,S){var _;return(_=m?.findIndex)==null?void 0:_.call(m,S)}let{isArray:h,from:y}=Array,{assign:N}=Object;function w(m){return typeof m=="function"}function D(m){return m!==null&&typeof m=="object"}function b(m){return t.call(m)==="[object Object]"}function O(m){return D(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)&&D(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 z(m){return q(m)||R(m)&&!isNaN(m-parseFloat(m))}function H(m){return!(h(m)?m.length:D(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 S=Number(m);return isNaN(S)?!1:S}function ie(m){return parseFloat(m)||0}function X(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=X(m);let S=M(m)?m:m?.ownerDocument;return S?.defaultView||window}function re(m,S){return m===S||D(m)&&D(S)&&Object.keys(m).length===Object.keys(S).length&&ye(m,(_,$)=>_===S[$])}function he(m,S,_){return m.replace(new RegExp(`${S}|${_}`,"g"),$=>$===S?_:S)}function De(m){return m[m.length-1]}function ye(m,S){for(let _ in m)if(S(m[_],_)===!1)return!1;return!0}function ce(m,S){return m.slice().sort(({[S]:_=0},{[S]:$=0})=>_>$?1:$>_?-1:0)}function Ne(m,S){return m.reduce((_,$)=>_+ie(w(S)?S($):$[S]),0)}function Pe(m,S){let _=new Set;return m.filter(({[S]:$})=>_.has($)?!1:_.add($))}function Ce(m,S){return S.reduce((_,$)=>({..._,[$]:m[$]}),{})}function Oe(m,S=0,_=1){return Math.min(Math.max(ee(m)||0,S),_)}function He(){}function Ee(...m){return[["bottom","top"],["right","left"]].every(([S,_])=>Math.min(...m.map(({[S]:$})=>$))-Math.max(...m.map(({[_]:$})=>$))>0)}function ze(m,S){return m.x<=S.right&&m.x>=S.left&&m.y<=S.bottom&&m.y>=S.top}function We(m,S,_){let $=S==="width"?"height":"width";return{[$]:m[S]?Math.round(_*m[$]/m[S]):m[$],[S]:_}}function Be(m,S){m={...m};for(let _ in m)m=m[_]>S[_]?We(m,_,S[_]):m;return m}function lt(m,S){m=Be(m,S);for(let _ in m)m=m[_]S[_]||(S[_]=m(_,...$))}function Ue(m,...S){for(let _ of Z(m)){let $=ot(S).filter(Q=>!ke(_,Q));$.length&&_.classList.add(...$)}}function ve(m,...S){for(let _ of Z(m)){let $=ot(S).filter(Q=>ke(_,Q));$.length&&_.classList.remove(...$)}}function Re(m,S,_){_=ot(_),S=ot(S).filter($=>!f(_,$)),ve(m,S),Ue(m,_)}function ke(m,S){return[S]=ot(S),Z(m).some(_=>_.classList.contains(S))}function Je(m,S,_){let $=ot(S);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 et(m,S,_){var $;if(D(S)){for(let Q in S)et(m,Q,S[Q]);return}if(V(_))return($=X(m))==null?void 0:$.getAttribute(S);for(let Q of Z(m))w(_)&&(_=_.call(Q,et(Q,S))),_===null?Lt(Q,S):Q.setAttribute(S,_)}function ut(m,S){return Z(m).some(_=>_.hasAttribute(S))}function Lt(m,S){Z(m).forEach(_=>_.removeAttribute(S))}function fe(m,S){for(let _ of[S,`data-${S}`])if(ut(m,_))return et(m,_)}let J=typeof window<"u",j=J&&document.dir==="rtl",ne=J&&"ontouchstart"in window,pe=J&&window.PointerEvent,we=pe?"pointerdown":ne?"touchstart":"mousedown",Le=pe?"pointermove":ne?"touchmove":"mousemove",Qe=pe?"pointerup":ne?"touchend":"mouseup",it=pe?"pointerenter":ne?"":"mouseenter",Xe=pe?"pointerleave":ne?"":"mouseleave",pt=pe?"pointercancel":"touchcancel",Y={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(S=>Y[S.tagName.toLowerCase()])}let Ye=J&&Element.prototype.checkVisibility||function(){return this.offsetWidth||this.offsetHeight||this.getClientRects().length};function tt(m){return Z(m).some(S=>Ye.call(S))}let wt="input,select,textarea,button";function kt(m){return Z(m).some(S=>tr(S,wt))}let ur=`${wt},a[href],[tabindex]`;function Vr(m){return tr(m,ur)}function Wt(m){var S;return(S=X(m))==null?void 0:S.parentElement}function mi(m,S){return Z(m).filter(_=>tr(_,S))}function tr(m,S){return Z(m).some(_=>_.matches(S))}function no(m,S){let _=[];for(;m=Wt(m);)(!S||tr(m,S))&&_.push(m);return _}function Sr(m,S){m=X(m);let _=m?y(m.children):[];return S?mi(_,S):_}function Fn(m,S){return S?Z(m).indexOf(X(S)):Sr(Wt(m)).indexOf(m)}function Ta(m){return m=X(m),m&&["origin","pathname","search"].every(S=>m[S]===location[S])}function Oa(m){if(Ta(m)){m=X(m);let S=decodeURIComponent(m.hash).substring(1);return document.getElementById(S)||document.getElementsByName(S)[0]}}function zn(m,S){return Lo(m,ea(m,S))}function jo(m,S){return jn(m,ea(m,S))}function Lo(m,S){return X(oo(m,X(S),"querySelector"))}function jn(m,S){return Z(oo(m,X(S),"querySelectorAll"))}function ea(m,S=document){return R(m)&&cs(m).isContextSelector||M(S)?S:S.ownerDocument}let Il=/([!>+~-])(?=\s+[!>+~-]|\s*$)/g,bo=/.*?[^\\](?![^(]*\))(?:,|$)/g,sc=/\s*,$/,cs=be(m=>{var S;m=m.replace(Il,"$1 *");let _=!1,$=[];for(let Q of(S=m.match(bo))!=null?S:[])Q=Q.replace(sc,"").trim(),_||(_=["!","+","~","-",">"].includes(Q[0])),$.push(Q);return{selector:$.join(","),selectors:$,isContextSelector:_}}),io=be(m=>{m=m.substr(1).trim();let S=m.indexOf(" ");return~S?[m.substring(0,S),m.substring(S+1)]:[m,""]});function oo(m,S=document,_){if(!m||!R(m))return m;let $=cs(m);if(!$.isContextSelector)return ta(S,_,$.selector);m="";let Q=$.selectors.length===1;for(let ae of $.selectors){let me,Se=S;if(ae[0]==="!"&&([me,ae]=io(ae),Se=S.parentElement.closest(me),!ae&&Q)||Se&&ae[0]==="-"&&([me,ae]=io(ae),Se=Se.previousElementSibling,Se=tr(Se,me)?Se:null,!ae&&Q))return Se;if(Se){if(Q)return ae[0]==="~"||ae[0]==="+"?(ae=`:scope > :nth-child(${Fn(Se)+1}) ${ae}`,Se=Se.parentElement):ae[0]===">"&&(ae=`:scope ${ae}`),ta(Se,_,ae);m+=`${m?",":""}${Ks(Se)} ${ae}`}}return M(S)||(S=S.ownerDocument),ta(S,_,m)}function ta(m,S,_){try{return m[S](_)}catch{return null}}function Ks(m){let S=[];for(;m.parentNode;){let _=et(m,"id");if(_){S.unshift(`#${Ia(_)}`);break}else{let{tagName:$}=m;$!=="HTML"&&($+=`:nth-child(${Fn(m)+1})`),S.unshift($),m=m.parentNode}}return S.join(" > ")}function Ia(m){return R(m)?CSS.escape(m):""}function Qt(...m){let[S,_,$,Q,ae=!1]=Jr(m);Q.length>1&&(Q=ra(Q)),ae?.self&&(Q=Lu(Q)),$&&(Q=zt($,Q));for(let me of _)for(let Se of S)Se.addEventListener(me,Q,ae);return()=>$i(S,_,Q,ae)}function $i(...m){let[S,_,,$,Q=!1]=Jr(m);for(let ae of _)for(let me of S)me.removeEventListener(ae,$,Q)}function Tr(...m){let[S,_,$,Q,ae=!1,me]=Jr(m),Se=Qt(S,_,$,_e=>{let Ke=!me||me(_e);Ke&&(Se(),Q(_e,Ke))},ae);return Se}function Rt(m,S,_){return Me(m).every($=>$.dispatchEvent(ao(S,!0,!0,_)))}function ao(m,S=!0,_=!1,$){return R(m)&&(m=new CustomEvent(m,{bubbles:S,cancelable:_,detail:$})),m}function Jr(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,S){return _=>{let $=m[0]===">"?jn(m,_.currentTarget).reverse().find(Q=>Q.contains(_.target)):_.target.closest(m);$&&(_.current=$,S.call(this,_),delete _.current)}}function ra(m){return S=>h(S.detail)?m(S,...S.detail):m(S)}function Lu(m){return function(S){if(S.target===S.currentTarget||S.target===S.current)return m.call(null,S)}}function Un(m){return m&&"addEventListener"in m}function ue(m){return Un(m)?m:X(m)}function Me(m){return h(m)?m.map(ue).filter(Boolean):R(m)?jn(m):Un(m)?[m]:Z(m)}function st(m){return m.pointerType==="touch"||!!m.touches}function ht(m){var S,_;let{clientX:$,clientY:Q}=((S=m.touches)==null?void 0:S[0])||((_=m.changedTouches)==null?void 0:_[0])||m;return{x:$,y:Q}}let nt={"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 Fe(m,S,_,$){let Q=Z(m);for(let ae of Q)if(R(S)){if(S=Ar(S),V(_))return getComputedStyle(ae).getPropertyValue(S);ae.style.setProperty(S,z(_)&&!nt[S]?`${_}px`:_||q(_)?_:"",$)}else if(h(S)){let me={};for(let Se of S)me[Se]=Fe(ae,Se);return me}else if(D(S))for(let me in S)Fe(ae,me,S[me],_);return Q[0]}let Ar=be(m=>{if(a(m,"--"))return m;m=i(m);let{style:S}=document.documentElement;if(m in S)return m;for(let _ of["webkit","moz"]){let $=`-${_}-${m}`;if($ in S)return $}}),_n="uk-transition",hi="transitionend",Js="transitioncanceled";function w1(m,S,_=400,$="linear"){return _=Math.round(_),Promise.all(Z(m).map(Q=>new Promise((ae,me)=>{for(let _e in S)Fe(Q,_e);let Se=setTimeout(()=>Rt(Q,hi),_);Tr(Q,[hi,Js],({type:_e})=>{clearTimeout(Se),ve(Q,_n),Fe(Q,{transitionProperty:"",transitionDuration:"",transitionTimingFunction:""}),_e===Js?me():ae(Q)},{self:!0}),Ue(Q,_n),Fe(Q,{transitionProperty:Object.keys(S).map(Ar).join(","),transitionDuration:`${_}ms`,transitionTimingFunction:$,...S})})))}let Mt={start:w1,async stop(m){Rt(m,hi),await Promise.resolve()},async cancel(m){Rt(m,Js),await Promise.resolve()},inProgress(m){return ke(m,_n)}},uc="uk-animation",Ud="animationend",Pu="animationcanceled";function na(m,S,_=200,$,Q){return Promise.all(Z(m).map(ae=>new Promise((me,Se)=>{ke(ae,uc)&&Rt(ae,Pu);let _e=[S,uc,`${uc}-${Q?"leave":"enter"}`,$&&`uk-transform-origin-${$}`,Q&&`${uc}-reverse`],Ke=setTimeout(()=>Rt(ae,Ud),_);Tr(ae,[Ud,Pu],({type:je})=>{clearTimeout(Ke),je===Pu?Se():me(ae),Fe(ae,"animationDuration",""),ve(ae,_e)},{self:!0}),Fe(ae,"animationDuration",`${_}ms`),Ue(ae,_e)})))}let ps={in:na,out(m,S,_,$){return na(m,S,_,$,!0)},inProgress(m){return ke(m,uc)},cancel(m){Rt(m,Pu)}};function b1(m){if(document.readyState!=="loading"){m();return}Tr(document,"DOMContentLoaded",m)}function Qr(m,...S){return S.some(_=>{var $;return(($=m?.tagName)==null?void 0:$.toLowerCase())===_.toLowerCase()})}function lc(m){return m=hr(m),m.innerHTML="",m}function Qs(m,S){return V(S)?hr(m).innerHTML:dn(lc(m),S)}let Hd=pc("prepend"),dn=pc("append"),fc=pc("before"),cc=pc("after");function pc(m){return function(S,_){var $;let Q=Z(R(_)?Ru(_):_);return($=hr(S))==null||$[m](...Q),mc(Q)}}function Do(m){Z(m).forEach(S=>S.remove())}function Qp(m,S){for(S=X(fc(m,S));S.firstElementChild;)S=S.firstElementChild;return dn(S,m),S}function jp(m,S){return Z(Z(m).map(_=>_.hasChildNodes()?Qp(y(_.childNodes),S):dn(_,S)))}function No(m){Z(m).map(Wt).filter((S,_,$)=>$.indexOf(S)===_).forEach(S=>S.replaceWith(...S.childNodes))}let sN=/^<(\w+)\s*\/?>(?:<\/\1>)?$/;function Ru(m){let S=sN.exec(m);if(S)return document.createElement(S[1]);let _=document.createElement("template");return _.innerHTML=m.trim(),mc(_.content.childNodes)}function mc(m){return m.length>1?m:m[0]}function So(m,S){if(F(m))for(S(m),m=m.firstElementChild;m;){let _=m.nextElementSibling;So(m,S),m=_}}function hr(m,S){return D1(m)?X(Ru(m)):Lo(m,S)}function an(m,S){return D1(m)?Z(Ru(m)):jn(m,S)}function D1(m){return R(m)&&a(m.trim(),"<")}let qu={width:["left","right"],height:["top","bottom"]};function Zt(m){let S=F(m)?X(m).getBoundingClientRect():{height:Wi(m),width:zu(m),top:0,left:0};return{height:S.height,width:S.width,top:S.top,left:S.left,bottom:S.top+S.height,right:S.left+S.width}}function xr(m,S){S&&Fe(m,{left:0,top:0});let _=Zt(m);if(m){let{scrollY:$,scrollX:Q}=le(m),ae={height:$,width:Q};for(let me in qu)for(let Se of qu[me])_[Se]+=ae[me]}if(!S)return _;for(let $ of["left","top"])Fe(m,$,S[$]-_[$])}function $d(m){let{top:S,left:_}=xr(m),{ownerDocument:{body:$,documentElement:Q},offsetParent:ae}=X(m),me=ae||Q;for(;me&&(me===$||me===Q)&&Fe(me,"position")==="static";)me=me.parentNode;if(F(me)){let Se=xr(me);S-=Se.top+ie(Fe(me,"borderTopWidth")),_-=Se.left+ie(Fe(me,"borderLeftWidth"))}return{top:S-ie(Fe(m,"marginTop")),left:_-ie(Fe(m,"marginLeft"))}}function js(m){m=X(m);let S=[m.offsetTop,m.offsetLeft];for(;m=m.offsetParent;)if(S[0]+=m.offsetTop+ie(Fe(m,"borderTopWidth")),S[1]+=m.offsetLeft+ie(Fe(m,"borderLeftWidth")),Fe(m,"position")==="fixed"){let _=le(m);return S[0]+=_.scrollY,S[1]+=_.scrollX,S}return S}let Wi=hc("height"),zu=hc("width");function hc(m){let S=l(m);return(_,$)=>{if(V($)){if(O(_))return _[`inner${S}`];if(M(_)){let Q=_.documentElement;return Math.max(Q[`offset${S}`],Q[`scroll${S}`])}return _=X(_),$=Fe(_,m),$=$==="auto"?_[`offset${S}`]:ie($)||0,$-eu(_,m)}else return Fe(_,m,!$&&$!==0?"":+$+eu(_,m)+"px")}}function eu(m,S,_="border-box"){return Fe(m,"boxSizing")===_?Ne(qu[S].map(l),$=>ie(Fe(m,`padding${$}`))+ie(Fe(m,`border${$}Width`))):0}function dc(m){for(let S in qu)for(let _ in qu[S])if(qu[S][_]===m)return qu[S][1-_];return m}function ei(m,S="width",_=window,$=!1){return R(m)?Ne(uN(m),Q=>{let ae=ia(Q);return ae?lN(ae==="vh"?S1():ae==="vw"?zu(le(_)):$?_[`offset${l(S)}`]:Zt(_)[S],Q):Q}):ie(m)}let em=/-?\d+(?:\.\d+)?(?:v[wh]|%|px)?/g,uN=be(m=>m.toString().replace(/\s/g,"").match(em)||[]),N1=/(?:v[hw]|%)$/,ia=be(m=>(m.match(N1)||[])[0]);function lN(m,S){return m*ie(S)/100}let vc,tu;function S1(){return vc||(tu||(tu=hr("
    "),Fe(tu,{height:"100vh",position:"fixed"}),Qt(window,"resize",()=>vc=null)),dn(document.body,tu),vc=tu.clientHeight,Do(tu),vc)}let Vi={read:tm,write:Wd,clear:_l,flush:E1},Fl=[],Po=[];function tm(m){return Fl.push(m),Gd(),m}function Wd(m){return Po.push(m),Gd(),m}function _l(m){Yd(Fl,m),Yd(Po,m)}let Vd=!1;function E1(){A1(Fl),A1(Po.splice(0)),Vd=!1,(Fl.length||Po.length)&&Gd()}function Gd(){Vd||(Vd=!0,queueMicrotask(E1))}function A1(m){let S;for(;S=m.shift();)try{S()}catch(_){console.error(_)}}function Yd(m,S){let _=m.indexOf(S);return~_&&m.splice(_,1)}class Zd{init(){this.positions=[];let S;this.unbind=Qt(document,"mousemove",_=>S=ht(_)),this.interval=setInterval(()=>{S&&(this.positions.push(S),this.positions.length>5&&this.positions.shift())},50)}cancel(){var S;(S=this.unbind)==null||S.call(this),clearInterval(this.interval)}movesTo(S){if(!this.positions||this.positions.length<2)return!1;let _=Zt(S),{left:$,right:Q,top:ae,bottom:me}=_,[Se]=this.positions,_e=De(this.positions),Ke=[Se,_e];return ze(_e,_)?!1:[[{x:$,y:ae},{x:Q,y:me}],[{x:$,y:me},{x:Q,y:ae}]].some(xt=>{let Pt=fN(Ke,xt);return Pt&&ze(Pt,_)})}}function fN([{x:m,y:S},{x:_,y:$}],[{x:Q,y:ae},{x:me,y:Se}]){let _e=(Se-ae)*(_-m)-(me-Q)*($-S);if(_e===0)return!1;let Ke=((me-Q)*(S-ae)-(Se-ae)*(m-Q))/_e;return Ke<0?!1:{x:m+Ke*(_-m),y:S+Ke*($-S)}}function C1(m,S,_={},{intersecting:$=!0}={}){let Q=new IntersectionObserver($?(ae,me)=>{ae.some(Se=>Se.isIntersecting)&&S(ae,me)}:S,_);for(let ae of Z(m))Q.observe(ae);return Q}let cN=J&&window.ResizeObserver;function gc(m,S,_={box:"border-box"}){if(cN)return Kd(ResizeObserver,m,S,_);let $=[Qt(window,"load resize",S),Qt(document,"loadedmetadata load",S,!0)];return{disconnect:()=>$.map(Q=>Q())}}function rm(m){return{disconnect:Qt([window,window.visualViewport],"resize",m)}}function Xd(m,S,_){return Kd(MutationObserver,m,S,_)}function Kd(m,S,_,$){let Q=new m(_);for(let ae of Z(S))Q.observe(ae,$);return Q}function kl(m){ru(m)&&im(m,{func:"playVideo",method:"play"}),nm(m)&&m.play()}function ms(m){ru(m)&&im(m,{func:"pauseVideo",method:"pause"}),nm(m)&&m.pause()}function M1(m){ru(m)&&im(m,{func:"mute",method:"setVolume",value:0}),nm(m)&&(m.muted=!0)}function T1(m){return nm(m)||ru(m)}function nm(m){return Qr(m,"video")}function ru(m){return Qr(m,"iframe")&&(Hn(m)||O1(m))}function Hn(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 im(m,S){await pN(m),Bl(m,S)}function Bl(m,S){m.contentWindow.postMessage(JSON.stringify({event:"command",...S}),"*")}let Jd="_ukPlayer",I1=0;function pN(m){if(m[Jd])return m[Jd];let S=Hn(m),_=O1(m),$=++I1,Q;return m[Jd]=new Promise(ae=>{S&&Tr(m,"load",()=>{let me=()=>Bl(m,{event:"listening",id:$});Q=setInterval(me,100),me()}),Tr(window,"message",ae,!1,({data:me})=>{try{return me=JSON.parse(me),S&&me?.id===$&&me.event==="onReady"||_&&Number(me?.player_id)===$}catch{}}),m.src=`${m.src}${f(m.src,"?")?"&":"?"}${S?"enablejsapi=1":`api=1&player_id=${$}`}`}).then(()=>clearInterval(Q))}function Qd(m,S=0,_=0){return tt(m)?Ee(...nu(m).map($=>{let{top:Q,left:ae,bottom:me,right:Se}=Eo($);return{top:Q-S,left:ae-_,bottom:me+S,right:Se+_}}).concat(xr(m))):!1}function jd(m,{offset:S=0}={}){let _=tt(m)?Uu(m,!1,["hidden"]):[];return _.reduce((me,Se,_e)=>{let{scrollTop:Ke,scrollHeight:je,offsetHeight:xt}=Se,Pt=Eo(Se),$t=je-Pt.height,{height:ar,top:Ir}=_[_e-1]?Eo(_[_e-1]):xr(m),Pr=Math.ceil(Ir-Pt.top-S+Ke);return S>0&&xt$t?(S-=Pr-$t,Pr=$t):Pr<0&&(S-=Pr,Pr=0),()=>$(Se,Pr-Ke,m,$t).then(me)},()=>Promise.resolve())();function $(me,Se,_e,Ke){return new Promise(je=>{let xt=me.scrollTop,Pt=Q(Math.abs(Se)),$t=Date.now(),ar=xc(me)===me,Ir=xr(_e).top+(ar?0:xt),Pr=0,pu=15;(function $v(){let kx=ae(Oe((Date.now()-$t)/Pt)),ws=0;if(_[0]===me&&xt+SeFe(me,"position")==="fixed");return~ae&&(Q=Q.slice(ae)),[$].concat(Q.filter(me=>Fe(me,"overflow").split(" ").some(Se=>f(["auto","scroll",..._],Se))&&(!S||me.scrollHeight>Eo(me).height))).reverse()}function hs(...m){return Uu(...m)[0]}function nu(m){return Uu(m,!1,["hidden","clip"])}function Eo(m){let S=le(m),_=m===xc(m)?S:m;if(O(_)&&S.visualViewport){let{height:Q,width:ae,scale:me,pageTop:Se,pageLeft:_e}=S.visualViewport;return Q=Math.round(Q*me),ae=Math.round(ae*me),{height:Q,width:ae,top:Se,left:_e,bottom:Se+Q,right:_e+ae}}let $=xr(_);if(Fe(_,"display")==="inline")return $;for(let[Q,ae,me,Se]of[["width","x","left","right"],["height","y","top","bottom"]]){O(_)?_=_.document:$[me]+=ie(Fe(_,`border-${me}-width`));let _e=$[Q]%1;$[Q]=$[ae]=_[`client${l(Q)}`]-(_e?_e<.5?-_e:1-_e:0),$[Se]=$[Q]+$[me]}return $}function Hu(m){let{left:S,width:_,top:$}=Zt(m);for(let Q of $?[0,$]:[0])for(let ae of le(m).document.elementsFromPoint(S+_/2,Q))if(!ae.contains(m)&&!ke(ae,"uk-togglable-leave")&&(Ll(ae,"fixed")&&Fa(no(m).reverse().find(me=>!me.contains(ae)&&!Ll(me,"static")))=Pt[je])continue;$t=_1(m,S,_,_e)[je]-$[je];let Ir=F1(m,S[_e],ae,_e);if(!Ao(ev($,$t,_e),Ir,_e)){if(Ao($,Ir,_e))continue;if(_.recursion)return!1;let Pr=k1(m,S,_);if(Pr&&Ao(Pr,Ir,1-_e))return Pr;continue}}else if(me[_e]==="shift"){let ar=xr(S[_e]),{offset:Ir}=_;$t=Oe(Oe($[je],Pt[je],Pt[xt]-$[Ke]),ar[je]-$[Ke]+Ir[_e],ar[xt]-Ir[_e])-$[je]}Se=ev(Se,$t,_e)}return Se}function am(m,S,_){let{attach:$,offset:Q}={attach:{element:["left","top"],target:["left","top"],..._.attach},offset:[0,0],..._},ae=xr(m);for(let[me,[Se,,_e,Ke]]of Object.entries(so)){let je=$.target[me]===$.element[me]?Eo(S[me]):xr(S[me]);ae=ev(ae,je[_e]-ae[_e]+tv($.target[me],Ke,je[Se])-tv($.element[me],Ke,ae[Se])+ +Q[me],me)}return ae}function ev(m,S,_){let[,$,Q,ae]=so[_],me={...m};return me[Q]=m[$]=m[Q]+S,me[ae]+=S,me}function tv(m,S,_){return m==="center"?_/2:m===S?_:0}function mN(m,S,_,$,Q){let ae=$u(...sm(m,S).map(Eo));return _&&(ae[so[Q][2]]+=_,ae[so[Q][3]]-=_),$&&(ae=$u(ae,xr(h($)?$[Q]:$))),ae}function F1(m,S,_,$){let[Q,ae,me,Se]=so[$],[_e]=sm(m,S),Ke=Eo(_e);return["auto","scroll"].includes(Fe(_e,`overflow-${ae}`))&&(Ke[me]-=_e[`scroll${l(me)}`],Ke[Se]=Ke[me]+_e[`scroll${l(Q)}`]),Ke[me]+=_,Ke[Se]-=_,Ke}function sm(m,S){return nu(S).filter(_=>_.contains(m))}function $u(...m){let S={};for(let _ of m)for(let[,,$,Q]of so)S[$]=Math.max(S[$]||0,_[$]),S[Q]=Math.min(...[S[Q],_[Q]].filter(Boolean));return S}function Ao(m,S,_){let[,,$,Q]=so[_];return m[$]>=S[$]&&m[Q]<=S[Q]}function _1(m,S,{offset:_,attach:$},Q){return am(m,S,{attach:{element:B1($.element,Q),target:B1($.target,Q)},offset:hN(_,Q)})}function k1(m,S,_){return iu(m,S,{..._,attach:{element:_.attach.element.map(L1).reverse(),target:_.attach.target.map(L1).reverse()},offset:_.offset.reverse(),placement:_.placement.reverse(),recursion:!0})}function B1(m,S){let _=[...m],$=so[S].indexOf(m[S]);return~$&&(_[S]=so[S][1-$%2+2]),_}function L1(m){for(let S=0;Sdocument,handler(){document.hidden?this.stop():this.start()}},methods:{start(){this.stop(),this.update(),this.timer||(Rt(this.$el,"countdownstart"),this.timer=setInterval(this.update,1e3))},stop(){this.timer&&(clearInterval(this.timer),Rt(this.$el,"countdownstop"),this.timer=null)},update(){let m=q1(this.date);m.total||(this.stop(),this.end||(Rt(this.$el,"countdownend"),this.end=!0));for(let S of yc){let _=hr(this.clsWrapper.replace("%unit%",S),this.$el);if(!_)continue;let $=Math.trunc(m[S]).toString().padStart(2,"0");_.textContent!==$&&($=$.split(""),$.length!==_.children.length&&Qs(_,$.map(()=>"").join("")),$.forEach((Q,ae)=>_.children[ae].textContent=Q))}}}};function q1(m){let S=Math.max(0,m-Date.now())/1e3;return{total:S,seconds:S%60,minutes:S/60%60,hours:S/60/60%24,days:S/60/60/24}}let kn={};kn.events=kn.watch=kn.observe=kn.created=kn.beforeConnect=kn.connected=kn.beforeDisconnect=kn.disconnected=kn.destroy=um,kn.args=function(m,S){return S!==!1&&um(S||m)},kn.update=function(m,S){return ce(um(m,w(S)?{read:S}:S),"order")},kn.props=function(m,S){if(h(S)){let _={};for(let $ of S)_[$]=String;S=_}return kn.methods(m,S)},kn.computed=kn.methods=function(m,S){return S?m?{...m,...S}:S:m},kn.i18n=kn.data=function(m,S,_){return _?wc(m,S,_):S?m?function($){return wc(m,S,$)}:S:m};function wc(m,S,_){return kn.computed(w(m)?m.call(_,_):m,w(S)?S.call(_,_):S)}function um(m,S){return m=m&&!h(m)?[m]:m,S?m?m.concat(S):h(S)?S:[S]:m}function lm(m,S){return V(S)?m:S}function Yi(m,S,_){let $={};if(w(S)&&(S=S.options),S.extends&&(m=Yi(m,S.extends,_)),S.mixins)for(let ae of S.mixins)m=Yi(m,ae,_);for(let ae in m)Q(ae);for(let ae in S)r(m,ae)||Q(ae);function Q(ae){$[ae]=(kn[ae]||lm)(m[ae],S[ae],_)}return $}function Wu(m,S=[]){try{return m?a(m,"{")?JSON.parse(m):S.length&&!f(m,":")?{[S[0]]:m}:m.split(";").reduce((_,$)=>{let[Q,ae]=$.split(/:(.*)/);return Q&&!V(ae)&&(_[Q.trim()]=ae.trim()),_},{}):{}}catch{return{}}}function bc(m,S){return m===Boolean?W(S):m===Number?ee(S):m==="list"?z1(S):m===Object&&R(S)?Wu(S):m?m(S):S}let rv=/,(?![^(]*\))/;function z1(m){return h(m)?m:R(m)?m.split(rv).map(S=>z(S)?ee(S):W(S.trim())):[m]}function U1(m){m._data={},m._updates=[...m.$options.update||[]]}function nv(m,S){m._updates.unshift(S)}function dN(m){delete m._data}function Dc(m,S="update"){m._connected&&m._updates.length&&(m._queued||(m._queued=new Set,Vi.read(()=>{m._connected&&vN(m,m._queued),delete m._queued})),m._queued.add(S.type||S))}function vN(m,S){for(let{read:_,write:$,events:Q=[]}of m._updates){if(!S.has("update")&&!Q.some(me=>S.has(me)))continue;let ae;_&&(ae=_.call(m,m._data,S),ae&&b(ae)&&N(m._data,ae)),$&&ae!==!1&&Vi.write(()=>{m._connected&&$.call(m,m._data,S)})}}function si(m){return sa(gc,m,"resize")}function aa(m){return sa(C1,m)}function ds(m){return sa(Xd,m)}function Pl(m={}){return aa({handler:function(S,_){let{targets:$=this.$el,preload:Q=5}=m;for(let ae of Z(w($)?$(this):$))an('[loading="lazy"]',ae).slice(0,Q-1).forEach(me=>Lt(me,"loading"));for(let ae of S.filter(({isIntersecting:me})=>me).map(({target:me})=>me))_.unobserve(ae)},...m})}function Nc(m){return sa((S,_)=>rm(_),m,"resize")}function Rl(m){return sa((S,_)=>({disconnect:Qt(Zi(S),"scroll",_,{passive:!0})}),m,"scroll")}function fm(m){return{observe(S,_){return{observe:He,unobserve:He,disconnect:Qt(S,we,_,{passive:!0})}},handler(S){if(!st(S))return;let _=ht(S),$="tagName"in S.target?S.target:Wt(S.target);Tr(document,`${Qe} ${pt} scroll`,Q=>{let{x:ae,y:me}=ht(Q);(Q.type!=="scroll"&&$&&ae&&Math.abs(_.x-ae)>100||me&&Math.abs(_.y-me)>100)&&setTimeout(()=>{Rt($,"swipe"),Rt($,`swipe${Vu(_.x,_.y,ae,me)}`)})})},...m}}function sa(m,S,_){return{observe:m,handler(){Dc(this,_)},...S}}function Vu(m,S,_,$){return Math.abs(m-_)>=Math.abs(S-$)?m-_>0?"Left":"Right":S-$>0?"Up":"Down"}function Zi(m){return Z(m).map(S=>{let{ownerDocument:_}=S,$=hs(S,!0);return $===_.scrollingElement?_:$})}var vs={props:{margin:String,firstColumn:Boolean},data:{margin:"uk-margin-small-top",firstColumn:"uk-first-column"},observe:[ds({options:{childList:!0}}),ds({options:{attributes:!0,attributeFilter:["style"]},target:({$el:m})=>[m,...Sr(m)]}),si({target:({$el:m})=>[m,...Sr(m)]})],update:{read(){return{rows:_a(Sr(this.$el))}},write({rows:m}){for(let S of m)for(let _ of S)Je(_,this.margin,m[0]!==S),Je(_,this.firstColumn,S[j?S.length-1:0]===_)},events:["resize"]}};function _a(m){let S=[[]],_=m.some(($,Q)=>Q&&m[Q-1].offsetParent!==$.offsetParent);for(let $ of m){if(!tt($))continue;let Q=ql($,_);for(let ae=S.length-1;ae>=0;ae--){let me=S[ae];if(!me[0]){me.push($);break}let Se=ql(me[0],_);if(Q.top>=Se.bottom-1&&Q.top!==Se.top){S.push([$]);break}if(Q.bottom-1>Se.top||Q.top===Se.top){let _e=me.length-1;for(;_e>=0;_e--){let Ke=ql(me[_e],_);if(Q.left>=Ke.left)break}me.splice(_e+1,0,$);break}if(ae===0){S.unshift([$]);break}}}return S}function ql(m,S=!1){let{offsetTop:_,offsetLeft:$,offsetHeight:Q,offsetWidth:ae}=m;return S&&([_,$]=js(m)),{top:_,left:$,bottom:_+Q,right:$+ae}}async function gN(m,S,_){await zl();let $=Sr(S),Q=$.map($t=>iv($t,!0)),ae={...Fe(S,["height","padding"]),display:"block"},me=$.concat(S);await Promise.all(me.map(Mt.cancel)),Fe(me,"transitionProperty","none"),await m(),$=$.concat(Sr(S).filter($t=>!f($,$t))),await Promise.resolve(),Fe(me,"transitionProperty","");let Se=et(S,"style"),_e=Fe(S,["height","padding"]),[Ke,je]=Sc(S,$,Q),xt=$.map($t=>({style:et($t,"style")}));$.forEach(($t,ar)=>je[ar]&&Fe($t,je[ar])),Fe(S,ae),Rt(S,"scroll"),await zl();let Pt=$.map(($t,ar)=>Wt($t)===S&&Mt.start($t,Ke[ar],_,"ease")).concat(Mt.start(S,_e,_,"ease"));try{await Promise.all(Pt),$.forEach(($t,ar)=>{et($t,xt[ar]),Wt($t)===S&&Fe($t,"display",Ke[ar].opacity===0?"none":"")}),et(S,"style",Se)}catch{et($,"style",""),H1(S,ae)}}function iv(m,S){let _=Fe(m,"zIndex");return tt(m)?{display:"",opacity:S?Fe(m,"opacity"):"0",pointerEvents:"none",position:"absolute",zIndex:_==="auto"?Fn(m):_,...cm(m)}:!1}function Sc(m,S,_){let $=S.map((ae,me)=>Wt(ae)&&me in _?_[me]?tt(ae)?cm(ae):{opacity:0}:{opacity:tt(ae)?1:0}:!1),Q=$.map((ae,me)=>{let Se=Wt(S[me])===m&&(_[me]||iv(S[me]));if(!Se)return!1;if(!ae)delete Se.opacity;else if(!("opacity"in ae)){let{opacity:_e}=Se;_e%1?ae.opacity=1:delete Se.opacity}return Se});return[$,Q]}function H1(m,S){for(let _ in S)Fe(m,_,"")}function cm(m){let{height:S,width:_}=xr(m);return{height:S,width:_,transform:"",...$d(m),...Fe(m,["marginTop","marginLeft"])}}function zl(){return new Promise(m=>requestAnimationFrame(m))}let ov="uk-transition-leave",Ec="uk-transition-enter";function av(m,S,_,$=0){let Q=Ul(S,!0),ae={opacity:1},me={opacity:0},Se=je=>()=>Q===Ul(S)?je():Promise.reject(),_e=Se(async()=>{Ue(S,ov),await Promise.all(Gu(S).map((je,xt)=>new Promise(Pt=>setTimeout(()=>Mt.start(je,me,_/2,"ease").then(Pt),xt*$)))),ve(S,ov)}),Ke=Se(async()=>{let je=Wi(S);Ue(S,Ec),m(),Fe(Sr(S),{opacity:0}),await zl();let xt=Sr(S),Pt=Wi(S);Fe(S,"alignContent","flex-start"),Wi(S,je);let $t=Gu(S);Fe(xt,me);let ar=$t.map(async(Ir,Pr)=>{await mm(Pr*$),await Mt.start(Ir,ae,_/2,"ease")});je!==Pt&&ar.push(Mt.start(S,{height:Pt},_/2+$t.length*$,"ease")),await Promise.all(ar).then(()=>{ve(S,Ec),Q===Ul(S)&&(Fe(S,{height:"",alignContent:""}),Fe(xt,{opacity:""}),delete S.dataset.transition)})});return ke(S,ov)?pm(S).then(Ke):ke(S,Ec)?pm(S).then(_e).then(Ke):_e().then(Ke)}function Ul(m,S){return S&&(m.dataset.transition=1+Ul(m)),ee(m.dataset.transition)||0}function pm(m){return Promise.all(Sr(m).filter(Mt.inProgress).map(S=>new Promise(_=>Tr(S,"transitionend transitioncanceled",_))))}function Gu(m){return _a(Sr(m)).flat().filter(tt)}function mm(m){return new Promise(S=>setTimeout(S,m))}var sv={props:{duration:Number,animation:Boolean},data:{duration:150,animation:"slide"},methods:{animate(m,S=this.$el){let _=this.animation;return(_==="fade"?av:_==="delayed-fade"?(...Q)=>av(...Q,40):_?gN:()=>(m(),Promise.resolve()))(m,S,this.duration).catch(He)}}};let Or={TAB:9,ESC:27,SPACE:32,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40};var xN={mixins:[sv],args:"target",props:{target:String,selActive:Boolean},data:{target:"",selActive:!1,attrItem:"uk-filter-control",cls:"uk-active",duration:250},computed:{children:({target:m},S)=>an(`${m} > *`,S),toggles:({attrItem:m},S)=>an(`[${m}],[data-${m}]`,S)},watch:{toggles(m){this.updateState();let S=an(this.selActive,this.$el);for(let _ of m){this.selActive!==!1&&Je(_,this.cls,f(S,_));let $=dm(_);Qr($,"a")&&et($,"role","button")}},children(m,S){S&&this.updateState()}},events:{name:"click keydown",delegate:({attrItem:m})=>`[${m}],[data-${m}]`,handler(m){m.type==="keydown"&&m.keyCode!==Or.SPACE||m.target.closest("a,button")&&(m.preventDefault(),this.apply(m.current))}},methods:{apply(m){let S=this.getState(),_=hm(m,this.attrItem,this.getState());yN(S,_)||this.setState(_)},getState(){return this.toggles.filter(m=>ke(m,this.cls)).reduce((m,S)=>hm(S,this.attrItem,m),{filter:{"":""},sort:[]})},async setState(m,S=!0){m={filter:{"":""},sort:[],...m},Rt(this.$el,"beforeFilter",[this,m]);for(let _ of this.toggles)Je(_,this.cls,Hl(_,this.attrItem,m));await Promise.all(an(this.target,this.$el).map(_=>{let $=()=>uv(m,_,Sr(_));return S?this.animate($,_):$()})),Rt(this.$el,"afterFilter",[this])},updateState(){Vi.write(()=>this.setState(this.getState(),!1))}}};function $1(m,S){return Wu(fe(m,S),["filter"])}function yN(m,S){return["filter","sort"].every(_=>re(m[_],S[_]))}function uv(m,S,_){let $=Ac(m);for(let me of _)Fe(me,"display",$&&!tr(me,$)?"none":"");let[Q,ae]=m.sort;if(Q){let me=wN(_,Q,ae);re(me,_)||dn(S,me)}}function hm(m,S,_){let{filter:$,group:Q,sort:ae,order:me="asc"}=$1(m,S);return($||V(ae))&&(Q?$?(delete _.filter[""],_.filter[Q]=$):(delete _.filter[Q],(H(_.filter)||""in _.filter)&&(_.filter={"":$||""})):_.filter={"":$||""}),V(ae)||(_.sort=[ae,me]),_}function Hl(m,S,{filter:_={"":""},sort:[$,Q]}){let{filter:ae="",group:me="",sort:Se,order:_e="asc"}=$1(m,S);return V(Se)?me in _&&ae===_[me]||!ae&&me&&!(me in _)&&!_[""]:$===Se&&Q===_e}function Ac({filter:m}){let S="";return ye(m,_=>S+=_||""),S}function wN(m,S,_){return[...m].sort(($,Q)=>fe($,S).localeCompare(fe(Q,S),void 0,{numeric:!0})*(_==="asc"||-1))}function dm(m){return hr("a,button",m)||m}let vm;function $l(m){let S=Qt(m,"touchstart",$=>{if($.targetTouches.length!==1||tr($.target,'input[type="range"'))return;let Q=ht($).y,ae=Qt(m,"touchmove",me=>{let Se=ht(me).y;Se!==Q&&(Q=Se,Uu(me.target).some(_e=>{if(!m.contains(_e))return!1;let{scrollHeight:Ke,clientHeight:je}=_e;return je{vm=!1,S(),Fe(_,{overflowY:"",touchAction:"",paddingRight:""})}}var Wl={props:{container:Boolean},data:{container:!0},computed:{container({container:m}){return m===!0&&this.$container||m&&hr(m)}}},Co={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(S=>a(m[0],S))},methods:{async toggleElement(m,S,_){try{return await Promise.all(Z(m).map($=>{let Q=P(S)?S:!this.isToggled($);if(!Rt($,`before${Q?"show":"hide"}`,[this]))return Promise.reject();let ae=(w(_)?_:_===!1||!this.hasAnimation?Cc:this.hasTransition?Yu:Mc)($,Q,this),me=Q?this.clsEnter:this.clsLeave;Ue($,me),Rt($,Q?"show":"hide",[this]);let Se=()=>{ve($,me),Rt($,Q?"shown":"hidden",[this])};return ae?ae.then(Se,()=>(ve($,me),Promise.reject())):Se()})),!0}catch{return!1}},isToggled(m=this.$el){return m=X(m),ke(m,this.clsEnter)?!0:ke(m,this.clsLeave)?!1:this.cls?ke(m,this.cls.split(" ")[0]):tt(m)},_toggle(m,S){if(!m)return;S=!!S;let _;this.cls?(_=f(this.cls," ")||S!==ke(m,this.cls),_&&Je(m,this.cls,f(this.cls," ")?void 0:S)):(_=S===m.hidden,_&&(m.hidden=!S)),an("[autofocus]",m).some($=>tt($)?$.focus()||!0:$.blur()),_&&Rt(m,"toggled",[S,this])}}};function Cc(m,S,{_toggle:_}){return ps.cancel(m),Mt.cancel(m),_(m,S)}async function Yu(m,S,{animation:_,duration:$,velocity:Q,transition:ae,_toggle:me}){var Se;let[_e="reveal",Ke="top"]=((Se=_[0])==null?void 0:Se.split("-"))||[],je=[["left","right"],["top","bottom"]],xt=je[f(je[0],Ke)?0:1],Pt=xt[1]===Ke,ar=["width","height"][je.indexOf(xt)],Ir=`margin-${xt[0]}`,Pr=`margin-${Ke}`,pu=Zt(m)[ar],$v=Mt.inProgress(m);await Mt.cancel(m),S&&me(m,!0);let kx=Object.fromEntries(["padding","border","width","height","minWidth","minHeight","overflowY","overflowX",Ir,Pr].map(xO=>[xO,m.style[xO]])),ws=Zt(m),Um=ie(Fe(m,Ir)),dO=ie(Fe(m,Pr)),Zc=ws[ar]+dO;!$v&&!S&&(pu+=dO);let[Bx]=jp(m,"
    ");Fe(Bx,{boxSizing:"border-box",height:ws.height,width:ws.width,...Fe(m,["overflow","padding","borderTop","borderRight","borderBottom","borderLeft","borderImage",Pr])}),Fe(m,{padding:0,border:0,minWidth:0,minHeight:0,[Pr]:0,width:ws.width,height:ws.height,overflow:"hidden",[ar]:pu});let vO=pu/Zc;$=(Q*Zc+$)*(S?1-vO:vO);let gO={[ar]:S?Zc:0};Pt&&(Fe(m,Ir,Zc-pu+Um),gO[Ir]=S?Um:Zc+Um),!Pt^_e==="reveal"&&(Fe(Bx,Ir,-Zc+pu),Mt.start(Bx,{[Ir]:S?0:-Zc},$,ae));try{await Mt.start(m,gO,$,ae)}finally{Fe(m,kx),No(Bx.firstChild),S||me(m,!1)}}function Mc(m,S,_){let{animation:$,duration:Q,_toggle:ae}=_;return S?(ae(m,!0),ps.in(m,$[0],Q,_.origin)):ps.out(m,$[1]||$[0],Q,_.origin).then(()=>ae(m,!1))}let ti=[];var gm={mixins:[Gi,Wl,Co],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},S)=>hr(m,S),transitionElement(){return this.panel},bgClose({bgClose:m}){return m&&this.panel}},connected(){et(this.panel||this.$el,"role",this.role),this.overlay&&et(this.panel||this.$el,"aria-modal",!0)},beforeDisconnect(){f(ti,this)&&this.toggleElement(this.$el,!1,!1)},events:[{name:"click",delegate:({selClose:m})=>`${m},a[href*="#"]`,handler(m){let{current:S,defaultPrevented:_}=m,{hash:$}=S;!_&&$&&Ta(S)&&!this.$el.contains(hr($))?this.hide():tr(S,this.selClose)&&(m.preventDefault(),this.hide())}},{name:"toggle",self:!0,handler(m){m.defaultPrevented||(m.preventDefault(),this.isToggled()===f(ti,this)&&this.toggle())}},{name:"beforeshow",self:!0,handler(m){if(f(ti,this))return!1;!this.stack&&ti.length?(Promise.all(ti.map(S=>S.hide())).then(this.show),m.preventDefault()):ti.push(this)}},{name:"show",self:!0,handler(){this.stack&&Fe(this.$el,"zIndex",ie(Fe(this.$el,"zIndex"))+ti.length);let m=[this.overlay&&bN(this),this.overlay&&$l(this.$el),this.bgClose&&Zu(this),this.escClose&&Xu(this)];Tr(this.$el,"hidden",()=>m.forEach(S=>S&&S()),{self:!0}),Ue(document.documentElement,this.clsPage)}},{name:"shown",self:!0,handler(){Vr(this.$el)||et(this.$el,"tabindex","-1"),tr(this.$el,":focus-within")||this.$el.focus()}},{name:"hidden",self:!0,handler(){f(ti,this)&&ti.splice(ti.indexOf(this),1),Fe(this.$el,"zIndex",""),ti.some(m=>m.clsPage===this.clsPage)||ve(document.documentElement,this.clsPage)}}],methods:{toggle(){return this.isToggled()?this.hide():this.show()},show(){return this.container&&Wt(this.$el)!==this.container?(dn(this.container,this.$el),new Promise(m=>requestAnimationFrame(()=>this.show().then(m)))):this.toggleElement(this.$el,!0,lv)},hide(){return this.toggleElement(this.$el,!1,lv)}}};function lv(m,S,{transitionElement:_,_toggle:$}){return new Promise((Q,ae)=>Tr(m,"show hide",()=>{var me;(me=m._reject)==null||me.call(m),m._reject=ae,$(m,S);let Se=Tr(_,"transitionstart",()=>{Tr(_,"transitionend transitioncancel",Q,{self:!0}),clearTimeout(_e)},{self:!0}),_e=setTimeout(()=>{Se(),Q()},W1(Fe(_,"transitionDuration")))})).then(()=>delete m._reject)}function W1(m){return m?s(m,"ms")?ie(m):ie(m)*1e3:0}function bN(m){return Qt(document,"focusin",S=>{De(ti)===m&&!m.$el.contains(S.target)&&m.$el.focus()})}function Zu(m){return Qt(document,we,({target:S})=>{De(ti)!==m||m.overlay&&!m.$el.contains(S)||m.panel.contains(S)||Tr(document,`${Qe} ${pt} scroll`,({defaultPrevented:_,type:$,target:Q})=>{!_&&$===Qe&&S===Q&&m.hide()},!0)})}function Xu(m){return Qt(document,"keydown",S=>{S.keyCode===27&&De(ti)===m&&m.hide()})}var fv={slide:{show(m){return[{transform:Sn(m*-100)},{transform:Sn()}]},percent(m){return Tc(m)},translate(m,S){return[{transform:Sn(S*-100*m)},{transform:Sn(S*100*(1-m))}]}}};function Tc(m){return Math.abs(Fe(m,"transform").split(",")[4]/m.offsetWidth)}function Sn(m=0,S="%"){return m+=m?S:"",`translate3d(${m}, 0, 0)`}function Vl(m){return`scale3d(${m}, ${m}, 1)`}function DN(m,S,_,{animation:$,easing:Q}){let{percent:ae,translate:me,show:Se=He}=$,_e=Se(_),Ke;return{dir:_,show(je,xt=0,Pt){let $t=Pt?"linear":Q;return je-=Math.round(je*Oe(xt,-1,1)),this.translate(xt),xm(S,"itemin",{percent:xt,duration:je,timing:$t,dir:_}),xm(m,"itemout",{percent:1-xt,duration:je,timing:$t,dir:_}),new Promise(ar=>{Ke||(Ke=ar),Promise.all([Mt.start(S,_e[1],je,$t),Mt.start(m,_e[0],je,$t)]).then(()=>{this.reset(),Ke()},He)})},cancel(){return Mt.cancel([S,m])},reset(){for(let je in _e[0])Fe([S,m],je,"")},async forward(je,xt=this.percent()){return await this.cancel(),this.show(je,xt,!0)},translate(je){if(je===this.percent())return;this.reset();let xt=me(je,_);Fe(S,xt[1]),Fe(m,xt[0]),xm(S,"itemtranslatein",{percent:je,dir:_}),xm(m,"itemtranslateout",{percent:1-je,dir:_})},percent(){return ae(m||S,S,_)},getDistance(){return m?.offsetWidth}}}function xm(m,S,_){Rt(m,ao(S,!1,!1,_))}var di={props:{i18n:Object},data:{i18n:null},methods:{t(m,...S){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,()=>S[ae++]||""))||""}}},ri={props:{autoplay:Boolean,autoplayInterval:Number,pauseOnHover:Boolean},data:{autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0},connected(){et(this.list,"aria-live",this.autoplay?"off":"polite"),this.autoplay&&this.startAutoplay()},disconnected(){this.stopAutoplay()},update(){et(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&&tr(this.$el,":focus-within")&&!tr(this.$el,":focus")||this.pauseOnHover&&tr(this.$el,":hover")||this.show("next")},this.autoplayInterval)},stopAutoplay(){clearInterval(this.interval)}}};let $n={passive:!1,capture:!0},Wn={passive:!0,capture:!0},Oc="touchstart mousedown",cv="touchmove mousemove",Ic="touchend touchcancel mouseup click input scroll",V1=m=>m.preventDefault();var NN={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){for(let m of["start","move","end"]){let S=this[m];this[m]=_=>{let $=ht(_).x*(j?-1:1);this.prevPos=$===this.pos?this.prevPos:this.pos,this.pos=$,S(_)}}},events:[{name:Oc,passive:!0,delegate:({selList:m})=>`${m} > *`,handler(m){!this.draggable||this.parallax||!st(m)&&pv(m.target)||m.target.closest(wt)||m.button>0||this.length<2||this.start(m)}},{name:"dragstart",handler(m){m.preventDefault()}},{name:cv,el:({list:m})=>m,handler:He,...$n}],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,Qt(document,cv,this.move,$n),Qt(document,Ic,this.end,Wn),Fe(this.list,"userSelect","none")},move(m){let S=this.pos-this.drag;if(S===0||this.prevPos===this.pos||!this.dragging&&Math.abs(S)me;)this.drag-=me*this.dir,$=ae,Q-=me,ae=this.getIndex($+this.dir),me=G1.call(this,$,ae);this.percent=Q/me;let Se=_[$],_e=_[ae],Ke=this.index!==ae,je=$===ae,xt;for(let Pt of[this.index,this.prevIndex])f([ae,$],Pt)||(Rt(_[Pt],"itemhidden",[this]),je&&(xt=!0,this.prevIndex=$));(this.index===$&&this.prevIndex!==$||xt)&&Rt(_[this.index],"itemshown",[this]),Ke&&(this.prevIndex=$,this.index=ae,je||(Rt(Se,"beforeitemhide",[this]),Rt(Se,"itemhide",[this])),Rt(_e,"beforeitemshow",[this]),Rt(_e,"itemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),Se,!je&&_e)},end(){if($i(document,cv,this.move,$n),$i(document,Ic,this.end,Wn),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(()=>$i(this.list,"click",V1,$n)),Fe(this.list,{userSelect:""}),this.drag=this.percent=null}}};function G1(m,S){return this._getTransitioner(m,m!==S&&S).getDistance()||this.slides[m].offsetWidth}function pv(m){return Fe(m,"userSelect")!=="none"&&y(m.childNodes).some(S=>S.nodeType===3&&S.textContent.trim())}function Y1(m){m._watches=[];for(let S of m.$options.watch||[])for(let[_,$]of Object.entries(S))ym(m,$,_);m._initial=!0}function ym(m,S,_){m._watches.push({name:_,...b(S)?S:{handler:S}})}function SN(m,S){for(let{name:_,handler:$,immediate:Q=!0}of m._watches)(m._initial&&Q||r(S,_)&&!re(S[_],m[_]))&&$.call(m,m[_],S[_]);m._initial=!1}function mv(m){let{computed:S}=m.$options;if(m._computed={},S)for(let _ in S)hv(m,_,S[_])}let wm={subtree:!0,childList:!0};function hv(m,S,_){m._hasComputed=!0,Object.defineProperty(m,S,{enumerable:!0,get(){let{_computed:$,$props:Q,$el:ae}=m;if(!r($,S)&&($[S]=(_.get||_).call(m,Q,ae),_.observe&&m._computedObserver)){let me=_.observe.call(m,Q);m._computedObserver.observe(["~","+","-"].includes(me[0])?ae.parentElement:ae.getRootNode(),wm)}return $[S]},set($){let{_computed:Q}=m;Q[S]=_.set?_.set.call(m,$):$,V(Q[S])&&delete Q[S]}})}function Z1(m){m._hasComputed&&(nv(m,{read:()=>SN(m,vv(m)),events:["resize","computed"]}),m._computedObserver=Xd(m.$el,()=>Dc(m,"computed"),wm))}function dv(m){var S;(S=m._computedObserver)==null||S.disconnect(),delete m._computedObserver,vv(m)}function vv(m){let S={...m._computed};return m._computed={},S}function Fc(m){m._events=[];for(let S of m.$options.events||[])if(r(S,"handler"))_c(m,S);else for(let _ in S)_c(m,S[_],_)}function EN(m){m._events.forEach(S=>S()),delete m._events}function _c(m,S,_){let{name:$,el:Q,handler:ae,capture:me,passive:Se,delegate:_e,filter:Ke,self:je}=b(S)?S:{name:_,handler:S};Q=w(Q)?Q.call(m,m):Q||m.$el,!(!Q||h(Q)&&!Q.length||Ke&&!Ke.call(m,m))&&m._events.push(Qt(Q,$,_e?R(_e)?_e:_e.call(m,m):null,R(ae)?m[ae]:ae.bind(m),{passive:Se,capture:me,self:je}))}function gs(m){m._observers=[];for(let S of m.$options.observe||[])X1(m,S)}function gv(m,...S){m._observers.push(...S)}function AN(m){for(let S of m._observers)S.disconnect()}function X1(m,S){let{observe:_,target:$=m.$el,handler:Q,options:ae,filter:me,args:Se}=S;if(me&&!me.call(m,m))return;let _e=`_observe${m._observers.length}`;w($)&&!r(m,_e)&&hv(m,_e,()=>$.call(m,m)),Q=R(Q)?m[Q]:Q.bind(m),w(ae)&&(ae=ae.call(m,m));let Ke=r(m,_e)?m[_e]:$,je=_(Ke,Q,ae,Se);w($)&&h(m[_e])&&ym(m,{handler:Mo(je,ae),immediate:!1},_e),gv(m,je)}function Mo(m,S){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,S)}}function kr(m){let{$options:S,$props:_}=m,$=Ro(S);N(_,$);let{computed:Q,methods:ae}=S;for(let me in _)me in $&&(!Q||!r(Q,me))&&(!ae||!r(ae,me))&&(m[me]=_[me])}function Ro(m){let S={},{args:_=[],props:$={},el:Q,id:ae}=m;if(!$)return S;for(let Se in $){let _e=i(Se),Ke=fe(Q,_e);V(Ke)||(Ke=$[Se]===Boolean&&Ke===""?!0:bc($[Se],Ke),!(_e==="target"&&a(Ke,"_"))&&(S[Se]=Ke))}let me=Wu(fe(Q,ae),_);for(let Se in me){let _e=u(Se);V($[_e])||(S[_e]=bc($[_e],me[Se]))}return S}let ou=be((m,S)=>{let _=Object.keys(S),$=_.concat(m).map(Q=>[i(Q),`data-${i(Q)}`]).flat();return{attributes:_,filter:$}});function au(m){let{$options:S,$props:_}=m,{id:$,props:Q,el:ae}=S;if(!Q)return;let{attributes:me,filter:Se}=ou($,Q),_e=new MutationObserver(Ke=>{let je=Ro(S);Ke.some(({attributeName:xt})=>{let Pt=xt.replace("data-","");return(Pt===$?me:[u(Pt),u(xt)]).some($t=>!V(je[$t])&&je[$t]!==_[$t])})&&m.$reset()});_e.observe(ae,{attributes:!0,attributeFilter:Se}),gv(m,_e)}function Ku(m,S){var _;(_=m.$options[S])==null||_.forEach($=>$.call(m))}function kc(m){m._connected||(kr(m),Ku(m,"beforeConnect"),m._connected=!0,Fc(m),U1(m),Y1(m),gs(m),au(m),Z1(m),Ku(m,"connected"),Dc(m))}function bm(m){m._connected&&(Ku(m,"beforeDisconnect"),EN(m),dN(m),AN(m),dv(m),Ku(m,"disconnected"),m._connected=!1)}let CN=0;function Dm(m,S={}){S.data=xv(S,m.constructor.options),m.$options=Yi(m.constructor.options,S,m),m.$props={},m._uid=CN++,Bc(m),K1(m),mv(m),Ku(m,"created"),S.el&&m.$mount(S.el)}function Bc(m){let{data:S={}}=m.$options;for(let _ in S)m.$props[_]=m[_]=S[_]}function K1(m){let{methods:S}=m.$options;if(S)for(let _ in S)m[_]=S[_].bind(m)}function xv({data:m={}},{args:S=[],props:_={}}){h(m)&&(m=m.slice(0,S.length).reduce(($,Q,ae)=>(b(Q)?N($,Q):$[S[ae]]=Q,$),{}));for(let $ in m)V(m[$])?delete m[$]:_[$]&&(m[$]=bc(_[$],m[$]));return m}let Vn=function(m){Dm(this,m)};Vn.util=P1,Vn.options={},Vn.version="3.20.10";let J1="uk-",su="__uikit__",Gl={};function Lc(m,S){var _,$;let Q=J1+i(m);if(!S)return Gl[Q].options||(Gl[Q]=Vn.extend(Gl[Q])),Gl[Q];m=u(m),Vn[m]=(me,Se)=>Ju(m,me,Se);let ae=(_=S.options)!=null?_:{...S};return ae.id=Q,ae.name=m,($=ae.install)==null||$.call(ae,Vn,ae,m),Vn._initialized&&!ae.functional&&requestAnimationFrame(()=>Ju(m,`[${Q}],[data-${Q}]`)),Gl[Q]=ae}function Ju(m,S,_,...$){let Q=Lc(m);return Q.options.functional?new Q({data:b(S)?S:[S,_,...$]}):S?jn(S).map(ae)[0]:ae();function ae(me){let Se=Nm(me,m);if(Se)if(_)Se.$destroy();else return Se;return new Q({el:me,data:_})}}function Yl(m){return m?.[su]||{}}function Nm(m,S){return Yl(m)[S]}function Q1(m,S){m[su]||(m[su]={}),m[su][S.$options.name]=S}function MN(m,S){var _;(_=m[su])==null||delete _[S.$options.name],H(m[su])&&delete m[su]}function TN(m){m.component=Lc,m.getComponents=Yl,m.getComponent=Nm,m.update=Pc,m.use=function(_){if(!_.installed)return _.call(null,this),_.installed=!0,this},m.mixin=function(_,$){$=(R($)?this.component($):$)||this,$.options=Yi($.options,_)},m.extend=function(_){_||(_={});let $=this,Q=function(me){Dm(this,me)};return Q.prototype=Object.create($.prototype),Q.prototype.constructor=Q,Q.options=Yi($.options,_),Q.super=$,Q.extend=$.extend,Q};let S;Object.defineProperty(m,"container",{get(){return S||document.body},set(_){S=hr(_)}})}function Pc(m,S){m=m?X(m):document.body;for(let _ of no(m).reverse())yv(_,S);So(m,_=>yv(_,S))}function yv(m,S){let _=Yl(m);for(let $ in _)Dc(_[$],S)}function ON(m){m.prototype.$mount=function(S){let _=this;Q1(S,_),_.$options.el=S,document.contains(S)&&kc(_)},m.prototype.$destroy=function(S=!1){let _=this,{el:$}=_.$options;$&&bm(_),Ku(_,"destroy"),MN($,_),S&&Do(_.$el)},m.prototype.$create=Ju,m.prototype.$emit=function(S){Dc(this,S)},m.prototype.$update=function(S=this.$el,_){Pc(S,_)},m.prototype.$reset=function(){bm(this),kc(this)},m.prototype.$getComponent=Nm,Object.defineProperties(m.prototype,{$el:{get(){return this.$options.el}},$container:Object.getOwnPropertyDescriptor(m,"container")})}let IN=1;function uu(m,S=null){return S?.id||`${m.$options.id}-${IN++}`}var Zl={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},S)=>hr(m,S),navChildren(){return Sr(this.nav)},selNavItem:({attrItem:m})=>`[${m}],[data-${m}]`,navItems(m,S){return an(this.selNavItem,S)}},watch:{nav(m,S){et(m,"role","tablist"),S&&this.$emit()},list(m){Qr(m,"ul")&&et(m,"role","presentation")},navChildren(m){et(m,"role","presentation")},navItems(m){for(let S of m){let _=fe(S,this.attrItem),$=hr("a,button",S)||S,Q,ae=null;if(z(_)){let me=ee(_),Se=this.slides[me];Se&&(Se.id||(Se.id=uu(this,Se)),ae=Se.id),Q=this.t("slideX",ie(_)+1),et($,"role","tab")}else this.list&&(this.list.id||(this.list.id=uu(this,this.list)),ae=this.list.id),Q=this.t(_);et($,{"aria-controls":ae,"aria-label":et($,"aria-label")||Q})}},slides(m){m.forEach((S,_)=>et(S,{role:this.nav?"tabpanel":"group","aria-label":this.t("slideLabel",_+1,this.length),"aria-roledescription":this.nav?null:"slide"}))},length(m){let S=this.navChildren.length;if(this.nav&&m!==S){lc(this.nav);for(let _=0;_
  • `)}}},connected(){et(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===Or.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:S,keyCode:_}=m,$=fe(S,this.attrItem);if(!z($))return;let Q=_===Or.HOME?0:_===Or.END?"last":_===Or.LEFT?"previous":_===Or.RIGHT?"next":-1;~Q&&(m.preventDefault(),this.show(Q))}}],methods:{updateNav(){let m=this.getValidIndex();for(let S of this.navItems){let _=fe(S,this.attrItem),$=hr("a,button",S)||S;if(z(_)){let ae=ee(_)===m;Je(S,this.clsActive,ae),Je($,"uk-disabled",this.parallax),et($,{"aria-selected":ae,tabindex:ae&&!this.parallax?null:-1}),ae&&$&&tr(Wt(S),":focus-within")&&$.focus()}else Je(S,"uk-invisible",this.finite&&(_==="previous"&&m===0||_==="next"&&m>=this.maxIndex))}}}},Sm={mixins:[ri,NN,Zl,di],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(){ve(this.slides,this.clsActive)},computed:{duration:({velocity:m},S)=>wv(S.offsetWidth/m),list:({selList:m},S)=>hr(m,S),maxIndex(){return this.length-1},slides(){return Sr(this.list)},length(){return this.slides.length}},watch:{slides(m,S){S&&this.$emit()}},events:{itemshow({target:m}){Ue(m,this.clsEnter,this.clsSlideActive)},itemshown({target:m}){ve(m,this.clsEnter)},itemhide({target:m}){Ue(m,this.clsLeave)},itemhidden({target:m}){ve(m,this.clsLeave,this.clsSlideActive)}},methods:{show(m,S=!1){var _;if(this.dragging||!this.length||this.parallax)return;let{stack:$}=this,Q=S?0:$.length,ae=()=>{$.splice(Q,1),$.length&&this.show($.shift(),!0)};if($[S?"unshift":"push"](m),!S&&$.length>1){$.length===2&&((_=this._transitioner)==null||_.forward(Math.min(this.duration,200)));return}let me=this.getIndex(this.index),Se=ke(this.slides,this.clsActive)&&this.slides[me],_e=this.getIndex(m,this.index),Ke=this.slides[_e];if(Se===Ke){ae();return}if(this.dir=Em(m,me),this.prevIndex=me,this.index=_e,Se&&!Rt(Se,"beforeitemhide",[this])||!Rt(Ke,"beforeitemshow",[this,Se])){this.index=this.prevIndex,ae();return}let je=this._show(Se,Ke,S).then(()=>{Se&&Rt(Se,"itemhidden",[this]),Rt(Ke,"itemshown",[this]),$.shift(),this._transitioner=null,$.length&&requestAnimationFrame(()=>$.length&&this.show($.shift(),!0))});return Se&&Rt(Se,"itemhide",[this]),Rt(Ke,"itemshow",[this]),je},getIndex(m=this.index,S=this.index){return Oe(de(m,this.slides,S,this.finite),0,Math.max(0,this.maxIndex))},getValidIndex(m=this.index,S=this.prevIndex){return this.getIndex(m,S)},async _show(m,S,_){if(this._transitioner=this._getTransitioner(m,S,this.dir,{easing:_?S.offsetWidth<600?"cubic-bezier(0.25, 0.46, 0.45, 0.94)":"cubic-bezier(0.165, 0.84, 0.44, 1)":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,S=this.prevIndex,_=this.index){let $=this._getTransitioner(S===_?!1:S,_);return $.translate(m),$},_getTransitioner(m=this.prevIndex,S=this.index,_=this.dir||1,$=this.transitionOptions){return new this.Transitioner(q(m)?this.slides[m]:m,q(S)?this.slides[S]:S,_*(j?-1:1),$)}}};function Em(m,S){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:bv,template:'
    '}),created(){let m=hr(this.template),S=hr(this.selList,m);this.items.forEach(()=>dn(S,"
  • "));let _=hr("[uk-close]",m),$=this.t("close");_&&$&&(_.dataset.i18n=JSON.stringify({label:$})),this.$mount(dn(this.container,m))},computed:{caption:({selCaption:m},S)=>hr(m,S)},events:[{name:`${Le} ${we} 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(),ve(this.slides,this.clsActive),Mt.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 S=-1;m===Or.LEFT?S="previous":m===Or.RIGHT?S="next":m===Or.HOME?S=0:m===Or.END&&(S="last"),~S&&this.show(S)}},{name:"beforeitemshow",handler(m){this.isToggled()||(this.draggable=!1,m.preventDefault(),this.toggleElement(this.$el,!0,!1),this.animation=bv.scale,ve(m.target,this.clsActive),this.stack.splice(1,0,this.index))}},{name:"itemshow",handler(){Qs(this.caption,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,S){let{source:_,type:$,alt:Q="",poster:ae,attrs:me={}}=S;if(this.setItem(S,""),!_)return;let Se,_e={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 Ke=Xl("img",{src:_,alt:Q,...me});Qt(Ke,"load",()=>this.setItem(S,Ke)),Qt(Ke,"error",()=>this.setError(S))}else if($==="video"||_.match(/\.(mp4|webm|ogv)($|\?)/i)){let Ke=Xl("video",{src:_,poster:ae,controls:"",playsinline:"","uk-video":`${this.videoAutoplay}`,...me});Qt(Ke,"loadedmetadata",()=>this.setItem(S,Ke)),Qt(Ke,"error",()=>this.setError(S))}else if($==="iframe"||_.match(/\.(html|php)($|\?)/i))this.setItem(S,Xl("iframe",{src:_,allowfullscreen:"",class:"uk-lightbox-iframe",...me}));else if(Se=_.match(/\/\/(?:.*?youtube(-nocookie)?\..*?(?:[?&]v=|\/shorts\/)|youtu\.be\/)([\w-]{11})[&?]?(.*)?/))this.setItem(S,Xl("iframe",{src:`https://www.youtube${Se[1]||""}.com/embed/${Se[2]}${Se[3]?`?${Se[3]}`:""}`,width:1920,height:1080,..._e,...me}));else if(Se=_.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/))try{let{height:Ke,width:je}=await(await fetch(`https://vimeo.com/api/oembed.json?maxwidth=1920&url=${encodeURI(_)}`,{credentials:"omit"})).json();this.setItem(S,Xl("iframe",{src:`https://player.vimeo.com/video/${Se[1]}${Se[2]?`?${Se[2]}`:""}`,width:je,height:Ke,..._e,...me}))}catch{this.setError(S)}}}],methods:{loadItem(m=this.index){let S=this.getItem(m);this.getSlide(S).childElementCount||Rt(this.$el,"itemload",[S])},getItem(m=this.index){return this.items[de(m,this.slides)]},setItem(m,S){Rt(this.$el,"itemloaded",[this,Qs(this.getSlide(m),S)])},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(){ve(this.$el,"uk-active","uk-transition-active")}}};function Xl(m,S){let _=Ru(`<${m}>`);return et(_,S),_}var vi={install:Cm,props:{toggle:String},data:{toggle:"a"},computed:{toggles:({toggle:m},S)=>an(m,S)},watch:{toggles(m){this.hide();for(let S of m)Qr(S,"a")&&et(S,"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 S=Pe(this.toggles.map(Dv),"source");if(F(m)){let{source:_}=Dv(m);m=p(S,({source:$})=>_===$)}return this.panel=this.panel||this.$create("lightboxPanel",{...this.$props,items:S}),Qt(this.panel.$el,"hidden",()=>this.panel=null),this.panel.show(m)},hide(){var m;return(m=this.panel)==null?void 0:m.hide()}}};function Cm(m,S){m.lightboxPanel||m.component("lightboxPanel",j1),N(S.props,m.component("lightboxPanel").options.props)}function Dv(m){let S={};for(let _ of["href","caption","type","poster","alt","attrs"])S[_==="href"?"source":_]=fe(m,_);return S.attrs=Wu(S.attrs),S}var ex={mixins:[Wl],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:tx,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}`,S=`data-${this.clsContainer}-container`,_=hr(`.${m}[${S}]`,this.container)||dn(this.container,`
    `);this.$mount(dn(_,``))},async connected(){let m=ie(Fe(this.$el,this.marginProp));await Mt.start(Fe(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()},[it](){this.timer&&clearTimeout(this.timer)},[Xe](){this.timeout&&(this.timer=setTimeout(this.close,this.timeout))}},methods:{async close(m){let S=_=>{let $=Wt(_);Rt(_,"close",[this]),Do(_),$?.hasChildNodes()||Do($)};this.timer&&clearTimeout(this.timer),m||await Mt.start(this.$el,this.startProps),S(this.$el)}}};function tx(m){m.notification.closeAll=function(S,_){So(document.body,$=>{let Q=m.getComponent($,"notification");Q&&(!S||S===Q.group)&&Q.close(_)})}}var xs={props:{media:Boolean},data:{media:!1},connected(){let m=Mm(this.media,this.$el);if(this.matchMedia=!0,m){this.mediaObj=window.matchMedia(m);let S=()=>{this.matchMedia=this.mediaObj.matches,Rt(this.$el,ao("mediachange",!1,!0,[this.mediaObj]))};this.offMediaObj=Qt(this.mediaObj,"change",()=>{S(),this.$emit("resize")}),S()}},disconnected(){var m;(m=this.offMediaObj)==null||m.call(this)}};function Mm(m,S){if(R(m)){if(a(m,"@"))m=ie(Fe(S,`--uk-breakpoint-${m.substr(1)}`));else if(isNaN(m))return m}return m&&z(m)?`(min-width: ${m}px)`:""}function Nv(m){return tt(m)?Math.ceil(Math.max(0,...an("[stroke]",m).map(S=>S.getTotalLength()))):0}let Rc={x:qc,y:qc,rotate:qc,scale:qc,color:Kl,backgroundColor:Kl,borderColor:Kl,blur:ua,hue:ua,fopacity:ua,grayscale:ua,invert:ua,saturate:ua,sepia:ua,opacity:FN,stroke:Jl,bgx:Ev,bgy:Ev},{keys:Sv}=Object;var Qu={mixins:[xs],props:Mv(Sv(Rc),"list"),data:Mv(Sv(Rc),void 0),computed:{props(m,S){let _={};for(let Q in m)Q in Rc&&!V(m[Q])&&(_[Q]=m[Q].slice());let $={};for(let Q in _)$[Q]=Rc[Q](Q,S,_[Q],_);return $}},events:{load(){this.$emit()}},methods:{reset(){for(let m in this.getCss(0))Fe(this.$el,m,"")},getCss(m){let S={};for(let _ in this.props)this.props[_](S,Oe(m));return S.willChange=Object.keys(S).map(Ar).join(","),S}}};function qc(m,S,_){let $=fu(_)||{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 me;return fu([ae])?ei(ae,"width",S,!0)/S[`offset${(me=ae.endsWith)!=null&&me.call(ae,"vh")?"Height":"Width"}`]:ie(ae)}),_.length===1&&_.unshift(m==="scale"?1:0),_=ef(_,Q),(ae,me)=>{ae.transform=`${ae.transform||""} ${m}(${qo(_,me)}${$})`}}function Kl(m,S,_){return _.length===1&&_.unshift(Uc(S,m,"")),_=ef(_,$=>rx(S,$)),($,Q)=>{let[ae,me,Se]=Cv(_,Q),_e=ae.map((Ke,je)=>(Ke+=Se*(me[je]-Ke),je===3?ie(Ke):parseInt(Ke,10))).join(",");$[m]=`rgba(${_e})`}}function rx(m,S){return Uc(m,"color",S).split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(ie)}function ua(m,S,_){_.length===1&&_.unshift(0);let $=fu(_)||{blur:"px",hue:"deg"}[m]||"%";return m={fopacity:"opacity",hue:"hue-rotate"}[m]||m,_=ef(_),(Q,ae)=>{let me=qo(_,ae);Q.filter=`${Q.filter||""} ${m}(${me+$})`}}function FN(m,S,_){return _.length===1&&_.unshift(Uc(S,m,"")),_=ef(_),($,Q)=>{$[m]=qo(_,Q)}}function Jl(m,S,_){_.length===1&&_.unshift(0);let $=fu(_),Q=Nv(S);return _=ef(_.reverse(),ae=>(ae=ie(ae),$==="%"?ae*Q/100:ae)),_.some(([ae])=>ae)?(Fe(S,"strokeDasharray",Q),(ae,me)=>{ae.strokeDashoffset=qo(_,me)}):He}function Ev(m,S,_,$){_.length===1&&_.unshift(0);let Q=m==="bgy"?"height":"width";$[m]=ef(_,Se=>ei(Se,Q,S));let ae=["bgx","bgy"].filter(Se=>Se in $);if(ae.length===2&&m==="bgx")return He;if(Uc(S,"backgroundSize","")==="cover")return nx(m,S,_,$);let me={};for(let Se of ae)me[Se]=Av(S,Se);return Ql(ae,me,$)}function nx(m,S,_,$){let Q=zc(S);if(!Q.width)return He;let ae={width:S.offsetWidth,height:S.offsetHeight},me=["bgx","bgy"].filter(je=>je in $),Se={};for(let je of me){let xt=$[je].map(([Pr])=>Pr),Pt=Math.min(...xt),$t=Math.max(...xt),ar=xt.indexOf(Pt){Ke(je,xt),je.backgroundSize=`${_e.width}px ${_e.height}px`,je.backgroundRepeat="no-repeat"}}function Av(m,S){return Uc(m,`background-position-${S.substr(-1)}`,"")}function Ql(m,S,_){return function($,Q){for(let ae of m){let me=qo(_[ae],Q);$[`background-position-${ae.substr(-1)}`]=`calc(${S[ae]} + ${me}px)`}}}let jl={},lu={};function zc(m){let S=Fe(m,"backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/,"$1");if(lu[S])return lu[S];let _=new Image;return S&&(_.src=S,!_.naturalWidth&&!jl[S])?(Tr(_,"error load",()=>{lu[S]=Tm(_),Rt(m,ao("load",!1))}),jl[S]=!0,Tm(_)):lu[S]=Tm(_)}function Tm(m){return{width:m.naturalWidth,height:m.naturalHeight}}function ef(m,S=ie){let _=[],{length:$}=m,Q=0;for(let ae=0;ae<$;ae++){let[me,Se]=R(m[ae])?m[ae].trim().split(/ (?![^(]*\))/):[m[ae]];if(me=S(me),Se=Se?ie(Se)/100:null,ae===0?Se===null?Se=0:Se&&_.push([me,0]):ae===$-1&&(Se===null?Se=1:Se!==1&&(_.push([me,Se]),Se=1)),_.push([me,Se]),Se===null)Q++;else if(Q){let _e=_[ae-Q-1][1],Ke=(Se-_e)/(Q+1);for(let je=Q;je>0;je--)_[ae-je][1]=_e+Ke*(Q-je+1);Q=0}}return _}function Cv(m,S){let _=p(m.slice(1),([,$])=>S<=$)+1;return[m[_-1][0],m[_][0],(S-m[_-1][1])/(m[_][1]-m[_-1][1])]}function qo(m,S){let[_,$,Q]=Cv(m,S);return _+Math.abs(_-$)*Q*(_<$?1:-1)}let tf=/^-?\d+(?:\.\d+)?(\S+)?/;function fu(m,S){var _;for(let $ of m){let Q=(_=$.match)==null?void 0:_.call($,tf);if(Q)return Q[1]}return S}function Uc(m,S,_){let $=m.style[S],Q=Fe(Fe(m,S,_),S);return m.style[S]=$,Q}function Mv(m,S){return m.reduce((_,$)=>(_[$]=S,_),{})}function ix(m,S){return S>=0?Math.pow(m,S+1):1-Math.pow(1-m,1-S)}var _N={mixins:[Qu],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},S)=>ox(m&&zn(m,S)||S),start({start:m}){return ei(m,"height",this.target,!0)},end({end:m,viewport:S}){return ei(m||(S=(1-S)*100)&&`${S}vh+${S}%`,"height",this.target,!0)}},observe:[Nc(),Rl({target:({target:m})=>m}),si({target:({$el:m,target:S})=>[m,S,hs(S,!0)]})],update:{read({percent:m},S){if(S.has("scroll")||(m=!1),!tt(this.$el))return!1;if(!this.matchMedia)return;let _=m;return m=ix(om(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&&Fe(this.$el,m)},events:["scroll","resize"]}};function ox(m){return m?"offsetTop"in m?m:ox(Wt(m)):document.documentElement}var Oi={props:{parallax:Boolean,parallaxTarget:Boolean,parallaxStart:String,parallaxEnd:String,parallaxEasing:Number},data:{parallax:!1,parallaxTarget:!1,parallaxStart:0,parallaxEnd:0,parallaxEasing:0},observe:[si({target:({$el:m,parallaxTarget:S})=>[m,S],filter:({parallax:m})=>m}),Rl({filter:({parallax:m})=>m})],computed:{parallaxTarget({parallaxTarget:m},S){return m&&zn(m,S)||this.list}},update:{read(){if(!this.parallax)return!1;let m=this.parallaxTarget,S=ei(this.parallaxStart,"height",m,!0),_=ei(this.parallaxEnd,"height",m,!0),$=ix(om(m,S,_),this.parallaxEasing);return{parallax:this.getIndexAt($)}},write({parallax:m}){let[S,_]=m,$=this.getValidIndex(S+Math.ceil(_)),Q=this.slides[S],ae=this.slides[$],{triggerShow:me,triggerShown:Se,triggerHide:_e,triggerHidden:Ke}=ax(this);if(~this.prevIndex)for(let xt of new Set([this.index,this.prevIndex]))f([$,S],xt)||(_e(this.slides[xt]),Ke(this.slides[xt]));let je=this.prevIndex!==S||this.index!==$;this.dir=1,this.prevIndex=S,this.index=$,Q!==ae&&_e(Q),me(ae),je&&Se(Q),this._translate(Q===ae?1:_,Q,ae)},events:["scroll","resize"]},methods:{getIndexAt(m){let S=m*(this.length-1);return[Math.floor(S),S%1]}}};function ax(m){let{clsSlideActive:S,clsEnter:_,clsLeave:$}=m;return{triggerShow:Q,triggerShown:ae,triggerHide:me,triggerHidden:Se};function Q(_e){ke(_e,$)&&(me(_e),Se(_e)),ke(_e,S)||(Rt(_e,"beforeitemshow",[m]),Rt(_e,"itemshow",[m]))}function ae(_e){ke(_e,_)&&Rt(_e,"itemshown",[m])}function me(_e){ke(_e,S)||Q(_e),ke(_e,_)&&ae(_e),ke(_e,$)||(Rt(_e,"beforeitemhide",[m]),Rt(_e,"itemhide",[m]))}function Se(_e){ke(_e,$)&&Rt(_e,"itemhidden",[m])}}var sx={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,this.prevIndex,this.index)},events:["resize"]}},ux={observe:Pl({target:({slides:m})=>m,targets:m=>m.getAdjacentSlides()}),methods:{getAdjacentSlides(){return[1,-1].map(m=>this.slides[this.getIndex(this.index+m)])}}};function kN(m,S,_,{center:$,easing:Q,list:ae}){let me=m?rf(m,ae,$):rf(S,ae,$)+Zt(S).width*_,Se=S?rf(S,ae,$):me+Zt(m).width*_*(j?-1:1),_e;return{dir:_,show(Ke,je=0,xt){let Pt=xt?"linear":Q;return Ke-=Math.round(Ke*Oe(je,-1,1)),Fe(ae,"transitionProperty","none"),this.translate(je),Fe(ae,"transitionProperty",""),je=m?je:Oe(je,0,1),ka(this.getItemIn(),"itemin",{percent:je,duration:Ke,timing:Pt,dir:_}),m&&ka(this.getItemIn(!0),"itemout",{percent:1-je,duration:Ke,timing:Pt,dir:_}),new Promise($t=>{_e||(_e=$t),Mt.start(ae,{transform:Sn(-Se*(j?-1:1),"px")},Ke,Pt).then(_e,He)})},cancel(){return Mt.cancel(ae)},reset(){Fe(ae,"transform","")},async forward(Ke,je=this.percent()){return await this.cancel(),this.show(Ke,je,!0)},translate(Ke){if(Ke===this.percent())return;let je=this.getDistance()*_*(j?-1:1);Fe(ae,"transform",Sn(Oe(-Se+(je-je*Ke),-ju(ae),Zt(ae).width)*(j?-1:1),"px"));let xt=this.getActives(),Pt=this.getItemIn(),$t=this.getItemIn(!0);Ke=m?Oe(Ke,-1,1):0;for(let ar of Sr(ae)){let Ir=f(xt,ar),Pr=ar===Pt,pu=ar===$t,$v=Pr||!pu&&(Ir||_*(j?-1:1)===-1^Om(ar,ae)>Om(m||S));ka(ar,`itemtranslate${$v?"in":"out"}`,{dir:_,percent:pu?1-Ke:Pr?Ke:Ir?1:0})}},percent(){return Math.abs((Fe(ae,"transform").split(",")[4]*(j?-1:1)+me)/(Se-me))},getDistance(){return Math.abs(Se-me)},getItemIn(Ke=!1){let je=this.getActives(),xt=lx(ae,rf(S||m,ae,$));if(Ke){let Pt=je;je=xt,xt=Pt}return xt[p(xt,Pt=>!f(je,Pt))]},getActives(){return lx(ae,rf(m||S,ae,$))}}}function rf(m,S,_){let $=Om(m,S);return _?$-BN(m,S):Math.min($,Tv(S))}function Tv(m){return Math.max(0,ju(m)-Zt(m).width)}function ju(m,S){return Ne(Sr(m).slice(0,S),_=>Zt(_).width)}function BN(m,S){return Zt(S).width/2-Zt(m).width/2}function Om(m,S){return m&&($d(m).left+(j?Zt(m).width-Zt(S).width:0))*(j?-1:1)||0}function lx(m,S){S-=1;let _=Zt(m).width,$=S+_+2;return Sr(m).filter(Q=>{let ae=Om(Q,m),me=ae+Math.min(Zt(Q).width,_);return ae>=S&&me<=$})}function ka(m,S,_){Rt(m,ao(S,!1,!1,_))}var Hc={mixins:[Gi,Sm,sx,Oi,ux],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:kN},computed:{finite({finite:m}){return m||Im(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,S=Tv(this.list),_=p(this.slides,$=>{if(m>=S)return!0;m+=Zt($).width});return~_?_:this.length-1},sets({sets:m}){if(!m||this.parallax)return;let S=0,_=[],$=Zt(this.list).width;for(let Q=0;Q$&&(S=0),this.center?S<$/2&&S+ae+Zt(this.slides[de(+Q+1,this.slides)]).width/2>$/2&&(_.push(+Q),S=$/2-ae/2):S===0&&_.push(Math.min(+Q,this.maxIndex)),S+=ae}if(_.length)return _},transitionOptions(){return{center:this.center,list:this.list}},slides(){return Sr(this.list).filter(tt)}},connected(){Je(this.$el,this.clsContainer,!hr(`.${this.clsContainer}`,this.$el))},observe:si({target:({slides:m,$el:S})=>[S,...m]}),update:{write(){for(let m of this.navItems){let S=ee(fe(m,this.attrItem));S!==!1&&(m.hidden=!this.maxIndex||S>this.maxIndex||this.sets&&!f(this.sets,S))}this.reorder(),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 S=Math.abs(this.index-this.prevIndex+(this.dir>0&&this.indexthis.prevIndex?(this.maxIndex+1)*this.dir:0));if(!this.dragging&&S>1){for(let Q=0;Q0?"next":"previous");m.preventDefault();return}let _=this.dir<0||!this.slides[this.prevIndex]?this.index:this.prevIndex,$=ju(this.list)/this.length;this.duration=wv($/this.velocity)*(Zt(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){Fe(this.slides,"order","");return}let m=this.dir>0&&this.slides[this.prevIndex]?this.prevIndex:this.index;if(this.slides.forEach((Q,ae)=>Fe(Q,"order",this.dir>0&&ae=this.index?-1:"")),!this.center||!this.length)return;let S=this.slides[m],_=Zt(this.list).width/2-Zt(S).width/2,$=0;for(;_>0;){let Q=this.getIndex(--$+m,m),ae=this.slides[Q];Fe(ae,"order",Q>m?-2:-1),_-=Zt(ae).width}},updateActiveClasses(m=this.index){let S=this._getTransitioner(m).getActives();this.active!=="all"&&(S=[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(S,$);Je($,_,Q),et($,"aria-hidden",!Q);for(let ae of an(ur,$))r(ae,"_tabindex")||(ae._tabindex=et(ae,"tabindex")),et(ae,"tabindex",Q?ae._tabindex:-1)}},getValidIndex(m=this.index,S=this.prevIndex){if(m=this.getIndex(m,S),!this.sets)return m;let _;do{if(f(this.sets,m))return m;_=m,m=this.getIndex(m+this.dir,S)}while(m!==_);return m},getAdjacentSlides(){let{width:m}=Zt(this.list),S=-m,_=m*2,$=Zt(this.slides[this.index]).width,Q=this.center?m/2-$/2:0,ae=new Set;for(let me of[-1,1]){let Se=Q+(me>0?$:0),_e=0;do{let Ke=this.slides[this.getIndex(this.index+me+_e++*me)];Se+=Zt(Ke).width*me,ae.add(Ke)}while(this.length>_e&&Se>S&&Se<_)}return Array.from(ae)},getIndexAt(m){let S=-1,_=this.center?ju(this.list)-(Zt(this.slides[0]).width/2+Zt(De(this.slides)).width/2):ju(this.list,this.maxIndex),$=m*_,Q=0;do{let ae=Zt(this.slides[++S]).width,me=this.center?ae/2+Zt(this.slides[S+1]).width/2:ae;Q=$/me%1,$-=me}while($>=0&&SNe($.filter(je=>!_e.has(je)),je=>Zt(je).width))return!0}return!1}function $c(m){return Math.max(0,...Sr(m).map(S=>Zt(S).width))}var Ba={mixins:[Qu],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:S,duration:_,timing:$,dir:Q}}){Vi.read(()=>{if(!this.matchMedia)return;let ae=this.getCss(cx(m,Q,S)),me=this.getCss(fx(m)?.5:Q>0?1:0);Vi.write(()=>{Fe(this.$el,ae),Mt.start(this.$el,me,_,$).catch(He)})})}},{name:"transitioncanceled transitionend",self:!0,el:({item:m})=>m,handler(){Mt.cancel(this.$el)}},{name:"itemtranslatein itemtranslateout",self:!0,el:({item:m})=>m,handler({type:m,detail:{percent:S,dir:_}}){Vi.read(()=>{if(!this.matchMedia){this.reset();return}let $=this.getCss(cx(m,_,S));Vi.write(()=>Fe(this.$el,$))})}}]};function fx(m){return s(m,"in")}function cx(m,S,_){return _/=2,fx(m)^S<0?_:1-_}var nf={...fv,fade:{show(){return[{opacity:0,zIndex:0},{zIndex:-1}]},percent(m){return 1-Fe(m,"opacity")},translate(m){return[{opacity:1-m,zIndex:0},{zIndex:-1}]}},scale:{show(){return[{opacity:0,transform:Vl(1+.5),zIndex:0},{zIndex:-1}]},percent(m){return 1-Fe(m,"opacity")},translate(m){return[{opacity:1-m,transform:Vl(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,S,_){return _<0?1-Tc(S):Tc(m)},translate(m,S){return S<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,S,_){return _>0?1-Tc(S):Tc(m)},translate(m,S){return S<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}]}}},px={mixins:[Gi,Am,sx,Oi,ux],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:nf},watch:{list(m){Fe(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)])}}},mx={mixins:[Gi,sv],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:we,passive:!1,handler:"init"},computed:{target:(m,S)=>(S.tBodies||[S])[0],items(){return Sr(this.target)},isEmpty(){return!this.items.length},handles({handle:m},S){return m?an(m,S):this.items}},watch:{isEmpty(m){Je(this.target,this.clsEmpty,m)},handles(m,S){Fe(S,{touchAction:"",userSelect:""}),Fe(m,{touchAction:"none",userSelect:"none"})}},update:{write(m){if(!this.drag||!Wt(this.placeholder))return;let{pos:{x:S,y:_},origin:{offsetTop:$,offsetLeft:Q},placeholder:ae}=this;Fe(this.drag,{top:_-$,left:S-Q});let me=this.getSortable(document.elementFromPoint(S,_));if(!me)return;let{items:Se}=me;if(Se.some(Mt.inProgress))return;let _e=Fv(Se,{x:S,y:_});if(Se.length&&(!_e||_e===ae))return;let Ke=this.getSortable(ae),je=_v(me.target,_e,ae,S,_,me===Ke&&m.moved!==_e);je!==!1&&(je&&ae===je||(me!==Ke?(Ke.remove(ae),m.moved=_e):delete m.moved,me.insert(ae,je),this.touched.add(me)))},events:["move"]},methods:{init(m){let{target:S,button:_,defaultPrevented:$}=m,[Q]=this.items.filter(ae=>ae.contains(S));!Q||$||_>0||kt(S)||S.closest(`.${this.clsNoDrag}`)||this.handle&&!S.closest(this.handle)||(m.preventDefault(),this.pos=ht(m),this.touched=new Set([this]),this.placeholder=Q,this.origin={target:S,index:Fn(Q),...this.pos},Qt(document,Le,this.move),Qt(document,Qe,this.end),this.threshold||this.start(m))},start(m){this.drag=Iv(this.$container,this.placeholder);let{left:S,top:_}=Zt(this.placeholder);N(this.origin,{offsetLeft:this.pos.x-S,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),Rt(this.$el,"start",[this,this.placeholder]),Fm(this.pos),this.move(m)},move:hx(function(m){N(this.pos,ht(m)),this.drag?this.$emit("move"):(Math.abs(this.pos.x-this.origin.x)>this.threshold||Math.abs(this.pos.y-this.origin.y)>this.threshold)&&this.start(m)}),end(){if($i(document,Le,this.move),$i(document,Qe,this.end),!this.drag)return;of();let m=this.getSortable(this.placeholder);this===m?this.origin.index!==Fn(this.placeholder)&&Rt(this.$el,"moved",[this,this.placeholder]):(Rt(m.$el,"added",[m,this.placeholder]),Rt(this.$el,"removed",[this,this.placeholder])),Rt(this.$el,"stop",[this,this.placeholder]),Do(this.drag),this.drag=null;for(let{clsPlaceholder:S,clsItem:_}of this.touched)for(let $ of this.touched)ve($.items,S,_);this.touched=null,ve(document.documentElement,this.clsDragState)},insert(m,S){Ue(this.items,this.clsItem),S&&S.previousElementSibling!==m?this.animate(()=>fc(S,m)):!S&&this.target.lastElementChild!==m&&this.animate(()=>dn(this.target,m))},remove(m){this.target.contains(m)&&this.animate(()=>Do(m))},getSortable(m){do{let S=this.$getComponent(m,"sortable");if(S&&(S===this||this.group!==!1&&S.group===this.group))return S}while(m=Wt(m))}}};let Ov;function Fm(m){let S=Date.now();Ov=setInterval(()=>{let{x:_,y:$}=m;$+=document.scrollingElement.scrollTop;let Q=(Date.now()-S)*.3;S=Date.now(),Uu(document.elementFromPoint(_,m.y)).reverse().some(ae=>{let{scrollTop:me,scrollHeight:Se}=ae,{top:_e,bottom:Ke,height:je}=Eo(ae);if(_e<$&&_e+35>$)me-=Q;else if(Ke>$&&Ke-35<$)me+=Q;else return;if(me>0&&me"),dn(_,S.cloneNode(!0).children);for(let $ of S.getAttributeNames())et(_,$,S.getAttribute($))}else _=S.cloneNode(!0);return dn(m,_),Fe(_,"margin","0","important"),Fe(_,{boxSizing:"border-box",width:S.offsetWidth,height:S.offsetHeight,padding:Fe(S,"padding")}),Wi(_.firstElementChild,Wi(S.firstElementChild)),_}function Fv(m,S){return m[p(m,_=>ze(S,Zt(_)))]}function _v(m,S,_,$,Q,ae){if(!Sr(m).length)return;let me=Zt(S);if(!ae)return LN(m,_)||Qme[Pt]-$t?!1:S}function LN(m,S){let _=Sr(m).length===1;_&&dn(m,S);let $=Sr(m),Q=$.some((ae,me)=>{let Se=Zt(ae);return $.slice(me+1).some(_e=>{let Ke=Zt(_e);return!af([Se.left,Se.right],[Ke.left,Ke.right])})});return _&&Do(S),Q}function af(m,S){return m[1]>S[0]&&S[1]>m[0]}function hx(m){let S;return function(..._){S||(S=!0,requestAnimationFrame(()=>{S=!1,m.call(this,..._)}))}}var dx={props:{pos:String,offset:null,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,S,_){let $=[this.getPositionOffset(m),this.getShiftOffset(m)],Q=[this.flip&&"flip",this.shift&&"shift"],ae={element:[this.inset?this.dir:dc(this.dir),this.align],target:[this.dir,this.align]};if(this.axis==="y"){for(let _e in ae)ae[_e].reverse();$.reverse(),Q.reverse()}let me=vx(m),Se=Zt(m);Fe(m,{top:-Se.height,left:-Se.width}),oa(m,S,{attach:ae,offset:$,boundary:_,placement:Q,viewportOffset:this.getViewportOffset(m)}),me()},getPositionOffset(m=this.$el){return ei(this.offset===!1?Fe(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:ei(Fe(m,"--uk-position-shift-offset"),this.axis==="y"?"width":"height",m)*(f(["left","top"],this.align)?1:-1)},getViewportOffset(m){return ei(Fe(m,"--uk-position-viewport-offset"))}}};function vx(m){let S=hs(m),{scrollTop:_}=S;return()=>{_!==S.scrollTop&&(S.scrollTop=_)}}var _m={mixins:[Wl,Co,dx],data:{pos:"top",animation:["uk-animation-scale-up"],duration:100,cls:"uk-active"},connected(){PN(this.$el)},disconnected(){this.hide()},methods:{show(){if(this.isToggled(this.tooltip||null))return;let{delay:m=0,title:S}=Wc(this.$options);if(!S)return;let _=et(this.$el,"title"),$=Qt(this.$el,["blur",Xe],ae=>!st(ae)&&this.hide());this.reset=()=>{et(this.$el,{title:_,"aria-describedby":null}),$()};let Q=uu(this);et(this.$el,{title:null,"aria-describedby":Q}),clearTimeout(this.showTimer),this.showTimer=setTimeout(()=>this._show(S,Q),m)},async hide(){var m;tr(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),Do(this.tooltip),this.tooltip=null)},async _show(m,S){this.tooltip=dn(this.container,``),Qt(this.tooltip,"toggled",(_,$)=>{if(!$)return;let Q=()=>this.positionAt(this.tooltip,this.$el);Q();let[ae,me]=RN(this.tooltip,this.$el,this.pos);this.origin=this.axis==="y"?`${dc(ae)}-${me}`:`${me}-${dc(ae)}`;let Se=[Tr(document,`keydown ${we}`,this.hide,!1,_e=>_e.type===we&&!this.$el.contains(_e.target)||_e.type==="keydown"&&_e.keyCode===Or.ESC),Qt([document,...nu(this.$el)],"scroll",Q,{passive:!0})];Tr(this.tooltip,"hide",()=>Se.forEach(_e=>_e()),{self:!0})}),await this.toggleElement(this.tooltip,!0)||this.hide()}},events:{[`focus ${it} ${we}`](m){(!st(m)||m.type===we)&&this.show()}}};function PN(m){Vr(m)||et(m,"tabindex","0")}function RN(m,S,[_,$]){let Q=xr(m),ae=xr(S),me=[["left","right"],["top","bottom"]];for(let _e of me){if(Q[_e[0]]>=ae[_e[1]]){_=_e[1];break}if(Q[_e[1]]<=ae[_e[0]]){_=_e[0];break}}return $=(f(me[0],_)?me[1]:me[0]).find(_e=>Q[_e]===ae[_e])||"center",[_,$]}function Wc(m){let{el:S,id:_,data:$}=m;return["delay","title"].reduce((Q,ae)=>({[ae]:fe(S,ae),...Q}),{...Wu(fe(S,_),["title"]),...$})}var gx={mixins:[di],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){tr(m.target,'input[type="file"]')&&(m.preventDefault(),m.target.files&&this.upload(m.target.files),m.target.value="")},drop(m){sf(m);let S=m.dataTransfer;S?.files&&(ve(this.$el,this.clsDragover),this.upload(S.files))},dragenter(m){sf(m)},dragover(m){sf(m),Ue(this.$el,this.clsDragover)},dragleave(m){sf(m),ve(this.$el,this.clsDragover)}},methods:{async upload(m){if(m=y(m),!m.length)return;Rt(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&&!kv(this.allow,$.name)){this.fail(this.t("invalidName",this.allow));return}if(this.mime&&!kv(this.mime,$.type)){this.fail(this.t("invalidMime",this.mime));return}}this.multiple||(m=m.slice(0,1)),this.beforeAll(this,m);let S=qN(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 xx(this.url,{data:Q,method:this.method,responseType:this.type,beforeSend:me=>{let{xhr:Se}=me;Qt(Se.upload,"progress",this.progress);for(let _e of["loadStart","load","loadEnd","abort"])Qt(Se,_e.toLowerCase(),this[_e]);return this.beforeSend(me)}});this.complete(ae),S.length?await _(S.shift()):this.completeAll(ae)}catch(ae){this.error(ae)}};await _(S.shift())}}};function kv(m,S){return S.match(new RegExp(`^${m.replace(/\//g,"\\/").replace(/\*\*/g,"(\\/[^\\/]+)*").replace(/\*/g,"[^\\/]+").replace(/((?!\\))\?/g,"$1.")}$`,"i"))}function qN(m,S){let _=[];for(let $=0;${let{xhr:Q}=S;for(let ae in S)if(ae in Q)try{Q[ae]=S[ae]}catch{}Q.open(S.method.toUpperCase(),m);for(let ae in S.headers)Q.setRequestHeader(ae,S.headers[ae]);Qt(Q,"load",()=>{Q.status===0||Q.status>=200&&Q.status<300||Q.status===304?_(Q):$(N(Error(Q.statusText),{xhr:Q,status:Q.status}))}),Qt(Q,"error",()=>$(N(Error("Network Error"),{xhr:Q}))),Qt(Q,"timeout",()=>$(N(Error("Network Timeout"),{xhr:Q}))),Q.send(S.data)})}var yx=Object.freeze({__proto__:null,Countdown:R1,Filter:xN,Lightbox:vi,LightboxPanel:j1,Notification:ex,Parallax:_N,Slider:Hc,SliderParallax:Ba,Slideshow:px,SlideshowParallax:Ba,Sortable:mx,Tooltip:_m,Upload:gx});function wx(m){J&&window.MutationObserver&&(document.body?requestAnimationFrame(()=>bx(m)):new MutationObserver((S,_)=>{document.body&&(bx(m),_.disconnect())}).observe(document.documentElement,{childList:!0}))}function bx(m){Rt(document,"uikit:init",m),document.body&&So(document.body,uf),new MutationObserver(S=>S.forEach(Bv)).observe(document,{subtree:!0,childList:!0}),new MutationObserver(S=>S.forEach(Vc)).observe(document,{subtree:!0,attributes:!0}),m._initialized=!0}function Bv({addedNodes:m,removedNodes:S}){for(let _ of m)So(_,uf);for(let _ of S)So(_,UN)}function Vc({target:m,attributeName:S}){var _;let $=Lv(S);$&&(ut(m,S)?Ju($,m):(_=Nm(m,$))==null||_.$destroy())}function uf(m){let S=Yl(m);for(let _ in S)kc(S[_]);for(let _ of m.getAttributeNames()){let $=Lv(_);$&&Ju($,m)}}function UN(m){let S=Yl(m);for(let _ in S)bm(S[_])}function Lv(m){a(m,"data-")&&(m=m.slice(5));let S=Gl[m];return S&&(S.options||S).name}TN(Vn),ON(Vn);var Dx={mixins:[Gi,Co],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},S)=>an(m,S),toggles({toggle:m}){return this.items.map(S=>hr(m,S))},contents({content:m}){return this.items.map(S=>{var _;return((_=S._wrapper)==null?void 0:_.firstElementChild)||hr(m,S)})}},watch:{items(m,S){if(S||ke(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 S of m){let _=ke(this.items.find($=>$.contains(S)),this.clsOpen);km(S,!_)}this.$emit()}},observe:Pl(),events:[{name:"click keydown",delegate:({targets:m,$props:S})=>`${m} ${S.toggle}`,async handler(m){var S;m.type==="keydown"&&m.keyCode!==Or.SPACE||(m.preventDefault(),(S=this._off)==null||S.call(this),this._off=$N(m.target),await this.toggle(Fn(this.toggles,m.current)),this._off())}},{name:"shown hidden",self:!0,delegate:({targets:m})=>m,handler(){this.$emit()}}],update(){let m=mi(this.items,`.${this.clsOpen}`);for(let S in this.items){let _=this.toggles[S],$=this.contents[S];if(!_||!$)continue;_.id=uu(this,_),$.id=uu(this,$);let Q=f(m,this.items[S]);et(_,{role:Qr(_,"a")?"button":null,"aria-controls":$.id,"aria-expanded":Q,"aria-disabled":!this.collapsible&&m.length<2&&Q}),et($,{role:"region","aria-labelledby":_.id}),Qr($,"ul")&&et(Sr($),"role","presentation")}},methods:{toggle(m,S){m=this.items[de(m,this.items)];let _=[m],$=mi(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,me)=>{if(Je(ae,this.clsOpen,me),S===!1||!this.animation){km(hr(this.content,ae),!me);return}return HN(ae,me,this)})))}}};function km(m,S){m&&(m.hidden=S)}async function HN(m,S,{content:_,duration:$,velocity:Q,transition:ae}){var me;_=((me=m._wrapper)==null?void 0:me.firstElementChild)||hr(_,m),m._wrapper||(m._wrapper=Qp(_,"
    "));let Se=m._wrapper;Fe(Se,"overflow","hidden");let _e=ie(Fe(Se,"height"));await Mt.cancel(Se),km(_,!1);let Ke=Ne(["marginTop","marginBottom"],xt=>Fe(_,xt))+Zt(_).height,je=_e/Ke;$=(Q*Ke+$)*(S?1-je:je),Fe(Se,"height",_e),await Mt.start(Se,{height:S?Ke:0},$,ae),No(_),delete m._wrapper,S||km(_,!0)}function $N(m){let S=hs(m,!0),_;return function $(){_=requestAnimationFrame(()=>{let{top:Q}=Zt(m);Q<0&&(S.scrollTop+=Q),$()})}(),()=>requestAnimationFrame(()=>cancelAnimationFrame(_))}var Nx={mixins:[Gi,Co],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,WN),this.$destroy(!0)}}};function WN(m,S,{duration:_,transition:$,velocity:Q}){let ae=ie(Fe(m,"height"));return Fe(m,"height",ae),Mt.start(m,{height:0,marginTop:0,marginBottom:0,paddingTop:0,paddingBottom:0,borderTop:0,borderBottom:0,opacity:0},Q*ae+_,$)}var Sx={args:"autoplay",props:{automute:Boolean,autoplay:Boolean},data:{automute:!1,autoplay:!0},beforeConnect(){this.autoplay==="inview"&&!ut(this.$el,"preload")&&(this.$el.preload="none"),Qr(this.$el,"iframe")&&!ut(this.$el,"allow")&&(this.$el.allow="autoplay"),this.autoplay==="hover"&&(Qr(this.$el,"video")?this.$el.tabindex=0:this.autoplay=!0),this.automute&&M1(this.$el)},events:[{name:`${it} focusin`,filter:({autoplay:m})=>f(m,"hover"),handler(m){!st(m)||!Ex(this.$el)?kl(this.$el):ms(this.$el)}},{name:`${Xe} focusout`,filter:({autoplay:m})=>f(m,"hover"),handler(m){st(m)||ms(this.$el)}}],observe:[aa({filter:({$el:m,autoplay:S})=>S&&S!=="hover"&&T1(m),handler([{isIntersecting:m}]){document.fullscreenElement||(m?kl(this.$el):ms(this.$el))},args:{intersecting:!1},options:({$el:m,autoplay:S})=>({root:S==="inview"?null:Wt(m)})})]};function Ex(m){return!m.paused&&!m.ended}var Pv={mixins:[Sx],props:{width:Number,height:Number},data:{automute:!0},created(){this.useObjectFit=Qr(this.$el,"img","video")},observe:si({target:({$el:m})=>Rv(m)||Wt(m),filter:({useObjectFit:m})=>!m}),update:{read(){if(this.useObjectFit)return!1;let{ratio:m,cover:S}=ct,{$el:_,width:$,height:Q}=this,ae={width:$,height:Q};if(!$||!Q){let Ke={width:_.naturalWidth||_.videoWidth||_.clientWidth,height:_.naturalHeight||_.videoHeight||_.clientHeight};$?ae=m(Ke,"width",$):Q?ae=m(Ke,"height",Q):ae=Ke}let{offsetHeight:me,offsetWidth:Se}=Rv(_)||Wt(_),_e=S(ae,{width:Se+(Se%2?1:0),height:me+(me%2?1:0)});return!_e.width||!_e.height?!1:_e},write({height:m,width:S}){Fe(this.$el,{height:m,width:S})},events:["resize"]}};function Rv(m){for(;m=Wt(m);)if(Fe(m,"position")!=="static")return m}let gi;var qv={mixins:[Wl,dx,Co],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:S,boundaryY:_},$){return[zn(S||m,$)||window,zn(_||m,$)||window]},target({target:m,targetX:S,targetY:_},$){return S||(S=m||this.targetEl),_||(_=m||this.targetEl),[S===!0?window:zn(S,$),_===!0?window:zn(_,$)]}},created(){this.tracker=new Zd},beforeConnect(){this.clsDrop=this.$props.clsDrop||this.$options.id},connected(){Ue(this.$el,"uk-drop",this.clsDrop),this.toggle&&!this.targetEl&&(this.targetEl=Bm(this)),this._style=Ce(this.$el.style,["width","height"])},disconnected(){this.isActive()&&(this.hide(!1),gi=null),Fe(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:S}){let{hash:_}=S;!m&&_&&Ta(S)&&!this.$el.contains(hr(_))&&this.hide(!1)}},{name:"beforescroll",handler(){this.hide(!1)}},{name:"toggle",self:!0,handler(m,S){m.preventDefault(),this.isToggled()?this.hide(!1):this.show(S?.$el,!1)}},{name:"toggleshow",self:!0,handler(m,S){m.preventDefault(),this.show(S?.$el)}},{name:"togglehide",self:!0,handler(m){m.preventDefault(),tr(this.$el,":focus,:hover")||this.hide()}},{name:`${it} 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,S){S&&(this.clearTimers(),this.position())}},{name:"show",self:!0,handler(){gi=this,this.tracker.init(),et(this.targetEl,"aria-expanded",!0);let m=[VN(this),GN(this),YN(this),this.autoUpdate&&Cx(this),this.closeOnScroll&&sn(this)];Tr(this.$el,"hide",()=>m.forEach(S=>S&&S()),{self:!0}),this.bgScroll||Tr(this.$el,"hidden",$l(this.$el),{self:!0})}},{name:"beforehide",self:!0,handler:"clearTimers"},{name:"hide",handler({target:m}){if(this.$el!==m){gi=gi===null&&this.$el.contains(m)&&this.isToggled()?this:gi;return}gi=this.isActive()?null:gi,this.tracker.cancel(),et(this.targetEl,"aria-expanded",null)}}],update:{write(){this.isToggled()&&!ke(this.$el,this.clsEnter)&&this.position()}},methods:{show(m=this.targetEl,S=!0){if(this.isToggled()&&m&&this.targetEl&&m!==this.targetEl&&this.hide(!1,!1),this.targetEl=m,this.clearTimers(),!this.isActive()){if(gi){if(S&&gi.isDelaying){this.showTimer=setTimeout(()=>tr(m,":hover")&&this.show(),10);return}let _;for(;gi&&_!==gi&&!gi.$el.contains(this.$el);)_=gi,gi.hide(!1,!1)}this.container&&Wt(this.$el)!==this.container&&dn(this.container,this.$el),this.showTimer=setTimeout(()=>this.toggleElement(this.$el,!0),S&&this.delayShow||0)}},hide(m=!0,S=!0){let _=()=>this.toggleElement(this.$el,!1,this.animateOut&&S);this.clearTimers(),this.isDelayedHide=m,this.isDelaying=lf(this.$el).some($=>this.tracker.movesTo($)),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,this.isDelaying=!1},isActive(){return gi===this},position(){ve(this.$el,"uk-drop-stack"),Fe(this.$el,this._style),this.$el.hidden=!0;let m=this.target.map(Q=>Ax(this.$el,Q)),S=this.getViewportOffset(this.$el),_=[[0,["x","width","left","right"]],[1,["y","height","top","bottom"]]];for(let[Q,[ae,me]]of _)this.axis!==ae&&f([ae,!0],this.stretch)&&Fe(this.$el,{[me]:Math.min(xr(this.boundary[Q])[me],m[Q][me]-2*S),[`overflow-${ae}`]:"auto"});let $=m[0].width-2*S;this.$el.hidden=!1,Fe(this.$el,"maxWidth",""),this.$el.offsetWidth>$&&Ue(this.$el,"uk-drop-stack"),Fe(this.$el,"maxWidth",$),this.positionAt(this.$el,this.target,this.boundary);for(let[Q,[ae,me,Se,_e]]of _)if(this.axis===ae&&f([ae,!0],this.stretch)){let Ke=Math.abs(this.getPositionOffset()),je=xr(this.target[Q]),xt=xr(this.$el);Fe(this.$el,{[me]:(je[Se]>xt[Se]?je[this.inset?_e:Se]-Math.max(xr(this.boundary[Q])[Se],m[Q][Se]+S):Math.min(xr(this.boundary[Q])[_e],m[Q][_e]-S)-je[this.inset?Se:_e])-Ke,[`overflow-${ae}`]:"auto"}),this.positionAt(this.$el,this.target,this.boundary)}}}};function lf(m){let S=[];return So(m,_=>Fe(_,"position")!=="static"&&S.push(_)),S}function Ax(m,S){return Eo(nu(S).find(_=>_.contains(m)))}function Bm(m){let{$el:S}=m.$create("toggle",zn(m.toggle,m.$el),{target:m.$el,mode:m.mode});return et(S,"aria-haspopup",!0),S}function VN(m){let S=()=>m.$emit(),_=[rm(S),gc(nu(m.$el).concat(m.target),S)];return()=>_.map($=>$.disconnect())}function Cx(m,S=()=>m.$emit()){return Qt([document,...nu(m.$el)],"scroll",S,{passive:!0})}function GN(m){return Qt(document,"keydown",S=>{S.keyCode===Or.ESC&&m.hide(!1)})}function sn(m){return Cx(m,()=>m.hide(!1))}function YN(m){return Qt(document,we,({target:S})=>{m.$el.contains(S)||Tr(document,`${Qe} ${pt} scroll`,({defaultPrevented:_,type:$,target:Q})=>{var ae;!_&&$===Qe&&S===Q&&!((ae=m.targetEl)!=null&&ae.contains(S))&&m.hide(!1)},!0)})}var Lm={mixins:[Gi,Wl],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},S)=>zn(m,S)||S,dropbar({dropbar:m}){return m?(m=this._dropbar||zn(m,this.$el)||hr(`+ .${this.clsDropbar}`,this.$el),m||(this._dropbar=hr("
    "))):null},dropContainer(m,S){return this.container||S},dropdowns({clsDrop:m},S){var _;let $=an(`.${m}`,S);if(this.dropContainer!==S)for(let Q of an(`.${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},S){return an(m,S)}},watch:{dropbar(m){Ue(m,"uk-dropbar","uk-dropbar-top",this.clsDropbar,`uk-${this.$options.name}-dropbar`)},dropdowns(){this.initializeDropdowns()}},connected(){this.initializeDropdowns()},disconnected(){Do(this._dropbar),delete this._dropbar},events:[{name:"mouseover focusin",delegate:({selNavItem:m})=>m,handler({current:m}){let S=this.getActive();S&&f(S.mode,"hover")&&S.targetEl&&!m.contains(S.targetEl)&&!S.isDelaying&&S.hide(!1)}},{name:"keydown",self:!0,delegate:({selNavItem:m})=>m,handler(m){var S;let{current:_,keyCode:$}=m,Q=this.getActive();$===Or.DOWN&&Q?.targetEl===_&&(m.preventDefault(),(S=hr(ur,Q.$el))==null||S.focus()),ff(m,this.items,Q)}},{name:"keydown",el:({dropContainer:m})=>m,delegate:({clsDrop:m})=>`.${m}`,handler(m){var S;let{current:_,keyCode:$}=m;if(!f(this.dropdowns,_))return;let Q=this.getActive(),ae=-1;if($===Or.HOME?ae=0:$===Or.END?ae="last":$===Or.UP?ae="previous":$===Or.DOWN?ae="next":$===Or.ESC&&((S=Q.targetEl)==null||S.focus()),~ae){m.preventDefault();let me=an(ur,_);me[de(ae,me,p(me,Se=>tr(Se,":focus")))].focus()}ff(m,this.items,Q)}},{name:"mouseleave",el:({dropbar:m})=>m,filter:({dropbar:m})=>m,handler(){let m=this.getActive();m&&f(m.mode,"hover")&&!this.dropdowns.some(S=>tr(S,":hover"))&&m.hide()}},{name:"beforeshow",el:({dropContainer:m})=>m,filter:({dropbar:m})=>m,handler({target:m}){this.isDropbarDrop(m)&&(this.dropbar.previousElementSibling!==this.dropbarAnchor&&cc(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 S=this.getDropdown(m),_=()=>{let $=Math.max(...no(m,`.${this.clsDrop}`).concat(m).map(Q=>xr(Q).bottom));xr(this.dropbar,{left:xr(this.dropbar).left,top:this.getDropbarOffset(S.getPositionOffset())}),this.transitionTo($-xr(this.dropbar).top+ie(Fe(m,"marginBottom")),m)};this._observer=gc([S.$el,...S.target],_),_()}},{name:"beforehide",el:({dropContainer:m})=>m,filter:({dropbar:m})=>m,handler(m){let S=this.getActive();tr(this.dropbar,":hover")&&S.$el===m.target&&this.isDropbarDrop(S.$el)&&f(S.mode,"hover")&&S.isDelayedHide&&!this.items.some(_=>S.targetEl!==_&&tr(_,":focus"))&&m.preventDefault()}},{name:"hide",el:({dropContainer:m})=>m,filter:({dropbar:m})=>m,handler({target:m}){var S;if(!this.isDropbarDrop(m))return;(S=this._observer)==null||S.disconnect();let _=this.getActive();(!_||_.$el===m)&&this.transitionTo(0)}}],methods:{getActive(){var m;return f(this.dropdowns,(m=gi)==null?void 0:m.$el)&&gi},async transitionTo(m,S){let{dropbar:_}=this,$=Wi(_);if(S=$0&&Fe(S,"transitionDelay",`${Q/m*this.duration}ms`)}Fe(S,"clipPath",`polygon(0 0,100% 0,100% ${$}px,0 ${$}px)`),Wi(_,$),await Promise.all([Mt.start(_,{height:m},this.duration),Mt.start(S,{clipPath:`polygon(0 0,100% 0,100% ${m}px,0 ${m}px)`},this.duration).finally(()=>Fe(S,{clipPath:"",transitionDelay:""}))]).catch(He)},getDropdown(m){return this.$getComponent(m,"drop")||this.$getComponent(m,"dropdown")},isDropbarDrop(m){return f(this.dropdowns,m)&&ke(m,this.clsDrop)},getDropbarOffset(m){let{$el:S,target:_,targetY:$}=this,{top:Q,height:ae}=xr(zn($||_||S,S));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 ff(m,S,_){var $,Q,ae;let{current:me,keyCode:Se}=m,_e=-1;Se===Or.HOME?_e=0:Se===Or.END?_e="last":Se===Or.LEFT?_e="previous":Se===Or.RIGHT?_e="next":Se===Or.TAB&&(($=_.targetEl)==null||$.focus(),(Q=_.hide)==null||Q.call(_,!1)),~_e&&(m.preventDefault(),(ae=_.hide)==null||ae.call(_,!1),S[de(_e,S,S.indexOf(_.targetEl||me))].focus())}var la={mixins:[Gi],args:"target",props:{target:Boolean},data:{target:!1},computed:{input:(m,S)=>hr(wt,S),state(){return this.input.nextElementSibling},target({target:m},S){return m&&(m===!0&&Wt(this.input)===S&&this.input.nextElementSibling||hr(m,S))}},update(){var m;let{target:S,input:_}=this;if(!S)return;let $,Q=kt(S)?"value":"textContent",ae=S[Q],me=(m=_.files)!=null&&m[0]?_.files[0].name:tr(_,"select")&&($=an("option",_).filter(Se=>Se.selected)[0])?$.textContent:_.value;ae!==me&&(S[Q]=me)},events:[{name:"change",handler(){this.$emit()}},{name:"reset",el:({$el:m})=>m.closest("form"),handler(){this.$emit()}}]},Pm={extends:vs,mixins:[Gi],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:Rl({filter:({parallax:m,parallaxJustify:S})=>m||S}),update:[{write({rows:m}){Je(this.$el,this.clsStack,!m.some(S=>S.length>1))},events:["resize"]},{read(m){let{rows:S}=m,{masonry:_,parallax:$,parallaxJustify:Q,margin:ae}=this;if($=Math.max(0,ei($)),!(_||$||Q)||Rm(S)||S[0].some((ar,Ir)=>S.some(Pr=>Pr[Ir]&&Pr[Ir].offsetWidth!==ar.offsetWidth)))return m.translates=m.scrollColumns=!1;let me=Tx(S,ae),Se,_e;_?[Se,_e]=Mx(S,me,_==="next"):Se=Ox(S);let Ke=Se.map(ar=>Ne(ar,"offsetHeight")+me*(ar.length-1)),je=Math.max(0,...Ke),xt,Pt,$t;return($||Q)&&(xt=Ke.map((ar,Ir)=>Q?je-ar+$:$/(Ir%2||8)),Q||($=Math.max(...Ke.map((ar,Ir)=>ar+xt[Ir]-je))),Pt=ei(this.parallaxStart,"height",this.$el,!0),$t=ei(this.parallaxEnd,"height",this.$el,!0)),{columns:Se,translates:_e,scrollColumns:xt,parallaxStart:Pt,parallaxEnd:$t,padding:$,height:_e?je:""}},write({height:m,padding:S}){Fe(this.$el,"paddingBottom",S||""),m!==!1&&Fe(this.$el,"height",m)},events:["resize"]},{read({rows:m,scrollColumns:S,parallaxStart:_,parallaxEnd:$}){return{scrolled:S&&!Rm(m)?om(this.$el,_,$):!1}},write({columns:m,scrolled:S,scrollColumns:_,translates:$}){!S&&!$||m.forEach((Q,ae)=>Q.forEach((me,Se)=>{let[_e,Ke]=$&&$[ae][Se]||[0,0];S&&(Ke+=S*_[ae]),Fe(me,"transform",`translate(${_e}px, ${Ke}px)`)}))},events:["scroll","resize"]}]};function Rm(m){return m.flat().some(S=>Fe(S,"position")==="absolute")}function Mx(m,S,_){let $=[],Q=[],ae=Array(m[0].length).fill(0),me=0;for(let Se of m){j&&(Se=Se.reverse());let _e=0;for(let Ke in Se){let{offsetWidth:je,offsetHeight:xt}=Se[Ke],Pt=_?Ke:ae.indexOf(Math.min(...ae));Gc($,Pt,Se[Ke]),Gc(Q,Pt,[(Pt-Ke)*je*(j?-1:1),ae[Pt]-me]),ae[Pt]+=xt+S,_e=Math.max(_e,xt)}me+=_e+S}return[$,Q]}function Tx(m,S){let _=m.flat().find($=>ke($,S));return ie(_?Fe(_,"marginTop"):Fe(m[0][0],"paddingLeft"))}function Ox(m){let S=[];for(let _ of m)for(let $ in _)Gc(S,$,_[$]);return S}function Gc(m,S,_){m[S]||(m[S]=[]),m[S].push(_)}var Ix={args:"target",props:{target:String,row:Boolean},data:{target:"> *",row:!0},computed:{elements:({target:m},S)=>an(m,S)},observe:si({target:({$el:m,elements:S})=>S.reduce((_,$)=>_.concat($,...$.children),[m])}),events:{name:"loadingdone",el:()=>document.fonts,handler(){this.$emit("resize")}},update:{read(){return{rows:(this.row?_a(this.elements):[this.elements]).map(ZN)}},write({rows:m}){for(let{heights:S,elements:_}of m)_.forEach(($,Q)=>Fe($,"minHeight",S[Q]))},events:["resize"]}};function ZN(m){if(m.length<2)return{heights:[""],elements:m};let S=m.map(zv),_=Math.max(...S);return{heights:m.map(($,Q)=>S[Q].toFixed(2)===_.toFixed(2)?"":_),elements:m}}function zv(m){let S=Ce(m.style,["display","minHeight"]);tt(m)||Fe(m,"display","block","important"),Fe(m,"minHeight","");let _=Zt(m).height-eu(m,"height","content-box");return Fe(m,S),_}var Fx={args:"target",props:{target:String},data:{target:""},computed:{target:{get:({target:m},S)=>zn(m,S),observe:({target:m})=>m}},observe:si({target:({target:m})=>m}),update:{read(){return this.target?{height:this.target.offsetHeight}:!1},write({height:m}){Fe(this.$el,{minHeight:m})},events:["resize"]}},qr={props:{expand:Boolean,offsetTop:Boolean,offsetBottom:Boolean,minHeight:Number},data:{expand:!1,offsetTop:!1,offsetBottom:!1,minHeight:0},observe:[Nc({filter:({expand:m})=>m}),si({target:({$el:m})=>Uu(m)})],update:{read(){if(!tt(this.$el))return!1;let m="",S=eu(this.$el,"height","content-box"),{body:_,scrollingElement:$}=document,Q=hs(this.$el),{height:ae}=Eo(Q===_?$:Q),me=$===Q||_===Q;if(m=`calc(${me?"100vh":`${ae}px`}`,this.expand){let Se=Zt(Q).height-Zt(this.$el).height;m+=` - ${Se}px`}else{if(this.offsetTop)if(me){let Se=this.offsetTop===!0?this.$el:zn(this.offsetTop,this.$el),_e=js(Se)[0]-js(Q)[0];m+=_e>0&&_e{if(!this._connected)return;let S=Ae(m,this.$el);return this.svgEl&&S!==this.svgEl&&Do(this.svgEl),Ze.call(this,S,m),this.svgEl=S},He)},disconnected(){this.svg.then(m=>{this._connected||(xe(this.$el)&&(this.$el.hidden=!1),Do(m),this.svgEl=null)}),this.svg=null},methods:{async getSvg(){}}};function Ae(m,S){if(xe(S)||Qr(S,"canvas")){S.hidden=!0;let $=S.nextElementSibling;return Ie(m,$)?$:cc(S,m)}let _=S.lastElementChild;return Ie(m,_)?_:dn(S,m)}function Ie(m,S){return Qr(m,"svg")&&Qr(S,"svg")&&m.innerHTML===S.innerHTML}function Ze(m,S){let _=["width","height"],$=_.map(ae=>this[ae]);$.some(ae=>ae)||($=_.map(ae=>et(S,ae)));let Q=et(S,"viewBox");Q&&!$.some(ae=>ae)&&($=Q.split(" ").slice(2)),$.forEach((ae,me)=>et(m,_[me],ie(ae)*this.ratio||null))}let $e={spinner:te,totop:oe,marker:KN,"close-icon":_x,"close-large":XN,"drop-parent-icon":cf,"nav-parent-icon":JN,"nav-parent-icon-large":qm,"navbar-parent-icon":En,"navbar-toggle-icon":QN,"overlay-icon":jN,"pagination-next":eS,"pagination-previous":zm,"search-icon":c,"search-large":d,"search-navbar":A,"search-toggle-icon":c,"slidenav-next":T,"slidenav-next-large":E,"slidenav-previous":G,"slidenav-previous-large":U},at={install:Xi,mixins:[se],args:"icon",props:{icon:String},isIcon:!0,beforeConnect(){Ue(this.$el,"uk-icon")},methods:{async getSvg(){let m=Ki(this.icon);if(!m)throw"Icon not found.";return m}}},mt={args:!1,extends:at,data:m=>({icon:i(m.constructor.options.name)}),beforeConnect(){Ue(this.$el,this.$options.id)}},yt={extends:mt,beforeConnect(){let m=this.$props.icon;this.icon=this.$el.closest(".uk-nav-primary")?`${m}-large`:m}},Dt={extends:mt,mixins:[di],i18n:{toggle:"Open Search",submit:"Submit Search"},beforeConnect(){let m=ke(this.$el,"uk-search-toggle")||ke(this.$el,"uk-navbar-toggle");if(this.icon=m?"search-toggle-icon":ke(this.$el,"uk-search-icon")&&this.$el.closest(".uk-search-large")?"search-large":this.$el.closest(".uk-search-navbar")?"search-navbar":this.$props.icon,!ut(this.$el,"aria-label"))if(m){let S=this.t("toggle");et(this.$el,"aria-label",S)}else{let S=this.$el.closest("a,button");if(S){let _=this.t("submit");et(S,"aria-label",_)}}}},At={extends:mt,beforeConnect(){et(this.$el,"role","status")},methods:{async getSvg(){let m=await at.methods.getSvg.call(this);return this.ratio!==1&&Fe(hr("circle",m),"strokeWidth",1/this.ratio),m}}},bt={extends:mt,mixins:[di],beforeConnect(){let m=this.$el.closest("a,button");et(m,"role",this.role!==null&&Qr(m,"a")?"button":this.role);let S=this.t("label");S&&!ut(m,"aria-label")&&et(m,"aria-label",S)}},Ot={extends:bt,beforeConnect(){Ue(this.$el,"uk-slidenav");let m=this.$props.icon;this.icon=ke(this.$el,"uk-slidenav-large")?`${m}-large`:m}},Kt={extends:bt,i18n:{label:"Open menu"}},Vt={extends:bt,i18n:{label:"Close"},beforeConnect(){this.icon=`close-${ke(this.$el,"uk-close-large")?"large":"icon"}`}},vr={extends:bt,i18n:{label:"Open"}},Gr={extends:bt,i18n:{label:"Back to top"}},ni={extends:bt,i18n:{label:"Next page"},data:{role:null}},mn={extends:bt,i18n:{label:"Previous page"},data:{role:null}},xi={};function Xi(m){m.icon.add=(S,_)=>{let $=R(S)?{[S]:_}:S;ye($,(Q,ae)=>{$e[ae]=Q,delete xi[ae]}),m._initialized&&So(document.body,Q=>ye(m.getComponents(Q),ae=>{ae.$options.isIcon&&ae.icon in $&&ae.$reset()}))}}let Bn={twitter:"x"};function Ki(m){return m=Bn[m]||m,$e[m]?(xi[m]||(xi[m]=hr(($e[ui(m)]||$e[m]).trim())),xi[m].cloneNode(!0)):null}function ui(m){return j?he(he(m,"left","right"),"previous","next"):m}var Gn={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():zo(this.$el)&&(this.$el.loading="lazy",vn(this.$el))},disconnected(){this.img&&(this.img.onload=""),delete this.img},observe:aa({handler(m,S){this.load(),S.disconnect()},options:({margin:m})=>({rootMargin:m}),filter:({loading:m})=>m==="lazy",target:({$el:m,$props:S})=>S.target?[m,...jo(S.target,m)]:m}),methods:{load(){if(this.img)return this.img;let m=zo(this.$el)?this.$el:pf(this.$el,this.dataSrc,this.sources);return Lt(m,"loading"),vn(this.$el,m.currentSrc),this.img=m}}};function vn(m,S){if(zo(m)){let _=Wt(m);(Qr(_,"picture")?Sr(_):[m]).forEach(Q=>Ii(Q,Q))}else S&&!f(m.style.backgroundImage,S)&&(Fe(m,"backgroundImage",`url(${Ia(S)})`),Rt(m,ao("load",!1)))}let gn=["data-src","data-srcset","sizes"];function Ii(m,S){for(let _ of gn){let $=fe(m,_);$&&et(S,_.replace(/^(data-)+/,""),$)}}function pf(m,S,_){let $=new Image;return cu($,_),Ii(m,$),$.onload=()=>{vn(m,$.currentSrc)},et($,"src",S),$}function cu(m,S){if(S=yi(S),S.length){let _=Ru("");for(let $ of S){let Q=Ru("");et(Q,$),dn(_,Q)}dn(_,m)}}function yi(m){if(!m)return[];if(a(m,"["))try{m=JSON.parse(m)}catch{m=[]}else m=Wu(m);return h(m)||(m=[m]),m.filter(S=>!H(S))}function zo(m){return Qr(m,"img")}var ii={props:{target:String,selActive:String},data:{target:!1,selActive:!1},computed:{target:({target:m},S)=>m?an(m,S):S},observe:[aa({handler(m){this.isIntersecting=m.some(({isIntersecting:S})=>S),this.$emit()},target:({target:m})=>m,args:{intersecting:!1}}),ds({target:({target:m})=>m,options:{attributes:!0,attributeFilter:["class"],attributeOldValue:!0}}),{target:({target:m})=>m,observe:(m,S)=>{let _=gc([...Z(m),document.documentElement],S),$=[Qt(document,"scroll itemshown itemhidden",S,{passive:!0,capture:!0}),Qt(document,"show hide transitionstart",Q=>(S(),_.observe(Q.target))),Qt(document,"shown hidden transitionend transitioncancel",Q=>(S(),_.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 S=!this.selActive||tr(m,this.selActive)?Uv(m):"";S!==!1&&Re(m,"uk-light uk-dark",S)}}}};function Uv(m){let S=Zt(m),_=Zt(window);if(!Ee(S,_))return!1;let{left:$,top:Q,height:ae,width:me}=S,Se;for(let _e of[.25,.5,.75]){let Ke=m.ownerDocument.elementsFromPoint(Math.max(0,Math.min($+me*_e,_.width-1)),Math.max(0,Math.min(Q+ae/2,_.height-1)));for(let je of Ke){if(m.contains(je)||!ys(je)||je.closest('[class*="-leave"]')&&Ke.some(Pt=>je!==Pt&&tr(Pt,'[class*="-enter"]')))continue;let xt=Fe(je,"--uk-inverse");if(xt){if(xt===Se)return`uk-${xt}`;Se=xt;break}}}return Se?`uk-${Se}`:""}function ys(m){if(Fe(m,"visibility")!=="visible")return!1;for(;m;){if(Fe(m,"opacity")==="0")return!1;m=Wt(m)}return!0}var el={mixins:[Gi,xs],props:{fill:String},data:{fill:"",clsWrapper:"uk-leader-fill",clsHide:"uk-leader-hide",attrFill:"data-fill"},computed:{fill:({fill:m},S)=>m||Fe(S,"--uk-leader-fill-content")},connected(){[this.wrapper]=jp(this.$el,``)},disconnected(){No(this.wrapper.childNodes)},observe:si(),update:{read(){return{width:Math.trunc(this.$el.offsetWidth/2),fill:this.fill,hide:!this.matchMedia}},write({width:m,fill:S,hide:_}){Je(this.wrapper,this.clsHide,_),et(this.wrapper,this.attrFill,new Array(m).join(S))},events:["resize"]}},tl={install:Fi,mixins:[gm],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){Qr(m.target,"video")&&this.isToggled()&&!document.fullscreenElement&&this.hide()}},{name:"show",self:!0,handler(){ke(this.panel,"uk-margin-auto-vertical")?Ue(this.$el,"uk-flex"):Fe(this.$el,"display","block"),Wi(this.$el)}},{name:"hidden",self:!0,handler(){Fe(this.$el,"display",""),ve(this.$el,"uk-flex")}}]};function Fi({modal:m}){m.dialog=function(_,$){let Q=m(hr(`
    ${_}
    `),{stack:!0,role:"alertdialog",...$});return Q.show(),Qt(Q.$el,"hidden",async()=>{await Promise.resolve(),Q.$destroy(!0)},{self:!0}),Q},m.alert=function(_,$){return S(({i18n:Q})=>`
    ${R(_)?_:Qs(_)}
    `,$)},m.confirm=function(_,$){return S(({i18n:Q})=>`
    ${R(_)?_:Qs(_)}
    `,$,()=>Promise.reject())},m.prompt=function(_,$,Q){let ae=S(({i18n:_e})=>`
    `,Q,()=>null,()=>Se.value),{$el:me}=ae.dialog,Se=hr("input",me);return Se.value=$||"",Qt(me,"show",()=>Se.select()),ae},m.i18n={ok:"Ok",cancel:"Cancel"};function S(_,$,Q=He,ae=He){$={bgClose:!1,escClose:!0,...$,i18n:{...m.i18n,...$?.i18n}};let me=m.dialog(_($),$);return N(new Promise(Se=>{let _e=Qt(me.$el,"hide",()=>Se(Q()));Qt(me.$el,"submit","form",Ke=>{Ke.preventDefault(),Se(ae(me)),_e(),me.hide()})}),{dialog:me})}}var mf={extends:Dx,data:{targets:"> .uk-parent",toggle:"> a",content:"> ul"}};let Yc="uk-navbar-transparent";var hte={extends:Lm,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,S)=>S.closest(".uk-navbar-container")},watch:{items(){let m=ke(this.$el,"uk-navbar-justify"),S=an(".uk-navbar-nav, .uk-navbar-left, .uk-navbar-right",this.$el);for(let _ of S){let $=m?an(".uk-navbar-nav > li > a, .uk-navbar-item, .uk-navbar-toggle",_).length:"";Fe(_,"flexGrow",$)}}},events:[{name:"show",el:({dropContainer:m})=>m,handler({target:m}){this.getTransparentMode(m)==="remove"&&ke(this.navbarContainer,Yc)&&(ve(this.navbarContainer,Yc),this._transparent=!0)}},{name:"hide",el:({dropContainer:m})=>m,async handler(){await dte(),!this.getActive()&&this._transparent&&(Ue(this.navbarContainer,Yc),this._transparent=null)}}],methods:{getTransparentMode(m){if(!this.navbarContainer)return;if(this.dropbar&&this.isDropbarDrop(m))return this.dropbarTransparentMode;let S=this.getDropdown(m);if(S&&ke(m,"uk-dropbar"))return S.inset?"behind":"remove"},getDropbarOffset(m){let{top:S,height:_}=xr(this.navbarContainer);return S+(this.dropbarTransparentMode==="behind"?0:_+m)}}};function dte(){return new Promise(m=>setTimeout(m))}var vte={mixins:[gm],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:S})=>m?S:"",clsOverlay:({overlay:m,clsOverlay:S})=>m?S:"",clsMode:({mode:m,clsMode:S})=>`${S}-${m}`,clsSidebarAnimation:({mode:m,clsSidebarAnimation:S})=>m==="none"||m==="reveal"?"":S,clsContainerAnimation:({mode:m,clsContainerAnimation:S})=>m!=="push"&&m!=="reveal"?"":S,transitionElement({mode:m}){return m==="reveal"?Wt(this.panel):this.panel}},observe:fm({filter:({swiping:m})=>m}),update:{read(){this.isToggled()&&!tt(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"&&!ke(Wt(this.panel),this.clsMode)&&(Qp(this.panel,"
    "),Ue(Wt(this.panel),this.clsMode));let{body:m,scrollingElement:S}=document;Ue(m,this.clsContainer,this.clsFlip),Fe(m,"touch-action","pan-y pinch-zoom"),Fe(this.$el,"display","block"),Fe(this.panel,"maxWidth",S.clientWidth),Ue(this.$el,this.clsOverlay),Ue(this.panel,this.clsSidebarAnimation,this.mode==="reveal"?"":this.clsMode),Wi(m),Ue(m,this.clsContainerAnimation),this.clsContainerAnimation&>e()}},{name:"hide",self:!0,handler(){ve(document.body,this.clsContainerAnimation),Fe(document.body,"touch-action","")}},{name:"hidden",self:!0,handler(){this.clsContainerAnimation&&xte(),this.mode==="reveal"&&No(this.panel),ve(this.panel,this.clsSidebarAnimation,this.clsMode),ve(this.$el,this.clsOverlay),Fe(this.$el,"display",""),Fe(this.panel,"maxWidth",""),ve(document.body,this.clsContainer,this.clsFlip)}},{name:"swipeLeft swipeRight",handler(m){this.isToggled()&&s(m.type,"Left")^this.flip&&this.hide()}}]};function gte(){uO().content+=",user-scalable=0"}function xte(){let m=uO();m.content=m.content.replace(/,user-scalable=0$/,"")}function uO(){return hr('meta[name="viewport"]',document.head)||dn(document.head,'')}var yte={mixins:[Gi],props:{selContainer:String,selContent:String,minHeight:Number},data:{selContainer:".uk-modal",selContent:".uk-modal-dialog",minHeight:150},computed:{container:({selContainer:m},S)=>S.closest(m),content:({selContent:m},S)=>S.closest(m)},observe:si({target:({container:m,content:S})=>[m,S]}),update:{read(){return!this.content||!this.container||!tt(this.$el)?!1:{max:Math.max(this.minHeight,Wi(this.container)-(Zt(this.content).height-Wi(this.$el)))}},write({max:m}){Fe(this.$el,{minHeight:this.minHeight,maxHeight:m})},events:["resize"]}},wte={props:["width","height"],connected(){Ue(this.$el,"uk-responsive-width"),Fe(this.$el,"aspectRatio",`${this.width}/${this.height}`)}},bte={props:{offset:Number},data:{offset:0},connected(){Dte(this)},disconnected(){Nte(this)},methods:{async scrollTo(m){m=m&&hr(m)||document.body,Rt(this.$el,"beforescroll",[this,m])&&(await jd(m,{offset:this.offset}),Rt(this.$el,"scrolled",[this,m]))}}};let Hv=new Set;function Dte(m){Hv.size||Qt(document,"click",lO),Hv.add(m)}function Nte(m){Hv.delete(m),Hv.size||$i(document,"click",lO)}function lO(m){if(!m.defaultPrevented)for(let S of Hv)S.$el.contains(m.target)&&Ta(S.$el)&&(m.preventDefault(),window.location.href!==S.$el.href&&window.history.pushState({},"",S.$el.href),S.scrollTo(Oa(S.$el)))}let tS="uk-scrollspy-inview";var Ste={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},S)=>m?an(m,S):[S]},watch:{elements(m){this.hidden&&Fe(mi(m,`:not(.${tS})`),"opacity",0)}},connected(){this.elementData=new Map},disconnected(){for(let[m,S]of this.elementData.entries())ve(m,tS,S?.cls||"");delete this.elementData},observe:aa({target:({elements:m})=>m,handler(m){let S=this.elementData;for(let{target:_,isIntersecting:$}of m){S.has(_)||S.set(_,{cls:fe(_,"uk-scrollspy-class")||this.cls});let Q=S.get(_);!this.repeat&&Q.show||(Q.show=$)}this.$emit()},options:({margin:m})=>({rootMargin:m}),args:{intersecting:!1}}),update:[{write(m){for(let[S,_]of this.elementData.entries())_.show&&!_.inview&&!_.queued?(_.queued=!0,m.promise=(m.promise||Promise.resolve()).then(()=>new Promise($=>setTimeout($,this.delay))).then(()=>{this.toggle(S,!0),setTimeout(()=>{_.queued=!1,this.$emit()},300)})):!_.show&&_.inview&&!_.queued&&this.repeat&&this.toggle(S,!1)}}],methods:{toggle(m,S){var _,$;let Q=(_=this.elementData)==null?void 0:_.get(m);if(!Q)return;($=Q.off)==null||$.call(Q),Fe(m,"opacity",!S&&this.hidden?0:""),Je(m,tS,S),Je(m,Q.cls);let ae;if(ae=Q.cls.match(/\buk-animation-[\w-]+/g)){let me=()=>ve(m,ae);S?Q.off=Tr(m,"animationcancel animationend",me,{self:!0}):me()}Rt(m,S?"inview":"outview"),Q.inview=S}}},Ete={props:{cls:String,closest:Boolean,scroll:Boolean,overflow:Boolean,offset:Number},data:{cls:"uk-active",closest:!1,scroll:!1,overflow:!0,offset:0},computed:{links:(m,S)=>an('a[href*="#"]',S).filter(_=>_.hash&&Ta(_)),elements({closest:m}){return this.links.map(S=>S.closest(m||"*"))}},watch:{links(m){this.scroll&&this.$create("scroll",m,{offset:this.offset})}},observe:[aa(),Rl()],update:[{read(){let m=this.links.map(Oa).filter(Boolean),{length:S}=m;if(!S||!tt(this.$el))return!1;let _=hs(m,!0),{scrollTop:$,scrollHeight:Q}=_,ae=Eo(_),me=Q-ae.height,Se=!1;if($===me)Se=S-1;else{let _e=this.offset+xr(Hu()).height;for(let Ke=0;Ke0);Ke++)Se=+Ke;Se===!1&&this.overflow&&(Se=0)}return{active:Se}},write({active:m}){let S=m!==!1&&!ke(this.elements[m],this.cls);this.links.forEach(_=>_.blur());for(let _=0;_m&&hr(m,S)||S},connected(){this.start=fO(this.start||this.top),this.end=fO(this.end||this.bottom),this.placeholder=hr("+ .uk-sticky-placeholder",this.$el)||hr('
    '),this.isFixed=!1,this.setActive(!1)},beforeDisconnect(){this.isFixed&&(this.hide(),ve(this.target,this.clsInactive)),cO(this.$el),Do(this.placeholder),this.placeholder=null},observe:[Nc(),Rl({target:()=>document.scrollingElement}),si({target:({$el:m})=>[m,Wt(m),document.scrollingElement],handler(m){this.$emit(this._data.resized&&m.some(({target:S})=>S===Wt(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 S=xr(hr(location.hash)),_=xr(this.$el);this.isFixed&&Ee(S,_)&&(m.scrollTop=Math.ceil(S.top-_.height-ei(this.targetOffset,"height",this.placeholder)-ei(this.offset,"height",this.placeholder)))})}}],update:[{read({height:m,width:S,margin:_,sticky:$},Q){if(this.inactive=!this.matchMedia||!tt(this.$el),this.inactive)return;let ae=this.isFixed&&Q.has("update");ae&&(iS(this.target),this.hide()),this.active||({height:m,width:S}=xr(this.$el),_=Fe(this.$el,"margin")),ae&&this.show();let me=ei("100vh","height"),Se=Wi(window),_e=Math.max(0,document.scrollingElement.scrollHeight-me),Ke=this.position;this.overflowFlip&&m>me&&(Ke=Ke==="top"?"bottom":"top");let je=this.isFixed?this.placeholder:this.$el,xt=ei(this.offset,"height",$?this.$el:je);Ke==="bottom"&&(mxr(Pt).top+(_e?Math.min(Se,me):Se),offsetParentTop:xr(Pt.offsetParent).top,overflowScroll:Oe($+Oe(je,Q,ae)-Oe(m,Q,ae),0,_)}},write(m,S){let _=S.has("scroll"),{initTimestamp:$=0,dir:Q,prevDir:ae,scroll:me,prevScroll:Se=0,top:_e,start:Ke,below:je}=m;if(me<0||me===Se&&_||this.showOnUp&&!_&&!this.isFixed)return;let xt=Date.now();if((xt-$>300||Q!==ae)&&(m.initScroll=me,m.initTimestamp=xt),!(this.showOnUp&&!this.isFixed&&Math.abs(m.initScroll-me)<=30&&Math.abs(Se-me)<=10))if(this.inactive||meme&&(ps.cancel(this.$el),this.hide());return}if(this.animation&&je){if(ke(this.$el,"uk-animation-leave"))return;ps.out(this.$el,this.animation).then(()=>this.hide(),He)}else this.hide()}else this.isFixed?this.update():this.animation&&je?(this.show(),ps.in(this.$el,this.animation).catch(He)):(iS(this.target),this.show())},events:["resize","resizeViewport","scroll"]}],methods:{show(){this.isFixed=!0,this.update(),this.placeholder.hidden=!1},hide(){let{offset:m,sticky:S}=this._data;this.setActive(!1),ve(this.$el,this.clsFixed,this.clsBelow),S?Fe(this.$el,"top",m):Fe(this.$el,{position:"",top:"",width:"",marginTop:""}),this.placeholder.hidden=!0,this.isFixed=!1},update(){let{width:m,scroll:S=0,overflow:_,overflowScroll:$=0,start:Q,end:ae,offset:me,offsetParentTop:Se,sticky:_e,below:Ke}=this._data,je=Q!==0||S>Q;if(!_e){let xt="fixed";S>ae&&(me+=ae-Se+$-_,xt="absolute"),Fe(this.$el,{position:xt,width:m,marginTop:0},"important")}Fe(this.$el,"top",me-$),this.setActive(je),Je(this.$el,this.clsBelow,Ke),Ue(this.$el,this.clsFixed)},setActive(m){let S=this.active;this.active=m,m?(Re(this.target,this.clsInactive,this.clsActive),S!==m&&Rt(this.$el,"active")):(Re(this.target,this.clsActive,this.clsInactive),S!==m&&(iS(this.target),Rt(this.$el,"inactive")))}}};function rS(m,S,_,$){if(!m)return 0;if(z(m)||R(m)&&m.match(/^-?\d/))return _+ei(m,"height",S,!0);{let Q=m===!0?Wt(S):zn(m,S);return xr(Q).bottom-($&&Q?.contains(S)?ie(Fe(Q,"paddingBottom")):0)}}function fO(m){return m==="true"?!0:m==="false"?!1:m}function cO(m){Fe(m,{position:"",top:"",marginTop:"",width:""})}let nS="uk-transition-disable";function iS(m){ke(m,nS)||(Ue(m,nS),requestAnimationFrame(()=>ve(m,nS)))}var Cte={mixins:[se],args:"src",props:{src:String,icon:String,attributes:"list",strokeAnimation:Boolean},data:{strokeAnimation:!1},observe:[ds({async handler(){let m=await this.svg;m&&pO.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&&(pO.call(this,m),this.strokeAnimation&&Ite(m))},methods:{async getSvg(){return Qr(this.$el,"img")&&!this.$el.complete&&this.$el.loading==="lazy"&&await new Promise(m=>Tr(this.$el,"load",m)),Tte(await Mte(this.src),this.icon)||Promise.reject("SVG not found.")}}};function pO(m){let{$el:S}=this;Ue(m,et(S,"class"),"uk-svg");for(let _=0;_m?a(m,"data:")?decodeURIComponent(m.split(",")[1]):(await fetch(m)).text():Promise.reject());function Tte(m,S){return S&&f(m,"/g,Ote=be(function(m){let S={};mO.lastIndex=0;let _;for(;_=mO.exec(m);)S[_[3]]=``;return S});function Ite(m){let S=Nv(m);S&&Fe(m,"--uk-animation-stroke",S)}let oS=".uk-disabled *, .uk-disabled, [disabled]";var hO={mixins:[Co],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},S)=>jo(m,S),observe:({connect:m})=>m},connectChildren(){return this.connects.map(m=>Sr(m)).flat()},toggles:({toggle:m},S)=>an(m,S),children(m,S){return Sr(S).filter(_=>this.toggles.some($=>_.contains($)))}},watch:{connects(m){this.swiping&&Fe(m,"touchAction","pan-y pinch-zoom"),this.$emit()},connectChildren(){let m=Math.max(0,this.index());for(let S of this.connects)Sr(S).forEach((_,$)=>Je(_,this.cls,$===m));this.$emit()},toggles(m){this.$emit();let S=this.index();this.show(~S?S:m[this.active]||m[0])}},connected(){et(this.$el,"role","tablist")},observe:[Pl({targets:({connectChildren:m})=>m}),fm({target:({connects:m})=>m,filter:({swiping:m})=>m})],events:[{name:"click keydown",delegate:({toggle:m})=>m,handler(m){!tr(m.current,oS)&&(m.type==="click"||m.keyCode===Or.SPACE)&&(m.preventDefault(),this.show(m.current))}},{name:"keydown",delegate:({toggle:m})=>m,handler(m){let{current:S,keyCode:_}=m,$=tr(this.$el,this.selVertical),Q=_===Or.HOME?0:_===Or.END?"last":_===Or.LEFT&&!$||_===Or.UP&&$?"previous":_===Or.RIGHT&&!$||_===Or.DOWN&&$?"next":-1;if(~Q){m.preventDefault();let ae=this.toggles.filter(Se=>!tr(Se,oS)),me=ae[de(Q,ae,ae.indexOf(S))];me.focus(),this.followFocus&&this.show(me)}}},{name:"click",el:({$el:m,connects:S,itemNav:_})=>S.concat(_?jo(_,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 S of this.connects)Qr(S,"ul")&&et(S,"role","presentation");et(Sr(this.$el),"role","presentation");for(let S in this.toggles){let _=this.toggles[S],$=(m=this.connects[0])==null?void 0:m.children[S];et(_,"role","tab"),$&&(_.id=uu(this,_),$.id=uu(this,$),et(_,"aria-controls",$.id),et($,{role:"tabpanel","aria-labelledby":_.id}))}et(this.$el,"aria-orientation",tr(this.$el,this.selVertical)?"vertical":null)},methods:{index(){return p(this.children,m=>ke(m,this.cls))},show(m){let S=this.toggles.filter(me=>!tr(me,oS)),_=this.index(),$=de(!I(m)||f(S,m)?m:0,S,de(this.toggles[_],S)),Q=de(S[$],this.toggles);this.children.forEach((me,Se)=>{Je(me,this.cls,Q===Se),et(this.toggles[Se],{"aria-selected":Q===Se,tabindex:Q===Se?null:-1})});let ae=_>=0&&_!==$;this.connects.forEach(async({children:me})=>{let Se=y(me).filter((_e,Ke)=>Ke!==Q&&ke(_e,this.cls));await this.toggleElement(Se,!1,ae)&&await this.toggleElement(me[Q],!0,ae)})}}},Fte={mixins:[Gi],extends:hO,props:{media:Boolean},data:{media:960,attrItem:"uk-tab-item",selVertical:".uk-tab-left,.uk-tab-right"},connected(){let m=ke(this.$el,"uk-tab-left")?"uk-tab-left":ke(this.$el,"uk-tab-right")?"uk-tab-right":!1;m&&this.$create("toggle",this.$el,{cls:m,mode:"media",media:this.media})}};let _te=32;var kte={mixins:[xs,Co],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},S)=>(m=jo(m||S.hash,S),m.length?m:[S]),observe:({target:m})=>m}},connected(){f(this.mode,"media")||(Vr(this.$el)||et(this.$el,"tabindex","0"),!this.cls&&Qr(this.$el,"a")&&et(this.$el,"role","button"))},observe:Pl({targets:({target:m})=>m}),events:[{name:we,filter:({mode:m})=>f(m,"hover"),handler(m){this._preventClick=null,!(!st(m)||P(this._showState)||this.$el.disabled)&&(Rt(this.$el,"focus"),Tr(document,we,()=>Rt(this.$el,"blur"),!0,S=>!this.$el.contains(S.target)),f(this.mode,"click")&&(this._preventClick=!0))}},{name:`mouseenter mouseleave ${it} ${Xe} focus blur`,filter:({mode:m})=>f(m,"hover"),handler(m){if(st(m)||this.$el.disabled)return;let S=f(["mouseenter",it,"focus"],m.type),_=this.isToggled(this.target);if(!S&&(!P(this._showState)||m.type!=="blur"&&tr(this.$el,":focus")||m.type==="blur"&&tr(this.$el,":hover"))){_===this._showState&&(this._showState=null);return}S&&P(this._showState)&&_!==this._showState||(this._showState=S?_:null,this.toggle(`toggle${S?"show":"hide"}`))}},{name:"keydown",filter:({$el:m,mode:S})=>f(S,"click")&&!Qr(m,"input"),handler(m){m.keyCode===_te&&(m.preventDefault(),this.$el.click())}},{name:"click",filter:({mode:m})=>["click","hover"].some(S=>f(m,S)),handler(m){let S;(this._preventClick||m.target.closest('a[href="#"], a[href=""]')||(S=m.target.closest("a[href]"))&&(!this.isToggled(this.target)||S.hash&&tr(this.target,S.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,S){S.matches^this.isToggled(this.target)&&this.toggle()}}],methods:{async toggle(m){if(!Rt(this.target,m||"toggle",[this]))return;if(ut(this.$el,"aria-expanded")&&et(this.$el,"aria-expanded",!this.isToggled(this.target)),!this.queued)return this.toggleElement(this.target);let S=this.target.filter($=>ke($,this.clsLeave));if(S.length){for(let $ of this.target){let Q=f(S,$);this.toggleElement($,Q,Q)}return}let _=this.target.filter(this.isToggled);await this.toggleElement(_,!1)&&await this.toggleElement(this.target.filter($=>!f(_,$)),!0)}}},Bte=Object.freeze({__proto__:null,Accordion:Dx,Alert:Nx,Close:Vt,Cover:Pv,Drop:qv,DropParentIcon:mt,Dropdown:qv,Dropnav:Lm,FormCustom:la,Grid:Pm,HeightMatch:Ix,HeightPlaceholder:Fx,HeightViewport:qr,Icon:at,Img:Gn,Inverse:ii,Leader:el,Margin:vs,Marker:vr,Modal:tl,Nav:mf,NavParentIcon:yt,Navbar:hte,NavbarParentIcon:mt,NavbarToggleIcon:Kt,Offcanvas:vte,OverflowAuto:yte,OverlayIcon:mt,PaginationNext:ni,PaginationPrevious:mn,Responsive:wte,Scroll:bte,Scrollspy:Ste,ScrollspyNav:Ete,SearchIcon:Dt,SlidenavNext:Ot,SlidenavPrevious:Ot,Spinner:At,Sticky:Ate,Svg:Cte,Switcher:hO,Tab:Fte,Toggle:kte,Totop:Gr,Video:Sx});return ye(Bte,(m,S)=>Vn.component(S,m)),wx(Vn),ye(yx,(m,S)=>Vn.component(S,m)),Vn})});var xy=dt((KS,JS)=>{v();x();g();(function(e,t){typeof KS=="object"&&typeof JS<"u"?JS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e["'typed'"]=t())})(KS,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 pe=s.get(ne);if(pe)return pe;let we='Unknown type "'+ne+'"',Le=ne.toLowerCase(),Qe;for(Qe of f)if(Qe.toLowerCase()===Le){we+='. Did you mean "'+Qe+'" ?';break}throw new TypeError(we)}function N(ne){let pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any",we=pe?y(pe).index:f.length,Le=[];for(let it=0;it{let Le=s.get(we);return!Le.isAny&&Le.test(ne)});return pe.length?pe:["any"]}function O(ne){return ne&&typeof ne=="function"&&"_typedFunctionData"in ne}function M(ne,pe,we){if(!O(ne))throw new TypeError(n);let Le=we&&we.exact,Qe=Array.isArray(pe)?pe.join(","):pe,it=z(Qe),Xe=C(it);if(!Le||Xe in ne.signatures){let Ye=ne._typedFunctionData.signatureMap.get(Xe);if(Ye)return Ye}let pt=it.length,Y;if(Le){Y=[];let Ye;for(Ye in ne.signatures)Y.push(ne._typedFunctionData.signatureMap.get(Ye))}else Y=ne._typedFunctionData.signatures;for(let Ye=0;Ye!Vr.has(Wt.name)))continue}wt.push(kt)}}if(Y=wt,Y.length===0)break}let xe;for(xe of Y)if(xe.params.length<=pt)return xe;throw new TypeError("Signature not found (signature: "+(ne.name||"unnamed")+"("+C(it,", ")+"))")}function I(ne,pe,we){return M(ne,pe,we).implementation}function F(ne,pe){let we=y(pe);if(we.test(ne))return ne;let Le=we.conversionsTo;if(Le.length===0)throw new Error("There are no conversions to "+pe+" defined.");for(let Qe=0;Qe1&&arguments[1]!==void 0?arguments[1]:",";return ne.map(we=>we.name).join(pe)}function P(ne){let pe=ne.indexOf("...")===0,Le=(pe?ne.length>3?ne.slice(3):"any":ne).split("|").map(pt=>y(pt.trim())),Qe=!1,it=pe?"...":"";return{types:Le.map(function(pt){return Qe=pt.isAny||Qe,it+=pt.name+"|",{name:pt.name,typeIndex:pt.index,test:pt.test,isAny:pt.isAny,conversion:null,conversionIndex:-1}}),name:it.slice(0,-1),hasAny:Qe,hasConversion:!1,restParam:pe}}function R(ne){let pe=ne.types.map(Xe=>Xe.name),we=ce(pe),Le=ne.hasAny,Qe=ne.name,it=we.map(function(Xe){let pt=y(Xe.from);return Le=pt.isAny||Le,Qe+="|"+Xe.from,{name:Xe.from,typeIndex:pt.index,test:pt.test,isAny:pt.isAny,conversion:Xe,conversionIndex:Xe.index}});return{types:ne.types.concat(it),name:Qe,hasAny:Le,hasConversion:it.length>0,restParam:ne.restParam}}function q(ne){return ne.typeSet||(ne.typeSet=new Set,ne.types.forEach(pe=>ne.typeSet.add(pe.name))),ne.typeSet}function z(ne){let pe=[];if(typeof ne!="string")throw new TypeError("Signatures must be strings");let we=ne.trim();if(we==="")return pe;let Le=we.split(",");for(let Qe=0;Qe=Qe+1}}else return ne.length===0?function(it){return it.length===0}:ne.length===1?(we=V(ne[0]),function(it){return we(it[0])&&it.length===1}):ne.length===2?(we=V(ne[0]),Le=V(ne[1]),function(it){return we(it[0])&&Le(it[1])&&it.length===2}):(pe=ne.map(V),function(it){for(let Xe=0;Xe{let Qe=ie(Le.params,pe),it;for(it of Qe)we.add(it)}),we.has("any")?["any"]:Array.from(we)}function le(ne,pe,we){let Le,Qe,it=ne||"unnamed",Xe=we,pt;for(pt=0;pt{let kt=ee(wt.params,pt),ur=V(kt);(pt0){let wt=b(pe[pt]);return Le=new TypeError("Unexpected type of argument in function "+it+" (expected: "+Qe.join(" or ")+", actual: "+wt.join(" | ")+", index: "+pt+")"),Le.data={category:"wrongType",fn:it,index:pt,actual:wt,expected:Qe},Le}}else Xe=tt}let Y=Xe.map(function(tt){return H(tt.params)?1/0:tt.params.length});if(pe.lengthxe)return Le=new TypeError("Too many arguments in function "+it+" (expected: "+xe+", actual: "+pe.length+")"),Le.data={category:"tooManyArgs",fn:it,index:pe.length,expectedLength:xe},Le;let Ye=[];for(let tt=0;tt0)return 1;let Le=he(ne)-he(pe);return Le<0?-1:Le>0?1:0}function ye(ne,pe){let we=ne.params,Le=pe.params,Qe=de(we),it=de(Le),Xe=H(we),pt=H(Le);if(Xe&&Qe.hasAny){if(!pt||!it.hasAny)return 1}else if(pt&&it.hasAny)return-1;let Y=0,xe=0,Ye;for(Ye of we)Ye.hasAny&&++Y,Ye.hasConversion&&++xe;let tt=0,wt=0;for(Ye of Le)Ye.hasAny&&++tt,Ye.hasConversion&&++wt;if(Y!==tt)return Y-tt;if(Xe&&Qe.hasConversion){if(!pt||!it.hasConversion)return 1}else if(pt&&it.hasConversion)return-1;if(xe!==wt)return xe-wt;if(Xe){if(!pt)return 1}else if(pt)return-1;let kt=(we.length-Le.length)*(Xe?-1:1);if(kt!==0)return kt;let ur=[],Vr=0;for(let mi=0;mi1&&pe.sort((Qe,it)=>Qe.index-it.index);let we=pe[0].conversionsTo;if(ne.length===1)return we;we=we.concat([]);let Le=new Set(ne);for(let Qe=1;QeQe.hasConversion)){let Qe=H(ne),it=ne.map(Pe);we=function(){let pt=[],Y=Qe?arguments.length-1:arguments.length;for(let xe=0;xeY.name).join("|"),hasAny:pt.some(Y=>Y.isAny),hasConversion:!1,restParam:!0}),Xe.push(it)}else Xe=it.types.map(function(pt){return{types:[pt],name:pt.name,hasAny:pt.isAny,hasConversion:pt.conversion,restParam:!1}});return ve(Xe,function(pt){return pe(we,Le+1,Qe.concat([pt]))})}else return[Qe]}return pe(ne,0,[])}function Oe(ne,pe){let we=Math.max(ne.length,pe.length);for(let pt=0;pt=Le:Xe?Le>=Qe:Le===Qe}function He(ne){return ne.map(pe=>et(pe)?Je(pe.referToSelf.callback):ot(pe)?ke(pe.referTo.references,pe.referTo.callback):pe)}function Ee(ne,pe,we){let Le=[],Qe;for(Qe of ne){let it=we[Qe];if(typeof it!="number")throw new TypeError('No definition for referenced signature "'+Qe+'"');if(it=pe[it],typeof it!="function")return!1;Le.push(it)}return Le}function ze(ne,pe,we){let Le=He(ne),Qe=new Array(Le.length).fill(!1),it=!0;for(;it;){it=!1;let Xe=!0;for(let pt=0;pt{let Le=ne[we];if(pe.test(Le.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 Be(ne,pe){if(h.createCount++,Object.keys(pe).length===0)throw new SyntaxError("No signatures provided");h.warnAgainstDeprecatedThis&&We(pe);let we=[],Le=[],Qe={},it=[],Xe;for(Xe in pe){if(!Object.prototype.hasOwnProperty.call(pe,Xe))continue;let ue=z(Xe);if(!ue)continue;we.forEach(function(nt){if(Oe(nt,ue))throw new TypeError('Conflicting signatures "'+C(nt)+'" and "'+C(ue)+'".')}),we.push(ue);let Me=Le.length;Le.push(pe[Xe]);let st=ue.map(R),ht;for(ht of Ce(st)){let nt=C(ht);it.push({params:ht,name:nt,fn:Me}),ht.every(Fe=>!Fe.hasConversion)&&(Qe[nt]=Me)}}it.sort(ye);let pt=ze(Le,Qe,Un),Y;for(Y in Qe)Object.prototype.hasOwnProperty.call(Qe,Y)&&(Qe[Y]=pt[Qe[Y]]);let xe=[],Ye=new Map;for(Y of it)Ye.has(Y.name)||(Y.fn=pt[Y.fn],xe.push(Y),Ye.set(Y.name,Y));let tt=xe[0]&&xe[0].params.length<=2&&!H(xe[0].params),wt=xe[1]&&xe[1].params.length<=2&&!H(xe[1].params),kt=xe[2]&&xe[2].params.length<=2&&!H(xe[2].params),ur=xe[3]&&xe[3].params.length<=2&&!H(xe[3].params),Vr=xe[4]&&xe[4].params.length<=2&&!H(xe[4].params),Wt=xe[5]&&xe[5].params.length<=2&&!H(xe[5].params),mi=tt&&wt&&kt&&ur&&Vr&&Wt;for(let ue=0;ueue.test),ra=xe.map(ue=>ue.implementation),Lu=function(){for(let Me=ao;MeC(z(we))),pe=de(arguments);if(typeof pe!="function")throw new TypeError("Callback function expected as last argument");return ke(ne,pe)}function ke(ne,pe){return{referTo:{references:ne,callback:pe}}}function Je(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 et(ne){return ne&&typeof ne.referToSelf=="object"&&typeof ne.referToSelf.callback=="function"}function ut(ne,pe){if(!ne)return pe;if(pe&&pe!==ne){let we=new Error("Function names do not match (expected: "+ne+", actual: "+pe+")");throw we.data={actual:pe,expected:ne},we}return ne}function Lt(ne){let pe;for(let we in ne)Object.prototype.hasOwnProperty.call(ne,we)&&(O(ne[we])||typeof ne[we].signature=="string")&&(pe=ut(pe,ne[we].name));return pe}function fe(ne,pe){let we;for(we in pe)if(Object.prototype.hasOwnProperty.call(pe,we)){if(we in ne&&pe[we]!==ne[we]){let Le=new Error('Signature "'+we+'" is defined twice');throw Le.data={signature:we,sourceFunction:pe[we],destFunction:ne[we]},Le}ne[we]=pe[we]}}let J=h;h=function(ne){let pe=typeof ne=="string",we=pe?1:0,Le=pe?ne:"",Qe={};for(let it=we;itQe.from===ne.from);if(!we)throw new Error("Attempt to remove nonexistent conversion from "+ne.from+" to "+ne.to);if(we.convert!==ne.convert)throw new Error("Conversion to remove does not match existing conversion");let Le=pe.conversionsTo.indexOf(we);pe.conversionsTo.splice(Le,1)},h.resolve=function(ne,pe){if(!O(ne))throw new TypeError(n);let we=ne._typedFunctionData.signatures;for(let Le=0;Le{v();x();g();(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,N,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,N=h*h+f*f,w=N!==0?new a((y*h-f*f)/N,(f*h+y*f)/N):new a(s!==-1?s/0:0,f!==0?f/0:0),D=w.re;return w.re=u(w.re,w.im)/2,w.im=Math.atan2(w.im,D)/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){v();x();g();(function(e){"use strict";var t=2e3,r={s:1,n:0,d:1};function n(w,D){if(isNaN(w=parseInt(w,10)))throw y();return w*D}function i(w,D){if(D===0)throw h();var b=Object.create(p.prototype);b.s=w<0?-1:1,w=w<0?-w:w;var O=f(w,D);return b.n=w/O,b.d=D/O,b}function o(w){for(var D={},b=w,O=2,M=4;M<=b;){for(;b%O===0;)b/=O,D[O]=(D[O]||0)+1;M+=1+2*O++}return b!==w?b>1&&(D[b]=(D[b]||0)+1):D[w]=(D[w]||0)+1,D}var u=function(w,D){var b=0,O=1,M=1,I=0,F=0,C=0,P=1,R=1,q=0,z=1,H=1,V=1,W=1e7,ee;if(w!=null)if(D!==void 0){if(b=w,O=D,M=b*O,b%1!==0||O%1!==0)throw N()}else switch(typeof w){case"object":{if("d"in w&&"n"in w)b=w.n,O=w.d,"s"in w&&(b*=w.s);else if(0 in w)b=w[0],1 in w&&(O=w[1]);else throw y();M=b*O;break}case"number":{if(w<0&&(M=w,w=-w),w%1===0)b=w;else if(w>0){for(w>=1&&(R=Math.pow(10,Math.floor(1+Math.log(w)/Math.LN10)),w/=R);z<=W&&V<=W;)if(ee=(q+H)/(z+V),w===ee){z+V<=W?(b=q+H,O=z+V):V>z?(b=H,O=V):(b=q,O=z);break}else w>ee?(q+=H,z+=V):(H+=q,V+=z),z>W?(b=H,O=V):(b=q,O=z);b*=R}else(isNaN(w)||isNaN(D))&&(O=b=NaN);break}case"string":{if(z=w.match(/\d+|./g),z===null)throw y();if(z[q]==="-"?(M=-1,q++):z[q]==="+"&&q++,z.length===q+1?F=n(z[q++],M):z[q+1]==="."||z[q]==="."?(z[q]!=="."&&(I=n(z[q++],M)),q++,(q+1===z.length||z[q+1]==="("&&z[q+3]===")"||z[q+1]==="'"&&z[q+3]==="'")&&(F=n(z[q],M),P=Math.pow(10,z[q].length),q++),(z[q]==="("&&z[q+2]===")"||z[q]==="'"&&z[q+2]==="'")&&(C=n(z[q+1],M),R=Math.pow(10,z[q+1].length)-1,q+=3)):z[q+1]==="/"||z[q+1]===":"?(F=n(z[q],M),P=n(z[q+2],1),q+=3):z[q+3]==="/"&&z[q+1]===" "&&(I=n(z[q],M),F=n(z[q+2],M),P=n(z[q+4],1),q+=5),z.length<=q){O=P*R,M=b=C+O*I+R*F;break}}default:throw y()}if(O===0)throw h();r.s=M<0?-1:1,r.n=Math.abs(b),r.d=Math.abs(O)};function l(w,D,b){for(var O=1;D>0;w=w*w%b,D>>=1)D&1&&(O=O*w%b);return O}function a(w,D){for(;D%2===0;D/=2);for(;D%5===0;D/=5);if(D===1)return 0;for(var b=10%D,O=1;b!==1;O++)if(b=b*10%D,O>t)return 0;return O}function s(w,D,b){for(var O=1,M=l(10,b,D),I=0;I<300;I++){if(O===M)return I;O=O*10%D,M=M*10%D}return 0}function f(w,D){if(!w)return D;if(!D)return w;for(;;){if(w%=D,!w)return D;if(D%=w,!D)return w}}function p(w,D){if(u(w,D),this instanceof p)w=f(r.d,r.n),this.s=r.s,this.n=r.n/w,this.d=r.d/w;else return i(r.s*r.n,r.d)}var h=function(){return new Error("Division by Zero")},y=function(){return new Error("Invalid argument")},N=function(){return new Error("Parameters must be integer")};p.prototype={s:1,n:0,d:1,abs:function(){return i(this.n,this.d)},neg:function(){return i(-this.s*this.n,this.d)},add:function(w,D){return u(w,D),i(this.s*this.n*r.d+r.s*this.d*r.n,this.d*r.d)},sub:function(w,D){return u(w,D),i(this.s*this.n*r.d-r.s*this.d*r.n,this.d*r.d)},mul:function(w,D){return u(w,D),i(this.s*r.s*this.n*r.n,this.d*r.d)},div:function(w,D){return u(w,D),i(this.s*r.s*this.n*r.d,this.d*r.n)},clone:function(){return i(this.s*this.n,this.d)},mod:function(w,D){if(isNaN(this.n)||isNaN(this.d))return new p(NaN);if(w===void 0)return i(this.s*this.n%this.d,1);if(u(w,D),r.n===0&&this.d===0)throw h();return i(this.s*(r.d*this.n)%(r.n*this.d),r.d*this.d)},gcd:function(w,D){return u(w,D),i(f(r.n,this.n)*f(r.d,this.d),r.d*this.d)},lcm:function(w,D){return u(w,D),r.n===0&&this.n===0?i(0,1):i(r.n*this.n,f(r.n,this.n)*f(r.d,this.d))},ceil:function(w){return w=Math.pow(10,w||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):i(Math.ceil(w*this.s*this.n/this.d),w)},floor:function(w){return w=Math.pow(10,w||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):i(Math.floor(w*this.s*this.n/this.d),w)},round:function(w){return w=Math.pow(10,w||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):i(Math.round(w*this.s*this.n/this.d),w)},inverse:function(){return i(this.s*this.d,this.n)},pow:function(w,D){if(u(w,D),r.d===1)return r.s<0?i(Math.pow(this.s*this.d,r.n),Math.pow(this.n,r.n)):i(Math.pow(this.s*this.n,r.n),Math.pow(this.d,r.n));if(this.s<0)return null;var b=o(this.n),O=o(this.d),M=1,I=1;for(var F in b)if(F!=="1"){if(F==="0"){M=0;break}if(b[F]*=r.n,b[F]%r.d===0)b[F]/=r.d;else return null;M*=Math.pow(F,b[F])}for(var F in O)if(F!=="1"){if(O[F]*=r.n,O[F]%r.d===0)O[F]/=r.d;else return null;I*=Math.pow(F,O[F])}return r.s<0?i(I,M):i(M,I)},equals:function(w,D){return u(w,D),this.s*this.n*r.d===r.s*r.n*this.d},compare:function(w,D){u(w,D);var b=this.s*this.n*r.d-r.s*r.n*this.d;return(0=0;I--)M=M.inverse().add(b[I]);if(Math.abs(M.sub(D).valueOf())0&&(b+=D,b+=" ",O%=M),b+=O,b+="/",b+=M),b},toLatex:function(w){var D,b="",O=this.n,M=this.d;return this.s<0&&(b+="-"),M===1?b+=O:(w&&(D=Math.floor(O/M))>0&&(b+=D,O%=M),b+="\\frac{",b+=O,b+="}{",b+=M,b+="}"),b},toContinued:function(){var w,D=this.n,b=this.d,O=[];if(isNaN(D)||isNaN(b))return O;do O.push(Math.floor(D/b)),w=D%b,D=b,b=w;while(D!==1);return O},toString:function(w){var D=this.n,b=this.d;if(isNaN(D)||isNaN(b))return"NaN";w=w||15;var O=a(D,b),M=s(D,b,O),I=this.s<0?"-":"";if(I+=D/b|0,D%=b,D*=10,D&&(I+="."),O){for(var F=M;F--;)I+=D/b|0,D%=b,D*=10;I+="(";for(var F=O;F--;)I+=D/b|0,D%=b,D*=10;I+=")"}else for(var F=w;D&&F--;)I+=D/b|0,D%=b,D*=10;return I}},typeof wE=="object"?(Object.defineProperty(p,"__esModule",{value:!0}),p.default=p,p.Fraction=p,HF.exports=p):e.Fraction=p})(wE)});var oB=dt(($Ve,iB)=>{v();x();g();iB.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),N=parseInt(f.match(u),16)||y&&f.match(o)&&Date.parse(f)||null,w,D;if(N){if(yN)return 1}for(var b=0,O=Math.max(p.length,h.length);bD)return 1}return 0}});var b6=dt((Ntt,w6)=>{"use strict";v();x();g();var CA=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?afe:i,u=String(e),l="",a=o(CA({},ife),n?CA({},ofe):{}),s=Object.keys(a),f=function(){var h=!1;s.forEach(function(y,N){h||u.length>=y.length&&u.slice(0,y.length)===y&&(l+=a[s[N]],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 Wq=dt(($q,BA)=>{v();x();g();(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})($q,typeof BA=="object"&&BA,typeof define=="function"&&define)});var Gq=dt((Vq,LA)=>{v();x();g();(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})(Vq,typeof LA=="object"&&LA,typeof define=="function"&&define)});var Zq=dt((Yq,PA)=>{v();x();g();(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})(Yq,typeof PA=="object"&&PA,typeof define=="function"&&define)});var Kq=dt((Xq,RA)=>{v();x();g();(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})(Xq,typeof RA=="object"&&RA,typeof define=="function"&&define)});var Qq=dt((Jq,qA)=>{v();x();g();(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,N,w,D=[],b=128;for(f===(f|0)?(h=f,f=null):(f=f+"\0",h=0,b=Math.max(b,f.length)),y=0,N=-32;N>>15,h^=h<<4,h^=h>>>13,N>=0&&(w=w+1640531527|0,p=D[N&127]^=h+w,y=p==0?y+1:0);for(y>=128&&(D[(f&&f.length||0)&127]=-1),y=127,N=4*128;N>0;--N)h=D[y+34&127],p=D[y=y+1&127],h^=h<<13,p^=p<<17,h^=h>>>15,p^=p>>>12,D[y]=h^p;s.w=w,s.X=D,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})(Jq,typeof qA=="object"&&qA,typeof define=="function"&&define)});var ez=dt((jq,zA)=>{v();x();g();(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})(jq,typeof zA=="object"&&zA,typeof define=="function"&&define)});var tz={};La(tz,{default:()=>Nce});var Nce,rz=Te(()=>{v();x();g();Nce={}});var iz=dt((nz,Ww)=>{v();x();g();(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=D(w(I.entropy?[M,O(t)]:M??b(),3),C),R=new y(C),q=function(){for(var z=R.g(i),H=l,V=0;z=s;)z/=2,H/=2,V>>>=1;return(z+V)/H};return q.int32=function(){return R.g(4)|0},q.quick=function(){return R.g(4)/4294967296},q.double=q,D(O(R.S),t),(I.pass||F||function(z,H,V,W){return W&&(W.S&&N(W,R),z.state=function(){return N(R,{})}),V?(r[u]=z,H):z})(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{v();x();g();var Sce=Wq(),Ece=Gq(),Ace=Zq(),Cce=Kq(),Mce=Qq(),Tce=ez(),pp=iz();pp.alea=Sce;pp.xor128=Ece;pp.xorwow=Ace;pp.xorshift7=Cce;pp.xor4096=Mce;pp.tychei=Tce;oz.exports=pp});var kH=dt((gRt,YA)=>{v();x();g();function GA(){}GA.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{v();x();g();(function(e,t){typeof ZA=="object"?qH.exports=t():typeof define=="function"&&define.amd?define(t):e.jStat=t()})(ZA,function(){var e=function(t,r){var n=Array.prototype.concat,i=Array.prototype.slice,o=Object.prototype.toString;function u(D,b){var O=D>b?D:b;return t.pow(10,17-~~(t.log(O>0?O:-O)*t.LOG10E))}var l=Array.isArray||function(b){return o.call(b)==="[object Array]"};function a(D){return o.call(D)==="[object Function]"}function s(D){return typeof D=="number"?D-D===0:!1}function f(D){return n.apply([],D)}function p(){return new p._init(arguments)}p.fn=p.prototype,p._init=function(b){if(l(b[0]))if(l(b[0][0])){a(b[1])&&(b[0]=p.map(b[0],b[1]));for(var O=0;O=0;O--,I++)M[I]=[b[I][O]];return M},p.transpose=function(b){var O=[],M,I,F,C,P;for(l(b[0])||(b=[b]),I=b.length,F=b[0].length,P=0;P0&&(P[I][0]=b[I][0]),R=1;RO&&M>0)return[];if(M>0)for(F=b;FO;F+=M)I.push(F);return I},p.slice=function(){function D(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 b(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||{},D(C,I.start,I.end,I.step)}if(s(M.col)){var P=p.cola(O,M.col);return F=M.row||{},D(P,F.start,F.end,F.step)}F=M.row||{},I=M.col||{};var R=D(O,F.start,F.end,F.step);return R.map(function(q){return D(q,I.start,I.end,I.step)})}return b}(),p.sliceAssign=function(b,O,M){var I,F;if(s(O.row)){if(s(O.col))return b[O.row][O.col]=M;O.col=O.col||{},O.col.start=O.col.start||0,O.col.end=O.col.end||b[0].length,O.col.step=O.col.step||1,I=p.arange(O.col.start,t.min(b.length,O.col.end),O.col.step);var C=O.row;return I.forEach(function(R,q){b[C][R]=M[q]}),b}if(s(O.col)){O.row=O.row||{},O.row.start=O.row.start||0,O.row.end=O.row.end||b.length,O.row.step=O.row.step||1,F=p.arange(O.row.start,t.min(b[0].length,O.row.end),O.row.step);var P=O.col;return F.forEach(function(R,q){b[R][P]=M[q]}),b}return M[0].length===r&&(M=[M]),O.row.start=O.row.start||0,O.row.end=O.row.end||b.length,O.row.step=O.row.step||1,O.col.start=O.col.start||0,O.col.end=O.col.end||b[0].length,O.col.step=O.col.step||1,F=p.arange(O.row.start,t.min(b.length,O.row.end),O.row.step),I=p.arange(O.col.start,t.min(b[0].length,O.col.end),O.col.step),F.forEach(function(R,q){I.forEach(function(z,H){b[R][z]=M[q][H]})}),b},p.diagonal=function(b){var O=p.zeros(b.length,b.length);return b.forEach(function(M,I){O[I][I]=M}),O},p.copy=function(b){return b.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(b,O){return p(p.map(this,b,O))},w.cumreduce=function(b,O){return p(p.cumreduce(this,b,O))},w.alter=function(b){return p.alter(this,b),this},function(D){for(var b=0;b=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?(N=[f[w]],h=p,y=0):p===h&&(N.push(f[w]),y++),p=1);return y===0?N[0]:N},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],N=a.length,w,D,b,O,M,I;for(typeof f>"u"&&(f=3/8),typeof p>"u"&&(p=3/8),w=0;w1){for(N=f===!0?this:this.transpose();y1){for(s!=="sumrow"&&(N=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,N,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(N=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,Np)for(h=0;h=1?i:1/i)*8.5+i*.4+17),D;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,N,w,D,b;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),D=r.exp(l*(w-1)-s),N=i<.5?i:1-i,h=r.sqrt(-2*r.log(N)),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=D*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,N,w,D,b,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,N=r.sqrt(-2*r.log(y)),b=(2.30753+N*.27061)/(1+N*(.99229+N*.04481))-N,i<.5&&(b=-b),O=(b*b-3)/6,M=2/(1/(2*o-1)+1/(2*u-1)),I=b*r.sqrt(O+M)/M-(1/(2*u-1)-1/(2*o-1))*(O+5/6-2/(3*M)),b=o/(o+u*r.exp(2*I))):(p=r.log(o/(o+u)),h=r.log(u/(o+u)),N=r.exp(o*p)/o,w=r.exp(u*h)/u,I=N+w,i=1&&(b=.5*(b+N+1)),r.abs(N)0)break}return b},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;)D=w,O>0&&(M*=f*f/(2*O),I*=f*f/(2*(O+1/2))),w=M*t.beta.cdf(b,O+.5,s/2)+I*t.beta.cdf(b,O+1,s/2),N+=.5*w,O++;return y?1-N:N}}),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;)D=y,b=-(a+w)*(a+s+w)*l/(a+2*w)/(a+2*w+1),p=y+b*p,h=N+b*h,w=w+1,b=w*(s-w)*l/(a+2*w-1)/(a+2*w),y=p+b*y,N=h+b*N,p=p/N,h=h/N,y=y/N,N=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,N=a+1,w=s-a,D=N+w,b=r.exp(t.gammaln(D)-t.gammaln(w)-t.gammaln(N)+N*r.log(y)+w*r.log(1-y));return y<(N+1)/(D+2)?p=b*n(y,N,w,h):p=1-b*n(1-y,w,N,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&&Np);return f-1},sampleLarge:function(a){var s=a,f,p,h,y,N,w,D,b,O,M;for(y=r.sqrt(s),N=r.log(s),D=.931+2.53*y,w=-.059+.02483*D,b=1.1239+1.1328/(D-3.4),O=.9277-3.6224/(D-2);;){if(p=r.random()-.5,h=r.random(),M=.5-r.abs(p),f=r.floor((2*w/M+D)*p+s+.43),M>=.07&&h<=O)return f;if(!(f<0||M<.013&&h>M)&&r.log(h)+r.log(b)-r.log(w/(M*M)+D)<=-s+f*N-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>D?P=b:P=O;for(var R=F,q=(w-F)/P,z=R+q,H=0,V=s-1,W=1;W<=P;W++){for(var ee=0,ie=.5*(z+R),X=.5*(z-R),Z=1;Z<=f;Z++){var le,re;pN)break;var ce=2*t.normal.cdf(De,0,1,1,0),Ne=2*t.normal.cdf(De,l,1,1,0),Pe=ce*.5-Ne*.5;Pe>=r.exp(h/V)&&(Pe=I[le-1]*r.exp(-(.5*ye))*r.pow(Pe,V),ee+=Pe)}ee*=2*X*s/r.sqrt(2*r.PI),H+=ee,R=z,z+=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,N=-.342242088547,w=.531103462366,D=-.204231210125,b=.10353775285,O=-453642210148e-16,M=.0038560700634,I=.8832,F=.2368,C=1.214,P=1.208,R=1.4142,q=120,z=.5-.5*l,H=r.sqrt(r.log(1/(z*z))),V=H+((((H*O+D)*H+N)*H+h)*H+f)/((((H*M+b)*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<=b?ie=F:f<=O?ie=C:f<=M?ie=P:ie=R,V+=r.log(ie);for(var X=0,Z=1;Z<=50;Z++){for(var le=0,re=(2*Z-1)*ie,he=1;he<=y;he++){var De,ye;N=w){N=1&&le<=D)break;X+=le}if(le>D)throw new Error("tukey.cdf failed to converge");return X>1&&(X=1),X},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 N=u(l,p,s),w=t.tukey.cdf(N,a,s)-l,D;w>0?D=r.max(0,N-1):D=N+1;for(var b=t.tukey.cdf(D,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,N=0,w=[],D,b,O,M;for(l=t.aug(l,a),D=l[0].length,s=0;s=0;s--){for(N=0,f=s+1;f<=p-1;f++)N=N+w[f]*l[s][f];w[s]=(l[s][D-1]-N)/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,N,w;for(N=0;Nr.abs(s[D][N])&&(D=w);var b=s[N];for(s[N]=s[D],s[D]=b,w=N+1;w=0;N--){for(h=s[N][N],w=0;wN-1;y--)s[w][y]-=s[N][y]*s[w][N]/h;for(s[N][N]/=h,y=f;yh?(N[p][h]=l[p][h],w[p][h]=D[p][h]=0):pf;)b=I,I=t.add(t.multiply(M,b),O),p++;return I},gauss_seidel:function(l,a,s,f){for(var p=0,h=l.length,y=[],N=[],w=[],D,b,O,M,I;pD?(y[p][D]=l[p][D],N[p][D]=w[p][D]=0):pf;)b=I,I=t.add(t.multiply(M,b),O),p=p+1;return I},SOR:function(l,a,s,f,p){for(var h=0,y=l.length,N=[],w=[],D=[],b,O,M,I,F;hb?(N[h][b]=l[h][b],w[h][b]=D[h][b]=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,N,w,D,b;f0?-1:1,y=b*r.sqrt(y),N=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*N),w=f+2;w0?r.PI/4:-r.PI/4:O=r.atan(2*l[w][D]/(l[w][w]-l[D][D]))/2,M=t.identity(s,s),M[w][w]=r.cos(O),M[w][D]=-r.sin(O),M[D][w]=r.sin(O),M[D][D]=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;)D=p(l,s+f),b=p(l,s),N[y]=(a[D]-2*a[b]+a[2*b-D])/(f*f),f/=2,y++;for(M=N.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])*D[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=[],N=[],w=[],D=[],b=[],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,N,w,D;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),N=e.mean(u),w=e.sum(h.map(function(M){return Math.pow(M-N,2)})),D=e.sum(u.map(function(M,I){return Math.pow(M-h[I],2)})),b=w+D,O=w/b;return{exog:l,endog:u,nobs:a,df_model:s,df_resid:f,coef:p,predict:h,resid:y,ybar:N,SST:b,SSE:w,SSR:D,R2:O}}function n(u){var l=t(u.exog),a=Math.sqrt(u.SSR/u.df_resid),s=l.map(function(N){var w=N.SST,D=N.R2;return a/Math.sqrt(w*(1-D))}),f=u.coef.map(function(N,w){return(N-0)/s[w]}),p=f.map(function(N){var w=e.studentt.cdf(N,u.df_resid);return(w>.5?1-w:w)*2}),h=e.studentt.inv(.975,u.df_resid),y=u.coef.map(function(N,w){var D=h*s[w];return[N-D,N+D]});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{v();x();g();var UH;(function(e){typeof DO_NOT_EXPORT_BESSEL>"u"?typeof XA=="object"?e(XA):typeof define=="function"&&define.amd?define(function(){var t={};return e(t),t}):e(UH={}):e(UH={})})(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,N(F),M(F),-1);else{for(var R=2*t.floor((C+t.floor(t.sqrt(40*C)))/2),q=!1,z=0,H=0,V=1,W=0,ee=2/F,ie=R;ie>0;ie--)W=ie*ee*V-z,z=V,V=W,t.abs(V)>1e10&&(V*=1e-10,z*=1e-10,P*=1e-10,H*=1e-10),q&&(H+=V),q=!q,ie==C&&(P=z);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 N(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(),D=[249958057e5,424441966400,3733650367,2245904002e-2,102042.605,354.9632885,1].reverse(),b=[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(D,R),F=C/P+s*(o(I,1)*t.log(I)-1/I)):(R=64/R,C=r(b,R),P=r(O,R),F=t.sqrt(s/I)*(t.sin(q)*C+t.cos(q)*P*8/I)),F}return i(N,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 N(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(D,b){if(b=Math.round(b),b===0)return p(D);if(b===1)return N(D);if(b<0)return NaN;if(t.abs(D)===0)return 0;if(D==1/0)return 1/0;var O=0,M,I=2/t.abs(D),F=0,C=1,P=0,R=2*t.round((b+t.round(t.sqrt(40*b)))/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==b&&(O=F);return O*=w(D,0)/C,D<0&&b%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 N(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,N,"BESSELK",2,1)}();e.besselj=o,e.bessely=u,e.besseli=l,e.besselk=a})});var Bs=dt((MC,TC)=>{v();x();g();(function(e,t){typeof MC=="object"&&typeof TC<"u"?TC.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self,e.CodeMirror=t())})(MC,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),N=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),w=/PhantomJS/.test(e),D=y&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),b=/Android/.test(e),O=D||b||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),M=D||/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 z=function(c,d){var A=c.className,E=q(d).exec(A);if(E){var T=A.slice(E.index+E[0].length);c.className=A.slice(0,E.index)+(T?E[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,A,E){var T=document.createElement(c);if(A&&(T.className=A),E&&(T.style.cssText=E),typeof d=="string")T.appendChild(document.createTextNode(d));else if(d)for(var U=0;U=d)return G+(d-U);G+=te-U,G+=A-G%A,U=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 A=+new Date+c;(!this.id||A=d)return E+Math.min(G,d-T);if(T+=U-E,T+=A-T%A,E=U+1,T>=d)return E}}var be=[""];function Ue(c){for(;be.length<=c;)be.push(ve(be)+" ");return be[c]}function ve(c){return c[c.length-1]}function Re(c,d){for(var A=[],E=0;E"\x80"&&(c.toUpperCase()!=c.toLowerCase()||et.test(c))}function Lt(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,A){for(;(A<0?d>0:dA?-1:1;;){if(d==A)return d;var T=(d+A)/2,U=E<0?Math.ceil(T):Math.floor(T);if(U==d)return c(U)?d:A;c(U)?A=U:d=U+E}}function we(c,d,A,E){if(!c)return E(d,A,"ltr",0);for(var T=!1,U=0;Ud||d==A&&G.to==d)&&(E(Math.max(G.from,d),Math.min(G.to,A),G.level==1?"rtl":"ltr",U),T=!0)}T||E(d,A,"ltr")}var Le=null;function Qe(c,d,A){var E;Le=null;for(var T=0;Td)return T;U.to==d&&(U.from!=U.to&&A=="before"?E=T:Le=T),U.from==d&&(U.from!=U.to&&A!="before"?E=T:Le=T)}return E??Le}var it=function(){var c="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",d="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function A(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 E=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,T=/[stwN]/,U=/[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"&&!E.test(se))return!1;for(var Ze=se.length,$e=[],at=0;at-1&&(E[d]=T.slice(0,U).concat(T.slice(U+1)))}}}function tt(c,d){var A=xe(c,d);if(A.length)for(var E=Array.prototype.slice.call(arguments,2),T=0;T0}function Vr(c){c.prototype.on=function(d,A){Y(this,d,A)},c.prototype.off=function(d,A){Ye(this,d,A)}}function Wt(c){c.preventDefault?c.preventDefault():c.returnValue=!1}function mi(c){c.stopPropagation?c.stopPropagation():c.cancelBubble=!0}function tr(c){return c.defaultPrevented!=null?c.defaultPrevented:c.returnValue==!1}function no(c){Wt(c),mi(c)}function Sr(c){return c.target||c.srcElement}function Fn(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 Ta=function(){if(u&&l<9)return!1;var c=W("div");return"draggable"in c||"dragDrop"in c}(),Oa;function zn(c){if(Oa==null){var d=W("span","\u200B");V(c,W("span",[d,document.createTextNode("x")])),c.firstChild.offsetHeight!=0&&(Oa=d.offsetWidth<=1&&d.offsetHeight>2&&!(u&&l<8))}var A=Oa?W("span","\u200B"):W("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return A.setAttribute("cm-text",""),A}var jo;function Lo(c){if(jo!=null)return jo;var d=V(c,document.createTextNode("A\u062EA")),A=ie(d,0,1).getBoundingClientRect(),E=ie(d,1,2).getBoundingClientRect();return H(c),!A||A.left==A.right?!1:jo=E.right-A.right<3}var jn=` - -b`.split(/\n/).length!=3?function(c){for(var d=0,A=[],E=c.length;d<=E;){var T=c.indexOf(` -`,d);T==-1&&(T=c.length);var U=c.slice(d,c.charAt(T-1)=="\r"?T-1:T),G=U.indexOf("\r");G!=-1?(A.push(U.slice(0,G)),d+=G+1):(A.push(U),d=T+1)}return A}:function(c){return c.split(/\r\n?|\n/)},ea=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},Il=function(){var c=W("div");return"oncopy"in c?!0:(c.setAttribute("oncopy","return;"),typeof c.oncopy=="function")}(),bo=null;function sc(c){if(bo!=null)return bo;var d=V(c,W("span","x")),A=d.getBoundingClientRect(),E=ie(d,0,1).getBoundingClientRect();return bo=Math.abs(A.left-E.left)>1}var cs={},io={};function oo(c,d){arguments.length>2&&(d.dependencies=Array.prototype.slice.call(arguments,2)),cs[c]=d}function ta(c,d){io[c]=d}function Ks(c){if(typeof c=="string"&&io.hasOwnProperty(c))c=io[c];else if(c&&typeof c.name=="string"&&io.hasOwnProperty(c.name)){var d=io[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 Ks("application/xml");if(typeof c=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(c))return Ks("application/json")}return typeof c=="string"?{name:c}:c||{name:"null"}}function Ia(c,d){d=Ks(d);var A=cs[d.name];if(!A)return Ia(c,"text/plain");var E=A(c,d);if(Qt.hasOwnProperty(d.name)){var T=Qt[d.name];for(var U in T)T.hasOwnProperty(U)&&(E.hasOwnProperty(U)&&(E["_"+U]=E[U]),E[U]=T[U])}if(E.name=d.name,d.helperType&&(E.helperType=d.helperType),d.modeProps)for(var G in d.modeProps)E[G]=d.modeProps[G];return E}var Qt={};function $i(c,d){var A=Qt.hasOwnProperty(c)?Qt[c]:Qt[c]={};Ce(d,A)}function Tr(c,d){if(d===!0)return d;if(c.copyState)return c.copyState(d);var A={};for(var E in d){var T=d[E];T instanceof Array&&(T=T.concat([])),A[E]=T}return A}function Rt(c,d){for(var A;c.innerMode&&(A=c.innerMode(d),!(!A||A.mode==c));)d=A.state,c=A.mode;return A||{mode:c,state:d}}function ao(c,d,A){return c.startState?c.startState(d,A):!0}var Jr=function(c,d,A){this.pos=this.start=0,this.string=c,this.tabSize=d||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=A};Jr.prototype.eol=function(){return this.pos>=this.string.length},Jr.prototype.sol=function(){return this.pos==this.lineStart},Jr.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Jr.prototype.next=function(){if(this.posd},Jr.prototype.eatSpace=function(){for(var c=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>c},Jr.prototype.skipToEnd=function(){this.pos=this.string.length},Jr.prototype.skipTo=function(c){var d=this.string.indexOf(c,this.pos);if(d>-1)return this.pos=d,!0},Jr.prototype.backUp=function(c){this.pos-=c},Jr.prototype.column=function(){return this.lastColumnPos0?null:(U&&d!==!1&&(this.pos+=U[0].length),U)}},Jr.prototype.current=function(){return this.string.slice(this.start,this.pos)},Jr.prototype.hideFirstChars=function(c,d){this.lineStart+=c;try{return d()}finally{this.lineStart-=c}},Jr.prototype.lookAhead=function(c){var d=this.lineOracle;return d&&d.lookAhead(c)},Jr.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 A=c;!A.lines;)for(var E=0;;++E){var T=A.children[E],U=T.chunkSize();if(d=c.first&&dA?nt(A,zt(c,A).text.length):uc(d,zt(c,d.line).text.length)}function uc(c,d){var A=c.ch;return A==null||A>d?nt(c.line,d):A<0?nt(c.line,0):c}function Ud(c,d){for(var A=[],E=0;Ethis.maxLookAhead&&(this.maxLookAhead=c),d},na.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}},na.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},na.fromSaved=function(c,d,A){return d instanceof Pu?new na(c,Tr(c.mode,d.state),A,d.lookAhead):new na(c,Tr(c.mode,d),A)},na.prototype.save=function(c){var d=c!==!1?Tr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Pu(d,this.maxLookAhead):d};function ps(c,d,A,E){var T=[c.state.modeGen],U={};pc(c,d.text,c.doc.mode,A,function(se,Ae){return T.push(se,Ae)},U,E);for(var G=A.state,te=function(se){A.baseTokens=T;var Ae=c.state.overlays[se],Ie=1,Ze=0;A.state=!0,pc(c,d.text,Ae.mode,A,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&&Tr(c.doc.mode,E.state),U=ps(c,d,E);T&&(E.state=T),d.stateAfter=E.save(!T),d.styles=U.styles,U.classes?d.styleClasses=U.classes:d.styleClasses&&(d.styleClasses=null),A===c.doc.highlightFrontier&&(c.doc.modeFrontier=Math.max(c.doc.modeFrontier,++c.doc.highlightFrontier))}return d.styles}function Qr(c,d,A){var E=c.doc,T=c.display;if(!E.mode.startState)return new na(E,!0,d);var U=Do(c,d,A),G=U>E.first&&zt(E,U-1).stateAfter,te=G?na.fromSaved(E,G,U):new na(E,ao(E.mode),U);return E.iter(U,d,function(oe){lc(c,oe.text,te);var se=te.line;oe.stateAfter=se==d-1||se%5==0||se>=T.viewFrom&&sed.start)return U}throw new Error("Mode "+c.name+" failed to advance stream.")}var dn=function(c,d,A){this.start=c.start,this.end=c.pos,this.string=c.current(),this.type=d||null,this.state=A};function fc(c,d,A,E){var T=c.doc,U=T.mode,G;d=Mt(T,d);var te=zt(T,d.line),oe=Qr(c,d.line,A),se=new Jr(te.text,c.options.tabSize,oe),Ae;for(E&&(Ae=[]);(E||se.posc.options.maxHighlightLength?(te=!1,G&&lc(c,d,E,Ae.pos),Ae.pos=d.length,Ie=null):Ie=cc(Hd(A,Ae,E.state,Ze),U),Ze){var $e=Ze[0].name;$e&&(Ie="m-"+(Ie?$e+" "+Ie:$e))}if(!te||se!=Ie){for(;oeG;--te){if(te<=U.first)return U.first;var oe=zt(U,te-1),se=oe.stateAfter;if(se&&(!A||te+(se instanceof Pu?se.lookAhead:0)<=U.modeFrontier))return te;var Ae=Oe(oe.text,null,c.options.tabSize);(T==null||E>Ae)&&(T=te-1,E=Ae)}return T}function Qp(c,d){if(c.modeFrontier=Math.min(c.modeFrontier,d),!(c.highlightFrontierA;E--){var T=zt(c,E).stateAfter;if(T&&(!(T instanceof Pu)||E+T.lookAhead=d:U.to>d);(E||(E=[])).push(new mc(G,U.from,oe?null:U.to))}}return E}function qu(c,d,A){var E;if(c)for(var T=0;T=d:U.to>d);if(te||U.from==d&&G.type=="bookmark"&&(!A||U.marker.insertLeft)){var oe=U.from==null||(G.inclusiveLeft?U.from<=d:U.from0&&te)for(var Ot=0;Ot0)){var Ae=[oe,1],Ie=Fe(se.from,te.from),Ze=Fe(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 js(c){var d=c.markedSpans;if(d){for(var A=0;Ad)&&(!E||eu(E,U.marker)<0)&&(E=U.marker)}return E}function N1(c,d,A,E,T){var U=zt(c,d),G=No&&U.markedSpans;if(G)for(var te=0;te=0&&Ie<=0||Ae<=0&&Ie>=0)&&(Ae<=0&&(oe.marker.inclusiveRight&&T.inclusiveLeft?Fe(se.to,A)>=0:Fe(se.to,A)>0)||Ae>=0&&(oe.marker.inclusiveRight&&T.inclusiveLeft?Fe(se.from,E)<=0:Fe(se.from,E)<0)))return!0}}}function ia(c){for(var d;d=ei(c);)c=d.find(-1,!0).line;return c}function lN(c){for(var d;d=em(c);)c=d.find(1,!0).line;return c}function vc(c){for(var d,A;d=em(c);)c=d.find(1,!0).line,(A||(A=[])).push(c);return A}function tu(c,d){var A=zt(c,d),E=ia(A);return A==E?d:ue(E)}function S1(c,d){if(d>c.lastLine())return d;var A=zt(c,d),E;if(!Vi(c,A))return d;for(;E=em(A);)A=E.find(1,!0).line;return ue(A)+1}function Vi(c,d){var A=No&&d.markedSpans;if(A){for(var E=void 0,T=0;Td.maxLineLength&&(d.maxLineLength=T,d.maxLine=E)})}var _l=function(c,d,A){this.text=c,Wi(this,d),this.height=A?A(this):1};_l.prototype.lineNo=function(){return ue(this)},Vr(_l);function Vd(c,d,A,E){c.text=d,c.stateAfter&&(c.stateAfter=null),c.styles&&(c.styles=null),c.order!=null&&(c.order=null),js(c),Wi(c,A);var T=E?E(c):1;T!=c.height&&Un(c,T)}function E1(c){c.parent=null,js(c)}var Gd={},A1={};function Yd(c,d){if(!c||/^\s*$/.test(c))return null;var A=d.addModeClass?A1:Gd;return A[c]||(A[c]=c.replace(/\S+/g,"cm-$&"))}function Zd(c,d){var A=ee("span",null,null,a?"padding-right: .1px":null),E={pre:ee("pre",[A],"CodeMirror-line"),content:A,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 U=T?d.rest[T-1]:d.line,G=void 0;E.pos=0,E.addToken=C1,Lo(c.display.measure)&&(G=Xe(U,c.doc.direction))&&(E.addToken=gc(E.addToken,G)),E.map=[];var te=d!=c.display.externalMeasured&&ue(U);Xd(U,E,b1(c,U,te)),U.styleClasses&&(U.styleClasses.bgClass&&(E.bgClass=re(U.styleClasses.bgClass,E.bgClass||"")),U.styleClasses.textClass&&(E.textClass=re(U.styleClasses.textClass,E.textClass||""))),E.map.length==0&&E.map.push(0,0,E.content.appendChild(zn(c.display.measure))),T==0?(d.measure.map=E.map,d.measure.cache={}):((d.measure.maps||(d.measure.maps=[])).push(E.map),(d.measure.caches||(d.measure.caches=[])).push({}))}if(a){var oe=E.content.lastChild;(/\bcm-tab\b/.test(oe.className)||oe.querySelector&&oe.querySelector(".cm-tab"))&&(E.content.className="cm-tab-wrap-hack")}return tt(c,"renderLine",c,d.line,E.pre),E.pre.className&&(E.textClass=re(E.pre.className,E.textClass||"")),E}function fN(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,A,E,T,U,G){if(d){var te=c.splitSpaces?cN(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,Dt=yt-c.col%yt;mt=Ae.appendChild(W("span",Ue(Dt),"cm-tab")),mt.setAttribute("role","presentation"),mt.setAttribute("cm-text"," "),c.col+=Dt}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,A||E||T||se||U||G){var At=A||"";E&&(At+=E),T&&(At+=T);var bt=W("span",[Ae],At,U);if(G)for(var Ot in G)G.hasOwnProperty(Ot)&&Ot!="style"&&Ot!="class"&&bt.setAttribute(Ot,G[Ot]);return c.content.appendChild(bt)}c.content.appendChild(Ae)}}function cN(c,d){if(c.length>1&&!/ /.test(c))return c;for(var A=d,E="",T=0;Tse&&Ie.from<=se));Ze++);if(Ie.to>=Ae)return c(A,E,T,U,G,te,oe);c(A,E.slice(0,Ie.to-se),T,U,null,te,oe),U=null,E=E.slice(Ie.to-se),se=Ie.to}}}function rm(c,d,A,E){var T=!E&&A.widgetNode;T&&c.map.push(c.pos,c.pos+d,T),!E&&c.cm.display.input.needsContentAttribute&&(T||(T=c.content.appendChild(document.createElement("span"))),T.setAttribute("cm-marker",A.id)),T&&(c.cm.display.input.setUneditable(T),c.content.appendChild(T)),c.pos+=d,c.trailingSpace=!1}function Xd(c,d,A){var E=c.markedSpans,T=c.text,U=0;if(!E){for(var G=1;Goe||vr.collapsed&&Vt.to==oe&&Vt.from==oe)){if(Vt.to!=null&&Vt.to!=oe&&$e>Vt.to&&($e=Vt.to,mt=""),vr.className&&(at+=" "+vr.className),vr.css&&(Ze=(Ze?Ze+";":"")+vr.css),vr.startStyle&&Vt.from==oe&&(yt+=" "+vr.startStyle),vr.endStyle&&Vt.to==$e&&(Ot||(Ot=[])).push(vr.endStyle,Vt.to),vr.title&&((At||(At={})).title=vr.title),vr.attributes)for(var Gr in vr.attributes)(At||(At={}))[Gr]=vr.attributes[Gr];vr.collapsed&&(!Dt||eu(Dt.marker,vr)<0)&&(Dt=Vt)}else Vt.from>oe&&$e>Vt.from&&($e=Vt.from)}if(Ot)for(var ni=0;ni=te)break;for(var xi=Math.min(te,$e);;){if(Ae){var Xi=oe+Ae.length;if(!Dt){var Bn=Xi>xi?Ae.slice(0,xi-oe):Ae;d.addToken(d,Bn,Ie?Ie+at:at,yt,oe+Bn.length==$e?mt:"",Ze,At)}if(Xi>=xi){Ae=Ae.slice(xi-oe),oe=xi;break}oe=Xi,yt=""}Ae=T.slice(U,U=A[se++]),Ie=Yd(A[se++],d.cm.options)}}}function Kd(c,d,A){this.line=d,this.rest=vc(d),this.size=this.rest?ue(ve(this.rest))-A+1:1,this.node=this.text=null,this.hidden=Vi(c,d)}function kl(c,d,A){for(var E=[],T,U=d;U2&&U.push((oe.bottom+se.top)/2-A.top)}}U.push(A.bottom-A.top)}}function tv(c,d,A){if(c.line==d)return{map:c.measure.map,cache:c.measure.cache};if(c.rest){for(var E=0;EA)return{map:c.measure.maps[T],cache:c.measure.caches[T],before:!0}}}function mN(c,d){d=ia(d);var A=ue(d),E=c.display.externalMeasured=new Kd(c.doc,d,A);E.lineN=A;var T=E.built=Zd(c,E);return E.text=T.pre,V(c.display.lineMeasure,T.pre),E}function F1(c,d,A,E){return Ao(c,$u(c,d),A,E)}function sm(c,d){if(d>=c.display.viewFrom&&d=A.lineN&&dd)&&(U=oe-te,T=U-1,d>=oe&&(G="right")),T!=null){if(E=c[se+2],te==oe&&A==(E.insertLeft?"left":"right")&&(G=A),A=="left"&&T==0)for(;se&&c[se-2]==c[se-3]&&c[se-1].insertLeft;)E=c[(se-=3)+2],G="left";if(A=="right"&&T==oe-te)for(;se=0&&(A=c[T]).left==A.right;T--);return A}function L1(c,d,A,E){var T=k1(d.map,A,E),U=T.node,G=T.start,te=T.end,oe=T.collapse,se;if(U.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=E="right");var Ie;c.options.lineWrapping&&(Ie=U.getClientRects()).length>1?se=Ie[E=="right"?Ie.length-1:0]:se=U.getBoundingClientRect()}if(u&&l<9&&!G&&(!se||!se.left&&!se.right)){var Ze=U.parentNode.getClientRects()[0];Ze?se={left:Ze.left,right:Ze.left+ds(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,Dt=0;Dt=E.text.length?(oe=E.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 Dt=te[mt],At=Dt.level==1;return G(yt?at-1:at,At!=yt)}var Ie=Qe(te,oe,se),Ze=Le,$e=Ae(oe,Ie,se=="before");return Ze!=null&&($e.other=Ae(oe,Ze,se!="before")),$e}function Wu(c,d){var A=0;d=Mt(c.doc,d),c.options.lineWrapping||(A=ds(c.display)*d.ch);var E=zt(c.doc,d.line),T=Po(E)+Ll(c.display);return{left:A,right:A,top:T,bottom:T+E.height}}function bc(c,d,A,E,T){var U=nt(c,d,A);return U.xRel=T,E&&(U.outside=E),U}function rv(c,d,A){var E=c.doc;if(A+=c.display.viewOffset,A<0)return bc(E.first,0,null,-1,-1);var T=Me(E,A),U=E.first+E.size-1;if(T>U)return bc(E.first+E.size-1,zt(E,U).text.length,null,1,1);d<0&&(d=0);for(var G=zt(E,T);;){var te=dN(c,G,T,d,A),oe=uN(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(E,T=se.line)}}function z1(c,d,A,E){E-=kn(d);var T=d.text.length,U=pe(function(G){return Ao(c,A,G-1).bottom<=E},T,0);return T=pe(function(G){return Ao(c,A,G).top>E},U,T),{begin:U,end:T}}function U1(c,d,A,E){A||(A=$u(c,d));var T=wc(c,d,Ao(c,A,E),"line").top;return z1(c,d,A,T)}function nv(c,d,A,E){return c.bottom<=A?!1:c.top>A?!0:(E?c.left:c.right)>d}function dN(c,d,A,E,T){T-=Po(d);var U=$u(c,d),G=kn(d),te=0,oe=d.text.length,se=!0,Ae=Xe(d,c.doc.direction);if(Ae){var Ie=(c.options.lineWrapping?vN:Dc)(c,d,A,U,Ae,E,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=pe(function(Kt){var Vt=Ao(c,U,Kt);return Vt.top+=G,Vt.bottom+=G,nv(Vt,E,T,!1)?(Vt.top<=T&&Vt.left<=E&&(Ze=Kt,$e=Vt),!0):!1},te,oe),mt,yt,Dt=!1;if($e){var At=E-$e.left<$e.right-E,bt=At==se;at=Ze+(bt?0:1),yt=bt?"after":"before",mt=At?$e.left:$e.right}else{!se&&(at==oe||at==te)&&at++,yt=at==0?"after":at==d.text.length?"before":Ao(c,U,at-(se?1:0)).bottom+G<=T==se?"after":"before";var Ot=Yi(c,nt(A,at,yt),"line",d,U);mt=Ot.left,Dt=T=Ot.bottom?1:0}return at=ne(d.text,at,1),bc(A,at,yt,Dt,E-mt)}function Dc(c,d,A,E,T,U,G){var te=pe(function(Ie){var Ze=T[Ie],$e=Ze.level!=1;return nv(Yi(c,nt(A,$e?Ze.to:Ze.from,$e?"before":"after"),"line",d,E),U,G,!0)},0,T.length-1),oe=T[te];if(te>0){var se=oe.level!=1,Ae=Yi(c,nt(A,se?oe.from:oe.to,se?"after":"before"),"line",d,E);nv(Ae,U,G,!0)&&Ae.top>G&&(oe=T[te-1])}return oe}function vN(c,d,A,E,T,U,G){var te=z1(c,d,E,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=Ao(c,E,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 si;function aa(c){if(c.cachedTextHeight!=null)return c.cachedTextHeight;if(si==null){si=W("pre",null,"CodeMirror-line-like");for(var d=0;d<49;++d)si.appendChild(document.createTextNode("x")),si.appendChild(W("br"));si.appendChild(document.createTextNode("x"))}V(c.measure,si);var A=si.offsetHeight/50;return A>3&&(c.cachedTextHeight=A),H(c.measure),A||1}function ds(c){if(c.cachedCharWidth!=null)return c.cachedCharWidth;var d=W("span","xxxxxxxxxx"),A=W("pre",[d],"CodeMirror-line-like");V(c.measure,A);var E=d.getBoundingClientRect(),T=(E.right-E.left)/10;return T>2&&(c.cachedCharWidth=T),T||10}function Pl(c){for(var d=c.display,A={},E={},T=d.gutters.clientLeft,U=d.gutters.firstChild,G=0;U;U=U.nextSibling,++G){var te=c.display.gutterSpecs[G].className;A[te]=U.offsetLeft+U.clientLeft+T,E[te]=U.clientWidth}return{fixedPos:Nc(d),gutterTotalWidth:d.gutters.offsetWidth,gutterLeft:A,gutterWidth:E,wrapperWidth:d.wrapper.clientWidth}}function Nc(c){return c.scroller.getBoundingClientRect().left-c.sizer.getBoundingClientRect().left}function Rl(c){var d=aa(c.display),A=c.options.lineWrapping,E=A&&Math.max(5,c.display.scroller.clientWidth/ds(c.display)-3);return function(T){if(Vi(c.doc,T))return 0;var U=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=nt(oe.line,Math.max(0,Math.round((U-so(c.display).left)/ds(c.display))-Ae))}return oe}function Vu(c,d){if(d>=c.display.viewTo||(d-=c.display.viewFrom,d<0))return null;for(var A=c.display.view,E=0;Ed)&&(T.updateLineNumbers=d),c.curOp.viewChanged=!0,d>=T.viewTo)No&&tu(c.doc,d)T.viewFrom?_a(c):(T.viewFrom+=E,T.viewTo+=E);else if(d<=T.viewFrom&&A>=T.viewTo)_a(c);else if(d<=T.viewFrom){var U=ql(c,A,A+E,1);U?(T.view=T.view.slice(U.index),T.viewFrom=U.lineN,T.viewTo+=E):_a(c)}else if(A>=T.viewTo){var G=ql(c,d,d,-1);G?(T.view=T.view.slice(0,G.index),T.viewTo=G.lineN):_a(c)}else{var te=ql(c,d,d,-1),oe=ql(c,A,A+E,1);te&&oe?(T.view=T.view.slice(0,te.index).concat(kl(c,te.lineN,oe.lineN)).concat(T.view.slice(oe.index)),T.viewTo+=E):_a(c)}var se=T.externalMeasured;se&&(A=T.lineN&&d=E.viewTo)){var U=E.view[Vu(c,d)];if(U.node!=null){var G=U.changes||(U.changes=[]);Ee(G,A)==-1&&G.push(A)}}}function _a(c){c.display.viewFrom=c.display.viewTo=c.doc.first,c.display.view=[],c.display.viewOffset=0}function ql(c,d,A,E){var T=Vu(c,d),U,G=c.display.view;if(!No||A==c.doc.first+c.doc.size)return{index:T,lineN:A};for(var te=c.display.viewFrom,oe=0;oe0){if(T==G.length-1)return null;U=te+G[T].size-d,T++}else U=te-d;d+=U,A+=U}for(;tu(c.doc,A)!=A;){if(T==(E<0?0:G.length-1))return null;A+=E*G[T-(E<0?1:0)].size,T+=E}return{index:T,lineN:A}}function gN(c,d,A){var E=c.display,T=E.view;T.length==0||d>=E.viewTo||A<=E.viewFrom?(E.view=kl(c,d,A),E.viewFrom=d):(E.viewFrom>d?E.view=kl(c,d,E.viewFrom).concat(E.view):E.viewFromA&&(E.view=E.view.slice(0,Vu(c,A)))),E.viewTo=A}function iv(c){for(var d=c.display.view,A=0,E=0;E=c.display.viewTo||oe.to().line0?G:c.defaultCharWidth())+"px"}if(E.other){var te=A.appendChild(W("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));te.style.display="",te.style.left=E.other.left+"px",te.style.top=E.other.top+"px",te.style.height=(E.other.bottom-E.other.top)*.85+"px"}}function zl(c,d){return c.top-d.top||c.left-d.left}function ov(c,d,A){var E=c.display,T=c.doc,U=document.createDocumentFragment(),G=so(c.display),te=G.left,oe=Math.max(E.sizerWidth,iu(c)-E.sizer.offsetLeft)-G.right,se=T.direction=="ltr";function Ae(bt,Ot,Kt,Vt){Ot<0&&(Ot=0),Ot=Math.round(Ot),Vt=Math.round(Vt),U.appendChild(W("div",null,"CodeMirror-selected","position: absolute; left: "+bt+`px; - top: `+Ot+"px; width: "+(Kt??oe-bt)+`px; - height: `+(Vt-Ot)+"px"))}function Ie(bt,Ot,Kt){var Vt=zt(T,bt),vr=Vt.text.length,Gr,ni;function mn(Bn,Ki){return lm(c,nt(bt,Bn),"div",Vt,Ki)}function xi(Bn,Ki,ui){var Gn=U1(c,Vt,null,Bn),vn=Ki=="ltr"==(ui=="after")?"left":"right",gn=ui=="after"?Gn.begin:Gn.end-(/\s/.test(Vt.text.charAt(Gn.end-1))?2:1);return mn(gn,vn)[vn]}var Xi=Xe(Vt,T.direction);return we(Xi,Ot||0,Kt??vr,function(Bn,Ki,ui,Gn){var vn=ui=="ltr",gn=mn(Bn,vn?"left":"right"),Ii=mn(Ki-1,vn?"right":"left"),pf=Ot==null&&Bn==0,cu=Kt==null&&Ki==vr,yi=Gn==0,zo=!Xi||Gn==Xi.length-1;if(Ii.top-gn.top<=3){var ii=(se?pf:cu)&&yi,Uv=(se?cu:pf)&&zo,ys=ii?te:(vn?gn:Ii).left,el=Uv?oe:(vn?Ii:gn).right;Ae(ys,gn.top,el-ys,gn.bottom)}else{var tl,Fi,mf,Yc;vn?(tl=se&&pf&&yi?te:gn.left,Fi=se?oe:xi(Bn,ui,"before"),mf=se?te:xi(Ki,ui,"after"),Yc=se&&cu&&zo?oe:Ii.right):(tl=se?xi(Bn,ui,"before"):te,Fi=!se&&pf&&yi?oe:gn.right,mf=!se&&cu&&zo?te:Ii.left,Yc=se?xi(Ki,ui,"after"):oe),Ae(tl,gn.top,Fi-tl,gn.bottom),gn.bottom0?d.blinker=setInterval(function(){c.hasFocus()||Gu(c),d.cursorDiv.style.visibility=(A=!A)?"":"hidden"},c.options.cursorBlinkRate):c.options.cursorBlinkRate<0&&(d.cursorDiv.style.visibility="hidden")}}function av(c){c.hasFocus()||(c.display.input.focus(),c.state.focused||pm(c))}function Ul(c){c.state.delayingBlurEvent=!0,setTimeout(function(){c.state.delayingBlurEvent&&(c.state.delayingBlurEvent=!1,c.state.focused&&Gu(c))},100)}function pm(c,d){c.state.delayingBlurEvent&&!c.state.draggingText&&(c.state.delayingBlurEvent=!1),c.options.readOnly!="nocursor"&&(c.state.focused||(tt(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()),Ec(c))}function Gu(c,d){c.state.delayingBlurEvent||(c.state.focused&&(tt(c,"blur",c,d),c.state.focused=!1,z(c.display.wrapper,"CodeMirror-focused")),clearInterval(c.display.blinker),setTimeout(function(){c.state.focused||(c.display.shift=!1)},150))}function mm(c){for(var d=c.display,A=d.lineDiv.offsetTop,E=Math.max(0,d.scroller.getBoundingClientRect().top),T=d.lineDiv.getBoundingClientRect().top,U=0,G=0;G.005||$e<-.005)&&(Tc.display.sizerWidth){var mt=Math.ceil(Ae/ds(c.display));mt>c.display.maxLineLength&&(c.display.maxLineLength=mt,c.display.maxLine=te.line,c.display.maxLineChanged=!0)}}}Math.abs(U)>2&&(d.scroller.scrollTop+=U)}function sv(c){if(c.widgets)for(var d=0;d=G&&(U=Me(d,Po(zt(d,oe))-c.wrapper.clientHeight),G=oe)}return{from:U,to:Math.max(G,U+1)}}function xN(c,d){if(!wt(c,"scrollCursorIntoView")){var A=c.display,E=A.sizer.getBoundingClientRect(),T=null,U=A.wrapper.ownerDocument;if(d.top+E.top<0?T=!0:d.bottom+E.top>(U.defaultView.innerHeight||U.documentElement.clientHeight)&&(T=!1),T!=null&&!w){var G=W("div","\u200B",null,`position: absolute; - top: `+(d.top-A.viewOffset-Ll(c.display))+`px; - height: `+(d.bottom-d.top+oa(c)+A.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,A,E){E==null&&(E=0);var T;!c.options.lineWrapping&&d==A&&(A=d.sticky=="before"?nt(d.line,d.ch+1,"before"):d,d=d.ch?nt(d.line,d.sticky=="before"?d.ch-1:d.ch,"after"):d);for(var U=0;U<5;U++){var G=!1,te=Yi(c,d),oe=!A||A==d?te:Yi(c,A);T={left:Math.min(te.left,oe.left),top:Math.min(te.top,oe.top)-E,right:Math.max(te.left,oe.left),bottom:Math.max(te.bottom,oe.bottom)+E};var se=uv(c,T),Ae=c.doc.scrollTop,Ie=c.doc.scrollLeft;if(se.scrollTop!=null&&($l(c,se.scrollTop),Math.abs(c.doc.scrollTop-Ae)>1&&(G=!0)),se.scrollLeft!=null&&(Co(c,se.scrollLeft),Math.abs(c.doc.scrollLeft-Ie)>1&&(G=!0)),!G)break}return T}function yN(c,d){var A=uv(c,d);A.scrollTop!=null&&$l(c,A.scrollTop),A.scrollLeft!=null&&Co(c,A.scrollLeft)}function uv(c,d){var A=c.display,E=aa(c.display);d.top<0&&(d.top=0);var T=c.curOp&&c.curOp.scrollTop!=null?c.curOp.scrollTop:A.scroller.scrollTop,U=am(c),G={};d.bottom-d.top>U&&(d.bottom=d.top+U);var te=c.doc.height+xc(A),oe=d.topte-E;if(d.topT+U){var Ae=Math.min(d.top,(se?te:d.bottom)-U);Ae!=T&&(G.scrollTop=Ae)}var Ie=c.options.fixedGutter?0:A.gutters.offsetWidth,Ze=c.curOp&&c.curOp.scrollLeft!=null?c.curOp.scrollLeft:A.scroller.scrollLeft-Ie,$e=iu(c)-A.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 hm(c,d){d!=null&&(dm(c),c.curOp.scrollTop=(c.curOp.scrollTop==null?c.doc.scrollTop:c.curOp.scrollTop)+d)}function Hl(c){dm(c);var d=c.getCursor();c.curOp.scrollToPos={from:d,to:d,margin:c.options.cursorScrollMargin}}function Ac(c,d,A){(d!=null||A!=null)&&dm(c),d!=null&&(c.curOp.scrollLeft=d),A!=null&&(c.curOp.scrollTop=A)}function wN(c,d){dm(c),c.curOp.scrollToPos=d}function dm(c){var d=c.curOp.scrollToPos;if(d){c.curOp.scrollToPos=null;var A=Wu(c,d.from),E=Wu(c,d.to);vm(c,A,E,d.margin)}}function vm(c,d,A,E){var T=uv(c,{left:Math.min(d.left,A.left),top:Math.min(d.top,A.top)-E,right:Math.max(d.right,A.right),bottom:Math.max(d.bottom,A.bottom)+E});Ac(c,T.scrollLeft,T.scrollTop)}function $l(c,d){Math.abs(c.doc.scrollTop-d)<2||(r||ym(c,{top:d}),Wl(c,d,!0),r&&ym(c),Oc(c,100))}function Wl(c,d,A){d=Math.max(0,Math.min(c.display.scroller.scrollHeight-c.display.scroller.clientHeight,d)),!(c.display.scroller.scrollTop==d&&!A)&&(c.doc.scrollTop=d,c.display.scrollbars.setScrollTop(d),c.display.scroller.scrollTop!=d&&(c.display.scroller.scrollTop=d))}function Co(c,d,A,E){d=Math.max(0,Math.min(d,c.display.scroller.scrollWidth-c.display.scroller.clientWidth)),!((A?d==c.doc.scrollLeft:Math.abs(c.doc.scrollLeft-d)<2)&&!E)&&(c.doc.scrollLeft=d,hv(c),c.display.scroller.scrollLeft!=d&&(c.display.scroller.scrollLeft=d),c.display.scrollbars.setScrollLeft(d))}function Cc(c){var d=c.display,A=d.gutters.offsetWidth,E=Math.round(c.doc.height+xc(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?A:0,docHeight:E,scrollHeight:E+oa(c)+d.barHeight,nativeBarWidth:d.nativeBarWidth,gutterWidth:A}}var Yu=function(c,d,A){this.cm=A;var E=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");E.tabIndex=T.tabIndex=-1,c(E),c(T),Y(E,"scroll",function(){E.clientHeight&&d(E.scrollTop,"vertical")}),Y(T,"scroll",function(){T.clientWidth&&d(T.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,u&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Yu.prototype.update=function(c){var d=c.scrollWidth>c.clientWidth+1,A=c.scrollHeight>c.clientHeight+1,E=c.nativeBarWidth;if(A){this.vert.style.display="block",this.vert.style.bottom=d?E+"px":"0";var T=c.viewHeight-(d?E: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=A?E+"px":"0",this.horiz.style.left=c.barLeft+"px";var U=c.viewWidth-c.barLeft-(A?E:0);this.horiz.firstChild.style.width=Math.max(0,c.scrollWidth-c.clientWidth+U)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&c.clientHeight>0&&(E==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:A?E:0,bottom:d?E:0}},Yu.prototype.setScrollLeft=function(c){this.horiz.scrollLeft!=c&&(this.horiz.scrollLeft=c),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Yu.prototype.setScrollTop=function(c){this.vert.scrollTop!=c&&(this.vert.scrollTop=c),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Yu.prototype.zeroWidthHack=function(){var c=M&&!N?"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},Yu.prototype.enableZeroWidthBar=function(c,d,A){c.style.visibility="";function E(){var T=c.getBoundingClientRect(),U=A=="vert"?document.elementFromPoint(T.right-1,(T.top+T.bottom)/2):document.elementFromPoint((T.right+T.left)/2,T.bottom-1);U!=c?c.style.visibility="hidden":d.set(1e3,E)}d.set(1e3,E)},Yu.prototype.clear=function(){var c=this.horiz.parentNode;c.removeChild(this.horiz),c.removeChild(this.vert)};var Mc=function(){};Mc.prototype.update=function(){return{bottom:0,right:0}},Mc.prototype.setScrollLeft=function(){},Mc.prototype.setScrollTop=function(){},Mc.prototype.clear=function(){};function ti(c,d){d||(d=Cc(c));var A=c.display.barWidth,E=c.display.barHeight;gm(c,d);for(var T=0;T<4&&A!=c.display.barWidth||E!=c.display.barHeight;T++)A!=c.display.barWidth&&c.options.lineWrapping&&mm(c),gm(c,Cc(c)),A=c.display.barWidth,E=c.display.barHeight}function gm(c,d){var A=c.display,E=A.scrollbars.update(d);A.sizer.style.paddingRight=(A.barWidth=E.right)+"px",A.sizer.style.paddingBottom=(A.barHeight=E.bottom)+"px",A.heightForcer.style.borderBottom=E.bottom+"px solid transparent",E.right&&E.bottom?(A.scrollbarFiller.style.display="block",A.scrollbarFiller.style.height=E.bottom+"px",A.scrollbarFiller.style.width=E.right+"px"):A.scrollbarFiller.style.display="",E.bottom&&c.options.coverGutterNextToScrollbar&&c.options.fixedGutter?(A.gutterFiller.style.display="block",A.gutterFiller.style.height=E.bottom+"px",A.gutterFiller.style.width=d.gutterWidth+"px"):A.gutterFiller.style.display=""}var lv={native:Yu,null:Mc};function W1(c){c.display.scrollbars&&(c.display.scrollbars.clear(),c.display.scrollbars.addClass&&z(c.display.wrapper,c.display.scrollbars.addClass)),c.display.scrollbars=new lv[c.options.scrollbarStyle](function(d){c.display.wrapper.insertBefore(d,c.display.scrollbarFiller),Y(d,"mousedown",function(){c.state.focused&&setTimeout(function(){return c.display.input.focus()},0)}),d.setAttribute("cm-not-content","true")},function(d,A){A=="horizontal"?Co(c,d):$l(c,d)},c),c.display.scrollbars.addClass&&le(c.display.wrapper,c.display.scrollbars.addClass)}var bN=0;function Zu(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:++bN,markArrays:null},M1(c.curOp)}function Xu(c){var d=c.curOp;d&&nm(d,function(A){for(var E=0;E=A.viewTo)||A.maxLineChanged&&d.options.lineWrapping,c.update=c.mustUpdate&&new Ic(d,c.mustUpdate&&{top:c.scrollTop,ensure:c.scrollToPos},c.forceUpdate)}function Sn(c){c.updatedDisplay=c.mustUpdate&&pv(c.cm,c.update)}function Vl(c){var d=c.cm,A=d.display;c.updatedDisplay&&mm(d),c.barMeasure=Cc(d),A.maxLineChanged&&!d.options.lineWrapping&&(c.adjustWidthTo=F1(d,A.maxLine,A.maxLine.text.length).left+3,d.display.sizerWidth=c.adjustWidthTo,c.barMeasure.scrollWidth=Math.max(A.scroller.clientWidth,A.sizer.offsetLeft+c.adjustWidthTo+oa(d)+d.display.barWidth),c.maxScrollLeft=Math.max(0,A.sizer.offsetLeft+c.adjustWidthTo-iu(d))),(c.updatedDisplay||c.selectionChanged)&&(c.preparedSelection=A.input.prepareSelection())}function DN(c){var d=c.cm;c.adjustWidthTo!=null&&(d.display.sizer.style.minWidth=c.adjustWidthTo+"px",c.maxScrollLeft=c.display.viewTo)){var A=+new Date+c.options.workTime,E=Qr(c,d.highlightFrontier),T=[];d.iter(E.line,Math.min(d.first+d.size,c.display.viewTo+500),function(U){if(E.line>=c.display.viewFrom){var G=U.styles,te=U.text.length>c.options.maxHighlightLength?Tr(d.mode,E.state):null,oe=ps(c,U,E,!0);te&&(E.state=te),U.styles=oe.styles;var se=U.styleClasses,Ae=oe.classes;Ae?U.styleClasses=Ae:se&&(U.styleClasses=null);for(var Ie=!G||G.length!=U.styles.length||se!=Ae&&(!se||!Ae||se.bgClass!=Ae.bgClass||se.textClass!=Ae.textClass),Ze=0;!Ie&&ZeA)return Oc(c,c.options.workDelay),!0}),d.highlightFrontier=E.line,d.modeFrontier=Math.max(d.modeFrontier,E.line),T.length&&di(c,function(){for(var U=0;U=A.viewFrom&&d.visible.to<=A.viewTo&&(A.updateLineNumbers==null||A.updateLineNumbers>=A.viewTo)&&A.renderedView==A.view&&iv(c)==0)return!1;Z1(c)&&(_a(c),d.dims=Pl(c));var T=E.first+E.size,U=Math.max(d.visible.from-c.options.viewportMargin,E.first),G=Math.min(T,d.visible.to+c.options.viewportMargin);A.viewFromG&&A.viewTo-G<20&&(G=Math.min(T,A.viewTo)),No&&(U=tu(c.doc,U),G=S1(c.doc,G));var te=U!=A.viewFrom||G!=A.viewTo||A.lastWrapHeight!=d.wrapperHeight||A.lastWrapWidth!=d.wrapperWidth;gN(c,U,G),A.viewOffset=Po(zt(c.doc,A.viewFrom)),c.display.mover.style.top=A.viewOffset+"px";var oe=iv(c);if(!te&&oe==0&&!d.force&&A.renderedView==A.view&&(A.updateLineNumbers==null||A.updateLineNumbers>=A.viewTo))return!1;var se=NN(c);return oe>4&&(A.lineDiv.style.display="none"),SN(c,A.updateLineNumbers,d.dims),oe>4&&(A.lineDiv.style.display=""),A.renderedView=A.view,G1(se),H(A.cursorDiv),H(A.selectionDiv),A.gutters.style.height=A.sizer.style.minHeight=0,te&&(A.lastWrapHeight=d.wrapperHeight,A.lastWrapWidth=d.wrapperWidth,Oc(c,400)),A.updateLineNumbers=null,!0}function Y1(c,d){for(var A=d.viewport,E=!0;;E=!1){if(!E||!c.options.lineWrapping||d.oldDisplayWidth==iu(c)){if(A&&A.top!=null&&(A={top:Math.min(c.doc.height+xc(c.display)-am(c),A.top)}),d.visible=Or(c.display,c.doc,A),d.visible.from>=c.display.viewFrom&&d.visible.to<=c.display.viewTo)break}else E&&(d.visible=Or(c.display,c.doc,A));if(!pv(c,d))break;mm(c);var T=Cc(c);Sc(c),ti(c,T),wm(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 ym(c,d){var A=new Ic(c,d);if(pv(c,A)){mm(c),Y1(c,A);var E=Cc(c);Sc(c),ti(c,E),wm(c,E),A.finish()}}function SN(c,d,A){var E=c.display,T=c.options.lineNumbers,U=E.lineDiv,G=U.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=E.view,se=E.viewFrom,Ae=0;Ae-1&&($e=!1),im(c,Ie,se,A)),$e&&(H(Ie.lineNumber),Ie.lineNumber.appendChild(document.createTextNode(ht(c.options,se)))),G=Ie.node.nextSibling}se+=Ie.size}for(;G;)G=te(G)}function mv(c){var d=c.gutters.offsetWidth;c.sizer.style.marginLeft=d+"px",Hn(c,"gutterChanged",c)}function wm(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+oa(c)+"px"}function hv(c){var d=c.display,A=d.view;if(!(!d.alignWidgets&&(!d.gutters.firstChild||!c.options.fixedGutter))){for(var E=Nc(d)-d.scroller.scrollLeft+c.doc.scrollLeft,T=d.gutters.offsetWidth,U=E+"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=dv(E.gutters,E.lineNumbers),vv(T),A.init(T)}var _c=0,gs=null;u?gs=-.53:r?gs=15:f?gs=-.7:y&&(gs=-1/3);function gv(c){var d=c.wheelDeltaX,A=c.wheelDeltaY;return d==null&&c.detail&&c.axis==c.HORIZONTAL_AXIS&&(d=c.detail),A==null&&c.detail&&c.axis==c.VERTICAL_AXIS?A=c.detail:A==null&&(A=c.wheelDelta),{x:d,y:A}}function AN(c){var d=gv(c);return d.x*=gs,d.y*=gs,d}function X1(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 A=gv(d),E=A.x,T=A.y,U=gs;d.deltaMode===0&&(E=d.deltaX,T=d.deltaY,U=1);var G=c.display,te=G.scroller,oe=te.scrollWidth>te.clientWidth,se=te.scrollHeight>te.clientHeight;if(E&&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&&Fe(c,E.to())<=0)return A}return-1};var kr=function(c,d){this.anchor=c,this.head=d};kr.prototype.from=function(){return Js(this.anchor,this.head)},kr.prototype.to=function(){return hi(this.anchor,this.head)},kr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ro(c,d,A){var E=c&&c.options.selectionsMayTouch,T=d[A];d.sort(function(Ze,$e){return Fe(Ze.from(),$e.from())}),A=Ee(d,T);for(var U=1;U0:oe>=0){var se=Js(te.from(),G.from()),Ae=hi(te.to(),G.to()),Ie=te.empty()?G.from()==G.head:te.from()==te.head;U<=A&&--A,d.splice(--U,2,new kr(Ie?Ae:se,Ie?se:Ae))}}return new Mo(d,A)}function ou(c,d){return new Mo([new kr(c,d||c)],0)}function au(c){return c.text?nt(c.from.line+c.text.length-1,ve(c.text).length+(c.text.length==1?c.from.ch:0)):c.to}function Ku(c,d){if(Fe(c,d.from)<0)return c;if(Fe(c,d.to)<=0)return au(d);var A=c.line+d.text.length-(d.to.line-d.from.line)-1,E=c.ch;return c.line==d.to.line&&(E+=au(d).ch-d.to.ch),nt(A,E)}function kc(c,d){for(var A=[],E=0;E1&&c.remove(te.line+1,at-1),c.insert(te.line+1,Dt)}Hn(c,"change",c,d)}function Vn(c,d,A){function E(T,U,G){if(T.linked)for(var te=0;te1&&!c.done[c.done.length-2].ranges)return c.done.pop(),ve(c.done)}function Q1(c,d,A,E){var T=c.history;T.undone.length=0;var U=+new Date,G,te;if((T.lastOp==E||T.lastOrigin==d.origin&&d.origin&&(d.origin.charAt(0)=="+"&&T.lastModTime>U-(c.cm?c.cm.options.historyEventDelay:500)||d.origin.charAt(0)=="*"))&&(G=Nm(T,T.lastOp==E)))te=ve(G.changes),Fe(d.from,d.to)==0&&Fe(d.from,te.to)==0?te.to=au(d):G.changes.push(Ju(c,d));else{var oe=ve(T.done);for((!oe||!oe.ranges)&&Pc(c.sel,T.done),G={changes:[Ju(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(A),T.generation=++T.maxGeneration,T.lastModTime=T.lastSelTime=U,T.lastOp=T.lastSelOp=E,T.lastOrigin=T.lastSelOrigin=d.origin,te||tt(c,"historyAdded")}function MN(c,d,A,E){var T=d.charAt(0);return T=="*"||T=="+"&&A.ranges.length==E.ranges.length&&A.somethingSelected()==E.somethingSelected()&&new Date-c.history.lastSelTime<=(c.cm?c.cm.options.historyEventDelay:500)}function TN(c,d,A,E){var T=c.history,U=E&&E.origin;A==T.lastSelOp||U&&T.lastSelOrigin==U&&(T.lastModTime==T.lastSelTime&&T.lastOrigin==U||MN(c,U,ve(T.done),d))?T.done[T.done.length-1]=d:Pc(d,T.done),T.lastSelTime=+new Date,T.lastSelOrigin=U,T.lastSelOp=A,E&&E.clearRedo!==!1&&Yl(T.undone)}function Pc(c,d){var A=ve(d);A&&A.ranges&&A.equals(c)||d.push(c)}function yv(c,d,A,E){var T=d["spans_"+c.id],U=0;c.iter(Math.max(c.first,A),Math.min(c.first+c.size,E),function(G){G.markedSpans&&((T||(T=d["spans_"+c.id]={}))[U]=G.markedSpans),++U})}function ON(c){if(!c)return null;for(var d,A=0;A-1&&(ve(te)[Ie]=se[Ie],delete se[Ie])}}return E}function Sm(c,d,A,E){if(E){var T=c.anchor;if(A){var U=Fe(d,T)<0;U!=Fe(A,T)<0?(T=d,d=A):U!=Fe(d,A)<0&&(d=A)}return new kr(T,d)}else return new kr(A||d,d)}function Em(c,d,A,E,T){T==null&&(T=c.cm&&(c.cm.display.shift||c.extend)),vi(c,new Mo([Sm(c.sel.primary(),d,A,T)],0),E)}function wv(c,d,A){for(var E=[],T=c.cm&&(c.cm.display.shift||c.extend),U=0;U=d.ch:te.to>d.ch))){if(T&&(tt(oe,"beforeCursorEnter"),oe.explicitlyCleared))if(U.markedSpans){--G;continue}else break;if(!oe.atomic)continue;if(A){var Ie=oe.find(E<0?1:-1),Ze=void 0;if((E<0?Ae:se)&&(Ie=Nv(c,Ie,-E,Ie&&Ie.line==d.line?U:null)),Ie&&Ie.line==d.line&&(Ze=Fe(Ie,A))&&(E<0?Ze<0:Ze>0))return xs(c,Ie,d,E,T)}var $e=oe.find(E<0?-1:1);return(E<0?se:Ae)&&($e=Nv(c,$e,E,$e.line==d.line?U:null)),$e?xs(c,$e,d,E,T):null}}return d}function Mm(c,d,A,E,T){var U=E||1,G=xs(c,d,A,U,T)||!T&&xs(c,d,A,U,!0)||xs(c,d,A,-U,T)||!T&&xs(c,d,A,-U,!0);return G||(c.cantEdit=!0,nt(c.first,0))}function Nv(c,d,A,E){return A<0&&d.ch==0?d.line>c.first?Mt(c,nt(d.line-1)):null:A>0&&d.ch==(E||zt(c,d.line)).text.length?d.line=0;--T)qc(c,{from:E[T].from,to:E[T].to,text:T?[""]:d.text,origin:d.origin});else qc(c,d)}}function qc(c,d){if(!(d.text.length==1&&d.text[0]==""&&Fe(d.from,d.to)==0)){var A=kc(c,d);Q1(c,d,A,c.cm?c.cm.curOp.id:NaN),ua(c,d,A,Zt(c,d));var E=[];Vn(c,function(T,U){!U&&Ee(E,T.history)==-1&&(Av(T.history,d),E.push(T.history)),ua(T,d,null,Zt(T,d))})}}function Kl(c,d,A){var E=c.cm&&c.cm.state.suppressEdits;if(!(E&&!A)){for(var T=c.history,U,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 rx(c,d){if(d!=0&&(c.first+=d,c.sel=new Mo(Re(c.sel.ranges,function(T){return new kr(nt(T.anchor.line+d,T.anchor.ch),nt(T.head.line+d,T.head.ch))}),c.sel.primIndex),c.cm)){Zi(c.cm,c.first,c.first-d,d);for(var A=c.cm.display,E=A.viewFrom;Ec.lastLine())){if(d.from.lineU&&(d={from:d.from,to:nt(U,zt(c,U).text.length),text:[d.text[0]],origin:d.origin}),d.removed=ra(c,d.from,d.to),A||(A=kc(c,d)),c.cm?FN(c.cm,d,E):xv(c,d,E),Cm(c,A,Be),c.cantEdit&&Mm(c,nt(c.firstLine(),0))&&(c.cantEdit=!1)}}function FN(c,d,A){var E=c.doc,T=c.display,U=d.from,G=d.to,te=!1,oe=U.line;c.options.lineWrapping||(oe=ue(ia(zt(E,U.line))),E.iter(oe,G.line+1,function($e){if($e==T.maxLine)return te=!0,!0})),E.sel.contains(d.from,d.to)>-1&&kt(c),xv(E,d,A,Rl(c)),c.options.lineWrapping||(E.iter(oe,U.line+d.text.length,function($e){var at=tm($e);at>T.maxLineLength&&(T.maxLine=$e,T.maxLineLength=at,T.maxLineChanged=!0,te=!1)}),te&&(c.curOp.updateMaxLine=!0)),Qp(E,U.line),Oc(c,400);var se=d.text.length-(G.line-U.line)-1;d.full?Zi(c):U.line==G.line&&d.text.length==1&&!K1(c.doc,d)?vs(c,U.line,"text"):Zi(c,U.line,G.line+1,se);var Ae=ur(c,"changes"),Ie=ur(c,"change");if(Ie||Ae){var Ze={from:U,to:G,text:d.text,removed:d.removed,origin:d.origin};Ie&&Hn(c,"change",c,Ze),Ae&&(c.curOp.changeObjs||(c.curOp.changeObjs=[])).push(Ze)}c.display.selForContextMenu=null}function Jl(c,d,A,E,T){var U;E||(E=A),Fe(E,A)<0&&(U=[E,A],A=U[0],E=U[1]),typeof d=="string"&&(d=c.splitLines(d)),Qu(c,{from:A,to:E,text:d,origin:T})}function Ev(c,d,A,E){A1||!(this.children[0]instanceof jl))){var te=[];this.collapse(te),this.children=[new jl(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,A){for(var E=0;Ec.display.maxLineLength&&(c.display.maxLine=se,c.display.maxLineLength=Ae,c.display.maxLineChanged=!0)}E!=null&&c&&this.collapsed&&Zi(c,E,T+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,c&&ex(c.doc)),c&&Hn(c,"markerCleared",c,this,E,T),d&&Xu(c),this.parent&&this.parent.clear()}},qo.prototype.find=function(c,d){c==null&&this.type=="bookmark"&&(c=1);for(var A,E,T=0;T0||G==0&&U.clearWhenEmpty!==!1)return U;if(U.replacedWith&&(U.collapsed=!0,U.widgetNode=ee("span",[U.replacedWith],"CodeMirror-widget"),E.handleMouseEvents||U.widgetNode.setAttribute("cm-ignore-events","true"),E.insertLeft&&(U.widgetNode.insertLeft=!0)),U.collapsed){if(N1(c,d.line,d,A,U)||d.line!=A.line&&N1(c,A.line,d,A,U))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ru()}U.addToHistory&&Q1(c,{from:d,to:A,origin:"markText"},c.sel,NaN);var te=d.line,oe=c.cm,se;if(c.iter(te,A.line+1,function(Ie){oe&&U.collapsed&&!oe.options.lineWrapping&&ia(Ie)==oe.display.maxLine&&(se=!0),U.collapsed&&te!=d.line&&Un(Ie,0),an(Ie,new mc(U,te==d.line?d.ch:null,te==A.line?A.ch:null),c.cm&&c.cm.curOp),++te}),U.collapsed&&c.iter(d.line,A.line+1,function(Ie){Vi(c,Ie)&&Un(Ie,0)}),U.clearOnEnter&&Y(U,"beforeCursorEnter",function(){return U.clear()}),U.readOnly&&(sN(),(c.history.done.length||c.history.undone.length)&&c.clearHistory()),U.collapsed&&(U.id=++Cv,U.atomic=!0),oe){if(se&&(oe.curOp.updateMaxLine=!0),U.collapsed)Zi(oe,d.line,A.line+1);else if(U.className||U.startStyle||U.endStyle||U.css||U.attributes||U.title)for(var Ae=d.line;Ae<=A.line;Ae++)vs(oe,Ae,"text");U.atomic&&ex(oe.doc),Hn(oe,"markerAdded",oe,U)}return U}var fu=function(c,d){this.markers=c,this.primary=d;for(var A=0;A=0;oe--)Qu(this,E[oe]);te?Xl(this,te):this.cm&&Hl(this.cm)}),undo:Wn(function(){Kl(this,"undo")}),redo:Wn(function(){Kl(this,"redo")}),undoSelection:Wn(function(){Kl(this,"undo",!0)}),redoSelection:Wn(function(){Kl(this,"redo",!0)}),setExtending:function(c){this.extend=c},getExtending:function(){return this.extend},historySize:function(){for(var c=this.history,d=0,A=0,E=0;E=c.ch)&&d.push(T.marker.parent||T.marker)}return d},findMarks:function(c,d,A){c=Mt(this,c),d=Mt(this,d);var E=[],T=c.line;return this.iter(c.line,d.line+1,function(U){var G=U.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)&&(!A||A(oe.marker))&&E.push(oe.marker.parent||oe.marker)}++T}),E},getAllMarks:function(){var c=[];return this.iter(function(d){var A=d.markedSpans;if(A)for(var E=0;Ec)return d=c,!0;c-=U,++A}),Mt(this,nt(A,d))},indexFromPos:function(c){c=Mt(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()),Cm(d.doc,ou(A,A)),Ie)for(var Ze=0;Ze=0;te--)Jl(c.doc,"",E[te].from,E[te].to,"+delete");Hl(c)})}function Iv(c,d,A){var E=ne(c.text,d+A,A);return E<0||E>c.text.length?null:E}function Fv(c,d,A){var E=Iv(c,d.ch,A);return E==null?null:new nt(d.line,E,A<0?"after":"before")}function _v(c,d,A,E,T){if(c){d.doc.direction=="rtl"&&(T=-T);var U=Xe(A,d.doc.direction);if(U){var G=T<0?ve(U):U[0],te=T<0==(G.level==1),oe=te?"after":"before",se;if(G.level>0||d.doc.direction=="rtl"){var Ae=$u(d,A);se=T<0?A.text.length-1:0;var Ie=Ao(d,Ae,se).top;se=pe(function(Ze){return Ao(d,Ae,Ze).top==Ie},T<0==(G.level==1)?G.from:G.to-1,se),oe=="before"&&(se=Iv(A,se,1))}else se=T<0?G.to:G.from;return new nt(E,se,oe)}}return new nt(E,T<0?A.text.length:0,T<0?"before":"after")}function LN(c,d,A,E){var T=Xe(d,c.doc.direction);if(!T)return Fv(d,A,E);A.ch>=d.text.length?(A.ch=d.text.length,A.sticky="before"):A.ch<=0&&(A.ch=0,A.sticky="after");var U=Qe(T,A.ch,A.sticky),G=T[U];if(c.doc.direction=="ltr"&&G.level%2==0&&(E>0?G.to>A.ch:G.from=G.from&&Ze>=Ae.begin)){var $e=Ie?"before":"after";return new nt(A.line,Ze,$e)}}var at=function(Dt,At,bt){for(var Ot=function(Gr,ni){return ni?new nt(A.line,te(Gr,1),"before"):new nt(A.line,Gr,"after")};Dt>=0&&Dt0==(Kt.level!=1),vr=Vt?bt.begin:te(bt.end,-1);if(Kt.from<=vr&&vr0?Ae.end:te(Ae.begin,-1);return yt!=null&&!(E>0&&yt==d.text.length)&&(mt=at(E>0?0:T.length-1,E,se(yt)),mt)?mt:null}var af={selectAll:Rc,singleSelection:function(c){return c.setSelection(c.getCursor("anchor"),c.getCursor("head"),Be)},killLine:function(c){return of(c,function(d){if(d.empty()){var A=zt(c.doc,d.head.line).text.length;return d.head.ch==A&&d.head.line0)T=new nt(T.line,T.ch+1),c.replaceRange(U.charAt(T.ch-1)+U.charAt(T.ch-2),nt(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 nt(T.line,1),c.replaceRange(U.charAt(0)+c.doc.lineSeparator()+G.charAt(G.length-1),nt(T.line-1,G.length-1),T,"+transpose"))}}A.push(new kr(T,T))}c.setSelections(A)})},newlineAndIndent:function(c){return di(c,function(){for(var d=c.listSelections(),A=d.length-1;A>=0;A--)c.replaceRange(c.doc.lineSeparator(),d[A].anchor,d[A].head,"+input");d=c.listSelections();for(var E=0;Ec&&Fe(d,this.pos)==0&&A==this.button};var Vc,uf;function UN(c,d){var A=+new Date;return uf&&uf.compare(A,c,d)?(Vc=uf=null,"triple"):Vc&&Vc.compare(A,c,d)?(uf=new Bv(A,c,d),Vc=null,"double"):(Vc=new Bv(A,c,d),uf=null,"single")}function Lv(c){var d=this,A=d.display;if(!(wt(d,c)||A.activeTouch&&A.input.supportsTouch())){if(A.input.ensurePolled(),A.shift=c.shiftKey,Fa(A,c)){a||(A.scroller.draggable=!1,setTimeout(function(){return A.scroller.draggable=!0},100));return}if(!Pv(d,c)){var E=sa(d,c),T=Fn(c),U=E?UN(E,T):"single";Ne(d).focus(),T==1&&d.state.selectingText&&d.state.selectingText(c),!(E&&Dx(d,T,E,U,c))&&(T==1?E?HN(d,E,U,c):Sr(c)==A.scroller&&Wt(c):T==2?(E&&Em(d.doc,E),setTimeout(function(){return A.input.focus()},20)):T==3&&(R?d.display.input.onContextMenu(c):Ul(d)))}}}function Dx(c,d,A,E,T){var U="Click";return E=="double"?U="Double"+U:E=="triple"&&(U="Triple"+U),U=(d==1?"Left":d==2?"Middle":"Right")+U,Wc(c,mx(U,T),T,function(G){if(typeof G=="string"&&(G=af[G]),!G)return!1;var te=!1;try{c.isReadOnly()&&(c.state.suppressEdits=!0),te=G(c,A)!=We}finally{c.state.suppressEdits=!1}return te})}function km(c,d,A){var E=c.getOption("configureMouse"),T=E?E(c,d,A):{};if(T.unit==null){var U=I?A.shiftKey&&A.metaKey:A.altKey;T.unit=U?"rectangle":d=="single"?"char":d=="double"?"word":"line"}return(T.extend==null||c.doc.extend)&&(T.extend=c.doc.extend||A.shiftKey),T.addNew==null&&(T.addNew=M?A.metaKey:A.ctrlKey),T.moveOnDrag==null&&(T.moveOnDrag=!(M?A.altKey:A.ctrlKey)),T}function HN(c,d,A,E){u?setTimeout(Pe(av,c),0):c.curOp.focus=Z(ye(c));var T=km(c,A,E),U=c.doc.sel,G;c.options.dragDrop&&Ta&&!c.isReadOnly()&&A=="single"&&(G=U.contains(d))>-1&&(Fe((G=U.ranges[G]).from(),d)<0||d.xRel>0)&&(Fe(G.to(),d)>0||d.xRel<0)?$N(c,E,d,T):WN(c,E,d,T)}function $N(c,d,A,E){var T=c.display,U=!1,G=ri(c,function(se){a&&(T.scroller.draggable=!1),c.state.draggingText=!1,c.state.delayingBlurEvent&&(c.hasFocus()?c.state.delayingBlurEvent=!1:Ul(c)),Ye(T.wrapper.ownerDocument,"mouseup",G),Ye(T.wrapper.ownerDocument,"mousemove",te),Ye(T.scroller,"dragstart",oe),Ye(T.scroller,"drop",G),U||(Wt(se),E.addNew||Em(c.doc,A,null,null,E.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){U=U||Math.abs(d.clientX-se.clientX)+Math.abs(d.clientY-se.clientY)>=10},oe=function(){return U=!0};a&&(T.scroller.draggable=!0),c.state.draggingText=G,G.copy=!E.moveOnDrag,Y(T.wrapper.ownerDocument,"mouseup",G),Y(T.wrapper.ownerDocument,"mousemove",te),Y(T.scroller,"dragstart",oe),Y(T.scroller,"drop",G),c.state.delayingBlurEvent=!0,setTimeout(function(){return T.input.focus()},20),T.scroller.dragDrop&&T.scroller.dragDrop()}function Nx(c,d,A){if(A=="char")return new kr(d,d);if(A=="word")return c.findWordAt(d);if(A=="line")return new kr(nt(d.line,0),Mt(c.doc,nt(d.line+1,0)));var E=A(c,d);return new kr(E.from,E.to)}function WN(c,d,A,E){u&&Ul(c);var T=c.display,U=c.doc;Wt(d);var G,te,oe=U.sel,se=oe.ranges;if(E.addNew&&!E.extend?(te=U.sel.contains(A),te>-1?G=se[te]:G=new kr(A,A)):(G=U.sel.primary(),te=U.sel.primIndex),E.unit=="rectangle")E.addNew||(G=new kr(A,A)),A=sa(c,d,!0,!0),te=-1;else{var Ae=Nx(c,A,E.unit);E.extend?G=Sm(G,Ae.anchor,Ae.head,E.extend):G=Ae}E.addNew?te==-1?(te=se.length,vi(U,Ro(c,se.concat([G]),te),{scroll:!1,origin:"*mouse"})):se.length>1&&se[te].empty()&&E.unit=="char"&&!E.extend?(vi(U,Ro(c,se.slice(0,te).concat(se.slice(te+1)),0),{scroll:!1,origin:"*mouse"}),oe=U.sel):Am(U,te,G,lt):(te=0,vi(U,new Mo([G],0),lt),oe=U.sel);var Ie=A;function Ze(bt){if(Fe(Ie,bt)!=0)if(Ie=bt,E.unit=="rectangle"){for(var Ot=[],Kt=c.options.tabSize,Vt=Oe(zt(U,A.line).text,A.ch,Kt),vr=Oe(zt(U,bt.line).text,bt.ch,Kt),Gr=Math.min(Vt,vr),ni=Math.max(Vt,vr),mn=Math.min(A.line,bt.line),xi=Math.min(c.lastLine(),Math.max(A.line,bt.line));mn<=xi;mn++){var Xi=zt(U,mn).text,Bn=de(Xi,Gr,Kt);Gr==ni?Ot.push(new kr(nt(mn,Bn),nt(mn,Bn))):Xi.length>Bn&&Ot.push(new kr(nt(mn,Bn),nt(mn,de(Xi,ni,Kt))))}Ot.length||Ot.push(new kr(A,A)),vi(U,Ro(c,oe.ranges.slice(0,te).concat(Ot),te),{origin:"*mouse",scroll:!1}),c.scrollIntoView(bt)}else{var Ki=G,ui=Nx(c,bt,E.unit),Gn=Ki.anchor,vn;Fe(ui.anchor,Gn)>0?(vn=ui.head,Gn=Js(Ki.from(),ui.anchor)):(vn=ui.anchor,Gn=hi(Ki.to(),ui.head));var gn=oe.ranges.slice(0);gn[te]=Sx(c,new kr(Mt(U,Gn),vn)),vi(U,Ro(c,gn,te),lt)}}var $e=T.wrapper.getBoundingClientRect(),at=0;function mt(bt){var Ot=++at,Kt=sa(c,bt,!0,E.unit=="rectangle");if(Kt)if(Fe(Kt,Ie)!=0){c.curOp.focus=Z(ye(c)),Ze(Kt);var Vt=Or(T,U);(Kt.line>=Vt.to||Kt.line$e.bottom?20:0;vr&&setTimeout(ri(c,function(){at==Ot&&(T.scroller.scrollTop+=vr,mt(bt))}),50)}}function yt(bt){c.state.selectingText=!1,at=1/0,bt&&(Wt(bt),T.input.focus()),Ye(T.wrapper.ownerDocument,"mousemove",Dt),Ye(T.wrapper.ownerDocument,"mouseup",At),U.history.lastSelOrigin=null}var Dt=ri(c,function(bt){bt.buttons===0||!Fn(bt)?yt(bt):mt(bt)}),At=ri(c,yt);c.state.selectingText=At,Y(T.wrapper.ownerDocument,"mousemove",Dt),Y(T.wrapper.ownerDocument,"mouseup",At)}function Sx(c,d){var A=d.anchor,E=d.head,T=zt(c.doc,A.line);if(Fe(A,E)==0&&A.sticky==E.sticky)return d;var U=Xe(T);if(!U)return d;var G=Qe(U,A.ch,A.sticky),te=U[G];if(te.from!=A.ch&&te.to!=A.ch)return d;var oe=G+(te.from==A.ch==(te.level!=1)?0:1);if(oe==0||oe==U.length)return d;var se;if(E.line!=A.line)se=(E.line-A.line)*(c.doc.direction=="ltr"?1:-1)>0;else{var Ae=Qe(U,E.ch,E.sticky),Ie=Ae-G||(E.ch-A.ch)*(te.level==1?-1:1);Ae==oe-1||Ae==oe?se=Ie<0:se=Ie>0}var Ze=U[oe+(se?-1:0)],$e=se==(Ze.level==1),at=$e?Ze.from:Ze.to,mt=$e?"after":"before";return A.ch==at&&A.sticky==mt?d:new kr(new nt(A.line,at,mt),E)}function Ex(c,d,A,E){var T,U;if(d.touches)T=d.touches[0].clientX,U=d.touches[0].clientY;else try{T=d.clientX,U=d.clientY}catch{return!1}if(T>=Math.floor(c.display.gutters.getBoundingClientRect().right))return!1;E&&Wt(d);var G=c.display,te=G.lineDiv.getBoundingClientRect();if(U>te.bottom||!ur(c,A))return tr(d);U-=te.top-G.viewOffset;for(var oe=0;oe=T){var Ae=Me(c.doc,U),Ie=c.display.gutterSpecs[oe];return tt(c,A,c,Ae,Ie.className,d),tr(d)}}}function Pv(c,d){return Ex(c,d,"gutterClick",!0)}function Rv(c,d){Fa(c.display,d)||gi(c,d)||wt(c,d,"contextmenu")||R||c.display.input.onContextMenu(d)}function gi(c,d){return ur(c,"gutterContextMenu")?Ex(c,d,"gutterContextMenu",!1):!1}function qv(c){c.display.wrapper.className=c.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+c.options.theme.replace(/(^|\s)\s*/g," cm-s-"),yc(c)}var lf={toString:function(){return"CodeMirror.Init"}},Ax={},Bm={};function VN(c){var d=c.optionHandlers;function A(E,T,U,G){c.defaults[E]=T,U&&(d[E]=G?function(te,oe,se){se!=lf&&U(te,oe,se)}:U)}c.defineOption=A,c.Init=lf,A("value","",function(E,T){return E.setValue(T)},!0),A("mode",null,function(E,T){E.doc.modeOption=T,Dm(E)},!0),A("indentUnit",2,Dm,!0),A("indentWithTabs",!1),A("smartIndent",!0),A("tabSize",4,function(E){Bc(E),yc(E),Zi(E)},!0),A("lineSeparator",null,function(E,T){if(E.doc.lineSep=T,!!T){var U=[],G=E.doc.first;E.doc.iter(function(oe){for(var se=0;;){var Ae=oe.text.indexOf(T,se);if(Ae==-1)break;se=Ae+T.length,U.push(nt(G,Ae))}G++});for(var te=U.length-1;te>=0;te--)Jl(E.doc,T,U[te],nt(U[te].line,U[te].ch+T.length))}}),A("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(E,T,U){E.state.specialChars=new RegExp(T.source+(T.test(" ")?"":"| "),"g"),U!=lf&&E.refresh()}),A("specialCharPlaceholder",fN,function(E){return E.refresh()},!0),A("electricChars",!0),A("inputStyle",O?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),A("spellcheck",!1,function(E,T){return E.getInputField().spellcheck=T},!0),A("autocorrect",!1,function(E,T){return E.getInputField().autocorrect=T},!0),A("autocapitalize",!1,function(E,T){return E.getInputField().autocapitalize=T},!0),A("rtlMoveVisually",!F),A("wholeLineUpdateBefore",!0),A("theme","default",function(E){qv(E),Fc(E)},!0),A("keyMap","default",function(E,T,U){var G=Fm(T),te=U!=lf&&Fm(U);te&&te.detach&&te.detach(E,G),G.attach&&G.attach(E,te||null)}),A("extraKeys",null),A("configureMouse",null),A("lineWrapping",!1,GN,!0),A("gutters",[],function(E,T){E.display.gutterSpecs=dv(T,E.options.lineNumbers),Fc(E)},!0),A("fixedGutter",!0,function(E,T){E.display.gutters.style.left=T?Nc(E.display)+"px":"0",E.refresh()},!0),A("coverGutterNextToScrollbar",!1,function(E){return ti(E)},!0),A("scrollbarStyle","native",function(E){W1(E),ti(E),E.display.scrollbars.setScrollTop(E.doc.scrollTop),E.display.scrollbars.setScrollLeft(E.doc.scrollLeft)},!0),A("lineNumbers",!1,function(E,T){E.display.gutterSpecs=dv(E.options.gutters,T),Fc(E)},!0),A("firstLineNumber",1,Fc,!0),A("lineNumberFormatter",function(E){return E},Fc,!0),A("showCursorWhenSelecting",!1,Sc,!0),A("resetSelectionOnContextMenu",!0),A("lineWiseCopyCut",!0),A("pasteLinesPerSelection",!0),A("selectionsMayTouch",!1),A("readOnly",!1,function(E,T){T=="nocursor"&&(Gu(E),E.display.input.blur()),E.display.input.readOnlyChanged(T)}),A("screenReaderLabel",null,function(E,T){T=T===""?null:T,E.display.input.screenReaderLabelChanged(T)}),A("disableInput",!1,function(E,T){T||E.display.input.reset()},!0),A("dragDrop",!0,Cx),A("allowDropFileTypes",null),A("cursorBlinkRate",530),A("cursorScrollMargin",0),A("cursorHeight",1,Sc,!0),A("singleCursorHeightPerLine",!0,Sc,!0),A("workTime",100),A("workDelay",100),A("flattenSpans",!0,Bc,!0),A("addModeClass",!1,Bc,!0),A("pollInterval",100),A("undoDepth",200,function(E,T){return E.doc.history.undoDepth=T}),A("historyEventDelay",1250),A("viewportMargin",10,function(E){return E.refresh()},!0),A("maxHighlightLength",1e4,Bc,!0),A("moveInputWithCursor",!0,function(E,T){T||E.display.input.resetPosition()}),A("tabindex",null,function(E,T){return E.display.input.getField().tabIndex=T||""}),A("autofocus",null),A("direction","ltr",function(E,T){return E.doc.setDirection(T)},!0),A("phrases",null)}function Cx(c,d,A){var E=A&&A!=lf;if(!d!=!E){var T=c.display.dragFunctions,U=d?Y:Ye;U(c.display.scroller,"dragstart",T.start),U(c.display.scroller,"dragenter",T.enter),U(c.display.scroller,"dragover",T.over),U(c.display.scroller,"dragleave",T.leave),U(c.display.scroller,"drop",T.drop)}}function GN(c){c.options.lineWrapping?(le(c.display.wrapper,"CodeMirror-wrap"),c.display.sizer.style.minWidth="",c.display.sizerWidth=null):(z(c.display.wrapper,"CodeMirror-wrap"),Wd(c)),fm(c),Zi(c),yc(c),setTimeout(function(){return ti(c)},100)}function sn(c,d){var A=this;if(!(this instanceof sn))return new sn(c,d);this.options=d=d?Ce(d):{},Ce(Ax,d,!1);var E=d.value;typeof E=="string"?E=new Oi(E,d.mode,null,d.lineSeparator,d.direction):d.mode&&(E.modeOption=d.mode),this.doc=E;var T=new sn.inputStyles[d.inputStyle](this),U=this.display=new EN(c,E,T,d);U.wrapper.CodeMirror=this,qv(this),d.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),W1(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&&U.input.focus(),u&&l<11&&setTimeout(function(){return A.display.input.reset(!0)},20),YN(this),BN(),Zu(this),this.curOp.forceUpdate=!0,J1(this,E),d.autofocus&&!O||this.hasFocus()?setTimeout(function(){A.hasFocus()&&!A.state.focused&&pm(A)},20):Gu(this);for(var G in Bm)Bm.hasOwnProperty(G)&&Bm[G](this,d[G],lf);Z1(this),d.finishInit&&d.finishInit(this);for(var te=0;te20*20}Y(d.scroller,"touchstart",function(oe){if(!wt(c,oe)&&!U(oe)&&!Pv(c,oe)){d.input.ensurePolled(),clearTimeout(A);var se=+new Date;d.activeTouch={start:se,moved:!1,prev:se-E.end<=300?E:null},oe.touches.length==1&&(d.activeTouch.left=oe.touches[0].pageX,d.activeTouch.top=oe.touches[0].pageY)}}),Y(d.scroller,"touchmove",function(){d.activeTouch&&(d.activeTouch.moved=!0)}),Y(d.scroller,"touchend",function(oe){var se=d.activeTouch;if(se&&!Fa(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 kr(Ae,Ae):!se.prev.prev||G(se,se.prev.prev)?Ie=c.findWordAt(Ae):Ie=new kr(nt(Ae.line,0),Mt(c.doc,nt(Ae.line+1,0))),c.setSelection(Ie.anchor,Ie.head),c.focus(),Wt(oe)}T()}),Y(d.scroller,"touchcancel",T),Y(d.scroller,"scroll",function(){d.scroller.clientHeight&&($l(c,d.scroller.scrollTop),Co(c,d.scroller.scrollLeft,!0),tt(c,"scroll",c))}),Y(d.scroller,"mousewheel",function(oe){return X1(c,oe)}),Y(d.scroller,"DOMMouseScroll",function(oe){return X1(c,oe)}),Y(d.wrapper,"scroll",function(){return d.wrapper.scrollTop=d.wrapper.scrollLeft=0}),d.dragFunctions={enter:function(oe){wt(c,oe)||no(oe)},over:function(oe){wt(c,oe)||(kN(c,oe),no(oe))},start:function(oe){return ux(c,oe)},drop:ri(c,sx),leave:function(oe){wt(c,oe)||rf(c)}};var te=d.input.getField();Y(te,"keyup",function(oe){return yx.call(c,oe)}),Y(te,"keydown",ri(c,xx)),Y(te,"keypress",ri(c,wx)),Y(te,"focus",function(oe){return pm(c,oe)}),Y(te,"blur",function(oe){return Gu(c,oe)})}var Lm=[];sn.defineInitHook=function(c){return Lm.push(c)};function ff(c,d,A,E){var T=c.doc,U;A==null&&(A="add"),A=="smart"&&(T.mode.indent?U=Qr(c,d).state:A="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(!E&&!/\S/.test(te.text))Ae=0,A="not";else if(A=="smart"&&(Ae=T.mode.indent(U,te.text.slice(se.length),te.text),Ae==We||Ae>150)){if(!E)return;A="prev"}A=="prev"?d>T.first?Ae=Oe(zt(T,d-1).text,null,G):Ae=0:A=="add"?Ae=oe+c.options.indentUnit:A=="subtract"?Ae=oe-c.options.indentUnit:typeof A=="number"&&(Ae=oe+A),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=jn(d),se=null;if(te&&E.ranges.length>1)if(la&&la.text.join(` -`)==d){if(E.ranges.length%la.text.length==0){se=[];for(var Ae=0;Ae=0;Ze--){var $e=E.ranges[Ze],at=$e.from(),mt=$e.to();$e.empty()&&(A&&A>0?at=nt(at.line,at.ch-A):c.state.overwrite&&!te?mt=nt(mt.line,Math.min(zt(U,mt.line).text.length,mt.ch+ve(oe).length)):te&&la&&la.lineWise&&la.text.join(` +(()=>{var Lte=Object.create;var qx=Object.defineProperty;var Pte=Object.getOwnPropertyDescriptor;var Rte=Object.getOwnPropertyNames;var qte=Object.getPrototypeOf,zte=Object.prototype.hasOwnProperty;var Te=(e,t)=>()=>(e&&(t=e(e=0)),t);var dt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ba=(e,t)=>{for(var r in t)qx(e,r,{get:t[r],enumerable:!0})},xO=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Rte(t))!zte.call(e,i)&&i!==r&&qx(e,i,{get:()=>t[i],enumerable:!(n=Pte(t,i))||n.enumerable});return e};var en=(e,t,r)=>(r=e!=null?Lte(qte(e)):{},xO(t||!e||!e.__esModule?qx(r,"default",{value:e,enumerable:!0}):r,e)),An=e=>xO(qx({},"__esModule",{value:!0}),e);var v=Te(()=>{});function Ute(e,t){this.fun=e,this.array=t}function yO(e){var t=Math.floor((Date.now()-Jc.now())*.001),r=Jc.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+=uE)),[n,i]}var ySe,Jc,sE,uE,wO=Te(()=>{v();x();g();Ute.prototype.run=function(){this.fun.apply(null,this.array)};ySe={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},Jc={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Jc.now===void 0&&(sE=Date.now(),Jc.timing&&Jc.timing.navigationStart&&(sE=Jc.timing.navigationStart),Jc.now=()=>Date.now()-sE);uE=1e9;yO.bigint=function(e){var t=yO(e);return typeof BigInt>"u"?t[0]*uE+t[1]:BigInt(t[0]*uE)+BigInt(t[1])}});var g=Te(()=>{wO()});function Hte(){if(bO)return zv;bO=!0,zv.byteLength=l,zv.toByteArray=s,zv.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=N);var D=w===N?0:4-w%4;return[w,D]}function l(y){var N=u(y),w=N[0],D=N[1];return(w+D)*3/4-D}function a(y,N,w){return(N+w)*3/4-w}function s(y){var N,w=u(y),D=w[0],b=w[1],O=new r(a(y,D,b)),M=0,I=b>0?D-4:D,F;for(F=0;F>16&255,O[M++]=N>>8&255,O[M++]=N&255;return b===2&&(N=t[y.charCodeAt(F)]<<2|t[y.charCodeAt(F+1)]>>4,O[M++]=N&255),b===1&&(N=t[y.charCodeAt(F)]<<10|t[y.charCodeAt(F+1)]<<4|t[y.charCodeAt(F+2)]>>2,O[M++]=N>>8&255,O[M++]=N&255),O}function f(y){return e[y>>18&63]+e[y>>12&63]+e[y>>6&63]+e[y&63]}function p(y,N,w){for(var D,b=[],O=N;OI?I:M+O));return D===1?(N=y[w-1],b.push(e[N>>2]+e[N<<4&63]+"==")):D===2&&(N=(y[w-2]<<8)+y[w-1],b.push(e[N>>10]+e[N>>4&63]+e[N<<2&63]+"=")),b.join("")}return zv}function $te(){if(DO)return zx;DO=!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,N=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+=N,l/=256,i-=8);for(u=u<0;e[r+y]=u&255,y+=N,u/=256,s-=8);e[r+y-N]|=w*128},zx}function Wte(){if(NO)return Qc;NO=!0;let e=Hte(),t=$te(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Qc.Buffer=u,Qc.SlowBuffer=b,Qc.INSPECT_MAX_BYTES=50;let n=2147483647;Qc.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(Je(fe,ArrayBuffer)||fe&&Je(fe.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Je(fe,SharedArrayBuffer)||fe&&Je(fe.buffer,SharedArrayBuffer)))return N(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 pe=w(fe);if(pe)return pe;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:D(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),pe=ne.write(fe,J);return pe!==j&&(ne=ne.slice(0,pe)),ne}function h(fe){let J=fe.length<0?0:D(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 b(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(Je(J,Uint8Array)&&(J=u.from(J,J.offset,J.byteLength)),Je(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,pe=j.length;for(let we=0,Le=Math.min(ne,pe);wepe.length?(u.isBuffer(Le)||(Le=u.from(Le)),Le.copy(pe,we)):Uint8Array.prototype.set.call(pe,Le,we);else if(u.isBuffer(Le))Le.copy(pe,we);else throw new TypeError('"list" argument must be an Array of Buffers');we+=Le.length}return pe};function O(fe,J){if(u.isBuffer(fe))return fe.length;if(ArrayBuffer.isView(fe)||Je(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 pe=!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(pe)return ne?-1:be(fe).length;J=(""+J).toLowerCase(),pe=!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 X(this,J,j);case"latin1":case"binary":return Y(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,pe,we){if(Je(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),pe===void 0&&(pe=0),we===void 0&&(we=this.length),j<0||ne>J.length||pe<0||we>this.length)throw new RangeError("out of range index");if(pe>=we&&j>=ne)return 0;if(pe>=we)return-1;if(j>=ne)return 1;if(j>>>=0,ne>>>=0,pe>>>=0,we>>>=0,this===J)return 0;let Le=we-pe,Qe=ne-j,it=Math.min(Le,Qe),Xe=this.slice(pe,we),pt=J.slice(j,ne);for(let Z=0;Z2147483647?j=2147483647:j<-2147483648&&(j=-2147483648),j=+j,ot(j)&&(j=pe?0:fe.length-1),j<0&&(j=fe.length+j),j>=fe.length){if(pe)return-1;j=fe.length-1}else if(j<0)if(pe)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,pe);if(typeof J=="number")return J=J&255,typeof Uint8Array.prototype.indexOf=="function"?pe?Uint8Array.prototype.indexOf.call(fe,J,j):Uint8Array.prototype.lastIndexOf.call(fe,J,j):C(fe,[J],j,ne,pe);throw new TypeError("val must be string, number or Buffer")}function C(fe,J,j,ne,pe){let we=1,Le=fe.length,Qe=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;we=2,Le/=2,Qe/=2,j/=2}function it(pt,Z){return we===1?pt[Z]:pt.readUInt16BE(Z*we)}let Xe;if(pe){let pt=-1;for(Xe=j;XeLe&&(j=Le-Qe),Xe=j;Xe>=0;Xe--){let pt=!0;for(let Z=0;Zpe&&(ne=pe)):ne=pe;let we=J.length;ne>we/2&&(ne=we/2);let Le;for(Le=0;Le>>0,isFinite(ne)?(ne=ne>>>0,pe===void 0&&(pe="utf8")):(pe=ne,ne=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let we=this.length-j;if((ne===void 0||ne>we)&&(ne=we),J.length>0&&(ne<0||j<0)||j>this.length)throw new RangeError("Attempt to write outside buffer bounds");pe||(pe="utf8");let Le=!1;for(;;)switch(pe){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 z(this,J,j,ne);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,J,j,ne);default:if(Le)throw new TypeError("Unknown encoding: "+pe);pe=(""+pe).toLowerCase(),Le=!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=[],pe=J;for(;pe239?4:we>223?3:we>191?2:1;if(pe+Qe<=j){let it,Xe,pt,Z;switch(Qe){case 1:we<128&&(Le=we);break;case 2:it=fe[pe+1],(it&192)===128&&(Z=(we&31)<<6|it&63,Z>127&&(Le=Z));break;case 3:it=fe[pe+1],Xe=fe[pe+2],(it&192)===128&&(Xe&192)===128&&(Z=(we&15)<<12|(it&63)<<6|Xe&63,Z>2047&&(Z<55296||Z>57343)&&(Le=Z));break;case 4:it=fe[pe+1],Xe=fe[pe+2],pt=fe[pe+3],(it&192)===128&&(Xe&192)===128&&(pt&192)===128&&(Z=(we&15)<<18|(it&63)<<12|(Xe&63)<<6|pt&63,Z>65535&&Z<1114112&&(Le=Z))}}Le===null?(Le=65533,Qe=1):Le>65535&&(Le-=65536,ne.push(Le>>>10&1023|55296),Le=56320|Le&1023),ne.push(Le),pe+=Qe}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 pe="";for(let we=J;wene&&(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 pe=this[J],we=1,Le=0;for(;++Le>>0,j=j>>>0,ne||he(J,j,this.length);let pe=this[J+--j],we=1;for(;j>0&&(we*=256);)pe+=this[J+--j]*we;return pe},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,Be(J,"offset");let j=this[J],ne=this[J+7];(j===void 0||ne===void 0)&<(J,this.length-8);let pe=j+this[++J]*2**8+this[++J]*2**16+this[++J]*2**24,we=this[++J]+this[++J]*2**8+this[++J]*2**16+ne*2**24;return BigInt(pe)+(BigInt(we)<>>0,Be(J,"offset");let j=this[J],ne=this[J+7];(j===void 0||ne===void 0)&<(J,this.length-8);let pe=j*2**24+this[++J]*2**16+this[++J]*2**8+this[++J],we=this[++J]*2**24+this[++J]*2**16+this[++J]*2**8+ne;return(BigInt(pe)<>>0,j=j>>>0,ne||he(J,j,this.length);let pe=this[J],we=1,Le=0;for(;++Le=we&&(pe-=Math.pow(2,8*j)),pe},u.prototype.readIntBE=function(J,j,ne){J=J>>>0,j=j>>>0,ne||he(J,j,this.length);let pe=j,we=1,Le=this[J+--pe];for(;pe>0&&(we*=256);)Le+=this[J+--pe]*we;return we*=128,Le>=we&&(Le-=Math.pow(2,8*j)),Le},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,Be(J,"offset");let j=this[J],ne=this[J+7];(j===void 0||ne===void 0)&<(J,this.length-8);let pe=this[J+4]+this[J+5]*2**8+this[J+6]*2**16+(ne<<24);return(BigInt(pe)<>>0,Be(J,"offset");let j=this[J],ne=this[J+7];(j===void 0||ne===void 0)&<(J,this.length-8);let pe=(j<<24)+this[++J]*2**16+this[++J]*2**8+this[++J];return(BigInt(pe)<>>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,pe,we){if(!u.isBuffer(fe))throw new TypeError('"buffer" argument must be a Buffer instance');if(J>pe||Jfe.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(J,j,ne,pe){if(J=+J,j=j>>>0,ne=ne>>>0,!pe){let Qe=Math.pow(2,8*ne)-1;De(this,J,j,ne,Qe,0)}let we=1,Le=0;for(this[j]=J&255;++Le>>0,ne=ne>>>0,!pe){let Qe=Math.pow(2,8*ne)-1;De(this,J,j,ne,Qe,0)}let we=ne-1,Le=1;for(this[j+we]=J&255;--we>=0&&(Le*=256);)this[j+we]=J/Le&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 ye(fe,J,j,ne,pe){We(J,ne,pe,fe,j,7);let we=Number(J&BigInt(4294967295));fe[j++]=we,we=we>>8,fe[j++]=we,we=we>>8,fe[j++]=we,we=we>>8,fe[j++]=we;let Le=Number(J>>BigInt(32)&BigInt(4294967295));return fe[j++]=Le,Le=Le>>8,fe[j++]=Le,Le=Le>>8,fe[j++]=Le,Le=Le>>8,fe[j++]=Le,j}function ce(fe,J,j,ne,pe){We(J,ne,pe,fe,j,7);let we=Number(J&BigInt(4294967295));fe[j+7]=we,we=we>>8,fe[j+6]=we,we=we>>8,fe[j+5]=we,we=we>>8,fe[j+4]=we;let Le=Number(J>>BigInt(32)&BigInt(4294967295));return fe[j+3]=Le,Le=Le>>8,fe[j+2]=Le,Le=Le>>8,fe[j+1]=Le,Le=Le>>8,fe[j]=Le,j+8}u.prototype.writeBigUInt64LE=ut(function(J,j=0){return ye(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,pe){if(J=+J,j=j>>>0,!pe){let it=Math.pow(2,8*ne-1);De(this,J,j,ne,it-1,-it)}let we=0,Le=1,Qe=0;for(this[j]=J&255;++we>0)-Qe&255;return j+ne},u.prototype.writeIntBE=function(J,j,ne,pe){if(J=+J,j=j>>>0,!pe){let it=Math.pow(2,8*ne-1);De(this,J,j,ne,it-1,-it)}let we=ne-1,Le=1,Qe=0;for(this[j+we]=J&255;--we>=0&&(Le*=256);)J<0&&Qe===0&&this[j+we+1]!==0&&(Qe=1),this[j+we]=(J/Le>>0)-Qe&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 ye(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 Ne(fe,J,j,ne,pe,we){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,pe){return J=+J,j=j>>>0,pe||Ne(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,pe){return J=+J,j=j>>>0,pe||Ne(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,pe){if(!u.isBuffer(J))throw new TypeError("argument should be a Buffer");if(ne||(ne=0),!pe&&pe!==0&&(pe=this.length),j>=J.length&&(j=J.length),j||(j=0),pe>0&&pe=this.length)throw new RangeError("Index out of range");if(pe<0)throw new RangeError("sourceEnd out of bounds");pe>this.length&&(pe=this.length),J.length-j>>0,ne=ne===void 0?this.length:ne>>>0,J||(J=0);let we;if(typeof J=="number")for(we=j;we2**32?pe=Se(String(j)):typeof j=="bigint"&&(pe=String(j),(j>BigInt(2)**BigInt(32)||j<-(BigInt(2)**BigInt(32)))&&(pe=Se(pe)),pe+="n"),ne+=` It must be ${J}. Received ${pe}`,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){Be(J,"offset"),(fe[J]===void 0||fe[J+j]===void 0)&<(J,fe.length-(j+1))}function We(fe,J,j,ne,pe,we){if(fe>j||fe3?J===0||J===BigInt(0)?Qe=`>= 0${Le} and < 2${Le} ** ${(we+1)*8}${Le}`:Qe=`>= -(2${Le} ** ${(we+1)*8-1}${Le}) and < 2 ** ${(we+1)*8-1}${Le}`:Qe=`>= ${J}${Le} and <= ${j}${Le}`,new Oe.ERR_OUT_OF_RANGE("value",Qe,fe)}ze(ne,pe,we)}function Be(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?(Be(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,pe=null,we=[];for(let Le=0;Le55295&&j<57344){if(!pe){if(j>56319){(J-=3)>-1&&we.push(239,191,189);continue}else if(Le+1===ne){(J-=3)>-1&&we.push(239,191,189);continue}pe=j;continue}if(j<56320){(J-=3)>-1&&we.push(239,191,189),pe=j;continue}j=(pe-55296<<10|j-56320)+65536}else pe&&(J-=3)>-1&&we.push(239,191,189);if(pe=null,j<128){if((J-=1)<0)break;we.push(j)}else if(j<2048){if((J-=2)<0)break;we.push(j>>6|192,j&63|128)}else if(j<65536){if((J-=3)<0)break;we.push(j>>12|224,j>>6&63|128,j&63|128)}else if(j<1114112){if((J-=4)<0)break;we.push(j>>18|240,j>>12&63|128,j>>6&63|128,j&63|128)}else throw new Error("Invalid code point")}return we}function Ue(fe){let J=[];for(let j=0;j>8,pe=j%256,we.push(pe),we.push(ne);return we}function Re(fe){return e.toByteArray(de(fe))}function ke(fe,J,j,ne){let pe;for(pe=0;pe=J.length||pe>=fe.length);++pe)J[pe+j]=fe[pe];return pe}function Je(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 et=function(){let fe="0123456789abcdef",J=new Array(256);for(let j=0;j<16;++j){let ne=j*16;for(let pe=0;pe<16;++pe)J[ne+pe]=fe[j]+fe[pe]}return J}();function ut(fe){return typeof BigInt>"u"?Lt:fe}function Lt(){throw new Error("BigInt not supported")}return Qc}var zv,bO,zx,DO,Qc,NO,jc,k,SSe,ASe,EO=Te(()=>{v();x();g();zv={},bO=!1;zx={},DO=!1;Qc={},NO=!1;jc=Wte();jc.Buffer;jc.SlowBuffer;jc.INSPECT_MAX_BYTES;jc.kMaxLength;k=jc.Buffer,SSe=jc.INSPECT_MAX_BYTES,ASe=jc.kMaxLength});var x=Te(()=>{EO()});var qm=dt((lE,fE)=>{v();x();g();(function(e,t){typeof lE=="object"&&typeof fE<"u"?fE.exports=t():typeof define=="function"&&define.amd?define("uikit",t):(e=typeof globalThis<"u"?globalThis:e||self,e.UIkit=t())})(lE,function(){"use strict";let{hasOwnProperty:e,toString:t}=Object.prototype;function r(m,E){return e.call(m,E)}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,(E,_)=>_.toUpperCase())),l=be(m=>m.charAt(0).toUpperCase()+m.slice(1));function a(m,E){var _;return(_=m?.startsWith)==null?void 0:_.call(m,E)}function s(m,E){var _;return(_=m?.endsWith)==null?void 0:_.call(m,E)}function f(m,E){var _;return(_=m?.includes)==null?void 0:_.call(m,E)}function p(m,E){var _;return(_=m?.findIndex)==null?void 0:_.call(m,E)}let{isArray:h,from:y}=Array,{assign:N}=Object;function w(m){return typeof m=="function"}function D(m){return m!==null&&typeof m=="object"}function b(m){return t.call(m)==="[object Object]"}function O(m){return D(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)&&D(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 z(m){return q(m)||R(m)&&!isNaN(m-parseFloat(m))}function H(m){return!(h(m)?m.length:D(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 E=Number(m);return isNaN(E)?!1:E}function ie(m){return parseFloat(m)||0}function X(m){return m&&Y(m)[0]}function Y(m){return I(m)?[m]:Array.from(m||[]).filter(I)}function le(m){if(O(m))return m;m=X(m);let E=M(m)?m:m?.ownerDocument;return E?.defaultView||window}function re(m,E){return m===E||D(m)&&D(E)&&Object.keys(m).length===Object.keys(E).length&&ye(m,(_,$)=>_===E[$])}function he(m,E,_){return m.replace(new RegExp(`${E}|${_}`,"g"),$=>$===E?_:E)}function De(m){return m[m.length-1]}function ye(m,E){for(let _ in m)if(E(m[_],_)===!1)return!1;return!0}function ce(m,E){return m.slice().sort(({[E]:_=0},{[E]:$=0})=>_>$?1:$>_?-1:0)}function Ne(m,E){return m.reduce((_,$)=>_+ie(w(E)?E($):$[E]),0)}function Pe(m,E){let _=new Set;return m.filter(({[E]:$})=>_.has($)?!1:_.add($))}function Ce(m,E){return E.reduce((_,$)=>({..._,[$]:m[$]}),{})}function Oe(m,E=0,_=1){return Math.min(Math.max(ee(m)||0,E),_)}function He(){}function Se(...m){return[["bottom","top"],["right","left"]].every(([E,_])=>Math.min(...m.map(({[E]:$})=>$))-Math.max(...m.map(({[_]:$})=>$))>0)}function ze(m,E){return m.x<=E.right&&m.x>=E.left&&m.y<=E.bottom&&m.y>=E.top}function We(m,E,_){let $=E==="width"?"height":"width";return{[$]:m[E]?Math.round(_*m[$]/m[E]):m[$],[E]:_}}function Be(m,E){m={...m};for(let _ in m)m=m[_]>E[_]?We(m,_,E[_]):m;return m}function lt(m,E){m=Be(m,E);for(let _ in m)m=m[_]E[_]||(E[_]=m(_,...$))}function Ue(m,...E){for(let _ of Y(m)){let $=ot(E).filter(Q=>!ke(_,Q));$.length&&_.classList.add(...$)}}function ve(m,...E){for(let _ of Y(m)){let $=ot(E).filter(Q=>ke(_,Q));$.length&&_.classList.remove(...$)}}function Re(m,E,_){_=ot(_),E=ot(E).filter($=>!f(_,$)),ve(m,E),Ue(m,_)}function ke(m,E){return[E]=ot(E),Y(m).some(_=>_.classList.contains(E))}function Je(m,E,_){let $=ot(E);V(_)||(_=!!_);for(let Q of Y(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 et(m,E,_){var $;if(D(E)){for(let Q in E)et(m,Q,E[Q]);return}if(V(_))return($=X(m))==null?void 0:$.getAttribute(E);for(let Q of Y(m))w(_)&&(_=_.call(Q,et(Q,E))),_===null?Lt(Q,E):Q.setAttribute(E,_)}function ut(m,E){return Y(m).some(_=>_.hasAttribute(E))}function Lt(m,E){Y(m).forEach(_=>_.removeAttribute(E))}function fe(m,E){for(let _ of[E,`data-${E}`])if(ut(m,_))return et(m,_)}let J=typeof window<"u",j=J&&document.dir==="rtl",ne=J&&"ontouchstart"in window,pe=J&&window.PointerEvent,we=pe?"pointerdown":ne?"touchstart":"mousedown",Le=pe?"pointermove":ne?"touchmove":"mousemove",Qe=pe?"pointerup":ne?"touchend":"mouseup",it=pe?"pointerenter":ne?"":"mouseenter",Xe=pe?"pointerleave":ne?"":"mouseleave",pt=pe?"pointercancel":"touchcancel",Z={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 Y(m).some(E=>Z[E.tagName.toLowerCase()])}let Ye=J&&Element.prototype.checkVisibility||function(){return this.offsetWidth||this.offsetHeight||this.getClientRects().length};function tt(m){return Y(m).some(E=>Ye.call(E))}let wt="input,select,textarea,button";function kt(m){return Y(m).some(E=>tr(E,wt))}let ur=`${wt},a[href],[tabindex]`;function Gr(m){return tr(m,ur)}function Vt(m){var E;return(E=X(m))==null?void 0:E.parentElement}function pi(m,E){return Y(m).filter(_=>tr(_,E))}function tr(m,E){return Y(m).some(_=>_.matches(E))}function ro(m,E){let _=[];for(;m=Vt(m);)(!E||tr(m,E))&&_.push(m);return _}function Er(m,E){m=X(m);let _=m?y(m.children):[];return E?pi(_,E):_}function Fn(m,E){return E?Y(m).indexOf(X(E)):Er(Vt(m)).indexOf(m)}function Aa(m){return m=X(m),m&&["origin","pathname","search"].every(E=>m[E]===location[E])}function Ca(m){if(Aa(m)){let{hash:E,ownerDocument:_}=X(m),$=decodeURIComponent(E).slice(1);return _.getElementById($)||_.getElementsByName($)[0]}}function Hn(m,E){return Lo(m,Jo(m,E))}function Ko(m,E){return Qn(m,Jo(m,E))}function Lo(m,E){return X(io(m,X(E),"querySelector"))}function Qn(m,E){return Y(io(m,X(E),"querySelectorAll"))}function Jo(m,E=document){return R(m)&&fs(m).isContextSelector||M(E)?E:E.ownerDocument}let Hl=/([!>+~-])(?=\s+[!>+~-]|\s*$)/g,bo=/.*?[^\\](?![^(]*\))(?:,|$)/g,ac=/\s*,$/,fs=be(m=>{var E;m=m.replace(Hl,"$1 *");let _=!1,$=[];for(let Q of(E=m.match(bo))!=null?E:[])Q=Q.replace(ac,"").trim(),_||(_=["!","+","~","-",">"].includes(Q[0])),$.push(Q);return{selector:$.join(","),selectors:$,isContextSelector:_}}),no=be(m=>{m=m.slice(1).trim();let E=m.indexOf(" ");return~E?[m.slice(0,E),m.slice(E+1)]:[m,""]});function io(m,E=document,_){if(!m||!R(m))return m;let $=fs(m);if(!$.isContextSelector)return Qo(E,_,$.selector);m="";let Q=$.selectors.length===1;for(let ae of $.selectors){let me,Ee=E;if(ae[0]==="!"&&([me,ae]=no(ae),Ee=E.parentElement.closest(me),!ae&&Q)||Ee&&ae[0]==="-"&&([me,ae]=no(ae),Ee=Ee.previousElementSibling,Ee=tr(Ee,me)?Ee:null,!ae&&Q))return Ee;if(Ee){if(Q)return ae[0]==="~"||ae[0]==="+"?(ae=`:scope > :nth-child(${Fn(Ee)+1}) ${ae}`,Ee=Ee.parentElement):ae[0]===">"&&(ae=`:scope ${ae}`),Qo(Ee,_,ae);m+=`${m?",":""}${Js(Ee)} ${ae}`}}return M(E)||(E=E.ownerDocument),Qo(E,_,m)}function Qo(m,E,_){try{return m[E](_)}catch{return null}}function Js(m){let E=[];for(;m.parentNode;){let _=et(m,"id");if(_){E.unshift(`#${Ma(_)}`);break}else{let{tagName:$}=m;$!=="HTML"&&($+=`:nth-child(${Fn(m)+1})`),E.unshift($),m=m.parentNode}}return E.join(" > ")}function Ma(m){return R(m)?CSS.escape(m):""}function Qt(...m){let[E,_,$,Q,ae=!1]=Qr(m);Q.length>1&&(Q=jo(Q)),ae?.self&&(Q=Hu(Q)),$&&(Q=zt($,Q));for(let me of _)for(let Ee of E)Ee.addEventListener(me,Q,ae);return()=>Ri(E,_,Q,ae)}function Ri(...m){let[E,_,,$,Q=!1]=Qr(m);for(let ae of _)for(let me of E)me.removeEventListener(ae,$,Q)}function Tr(...m){let[E,_,$,Q,ae=!1,me]=Qr(m),Ee=Qt(E,_,$,_e=>{let Ke=!me||me(_e);Ke&&(Ee(),Q(_e,Ke))},ae);return Ee}function Rt(m,E,_){return Me(m).every($=>$.dispatchEvent(oo(E,!0,!0,_)))}function oo(m,E=!0,_=!1,$){return R(m)&&(m=new CustomEvent(m,{bubbles:E,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,E){return _=>{let $=m[0]===">"?Qn(m,_.currentTarget).reverse().find(Q=>Q.contains(_.target)):_.target.closest(m);$&&(_.current=$,E.call(this,_),delete _.current)}}function jo(m){return E=>h(E.detail)?m(E,...E.detail):m(E)}function Hu(m){return function(E){if(E.target===E.currentTarget||E.target===E.current)return m.call(null,E)}}function $n(m){return m&&"addEventListener"in m}function ue(m){return $n(m)?m:X(m)}function Me(m){return h(m)?m.map(ue).filter(Boolean):R(m)?Qn(m):$n(m)?[m]:Y(m)}function at(m){return m.pointerType==="touch"||!!m.touches}function ht(m){var E,_;let{clientX:$,clientY:Q}=((E=m.touches)==null?void 0:E[0])||((_=m.changedTouches)==null?void 0:_[0])||m;return{x:$,y:Q}}let nt={"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 Fe(m,E,_,$){let Q=Y(m);for(let ae of Q)if(R(E)){if(E=Ar(E),V(_))return getComputedStyle(ae).getPropertyValue(E);ae.style.setProperty(E,z(_)&&!nt[E]?`${_}px`:_||q(_)?_:"",$)}else if(h(E)){let me={};for(let Ee of E)me[Ee]=Fe(ae,Ee);return me}else if(D(E))for(let me in E)Fe(ae,me,E[me],_);return Q[0]}let Ar=be(m=>{if(a(m,"--"))return m;m=i(m);let{style:E}=document.documentElement;if(m in E)return m;for(let _ of["webkit","moz"]){let $=`-${_}-${m}`;if($ in E)return $}}),_n="uk-transition",mi="transitionend",Qs="transitioncanceled";function v1(m,E,_=400,$="linear"){return _=Math.round(_),Promise.all(Y(m).map(Q=>new Promise((ae,me)=>{for(let _e in E)Fe(Q,_e);let Ee=setTimeout(()=>Rt(Q,mi),_);Tr(Q,[mi,Qs],({type:_e})=>{clearTimeout(Ee),ve(Q,_n),Fe(Q,{transitionProperty:"",transitionDuration:"",transitionTimingFunction:""}),_e===Qs?me():ae(Q)},{self:!0}),Ue(Q,_n),Fe(Q,{transitionProperty:Object.keys(E).map(Ar).join(","),transitionDuration:`${_}ms`,transitionTimingFunction:$,...E})})))}let Mt={start:v1,async stop(m){Rt(m,mi),await Promise.resolve()},async cancel(m){Rt(m,Qs),await Promise.resolve()},inProgress(m){return ke(m,_n)}},sc="uk-animation",Rd="animationend",$u="animationcanceled";function ea(m,E,_=200,$,Q){return Promise.all(Y(m).map(ae=>new Promise((me,Ee)=>{ke(ae,sc)&&Rt(ae,$u);let _e=[E,sc,`${sc}-${Q?"leave":"enter"}`,$&&`uk-transform-origin-${$}`,Q&&`${sc}-reverse`],Ke=setTimeout(()=>Rt(ae,Rd),_);Tr(ae,[Rd,$u],({type:je})=>{clearTimeout(Ke),je===$u?Ee():me(ae),Fe(ae,"animationDuration",""),ve(ae,_e)},{self:!0}),Fe(ae,"animationDuration",`${_}ms`),Ue(ae,_e)})))}let cs={in:ea,out(m,E,_,$){return ea(m,E,_,$,!0)},inProgress(m){return ke(m,sc)},cancel(m){Rt(m,$u)}};function g1(m){if(document.readyState!=="loading"){m();return}Tr(document,"DOMContentLoaded",m)}function jr(m,...E){return E.some(_=>{var $;return(($=m?.tagName)==null?void 0:$.toLowerCase())===_.toLowerCase()})}function uc(m){return m=gr(m),m.innerHTML="",m}function js(m,E){return V(E)?gr(m).innerHTML:vn(uc(m),E)}let qd=cc("prepend"),vn=cc("append"),lc=cc("before"),fc=cc("after");function cc(m){return function(E,_){var $;let Q=Y(R(_)?Wu(_):_);return($=gr(E))==null||$[m](...Q),pc(Q)}}function Do(m){Y(m).forEach(E=>E.remove())}function em(m,E){for(E=X(lc(m,E));E.firstElementChild;)E=E.firstElementChild;return vn(E,m),E}function tm(m,E){return Y(Y(m).map(_=>_.hasChildNodes()?em(y(_.childNodes),E):vn(_,E)))}function No(m){Y(m).map(Vt).filter((E,_,$)=>$.indexOf(E)===_).forEach(E=>E.replaceWith(...E.childNodes))}let fN=/^<(\w+)\s*\/?>(?:<\/\1>)?$/;function Wu(m){let E=fN.exec(m);if(E)return document.createElement(E[1]);let _=document.createElement("template");return _.innerHTML=m.trim(),pc(_.content.childNodes)}function pc(m){return m.length>1?m:m[0]}function Eo(m,E){if(F(m))for(E(m),m=m.firstElementChild;m;){let _=m.nextElementSibling;Eo(m,E),m=_}}function gr(m,E){return x1(m)?X(Wu(m)):Lo(m,E)}function un(m,E){return x1(m)?Y(Wu(m)):Qn(m,E)}function x1(m){return R(m)&&a(m.trim(),"<")}let Vu={width:["left","right"],height:["top","bottom"]};function Xt(m){let E=F(m)?X(m).getBoundingClientRect():{height:qi(m),width:Gu(m),top:0,left:0};return{height:E.height,width:E.width,top:E.top,left:E.left,bottom:E.top+E.height,right:E.left+E.width}}function xr(m,E){E&&Fe(m,{left:0,top:0});let _=Xt(m);if(m){let{scrollY:$,scrollX:Q}=le(m),ae={height:$,width:Q};for(let me in Vu)for(let Ee of Vu[me])_[Ee]+=ae[me]}if(!E)return _;for(let $ of["left","top"])Fe(m,$,E[$]-_[$])}function zd(m){let{top:E,left:_}=xr(m),{ownerDocument:{body:$,documentElement:Q},offsetParent:ae}=X(m),me=ae||Q;for(;me&&(me===$||me===Q)&&Fe(me,"position")==="static";)me=me.parentNode;if(F(me)){let Ee=xr(me);E-=Ee.top+ie(Fe(me,"borderTopWidth")),_-=Ee.left+ie(Fe(me,"borderLeftWidth"))}return{top:E-ie(Fe(m,"marginTop")),left:_-ie(Fe(m,"marginLeft"))}}function eu(m){m=X(m);let E=[m.offsetTop,m.offsetLeft];for(;m=m.offsetParent;)if(E[0]+=m.offsetTop+ie(Fe(m,"borderTopWidth")),E[1]+=m.offsetLeft+ie(Fe(m,"borderLeftWidth")),Fe(m,"position")==="fixed"){let _=le(m);return E[0]+=_.scrollY,E[1]+=_.scrollX,E}return E}let qi=mc("height"),Gu=mc("width");function mc(m){let E=l(m);return(_,$)=>{if(V($)){if(O(_))return _[`inner${E}`];if(M(_)){let Q=_.documentElement;return Math.max(Q[`offset${E}`],Q[`scroll${E}`])}return _=X(_),$=Fe(_,m),$=$==="auto"?_[`offset${E}`]:ie($)||0,$-tu(_,m)}else return Fe(_,m,!$&&$!==0?"":+$+tu(_,m)+"px")}}function tu(m,E,_="border-box"){return Fe(m,"boxSizing")===_?Ne(Vu[E].map(l),$=>ie(Fe(m,`padding${$}`))+ie(Fe(m,`border${$}Width`))):0}function hc(m){for(let E in Vu)for(let _ in Vu[E])if(Vu[E][_]===m)return Vu[E][1-_];return m}function jn(m,E="width",_=window,$=!1){return R(m)?Ne(cN(m),Q=>{let ae=ta(Q);return ae?pN(ae==="vh"?w1():ae==="vw"?Gu(le(_)):$?_[`offset${l(E)}`]:Xt(_)[E],Q):Q}):ie(m)}let rm=/-?\d+(?:\.\d+)?(?:v[wh]|%|px)?/g,cN=be(m=>m.toString().replace(/\s/g,"").match(rm)||[]),y1=/(?:v[hw]|%)$/,ta=be(m=>(m.match(y1)||[])[0]);function pN(m,E){return m*ie(E)/100}let dc,ru;function w1(){return dc||(ru||(ru=gr("
    "),Fe(ru,{height:"100vh",position:"fixed"}),Qt(window,"resize",()=>dc=null)),vn(document.body,ru),dc=ru.clientHeight,Do(ru),dc)}let zi={read:nm,write:Ud,clear:Wl,flush:b1},$l=[],Po=[];function nm(m){return $l.push(m),$d(),m}function Ud(m){return Po.push(m),$d(),m}function Wl(m){Wd($l,m),Wd(Po,m)}let Hd=!1;function b1(){D1($l),D1(Po.splice(0)),Hd=!1,($l.length||Po.length)&&$d()}function $d(){Hd||(Hd=!0,queueMicrotask(b1))}function D1(m){let E;for(;E=m.shift();)try{E()}catch(_){console.error(_)}}function Wd(m,E){let _=m.indexOf(E);return~_&&m.splice(_,1)}class Vd{init(){this.positions=[];let E;this.unbind=Qt(document,"mousemove",_=>E=ht(_)),this.interval=setInterval(()=>{E&&(this.positions.push(E),this.positions.length>5&&this.positions.shift())},50)}cancel(){var E;(E=this.unbind)==null||E.call(this),clearInterval(this.interval)}movesTo(E){if(!this.positions||this.positions.length<2)return!1;let _=Xt(E),{left:$,right:Q,top:ae,bottom:me}=_,[Ee]=this.positions,_e=De(this.positions),Ke=[Ee,_e];return ze(_e,_)?!1:[[{x:$,y:ae},{x:Q,y:me}],[{x:$,y:me},{x:Q,y:ae}]].some(gt=>{let Pt=mN(Ke,gt);return Pt&&ze(Pt,_)})}}function mN([{x:m,y:E},{x:_,y:$}],[{x:Q,y:ae},{x:me,y:Ee}]){let _e=(Ee-ae)*(_-m)-(me-Q)*($-E);if(_e===0)return!1;let Ke=((me-Q)*(E-ae)-(Ee-ae)*(m-Q))/_e;return Ke<0?!1:{x:m+Ke*(_-m),y:E+Ke*($-E)}}function N1(m,E,_={},{intersecting:$=!0}={}){let Q=new IntersectionObserver($?(ae,me)=>{ae.some(Ee=>Ee.isIntersecting)&&E(ae,me)}:E,_);for(let ae of Y(m))Q.observe(ae);return Q}let hN=J&&window.ResizeObserver;function vc(m,E,_={box:"border-box"}){if(hN)return Yd(ResizeObserver,m,E,_);let $=[Qt(window,"load resize",E),Qt(document,"loadedmetadata load",E,!0)];return{disconnect:()=>$.map(Q=>Q())}}function im(m){return{disconnect:Qt([window,window.visualViewport],"resize",m)}}function Gd(m,E,_){return Yd(MutationObserver,m,E,_)}function Yd(m,E,_,$){let Q=new m(_);for(let ae of Y(E))Q.observe(ae,$);return Q}function Vl(m){nu(m)&&am(m,{func:"playVideo",method:"play"}),om(m)&&m.play()}function ps(m){nu(m)&&am(m,{func:"pauseVideo",method:"pause"}),om(m)&&m.pause()}function E1(m){nu(m)&&am(m,{func:"mute",method:"setVolume",value:0}),om(m)&&(m.muted=!0)}function S1(m){return om(m)||nu(m)}function om(m){return jr(m,"video")}function nu(m){return jr(m,"iframe")&&(Wn(m)||A1(m))}function Wn(m){return!!m.src.match(/\/\/.*?youtube(-nocookie)?\.[a-z]+\/(watch\?v=[^&\s]+|embed)|youtu\.be\/.*/)}function A1(m){return!!m.src.match(/vimeo\.com\/video\/.*/)}async function am(m,E){await dN(m),Gl(m,E)}function Gl(m,E){m.contentWindow.postMessage(JSON.stringify({event:"command",...E}),"*")}let Zd="_ukPlayer",C1=0;function dN(m){if(m[Zd])return m[Zd];let E=Wn(m),_=A1(m),$=++C1,Q;return m[Zd]=new Promise(ae=>{E&&Tr(m,"load",()=>{let me=()=>Gl(m,{event:"listening",id:$});Q=setInterval(me,100),me()}),Tr(window,"message",ae,!1,({data:me})=>{try{return me=JSON.parse(me),E&&me?.id===$&&me.event==="onReady"||_&&Number(me?.player_id)===$}catch{}}),m.src=`${m.src}${f(m.src,"?")?"&":"?"}${E?"enablejsapi=1":`api=1&player_id=${$}`}`}).then(()=>clearInterval(Q))}function Xd(m,E=0,_=0){return tt(m)?Se(...iu(m).map($=>{let{top:Q,left:ae,bottom:me,right:Ee}=So($);return{top:Q-E,left:ae-_,bottom:me+E,right:Ee+_}}).concat(xr(m))):!1}function Kd(m,{offset:E=0}={}){let _=tt(m)?Yu(m,!1,["hidden"]):[];return _.reduce((me,Ee,_e)=>{let{scrollTop:Ke,scrollHeight:je,offsetHeight:gt}=Ee,Pt=So(Ee),Wt=je-Pt.height,{height:ar,top:Fr}=_[_e-1]?So(_[_e-1]):xr(m),Pr=Math.ceil(Fr-Pt.top-E+Ke);return E>0&>Wt?(E-=Pr-Wt,Pr=Wt):Pr<0&&(E-=Pr,Pr=0),()=>$(Ee,Pr-Ke,m,Wt).then(me)},()=>Promise.resolve())();function $(me,Ee,_e,Ke){return new Promise(je=>{let gt=me.scrollTop,Pt=Q(Math.abs(Ee)),Wt=Date.now(),ar=gc(me)===me,Fr=xr(_e).top+(ar?0:gt),Pr=0,xu=15;(function qv(){let Px=ae(Oe((Date.now()-Wt)/Pt)),bs=0;if(_[0]===me&>+EeFe(me,"position")==="fixed");return~ae&&(Q=Q.slice(ae)),[$].concat(Q.filter(me=>Fe(me,"overflow").split(" ").some(Ee=>f(["auto","scroll",..._],Ee))&&(!E||me.scrollHeight>So(me).height))).reverse()}function ms(...m){return Yu(...m)[0]}function iu(m){return Yu(m,!1,["hidden","clip"])}function So(m){let E=le(m),_=m===gc(m)?E:m;if(O(_)&&E.visualViewport){let{height:Q,width:ae,scale:me,pageTop:Ee,pageLeft:_e}=E.visualViewport;return Q=Math.round(Q*me),ae=Math.round(ae*me),{height:Q,width:ae,top:Ee,left:_e,bottom:Ee+Q,right:_e+ae}}let $=xr(_);if(Fe(_,"display")==="inline")return $;for(let[Q,ae,me,Ee]of[["width","x","left","right"],["height","y","top","bottom"]]){O(_)?_=_.document:$[me]+=ie(Fe(_,`border-${me}-width`));let _e=$[Q]%1;$[Q]=$[ae]=_[`client${l(Q)}`]-(_e?_e<.5?-_e:1-_e:0),$[Ee]=$[Q]+$[me]}return $}function Zu(m){let{left:E,width:_,top:$}=Xt(m);for(let Q of $?[0,$]:[0])for(let ae of le(m).document.elementsFromPoint(E+_/2,Q))if(!ae.contains(m)&&!ke(ae,"uk-togglable-leave")&&(Yl(ae,"fixed")&&Ta(ro(m).reverse().find(me=>!me.contains(ae)&&!Yl(me,"static")))=Pt[je])continue;Wt=T1(m,E,_,_e)[je]-$[je];let Fr=M1(m,E[_e],ae,_e);if(!Ao(Jd($,Wt,_e),Fr,_e)){if(Ao($,Fr,_e))continue;if(_.recursion)return!1;let Pr=O1(m,E,_);if(Pr&&Ao(Pr,Fr,1-_e))return Pr;continue}}else if(me[_e]==="shift"){let ar=xr(E[_e]),{offset:Fr}=_;Wt=Oe(Oe($[je],Pt[je],Pt[gt]-$[Ke]),ar[je]-$[Ke]+Fr[_e],ar[gt]-Fr[_e])-$[je]}Ee=Jd(Ee,Wt,_e)}return Ee}function um(m,E,_){let{attach:$,offset:Q}={attach:{element:["left","top"],target:["left","top"],..._.attach},offset:[0,0],..._},ae=xr(m);for(let[me,[Ee,,_e,Ke]]of Object.entries(ao)){let je=$.target[me]===$.element[me]?So(E[me]):xr(E[me]);ae=Jd(ae,je[_e]-ae[_e]+Qd($.target[me],Ke,je[Ee])-Qd($.element[me],Ke,ae[Ee])+ +Q[me],me)}return ae}function Jd(m,E,_){let[,$,Q,ae]=ao[_],me={...m};return me[Q]=m[$]=m[Q]+E,me[ae]+=E,me}function Qd(m,E,_){return m==="center"?_/2:m===E?_:0}function vN(m,E,_,$,Q){let ae=Xu(...lm(m,E).map(So));return _&&(ae[ao[Q][2]]+=_,ae[ao[Q][3]]-=_),$&&(ae=Xu(ae,xr(h($)?$[Q]:$))),ae}function M1(m,E,_,$){let[Q,ae,me,Ee]=ao[$],[_e]=lm(m,E),Ke=So(_e);return["auto","scroll"].includes(Fe(_e,`overflow-${ae}`))&&(Ke[me]-=_e[`scroll${l(me)}`],Ke[Ee]=Ke[me]+_e[`scroll${l(Q)}`]),Ke[me]+=_,Ke[Ee]-=_,Ke}function lm(m,E){return iu(E).filter(_=>_.contains(m))}function Xu(...m){let E={};for(let _ of m)for(let[,,$,Q]of ao)E[$]=Math.max(E[$]||0,_[$]),E[Q]=Math.min(...[E[Q],_[Q]].filter(Boolean));return E}function Ao(m,E,_){let[,,$,Q]=ao[_];return m[$]>=E[$]&&m[Q]<=E[Q]}function T1(m,E,{offset:_,attach:$},Q){return um(m,E,{attach:{element:I1($.element,Q),target:I1($.target,Q)},offset:gN(_,Q)})}function O1(m,E,_){return ou(m,E,{..._,attach:{element:_.attach.element.map(F1).reverse(),target:_.attach.target.map(F1).reverse()},offset:_.offset.reverse(),placement:_.placement.reverse(),recursion:!0})}function I1(m,E){let _=[...m],$=ao[E].indexOf(m[E]);return~$&&(_[E]=ao[E][1-$%2+2]),_}function F1(m){for(let E=0;Edocument,handler(){document.hidden?this.stop():this.start()}},methods:{start(){this.stop(),this.update(),this.timer||(Rt(this.$el,"countdownstart"),this.timer=setInterval(this.update,1e3))},stop(){this.timer&&(clearInterval(this.timer),Rt(this.$el,"countdownstop"),this.timer=null)},update(){let m=B1(this.date);m.total||(this.stop(),this.end||(Rt(this.$el,"countdownend"),this.end=!0));for(let E of xc){let _=gr(this.clsWrapper.replace("%unit%",E),this.$el);if(!_)continue;let $=Math.trunc(m[E]).toString().padStart(2,"0");_.textContent!==$&&($=$.split(""),$.length!==_.children.length&&js(_,$.map(()=>"").join("")),$.forEach((Q,ae)=>_.children[ae].textContent=Q))}}}};function B1(m){let E=Math.max(0,m-Date.now())/1e3;return{total:E,seconds:E%60,minutes:E/60%60,hours:E/60/60%24,days:E/60/60/24}}let kn={};kn.events=kn.watch=kn.observe=kn.created=kn.beforeConnect=kn.connected=kn.beforeDisconnect=kn.disconnected=kn.destroy=fm,kn.args=function(m,E){return E!==!1&&fm(E||m)},kn.update=function(m,E){return ce(fm(m,w(E)?{read:E}:E),"order")},kn.props=function(m,E){if(h(E)){let _={};for(let $ of E)_[$]=String;E=_}return kn.methods(m,E)},kn.computed=kn.methods=function(m,E){return E?m?{...m,...E}:E:m},kn.i18n=kn.data=function(m,E,_){return _?yc(m,E,_):E?m?function($){return yc(m,E,$)}:E:m};function yc(m,E,_){return kn.computed(w(m)?m.call(_,_):m,w(E)?E.call(_,_):E)}function fm(m,E){return m=m&&!h(m)?[m]:m,E?m?m.concat(E):h(E)?E:[E]:m}function cm(m,E){return V(E)?m:E}function Hi(m,E,_){let $={};if(w(E)&&(E=E.options),E.extends&&(m=Hi(m,E.extends,_)),E.mixins)for(let ae of E.mixins)m=Hi(m,ae,_);for(let ae in m)Q(ae);for(let ae in E)r(m,ae)||Q(ae);function Q(ae){$[ae]=(kn[ae]||cm)(m[ae],E[ae],_)}return $}function Ku(m,E=[]){try{return m?a(m,"{")?JSON.parse(m):E.length&&!f(m,":")?{[E[0]]:m}:m.split(";").reduce((_,$)=>{let[Q,ae]=$.split(/:(.*)/);return Q&&!V(ae)&&(_[Q.trim()]=ae.trim()),_},{}):{}}catch{return{}}}function wc(m,E){return m===Boolean?W(E):m===Number?ee(E):m==="list"?L1(E):m===Object&&R(E)?Ku(E):m?m(E):E}let jd=/,(?![^(]*\))/;function L1(m){return h(m)?m:R(m)?m.split(jd).map(E=>z(E)?ee(E):W(E.trim())):[m]}function P1(m){m._data={},m._updates=[...m.$options.update||[]]}function ev(m,E){m._updates.unshift(E)}function xN(m){delete m._data}function bc(m,E="update"){m._connected&&m._updates.length&&(m._queued||(m._queued=new Set,zi.read(()=>{m._connected&&yN(m,m._queued),delete m._queued})),m._queued.add(E.type||E))}function yN(m,E){for(let{read:_,write:$,events:Q=[]}of m._updates){if(!E.has("update")&&!Q.some(me=>E.has(me)))continue;let ae;_&&(ae=_.call(m,m._data,E),ae&&b(ae)&&N(m._data,ae)),$&&ae!==!1&&zi.write(()=>{m._connected&&$.call(m,m._data,E)})}}function ii(m){return ia(vc,m,"resize")}function na(m){return ia(N1,m)}function hs(m){return ia(Gd,m)}function Zl(m={}){return na({handler:function(E,_){let{targets:$=this.$el,preload:Q=5}=m;for(let ae of Y(w($)?$(this):$))un('[loading="lazy"]',ae).slice(0,Q-1).forEach(me=>Lt(me,"loading"));for(let ae of E.filter(({isIntersecting:me})=>me).map(({target:me})=>me))_.unobserve(ae)},...m})}function Dc(m){return ia((E,_)=>im(_),m,"resize")}function Xl(m){return ia((E,_)=>({disconnect:Qt($i(E),"scroll",_,{passive:!0})}),m,"scroll")}function pm(m){return{observe(E,_){return{observe:He,unobserve:He,disconnect:Qt(E,we,_,{passive:!0})}},handler(E){if(!at(E))return;let _=ht(E),$="tagName"in E.target?E.target:Vt(E.target);Tr(document,`${Qe} ${pt} scroll`,Q=>{let{x:ae,y:me}=ht(Q);(Q.type!=="scroll"&&$&&ae&&Math.abs(_.x-ae)>100||me&&Math.abs(_.y-me)>100)&&setTimeout(()=>{Rt($,"swipe"),Rt($,`swipe${Ju(_.x,_.y,ae,me)}`)})})},...m}}function ia(m,E,_){return{observe:m,handler(){bc(this,_)},...E}}function Ju(m,E,_,$){return Math.abs(m-_)>=Math.abs(E-$)?m-_>0?"Left":"Right":E-$>0?"Up":"Down"}function $i(m){return Y(m).map(E=>{let{ownerDocument:_}=E,$=ms(E,!0);return $===_.scrollingElement?_:$})}var ds={props:{margin:String,firstColumn:Boolean},data:{margin:"uk-margin-small-top",firstColumn:"uk-first-column"},observe:[hs({options:{childList:!0}}),hs({options:{attributes:!0,attributeFilter:["style"]},target:({$el:m})=>[m,...Er(m)]}),ii({target:({$el:m})=>[m,...Er(m)]})],update:{read(){return{rows:Oa(Er(this.$el))}},write({rows:m}){for(let E of m)for(let _ of E)Je(_,this.margin,m[0]!==E),Je(_,this.firstColumn,E[j?E.length-1:0]===_)},events:["resize"]}};function Oa(m){let E=[[]],_=m.some(($,Q)=>Q&&m[Q-1].offsetParent!==$.offsetParent);for(let $ of m){if(!tt($))continue;let Q=Kl($,_);for(let ae=E.length-1;ae>=0;ae--){let me=E[ae];if(!me[0]){me.push($);break}let Ee=Kl(me[0],_);if(Q.top>=Ee.bottom-1&&Q.top!==Ee.top){E.push([$]);break}if(Q.bottom-1>Ee.top||Q.top===Ee.top){let _e=me.length-1;for(;_e>=0;_e--){let Ke=Kl(me[_e],_);if(Q.left>=Ke.left)break}me.splice(_e+1,0,$);break}if(ae===0){E.unshift([$]);break}}}return E}function Kl(m,E=!1){let{offsetTop:_,offsetLeft:$,offsetHeight:Q,offsetWidth:ae}=m;return E&&([_,$]=eu(m)),{top:_,left:$,bottom:_+Q,right:$+ae}}async function wN(m,E,_){await Jl();let $=Er(E),Q=$.map(Wt=>tv(Wt,!0)),ae={...Fe(E,["height","padding"]),display:"block"},me=$.concat(E);await Promise.all(me.map(Mt.cancel)),Fe(me,"transitionProperty","none"),await m(),$=$.concat(Er(E).filter(Wt=>!f($,Wt))),await Promise.resolve(),Fe(me,"transitionProperty","");let Ee=et(E,"style"),_e=Fe(E,["height","padding"]),[Ke,je]=Nc(E,$,Q),gt=$.map(Wt=>({style:et(Wt,"style")}));$.forEach((Wt,ar)=>je[ar]&&Fe(Wt,je[ar])),Fe(E,ae),Rt(E,"scroll"),await Jl();let Pt=$.map((Wt,ar)=>Vt(Wt)===E&&Mt.start(Wt,Ke[ar],_,"ease")).concat(Mt.start(E,_e,_,"ease"));try{await Promise.all(Pt),$.forEach((Wt,ar)=>{et(Wt,gt[ar]),Vt(Wt)===E&&Fe(Wt,"display",Ke[ar].opacity===0?"none":"")}),et(E,"style",Ee)}catch{et($,"style",""),R1(E,ae)}}function tv(m,E){let _=Fe(m,"zIndex");return tt(m)?{display:"",opacity:E?Fe(m,"opacity"):"0",pointerEvents:"none",position:"absolute",zIndex:_==="auto"?Fn(m):_,...mm(m)}:!1}function Nc(m,E,_){let $=E.map((ae,me)=>Vt(ae)&&me in _?_[me]?tt(ae)?mm(ae):{opacity:0}:{opacity:tt(ae)?1:0}:!1),Q=$.map((ae,me)=>{let Ee=Vt(E[me])===m&&(_[me]||tv(E[me]));if(!Ee)return!1;if(!ae)delete Ee.opacity;else if(!("opacity"in ae)){let{opacity:_e}=Ee;_e%1?ae.opacity=1:delete Ee.opacity}return Ee});return[$,Q]}function R1(m,E){for(let _ in E)Fe(m,_,"")}function mm(m){let{height:E,width:_}=xr(m);return{height:E,width:_,transform:"",...zd(m),...Fe(m,["marginTop","marginLeft"])}}function Jl(){return new Promise(m=>requestAnimationFrame(m))}let rv="uk-transition-leave",Ec="uk-transition-enter";function nv(m,E,_,$=0){let Q=Ql(E,!0),ae={opacity:1},me={opacity:0},Ee=je=>()=>Q===Ql(E)?je():Promise.reject(),_e=Ee(async()=>{Ue(E,rv),await Promise.all(Qu(E).map((je,gt)=>new Promise(Pt=>setTimeout(()=>Mt.start(je,me,_/2,"ease").then(Pt),gt*$)))),ve(E,rv)}),Ke=Ee(async()=>{let je=qi(E);Ue(E,Ec),m(),Fe(Er(E),{opacity:0}),await Jl();let gt=Er(E),Pt=qi(E);Fe(E,"alignContent","flex-start"),qi(E,je);let Wt=Qu(E);Fe(gt,me);let ar=Wt.map(async(Fr,Pr)=>{await dm(Pr*$),await Mt.start(Fr,ae,_/2,"ease")});je!==Pt&&ar.push(Mt.start(E,{height:Pt},_/2+Wt.length*$,"ease")),await Promise.all(ar).then(()=>{ve(E,Ec),Q===Ql(E)&&(Fe(E,{height:"",alignContent:""}),Fe(gt,{opacity:""}),delete E.dataset.transition)})});return ke(E,rv)?hm(E).then(Ke):ke(E,Ec)?hm(E).then(_e).then(Ke):_e().then(Ke)}function Ql(m,E){return E&&(m.dataset.transition=1+Ql(m)),ee(m.dataset.transition)||0}function hm(m){return Promise.all(Er(m).filter(Mt.inProgress).map(E=>new Promise(_=>Tr(E,"transitionend transitioncanceled",_))))}function Qu(m){return Oa(Er(m)).flat().filter(tt)}function dm(m){return new Promise(E=>setTimeout(E,m))}var iv={props:{duration:Number,animation:Boolean},data:{duration:150,animation:"slide"},methods:{animate(m,E=this.$el){let _=this.animation;return(_==="fade"?nv:_==="delayed-fade"?(...Q)=>nv(...Q,40):_?wN:()=>(m(),Promise.resolve()))(m,E,this.duration).catch(He)}}};let Or={TAB:9,ESC:27,SPACE:32,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40};var bN={mixins:[iv],args:"target",props:{target:String,selActive:Boolean},data:{target:"",selActive:!1,attrItem:"uk-filter-control",cls:"uk-active",duration:250},computed:{children:({target:m},E)=>un(`${m} > *`,E),toggles:({attrItem:m},E)=>un(`[${m}],[data-${m}]`,E)},watch:{toggles(m){this.updateState();let E=un(this.selActive,this.$el);for(let _ of m){this.selActive!==!1&&Je(_,this.cls,f(E,_));let $=NN(_);jr($,"a")&&et($,"role","button")}},children(m,E){E&&this.updateState()}},events:{name:"click keydown",delegate:({attrItem:m})=>`[${m}],[data-${m}]`,handler(m){m.type==="keydown"&&m.keyCode!==Or.SPACE||m.target.closest("a,button")&&(m.preventDefault(),this.apply(m.current))}},methods:{apply(m){let E=this.getState(),_=vm(m,this.attrItem,this.getState());DN(E,_)||this.setState(_)},getState(){return this.toggles.filter(m=>ke(m,this.cls)).reduce((m,E)=>vm(E,this.attrItem,m),{filter:{"":""},sort:[]})},async setState(m,E=!0){m={filter:{"":""},sort:[],...m},Rt(this.$el,"beforeFilter",[this,m]);for(let _ of this.toggles)Je(_,this.cls,jl(_,this.attrItem,m));await Promise.all(un(this.target,this.$el).map(_=>{let $=()=>ov(m,_,Er(_));return E?this.animate($,_):$()})),Rt(this.$el,"afterFilter",[this])},updateState(){zi.write(()=>this.setState(this.getState(),!1))}}};function q1(m,E){return Ku(fe(m,E),["filter"])}function DN(m,E){return["filter","sort"].every(_=>re(m[_],E[_]))}function ov(m,E,_){let $=Object.values(m.filter).join("");for(let me of _)Fe(me,"display",$&&!tr(me,$)?"none":"");let[Q,ae]=m.sort;if(Q){let me=Sc(_,Q,ae);re(me,_)||vn(E,me)}}function vm(m,E,_){let{filter:$,group:Q,sort:ae,order:me="asc"}=q1(m,E);return($||V(ae))&&(Q?$?(delete _.filter[""],_.filter[Q]=$):(delete _.filter[Q],(H(_.filter)||""in _.filter)&&(_.filter={"":$||""})):_.filter={"":$||""}),V(ae)||(_.sort=[ae,me]),_}function jl(m,E,{filter:_={"":""},sort:[$,Q]}){let{filter:ae="",group:me="",sort:Ee,order:_e="asc"}=q1(m,E);return V(Ee)?me in _&&ae===_[me]||!ae&&me&&!(me in _)&&!_[""]:$===Ee&&Q===_e}function Sc(m,E,_){return[...m].sort(($,Q)=>fe($,E).localeCompare(fe(Q,E),void 0,{numeric:!0})*(_==="asc"||-1))}function NN(m){return gr("a,button",m)||m}let ef;function av(m){let E=Qt(m,"touchstart",$=>{if($.targetTouches.length!==1||tr($.target,'input[type="range"'))return;let Q=ht($).y,ae=Qt(m,"touchmove",me=>{let Ee=ht(me).y;Ee!==Q&&(Q=Ee,Yu(me.target).some(_e=>{if(!m.contains(_e))return!1;let{scrollHeight:Ke,clientHeight:je}=_e;return je{ef=!1,E(),Fe(_,{overflowY:"",touchAction:"",paddingRight:""})}}var vs={props:{container:Boolean},data:{container:!0},computed:{container({container:m}){return m===!0&&this.$container||m&&gr(m)}}},au={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(E=>a(m[0],E))},methods:{async toggleElement(m,E,_){try{return await Promise.all(Y(m).map($=>{let Q=P(E)?E:!this.isToggled($);if(!Rt($,`before${Q?"show":"hide"}`,[this]))return Promise.reject();let ae=(w(_)?_:_===!1||!this.hasAnimation?ju:this.hasTransition?Ac:el)($,Q,this),me=Q?this.clsEnter:this.clsLeave;Ue($,me),Rt($,Q?"show":"hide",[this]);let Ee=()=>{ve($,me),Rt($,Q?"shown":"hidden",[this])};return ae?ae.then(Ee,()=>(ve($,me),Promise.reject())):Ee()})),!0}catch{return!1}},isToggled(m=this.$el){return m=X(m),ke(m,this.clsEnter)?!0:ke(m,this.clsLeave)?!1:this.cls?ke(m,this.cls.split(" ")[0]):tt(m)},_toggle(m,E){if(!m)return;E=!!E;let _;this.cls?(_=f(this.cls," ")||E!==ke(m,this.cls),_&&Je(m,this.cls,f(this.cls," ")?void 0:E)):(_=E===m.hidden,_&&(m.hidden=!E)),un("[autofocus]",m).some($=>tt($)?$.focus()||!0:$.blur()),_&&Rt(m,"toggled",[E,this])}}};function ju(m,E,{_toggle:_}){return cs.cancel(m),Mt.cancel(m),_(m,E)}async function Ac(m,E,{animation:_,duration:$,velocity:Q,transition:ae,_toggle:me}){var Ee;let[_e="reveal",Ke="top"]=((Ee=_[0])==null?void 0:Ee.split("-"))||[],je=[["left","right"],["top","bottom"]],gt=je[f(je[0],Ke)?0:1],Pt=gt[1]===Ke,ar=["width","height"][je.indexOf(gt)],Fr=`margin-${gt[0]}`,Pr=`margin-${Ke}`,xu=Xt(m)[ar],qv=Mt.inProgress(m);await Mt.cancel(m),E&&me(m,!0);let Px=Object.fromEntries(["padding","border","width","height","minWidth","minHeight","overflowY","overflowX",Fr,Pr].map(gO=>[gO,m.style[gO]])),bs=Xt(m),Rm=ie(Fe(m,Fr)),hO=ie(Fe(m,Pr)),Kc=bs[ar]+hO;!qv&&!E&&(xu+=hO);let[Rx]=tm(m,"
    ");Fe(Rx,{boxSizing:"border-box",height:bs.height,width:bs.width,...Fe(m,["overflow","padding","borderTop","borderRight","borderBottom","borderLeft","borderImage",Pr])}),Fe(m,{padding:0,border:0,minWidth:0,minHeight:0,[Pr]:0,width:bs.width,height:bs.height,overflow:"hidden",[ar]:xu});let dO=xu/Kc;$=(Q*Kc+$)*(E?1-dO:dO);let vO={[ar]:E?Kc:0};Pt&&(Fe(m,Fr,Kc-xu+Rm),vO[Fr]=E?Rm:Kc+Rm),!Pt^_e==="reveal"&&(Fe(Rx,Fr,-Kc+xu),Mt.start(Rx,{[Fr]:E?0:-Kc},$,ae));try{await Mt.start(m,vO,$,ae)}finally{Fe(m,Px),No(Rx.firstChild),E||me(m,!1)}}function el(m,E,_){let{animation:$,duration:Q,_toggle:ae}=_;return E?(ae(m,!0),cs.in(m,$[0],Q,_.origin)):cs.out(m,$[1]||$[0],Q,_.origin).then(()=>ae(m,!1))}let oi=[];var su={mixins:[Ui,vs,au],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},E)=>gr(m,E),transitionElement(){return this.panel},bgClose({bgClose:m}){return m&&this.panel}},connected(){et(this.panel||this.$el,"role",this.role),this.overlay&&et(this.panel||this.$el,"aria-modal",!0)},beforeDisconnect(){f(oi,this)&&this.toggleElement(this.$el,!1,!1)},events:[{name:"click",delegate:({selClose:m})=>`${m},a[href*="#"]`,handler(m){let{current:E,defaultPrevented:_}=m,{hash:$}=E;!_&&$&&Aa(E)&&!this.$el.contains(gr($))?this.hide():tr(E,this.selClose)&&(m.preventDefault(),this.hide())}},{name:"toggle",self:!0,handler(m){m.defaultPrevented||(m.preventDefault(),this.isToggled()===f(oi,this)&&this.toggle())}},{name:"beforeshow",self:!0,handler(m){if(f(oi,this))return!1;!this.stack&&oi.length?(Promise.all(oi.map(E=>E.hide())).then(this.show),m.preventDefault()):oi.push(this)}},{name:"show",self:!0,handler(){this.stack&&Fe(this.$el,"zIndex",ie(Fe(this.$el,"zIndex"))+oi.length);let m=[this.overlay&&U1(this),this.overlay&&av(this.$el),this.bgClose&&EN(this),this.escClose&&tl(this)];Tr(this.$el,"hidden",()=>m.forEach(E=>E&&E()),{self:!0}),Ue(document.documentElement,this.clsPage)}},{name:"shown",self:!0,handler(){Gr(this.$el)||et(this.$el,"tabindex","-1"),tr(this.$el,":focus-within")||this.$el.focus()}},{name:"hidden",self:!0,handler(){f(oi,this)&&oi.splice(oi.indexOf(this),1),Fe(this.$el,"zIndex",""),oi.some(m=>m.clsPage===this.clsPage)||ve(document.documentElement,this.clsPage)}}],methods:{toggle(){return this.isToggled()?this.hide():this.show()},show(){return this.container&&Vt(this.$el)!==this.container?(vn(this.container,this.$el),new Promise(m=>requestAnimationFrame(()=>this.show().then(m)))):this.toggleElement(this.$el,!0,sv)},hide(){return this.toggleElement(this.$el,!1,sv)}}};function sv(m,E,{transitionElement:_,_toggle:$}){return new Promise((Q,ae)=>Tr(m,"show hide",()=>{var me;(me=m._reject)==null||me.call(m),m._reject=ae,$(m,E);let Ee=Tr(_,"transitionstart",()=>{Tr(_,"transitionend transitioncancel",Q,{self:!0}),clearTimeout(_e)},{self:!0}),_e=setTimeout(()=>{Ee(),Q()},z1(Fe(_,"transitionDuration")))})).then(()=>delete m._reject)}function z1(m){return m?s(m,"ms")?ie(m):ie(m)*1e3:0}function U1(m){return Qt(document,"focusin",E=>{De(oi)===m&&!m.$el.contains(E.target)&&m.$el.focus()})}function EN(m){return Qt(document,we,({target:E})=>{De(oi)!==m||m.overlay&&!m.$el.contains(E)||m.panel.contains(E)||Tr(document,`${Qe} ${pt} scroll`,({defaultPrevented:_,type:$,target:Q})=>{!_&&$===Qe&&E===Q&&m.hide()},!0)})}function tl(m){return Qt(document,"keydown",E=>{E.keyCode===27&&De(oi)===m&&m.hide()})}var gs={slide:{show(m){return[{transform:En(m*-100)},{transform:En()}]},percent(m){return Cc(m)},translate(m,E){return[{transform:En(E*-100*m)},{transform:En(E*100*(1-m))}]}}};function Cc(m){return Math.abs(Fe(m,"transform").split(",")[4]/m.offsetWidth)}function En(m=0,E="%"){return m+=m?E:"",`translate3d(${m}, 0, 0)`}function tf(m){return`scale3d(${m}, ${m}, 1)`}function SN(m,E,_,{animation:$,easing:Q}){let{percent:ae,translate:me,show:Ee=He}=$,_e=Ee(_),Ke;return{dir:_,show(je,gt=0,Pt){let Wt=Pt?"linear":Q;return je-=Math.round(je*Oe(gt,-1,1)),this.translate(gt),gm(E,"itemin",{percent:gt,duration:je,timing:Wt,dir:_}),gm(m,"itemout",{percent:1-gt,duration:je,timing:Wt,dir:_}),new Promise(ar=>{Ke||(Ke=ar),Promise.all([Mt.start(E,_e[1],je,Wt),Mt.start(m,_e[0],je,Wt)]).then(()=>{this.reset(),Ke()},He)})},cancel(){return Mt.cancel([E,m])},reset(){for(let je in _e[0])Fe([E,m],je,"")},async forward(je,gt=this.percent()){return await this.cancel(),this.show(je,gt,!0)},translate(je){if(je===this.percent())return;this.reset();let gt=me(je,_);Fe(E,gt[1]),Fe(m,gt[0]),gm(E,"itemtranslatein",{percent:je,dir:_}),gm(m,"itemtranslateout",{percent:1-je,dir:_})},percent(){return ae(m||E,E,_)},getDistance(){return m?.offsetWidth}}}function gm(m,E,_){Rt(m,oo(E,!1,!1,_))}var xm={props:{i18n:Object},data:{i18n:null},methods:{t(m,...E){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,()=>E[ae++]||""))||""}}},so={props:{autoplay:Boolean,autoplayInterval:Number,pauseOnHover:Boolean},data:{autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0},connected(){et(this.list,"aria-live",this.autoplay?"off":"polite"),this.autoplay&&this.startAutoplay()},disconnected(){this.stopAutoplay()},update(){et(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&&tr(this.$el,":focus-within")&&!tr(this.$el,":focus")||this.pauseOnHover&&tr(this.$el,":hover")||this.show("next")},this.autoplayInterval)},stopAutoplay(){clearInterval(this.interval)}}};let gn={passive:!1,capture:!0},hi={passive:!0,capture:!0},ei="touchstart mousedown",rl="touchmove mousemove",H1="touchend touchcancel mouseup click input scroll",Mc=m=>m.preventDefault();var AN={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){for(let m of["start","move","end"]){let E=this[m];this[m]=_=>{let $=ht(_).x*(j?-1:1);this.prevPos=$===this.pos?this.prevPos:this.pos,this.pos=$,E(_)}}},events:[{name:ei,passive:!0,delegate:({selList:m})=>`${m} > *`,handler(m){!this.draggable||this.parallax||!at(m)&&CN(m.target)||m.target.closest(wt)||m.button>0||this.length<2||this.start(m)}},{name:"dragstart",handler(m){m.preventDefault()}},{name:rl,el:({list:m})=>m,handler:He,...gn}],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,Qt(document,rl,this.move,gn),Qt(document,H1,this.end,hi),Fe(this.list,"userSelect","none")},move(m){let E=this.pos-this.drag;if(E===0||this.prevPos===this.pos||!this.dragging&&Math.abs(E)me;)this.drag-=me*this.dir,$=ae,Q-=me,ae=this.getIndex($+this.dir),me=$1.call(this,$,ae);this.percent=Q/me;let Ee=_[$],_e=_[ae],Ke=this.index!==ae,je=$===ae,gt;for(let Pt of[this.index,this.prevIndex])f([ae,$],Pt)||(Rt(_[Pt],"itemhidden",[this]),je&&(gt=!0,this.prevIndex=$));(this.index===$&&this.prevIndex!==$||gt)&&Rt(_[this.index],"itemshown",[this]),Ke&&(this.prevIndex=$,this.index=ae,je||(Rt(Ee,"beforeitemhide",[this]),Rt(Ee,"itemhide",[this])),Rt(_e,"beforeitemshow",[this]),Rt(_e,"itemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),Ee,!je&&_e)},end(){if(Ri(document,rl,this.move,gn),Ri(document,H1,this.end,hi),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(()=>Ri(this.list,"click",Mc,gn)),Fe(this.list,{userSelect:""}),this.drag=this.percent=null}}};function $1(m,E){return this._getTransitioner(m,m!==E&&E).getDistance()||this.slides[m].offsetWidth}function CN(m){return Fe(m,"userSelect")!=="none"&&y(m.childNodes).some(E=>E.nodeType===3&&E.textContent.trim())}function uv(m){m._watches=[];for(let E of m.$options.watch||[])for(let[_,$]of Object.entries(E))lv(m,$,_);m._initial=!0}function lv(m,E,_){m._watches.push({name:_,...b(E)?E:{handler:E}})}function fv(m,E){for(let{name:_,handler:$,immediate:Q=!0}of m._watches)(m._initial&&Q||r(E,_)&&!re(E[_],m[_]))&&$.call(m,m[_],E[_]);m._initial=!1}function MN(m){let{computed:E}=m.$options;if(m._computed={},E)for(let _ in E)wm(m,_,E[_])}let ym={subtree:!0,childList:!0};function wm(m,E,_){m._hasComputed=!0,Object.defineProperty(m,E,{enumerable:!0,get(){let{_computed:$,$props:Q,$el:ae}=m;if(!r($,E)&&($[E]=(_.get||_).call(m,Q,ae),_.observe&&m._computedObserver)){let me=_.observe.call(m,Q);m._computedObserver.observe(["~","+","-"].includes(me[0])?ae.parentElement:ae.getRootNode(),ym)}return $[E]},set($){let{_computed:Q}=m;Q[E]=_.set?_.set.call(m,$):$,V(Q[E])&&delete Q[E]}})}function W1(m){m._hasComputed&&(ev(m,{read:()=>fv(m,bm(m)),events:["resize","computed"]}),m._computedObserver=Gd(m.$el,()=>bc(m,"computed"),ym))}function V1(m){var E;(E=m._computedObserver)==null||E.disconnect(),delete m._computedObserver,bm(m)}function bm(m){let E={...m._computed};return m._computed={},E}function G1(m){m._events=[];for(let E of m.$options.events||[])if(r(E,"handler"))Y1(m,E);else for(let _ in E)Y1(m,E[_],_)}function Tc(m){m._events.forEach(E=>E()),delete m._events}function Y1(m,E,_){let{name:$,el:Q,handler:ae,capture:me,passive:Ee,delegate:_e,filter:Ke,self:je}=b(E)?E:{name:_,handler:E};Q=w(Q)?Q.call(m,m):Q||m.$el,!(!Q||h(Q)&&!Q.length||Ke&&!Ke.call(m,m))&&m._events.push(Qt(Q,$,_e?R(_e)?_e:_e.call(m,m):null,R(ae)?m[ae]:ae.bind(m),{passive:Ee,capture:me,self:je}))}function Dm(m){m._observers=[];for(let E of m.$options.observe||[])TN(m,E)}function Ia(m,...E){m._observers.push(...E)}function Z1(m){for(let E of m._observers)E.disconnect()}function TN(m,E){let{observe:_,target:$=m.$el,handler:Q,options:ae,filter:me,args:Ee}=E;if(me&&!me.call(m,m))return;let _e=`_observe${m._observers.length}`;w($)&&!r(m,_e)&&wm(m,_e,()=>{let gt=$.call(m,m);return h(gt)?Y(gt):gt}),Q=R(Q)?m[Q]:Q.bind(m),w(ae)&&(ae=ae.call(m,m));let Ke=r(m,_e)?m[_e]:$,je=_(Ke,Q,ae,Ee);w($)&&h(m[_e])&&lv(m,{handler:X1(je,ae),immediate:!1},_e),Ia(m,je)}function X1(m,E){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,E)}}function Co(m){let{$options:E,$props:_}=m,$=Ir(E);N(_,$);let{computed:Q,methods:ae}=E;for(let me in _)me in $&&(!Q||!r(Q,me))&&(!ae||!r(ae,me))&&(m[me]=_[me])}function Ir(m){let E={},{args:_=[],props:$={},el:Q,id:ae}=m;if(!$)return E;for(let Ee in $){let _e=i(Ee),Ke=fe(Q,_e);V(Ke)||(Ke=$[Ee]===Boolean&&Ke===""?!0:wc($[Ee],Ke),!(_e==="target"&&a(Ke,"_"))&&(E[Ee]=Ke))}let me=Ku(fe(Q,ae),_);for(let Ee in me){let _e=u(Ee);V($[_e])||(E[_e]=wc($[_e],me[Ee]))}return E}let oa=be((m,E)=>{let _=Object.keys(E),$=_.concat(m).map(Q=>[i(Q),`data-${i(Q)}`]).flat();return{attributes:_,filter:$}});function uu(m){let{$options:E,$props:_}=m,{id:$,props:Q,el:ae}=E;if(!Q)return;let{attributes:me,filter:Ee}=oa($,Q),_e=new MutationObserver(Ke=>{let je=Ir(E);Ke.some(({attributeName:gt})=>{let Pt=gt.replace("data-","");return(Pt===$?me:[u(Pt),u(gt)]).some(Wt=>!V(je[Wt])&&je[Wt]!==_[Wt])})&&m.$reset()});_e.observe(ae,{attributes:!0,attributeFilter:Ee}),Ia(m,_e)}function Mo(m,E){var _;(_=m.$options[E])==null||_.forEach($=>$.call(m))}function Nm(m){m._connected||(Co(m),Mo(m,"beforeConnect"),m._connected=!0,G1(m),P1(m),uv(m),Dm(m),uu(m),W1(m),Mo(m,"connected"),bc(m))}function Oc(m){m._connected&&(Mo(m,"beforeDisconnect"),Tc(m),xN(m),Z1(m),V1(m),Mo(m,"disconnected"),m._connected=!1)}let K1=0;function J1(m,E={}){E.data=Q1(E,m.constructor.options),m.$options=Hi(m.constructor.options,E,m),m.$props={},m._uid=K1++,cv(m),Ic(m),MN(m),Mo(m,"created"),E.el&&m.$mount(E.el)}function cv(m){let{data:E={}}=m.$options;for(let _ in E)m.$props[_]=m[_]=E[_]}function Ic(m){let{methods:E}=m.$options;if(E)for(let _ in E)m[_]=E[_].bind(m)}function Q1({data:m={}},{args:E=[],props:_={}}){h(m)&&(m=m.slice(0,E.length).reduce(($,Q,ae)=>(b(Q)?N($,Q):$[E[ae]]=Q,$),{}));for(let $ in m)V(m[$])?delete m[$]:_[$]&&(m[$]=wc(_[$],m[$]));return m}let Wi=function(m){J1(this,m)};Wi.util=_1,Wi.options={},Wi.version="3.21.1";let lu="uk-",fu="__uikit__",nl={};function j1(m,E){var _,$;let Q=lu+i(m);if(!E)return nl[Q].options||(nl[Q]=Wi.extend(nl[Q])),nl[Q];m=u(m),Wi[m]=(me,Ee)=>cu(m,me,Ee);let ae=(_=E.options)!=null?_:{...E};return ae.id=Q,ae.name=m,($=ae.install)==null||$.call(ae,Wi,ae,m),Wi._initialized&&!ae.functional&&requestAnimationFrame(()=>cu(m,`[${Q}],[data-${Q}]`)),nl[Q]=ae}function cu(m,E,_,...$){let Q=j1(m);return Q.options.functional?new Q({data:b(E)?E:[E,_,...$]}):E?Qn(E).map(ae)[0]:ae();function ae(me){let Ee=Fc(me,m);if(Ee)if(_)Ee.$destroy();else return Ee;return new Q({el:me,data:_})}}function il(m){return m?.[fu]||{}}function Fc(m,E){return il(m)[E]}function ON(m,E){m[fu]||(m[fu]={}),m[fu][E.$options.name]=E}function ex(m,E){var _;(_=m[fu])==null||delete _[E.$options.name],H(m[fu])&&delete m[fu]}function IN(m){m.component=j1,m.getComponents=il,m.getComponent=Fc,m.update=tx,m.use=function(_){if(!_.installed)return _.call(null,this),_.installed=!0,this},m.mixin=function(_,$){$=(R($)?this.component($):$)||this,$.options=Hi($.options,_)},m.extend=function(_){_||(_={});let $=this,Q=function(me){J1(this,me)};return Q.prototype=Object.create($.prototype),Q.prototype.constructor=Q,Q.options=Hi($.options,_),Q.super=$,Q.extend=$.extend,Q};let E;Object.defineProperty(m,"container",{get(){return E||document.body},set(_){E=gr(_)}})}function tx(m,E){m=m?X(m):document.body;for(let _ of ro(m).reverse())_c(_,E);Eo(m,_=>_c(_,E))}function _c(m,E){let _=il(m);for(let $ in _)bc(_[$],E)}function rx(m){m.prototype.$mount=function(E){let _=this;ON(E,_),_.$options.el=E,document.contains(E)&&Nm(_)},m.prototype.$destroy=function(E=!1){let _=this,{el:$}=_.$options;$&&Oc(_),Mo(_,"destroy"),ex($,_),E&&Do(_.$el)},m.prototype.$create=cu,m.prototype.$emit=function(E){bc(this,E)},m.prototype.$update=function(E=this.$el,_){tx(E,_)},m.prototype.$reset=function(){Oc(this),Nm(this)},m.prototype.$getComponent=Fc,Object.defineProperties(m.prototype,{$el:{get(){return this.$options.el}},$container:Object.getOwnPropertyDescriptor(m,"container")})}let FN=1;function ol(m,E=null){return E?.id||`${m.$options.id}-${FN++}`}var nx={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},E)=>gr(m,E),navChildren(){return Er(this.nav)},selNavItem:({attrItem:m})=>`[${m}],[data-${m}]`,navItems(m,E){return un(this.selNavItem,E)}},watch:{nav(m,E){et(m,"role","tablist"),E&&this.$emit()},list(m){jr(m,"ul")&&et(m,"role","presentation")},navChildren(m){et(m,"role","presentation")},navItems(m){for(let E of m){let _=fe(E,this.attrItem),$=gr("a,button",E)||E,Q,ae=null;if(z(_)){let me=ee(_),Ee=this.slides[me];Ee&&(Ee.id||(Ee.id=ol(this,Ee)),ae=Ee.id),Q=this.t("slideX",ie(_)+1),et($,"role","tab")}else this.list&&(this.list.id||(this.list.id=ol(this,this.list)),ae=this.list.id),Q=this.t(_);et($,{"aria-controls":ae,"aria-label":et($,"aria-label")||Q})}},slides(m){m.forEach((E,_)=>et(E,{role:this.nav?"tabpanel":"group","aria-label":this.t("slideLabel",_+1,this.length),"aria-roledescription":this.nav?null:"slide"}))},length(m){let E=this.navChildren.length;if(this.nav&&m!==E){uc(this.nav);for(let _=0;_
  • `)}}},connected(){et(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===Or.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:E,keyCode:_}=m,$=fe(E,this.attrItem);if(!z($))return;let Q=_===Or.HOME?0:_===Or.END?"last":_===Or.LEFT?"previous":_===Or.RIGHT?"next":-1;~Q&&(m.preventDefault(),this.show(Q))}}],methods:{updateNav(){let m=this.getValidIndex();for(let E of this.navItems){let _=fe(E,this.attrItem),$=gr("a,button",E)||E;if(z(_)){let ae=ee(_)===m;Je(E,this.clsActive,ae),Je($,"uk-disabled",this.parallax),et($,{"aria-selected":ae,tabindex:ae&&!this.parallax?null:-1}),ae&&$&&tr(Vt(E),":focus-within")&&$.focus()}else Je(E,"uk-invisible",this.finite&&(_==="previous"&&m===0||_==="next"&&m>=this.maxIndex))}}}},al={mixins:[so,AN,nx,xm],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(){ve(this.slides,this.clsActive)},computed:{duration:({velocity:m},E)=>kc(E.offsetWidth/m),list:({selList:m},E)=>gr(m,E),maxIndex(){return this.length-1},slides(){return Er(this.list)},length(){return this.slides.length}},watch:{slides(m,E){E&&this.$emit()}},events:{itemshow({target:m}){Ue(m,this.clsEnter,this.clsSlideActive)},itemshown({target:m}){ve(m,this.clsEnter)},itemhide({target:m}){Ue(m,this.clsLeave)},itemhidden({target:m}){ve(m,this.clsLeave,this.clsSlideActive)}},methods:{show(m,E=!1){var _;if(this.dragging||!this.length||this.parallax)return;let{stack:$}=this,Q=E?0:$.length,ae=()=>{$.splice(Q,1),$.length&&this.show($.shift(),!0)};if($[E?"unshift":"push"](m),!E&&$.length>1){$.length===2&&((_=this._transitioner)==null||_.forward(Math.min(this.duration,200)));return}let me=this.getIndex(this.index),Ee=ke(this.slides,this.clsActive)&&this.slides[me],_e=this.getIndex(m,this.index),Ke=this.slides[_e];if(Ee===Ke){ae();return}if(this.dir=pv(m,me),this.prevIndex=me,this.index=_e,Ee&&!Rt(Ee,"beforeitemhide",[this])||!Rt(Ke,"beforeitemshow",[this,Ee])){this.index=this.prevIndex,ae();return}let je=this._show(Ee,Ke,E).then(()=>{Ee&&Rt(Ee,"itemhidden",[this]),Rt(Ke,"itemshown",[this]),$.shift(),this._transitioner=null,$.length&&requestAnimationFrame(()=>$.length&&this.show($.shift(),!0))});return Ee&&Rt(Ee,"itemhide",[this]),Rt(Ke,"itemshow",[this]),je},getIndex(m=this.index,E=this.index){return Oe(de(m,this.slides,E,this.finite),0,Math.max(0,this.maxIndex))},getValidIndex(m=this.index,E=this.prevIndex){return this.getIndex(m,E)},async _show(m,E,_){if(this._transitioner=this._getTransitioner(m,E,this.dir,{easing:_?E.offsetWidth<600?"cubic-bezier(0.25, 0.46, 0.45, 0.94)":"cubic-bezier(0.165, 0.84, 0.44, 1)":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,E=this.prevIndex,_=this.index){let $=this._getTransitioner(E===_?!1:E,_);return $.translate(m),$},_getTransitioner(m=this.prevIndex,E=this.index,_=this.dir||1,$=this.transitionOptions){return new this.Transitioner(q(m)?this.slides[m]:m,q(E)?this.slides[E]:E,_*(j?-1:1),$)}}};function pv(m,E){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:Em,template:'
      '}),created(){let m=gr(this.template),E=gr(this.selList,m);this.items.forEach(()=>vn(E,"
    • "));let _=gr("[uk-close]",m),$=this.t("close");_&&$&&(_.dataset.i18n=JSON.stringify({label:$})),this.$mount(vn(this.container,m))},computed:{caption:({selCaption:m},E)=>gr(m,E)},events:[{name:`${Le} ${we} 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(),ve(this.slides,this.clsActive),Mt.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 E=-1;m===Or.LEFT?E="previous":m===Or.RIGHT?E="next":m===Or.HOME?E=0:m===Or.END&&(E="last"),~E&&this.show(E)}},{name:"beforeitemshow",handler(m){this.isToggled()||(this.draggable=!1,m.preventDefault(),this.toggleElement(this.$el,!0,!1),this.animation=Em.scale,ve(m.target,this.clsActive),this.stack.splice(1,0,this.index))}},{name:"itemshow",handler(){js(this.caption,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,E){let{source:_,type:$,alt:Q="",poster:ae,attrs:me={}}=E;if(this.setItem(E,""),!_)return;let Ee,_e={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 Ke=Bc("img",{src:_,alt:Q,...me});Qt(Ke,"load",()=>this.setItem(E,Ke)),Qt(Ke,"error",()=>this.setError(E))}else if($==="video"||_.match(/\.(mp4|webm|ogv)($|\?)/i)){let Ke=Bc("video",{src:_,poster:ae,controls:"",playsinline:"","uk-video":`${this.videoAutoplay}`,...me});Qt(Ke,"loadedmetadata",()=>this.setItem(E,Ke)),Qt(Ke,"error",()=>this.setError(E))}else if($==="iframe"||_.match(/\.(html|php)($|\?)/i))this.setItem(E,Bc("iframe",{src:_,allowfullscreen:"",class:"uk-lightbox-iframe",...me}));else if(Ee=_.match(/\/\/(?:.*?youtube(-nocookie)?\..*?(?:[?&]v=|\/shorts\/)|youtu\.be\/)([\w-]{11})[&?]?(.*)?/))this.setItem(E,Bc("iframe",{src:`https://www.youtube${Ee[1]||""}.com/embed/${Ee[2]}${Ee[3]?`?${Ee[3]}`:""}`,width:1920,height:1080,..._e,...me}));else if(Ee=_.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/))try{let{height:Ke,width:je}=await(await fetch(`https://vimeo.com/api/oembed.json?maxwidth=1920&url=${encodeURI(_)}`,{credentials:"omit"})).json();this.setItem(E,Bc("iframe",{src:`https://player.vimeo.com/video/${Ee[1]}${Ee[2]?`?${Ee[2]}`:""}`,width:je,height:Ke,..._e,...me}))}catch{this.setError(E)}}}],methods:{loadItem(m=this.index){let E=this.getItem(m);this.getSlide(E).childElementCount||Rt(this.$el,"itemload",[E])},getItem(m=this.index){return this.items[de(m,this.slides)]},setItem(m,E){Rt(this.$el,"itemloaded",[this,js(this.getSlide(m),E)])},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(){ve(this.$el,"uk-active","uk-transition-active")}}};function Bc(m,E){let _=Wu(`<${m}>`);return et(_,E),_}var ix={install:di,props:{toggle:String},data:{toggle:"a"},computed:{toggles:({toggle:m},E)=>un(m,E)},watch:{toggles(m){this.hide();for(let E of m)jr(E,"a")&&et(E,"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 E=Pe(this.toggles.map(Lc),"source");if(F(m)){let{source:_}=Lc(m);m=p(E,({source:$})=>_===$)}return this.panel=this.panel||this.$create("lightboxPanel",{...this.$props,items:E}),Qt(this.panel.$el,"hidden",()=>this.panel=null),this.panel.show(m)},hide(){var m;return(m=this.panel)==null?void 0:m.hide()}}};function di(m,E){m.lightboxPanel||m.component("lightboxPanel",hv),N(E.props,m.component("lightboxPanel").options.props)}function Lc(m){let E={};for(let _ of["href","caption","type","poster","alt","attrs"])E[_==="href"?"source":_]=fe(m,_);return E.attrs=Ku(E.attrs),E}var ox={mixins:[vs],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:ax,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}`,E=`data-${this.clsContainer}-container`,_=gr(`.${m}[${E}]`,this.container)||vn(this.container,`
      `);this.$mount(vn(_,``))},async connected(){let m=ie(Fe(this.$el,this.marginProp));await Mt.start(Fe(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()},[it](){this.timer&&clearTimeout(this.timer)},[Xe](){this.timeout&&(this.timer=setTimeout(this.close,this.timeout))}},methods:{async close(m){let E=_=>{let $=Vt(_);Rt(_,"close",[this]),Do(_),$?.hasChildNodes()||Do($)};this.timer&&clearTimeout(this.timer),m||await Mt.start(this.$el,this.startProps),E(this.$el)}}};function ax(m){m.notification.closeAll=function(E,_){Eo(document.body,$=>{let Q=m.getComponent($,"notification");Q&&(!E||E===Q.group)&&Q.close(_)})}}var Pc={props:{media:Boolean},data:{media:!1},connected(){let m=rf(this.media,this.$el);if(this.matchMedia=!0,m){this.mediaObj=window.matchMedia(m);let E=()=>{this.matchMedia=this.mediaObj.matches,Rt(this.$el,oo("mediachange",!1,!0,[this.mediaObj]))};this.offMediaObj=Qt(this.mediaObj,"change",()=>{E(),this.$emit("resize")}),E()}},disconnected(){var m;(m=this.offMediaObj)==null||m.call(this)}};function rf(m,E){if(R(m)){if(a(m,"@"))m=ie(Fe(E,`--uk-breakpoint-${m.slice(1)}`));else if(isNaN(m))return m}return m&&z(m)?`(min-width: ${m}px)`:""}function Rc(m){return tt(m)?Math.ceil(Math.max(0,...un("[stroke]",m).map(E=>E.getTotalLength()))):0}let qc={x:xs,y:xs,rotate:xs,scale:xs,color:Sm,backgroundColor:Sm,borderColor:Sm,blur:pu,hue:pu,fopacity:pu,grayscale:pu,invert:pu,saturate:pu,sepia:pu,opacity:zc,stroke:_N,bgx:sl,bgy:sl},{keys:dv}=Object;var vv={mixins:[Pc],props:lx(dv(qc),"list"),data:lx(dv(qc),void 0),computed:{props(m,E){let _={};for(let Q in m)Q in qc&&!V(m[Q])&&(_[Q]=m[Q].slice());let $={};for(let Q in _)$[Q]=qc[Q](Q,E,_[Q],_);return $}},events:{load(){this.$emit()}},methods:{reset(){for(let m in this.getCss(0))Fe(this.$el,m,"")},getCss(m){let E={};for(let _ in this.props)this.props[_](E,Oe(m));return E.willChange=Object.keys(E).map(Ar).join(","),E}}};function xs(m,E,_){let $=ys(_)||{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 me;return ys([ae])?jn(ae,"width",E,!0)/E[`offset${(me=ae.endsWith)!=null&&me.call(ae,"vh")?"Height":"Width"}`]:ie(ae)}),_.length===1&&_.unshift(m==="scale"?1:0),_=ll(_,Q),(ae,me)=>{ae.transform=`${ae.transform||""} ${m}(${of(_,me)}${$})`}}function Sm(m,E,_){return _.length===1&&_.unshift(ws(E,m,"")),_=ll(_,$=>Am(E,$)),($,Q)=>{let[ae,me,Ee]=ux(_,Q),_e=ae.map((Ke,je)=>(Ke+=Ee*(me[je]-Ke),je===3?ie(Ke):parseInt(Ke,10))).join(",");$[m]=`rgba(${_e})`}}function Am(m,E){return ws(m,"color",E).split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(ie)}function pu(m,E,_){_.length===1&&_.unshift(0);let $=ys(_)||{blur:"px",hue:"deg"}[m]||"%";return m={fopacity:"opacity",hue:"hue-rotate"}[m]||m,_=ll(_),(Q,ae)=>{let me=of(_,ae);Q.filter=`${Q.filter||""} ${m}(${me+$})`}}function zc(m,E,_){return _.length===1&&_.unshift(ws(E,m,"")),_=ll(_),($,Q)=>{$[m]=of(_,Q)}}function _N(m,E,_){_.length===1&&_.unshift(0);let $=ys(_),Q=Rc(E);return _=ll(_.reverse(),ae=>(ae=ie(ae),$==="%"?ae*Q/100:ae)),_.some(([ae])=>ae)?(Fe(E,"strokeDasharray",Q),(ae,me)=>{ae.strokeDashoffset=of(_,me)}):He}function sl(m,E,_,$){_.length===1&&_.unshift(0);let Q=m==="bgy"?"height":"width";$[m]=ll(_,Ee=>jn(Ee,Q,E));let ae=["bgx","bgy"].filter(Ee=>Ee in $);if(ae.length===2&&m==="bgx")return He;if(ws(E,"backgroundSize","")==="cover")return sx(m,E,_,$);let me={};for(let Ee of ae)me[Ee]=gv(E,Ee);return xv(ae,me,$)}function sx(m,E,_,$){let Q=Uc(E);if(!Q.width)return He;let ae={width:E.offsetWidth,height:E.offsetHeight},me=["bgx","bgy"].filter(je=>je in $),Ee={};for(let je of me){let gt=$[je].map(([Pr])=>Pr),Pt=Math.min(...gt),Wt=Math.max(...gt),ar=gt.indexOf(Pt){Ke(je,gt),je.backgroundSize=`${_e.width}px ${_e.height}px`,je.backgroundRepeat="no-repeat"}}function gv(m,E){return ws(m,`background-position-${E.slice(-1)}`,"")}function xv(m,E,_){return function($,Q){for(let ae of m){let me=of(_[ae],Q);$[`background-position-${ae.slice(-1)}`]=`calc(${E[ae]} + ${me}px)`}}}let nf={},mu={};function Uc(m){let E=Fe(m,"backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/,"$1");if(mu[E])return mu[E];let _=new Image;return E&&(_.src=E,!_.naturalWidth&&!nf[E])?(Tr(_,"error load",()=>{mu[E]=ul(_),Rt(m,oo("load",!1))}),nf[E]=!0,ul(_)):mu[E]=ul(_)}function ul(m){return{width:m.naturalWidth,height:m.naturalHeight}}function ll(m,E=ie){let _=[],{length:$}=m,Q=0;for(let ae=0;ae<$;ae++){let[me,Ee]=R(m[ae])?m[ae].trim().split(/ (?![^(]*\))/):[m[ae]];if(me=E(me),Ee=Ee?ie(Ee)/100:null,ae===0?Ee===null?Ee=0:Ee&&_.push([me,0]):ae===$-1&&(Ee===null?Ee=1:Ee!==1&&(_.push([me,Ee]),Ee=1)),_.push([me,Ee]),Ee===null)Q++;else if(Q){let _e=_[ae-Q-1][1],Ke=(Ee-_e)/(Q+1);for(let je=Q;je>0;je--)_[ae-je][1]=_e+Ke*(Q-je+1);Q=0}}return _}function ux(m,E){let _=p(m.slice(1),([,$])=>E<=$)+1;return[m[_-1][0],m[_][0],(E-m[_-1][1])/(m[_][1]-m[_-1][1])]}function of(m,E){let[_,$,Q]=ux(m,E);return _+Math.abs(_-$)*Q*(_<$?1:-1)}let hu=/^-?\d+(?:\.\d+)?(\S+)?/;function ys(m,E){var _;for(let $ of m){let Q=(_=$.match)==null?void 0:_.call($,hu);if(Q)return Q[1]}return E}function ws(m,E,_){let $=m.style[E],Q=Fe(Fe(m,E,_),E);return m.style[E]=$,Q}function lx(m,E){return m.reduce((_,$)=>(_[$]=E,_),{})}function yv(m,E){return E>=0?Math.pow(m,E+1):1-Math.pow(1-m,1-E)}var kN={mixins:[vv],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},E)=>fx(m&&Hn(m,E)||E),start({start:m}){return jn(m,"height",this.target,!0)},end({end:m,viewport:E}){return jn(m||(E=(1-E)*100)&&`${E}vh+${E}%`,"height",this.target,!0)}},observe:[Dc(),Xl({target:({target:m})=>m}),ii({target:({$el:m,target:E})=>[m,E,ms(E,!0)]})],update:{read({percent:m},E){if(E.has("scroll")||(m=!1),!tt(this.$el))return!1;if(!this.matchMedia)return;let _=m;return m=yv(sm(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&&Fe(this.$el,m)},events:["scroll","resize"]}};function fx(m){return m?"offsetTop"in m?m:fx(Vt(m)):document.documentElement}var cx={props:{parallax:Boolean,parallaxTarget:Boolean,parallaxStart:String,parallaxEnd:String,parallaxEasing:Number},data:{parallax:!1,parallaxTarget:!1,parallaxStart:0,parallaxEnd:0,parallaxEasing:0},observe:[ii({target:({$el:m,parallaxTarget:E})=>[m,E],filter:({parallax:m})=>m}),Xl({filter:({parallax:m})=>m})],computed:{parallaxTarget({parallaxTarget:m},E){return m&&Hn(m,E)||this.list}},update:{read(){if(!this.parallax)return!1;let m=this.parallaxTarget;if(!m)return!1;let E=jn(this.parallaxStart,"height",m,!0),_=jn(this.parallaxEnd,"height",m,!0),$=yv(sm(m,E,_),this.parallaxEasing);return{parallax:this.getIndexAt($)}},write({parallax:m}){let[E,_]=m,$=this.getValidIndex(E+Math.ceil(_)),Q=this.slides[E],ae=this.slides[$],{triggerShow:me,triggerShown:Ee,triggerHide:_e,triggerHidden:Ke}=Vi(this);if(~this.prevIndex)for(let gt of new Set([this.index,this.prevIndex]))f([$,E],gt)||(_e(this.slides[gt]),Ke(this.slides[gt]));let je=this.prevIndex!==E||this.index!==$;this.dir=1,this.prevIndex=E,this.index=$,Q!==ae&&_e(Q),me(ae),je&&Ee(Q),this._translate(Q===ae?1:_,Q,ae)},events:["scroll","resize"]},methods:{getIndexAt(m){let E=m*(this.length-1);return[Math.floor(E),E%1]}}};function Vi(m){let{clsSlideActive:E,clsEnter:_,clsLeave:$}=m;return{triggerShow:Q,triggerShown:ae,triggerHide:me,triggerHidden:Ee};function Q(_e){ke(_e,$)&&(me(_e),Ee(_e)),ke(_e,E)||(Rt(_e,"beforeitemshow",[m]),Rt(_e,"itemshow",[m]))}function ae(_e){ke(_e,_)&&Rt(_e,"itemshown",[m])}function me(_e){ke(_e,E)||Q(_e),ke(_e,_)&&ae(_e),ke(_e,$)||(Rt(_e,"beforeitemhide",[m]),Rt(_e,"itemhide",[m]))}function Ee(_e){ke(_e,$)&&Rt(_e,"itemhidden",[m])}}var wv={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,this.prevIndex,this.index)},events:["resize"]}},px={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 BN(m,E,_,{center:$,easing:Q,list:ae}){let me=m?Hc(m,ae,$):Hc(E,ae,$)+Xt(E).width*_,Ee=E?Hc(E,ae,$):me+Xt(m).width*_*(j?-1:1),_e;return{dir:_,show(Ke,je=0,gt){let Pt=gt?"linear":Q;return Ke-=Math.round(Ke*Oe(je,-1,1)),Fe(ae,"transitionProperty","none"),this.translate(je),Fe(ae,"transitionProperty",""),je=m?je:Oe(je,0,1),Dv(this.getItemIn(),"itemin",{percent:je,duration:Ke,timing:Pt,dir:_}),m&&Dv(this.getItemIn(!0),"itemout",{percent:1-je,duration:Ke,timing:Pt,dir:_}),new Promise(Wt=>{_e||(_e=Wt),Mt.start(ae,{transform:En(-Ee*(j?-1:1),"px")},Ke,Pt).then(_e,He)})},cancel(){return Mt.cancel(ae)},reset(){Fe(ae,"transform","")},async forward(Ke,je=this.percent()){return await this.cancel(),this.show(Ke,je,!0)},translate(Ke){if(Ke===this.percent())return;let je=this.getDistance()*_*(j?-1:1);Fe(ae,"transform",En(Oe(-Ee+(je-je*Ke),-fl(ae),Xt(ae).width)*(j?-1:1),"px"));let gt=this.getActives(),Pt=this.getItemIn(),Wt=this.getItemIn(!0);Ke=m?Oe(Ke,-1,1):0;for(let ar of Er(ae)){let Fr=f(gt,ar),Pr=ar===Pt,xu=ar===Wt,qv=Pr||!xu&&(Fr||_*(j?-1:1)===-1^Cm(ar,ae)>Cm(m||E));Dv(ar,`itemtranslate${qv?"in":"out"}`,{dir:_,percent:xu?1-Ke:Pr?Ke:Fr?1:0})}},percent(){return Math.abs((Fe(ae,"transform").split(",")[4]*(j?-1:1)+me)/(Ee-me))},getDistance(){return Math.abs(Ee-me)},getItemIn(Ke=!1){let je=this.getActives(),gt=hx(ae,Hc(E||m,ae,$));if(Ke){let Pt=je;je=gt,gt=Pt}return gt[p(gt,Pt=>!f(je,Pt))]},getActives(){return hx(ae,Hc(m||E,ae,$))}}}function Hc(m,E,_){let $=Cm(m,E);return _?$-mx(m,E):Math.min($,bv(E))}function bv(m){return Math.max(0,fl(m)-Xt(m).width)}function fl(m,E){return Ne(Er(m).slice(0,E),_=>Xt(_).width)}function mx(m,E){return Xt(E).width/2-Xt(m).width/2}function Cm(m,E){return m&&(zd(m).left+(j?Xt(m).width-Xt(E).width:0))*(j?-1:1)||0}function hx(m,E){E-=1;let _=Xt(m).width,$=E+_+2;return Er(m).filter(Q=>{let ae=Cm(Q,m),me=ae+Math.min(Xt(Q).width,_);return ae>=E&&me<=$})}function Dv(m,E,_){Rt(m,oo(E,!1,!1,_))}var du={mixins:[Ui,al,wv,cx,px],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:BN},computed:{finite({finite:m}){return m||$c(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,E=bv(this.list),_=p(this.slides,$=>{if(m>=E)return!0;m+=Xt($).width});return~_?_:this.length-1},sets({sets:m}){if(!m||this.parallax)return;let E=0,_=[],$=Xt(this.list).width;for(let Q=0;Q$&&(E=0),this.center?E<$/2&&E+ae+Xt(this.slides[de(+Q+1,this.slides)]).width/2>$/2&&(_.push(+Q),E=$/2-ae/2):E===0&&_.push(Math.min(+Q,this.maxIndex)),E+=ae}if(_.length)return _},transitionOptions(){return{center:this.center,list:this.list}},slides(){return Er(this.list).filter(tt)}},connected(){Je(this.$el,this.clsContainer,!gr(`.${this.clsContainer}`,this.$el))},observe:ii({target:({slides:m,$el:E})=>[E,...m]}),update:{write(){for(let m of this.navItems){let E=ee(fe(m,this.attrItem));E!==!1&&(m.hidden=!this.maxIndex||E>this.maxIndex||this.sets&&!f(this.sets,E))}this.reorder(),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 E=Math.abs(this.index-this.prevIndex+(this.dir>0&&this.indexthis.prevIndex?(this.maxIndex+1)*this.dir:0));if(!this.dragging&&E>1){for(let Q=0;Q0?"next":"previous");m.preventDefault();return}let _=this.dir<0||!this.slides[this.prevIndex]?this.index:this.prevIndex,$=fl(this.list)/this.length;this.duration=kc($/this.velocity)*(Xt(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){Fe(this.slides,"order","");return}let m=this.dir>0&&this.slides[this.prevIndex]?this.prevIndex:this.index;if(this.slides.forEach((Q,ae)=>Fe(Q,"order",this.dir>0&&ae=this.index?-1:"")),!this.center||!this.length)return;let E=this.slides[m],_=Xt(this.list).width/2-Xt(E).width/2,$=0;for(;_>0;){let Q=this.getIndex(--$+m,m),ae=this.slides[Q];Fe(ae,"order",Q>m?-2:-1),_-=Xt(ae).width}},updateActiveClasses(m=this.index){let E=this._getTransitioner(m).getActives();this.active!=="all"&&(E=[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(E,$);Je($,_,Q),et($,"aria-hidden",!Q);for(let ae of un(ur,$))r(ae,"_tabindex")||(ae._tabindex=et(ae,"tabindex")),et(ae,"tabindex",Q?ae._tabindex:-1)}},getValidIndex(m=this.index,E=this.prevIndex){if(m=this.getIndex(m,E),!this.sets)return m;let _;do{if(f(this.sets,m))return m;_=m,m=this.getIndex(m+this.dir,E)}while(m!==_);return m},getAdjacentSlides(){let{width:m}=Xt(this.list),E=-m,_=m*2,$=Xt(this.slides[this.index]).width,Q=this.center?m/2-$/2:0,ae=new Set;for(let me of[-1,1]){let Ee=Q+(me>0?$:0),_e=0;do{let Ke=this.slides[this.getIndex(this.index+me+_e++*me)];Ee+=Xt(Ke).width*me,ae.add(Ke)}while(this.length>_e&&Ee>E&&Ee<_)}return Array.from(ae)},getIndexAt(m){let E=-1,_=this.center?fl(this.list)-(Xt(this.slides[0]).width/2+Xt(De(this.slides)).width/2):fl(this.list,this.maxIndex),$=m*_,Q=0;do{let ae=Xt(this.slides[++E]).width,me=this.center?ae/2+Xt(this.slides[E+1]).width/2:ae;Q=$/me%1,$-=me}while($>=0&&ENe($.filter(je=>!_e.has(je)),je=>Xt(je).width))return!0}return!1}function Mm(m){return Math.max(0,...Er(m).map(E=>Xt(E).width))}var af={mixins:[vv],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:E,duration:_,timing:$,dir:Q}}){zi.read(()=>{if(!this.matchMedia)return;let ae=this.getCss(dx(m,Q,E)),me=this.getCss(Fa(m)?.5:Q>0?1:0);zi.write(()=>{Fe(this.$el,ae),Mt.start(this.$el,me,_,$).catch(He)})})}},{name:"transitioncanceled transitionend",self:!0,el:({item:m})=>m,handler(){Mt.cancel(this.$el)}},{name:"itemtranslatein itemtranslateout",self:!0,el:({item:m})=>m,handler({type:m,detail:{percent:E,dir:_}}){zi.read(()=>{if(!this.matchMedia){this.reset();return}let $=this.getCss(dx(m,_,E));zi.write(()=>Fe(this.$el,$))})}}]};function Fa(m){return s(m,"in")}function dx(m,E,_){return _/=2,Fa(m)^E<0?_:1-_}var LN={...gs,fade:{show(){return[{opacity:0,zIndex:0},{zIndex:-1}]},percent(m){return 1-Fe(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-Fe(m,"opacity")},translate(m){return[{opacity:1-m,transform:tf(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,E,_){return _<0?1-Cc(E):Cc(m)},translate(m,E){return E<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,E,_){return _>0?1-Cc(E):Cc(m)},translate(m,E){return E<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}]}}},sf={mixins:[Ui,mv,wv,cx,px],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:LN},watch:{list(m){Fe(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:[Ui,iv],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:we,passive:!1,handler:"init"},computed:{target:(m,E)=>(E.tBodies||[E])[0],items(){return Er(this.target)},isEmpty(){return!this.items.length},handles({handle:m},E){return m?un(m,E):this.items}},watch:{isEmpty(m){Je(this.target,this.clsEmpty,m)},handles(m,E){Fe(E,{touchAction:"",userSelect:""}),Fe(m,{touchAction:"none",userSelect:"none"})}},update:{write(m){if(!this.drag||!Vt(this.placeholder))return;let{pos:{x:E,y:_},origin:{offsetTop:$,offsetLeft:Q},placeholder:ae}=this;Fe(this.drag,{top:_-$,left:E-Q});let me=this.getSortable(document.elementFromPoint(E,_));if(!me)return;let{items:Ee}=me;if(Ee.some(Mt.inProgress))return;let _e=Ev(Ee,{x:E,y:_});if(Ee.length&&(!_e||_e===ae))return;let Ke=this.getSortable(ae),je=Sv(me.target,_e,ae,E,_,me===Ke&&m.moved!==_e);je!==!1&&(je&&ae===je||(me!==Ke?(Ke.remove(ae),m.moved=_e):delete m.moved,me.insert(ae,je),this.touched.add(me)))},events:["move"]},methods:{init(m){let{target:E,button:_,defaultPrevented:$}=m,[Q]=this.items.filter(ae=>ae.contains(E));!Q||$||_>0||kt(E)||E.closest(`.${this.clsNoDrag}`)||this.handle&&!E.closest(this.handle)||(m.preventDefault(),this.pos=ht(m),this.touched=new Set([this]),this.placeholder=Q,this.origin={target:E,index:Fn(Q),...this.pos},Qt(document,Le,this.move),Qt(document,Qe,this.end),this.threshold||this.start(m))},start(m){this.drag=uf(this.$container,this.placeholder);let{left:E,top:_}=Xt(this.placeholder);N(this.origin,{offsetLeft:this.pos.x-E,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),Rt(this.$el,"start",[this,this.placeholder]),gx(this.pos),this.move(m)},move:Wc(function(m){N(this.pos,ht(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(Ri(document,Le,this.move),Ri(document,Qe,this.end),!this.drag)return;Tm();let m=this.getSortable(this.placeholder);this===m?this.origin.index!==Fn(this.placeholder)&&Rt(this.$el,"moved",[this,this.placeholder]):(Rt(m.$el,"added",[m,this.placeholder]),Rt(this.$el,"removed",[this,this.placeholder])),Rt(this.$el,"stop",[this,this.placeholder]),Do(this.drag),this.drag=null;for(let{clsPlaceholder:E,clsItem:_}of this.touched)for(let $ of this.touched)ve($.items,E,_);this.touched=null,ve(document.documentElement,this.clsDragState)},insert(m,E){Ue(this.items,this.clsItem),E&&E.previousElementSibling!==m?this.animate(()=>lc(E,m)):!E&&this.target.lastElementChild!==m&&this.animate(()=>vn(this.target,m))},remove(m){this.target.contains(m)&&this.animate(()=>Do(m))},getSortable(m){do{let E=this.$getComponent(m,"sortable");if(E&&(E===this||this.group!==!1&&E.group===this.group))return E}while(m=Vt(m))}}};let Nv;function gx(m){let E=Date.now();Nv=setInterval(()=>{let{x:_,y:$}=m;$+=document.scrollingElement.scrollTop;let Q=(Date.now()-E)*.3;E=Date.now(),Yu(document.elementFromPoint(_,m.y)).reverse().some(ae=>{let{scrollTop:me,scrollHeight:Ee}=ae,{top:_e,bottom:Ke,height:je}=So(ae);if(_e<$&&_e+35>$)me-=Q;else if(Ke>$&&Ke-35<$)me+=Q;else return;if(me>0&&me"),vn(_,E.cloneNode(!0).children);for(let $ of E.getAttributeNames())et(_,$,E.getAttribute($))}else _=E.cloneNode(!0);return vn(m,_),Fe(_,"margin","0","important"),Fe(_,{boxSizing:"border-box",width:E.offsetWidth,height:E.offsetHeight,padding:Fe(E,"padding")}),qi(_.firstElementChild,qi(E.firstElementChild)),_}function Ev(m,E){return m[p(m,_=>ze(E,Xt(_)))]}function Sv(m,E,_,$,Q,ae){if(!Er(m).length)return;let me=Xt(E);if(!ae)return Av(m,_)||Qme[Pt]-Wt?!1:E}function Av(m,E){let _=Er(m).length===1;_&&vn(m,E);let $=Er(m),Q=$.some((ae,me)=>{let Ee=Xt(ae);return $.slice(me+1).some(_e=>{let Ke=Xt(_e);return!xx([Ee.left,Ee.right],[Ke.left,Ke.right])})});return _&&Do(E),Q}function xx(m,E){return m[1]>E[0]&&E[1]>m[0]}function Wc(m){let E;return function(..._){E||(E=!0,m.call(this,..._),requestAnimationFrame(()=>E=!1))}}var Cv={props:{pos:String,offset:null,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,E,_){let $=[this.getPositionOffset(m),this.getShiftOffset(m)],Q=[this.flip&&"flip",this.shift&&"shift"],ae={element:[this.inset?this.dir:hc(this.dir),this.align],target:[this.dir,this.align]};if(this.axis==="y"){for(let _e in ae)ae[_e].reverse();$.reverse(),Q.reverse()}let me=PN(m),Ee=Xt(m);Fe(m,{top:-Ee.height,left:-Ee.width}),ra(m,E,{attach:ae,offset:$,boundary:_,placement:Q,viewportOffset:this.getViewportOffset(m)}),me()},getPositionOffset(m=this.$el){return jn(this.offset===!1?Fe(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:jn(Fe(m,"--uk-position-shift-offset"),this.axis==="y"?"width":"height",m)*(f(["left","top"],this.align)?1:-1)},getViewportOffset(m){return jn(Fe(m,"--uk-position-viewport-offset"))}}};function PN(m){let E=ms(m),{scrollTop:_}=E;return()=>{_!==E.scrollTop&&(E.scrollTop=_)}}var yx={mixins:[vs,au,Cv],data:{pos:"top",animation:["uk-animation-scale-up"],duration:100,cls:"uk-active"},connected(){Om(this.$el)},disconnected(){this.hide()},methods:{show(){if(this.isToggled(this.tooltip||null))return;let{delay:m=0,title:E}=qN(this.$options);if(!E)return;let _=et(this.$el,"title"),$=Qt(this.$el,["blur",Xe],ae=>!at(ae)&&this.hide());this.reset=()=>{et(this.$el,{title:_,"aria-describedby":null}),$()};let Q=ol(this);et(this.$el,{title:null,"aria-describedby":Q}),clearTimeout(this.showTimer),this.showTimer=setTimeout(()=>this._show(E,Q),m)},async hide(){var m;tr(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),Do(this.tooltip),this.tooltip=null)},async _show(m,E){this.tooltip=vn(this.container,``),Qt(this.tooltip,"toggled",(_,$)=>{if(!$)return;let Q=()=>this.positionAt(this.tooltip,this.$el);Q();let[ae,me]=RN(this.tooltip,this.$el,this.pos);this.origin=this.axis==="y"?`${hc(ae)}-${me}`:`${me}-${hc(ae)}`;let Ee=[Tr(document,`keydown ${we}`,this.hide,!1,_e=>_e.type===we&&!this.$el.contains(_e.target)||_e.type==="keydown"&&_e.keyCode===Or.ESC),Qt([document,...iu(this.$el)],"scroll",Q,{passive:!0})];Tr(this.tooltip,"hide",()=>Ee.forEach(_e=>_e()),{self:!0})}),await this.toggleElement(this.tooltip,!0)||this.hide()}},events:{[`focus ${it} ${we}`](m){(!at(m)||m.type===we)&&this.show()}}};function Om(m){Gr(m)||et(m,"tabindex","0")}function RN(m,E,[_,$]){let Q=xr(m),ae=xr(E),me=[["left","right"],["top","bottom"]];for(let _e of me){if(Q[_e[0]]>=ae[_e[1]]){_=_e[1];break}if(Q[_e[1]]<=ae[_e[0]]){_=_e[0];break}}return $=(f(me[0],_)?me[1]:me[0]).find(_e=>Q[_e]===ae[_e])||"center",[_,$]}function qN(m){let{el:E,id:_,data:$}=m;return["delay","title"].reduce((Q,ae)=>({[ae]:fe(E,ae),...Q}),{...Ku(fe(E,_),["title"]),...$})}var Vc={mixins:[xm],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){tr(m.target,'input[type="file"]')&&(m.preventDefault(),m.target.files&&this.upload(m.target.files),m.target.value="")},drop(m){Im(m);let E=m.dataTransfer;E?.files&&(ve(this.$el,this.clsDragover),this.upload(E.files))},dragenter(m){Im(m)},dragover(m){Im(m),Ue(this.$el,this.clsDragover)},dragleave(m){Im(m),ve(this.$el,this.clsDragover)}},methods:{async upload(m){if(m=y(m),!m.length)return;Rt(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&&!Mv(this.allow,$.name)){this.fail(this.t("invalidName",this.allow));return}if(this.mime&&!Mv(this.mime,$.type)){this.fail(this.t("invalidMime",this.mime));return}}this.multiple||(m=m.slice(0,1)),this.beforeAll(this,m);let E=wx(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 Tv(this.url,{data:Q,method:this.method,responseType:this.type,beforeSend:me=>{let{xhr:Ee}=me;Qt(Ee.upload,"progress",this.progress);for(let _e of["loadStart","load","loadEnd","abort"])Qt(Ee,_e.toLowerCase(),this[_e]);return this.beforeSend(me)}});this.complete(ae),E.length?await _(E.shift()):this.completeAll(ae)}catch(ae){this.error(ae)}};await _(E.shift())}}};function Mv(m,E){return E.match(new RegExp(`^${m.replace(/\//g,"\\/").replace(/\*\*/g,"(\\/[^\\/]+)*").replace(/\*/g,"[^\\/]+").replace(/((?!\\))\?/g,"$1.")}$`,"i"))}function wx(m,E){let _=[];for(let $=0;${let{xhr:Q}=E;for(let ae in E)if(ae in Q)try{Q[ae]=E[ae]}catch{}Q.open(E.method.toUpperCase(),m);for(let ae in E.headers)Q.setRequestHeader(ae,E.headers[ae]);Qt(Q,"load",()=>{Q.status===0||Q.status>=200&&Q.status<300||Q.status===304?_(Q):$(N(Error(Q.statusText),{xhr:Q,status:Q.status}))}),Qt(Q,"error",()=>$(N(Error("Network Error"),{xhr:Q}))),Qt(Q,"timeout",()=>$(N(Error("Network Timeout"),{xhr:Q}))),Q.send(E.data)})}var zN=Object.freeze({__proto__:null,Countdown:k1,Filter:bN,Lightbox:ix,LightboxPanel:hv,Notification:ox,Parallax:kN,Slider:du,SliderParallax:af,Slideshow:sf,SlideshowParallax:af,Sortable:vx,Tooltip:yx,Upload:Vc});function Dx(m){J&&window.MutationObserver&&(document.body?requestAnimationFrame(()=>Ov(m)):new MutationObserver((E,_)=>{document.body&&(Ov(m),_.disconnect())}).observe(document.documentElement,{childList:!0}))}function Ov(m){Rt(document,"uikit:init",m),document.body&&Eo(document.body,lf),new MutationObserver(E=>E.forEach(UN)).observe(document,{subtree:!0,childList:!0}),new MutationObserver(E=>E.forEach(Iv)).observe(document,{subtree:!0,attributes:!0}),m._initialized=!0}function UN({addedNodes:m,removedNodes:E}){for(let _ of m)Eo(_,lf);for(let _ of E)Eo(_,Gc)}function Iv({target:m,attributeName:E}){var _;let $=Nx(E);$&&(ut(m,E)?cu($,m):(_=Fc(m,$))==null||_.$destroy())}function lf(m){let E=il(m);for(let _ in E)Nm(E[_]);for(let _ of m.getAttributeNames()){let $=Nx(_);$&&cu($,m)}}function Gc(m){let E=il(m);for(let _ in E)Oc(E[_])}function Nx(m){a(m,"data-")&&(m=m.slice(5));let E=nl[m];return E&&(E.options||E).name}IN(Wi),rx(Wi);var Fv={mixins:[Ui,au],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},E)=>un(m,E),toggles({toggle:m}){return this.items.map(E=>gr(m,E))},contents({content:m}){return this.items.map(E=>{var _;return((_=E._wrapper)==null?void 0:_.firstElementChild)||gr(m,E)})}},watch:{items(m,E){if(E||ke(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 E of m){let _=ke(this.items.find($=>$.contains(E)),this.clsOpen);Fm(E,!_)}this.$emit()}},observe:Zl(),events:[{name:"click keydown",delegate:({targets:m,$props:E})=>`${m} ${E.toggle}`,async handler(m){var E;m.type==="keydown"&&m.keyCode!==Or.SPACE||(m.preventDefault(),(E=this._off)==null||E.call(this),this._off=$N(m.target),await this.toggle(Fn(this.toggles,m.current)),this._off())}},{name:"shown hidden",self:!0,delegate:({targets:m})=>m,handler(){this.$emit()}}],update(){let m=pi(this.items,`.${this.clsOpen}`);for(let E in this.items){let _=this.toggles[E],$=this.contents[E];if(!_||!$)continue;_.id=ol(this,_),$.id=ol(this,$);let Q=f(m,this.items[E]);et(_,{role:jr(_,"a")?"button":null,"aria-controls":$.id,"aria-expanded":Q,"aria-disabled":!this.collapsible&&m.length<2&&Q}),et($,{role:"region","aria-labelledby":_.id}),jr($,"ul")&&et(Er($),"role","presentation")}},methods:{toggle(m,E){m=this.items[de(m,this.items)];let _=[m],$=pi(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,me)=>{if(Je(ae,this.clsOpen,me),E===!1||!this.animation){Fm(gr(this.content,ae),!me);return}return HN(ae,me,this)})))}}};function Fm(m,E){m&&(m.hidden=E)}async function HN(m,E,{content:_,duration:$,velocity:Q,transition:ae}){var me;_=((me=m._wrapper)==null?void 0:me.firstElementChild)||gr(_,m),m._wrapper||(m._wrapper=em(_,"
      "));let Ee=m._wrapper;Fe(Ee,"overflow","hidden");let _e=ie(Fe(Ee,"height"));await Mt.cancel(Ee),Fm(_,!1);let Ke=Ne(["marginTop","marginBottom"],gt=>Fe(_,gt))+Xt(_).height,je=_e/Ke;$=(Q*Ke+$)*(E?1-je:je),Fe(Ee,"height",_e),await Mt.start(Ee,{height:E?Ke:0},$,ae),No(_),delete m._wrapper,E||Fm(_,!0)}function $N(m){let E=ms(m,!0),_;return function $(){_=requestAnimationFrame(()=>{let{top:Q}=Xt(m);Q<0&&(E.scrollTop+=Q),$()})}(),()=>requestAnimationFrame(()=>cancelAnimationFrame(_))}var WN={mixins:[Ui,au],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,Ex),this.$destroy(!0)}}};function Ex(m,E,{duration:_,transition:$,velocity:Q}){let ae=ie(Fe(m,"height"));return Fe(m,"height",ae),Mt.start(m,{height:0,marginTop:0,marginBottom:0,paddingTop:0,paddingBottom:0,borderTop:0,borderBottom:0,opacity:0},Q*ae+_,$)}var Sx={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&&E1(this.$el)},events:[{name:`${it} focusin`,filter:({autoplay:m})=>f(m,"hover"),handler(m){!at(m)||!VN(this.$el)?Vl(this.$el):ps(this.$el)}},{name:`${Xe} focusout`,filter:({autoplay:m})=>f(m,"hover"),handler(m){at(m)||ps(this.$el)}}],observe:[na({filter:({$el:m,autoplay:E})=>E&&E!=="hover"&&S1(m),handler([{isIntersecting:m}]){document.fullscreenElement||(m?Vl(this.$el):ps(this.$el))},args:{intersecting:!1},options:({$el:m,autoplay:E})=>({root:E==="inview"?null:Vt(m)})})]};function VN(m){return!m.paused&&!m.ended}var Ax={mixins:[Sx],props:{width:Number,height:Number},data:{automute:!0},created(){this.useObjectFit=jr(this.$el,"img","video")},observe:ii({target:({$el:m})=>_m(m)||Vt(m),filter:({useObjectFit:m})=>!m}),update:{read(){if(this.useObjectFit)return!1;let{ratio:m,cover:E}=ct,{$el:_,width:$,height:Q}=this,ae={width:$,height:Q};if(!$||!Q){let Ke={width:_.naturalWidth||_.videoWidth||_.clientWidth,height:_.naturalHeight||_.videoHeight||_.clientHeight};$?ae=m(Ke,"width",$):Q?ae=m(Ke,"height",Q):ae=Ke}let{offsetHeight:me,offsetWidth:Ee}=_m(_)||Vt(_),_e=E(ae,{width:Ee+(Ee%2?1:0),height:me+(me%2?1:0)});return!_e.width||!_e.height?!1:_e},write({height:m,width:E}){Fe(this.$el,{height:m,width:E})},events:["resize"]}};function _m(m){for(;m=Vt(m);)if(Fe(m,"position")!=="static")return m}let ai;var Cx={mixins:[vs,Cv,au],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:E,boundaryY:_},$){return[Hn(E||m,$)||window,Hn(_||m,$)||window]},target({target:m,targetX:E,targetY:_},$){return E||(E=m||this.targetEl),_||(_=m||this.targetEl),[E===!0?window:Hn(E,$),_===!0?window:Hn(_,$)]}},created(){this.tracker=new Vd},beforeConnect(){this.clsDrop=this.$props.clsDrop||this.$options.id},connected(){Ue(this.$el,"uk-drop",this.clsDrop),this.toggle&&!this.targetEl&&(this.targetEl=Tx(this)),this._style=Ce(this.$el.style,["width","height"])},disconnected(){this.isActive()&&(this.hide(!1),ai=null),Fe(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:E}){let{hash:_}=E;!m&&_&&Aa(E)&&!this.$el.contains(gr(_))&&this.hide(!1)}},{name:"beforescroll",handler(){this.hide(!1)}},{name:"toggle",self:!0,handler(m,E){m.preventDefault(),this.isToggled()?this.hide(!1):this.show(E?.$el,!1)}},{name:"toggleshow",self:!0,handler(m,E){m.preventDefault(),this.show(E?.$el)}},{name:"togglehide",self:!0,handler(m){m.preventDefault(),tr(this.$el,":focus,:hover")||this.hide()}},{name:`${it} focusin`,filter:({mode:m})=>f(m,"hover"),handler(m){at(m)||this.clearTimers()}},{name:`${Xe} focusout`,filter:({mode:m})=>f(m,"hover"),handler(m){!at(m)&&m.relatedTarget&&this.hide()}},{name:"toggled",self:!0,handler(m,E){E&&(this.clearTimers(),this.position())}},{name:"show",self:!0,handler(){ai=this,this.tracker.init(),et(this.targetEl,"aria-expanded",!0);let m=[km(this),GN(this),ln(this),this.autoUpdate&&Ox(this),this.closeOnScroll&&YN(this)];Tr(this.$el,"hide",()=>m.forEach(E=>E&&E()),{self:!0}),this.bgScroll||Tr(this.$el,"hidden",av(this.$el),{self:!0})}},{name:"beforehide",self:!0,handler:"clearTimers"},{name:"hide",handler({target:m}){if(this.$el!==m){ai=ai===null&&this.$el.contains(m)&&this.isToggled()?this:ai;return}ai=this.isActive()?null:ai,this.tracker.cancel(),et(this.targetEl,"aria-expanded",null)}}],update:{write(){this.isToggled()&&!ke(this.$el,this.clsEnter)&&this.position()}},methods:{show(m=this.targetEl,E=!0){if(this.isToggled()&&m&&this.targetEl&&m!==this.targetEl&&this.hide(!1,!1),this.targetEl=m,this.clearTimers(),!this.isActive()){if(ai){if(E&&ai.isDelaying){this.showTimer=setTimeout(()=>tr(m,":hover")&&this.show(),10);return}let _;for(;ai&&_!==ai&&!ai.$el.contains(this.$el);)_=ai,ai.hide(!1,!1)}this.container&&Vt(this.$el)!==this.container&&vn(this.container,this.$el),this.showTimer=setTimeout(()=>this.toggleElement(this.$el,!0),E&&this.delayShow||0)}},hide(m=!0,E=!0){let _=()=>this.toggleElement(this.$el,!1,this.animateOut&&E);this.clearTimers(),this.isDelayedHide=m,this.isDelaying=Mx(this.$el).some($=>this.tracker.movesTo($)),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,this.isDelaying=!1},isActive(){return ai===this},position(){ve(this.$el,"uk-drop-stack"),Fe(this.$el,this._style),this.$el.hidden=!0;let m=this.target.map(Q=>ff(this.$el,Q)),E=this.getViewportOffset(this.$el),_=[[0,["x","width","left","right"]],[1,["y","height","top","bottom"]]];for(let[Q,[ae,me]]of _)this.axis!==ae&&f([ae,!0],this.stretch)&&Fe(this.$el,{[me]:Math.min(xr(this.boundary[Q])[me],m[Q][me]-2*E),[`overflow-${ae}`]:"auto"});let $=m[0].width-2*E;this.$el.hidden=!1,Fe(this.$el,"maxWidth",""),this.$el.offsetWidth>$&&Ue(this.$el,"uk-drop-stack"),Fe(this.$el,"maxWidth",$),this.positionAt(this.$el,this.target,this.boundary);for(let[Q,[ae,me,Ee,_e]]of _)if(this.axis===ae&&f([ae,!0],this.stretch)){let Ke=Math.abs(this.getPositionOffset()),je=xr(this.target[Q]),gt=xr(this.$el);Fe(this.$el,{[me]:(je[Ee]>gt[Ee]?je[this.inset?_e:Ee]-Math.max(xr(this.boundary[Q])[Ee],m[Q][Ee]+E):Math.min(xr(this.boundary[Q])[_e],m[Q][_e]-E)-je[this.inset?Ee:_e])-Ke,[`overflow-${ae}`]:"auto"}),this.positionAt(this.$el,this.target,this.boundary)}}}};function Mx(m){let E=[];return Eo(m,_=>Fe(_,"position")!=="static"&&E.push(_)),E}function ff(m,E){return So(iu(E).find(_=>_.contains(m)))}function Tx(m){let{$el:E}=m.$create("toggle",Hn(m.toggle,m.$el),{target:m.$el,mode:m.mode});return et(E,"aria-haspopup",!0),E}function km(m){let E=()=>m.$emit(),_=[im(E),vc(iu(m.$el).concat(m.target),E)];return()=>_.map($=>$.disconnect())}function Ox(m,E=()=>m.$emit()){return Qt([document,...iu(m.$el)],"scroll",E,{passive:!0})}function GN(m){return Qt(document,"keydown",E=>{E.keyCode===Or.ESC&&m.hide(!1)})}function YN(m){return Ox(m,()=>m.hide(!1))}function ln(m){return Qt(document,we,({target:E})=>{m.$el.contains(E)||Tr(document,`${Qe} ${pt} scroll`,({defaultPrevented:_,type:$,target:Q})=>{var ae;!_&&$===Qe&&E===Q&&!((ae=m.targetEl)!=null&&ae.contains(E))&&m.hide(!1)},!0)})}var Ix={mixins:[Ui,vs],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},E)=>Hn(m,E)||E,dropbar({dropbar:m}){return m?(m=this._dropbar||Hn(m,this.$el)||gr(`+ .${this.clsDropbar}`,this.$el),m||(this._dropbar=gr("
      "))):null},dropContainer(m,E){return this.container||E},dropdowns({clsDrop:m},E){var _;let $=un(`.${m}`,E);if(this.dropContainer!==E)for(let Q of un(`.${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},E){return un(m,E)}},watch:{dropbar(m){Ue(m,"uk-dropbar","uk-dropbar-top",this.clsDropbar,`uk-${this.$options.name}-dropbar`)},dropdowns(){this.initializeDropdowns()}},connected(){this.initializeDropdowns()},disconnected(){Do(this._dropbar),delete this._dropbar},events:[{name:"mouseover focusin",delegate:({selNavItem:m})=>m,handler({current:m}){let E=this.getActive();E&&f(E.mode,"hover")&&E.targetEl&&!m.contains(E.targetEl)&&!E.isDelaying&&E.hide(!1)}},{name:"keydown",self:!0,delegate:({selNavItem:m})=>m,handler(m){var E;let{current:_,keyCode:$}=m,Q=this.getActive();$===Or.DOWN&&Q?.targetEl===_&&(m.preventDefault(),(E=gr(ur,Q.$el))==null||E.focus()),Bm(m,this.items,Q)}},{name:"keydown",el:({dropContainer:m})=>m,delegate:({clsDrop:m})=>`.${m}`,handler(m){var E;let{current:_,keyCode:$}=m;if(!f(this.dropdowns,_))return;let Q=this.getActive(),ae=-1;if($===Or.HOME?ae=0:$===Or.END?ae="last":$===Or.UP?ae="previous":$===Or.DOWN?ae="next":$===Or.ESC&&((E=Q.targetEl)==null||E.focus()),~ae){m.preventDefault();let me=un(ur,_);me[de(ae,me,p(me,Ee=>tr(Ee,":focus")))].focus()}Bm(m,this.items,Q)}},{name:"mouseleave",el:({dropbar:m})=>m,filter:({dropbar:m})=>m,handler(){let m=this.getActive();m&&f(m.mode,"hover")&&!this.dropdowns.some(E=>tr(E,":hover"))&&m.hide()}},{name:"beforeshow",el:({dropContainer:m})=>m,filter:({dropbar:m})=>m,handler({target:m}){this.isDropbarDrop(m)&&(this.dropbar.previousElementSibling!==this.dropbarAnchor&&fc(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 E=this.getDropdown(m),_=()=>{let $=Math.max(...ro(m,`.${this.clsDrop}`).concat(m).map(Q=>xr(Q).bottom));xr(this.dropbar,{left:xr(this.dropbar).left,top:this.getDropbarOffset(E.getPositionOffset())}),this.transitionTo($-xr(this.dropbar).top+ie(Fe(m,"marginBottom")),m)};this._observer=vc([E.$el,...E.target],_),_()}},{name:"beforehide",el:({dropContainer:m})=>m,filter:({dropbar:m})=>m,handler(m){let E=this.getActive();tr(this.dropbar,":hover")&&E.$el===m.target&&this.isDropbarDrop(E.$el)&&f(E.mode,"hover")&&E.isDelayedHide&&!this.items.some(_=>E.targetEl!==_&&tr(_,":focus"))&&m.preventDefault()}},{name:"hide",el:({dropContainer:m})=>m,filter:({dropbar:m})=>m,handler({target:m}){var E;if(!this.isDropbarDrop(m))return;(E=this._observer)==null||E.disconnect();let _=this.getActive();(!_||_.$el===m)&&this.transitionTo(0)}}],methods:{getActive(){var m;return f(this.dropdowns,(m=ai)==null?void 0:m.$el)&&ai},async transitionTo(m,E){let{dropbar:_}=this,$=qi(_);if(E=$0&&Fe(E,"transitionDelay",`${Q/m*this.duration}ms`)}Fe(E,"clipPath",`polygon(0 0,100% 0,100% ${$}px,0 ${$}px)`),qi(_,$),await Promise.all([Mt.start(_,{height:m},this.duration),Mt.start(E,{clipPath:`polygon(0 0,100% 0,100% ${m}px,0 ${m}px)`},this.duration).finally(()=>Fe(E,{clipPath:"",transitionDelay:""}))]).catch(He)},getDropdown(m){return this.$getComponent(m,"drop")||this.$getComponent(m,"dropdown")},isDropbarDrop(m){return f(this.dropdowns,m)&&ke(m,this.clsDrop)},getDropbarOffset(m){let{$el:E,target:_,targetY:$}=this,{top:Q,height:ae}=xr(Hn($||_||E,E));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 Bm(m,E,_){var $,Q,ae;let{current:me,keyCode:Ee}=m,_e=-1;Ee===Or.HOME?_e=0:Ee===Or.END?_e="last":Ee===Or.LEFT?_e="previous":Ee===Or.RIGHT?_e="next":Ee===Or.TAB&&(($=_.targetEl)==null||$.focus(),(Q=_.hide)==null||Q.call(_,!1)),~_e&&(m.preventDefault(),(ae=_.hide)==null||ae.call(_,!1),E[de(_e,E,E.indexOf(_.targetEl||me))].focus())}var Yc={mixins:[Ui],args:"target",props:{target:Boolean},data:{target:!1},computed:{input:(m,E)=>gr(wt,E),state(){return this.input.nextElementSibling},target({target:m},E){return m&&(m===!0&&Vt(this.input)===E&&this.input.nextElementSibling||gr(m,E))}},update(){var m;let{target:E,input:_}=this;if(!E)return;let $,Q=kt(E)?"value":"textContent",ae=E[Q],me=(m=_.files)!=null&&m[0]?_.files[0].name:tr(_,"select")&&($=un("option",_).filter(Ee=>Ee.selected)[0])?$.textContent:_.value;ae!==me&&(E[Q]=me)},events:[{name:"change",handler(){this.$emit()}},{name:"reset",el:({$el:m})=>m.closest("form"),handler(){this.$emit()}}]},aa={extends:ds,mixins:[Ui],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:E})=>m||E}),update:[{write({rows:m}){Je(this.$el,this.clsStack,!m.some(E=>E.length>1))},events:["resize"]},{read(m){let{rows:E}=m,{masonry:_,parallax:$,parallaxJustify:Q,margin:ae}=this;if($=Math.max(0,jn($)),!(_||$||Q)||Zc(E)||E[0].some((ar,Fr)=>E.some(Pr=>Pr[Fr]&&Pr[Fr].offsetWidth!==ar.offsetWidth)))return m.translates=m.scrollColumns=!1;let me=Fx(E,ae),Ee,_e;_?[Ee,_e]=_v(E,me,_==="next"):Ee=_x(E);let Ke=Ee.map(ar=>Ne(ar,"offsetHeight")+me*(ar.length-1)),je=Math.max(0,...Ke),gt,Pt,Wt;return($||Q)&&(gt=Ke.map((ar,Fr)=>Q?je-ar+$:$/(Fr%2||8)),Q||($=Math.max(...Ke.map((ar,Fr)=>ar+gt[Fr]-je))),Pt=jn(this.parallaxStart,"height",this.$el,!0),Wt=jn(this.parallaxEnd,"height",this.$el,!0)),{columns:Ee,translates:_e,scrollColumns:gt,parallaxStart:Pt,parallaxEnd:Wt,padding:$,height:_e?je:""}},write({height:m,padding:E}){Fe(this.$el,"paddingBottom",E||""),m!==!1&&Fe(this.$el,"height",m)},events:["resize"]},{read({rows:m,scrollColumns:E,parallaxStart:_,parallaxEnd:$}){return{scrolled:E&&!Zc(m)?sm(this.$el,_,$):!1}},write({columns:m,scrolled:E,scrollColumns:_,translates:$}){!E&&!$||m.forEach((Q,ae)=>Q.forEach((me,Ee)=>{let[_e,Ke]=$&&$[ae][Ee]||[0,0];E&&(Ke+=E*_[ae]),Fe(me,"transform",`translate(${_e}px, ${Ke}px)`)}))},events:["scroll","resize"]}]};function Zc(m){return m.flat().some(E=>Fe(E,"position")==="absolute")}function _v(m,E,_){let $=[],Q=[],ae=Array(m[0].length).fill(0),me=0;for(let Ee of m){j&&(Ee=Ee.reverse());let _e=0;for(let Ke in Ee){let{offsetWidth:je,offsetHeight:gt}=Ee[Ke],Pt=_?Ke:ae.indexOf(Math.min(...ae));Lm($,Pt,Ee[Ke]),Lm(Q,Pt,[(Pt-Ke)*je*(j?-1:1),ae[Pt]-me]),ae[Pt]+=gt+E,_e=Math.max(_e,gt)}me+=_e+E}return[$,Q]}function Fx(m,E){let _=m.flat().find($=>ke($,E));return ie(_?Fe(_,"marginTop"):Fe(m[0][0],"paddingLeft"))}function _x(m){let E=[];for(let _ of m)for(let $ in _)Lm(E,$,_[$]);return E}function Lm(m,E,_){m[E]||(m[E]=[]),m[E].push(_)}var kv={args:"target",props:{target:String,row:Boolean},data:{target:"> *",row:!0},computed:{elements:({target:m},E)=>un(m,E)},observe:ii({target:({$el:m,elements:E})=>E.reduce((_,$)=>_.concat($,...$.children),[m])}),events:{name:"loadingdone",el:()=>document.fonts,handler(){this.$emit("resize")}},update:{read(){return{rows:(this.row?Oa(this.elements):[this.elements]).map(kx)}},write({rows:m}){for(let{heights:E,elements:_}of m)_.forEach(($,Q)=>Fe($,"minHeight",E[Q]))},events:["resize"]}};function kx(m){if(m.length<2)return{heights:[""],elements:m};let E=m.map(ZN),_=Math.max(...E);return{heights:m.map(($,Q)=>E[Q].toFixed(2)===_.toFixed(2)?"":_),elements:m}}function ZN(m){let E=Ce(m.style,["display","minHeight"]);tt(m)||Fe(m,"display","block","important"),Fe(m,"minHeight","");let _=Xt(m).height-tu(m,"height","content-box");return Fe(m,E),_}var Bv={args:"target",props:{target:String},data:{target:""},computed:{target:{get:({target:m},E)=>Hn(m,E),observe:({target:m})=>m}},observe:ii({target:({target:m})=>m}),update:{read(){return this.target?{height:this.target.offsetHeight}:!1},write({height:m}){Fe(this.$el,{minHeight:m})},events:["resize"]}},Bx={props:{expand:Boolean,offsetTop:Boolean,offsetBottom:Boolean,minHeight:Number},data:{expand:!1,offsetTop:!1,offsetBottom:!1,minHeight:0},observe:[Dc({filter:({expand:m})=>m}),ii({target:({$el:m})=>Yu(m)})],update:{read(){if(!tt(this.$el))return!1;let m="",E=tu(this.$el,"height","content-box"),{body:_,scrollingElement:$}=document,Q=ms(this.$el),{height:ae}=So(Q===_?$:Q),me=$===Q||_===Q;if(m=`calc(${me?"100vh":`${ae}px`}`,this.expand){let Ee=Xt(Q).height-Xt(this.$el).height;m+=` - ${Ee}px`}else{if(this.offsetTop)if(me){let Ee=this.offsetTop===!0?this.$el:Hn(this.offsetTop,this.$el),_e=eu(Ee)[0]-eu(Q)[0];m+=_e>0&&_e{if(!this._connected)return;let E=se(m,this.$el);return this.svgEl&&E!==this.svgEl&&Do(this.svgEl),Ie.call(this,E,m),this.svgEl=E},He)},disconnected(){this.svg.then(m=>{this._connected||(xe(this.$el)&&(this.$el.hidden=!1),Do(m),this.svgEl=null)}),this.svg=null},methods:{async getSvg(){}}};function se(m,E){if(xe(E)||jr(E,"canvas")){E.hidden=!0;let $=E.nextElementSibling;return Ae(m,$)?$:fc(E,m)}let _=E.lastElementChild;return Ae(m,_)?_:vn(E,m)}function Ae(m,E){return jr(m,"svg")&&jr(E,"svg")&&m.innerHTML===E.innerHTML}function Ie(m,E){let _=["width","height"],$=_.map(ae=>this[ae]);$.some(ae=>ae)||($=_.map(ae=>et(E,ae)));let Q=et(E,"viewBox");Q&&!$.some(ae=>ae)&&($=Q.split(" ").slice(2)),$.forEach((ae,me)=>et(m,_[me],ie(ae)*this.ratio||null))}var Ze={mixins:[oe],args:"src",props:{src:String,icon:String,attributes:"list",strokeAnimation:Boolean},data:{strokeAnimation:!1},observe:[hs({async handler(){let m=await this.svg;m&&$e.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&&($e.call(this,m),this.strokeAnimation&&At(m))},methods:{async getSvg(){return jr(this.$el,"img")&&!this.$el.complete&&this.$el.loading==="lazy"&&await new Promise(m=>Tr(this.$el,"load",m)),mt(await st(this.src),this.icon)||Promise.reject("SVG not found.")}}};function $e(m){let{$el:E}=this;Ue(m,et(E,"class"),"uk-svg");for(let _=0;_m?a(m,"data:")?decodeURIComponent(m.split(",")[1]):(await fetch(m)).text():Promise.reject());function mt(m,E){return E&&f(m,"/g,Dt=be(function(m){let E={};yt.lastIndex=0;let _;for(;_=yt.exec(m);)E[_[3]]=``;return E});function At(m){let E=Rc(m);E&&Fe(m,"--uk-animation-stroke",E)}function bt(m){let E=document.createElement("template");return E.innerHTML=m,E.content.firstElementChild}let Tt={spinner:G,totop:te,marker:cf,"close-icon":qr,"close-large":Lx,"drop-parent-icon":XN,"nav-parent-icon":Pm,"nav-parent-icon-large":KN,"navbar-parent-icon":JN,"navbar-toggle-icon":Sn,"overlay-icon":QN,"pagination-next":jN,"pagination-previous":eE,"search-icon":Xc,"search-medium":c,"search-large":d,"search-toggle-icon":Xc,"slidenav-next":S,"slidenav-next-large":A,"slidenav-previous":U,"slidenav-previous-large":T},Gt={install:Xi,mixins:[oe],args:"icon",props:{icon:String},isIcon:!0,beforeConnect(){Ue(this.$el,"uk-icon")},methods:{async getSvg(){let m=vu(this.icon);if(!m)throw"Icon not found.";return m}}},Ut={args:!1,extends:Gt,data:m=>({icon:i(m.constructor.options.name)}),beforeConnect(){Ue(this.$el,this.$options.id)}},dr={extends:Ut,beforeConnect(){let m=this.$props.icon;this.icon=this.$el.closest(".uk-nav-primary")?`${m}-large`:m}},Yr={extends:Ut,mixins:[xm],i18n:{toggle:"Open Search",submit:"Submit Search"},beforeConnect(){let m=ke(this.$el,"uk-search-toggle")||ke(this.$el,"uk-navbar-toggle");if(this.icon=m?"search-toggle-icon":ke(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 E=this.t("toggle");et(this.$el,"aria-label",E)}else{let E=this.$el.closest("a,button");if(E){let _=this.t("submit");et(E,"aria-label",_)}}}},ti={extends:Ut,beforeConnect(){et(this.$el,"role","status")},methods:{async getSvg(){let m=await Gt.methods.getSvg.call(this);return this.ratio!==1&&Fe(gr("circle",m),"strokeWidth",1/this.ratio),m}}},zr={extends:Ut,mixins:[xm],beforeConnect(){let m=this.$el.closest("a,button");et(m,"role",this.role!==null&&jr(m,"a")?"button":this.role);let E=this.t("label");E&&!ut(m,"aria-label")&&et(m,"aria-label",E)}},Gi={extends:zr,beforeConnect(){Ue(this.$el,"uk-slidenav");let m=this.$props.icon;this.icon=ke(this.$el,"uk-slidenav-large")?`${m}-large`:m}},Yi={extends:zr,i18n:{label:"Open menu"}},Bn={extends:zr,i18n:{label:"Close"},beforeConnect(){this.icon=`close-${ke(this.$el,"uk-close-large")?"large":"icon"}`}},Zi={extends:zr,i18n:{label:"Open"}},si={extends:zr,i18n:{label:"Back to top"}},Vn={extends:zr,i18n:{label:"Next page"},data:{role:null}},Ln={extends:zr,i18n:{label:"Previous page"},data:{role:null}},tn={};function Xi(m){m.icon.add=(E,_)=>{let $=R(E)?{[E]:_}:E;ye($,(Q,ae)=>{Tt[ae]=Q,delete tn[ae]}),m._initialized&&Eo(document.body,Q=>ye(m.getComponents(Q),ae=>{ae.$options.isIcon&&ae.icon in $&&ae.$reset()}))}}let pf={twitter:"x"};function vu(m){return m=pf[m]||m,Tt[m]?(tn[m]||(tn[m]=bt(Tt[vi(m)]||Tt[m])),tn[m].cloneNode(!0)):null}function vi(m){return j?he(he(m,"left","right"),"previous","next"):m}var _a={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():gu(this.$el)&&(this.$el.loading="lazy",Pn(this.$el))},disconnected(){this.img&&(this.img.onload=""),delete this.img},observe:na({handler(m,E){this.load(),E.disconnect()},options:({margin:m})=>({rootMargin:m}),filter:({loading:m})=>m==="lazy",target:({$el:m,$props:E})=>E.target?[m,...Ko(E.target,m)]:m}),methods:{load(){if(this.img)return this.img;let m=gu(this.$el)?this.$el:cl(this.$el,this.dataSrc,this.sources);return Lt(m,"loading"),Pn(this.$el,m.currentSrc),this.img=m}}};function Pn(m,E){if(gu(m)){let _=Vt(m);(jr(_,"picture")?Er(_):[m]).forEach(Q=>ka(Q,Q))}else E&&!f(m.style.backgroundImage,E)&&(Fe(m,"backgroundImage",`url(${Ma(E)})`),Rt(m,oo("load",!1)))}let Lv=["data-src","data-srcset","sizes"];function ka(m,E){for(let _ of Lv){let $=fe(m,_);$&&et(E,_.replace(/^(data-)+/,""),$)}}function cl(m,E,_){let $=new Image;return pl($,_),ka(m,$),$.onload=()=>{Pn(m,$.currentSrc)},et($,"src",E),$}function pl(m,E){if(E=Ci(E),E.length){let _=Wu("");for(let $ of E){let Q=Wu("");et(Q,$),vn(_,Q)}vn(_,m)}}function Ci(m){if(!m)return[];if(a(m,"["))try{m=JSON.parse(m)}catch{m=[]}else m=Ku(m);return h(m)||(m=[m]),m.filter(E=>!H(E))}function gu(m){return jr(m,"img")}var Pv={props:{target:String,selActive:String},data:{target:!1,selActive:!1},computed:{target:({target:m},E)=>m?un(m,E):E},observe:[na({handler(m){this.isIntersecting=m.some(({isIntersecting:E})=>E),this.$emit()},target:({target:m})=>m,args:{intersecting:!1}}),hs({target:({target:m})=>m,options:{attributes:!0,attributeFilter:["class"],attributeOldValue:!0}}),{target:({target:m})=>m,observe:(m,E)=>{let _=vc([...Y(m),document.documentElement],E),$=[Qt(document,"scroll itemshown itemhidden",E,{passive:!0,capture:!0}),Qt(document,"show hide transitionstart",Q=>(E(),_.observe(Q.target))),Qt(document,"shown hidden transitionend transitioncancel",Q=>(E(),_.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 Y(this.target)){let E=!this.selActive||tr(m,this.selActive)?mte(m):"";E!==!1&&Re(m,"uk-light uk-dark",E)}}}};function mte(m){let E=Xt(m),_=Xt(window);if(!Se(E,_))return!1;let{left:$,top:Q,height:ae,width:me}=E,Ee;for(let _e of[.25,.5,.75]){let Ke=m.ownerDocument.elementsFromPoint(Math.max(0,Math.min($+me*_e,_.width-1)),Math.max(0,Math.min(Q+ae/2,_.height-1)));for(let je of Ke){if(m.contains(je)||!hte(je)||je.closest('[class*="-leave"]')&&Ke.some(Pt=>je!==Pt&&tr(Pt,'[class*="-enter"]')))continue;let gt=Fe(je,"--uk-inverse");if(gt){if(gt===Ee)return`uk-${gt}`;Ee=gt;break}}}return Ee?`uk-${Ee}`:""}function hte(m){if(Fe(m,"visibility")!=="visible")return!1;for(;m;){if(Fe(m,"opacity")==="0")return!1;m=Vt(m)}return!0}var dte={mixins:[Ui,Pc],props:{fill:String},data:{fill:"",clsWrapper:"uk-leader-fill",clsHide:"uk-leader-hide",attrFill:"data-fill"},computed:{fill:({fill:m},E)=>m||Fe(E,"--uk-leader-fill-content")},connected(){[this.wrapper]=tm(this.$el,``)},disconnected(){No(this.wrapper.childNodes)},observe:ii(),update:{read(){return{width:Math.trunc(this.$el.offsetWidth/2),fill:this.fill,hide:!this.matchMedia}},write({width:m,fill:E,hide:_}){Je(this.wrapper,this.clsHide,_),et(this.wrapper,this.attrFill,new Array(m).join(E))},events:["resize"]}},vte={install:gte,mixins:[su],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(){ke(this.panel,"uk-margin-auto-vertical")?Ue(this.$el,"uk-flex"):Fe(this.$el,"display","block"),qi(this.$el)}},{name:"hidden",self:!0,handler(){Fe(this.$el,"display",""),ve(this.$el,"uk-flex")}}]};function gte({modal:m}){m.dialog=function(_,$){let Q=m(gr(`
      ${_}
      `),{stack:!0,role:"alertdialog",...$});return Q.show(),Qt(Q.$el,"hidden",async()=>{await Promise.resolve(),Q.$destroy(!0)},{self:!0}),Q},m.alert=function(_,$){return E(({i18n:Q})=>`
      ${R(_)?_:js(_)}
      `,$)},m.confirm=function(_,$){return E(({i18n:Q})=>`
      ${R(_)?_:js(_)}
      `,$,()=>Promise.reject())},m.prompt=function(_,$,Q){let ae=E(({i18n:_e})=>`
      `,Q,()=>null,()=>Ee.value),{$el:me}=ae.dialog,Ee=gr("input",me);return Ee.value=$||"",Qt(me,"show",()=>Ee.select()),ae},m.i18n={ok:"Ok",cancel:"Cancel"};function E(_,$,Q=He,ae=He){$={bgClose:!1,escClose:!0,...$,i18n:{...m.i18n,...$?.i18n}};let me=m.dialog(_($),$);return N(new Promise(Ee=>{let _e=Qt(me.$el,"hide",()=>Ee(Q()));Qt(me.$el,"submit","form",Ke=>{Ke.preventDefault(),Ee(ae(me)),_e(),me.hide()})}),{dialog:me})}}var xte={extends:Fv,data:{targets:"> .uk-parent",toggle:"> a",content:"> ul"}};let tE="uk-navbar-transparent";var yte={extends:Ix,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,E)=>E.closest(".uk-navbar-container")},watch:{items(){let m=ke(this.$el,"uk-navbar-justify"),E=un(".uk-navbar-nav, .uk-navbar-left, .uk-navbar-right",this.$el);for(let _ of E){let $=m?un(".uk-navbar-nav > li > a, .uk-navbar-item, .uk-navbar-toggle",_).length:"";Fe(_,"flexGrow",$)}}},events:[{name:"show",el:({dropContainer:m})=>m,handler({target:m}){this.getTransparentMode(m)==="remove"&&ke(this.navbarContainer,tE)&&(ve(this.navbarContainer,tE),this._transparent=!0)}},{name:"hide",el:({dropContainer:m})=>m,async handler(){await wte(),!this.getActive()&&this._transparent&&(Ue(this.navbarContainer,tE),this._transparent=null)}}],methods:{getTransparentMode(m){if(!this.navbarContainer)return;if(this.dropbar&&this.isDropbarDrop(m))return this.dropbarTransparentMode;let E=this.getDropdown(m);if(E&&ke(m,"uk-dropbar"))return E.inset?"behind":"remove"},getDropbarOffset(m){let{top:E,height:_}=xr(this.navbarContainer);return E+(this.dropbarTransparentMode==="behind"?0:_+m)}}};function wte(){return new Promise(m=>setTimeout(m))}var bte={mixins:[su],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:E})=>m?E:"",clsOverlay:({overlay:m,clsOverlay:E})=>m?E:"",clsMode:({mode:m,clsMode:E})=>`${E}-${m}`,clsSidebarAnimation:({mode:m,clsSidebarAnimation:E})=>m==="none"||m==="reveal"?"":E,clsContainerAnimation:({mode:m,clsContainerAnimation:E})=>m!=="push"&&m!=="reveal"?"":E,transitionElement({mode:m}){return m==="reveal"?Vt(this.panel):this.panel}},observe:pm({filter:({swiping:m})=>m}),update:{read(){this.isToggled()&&!tt(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"&&!ke(Vt(this.panel),this.clsMode)&&(em(this.panel,"
      "),Ue(Vt(this.panel),this.clsMode));let{body:m,scrollingElement:E}=document;Ue(m,this.clsContainer,this.clsFlip),Fe(m,"touch-action","pan-y pinch-zoom"),Fe(this.$el,"display","block"),Fe(this.panel,"maxWidth",E.clientWidth),Ue(this.$el,this.clsOverlay),Ue(this.panel,this.clsSidebarAnimation,this.mode==="reveal"?"":this.clsMode),qi(m),Ue(m,this.clsContainerAnimation),this.clsContainerAnimation&&Dte()}},{name:"hide",self:!0,handler(){ve(document.body,this.clsContainerAnimation),Fe(document.body,"touch-action","")}},{name:"hidden",self:!0,handler(){this.clsContainerAnimation&&Nte(),this.mode==="reveal"&&No(this.panel),ve(this.panel,this.clsSidebarAnimation,this.clsMode),ve(this.$el,this.clsOverlay),Fe(this.$el,"display",""),Fe(this.panel,"maxWidth",""),ve(document.body,this.clsContainer,this.clsFlip)}},{name:"swipeLeft swipeRight",handler(m){this.isToggled()&&s(m.type,"Left")^this.flip&&this.hide()}}]};function Dte(){lO().content+=",user-scalable=0"}function Nte(){let m=lO();m.content=m.content.replace(/,user-scalable=0$/,"")}function lO(){return gr('meta[name="viewport"]',document.head)||vn(document.head,'')}var Ete={mixins:[Ui],props:{selContainer:String,selContent:String,minHeight:Number},data:{selContainer:".uk-modal",selContent:".uk-modal-dialog",minHeight:150},computed:{container:({selContainer:m},E)=>E.closest(m),content:({selContent:m},E)=>E.closest(m)},observe:ii({target:({container:m,content:E})=>[m,E]}),update:{read(){return!this.content||!this.container||!tt(this.$el)?!1:{max:Math.max(this.minHeight,qi(this.container)-(Xt(this.content).height-qi(this.$el)))}},write({max:m}){Fe(this.$el,{minHeight:this.minHeight,maxHeight:m})},events:["resize"]}},Ste={props:["width","height"],connected(){Ue(this.$el,"uk-responsive-width"),Fe(this.$el,"aspectRatio",`${this.width}/${this.height}`)}},Ate={props:{offset:Number},data:{offset:0},connected(){Cte(this)},disconnected(){Mte(this)},methods:{async scrollTo(m){m=m&&gr(m)||document.body,Rt(this.$el,"beforescroll",[this,m])&&(await Kd(m,{offset:this.offset}),Rt(this.$el,"scrolled",[this,m]))}}};let Rv=new Set;function Cte(m){Rv.size||Qt(document,"click",fO),Rv.add(m)}function Mte(m){Rv.delete(m),Rv.size||Ri(document,"click",fO)}function fO(m){if(!m.defaultPrevented)for(let E of Rv)E.$el.contains(m.target)&&Aa(E.$el)&&(m.preventDefault(),window.location.href!==E.$el.href&&window.history.pushState({},"",E.$el.href),E.scrollTo(Ca(E.$el)))}let rE="uk-scrollspy-inview";var Tte={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},E)=>m?un(m,E):[E]},watch:{elements(m){this.hidden&&Fe(pi(m,`:not(.${rE})`),"opacity",0)}},connected(){this.elementData=new Map},disconnected(){for(let[m,E]of this.elementData.entries())ve(m,rE,E?.cls||"");delete this.elementData},observe:na({target:({elements:m})=>m,handler(m){let E=this.elementData;for(let{target:_,isIntersecting:$}of m){E.has(_)||E.set(_,{cls:fe(_,"uk-scrollspy-class")||this.cls});let Q=E.get(_);!this.repeat&&Q.show||(Q.show=$)}this.$emit()},options:({margin:m})=>({rootMargin:m}),args:{intersecting:!1}}),update:[{write(m){for(let[E,_]of this.elementData.entries())_.show&&!_.inview&&!_.queued?(_.queued=!0,m.promise=(m.promise||Promise.resolve()).then(()=>new Promise($=>setTimeout($,this.delay))).then(()=>{this.toggle(E,!0),setTimeout(()=>{_.queued=!1,this.$emit()},300)})):!_.show&&_.inview&&!_.queued&&this.repeat&&this.toggle(E,!1)}}],methods:{toggle(m,E){var _,$;let Q=(_=this.elementData)==null?void 0:_.get(m);if(!Q)return;($=Q.off)==null||$.call(Q),Fe(m,"opacity",!E&&this.hidden?0:""),Je(m,rE,E),Je(m,Q.cls);let ae;if(ae=Q.cls.match(/\buk-animation-[\w-]+/g)){let me=()=>ve(m,ae);E?Q.off=Tr(m,"animationcancel animationend",me,{self:!0}):me()}Rt(m,E?"inview":"outview"),Q.inview=E}}},Ote={props:{cls:String,closest:Boolean,scroll:Boolean,overflow:Boolean,offset:Number},data:{cls:"uk-active",closest:!1,scroll:!1,overflow:!0,offset:0},computed:{links:(m,E)=>un('a[href*="#"]',E).filter(_=>_.hash&&Aa(_)),elements({closest:m}){return this.links.map(E=>E.closest(m||"*"))}},watch:{links(m){this.scroll&&this.$create("scroll",m,{offset:this.offset})}},observe:[na(),Xl()],update:[{read(){let m=this.links.map(Ca).filter(Boolean),{length:E}=m;if(!E||!tt(this.$el))return!1;let _=ms(m,!0),{scrollTop:$,scrollHeight:Q}=_,ae=So(_),me=Q-ae.height,Ee=!1;if($===me)Ee=E-1;else{let _e=this.offset+xr(Zu()).height;for(let Ke=0;Ke0);Ke++)Ee=+Ke;Ee===!1&&this.overflow&&(Ee=0)}return{active:Ee}},write({active:m}){let E=m!==!1&&!ke(this.elements[m],this.cls);this.links.forEach(_=>_.blur());for(let _=0;_m&&gr(m,E)||E},connected(){this.start=cO(this.start||this.top),this.end=cO(this.end||this.bottom),this.placeholder=gr("+ .uk-sticky-placeholder",this.$el)||gr('
      '),this.isFixed=!1,this.setActive(!1)},beforeDisconnect(){this.isFixed&&(this.hide(),ve(this.target,this.clsInactive)),pO(this.$el),Do(this.placeholder),this.placeholder=null},observe:[Dc(),Xl({target:()=>document.scrollingElement}),ii({target:({$el:m})=>[m,Vt(m),document.scrollingElement],handler(m){this.$emit(this._data.resized&&m.some(({target:E})=>E===Vt(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 E=xr(gr(location.hash)),_=xr(this.$el);this.isFixed&&Se(E,_)&&(m.scrollTop=Math.ceil(E.top-_.height-jn(this.targetOffset,"height",this.placeholder)-jn(this.offset,"height",this.placeholder)))})}}],update:[{read({height:m,width:E,margin:_,sticky:$},Q){if(this.inactive=!this.matchMedia||!tt(this.$el),this.inactive)return;let ae=this.isFixed&&Q.has("update");ae&&(oE(this.target),this.hide()),this.active||({height:m,width:E}=xr(this.$el),_=Fe(this.$el,"margin")),ae&&this.show();let me=jn("100vh","height"),Ee=qi(window),_e=Math.max(0,document.scrollingElement.scrollHeight-me),Ke=this.position;this.overflowFlip&&m>me&&(Ke=Ke==="top"?"bottom":"top");let je=this.isFixed?this.placeholder:this.$el,gt=jn(this.offset,"height",$?this.$el:je);Ke==="bottom"&&(mxr(Pt).top+(_e?Math.min(Ee,me):Ee),offsetParentTop:xr(Pt.offsetParent).top,overflowScroll:Oe($+Oe(je,Q,ae)-Oe(m,Q,ae),0,_)}},write(m,E){let _=E.has("scroll"),{initTimestamp:$=0,dir:Q,prevDir:ae,scroll:me,prevScroll:Ee=0,top:_e,start:Ke,below:je}=m;if(me<0||me===Ee&&_||this.showOnUp&&!_&&!this.isFixed)return;let gt=Date.now();if((gt-$>300||Q!==ae)&&(m.initScroll=me,m.initTimestamp=gt),!(this.showOnUp&&!this.isFixed&&Math.abs(m.initScroll-me)<=30&&Math.abs(Ee-me)<=10))if(this.inactive||meme&&(cs.cancel(this.$el),this.hide());return}if(this.animation&&je){if(ke(this.$el,"uk-animation-leave"))return;cs.out(this.$el,this.animation).then(()=>this.hide(),He)}else this.hide()}else this.isFixed?this.update():this.animation&&je?(this.show(),cs.in(this.$el,this.animation).catch(He)):(oE(this.target),this.show())},events:["resize","resizeViewport","scroll"]}],methods:{show(){this.isFixed=!0,this.update(),this.placeholder.hidden=!1},hide(){let{offset:m,sticky:E}=this._data;this.setActive(!1),ve(this.$el,this.clsFixed,this.clsBelow),E?Fe(this.$el,"top",m):Fe(this.$el,{position:"",top:"",width:"",marginTop:""}),this.placeholder.hidden=!0,this.isFixed=!1},update(){let{width:m,scroll:E=0,overflow:_,overflowScroll:$=0,start:Q,end:ae,offset:me,offsetParentTop:Ee,sticky:_e,below:Ke}=this._data,je=Q!==0||E>Q;if(!_e){let gt="fixed";E>ae&&(me+=ae-Ee+$-_,gt="absolute"),Fe(this.$el,{position:gt,width:m,marginTop:0},"important")}Fe(this.$el,"top",me-$),this.setActive(je),Je(this.$el,this.clsBelow,Ke),Ue(this.$el,this.clsFixed)},setActive(m){let E=this.active;this.active=m,m?(Re(this.target,this.clsInactive,this.clsActive),E!==m&&Rt(this.$el,"active")):(Re(this.target,this.clsActive,this.clsInactive),E!==m&&(oE(this.target),Rt(this.$el,"inactive")))}}};function nE(m,E,_,$){if(!m)return 0;if(z(m)||R(m)&&m.match(/^-?\d/))return _+jn(m,"height",E,!0);{let Q=m===!0?Vt(E):Hn(m,E);return xr(Q).bottom-($&&Q?.contains(E)?ie(Fe(Q,"paddingBottom")):0)}}function cO(m){return m==="true"?!0:m==="false"?!1:m}function pO(m){Fe(m,{position:"",top:"",marginTop:"",width:""})}let iE="uk-transition-disable";function oE(m){ke(m,iE)||(Ue(m,iE),requestAnimationFrame(()=>ve(m,iE)))}let aE=".uk-disabled *, .uk-disabled, [disabled]";var mO={mixins:[au],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},E)=>Ko(m,E),observe:({connect:m})=>m},connectChildren(){return this.connects.map(m=>Er(m)).flat()},toggles:({toggle:m},E)=>un(m,E),children(m,E){return Er(E).filter(_=>this.toggles.some($=>_.contains($)))}},watch:{connects(m){this.swiping&&Fe(m,"touchAction","pan-y pinch-zoom"),this.$emit()},connectChildren(){let m=Math.max(0,this.index());for(let E of this.connects)Er(E).forEach((_,$)=>Je(_,this.cls,$===m));this.$emit()},toggles(m){this.$emit();let E=this.index();this.show(~E?E:m[this.active]||m[0])}},connected(){et(this.$el,"role","tablist")},observe:[Zl({targets:({connectChildren:m})=>m}),pm({target:({connects:m})=>m,filter:({swiping:m})=>m})],events:[{name:"click keydown",delegate:({toggle:m})=>m,handler(m){!tr(m.current,aE)&&(m.type==="click"||m.keyCode===Or.SPACE)&&(m.preventDefault(),this.show(m.current))}},{name:"keydown",delegate:({toggle:m})=>m,handler(m){let{current:E,keyCode:_}=m,$=tr(this.$el,this.selVertical),Q=_===Or.HOME?0:_===Or.END?"last":_===Or.LEFT&&!$||_===Or.UP&&$?"previous":_===Or.RIGHT&&!$||_===Or.DOWN&&$?"next":-1;if(~Q){m.preventDefault();let ae=this.toggles.filter(Ee=>!tr(Ee,aE)),me=ae[de(Q,ae,ae.indexOf(E))];me.focus(),this.followFocus&&this.show(me)}}},{name:"click",el:({$el:m,connects:E,itemNav:_})=>E.concat(_?Ko(_,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 E of this.connects)jr(E,"ul")&&et(E,"role","presentation");et(Er(this.$el),"role","presentation");for(let E in this.toggles){let _=this.toggles[E],$=(m=this.connects[0])==null?void 0:m.children[E];et(_,"role","tab"),$&&(_.id=ol(this,_),$.id=ol(this,$),et(_,"aria-controls",$.id),et($,{role:"tabpanel","aria-labelledby":_.id}))}et(this.$el,"aria-orientation",tr(this.$el,this.selVertical)?"vertical":null)},methods:{index(){return p(this.children,m=>ke(m,this.cls))},show(m){let E=this.toggles.filter(me=>!tr(me,aE)),_=this.index(),$=de(!I(m)||f(E,m)?m:0,E,de(this.toggles[_],E)),Q=de(E[$],this.toggles);this.children.forEach((me,Ee)=>{Je(me,this.cls,Q===Ee),et(this.toggles[Ee],{"aria-selected":Q===Ee,tabindex:Q===Ee?null:-1})});let ae=_>=0&&_!==$;this.connects.forEach(async({children:me})=>{let Ee=y(me).filter((_e,Ke)=>Ke!==Q&&ke(_e,this.cls));await this.toggleElement(Ee,!1,ae)&&await this.toggleElement(me[Q],!0,ae)})}}},Fte={mixins:[Ui],extends:mO,props:{media:Boolean},data:{media:960,attrItem:"uk-tab-item",selVertical:".uk-tab-left,.uk-tab-right"},connected(){let m=ke(this.$el,"uk-tab-left")?"uk-tab-left":ke(this.$el,"uk-tab-right")?"uk-tab-right":!1;m&&this.$create("toggle",this.$el,{cls:m,mode:"media",media:this.media})}};let _te=32;var kte={mixins:[Pc,au],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},E)=>(m=Ko(m||E.hash,E),m.length?m:[E]),observe:({target:m})=>m}},connected(){f(this.mode,"media")||(Gr(this.$el)||et(this.$el,"tabindex","0"),!this.cls&&jr(this.$el,"a")&&et(this.$el,"role","button"))},observe:Zl({targets:({target:m})=>m}),events:[{name:we,filter:({mode:m})=>f(m,"hover"),handler(m){this._preventClick=null,!(!at(m)||P(this._showState)||this.$el.disabled)&&(Rt(this.$el,"focus"),Tr(document,we,()=>Rt(this.$el,"blur"),!0,E=>!this.$el.contains(E.target)),f(this.mode,"click")&&(this._preventClick=!0))}},{name:`mouseenter mouseleave ${it} ${Xe} focus blur`,filter:({mode:m})=>f(m,"hover"),handler(m){if(at(m)||this.$el.disabled)return;let E=f(["mouseenter",it,"focus"],m.type),_=this.isToggled(this.target);if(!E&&(!P(this._showState)||m.type!=="blur"&&tr(this.$el,":focus")||m.type==="blur"&&tr(this.$el,":hover"))){_===this._showState&&(this._showState=null);return}E&&P(this._showState)&&_!==this._showState||(this._showState=E?_:null,this.toggle(`toggle${E?"show":"hide"}`))}},{name:"keydown",filter:({$el:m,mode:E})=>f(E,"click")&&!jr(m,"input"),handler(m){m.keyCode===_te&&(m.preventDefault(),this.$el.click())}},{name:"click",filter:({mode:m})=>["click","hover"].some(E=>f(m,E)),handler(m){let E;(this._preventClick||m.target.closest('a[href="#"], a[href=""]')||(E=m.target.closest("a[href]"))&&(!this.isToggled(this.target)||E.hash&&tr(this.target,E.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,E){E.matches^this.isToggled(this.target)&&this.toggle()}}],methods:{async toggle(m){if(!Rt(this.target,m||"toggle",[this]))return;if(ut(this.$el,"aria-expanded")&&et(this.$el,"aria-expanded",!this.isToggled(this.target)),!this.queued)return this.toggleElement(this.target);let E=this.target.filter($=>ke($,this.clsLeave));if(E.length){for(let $ of this.target){let Q=f(E,$);this.toggleElement($,Q,Q)}return}let _=this.target.filter(this.isToggled);await this.toggleElement(_,!1)&&await this.toggleElement(this.target.filter($=>!f(_,$)),!0)}}},Bte=Object.freeze({__proto__:null,Accordion:Fv,Alert:WN,Close:Bn,Cover:Ax,Drop:Cx,DropParentIcon:Ut,Dropdown:Cx,Dropnav:Ix,FormCustom:Yc,Grid:aa,HeightMatch:kv,HeightPlaceholder:Bv,HeightViewport:Bx,Icon:Gt,Img:_a,Inverse:Pv,Leader:dte,Margin:ds,Marker:Zi,Modal:vte,Nav:xte,NavParentIcon:dr,Navbar:yte,NavbarParentIcon:Ut,NavbarToggleIcon:Yi,Offcanvas:bte,OverflowAuto:Ete,OverlayIcon:Ut,PaginationNext:Vn,PaginationPrevious:Ln,Responsive:Ste,Scroll:Ate,Scrollspy:Tte,ScrollspyNav:Ote,SearchIcon:Yr,SlidenavNext:Gi,SlidenavPrevious:Gi,Spinner:ti,Sticky:Ite,Svg:Ze,Switcher:mO,Tab:Fte,Toggle:kte,Totop:si,Video:Sx});return ye(Bte,(m,E)=>Wi.component(E,m)),Dx(Wi),ye(zN,(m,E)=>Wi.component(E,m)),Wi})});var by=dt((JE,QE)=>{v();x();g();(function(e,t){typeof JE=="object"&&typeof QE<"u"?QE.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e["'typed'"]=t())})(JE,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 pe=s.get(ne);if(pe)return pe;let we='Unknown type "'+ne+'"',Le=ne.toLowerCase(),Qe;for(Qe of f)if(Qe.toLowerCase()===Le){we+='. Did you mean "'+Qe+'" ?';break}throw new TypeError(we)}function N(ne){let pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any",we=pe?y(pe).index:f.length,Le=[];for(let it=0;it{let Le=s.get(we);return!Le.isAny&&Le.test(ne)});return pe.length?pe:["any"]}function O(ne){return ne&&typeof ne=="function"&&"_typedFunctionData"in ne}function M(ne,pe,we){if(!O(ne))throw new TypeError(n);let Le=we&&we.exact,Qe=Array.isArray(pe)?pe.join(","):pe,it=z(Qe),Xe=C(it);if(!Le||Xe in ne.signatures){let Ye=ne._typedFunctionData.signatureMap.get(Xe);if(Ye)return Ye}let pt=it.length,Z;if(Le){Z=[];let Ye;for(Ye in ne.signatures)Z.push(ne._typedFunctionData.signatureMap.get(Ye))}else Z=ne._typedFunctionData.signatures;for(let Ye=0;Ye!Gr.has(Vt.name)))continue}wt.push(kt)}}if(Z=wt,Z.length===0)break}let xe;for(xe of Z)if(xe.params.length<=pt)return xe;throw new TypeError("Signature not found (signature: "+(ne.name||"unnamed")+"("+C(it,", ")+"))")}function I(ne,pe,we){return M(ne,pe,we).implementation}function F(ne,pe){let we=y(pe);if(we.test(ne))return ne;let Le=we.conversionsTo;if(Le.length===0)throw new Error("There are no conversions to "+pe+" defined.");for(let Qe=0;Qe1&&arguments[1]!==void 0?arguments[1]:",";return ne.map(we=>we.name).join(pe)}function P(ne){let pe=ne.indexOf("...")===0,Le=(pe?ne.length>3?ne.slice(3):"any":ne).split("|").map(pt=>y(pt.trim())),Qe=!1,it=pe?"...":"";return{types:Le.map(function(pt){return Qe=pt.isAny||Qe,it+=pt.name+"|",{name:pt.name,typeIndex:pt.index,test:pt.test,isAny:pt.isAny,conversion:null,conversionIndex:-1}}),name:it.slice(0,-1),hasAny:Qe,hasConversion:!1,restParam:pe}}function R(ne){let pe=ne.types.map(Xe=>Xe.name),we=ce(pe),Le=ne.hasAny,Qe=ne.name,it=we.map(function(Xe){let pt=y(Xe.from);return Le=pt.isAny||Le,Qe+="|"+Xe.from,{name:Xe.from,typeIndex:pt.index,test:pt.test,isAny:pt.isAny,conversion:Xe,conversionIndex:Xe.index}});return{types:ne.types.concat(it),name:Qe,hasAny:Le,hasConversion:it.length>0,restParam:ne.restParam}}function q(ne){return ne.typeSet||(ne.typeSet=new Set,ne.types.forEach(pe=>ne.typeSet.add(pe.name))),ne.typeSet}function z(ne){let pe=[];if(typeof ne!="string")throw new TypeError("Signatures must be strings");let we=ne.trim();if(we==="")return pe;let Le=we.split(",");for(let Qe=0;Qe=Qe+1}}else return ne.length===0?function(it){return it.length===0}:ne.length===1?(we=V(ne[0]),function(it){return we(it[0])&&it.length===1}):ne.length===2?(we=V(ne[0]),Le=V(ne[1]),function(it){return we(it[0])&&Le(it[1])&&it.length===2}):(pe=ne.map(V),function(it){for(let Xe=0;Xe{let Qe=ie(Le.params,pe),it;for(it of Qe)we.add(it)}),we.has("any")?["any"]:Array.from(we)}function le(ne,pe,we){let Le,Qe,it=ne||"unnamed",Xe=we,pt;for(pt=0;pt{let kt=ee(wt.params,pt),ur=V(kt);(pt0){let wt=b(pe[pt]);return Le=new TypeError("Unexpected type of argument in function "+it+" (expected: "+Qe.join(" or ")+", actual: "+wt.join(" | ")+", index: "+pt+")"),Le.data={category:"wrongType",fn:it,index:pt,actual:wt,expected:Qe},Le}}else Xe=tt}let Z=Xe.map(function(tt){return H(tt.params)?1/0:tt.params.length});if(pe.lengthxe)return Le=new TypeError("Too many arguments in function "+it+" (expected: "+xe+", actual: "+pe.length+")"),Le.data={category:"tooManyArgs",fn:it,index:pe.length,expectedLength:xe},Le;let Ye=[];for(let tt=0;tt0)return 1;let Le=he(ne)-he(pe);return Le<0?-1:Le>0?1:0}function ye(ne,pe){let we=ne.params,Le=pe.params,Qe=de(we),it=de(Le),Xe=H(we),pt=H(Le);if(Xe&&Qe.hasAny){if(!pt||!it.hasAny)return 1}else if(pt&&it.hasAny)return-1;let Z=0,xe=0,Ye;for(Ye of we)Ye.hasAny&&++Z,Ye.hasConversion&&++xe;let tt=0,wt=0;for(Ye of Le)Ye.hasAny&&++tt,Ye.hasConversion&&++wt;if(Z!==tt)return Z-tt;if(Xe&&Qe.hasConversion){if(!pt||!it.hasConversion)return 1}else if(pt&&it.hasConversion)return-1;if(xe!==wt)return xe-wt;if(Xe){if(!pt)return 1}else if(pt)return-1;let kt=(we.length-Le.length)*(Xe?-1:1);if(kt!==0)return kt;let ur=[],Gr=0;for(let pi=0;pi1&&pe.sort((Qe,it)=>Qe.index-it.index);let we=pe[0].conversionsTo;if(ne.length===1)return we;we=we.concat([]);let Le=new Set(ne);for(let Qe=1;QeQe.hasConversion)){let Qe=H(ne),it=ne.map(Pe);we=function(){let pt=[],Z=Qe?arguments.length-1:arguments.length;for(let xe=0;xeZ.name).join("|"),hasAny:pt.some(Z=>Z.isAny),hasConversion:!1,restParam:!0}),Xe.push(it)}else Xe=it.types.map(function(pt){return{types:[pt],name:pt.name,hasAny:pt.isAny,hasConversion:pt.conversion,restParam:!1}});return ve(Xe,function(pt){return pe(we,Le+1,Qe.concat([pt]))})}else return[Qe]}return pe(ne,0,[])}function Oe(ne,pe){let we=Math.max(ne.length,pe.length);for(let pt=0;pt=Le:Xe?Le>=Qe:Le===Qe}function He(ne){return ne.map(pe=>et(pe)?Je(pe.referToSelf.callback):ot(pe)?ke(pe.referTo.references,pe.referTo.callback):pe)}function Se(ne,pe,we){let Le=[],Qe;for(Qe of ne){let it=we[Qe];if(typeof it!="number")throw new TypeError('No definition for referenced signature "'+Qe+'"');if(it=pe[it],typeof it!="function")return!1;Le.push(it)}return Le}function ze(ne,pe,we){let Le=He(ne),Qe=new Array(Le.length).fill(!1),it=!0;for(;it;){it=!1;let Xe=!0;for(let pt=0;pt{let Le=ne[we];if(pe.test(Le.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 Be(ne,pe){if(h.createCount++,Object.keys(pe).length===0)throw new SyntaxError("No signatures provided");h.warnAgainstDeprecatedThis&&We(pe);let we=[],Le=[],Qe={},it=[],Xe;for(Xe in pe){if(!Object.prototype.hasOwnProperty.call(pe,Xe))continue;let ue=z(Xe);if(!ue)continue;we.forEach(function(nt){if(Oe(nt,ue))throw new TypeError('Conflicting signatures "'+C(nt)+'" and "'+C(ue)+'".')}),we.push(ue);let Me=Le.length;Le.push(pe[Xe]);let at=ue.map(R),ht;for(ht of Ce(at)){let nt=C(ht);it.push({params:ht,name:nt,fn:Me}),ht.every(Fe=>!Fe.hasConversion)&&(Qe[nt]=Me)}}it.sort(ye);let pt=ze(Le,Qe,$n),Z;for(Z in Qe)Object.prototype.hasOwnProperty.call(Qe,Z)&&(Qe[Z]=pt[Qe[Z]]);let xe=[],Ye=new Map;for(Z of it)Ye.has(Z.name)||(Z.fn=pt[Z.fn],xe.push(Z),Ye.set(Z.name,Z));let tt=xe[0]&&xe[0].params.length<=2&&!H(xe[0].params),wt=xe[1]&&xe[1].params.length<=2&&!H(xe[1].params),kt=xe[2]&&xe[2].params.length<=2&&!H(xe[2].params),ur=xe[3]&&xe[3].params.length<=2&&!H(xe[3].params),Gr=xe[4]&&xe[4].params.length<=2&&!H(xe[4].params),Vt=xe[5]&&xe[5].params.length<=2&&!H(xe[5].params),pi=tt&&wt&&kt&&ur&&Gr&&Vt;for(let ue=0;ueue.test),jo=xe.map(ue=>ue.implementation),Hu=function(){for(let Me=oo;MeC(z(we))),pe=de(arguments);if(typeof pe!="function")throw new TypeError("Callback function expected as last argument");return ke(ne,pe)}function ke(ne,pe){return{referTo:{references:ne,callback:pe}}}function Je(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 et(ne){return ne&&typeof ne.referToSelf=="object"&&typeof ne.referToSelf.callback=="function"}function ut(ne,pe){if(!ne)return pe;if(pe&&pe!==ne){let we=new Error("Function names do not match (expected: "+ne+", actual: "+pe+")");throw we.data={actual:pe,expected:ne},we}return ne}function Lt(ne){let pe;for(let we in ne)Object.prototype.hasOwnProperty.call(ne,we)&&(O(ne[we])||typeof ne[we].signature=="string")&&(pe=ut(pe,ne[we].name));return pe}function fe(ne,pe){let we;for(we in pe)if(Object.prototype.hasOwnProperty.call(pe,we)){if(we in ne&&pe[we]!==ne[we]){let Le=new Error('Signature "'+we+'" is defined twice');throw Le.data={signature:we,sourceFunction:pe[we],destFunction:ne[we]},Le}ne[we]=pe[we]}}let J=h;h=function(ne){let pe=typeof ne=="string",we=pe?1:0,Le=pe?ne:"",Qe={};for(let it=we;itQe.from===ne.from);if(!we)throw new Error("Attempt to remove nonexistent conversion from "+ne.from+" to "+ne.to);if(we.convert!==ne.convert)throw new Error("Conversion to remove does not match existing conversion");let Le=pe.conversionsTo.indexOf(we);pe.conversionsTo.splice(Le,1)},h.resolve=function(ne,pe){if(!O(ne))throw new TypeError(n);let we=ne._typedFunctionData.signatures;for(let Le=0;Le{v();x();g();(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,N,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,N=h*h+f*f,w=N!==0?new a((y*h-f*f)/N,(f*h+y*f)/N):new a(s!==-1?s/0:0,f!==0?f/0:0),D=w.re;return w.re=u(w.re,w.im)/2,w.im=Math.atan2(w.im,D)/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){v();x();g();(function(e){"use strict";var t=2e3,r={s:1,n:0,d:1};function n(w,D){if(isNaN(w=parseInt(w,10)))throw y();return w*D}function i(w,D){if(D===0)throw h();var b=Object.create(p.prototype);b.s=w<0?-1:1,w=w<0?-w:w;var O=f(w,D);return b.n=w/O,b.d=D/O,b}function o(w){for(var D={},b=w,O=2,M=4;M<=b;){for(;b%O===0;)b/=O,D[O]=(D[O]||0)+1;M+=1+2*O++}return b!==w?b>1&&(D[b]=(D[b]||0)+1):D[w]=(D[w]||0)+1,D}var u=function(w,D){var b=0,O=1,M=1,I=0,F=0,C=0,P=1,R=1,q=0,z=1,H=1,V=1,W=1e7,ee;if(w!=null)if(D!==void 0){if(b=w,O=D,M=b*O,b%1!==0||O%1!==0)throw N()}else switch(typeof w){case"object":{if("d"in w&&"n"in w)b=w.n,O=w.d,"s"in w&&(b*=w.s);else if(0 in w)b=w[0],1 in w&&(O=w[1]);else throw y();M=b*O;break}case"number":{if(w<0&&(M=w,w=-w),w%1===0)b=w;else if(w>0){for(w>=1&&(R=Math.pow(10,Math.floor(1+Math.log(w)/Math.LN10)),w/=R);z<=W&&V<=W;)if(ee=(q+H)/(z+V),w===ee){z+V<=W?(b=q+H,O=z+V):V>z?(b=H,O=V):(b=q,O=z);break}else w>ee?(q+=H,z+=V):(H+=q,V+=z),z>W?(b=H,O=V):(b=q,O=z);b*=R}else(isNaN(w)||isNaN(D))&&(O=b=NaN);break}case"string":{if(z=w.match(/\d+|./g),z===null)throw y();if(z[q]==="-"?(M=-1,q++):z[q]==="+"&&q++,z.length===q+1?F=n(z[q++],M):z[q+1]==="."||z[q]==="."?(z[q]!=="."&&(I=n(z[q++],M)),q++,(q+1===z.length||z[q+1]==="("&&z[q+3]===")"||z[q+1]==="'"&&z[q+3]==="'")&&(F=n(z[q],M),P=Math.pow(10,z[q].length),q++),(z[q]==="("&&z[q+2]===")"||z[q]==="'"&&z[q+2]==="'")&&(C=n(z[q+1],M),R=Math.pow(10,z[q+1].length)-1,q+=3)):z[q+1]==="/"||z[q+1]===":"?(F=n(z[q],M),P=n(z[q+2],1),q+=3):z[q+3]==="/"&&z[q+1]===" "&&(I=n(z[q],M),F=n(z[q+2],M),P=n(z[q+4],1),q+=5),z.length<=q){O=P*R,M=b=C+O*I+R*F;break}}default:throw y()}if(O===0)throw h();r.s=M<0?-1:1,r.n=Math.abs(b),r.d=Math.abs(O)};function l(w,D,b){for(var O=1;D>0;w=w*w%b,D>>=1)D&1&&(O=O*w%b);return O}function a(w,D){for(;D%2===0;D/=2);for(;D%5===0;D/=5);if(D===1)return 0;for(var b=10%D,O=1;b!==1;O++)if(b=b*10%D,O>t)return 0;return O}function s(w,D,b){for(var O=1,M=l(10,b,D),I=0;I<300;I++){if(O===M)return I;O=O*10%D,M=M*10%D}return 0}function f(w,D){if(!w)return D;if(!D)return w;for(;;){if(w%=D,!w)return D;if(D%=w,!D)return w}}function p(w,D){if(u(w,D),this instanceof p)w=f(r.d,r.n),this.s=r.s,this.n=r.n/w,this.d=r.d/w;else return i(r.s*r.n,r.d)}var h=function(){return new Error("Division by Zero")},y=function(){return new Error("Invalid argument")},N=function(){return new Error("Parameters must be integer")};p.prototype={s:1,n:0,d:1,abs:function(){return i(this.n,this.d)},neg:function(){return i(-this.s*this.n,this.d)},add:function(w,D){return u(w,D),i(this.s*this.n*r.d+r.s*this.d*r.n,this.d*r.d)},sub:function(w,D){return u(w,D),i(this.s*this.n*r.d-r.s*this.d*r.n,this.d*r.d)},mul:function(w,D){return u(w,D),i(this.s*r.s*this.n*r.n,this.d*r.d)},div:function(w,D){return u(w,D),i(this.s*r.s*this.n*r.d,this.d*r.n)},clone:function(){return i(this.s*this.n,this.d)},mod:function(w,D){if(isNaN(this.n)||isNaN(this.d))return new p(NaN);if(w===void 0)return i(this.s*this.n%this.d,1);if(u(w,D),r.n===0&&this.d===0)throw h();return i(this.s*(r.d*this.n)%(r.n*this.d),r.d*this.d)},gcd:function(w,D){return u(w,D),i(f(r.n,this.n)*f(r.d,this.d),r.d*this.d)},lcm:function(w,D){return u(w,D),r.n===0&&this.n===0?i(0,1):i(r.n*this.n,f(r.n,this.n)*f(r.d,this.d))},ceil:function(w){return w=Math.pow(10,w||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):i(Math.ceil(w*this.s*this.n/this.d),w)},floor:function(w){return w=Math.pow(10,w||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):i(Math.floor(w*this.s*this.n/this.d),w)},round:function(w){return w=Math.pow(10,w||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):i(Math.round(w*this.s*this.n/this.d),w)},inverse:function(){return i(this.s*this.d,this.n)},pow:function(w,D){if(u(w,D),r.d===1)return r.s<0?i(Math.pow(this.s*this.d,r.n),Math.pow(this.n,r.n)):i(Math.pow(this.s*this.n,r.n),Math.pow(this.d,r.n));if(this.s<0)return null;var b=o(this.n),O=o(this.d),M=1,I=1;for(var F in b)if(F!=="1"){if(F==="0"){M=0;break}if(b[F]*=r.n,b[F]%r.d===0)b[F]/=r.d;else return null;M*=Math.pow(F,b[F])}for(var F in O)if(F!=="1"){if(O[F]*=r.n,O[F]%r.d===0)O[F]/=r.d;else return null;I*=Math.pow(F,O[F])}return r.s<0?i(I,M):i(M,I)},equals:function(w,D){return u(w,D),this.s*this.n*r.d===r.s*r.n*this.d},compare:function(w,D){u(w,D);var b=this.s*this.n*r.d-r.s*r.n*this.d;return(0=0;I--)M=M.inverse().add(b[I]);if(Math.abs(M.sub(D).valueOf())0&&(b+=D,b+=" ",O%=M),b+=O,b+="/",b+=M),b},toLatex:function(w){var D,b="",O=this.n,M=this.d;return this.s<0&&(b+="-"),M===1?b+=O:(w&&(D=Math.floor(O/M))>0&&(b+=D,O%=M),b+="\\frac{",b+=O,b+="}{",b+=M,b+="}"),b},toContinued:function(){var w,D=this.n,b=this.d,O=[];if(isNaN(D)||isNaN(b))return O;do O.push(Math.floor(D/b)),w=D%b,D=b,b=w;while(D!==1);return O},toString:function(w){var D=this.n,b=this.d;if(isNaN(D)||isNaN(b))return"NaN";w=w||15;var O=a(D,b),M=s(D,b,O),I=this.s<0?"-":"";if(I+=D/b|0,D%=b,D*=10,D&&(I+="."),O){for(var F=M;F--;)I+=D/b|0,D%=b,D*=10;I+="(";for(var F=O;F--;)I+=D/b|0,D%=b,D*=10;I+=")"}else for(var F=w;D&&F--;)I+=D/b|0,D%=b,D*=10;return I}},typeof bS=="object"?(Object.defineProperty(p,"__esModule",{value:!0}),p.default=p,p.Fraction=p,UF.exports=p):e.Fraction=p})(bS)});var iB=dt(($Ve,nB)=>{v();x();g();nB.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),N=parseInt(f.match(u),16)||y&&f.match(o)&&Date.parse(f)||null,w,D;if(N){if(yN)return 1}for(var b=0,O=Math.max(p.length,h.length);bD)return 1}return 0}});var w6=dt((Ntt,y6)=>{"use strict";v();x();g();var MA=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?afe:i,u=String(e),l="",a=o(MA({},ife),n?MA({},ofe):{}),s=Object.keys(a),f=function(){var h=!1;s.forEach(function(y,N){h||u.length>=y.length&&u.slice(0,y.length)===y&&(l+=a[s[N]],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 $q=dt((Hq,LA)=>{v();x();g();(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})(Hq,typeof LA=="object"&&LA,typeof define=="function"&&define)});var Vq=dt((Wq,PA)=>{v();x();g();(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})(Wq,typeof PA=="object"&&PA,typeof define=="function"&&define)});var Yq=dt((Gq,RA)=>{v();x();g();(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})(Gq,typeof RA=="object"&&RA,typeof define=="function"&&define)});var Xq=dt((Zq,qA)=>{v();x();g();(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})(Zq,typeof qA=="object"&&qA,typeof define=="function"&&define)});var Jq=dt((Kq,zA)=>{v();x();g();(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,N,w,D=[],b=128;for(f===(f|0)?(h=f,f=null):(f=f+"\0",h=0,b=Math.max(b,f.length)),y=0,N=-32;N>>15,h^=h<<4,h^=h>>>13,N>=0&&(w=w+1640531527|0,p=D[N&127]^=h+w,y=p==0?y+1:0);for(y>=128&&(D[(f&&f.length||0)&127]=-1),y=127,N=4*128;N>0;--N)h=D[y+34&127],p=D[y=y+1&127],h^=h<<13,p^=p<<17,h^=h>>>15,p^=p>>>12,D[y]=h^p;s.w=w,s.X=D,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})(Kq,typeof zA=="object"&&zA,typeof define=="function"&&define)});var jq=dt((Qq,UA)=>{v();x();g();(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})(Qq,typeof UA=="object"&&UA,typeof define=="function"&&define)});var ez={};Ba(ez,{default:()=>Nce});var Nce,tz=Te(()=>{v();x();g();Nce={}});var nz=dt((rz,Yw)=>{v();x();g();(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=D(w(I.entropy?[M,O(t)]:M??b(),3),C),R=new y(C),q=function(){for(var z=R.g(i),H=l,V=0;z=s;)z/=2,H/=2,V>>>=1;return(z+V)/H};return q.int32=function(){return R.g(4)|0},q.quick=function(){return R.g(4)/4294967296},q.double=q,D(O(R.S),t),(I.pass||F||function(z,H,V,W){return W&&(W.S&&N(W,R),z.state=function(){return N(R,{})}),V?(r[u]=z,H):z})(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{v();x();g();var Ece=$q(),Sce=Vq(),Ace=Yq(),Cce=Xq(),Mce=Jq(),Tce=jq(),hp=nz();hp.alea=Ece;hp.xor128=Sce;hp.xorwow=Ace;hp.xorshift7=Cce;hp.xor4096=Mce;hp.tychei=Tce;iz.exports=hp});var _H=dt((gRt,ZA)=>{v();x();g();function YA(){}YA.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{v();x();g();(function(e,t){typeof XA=="object"?RH.exports=t():typeof define=="function"&&define.amd?define(t):e.jStat=t()})(XA,function(){var e=function(t,r){var n=Array.prototype.concat,i=Array.prototype.slice,o=Object.prototype.toString;function u(D,b){var O=D>b?D:b;return t.pow(10,17-~~(t.log(O>0?O:-O)*t.LOG10E))}var l=Array.isArray||function(b){return o.call(b)==="[object Array]"};function a(D){return o.call(D)==="[object Function]"}function s(D){return typeof D=="number"?D-D===0:!1}function f(D){return n.apply([],D)}function p(){return new p._init(arguments)}p.fn=p.prototype,p._init=function(b){if(l(b[0]))if(l(b[0][0])){a(b[1])&&(b[0]=p.map(b[0],b[1]));for(var O=0;O=0;O--,I++)M[I]=[b[I][O]];return M},p.transpose=function(b){var O=[],M,I,F,C,P;for(l(b[0])||(b=[b]),I=b.length,F=b[0].length,P=0;P0&&(P[I][0]=b[I][0]),R=1;RO&&M>0)return[];if(M>0)for(F=b;FO;F+=M)I.push(F);return I},p.slice=function(){function D(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 b(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||{},D(C,I.start,I.end,I.step)}if(s(M.col)){var P=p.cola(O,M.col);return F=M.row||{},D(P,F.start,F.end,F.step)}F=M.row||{},I=M.col||{};var R=D(O,F.start,F.end,F.step);return R.map(function(q){return D(q,I.start,I.end,I.step)})}return b}(),p.sliceAssign=function(b,O,M){var I,F;if(s(O.row)){if(s(O.col))return b[O.row][O.col]=M;O.col=O.col||{},O.col.start=O.col.start||0,O.col.end=O.col.end||b[0].length,O.col.step=O.col.step||1,I=p.arange(O.col.start,t.min(b.length,O.col.end),O.col.step);var C=O.row;return I.forEach(function(R,q){b[C][R]=M[q]}),b}if(s(O.col)){O.row=O.row||{},O.row.start=O.row.start||0,O.row.end=O.row.end||b.length,O.row.step=O.row.step||1,F=p.arange(O.row.start,t.min(b[0].length,O.row.end),O.row.step);var P=O.col;return F.forEach(function(R,q){b[R][P]=M[q]}),b}return M[0].length===r&&(M=[M]),O.row.start=O.row.start||0,O.row.end=O.row.end||b.length,O.row.step=O.row.step||1,O.col.start=O.col.start||0,O.col.end=O.col.end||b[0].length,O.col.step=O.col.step||1,F=p.arange(O.row.start,t.min(b.length,O.row.end),O.row.step),I=p.arange(O.col.start,t.min(b[0].length,O.col.end),O.col.step),F.forEach(function(R,q){I.forEach(function(z,H){b[R][z]=M[q][H]})}),b},p.diagonal=function(b){var O=p.zeros(b.length,b.length);return b.forEach(function(M,I){O[I][I]=M}),O},p.copy=function(b){return b.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(b,O){return p(p.map(this,b,O))},w.cumreduce=function(b,O){return p(p.cumreduce(this,b,O))},w.alter=function(b){return p.alter(this,b),this},function(D){for(var b=0;b=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?(N=[f[w]],h=p,y=0):p===h&&(N.push(f[w]),y++),p=1);return y===0?N[0]:N},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],N=a.length,w,D,b,O,M,I;for(typeof f>"u"&&(f=3/8),typeof p>"u"&&(p=3/8),w=0;w1){for(N=f===!0?this:this.transpose();y1){for(s!=="sumrow"&&(N=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,N,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(N=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,Np)for(h=0;h=1?i:1/i)*8.5+i*.4+17),D;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,N,w,D,b;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),D=r.exp(l*(w-1)-s),N=i<.5?i:1-i,h=r.sqrt(-2*r.log(N)),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=D*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,N,w,D,b,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,N=r.sqrt(-2*r.log(y)),b=(2.30753+N*.27061)/(1+N*(.99229+N*.04481))-N,i<.5&&(b=-b),O=(b*b-3)/6,M=2/(1/(2*o-1)+1/(2*u-1)),I=b*r.sqrt(O+M)/M-(1/(2*u-1)-1/(2*o-1))*(O+5/6-2/(3*M)),b=o/(o+u*r.exp(2*I))):(p=r.log(o/(o+u)),h=r.log(u/(o+u)),N=r.exp(o*p)/o,w=r.exp(u*h)/u,I=N+w,i=1&&(b=.5*(b+N+1)),r.abs(N)0)break}return b},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;)D=w,O>0&&(M*=f*f/(2*O),I*=f*f/(2*(O+1/2))),w=M*t.beta.cdf(b,O+.5,s/2)+I*t.beta.cdf(b,O+1,s/2),N+=.5*w,O++;return y?1-N:N}}),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;)D=y,b=-(a+w)*(a+s+w)*l/(a+2*w)/(a+2*w+1),p=y+b*p,h=N+b*h,w=w+1,b=w*(s-w)*l/(a+2*w-1)/(a+2*w),y=p+b*y,N=h+b*N,p=p/N,h=h/N,y=y/N,N=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,N=a+1,w=s-a,D=N+w,b=r.exp(t.gammaln(D)-t.gammaln(w)-t.gammaln(N)+N*r.log(y)+w*r.log(1-y));return y<(N+1)/(D+2)?p=b*n(y,N,w,h):p=1-b*n(1-y,w,N,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&&Np);return f-1},sampleLarge:function(a){var s=a,f,p,h,y,N,w,D,b,O,M;for(y=r.sqrt(s),N=r.log(s),D=.931+2.53*y,w=-.059+.02483*D,b=1.1239+1.1328/(D-3.4),O=.9277-3.6224/(D-2);;){if(p=r.random()-.5,h=r.random(),M=.5-r.abs(p),f=r.floor((2*w/M+D)*p+s+.43),M>=.07&&h<=O)return f;if(!(f<0||M<.013&&h>M)&&r.log(h)+r.log(b)-r.log(w/(M*M)+D)<=-s+f*N-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>D?P=b:P=O;for(var R=F,q=(w-F)/P,z=R+q,H=0,V=s-1,W=1;W<=P;W++){for(var ee=0,ie=.5*(z+R),X=.5*(z-R),Y=1;Y<=f;Y++){var le,re;pN)break;var ce=2*t.normal.cdf(De,0,1,1,0),Ne=2*t.normal.cdf(De,l,1,1,0),Pe=ce*.5-Ne*.5;Pe>=r.exp(h/V)&&(Pe=I[le-1]*r.exp(-(.5*ye))*r.pow(Pe,V),ee+=Pe)}ee*=2*X*s/r.sqrt(2*r.PI),H+=ee,R=z,z+=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,N=-.342242088547,w=.531103462366,D=-.204231210125,b=.10353775285,O=-453642210148e-16,M=.0038560700634,I=.8832,F=.2368,C=1.214,P=1.208,R=1.4142,q=120,z=.5-.5*l,H=r.sqrt(r.log(1/(z*z))),V=H+((((H*O+D)*H+N)*H+h)*H+f)/((((H*M+b)*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<=b?ie=F:f<=O?ie=C:f<=M?ie=P:ie=R,V+=r.log(ie);for(var X=0,Y=1;Y<=50;Y++){for(var le=0,re=(2*Y-1)*ie,he=1;he<=y;he++){var De,ye;N=w){N=1&&le<=D)break;X+=le}if(le>D)throw new Error("tukey.cdf failed to converge");return X>1&&(X=1),X},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 N=u(l,p,s),w=t.tukey.cdf(N,a,s)-l,D;w>0?D=r.max(0,N-1):D=N+1;for(var b=t.tukey.cdf(D,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,N=0,w=[],D,b,O,M;for(l=t.aug(l,a),D=l[0].length,s=0;s=0;s--){for(N=0,f=s+1;f<=p-1;f++)N=N+w[f]*l[s][f];w[s]=(l[s][D-1]-N)/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,N,w;for(N=0;Nr.abs(s[D][N])&&(D=w);var b=s[N];for(s[N]=s[D],s[D]=b,w=N+1;w=0;N--){for(h=s[N][N],w=0;wN-1;y--)s[w][y]-=s[N][y]*s[w][N]/h;for(s[N][N]/=h,y=f;yh?(N[p][h]=l[p][h],w[p][h]=D[p][h]=0):pf;)b=I,I=t.add(t.multiply(M,b),O),p++;return I},gauss_seidel:function(l,a,s,f){for(var p=0,h=l.length,y=[],N=[],w=[],D,b,O,M,I;pD?(y[p][D]=l[p][D],N[p][D]=w[p][D]=0):pf;)b=I,I=t.add(t.multiply(M,b),O),p=p+1;return I},SOR:function(l,a,s,f,p){for(var h=0,y=l.length,N=[],w=[],D=[],b,O,M,I,F;hb?(N[h][b]=l[h][b],w[h][b]=D[h][b]=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,N,w,D,b;f0?-1:1,y=b*r.sqrt(y),N=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*N),w=f+2;w0?r.PI/4:-r.PI/4:O=r.atan(2*l[w][D]/(l[w][w]-l[D][D]))/2,M=t.identity(s,s),M[w][w]=r.cos(O),M[w][D]=-r.sin(O),M[D][w]=r.sin(O),M[D][D]=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;)D=p(l,s+f),b=p(l,s),N[y]=(a[D]-2*a[b]+a[2*b-D])/(f*f),f/=2,y++;for(M=N.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])*D[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=[],N=[],w=[],D=[],b=[],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,N,w,D;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),N=e.mean(u),w=e.sum(h.map(function(M){return Math.pow(M-N,2)})),D=e.sum(u.map(function(M,I){return Math.pow(M-h[I],2)})),b=w+D,O=w/b;return{exog:l,endog:u,nobs:a,df_model:s,df_resid:f,coef:p,predict:h,resid:y,ybar:N,SST:b,SSE:w,SSR:D,R2:O}}function n(u){var l=t(u.exog),a=Math.sqrt(u.SSR/u.df_resid),s=l.map(function(N){var w=N.SST,D=N.R2;return a/Math.sqrt(w*(1-D))}),f=u.coef.map(function(N,w){return(N-0)/s[w]}),p=f.map(function(N){var w=e.studentt.cdf(N,u.df_resid);return(w>.5?1-w:w)*2}),h=e.studentt.inv(.975,u.df_resid),y=u.coef.map(function(N,w){var D=h*s[w];return[N-D,N+D]});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{v();x();g();var zH;(function(e){typeof DO_NOT_EXPORT_BESSEL>"u"?typeof KA=="object"?e(KA):typeof define=="function"&&define.amd?define(function(){var t={};return e(t),t}):e(zH={}):e(zH={})})(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,N(F),M(F),-1);else{for(var R=2*t.floor((C+t.floor(t.sqrt(40*C)))/2),q=!1,z=0,H=0,V=1,W=0,ee=2/F,ie=R;ie>0;ie--)W=ie*ee*V-z,z=V,V=W,t.abs(V)>1e10&&(V*=1e-10,z*=1e-10,P*=1e-10,H*=1e-10),q&&(H+=V),q=!q,ie==C&&(P=z);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 N(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(),D=[249958057e5,424441966400,3733650367,2245904002e-2,102042.605,354.9632885,1].reverse(),b=[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(D,R),F=C/P+s*(o(I,1)*t.log(I)-1/I)):(R=64/R,C=r(b,R),P=r(O,R),F=t.sqrt(s/I)*(t.sin(q)*C+t.cos(q)*P*8/I)),F}return i(N,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 N(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(D,b){if(b=Math.round(b),b===0)return p(D);if(b===1)return N(D);if(b<0)return NaN;if(t.abs(D)===0)return 0;if(D==1/0)return 1/0;var O=0,M,I=2/t.abs(D),F=0,C=1,P=0,R=2*t.round((b+t.round(t.sqrt(40*b)))/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==b&&(O=F);return O*=w(D,0)/C,D<0&&b%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 N(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,N,"BESSELK",2,1)}();e.besselj=o,e.bessely=u,e.besseli=l,e.besselk=a})});var Ls=dt((TC,OC)=>{v();x();g();(function(e,t){typeof TC=="object"&&typeof OC<"u"?OC.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self,e.CodeMirror=t())})(TC,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),N=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),w=/PhantomJS/.test(e),D=y&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),b=/Android/.test(e),O=D||b||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),M=D||/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 z=function(c,d){var A=c.className,S=q(d).exec(A);if(S){var T=A.slice(S.index+S[0].length);c.className=A.slice(0,S.index)+(T?S[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,A,S){var T=document.createElement(c);if(A&&(T.className=A),S&&(T.style.cssText=S),typeof d=="string")T.appendChild(document.createTextNode(d));else if(d)for(var U=0;U=d)return G+(d-U);G+=te-U,G+=A-G%A,U=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 A=+new Date+c;(!this.id||A=d)return S+Math.min(G,d-T);if(T+=U-S,T+=A-T%A,S=U+1,T>=d)return S}}var be=[""];function Ue(c){for(;be.length<=c;)be.push(ve(be)+" ");return be[c]}function ve(c){return c[c.length-1]}function Re(c,d){for(var A=[],S=0;S"\x80"&&(c.toUpperCase()!=c.toLowerCase()||et.test(c))}function Lt(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,A){for(;(A<0?d>0:dA?-1:1;;){if(d==A)return d;var T=(d+A)/2,U=S<0?Math.ceil(T):Math.floor(T);if(U==d)return c(U)?d:A;c(U)?A=U:d=U+S}}function we(c,d,A,S){if(!c)return S(d,A,"ltr",0);for(var T=!1,U=0;Ud||d==A&&G.to==d)&&(S(Math.max(G.from,d),Math.min(G.to,A),G.level==1?"rtl":"ltr",U),T=!0)}T||S(d,A,"ltr")}var Le=null;function Qe(c,d,A){var S;Le=null;for(var T=0;Td)return T;U.to==d&&(U.from!=U.to&&A=="before"?S=T:Le=T),U.from==d&&(U.from!=U.to&&A!="before"?S=T:Le=T)}return S??Le}var it=function(){var c="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",d="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function A(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 S=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,T=/[stwN]/,U=/[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"&&!S.test(se))return!1;for(var Ze=se.length,$e=[],st=0;st-1&&(S[d]=T.slice(0,U).concat(T.slice(U+1)))}}}function tt(c,d){var A=xe(c,d);if(A.length)for(var S=Array.prototype.slice.call(arguments,2),T=0;T0}function Gr(c){c.prototype.on=function(d,A){Z(this,d,A)},c.prototype.off=function(d,A){Ye(this,d,A)}}function Vt(c){c.preventDefault?c.preventDefault():c.returnValue=!1}function pi(c){c.stopPropagation?c.stopPropagation():c.cancelBubble=!0}function tr(c){return c.defaultPrevented!=null?c.defaultPrevented:c.returnValue==!1}function ro(c){Vt(c),pi(c)}function Er(c){return c.target||c.srcElement}function Fn(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 Aa=function(){if(u&&l<9)return!1;var c=W("div");return"draggable"in c||"dragDrop"in c}(),Ca;function Hn(c){if(Ca==null){var d=W("span","\u200B");V(c,W("span",[d,document.createTextNode("x")])),c.firstChild.offsetHeight!=0&&(Ca=d.offsetWidth<=1&&d.offsetHeight>2&&!(u&&l<8))}var A=Ca?W("span","\u200B"):W("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return A.setAttribute("cm-text",""),A}var Ko;function Lo(c){if(Ko!=null)return Ko;var d=V(c,document.createTextNode("A\u062EA")),A=ie(d,0,1).getBoundingClientRect(),S=ie(d,1,2).getBoundingClientRect();return H(c),!A||A.left==A.right?!1:Ko=S.right-A.right<3}var Qn=` + +b`.split(/\n/).length!=3?function(c){for(var d=0,A=[],S=c.length;d<=S;){var T=c.indexOf(` +`,d);T==-1&&(T=c.length);var U=c.slice(d,c.charAt(T-1)=="\r"?T-1:T),G=U.indexOf("\r");G!=-1?(A.push(U.slice(0,G)),d+=G+1):(A.push(U),d=T+1)}return A}:function(c){return c.split(/\r\n?|\n/)},Jo=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")}(),bo=null;function ac(c){if(bo!=null)return bo;var d=V(c,W("span","x")),A=d.getBoundingClientRect(),S=ie(d,0,1).getBoundingClientRect();return bo=Math.abs(A.left-S.left)>1}var fs={},no={};function io(c,d){arguments.length>2&&(d.dependencies=Array.prototype.slice.call(arguments,2)),fs[c]=d}function Qo(c,d){no[c]=d}function Js(c){if(typeof c=="string"&&no.hasOwnProperty(c))c=no[c];else if(c&&typeof c.name=="string"&&no.hasOwnProperty(c.name)){var d=no[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 Js("application/xml");if(typeof c=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(c))return Js("application/json")}return typeof c=="string"?{name:c}:c||{name:"null"}}function Ma(c,d){d=Js(d);var A=fs[d.name];if(!A)return Ma(c,"text/plain");var S=A(c,d);if(Qt.hasOwnProperty(d.name)){var T=Qt[d.name];for(var U in T)T.hasOwnProperty(U)&&(S.hasOwnProperty(U)&&(S["_"+U]=S[U]),S[U]=T[U])}if(S.name=d.name,d.helperType&&(S.helperType=d.helperType),d.modeProps)for(var G in d.modeProps)S[G]=d.modeProps[G];return S}var Qt={};function Ri(c,d){var A=Qt.hasOwnProperty(c)?Qt[c]:Qt[c]={};Ce(d,A)}function Tr(c,d){if(d===!0)return d;if(c.copyState)return c.copyState(d);var A={};for(var S in d){var T=d[S];T instanceof Array&&(T=T.concat([])),A[S]=T}return A}function Rt(c,d){for(var A;c.innerMode&&(A=c.innerMode(d),!(!A||A.mode==c));)d=A.state,c=A.mode;return A||{mode:c,state:d}}function oo(c,d,A){return c.startState?c.startState(d,A):!0}var Qr=function(c,d,A){this.pos=this.start=0,this.string=c,this.tabSize=d||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=A};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:(U&&d!==!1&&(this.pos+=U[0].length),U)}},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 A=c;!A.lines;)for(var S=0;;++S){var T=A.children[S],U=T.chunkSize();if(d=c.first&&dA?nt(A,zt(c,A).text.length):sc(d,zt(c,d.line).text.length)}function sc(c,d){var A=c.ch;return A==null||A>d?nt(c.line,d):A<0?nt(c.line,0):c}function Rd(c,d){for(var A=[],S=0;Sthis.maxLookAhead&&(this.maxLookAhead=c),d},ea.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}},ea.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ea.fromSaved=function(c,d,A){return d instanceof $u?new ea(c,Tr(c.mode,d.state),A,d.lookAhead):new ea(c,Tr(c.mode,d),A)},ea.prototype.save=function(c){var d=c!==!1?Tr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new $u(d,this.maxLookAhead):d};function cs(c,d,A,S){var T=[c.state.modeGen],U={};cc(c,d.text,c.doc.mode,A,function(se,Ae){return T.push(se,Ae)},U,S);for(var G=A.state,te=function(se){A.baseTokens=T;var Ae=c.state.overlays[se],Ie=1,Ze=0;A.state=!0,cc(c,d.text,Ae.mode,A,function($e,st){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(st)if(Ae.opaque)T.splice(mt,Ie-mt,$e,"overlay "+st),Ie=mt+2;else for(;mtc.options.maxHighlightLength&&Tr(c.doc.mode,S.state),U=cs(c,d,S);T&&(S.state=T),d.stateAfter=S.save(!T),d.styles=U.styles,U.classes?d.styleClasses=U.classes:d.styleClasses&&(d.styleClasses=null),A===c.doc.highlightFrontier&&(c.doc.modeFrontier=Math.max(c.doc.modeFrontier,++c.doc.highlightFrontier))}return d.styles}function jr(c,d,A){var S=c.doc,T=c.display;if(!S.mode.startState)return new ea(S,!0,d);var U=Do(c,d,A),G=U>S.first&&zt(S,U-1).stateAfter,te=G?ea.fromSaved(S,G,U):new ea(S,oo(S.mode),U);return S.iter(U,d,function(oe){uc(c,oe.text,te);var se=te.line;oe.stateAfter=se==d-1||se%5==0||se>=T.viewFrom&&sed.start)return U}throw new Error("Mode "+c.name+" failed to advance stream.")}var vn=function(c,d,A){this.start=c.start,this.end=c.pos,this.string=c.current(),this.type=d||null,this.state=A};function lc(c,d,A,S){var T=c.doc,U=T.mode,G;d=Mt(T,d);var te=zt(T,d.line),oe=jr(c,d.line,A),se=new Qr(te.text,c.options.tabSize,oe),Ae;for(S&&(Ae=[]);(S||se.posc.options.maxHighlightLength?(te=!1,G&&uc(c,d,S,Ae.pos),Ae.pos=d.length,Ie=null):Ie=fc(qd(A,Ae,S.state,Ze),U),Ze){var $e=Ze[0].name;$e&&(Ie="m-"+(Ie?$e+" "+Ie:$e))}if(!te||se!=Ie){for(;oeG;--te){if(te<=U.first)return U.first;var oe=zt(U,te-1),se=oe.stateAfter;if(se&&(!A||te+(se instanceof $u?se.lookAhead:0)<=U.modeFrontier))return te;var Ae=Oe(oe.text,null,c.options.tabSize);(T==null||S>Ae)&&(T=te-1,S=Ae)}return T}function em(c,d){if(c.modeFrontier=Math.min(c.modeFrontier,d),!(c.highlightFrontierA;S--){var T=zt(c,S).stateAfter;if(T&&(!(T instanceof $u)||S+T.lookAhead=d:U.to>d);(S||(S=[])).push(new pc(G,U.from,oe?null:U.to))}}return S}function Vu(c,d,A){var S;if(c)for(var T=0;T=d:U.to>d);if(te||U.from==d&&G.type=="bookmark"&&(!A||U.marker.insertLeft)){var oe=U.from==null||(G.inclusiveLeft?U.from<=d:U.from0&&te)for(var Tt=0;Tt0)){var Ae=[oe,1],Ie=Fe(se.from,te.from),Ze=Fe(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 eu(c){var d=c.markedSpans;if(d){for(var A=0;Ad)&&(!S||tu(S,U.marker)<0)&&(S=U.marker)}return S}function y1(c,d,A,S,T){var U=zt(c,d),G=No&&U.markedSpans;if(G)for(var te=0;te=0&&Ie<=0||Ae<=0&&Ie>=0)&&(Ae<=0&&(oe.marker.inclusiveRight&&T.inclusiveLeft?Fe(se.to,A)>=0:Fe(se.to,A)>0)||Ae>=0&&(oe.marker.inclusiveRight&&T.inclusiveLeft?Fe(se.from,S)<=0:Fe(se.from,S)<0)))return!0}}}function ta(c){for(var d;d=jn(c);)c=d.find(-1,!0).line;return c}function pN(c){for(var d;d=rm(c);)c=d.find(1,!0).line;return c}function dc(c){for(var d,A;d=rm(c);)c=d.find(1,!0).line,(A||(A=[])).push(c);return A}function ru(c,d){var A=zt(c,d),S=ta(A);return A==S?d:ue(S)}function w1(c,d){if(d>c.lastLine())return d;var A=zt(c,d),S;if(!zi(c,A))return d;for(;S=rm(A);)A=S.find(1,!0).line;return ue(A)+1}function zi(c,d){var A=No&&d.markedSpans;if(A){for(var S=void 0,T=0;Td.maxLineLength&&(d.maxLineLength=T,d.maxLine=S)})}var Wl=function(c,d,A){this.text=c,qi(this,d),this.height=A?A(this):1};Wl.prototype.lineNo=function(){return ue(this)},Gr(Wl);function Hd(c,d,A,S){c.text=d,c.stateAfter&&(c.stateAfter=null),c.styles&&(c.styles=null),c.order!=null&&(c.order=null),eu(c),qi(c,A);var T=S?S(c):1;T!=c.height&&$n(c,T)}function b1(c){c.parent=null,eu(c)}var $d={},D1={};function Wd(c,d){if(!c||/^\s*$/.test(c))return null;var A=d.addModeClass?D1:$d;return A[c]||(A[c]=c.replace(/\S+/g,"cm-$&"))}function Vd(c,d){var A=ee("span",null,null,a?"padding-right: .1px":null),S={pre:ee("pre",[A],"CodeMirror-line"),content:A,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 U=T?d.rest[T-1]:d.line,G=void 0;S.pos=0,S.addToken=N1,Lo(c.display.measure)&&(G=Xe(U,c.doc.direction))&&(S.addToken=vc(S.addToken,G)),S.map=[];var te=d!=c.display.externalMeasured&&ue(U);Gd(U,S,g1(c,U,te)),U.styleClasses&&(U.styleClasses.bgClass&&(S.bgClass=re(U.styleClasses.bgClass,S.bgClass||"")),U.styleClasses.textClass&&(S.textClass=re(U.styleClasses.textClass,S.textClass||""))),S.map.length==0&&S.map.push(0,0,S.content.appendChild(Hn(c.display.measure))),T==0?(d.measure.map=S.map,d.measure.cache={}):((d.measure.maps||(d.measure.maps=[])).push(S.map),(d.measure.caches||(d.measure.caches=[])).push({}))}if(a){var oe=S.content.lastChild;(/\bcm-tab\b/.test(oe.className)||oe.querySelector&&oe.querySelector(".cm-tab"))&&(S.content.className="cm-tab-wrap-hack")}return tt(c,"renderLine",c,d.line,S.pre),S.pre.className&&(S.textClass=re(S.pre.className,S.textClass||"")),S}function mN(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 N1(c,d,A,S,T,U,G){if(d){var te=c.splitSpaces?hN(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 st=document.createTextNode(te.slice(Ie,Ie+$e));u&&l<9?Ae.appendChild(W("span",[st])):Ae.appendChild(st),c.map.push(c.pos,c.pos+$e,st),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,Dt=yt-c.col%yt;mt=Ae.appendChild(W("span",Ue(Dt),"cm-tab")),mt.setAttribute("role","presentation"),mt.setAttribute("cm-text"," "),c.col+=Dt}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,A||S||T||se||U||G){var At=A||"";S&&(At+=S),T&&(At+=T);var bt=W("span",[Ae],At,U);if(G)for(var Tt in G)G.hasOwnProperty(Tt)&&Tt!="style"&&Tt!="class"&&bt.setAttribute(Tt,G[Tt]);return c.content.appendChild(bt)}c.content.appendChild(Ae)}}function hN(c,d){if(c.length>1&&!/ /.test(c))return c;for(var A=d,S="",T=0;Tse&&Ie.from<=se));Ze++);if(Ie.to>=Ae)return c(A,S,T,U,G,te,oe);c(A,S.slice(0,Ie.to-se),T,U,null,te,oe),U=null,S=S.slice(Ie.to-se),se=Ie.to}}}function im(c,d,A,S){var T=!S&&A.widgetNode;T&&c.map.push(c.pos,c.pos+d,T),!S&&c.cm.display.input.needsContentAttribute&&(T||(T=c.content.appendChild(document.createElement("span"))),T.setAttribute("cm-marker",A.id)),T&&(c.cm.display.input.setUneditable(T),c.content.appendChild(T)),c.pos+=d,c.trailingSpace=!1}function Gd(c,d,A){var S=c.markedSpans,T=c.text,U=0;if(!S){for(var G=1;Goe||dr.collapsed&&Ut.to==oe&&Ut.from==oe)){if(Ut.to!=null&&Ut.to!=oe&&$e>Ut.to&&($e=Ut.to,mt=""),dr.className&&(st+=" "+dr.className),dr.css&&(Ze=(Ze?Ze+";":"")+dr.css),dr.startStyle&&Ut.from==oe&&(yt+=" "+dr.startStyle),dr.endStyle&&Ut.to==$e&&(Tt||(Tt=[])).push(dr.endStyle,Ut.to),dr.title&&((At||(At={})).title=dr.title),dr.attributes)for(var Yr in dr.attributes)(At||(At={}))[Yr]=dr.attributes[Yr];dr.collapsed&&(!Dt||tu(Dt.marker,dr)<0)&&(Dt=Ut)}else Ut.from>oe&&$e>Ut.from&&($e=Ut.from)}if(Tt)for(var ti=0;ti=te)break;for(var Gi=Math.min(te,$e);;){if(Ae){var Yi=oe+Ae.length;if(!Dt){var Bn=Yi>Gi?Ae.slice(0,Gi-oe):Ae;d.addToken(d,Bn,Ie?Ie+st:st,yt,oe+Bn.length==$e?mt:"",Ze,At)}if(Yi>=Gi){Ae=Ae.slice(Gi-oe),oe=Gi;break}oe=Yi,yt=""}Ae=T.slice(U,U=A[se++]),Ie=Wd(A[se++],d.cm.options)}}}function Yd(c,d,A){this.line=d,this.rest=dc(d),this.size=this.rest?ue(ve(this.rest))-A+1:1,this.node=this.text=null,this.hidden=zi(c,d)}function Vl(c,d,A){for(var S=[],T,U=d;U2&&U.push((oe.bottom+se.top)/2-A.top)}}U.push(A.bottom-A.top)}}function Qd(c,d,A){if(c.line==d)return{map:c.measure.map,cache:c.measure.cache};if(c.rest){for(var S=0;SA)return{map:c.measure.maps[T],cache:c.measure.caches[T],before:!0}}}function vN(c,d){d=ta(d);var A=ue(d),S=c.display.externalMeasured=new Yd(c.doc,d,A);S.lineN=A;var T=S.built=Vd(c,S);return S.text=T.pre,V(c.display.lineMeasure,T.pre),S}function M1(c,d,A,S){return Ao(c,Xu(c,d),A,S)}function lm(c,d){if(d>=c.display.viewFrom&&d=A.lineN&&dd)&&(U=oe-te,T=U-1,d>=oe&&(G="right")),T!=null){if(S=c[se+2],te==oe&&A==(S.insertLeft?"left":"right")&&(G=A),A=="left"&&T==0)for(;se&&c[se-2]==c[se-3]&&c[se-1].insertLeft;)S=c[(se-=3)+2],G="left";if(A=="right"&&T==oe-te)for(;se=0&&(A=c[T]).left==A.right;T--);return A}function F1(c,d,A,S){var T=O1(d.map,A,S),U=T.node,G=T.start,te=T.end,oe=T.collapse,se;if(U.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=S="right");var Ie;c.options.lineWrapping&&(Ie=U.getClientRects()).length>1?se=Ie[S=="right"?Ie.length-1:0]:se=U.getBoundingClientRect()}if(u&&l<9&&!G&&(!se||!se.left&&!se.right)){var Ze=U.parentNode.getClientRects()[0];Ze?se={left:Ze.left,right:Ze.left+hs(c.display),top:Ze.top,bottom:Ze.bottom}:se=T1}for(var $e=se.top-d.rect.top,st=se.bottom-d.rect.top,mt=($e+st)/2,yt=d.view.measure.heights,Dt=0;Dt=S.text.length?(oe=S.text.length,se="before"):oe<=0&&(oe=0,se="after"),!te)return G(se=="before"?oe-1:oe,se=="before");function Ae(st,mt,yt){var Dt=te[mt],At=Dt.level==1;return G(yt?st-1:st,At!=yt)}var Ie=Qe(te,oe,se),Ze=Le,$e=Ae(oe,Ie,se=="before");return Ze!=null&&($e.other=Ae(oe,Ze,se!="before")),$e}function Ku(c,d){var A=0;d=Mt(c.doc,d),c.options.lineWrapping||(A=hs(c.display)*d.ch);var S=zt(c.doc,d.line),T=Po(S)+Yl(c.display);return{left:A,right:A,top:T,bottom:T+S.height}}function wc(c,d,A,S,T){var U=nt(c,d,A);return U.xRel=T,S&&(U.outside=S),U}function jd(c,d,A){var S=c.doc;if(A+=c.display.viewOffset,A<0)return wc(S.first,0,null,-1,-1);var T=Me(S,A),U=S.first+S.size-1;if(T>U)return wc(S.first+S.size-1,zt(S,U).text.length,null,1,1);d<0&&(d=0);for(var G=zt(S,T);;){var te=xN(c,G,T,d,A),oe=cN(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(S,T=se.line)}}function L1(c,d,A,S){S-=kn(d);var T=d.text.length,U=pe(function(G){return Ao(c,A,G-1).bottom<=S},T,0);return T=pe(function(G){return Ao(c,A,G).top>S},U,T),{begin:U,end:T}}function P1(c,d,A,S){A||(A=Xu(c,d));var T=yc(c,d,Ao(c,A,S),"line").top;return L1(c,d,A,T)}function ev(c,d,A,S){return c.bottom<=A?!1:c.top>A?!0:(S?c.left:c.right)>d}function xN(c,d,A,S,T){T-=Po(d);var U=Xu(c,d),G=kn(d),te=0,oe=d.text.length,se=!0,Ae=Xe(d,c.doc.direction);if(Ae){var Ie=(c.options.lineWrapping?yN:bc)(c,d,A,U,Ae,S,T);se=Ie.level!=1,te=se?Ie.from:Ie.to-1,oe=se?Ie.to:Ie.from-1}var Ze=null,$e=null,st=pe(function(Gt){var Ut=Ao(c,U,Gt);return Ut.top+=G,Ut.bottom+=G,ev(Ut,S,T,!1)?(Ut.top<=T&&Ut.left<=S&&(Ze=Gt,$e=Ut),!0):!1},te,oe),mt,yt,Dt=!1;if($e){var At=S-$e.left<$e.right-S,bt=At==se;st=Ze+(bt?0:1),yt=bt?"after":"before",mt=At?$e.left:$e.right}else{!se&&(st==oe||st==te)&&st++,yt=st==0?"after":st==d.text.length?"before":Ao(c,U,st-(se?1:0)).bottom+G<=T==se?"after":"before";var Tt=Hi(c,nt(A,st,yt),"line",d,U);mt=Tt.left,Dt=T=Tt.bottom?1:0}return st=ne(d.text,st,1),wc(A,st,yt,Dt,S-mt)}function bc(c,d,A,S,T,U,G){var te=pe(function(Ie){var Ze=T[Ie],$e=Ze.level!=1;return ev(Hi(c,nt(A,$e?Ze.to:Ze.from,$e?"before":"after"),"line",d,S),U,G,!0)},0,T.length-1),oe=T[te];if(te>0){var se=oe.level!=1,Ae=Hi(c,nt(A,se?oe.from:oe.to,se?"after":"before"),"line",d,S);ev(Ae,U,G,!0)&&Ae.top>G&&(oe=T[te-1])}return oe}function yN(c,d,A,S,T,U,G){var te=L1(c,d,S,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 st=$e.level!=1,mt=Ao(c,S,st?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 ii;function na(c){if(c.cachedTextHeight!=null)return c.cachedTextHeight;if(ii==null){ii=W("pre",null,"CodeMirror-line-like");for(var d=0;d<49;++d)ii.appendChild(document.createTextNode("x")),ii.appendChild(W("br"));ii.appendChild(document.createTextNode("x"))}V(c.measure,ii);var A=ii.offsetHeight/50;return A>3&&(c.cachedTextHeight=A),H(c.measure),A||1}function hs(c){if(c.cachedCharWidth!=null)return c.cachedCharWidth;var d=W("span","xxxxxxxxxx"),A=W("pre",[d],"CodeMirror-line-like");V(c.measure,A);var S=d.getBoundingClientRect(),T=(S.right-S.left)/10;return T>2&&(c.cachedCharWidth=T),T||10}function Zl(c){for(var d=c.display,A={},S={},T=d.gutters.clientLeft,U=d.gutters.firstChild,G=0;U;U=U.nextSibling,++G){var te=c.display.gutterSpecs[G].className;A[te]=U.offsetLeft+U.clientLeft+T,S[te]=U.clientWidth}return{fixedPos:Dc(d),gutterTotalWidth:d.gutters.offsetWidth,gutterLeft:A,gutterWidth:S,wrapperWidth:d.wrapper.clientWidth}}function Dc(c){return c.scroller.getBoundingClientRect().left-c.sizer.getBoundingClientRect().left}function Xl(c){var d=na(c.display),A=c.options.lineWrapping,S=A&&Math.max(5,c.display.scroller.clientWidth/hs(c.display)-3);return function(T){if(zi(c.doc,T))return 0;var U=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=nt(oe.line,Math.max(0,Math.round((U-ao(c.display).left)/hs(c.display))-Ae))}return oe}function Ju(c,d){if(d>=c.display.viewTo||(d-=c.display.viewFrom,d<0))return null;for(var A=c.display.view,S=0;Sd)&&(T.updateLineNumbers=d),c.curOp.viewChanged=!0,d>=T.viewTo)No&&ru(c.doc,d)T.viewFrom?Oa(c):(T.viewFrom+=S,T.viewTo+=S);else if(d<=T.viewFrom&&A>=T.viewTo)Oa(c);else if(d<=T.viewFrom){var U=Kl(c,A,A+S,1);U?(T.view=T.view.slice(U.index),T.viewFrom=U.lineN,T.viewTo+=S):Oa(c)}else if(A>=T.viewTo){var G=Kl(c,d,d,-1);G?(T.view=T.view.slice(0,G.index),T.viewTo=G.lineN):Oa(c)}else{var te=Kl(c,d,d,-1),oe=Kl(c,A,A+S,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+=S):Oa(c)}var se=T.externalMeasured;se&&(A=T.lineN&&d=S.viewTo)){var U=S.view[Ju(c,d)];if(U.node!=null){var G=U.changes||(U.changes=[]);Se(G,A)==-1&&G.push(A)}}}function Oa(c){c.display.viewFrom=c.display.viewTo=c.doc.first,c.display.view=[],c.display.viewOffset=0}function Kl(c,d,A,S){var T=Ju(c,d),U,G=c.display.view;if(!No||A==c.doc.first+c.doc.size)return{index:T,lineN:A};for(var te=c.display.viewFrom,oe=0;oe0){if(T==G.length-1)return null;U=te+G[T].size-d,T++}else U=te-d;d+=U,A+=U}for(;ru(c.doc,A)!=A;){if(T==(S<0?0:G.length-1))return null;A+=S*G[T-(S<0?1:0)].size,T+=S}return{index:T,lineN:A}}function wN(c,d,A){var S=c.display,T=S.view;T.length==0||d>=S.viewTo||A<=S.viewFrom?(S.view=Vl(c,d,A),S.viewFrom=d):(S.viewFrom>d?S.view=Vl(c,d,S.viewFrom).concat(S.view):S.viewFromA&&(S.view=S.view.slice(0,Ju(c,A)))),S.viewTo=A}function tv(c){for(var d=c.display.view,A=0,S=0;S=c.display.viewTo||oe.to().line0?G:c.defaultCharWidth())+"px"}if(S.other){var te=A.appendChild(W("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));te.style.display="",te.style.left=S.other.left+"px",te.style.top=S.other.top+"px",te.style.height=(S.other.bottom-S.other.top)*.85+"px"}}function Jl(c,d){return c.top-d.top||c.left-d.left}function rv(c,d,A){var S=c.display,T=c.doc,U=document.createDocumentFragment(),G=ao(c.display),te=G.left,oe=Math.max(S.sizerWidth,ou(c)-S.sizer.offsetLeft)-G.right,se=T.direction=="ltr";function Ae(bt,Tt,Gt,Ut){Tt<0&&(Tt=0),Tt=Math.round(Tt),Ut=Math.round(Ut),U.appendChild(W("div",null,"CodeMirror-selected","position: absolute; left: "+bt+`px; + top: `+Tt+"px; width: "+(Gt??oe-bt)+`px; + height: `+(Ut-Tt)+"px"))}function Ie(bt,Tt,Gt){var Ut=zt(T,bt),dr=Ut.text.length,Yr,ti;function zr(Bn,Zi){return cm(c,nt(bt,Bn),"div",Ut,Zi)}function Gi(Bn,Zi,si){var Vn=P1(c,Ut,null,Bn),Ln=Zi=="ltr"==(si=="after")?"left":"right",tn=si=="after"?Vn.begin:Vn.end-(/\s/.test(Ut.text.charAt(Vn.end-1))?2:1);return zr(tn,Ln)[Ln]}var Yi=Xe(Ut,T.direction);return we(Yi,Tt||0,Gt??dr,function(Bn,Zi,si,Vn){var Ln=si=="ltr",tn=zr(Bn,Ln?"left":"right"),Xi=zr(Zi-1,Ln?"right":"left"),pf=Tt==null&&Bn==0,vu=Gt==null&&Zi==dr,vi=Vn==0,_a=!Yi||Vn==Yi.length-1;if(Xi.top-tn.top<=3){var Pn=(se?pf:vu)&&vi,Lv=(se?vu:pf)&&_a,ka=Pn?te:(Ln?tn:Xi).left,cl=Lv?oe:(Ln?Xi:tn).right;Ae(ka,tn.top,cl-ka,tn.bottom)}else{var pl,Ci,gu,Pv;Ln?(pl=se&&pf&&vi?te:tn.left,Ci=se?oe:Gi(Bn,si,"before"),gu=se?te:Gi(Zi,si,"after"),Pv=se&&vu&&_a?oe:Xi.right):(pl=se?Gi(Bn,si,"before"):te,Ci=!se&&pf&&vi?oe:tn.right,gu=!se&&vu&&_a?te:Xi.left,Pv=se?Gi(Zi,si,"after"):oe),Ae(pl,tn.top,Ci-pl,tn.bottom),tn.bottom0?d.blinker=setInterval(function(){c.hasFocus()||Qu(c),d.cursorDiv.style.visibility=(A=!A)?"":"hidden"},c.options.cursorBlinkRate):c.options.cursorBlinkRate<0&&(d.cursorDiv.style.visibility="hidden")}}function nv(c){c.hasFocus()||(c.display.input.focus(),c.state.focused||hm(c))}function Ql(c){c.state.delayingBlurEvent=!0,setTimeout(function(){c.state.delayingBlurEvent&&(c.state.delayingBlurEvent=!1,c.state.focused&&Qu(c))},100)}function hm(c,d){c.state.delayingBlurEvent&&!c.state.draggingText&&(c.state.delayingBlurEvent=!1),c.options.readOnly!="nocursor"&&(c.state.focused||(tt(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()),Ec(c))}function Qu(c,d){c.state.delayingBlurEvent||(c.state.focused&&(tt(c,"blur",c,d),c.state.focused=!1,z(c.display.wrapper,"CodeMirror-focused")),clearInterval(c.display.blinker),setTimeout(function(){c.state.focused||(c.display.shift=!1)},150))}function dm(c){for(var d=c.display,A=d.lineDiv.offsetTop,S=Math.max(0,d.scroller.getBoundingClientRect().top),T=d.lineDiv.getBoundingClientRect().top,U=0,G=0;G.005||$e<-.005)&&(Tc.display.sizerWidth){var mt=Math.ceil(Ae/hs(c.display));mt>c.display.maxLineLength&&(c.display.maxLineLength=mt,c.display.maxLine=te.line,c.display.maxLineChanged=!0)}}}Math.abs(U)>2&&(d.scroller.scrollTop+=U)}function iv(c){if(c.widgets)for(var d=0;d=G&&(U=Me(d,Po(zt(d,oe))-c.wrapper.clientHeight),G=oe)}return{from:U,to:Math.max(G,U+1)}}function bN(c,d){if(!wt(c,"scrollCursorIntoView")){var A=c.display,S=A.sizer.getBoundingClientRect(),T=null,U=A.wrapper.ownerDocument;if(d.top+S.top<0?T=!0:d.bottom+S.top>(U.defaultView.innerHeight||U.documentElement.clientHeight)&&(T=!1),T!=null&&!w){var G=W("div","\u200B",null,`position: absolute; + top: `+(d.top-A.viewOffset-Yl(c.display))+`px; + height: `+(d.bottom-d.top+ra(c)+A.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 q1(c,d,A,S){S==null&&(S=0);var T;!c.options.lineWrapping&&d==A&&(A=d.sticky=="before"?nt(d.line,d.ch+1,"before"):d,d=d.ch?nt(d.line,d.sticky=="before"?d.ch-1:d.ch,"after"):d);for(var U=0;U<5;U++){var G=!1,te=Hi(c,d),oe=!A||A==d?te:Hi(c,A);T={left:Math.min(te.left,oe.left),top:Math.min(te.top,oe.top)-S,right:Math.max(te.left,oe.left),bottom:Math.max(te.bottom,oe.bottom)+S};var se=ov(c,T),Ae=c.doc.scrollTop,Ie=c.doc.scrollLeft;if(se.scrollTop!=null&&(vs(c,se.scrollTop),Math.abs(c.doc.scrollTop-Ae)>1&&(G=!0)),se.scrollLeft!=null&&(ju(c,se.scrollLeft),Math.abs(c.doc.scrollLeft-Ie)>1&&(G=!0)),!G)break}return T}function DN(c,d){var A=ov(c,d);A.scrollTop!=null&&vs(c,A.scrollTop),A.scrollLeft!=null&&ju(c,A.scrollLeft)}function ov(c,d){var A=c.display,S=na(c.display);d.top<0&&(d.top=0);var T=c.curOp&&c.curOp.scrollTop!=null?c.curOp.scrollTop:A.scroller.scrollTop,U=um(c),G={};d.bottom-d.top>U&&(d.bottom=d.top+U);var te=c.doc.height+gc(A),oe=d.topte-S;if(d.topT+U){var Ae=Math.min(d.top,(se?te:d.bottom)-U);Ae!=T&&(G.scrollTop=Ae)}var Ie=c.options.fixedGutter?0:A.gutters.offsetWidth,Ze=c.curOp&&c.curOp.scrollLeft!=null?c.curOp.scrollLeft:A.scroller.scrollLeft-Ie,$e=ou(c)-A.gutters.offsetWidth,st=d.right-d.left>$e;return st&&(d.right=d.left+$e),d.left<10?G.scrollLeft=0:d.left$e+Ze-3&&(G.scrollLeft=d.right+(st?0:10)-$e),G}function vm(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 Sc(c,d,A){(d!=null||A!=null)&&ef(c),d!=null&&(c.curOp.scrollLeft=d),A!=null&&(c.curOp.scrollTop=A)}function NN(c,d){ef(c),c.curOp.scrollToPos=d}function ef(c){var d=c.curOp.scrollToPos;if(d){c.curOp.scrollToPos=null;var A=Ku(c,d.from),S=Ku(c,d.to);av(c,A,S,d.margin)}}function av(c,d,A,S){var T=ov(c,{left:Math.min(d.left,A.left),top:Math.min(d.top,A.top)-S,right:Math.max(d.right,A.right),bottom:Math.max(d.bottom,A.bottom)+S});Sc(c,T.scrollLeft,T.scrollTop)}function vs(c,d){Math.abs(c.doc.scrollTop-d)<2||(r||fv(c,{top:d}),au(c,d,!0),r&&fv(c),rl(c,100))}function au(c,d,A){d=Math.max(0,Math.min(c.display.scroller.scrollHeight-c.display.scroller.clientHeight,d)),!(c.display.scroller.scrollTop==d&&!A)&&(c.doc.scrollTop=d,c.display.scrollbars.setScrollTop(d),c.display.scroller.scrollTop!=d&&(c.display.scroller.scrollTop=d))}function ju(c,d,A,S){d=Math.max(0,Math.min(d,c.display.scroller.scrollWidth-c.display.scroller.clientWidth)),!((A?d==c.doc.scrollLeft:Math.abs(c.doc.scrollLeft-d)<2)&&!S)&&(c.doc.scrollLeft=d,W1(c),c.display.scroller.scrollLeft!=d&&(c.display.scroller.scrollLeft=d),c.display.scrollbars.setScrollLeft(d))}function Ac(c){var d=c.display,A=d.gutters.offsetWidth,S=Math.round(c.doc.height+gc(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?A:0,docHeight:S,scrollHeight:S+ra(c)+d.barHeight,nativeBarWidth:d.nativeBarWidth,gutterWidth:A}}var el=function(c,d,A){this.cm=A;var S=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");S.tabIndex=T.tabIndex=-1,c(S),c(T),Z(S,"scroll",function(){S.clientHeight&&d(S.scrollTop,"vertical")}),Z(T,"scroll",function(){T.clientWidth&&d(T.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,u&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};el.prototype.update=function(c){var d=c.scrollWidth>c.clientWidth+1,A=c.scrollHeight>c.clientHeight+1,S=c.nativeBarWidth;if(A){this.vert.style.display="block",this.vert.style.bottom=d?S+"px":"0";var T=c.viewHeight-(d?S: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=A?S+"px":"0",this.horiz.style.left=c.barLeft+"px";var U=c.viewWidth-c.barLeft-(A?S:0);this.horiz.firstChild.style.width=Math.max(0,c.scrollWidth-c.clientWidth+U)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&c.clientHeight>0&&(S==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:A?S:0,bottom:d?S:0}},el.prototype.setScrollLeft=function(c){this.horiz.scrollLeft!=c&&(this.horiz.scrollLeft=c),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},el.prototype.setScrollTop=function(c){this.vert.scrollTop!=c&&(this.vert.scrollTop=c),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},el.prototype.zeroWidthHack=function(){var c=M&&!N?"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},el.prototype.enableZeroWidthBar=function(c,d,A){c.style.visibility="";function S(){var T=c.getBoundingClientRect(),U=A=="vert"?document.elementFromPoint(T.right-1,(T.top+T.bottom)/2):document.elementFromPoint((T.right+T.left)/2,T.bottom-1);U!=c?c.style.visibility="hidden":d.set(1e3,S)}d.set(1e3,S)},el.prototype.clear=function(){var c=this.horiz.parentNode;c.removeChild(this.horiz),c.removeChild(this.vert)};var oi=function(){};oi.prototype.update=function(){return{bottom:0,right:0}},oi.prototype.setScrollLeft=function(){},oi.prototype.setScrollTop=function(){},oi.prototype.clear=function(){};function su(c,d){d||(d=Ac(c));var A=c.display.barWidth,S=c.display.barHeight;sv(c,d);for(var T=0;T<4&&A!=c.display.barWidth||S!=c.display.barHeight;T++)A!=c.display.barWidth&&c.options.lineWrapping&&dm(c),sv(c,Ac(c)),A=c.display.barWidth,S=c.display.barHeight}function sv(c,d){var A=c.display,S=A.scrollbars.update(d);A.sizer.style.paddingRight=(A.barWidth=S.right)+"px",A.sizer.style.paddingBottom=(A.barHeight=S.bottom)+"px",A.heightForcer.style.borderBottom=S.bottom+"px solid transparent",S.right&&S.bottom?(A.scrollbarFiller.style.display="block",A.scrollbarFiller.style.height=S.bottom+"px",A.scrollbarFiller.style.width=S.right+"px"):A.scrollbarFiller.style.display="",S.bottom&&c.options.coverGutterNextToScrollbar&&c.options.fixedGutter?(A.gutterFiller.style.display="block",A.gutterFiller.style.height=S.bottom+"px",A.gutterFiller.style.width=d.gutterWidth+"px"):A.gutterFiller.style.display=""}var z1={native:el,null:oi};function U1(c){c.display.scrollbars&&(c.display.scrollbars.clear(),c.display.scrollbars.addClass&&z(c.display.wrapper,c.display.scrollbars.addClass)),c.display.scrollbars=new z1[c.options.scrollbarStyle](function(d){c.display.wrapper.insertBefore(d,c.display.scrollbarFiller),Z(d,"mousedown",function(){c.state.focused&&setTimeout(function(){return c.display.input.focus()},0)}),d.setAttribute("cm-not-content","true")},function(d,A){A=="horizontal"?ju(c,d):vs(c,d)},c),c.display.scrollbars.addClass&&le(c.display.wrapper,c.display.scrollbars.addClass)}var EN=0;function tl(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:++EN,markArrays:null},E1(c.curOp)}function gs(c){var d=c.curOp;d&&om(d,function(A){for(var S=0;S=A.viewTo)||A.maxLineChanged&&d.options.lineWrapping,c.update=c.mustUpdate&&new Mc(d,c.mustUpdate&&{top:c.scrollTop,ensure:c.scrollToPos},c.forceUpdate)}function tf(c){c.updatedDisplay=c.mustUpdate&&uv(c.cm,c.update)}function SN(c){var d=c.cm,A=d.display;c.updatedDisplay&&dm(d),c.barMeasure=Ac(d),A.maxLineChanged&&!d.options.lineWrapping&&(c.adjustWidthTo=M1(d,A.maxLine,A.maxLine.text.length).left+3,d.display.sizerWidth=c.adjustWidthTo,c.barMeasure.scrollWidth=Math.max(A.scroller.clientWidth,A.sizer.offsetLeft+c.adjustWidthTo+ra(d)+d.display.barWidth),c.maxScrollLeft=Math.max(0,A.sizer.offsetLeft+c.adjustWidthTo-ou(d))),(c.updatedDisplay||c.selectionChanged)&&(c.preparedSelection=A.input.prepareSelection())}function gm(c){var d=c.cm;c.adjustWidthTo!=null&&(d.display.sizer.style.minWidth=c.adjustWidthTo+"px",c.maxScrollLeft=c.display.viewTo)){var A=+new Date+c.options.workTime,S=jr(c,d.highlightFrontier),T=[];d.iter(S.line,Math.min(d.first+d.size,c.display.viewTo+500),function(U){if(S.line>=c.display.viewFrom){var G=U.styles,te=U.text.length>c.options.maxHighlightLength?Tr(d.mode,S.state):null,oe=cs(c,U,S,!0);te&&(S.state=te),U.styles=oe.styles;var se=U.styleClasses,Ae=oe.classes;Ae?U.styleClasses=Ae:se&&(U.styleClasses=null);for(var Ie=!G||G.length!=U.styles.length||se!=Ae&&(!se||!Ae||se.bgClass!=Ae.bgClass||se.textClass!=Ae.textClass),Ze=0;!Ie&&ZeA)return rl(c,c.options.workDelay),!0}),d.highlightFrontier=S.line,d.modeFrontier=Math.max(d.modeFrontier,S.line),T.length&&so(c,function(){for(var U=0;U=A.viewFrom&&d.visible.to<=A.viewTo&&(A.updateLineNumbers==null||A.updateLineNumbers>=A.viewTo)&&A.renderedView==A.view&&tv(c)==0)return!1;V1(c)&&(Oa(c),d.dims=Zl(c));var T=S.first+S.size,U=Math.max(d.visible.from-c.options.viewportMargin,S.first),G=Math.min(T,d.visible.to+c.options.viewportMargin);A.viewFromG&&A.viewTo-G<20&&(G=Math.min(T,A.viewTo)),No&&(U=ru(c.doc,U),G=w1(c.doc,G));var te=U!=A.viewFrom||G!=A.viewTo||A.lastWrapHeight!=d.wrapperHeight||A.lastWrapWidth!=d.wrapperWidth;wN(c,U,G),A.viewOffset=Po(zt(c.doc,A.viewFrom)),c.display.mover.style.top=A.viewOffset+"px";var oe=tv(c);if(!te&&oe==0&&!d.force&&A.renderedView==A.view&&(A.updateLineNumbers==null||A.updateLineNumbers>=A.viewTo))return!1;var se=$1(c);return oe>4&&(A.lineDiv.style.display="none"),MN(c,A.updateLineNumbers,d.dims),oe>4&&(A.lineDiv.style.display=""),A.renderedView=A.view,CN(se),H(A.cursorDiv),H(A.selectionDiv),A.gutters.style.height=A.sizer.style.minHeight=0,te&&(A.lastWrapHeight=d.wrapperHeight,A.lastWrapWidth=d.wrapperWidth,rl(c,400)),A.updateLineNumbers=null,!0}function lv(c,d){for(var A=d.viewport,S=!0;;S=!1){if(!S||!c.options.lineWrapping||d.oldDisplayWidth==ou(c)){if(A&&A.top!=null&&(A={top:Math.min(c.doc.height+gc(c.display)-um(c),A.top)}),d.visible=Or(c.display,c.doc,A),d.visible.from>=c.display.viewFrom&&d.visible.to<=c.display.viewTo)break}else S&&(d.visible=Or(c.display,c.doc,A));if(!uv(c,d))break;dm(c);var T=Ac(c);Nc(c),su(c,T),wm(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 fv(c,d){var A=new Mc(c,d);if(uv(c,A)){dm(c),lv(c,A);var S=Ac(c);Nc(c),su(c,S),wm(c,S),A.finish()}}function MN(c,d,A){var S=c.display,T=c.options.lineNumbers,U=S.lineDiv,G=U.firstChild;function te(st){var mt=st.nextSibling;return a&&M&&c.display.currentWheelTarget==st?st.style.display="none":st.parentNode.removeChild(st),mt}for(var oe=S.view,se=S.viewFrom,Ae=0;Ae-1&&($e=!1),am(c,Ie,se,A)),$e&&(H(Ie.lineNumber),Ie.lineNumber.appendChild(document.createTextNode(ht(c.options,se)))),G=Ie.node.nextSibling}se+=Ie.size}for(;G;)G=te(G)}function ym(c){var d=c.gutters.offsetWidth;c.sizer.style.marginLeft=d+"px",Wn(c,"gutterChanged",c)}function wm(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+ra(c)+"px"}function W1(c){var d=c.display,A=d.view;if(!(!d.alignWidgets&&(!d.gutters.firstChild||!c.options.fixedGutter))){for(var S=Dc(d)-d.scroller.scrollLeft+c.doc.scrollLeft,T=d.gutters.offsetWidth,U=S+"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=bm(S.gutters,S.lineNumbers),G1(T),A.init(T)}var Dm=0,Ia=null;u?Ia=-.53:r?Ia=15:f?Ia=-.7:y&&(Ia=-1/3);function Z1(c){var d=c.wheelDeltaX,A=c.wheelDeltaY;return d==null&&c.detail&&c.axis==c.HORIZONTAL_AXIS&&(d=c.detail),A==null&&c.detail&&c.axis==c.VERTICAL_AXIS?A=c.detail:A==null&&(A=c.wheelDelta),{x:d,y:A}}function TN(c){var d=Z1(c);return d.x*=Ia,d.y*=Ia,d}function X1(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 A=Z1(d),S=A.x,T=A.y,U=Ia;d.deltaMode===0&&(S=d.deltaX,T=d.deltaY,U=1);var G=c.display,te=G.scroller,oe=te.scrollWidth>te.clientWidth,se=te.scrollHeight>te.clientHeight;if(S&&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&&Fe(c,S.to())<=0)return A}return-1};var Ir=function(c,d){this.anchor=c,this.head=d};Ir.prototype.from=function(){return Qs(this.anchor,this.head)},Ir.prototype.to=function(){return mi(this.anchor,this.head)},Ir.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function oa(c,d,A){var S=c&&c.options.selectionsMayTouch,T=d[A];d.sort(function(Ze,$e){return Fe(Ze.from(),$e.from())}),A=Se(d,T);for(var U=1;U0:oe>=0){var se=Qs(te.from(),G.from()),Ae=mi(te.to(),G.to()),Ie=te.empty()?G.from()==G.head:te.from()==te.head;U<=A&&--A,d.splice(--U,2,new Ir(Ie?Ae:se,Ie?se:Ae))}}return new Co(d,A)}function uu(c,d){return new Co([new Ir(c,d||c)],0)}function Mo(c){return c.text?nt(c.from.line+c.text.length-1,ve(c.text).length+(c.text.length==1?c.from.ch:0)):c.to}function Nm(c,d){if(Fe(c,d.from)<0)return c;if(Fe(c,d.to)<=0)return Mo(d);var A=c.line+d.text.length-(d.to.line-d.from.line)-1,S=c.ch;return c.line==d.to.line&&(S+=Mo(d).ch-d.to.ch),nt(A,S)}function Oc(c,d){for(var A=[],S=0;S1&&c.remove(te.line+1,st-1),c.insert(te.line+1,Dt)}Wn(c,"change",c,d)}function lu(c,d,A){function S(T,U,G){if(T.linked)for(var te=0;te1&&!c.done[c.done.length-2].ranges)return c.done.pop(),ve(c.done)}function ex(c,d,A,S){var T=c.history;T.undone.length=0;var U=+new Date,G,te;if((T.lastOp==S||T.lastOrigin==d.origin&&d.origin&&(d.origin.charAt(0)=="+"&&T.lastModTime>U-(c.cm?c.cm.options.historyEventDelay:500)||d.origin.charAt(0)=="*"))&&(G=ON(T,T.lastOp==S)))te=ve(G.changes),Fe(d.from,d.to)==0&&Fe(d.from,te.to)==0?te.to=Mo(d):G.changes.push(il(c,d));else{var oe=ve(T.done);for((!oe||!oe.ranges)&&_c(c.sel,T.done),G={changes:[il(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(A),T.generation=++T.maxGeneration,T.lastModTime=T.lastSelTime=U,T.lastOp=T.lastSelOp=S,T.lastOrigin=T.lastSelOrigin=d.origin,te||tt(c,"historyAdded")}function IN(c,d,A,S){var T=d.charAt(0);return T=="*"||T=="+"&&A.ranges.length==S.ranges.length&&A.somethingSelected()==S.somethingSelected()&&new Date-c.history.lastSelTime<=(c.cm?c.cm.options.historyEventDelay:500)}function tx(c,d,A,S){var T=c.history,U=S&&S.origin;A==T.lastSelOp||U&&T.lastSelOrigin==U&&(T.lastModTime==T.lastSelTime&&T.lastOrigin==U||IN(c,U,ve(T.done),d))?T.done[T.done.length-1]=d:_c(d,T.done),T.lastSelTime=+new Date,T.lastSelOrigin=U,T.lastSelOp=A,S&&S.clearRedo!==!1&&Fc(T.undone)}function _c(c,d){var A=ve(d);A&&A.ranges&&A.equals(c)||d.push(c)}function rx(c,d,A,S){var T=d["spans_"+c.id],U=0;c.iter(Math.max(c.first,A),Math.min(c.first+c.size,S),function(G){G.markedSpans&&((T||(T=d["spans_"+c.id]={}))[U]=G.markedSpans),++U})}function FN(c){if(!c)return null;for(var d,A=0;A-1&&(ve(te)[Ie]=se[Ie],delete se[Ie])}}return S}function pv(c,d,A,S){if(S){var T=c.anchor;if(A){var U=Fe(d,T)<0;U!=Fe(A,T)<0?(T=d,d=A):U!=Fe(d,A)<0&&(d=A)}return new Ir(T,d)}else return new Ir(A||d,d)}function kc(c,d,A,S,T){T==null&&(T=c.cm&&(c.cm.display.shift||c.extend)),di(c,new Co([pv(c.sel.primary(),d,A,T)],0),S)}function mv(c,d,A){for(var S=[],T=c.cm&&(c.cm.display.shift||c.extend),U=0;U=d.ch:te.to>d.ch))){if(T&&(tt(oe,"beforeCursorEnter"),oe.explicitlyCleared))if(U.markedSpans){--G;continue}else break;if(!oe.atomic)continue;if(A){var Ie=oe.find(S<0?1:-1),Ze=void 0;if((S<0?Ae:se)&&(Ie=qc(c,Ie,-S,Ie&&Ie.line==d.line?U:null)),Ie&&Ie.line==d.line&&(Ze=Fe(Ie,A))&&(S<0?Ze<0:Ze>0))return rf(c,Ie,d,S,T)}var $e=oe.find(S<0?-1:1);return(S<0?se:Ae)&&($e=qc(c,$e,S,$e.line==d.line?U:null)),$e?rf(c,$e,d,S,T):null}}return d}function Rc(c,d,A,S,T){var U=S||1,G=rf(c,d,A,U,T)||!T&&rf(c,d,A,U,!0)||rf(c,d,A,-U,T)||!T&&rf(c,d,A,-U,!0);return G||(c.cantEdit=!0,nt(c.first,0))}function qc(c,d,A,S){return A<0&&d.ch==0?d.line>c.first?Mt(c,nt(d.line-1)):null:A>0&&d.ch==(S||zt(c,d.line)).text.length?d.line=0;--T)Sm(c,{from:S[T].from,to:S[T].to,text:T?[""]:d.text,origin:d.origin});else Sm(c,d)}}function Sm(c,d){if(!(d.text.length==1&&d.text[0]==""&&Fe(d.from,d.to)==0)){var A=Oc(c,d);ex(c,d,A,c.cm?c.cm.curOp.id:NaN),zc(c,d,A,Xt(c,d));var S=[];lu(c,function(T,U){!U&&Se(S,T.history)==-1&&(xv(T.history,d),S.push(T.history)),zc(T,d,null,Xt(T,d))})}}function Am(c,d,A){var S=c.cm&&c.cm.state.suppressEdits;if(!(S&&!A)){for(var T=c.history,U,G=c.sel,te=d=="undo"?T.done:T.undone,oe=d=="undo"?T.undone:T.done,se=0;se=0;--$e){var st=Ze($e);if(st)return st.v}}}}function pu(c,d){if(d!=0&&(c.first+=d,c.sel=new Co(Re(c.sel.ranges,function(T){return new Ir(nt(T.anchor.line+d,T.anchor.ch),nt(T.head.line+d,T.head.ch))}),c.sel.primIndex),c.cm)){$i(c.cm,c.first,c.first-d,d);for(var A=c.cm.display,S=A.viewFrom;Sc.lastLine())){if(d.from.lineU&&(d={from:d.from,to:nt(U,zt(c,U).text.length),text:[d.text[0]],origin:d.origin}),d.removed=jo(c,d.from,d.to),A||(A=Oc(c,d)),c.cm?_N(c.cm,d,S):Wi(c,d,S),Lc(c,A,Be),c.cantEdit&&Rc(c,nt(c.firstLine(),0))&&(c.cantEdit=!1)}}function _N(c,d,A){var S=c.doc,T=c.display,U=d.from,G=d.to,te=!1,oe=U.line;c.options.lineWrapping||(oe=ue(ta(zt(S,U.line))),S.iter(oe,G.line+1,function($e){if($e==T.maxLine)return te=!0,!0})),S.sel.contains(d.from,d.to)>-1&&kt(c),Wi(S,d,A,Xl(c)),c.options.lineWrapping||(S.iter(oe,U.line+d.text.length,function($e){var st=nm($e);st>T.maxLineLength&&(T.maxLine=$e,T.maxLineLength=st,T.maxLineChanged=!0,te=!1)}),te&&(c.curOp.updateMaxLine=!0)),em(S,U.line),rl(c,400);var se=d.text.length-(G.line-U.line)-1;d.full?$i(c):U.line==G.line&&d.text.length==1&&!Q1(c.doc,d)?ds(c,U.line,"text"):$i(c,U.line,G.line+1,se);var Ae=ur(c,"changes"),Ie=ur(c,"change");if(Ie||Ae){var Ze={from:U,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 sl(c,d,A,S,T){var U;S||(S=A),Fe(S,A)<0&&(U=[S,A],A=U[0],S=U[1]),typeof d=="string"&&(d=c.splitLines(d)),xs(c,{from:A,to:S,text:d,origin:T})}function sx(c,d,A,S){A1||!(this.children[0]instanceof mu))){var te=[];this.collapse(te),this.children=[new mu(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,A){for(var S=0;Sc.display.maxLineLength&&(c.display.maxLine=se,c.display.maxLineLength=Ae,c.display.maxLineChanged=!0)}S!=null&&c&&this.collapsed&&$i(c,S,T+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,c&&ax(c.doc)),c&&Wn(c,"markerCleared",c,this,S,T),d&&gs(c),this.parent&&this.parent.clear()}},hu.prototype.find=function(c,d){c==null&&this.type=="bookmark"&&(c=1);for(var A,S,T=0;T0||G==0&&U.clearWhenEmpty!==!1)return U;if(U.replacedWith&&(U.collapsed=!0,U.widgetNode=ee("span",[U.replacedWith],"CodeMirror-widget"),S.handleMouseEvents||U.widgetNode.setAttribute("cm-ignore-events","true"),S.insertLeft&&(U.widgetNode.insertLeft=!0)),U.collapsed){if(y1(c,d.line,d,A,U)||d.line!=A.line&&y1(c,A.line,d,A,U))throw new Error("Inserting collapsed marker partially overlapping an existing one");Wu()}U.addToHistory&&ex(c,{from:d,to:A,origin:"markText"},c.sel,NaN);var te=d.line,oe=c.cm,se;if(c.iter(te,A.line+1,function(Ie){oe&&U.collapsed&&!oe.options.lineWrapping&&ta(Ie)==oe.display.maxLine&&(se=!0),U.collapsed&&te!=d.line&&$n(Ie,0),un(Ie,new pc(U,te==d.line?d.ch:null,te==A.line?A.ch:null),c.cm&&c.cm.curOp),++te}),U.collapsed&&c.iter(d.line,A.line+1,function(Ie){zi(c,Ie)&&$n(Ie,0)}),U.clearOnEnter&&Z(U,"beforeCursorEnter",function(){return U.clear()}),U.readOnly&&(fN(),(c.history.done.length||c.history.undone.length)&&c.clearHistory()),U.collapsed&&(U.id=++of,U.atomic=!0),oe){if(se&&(oe.curOp.updateMaxLine=!0),U.collapsed)$i(oe,d.line,A.line+1);else if(U.className||U.startStyle||U.endStyle||U.css||U.attributes||U.title)for(var Ae=d.line;Ae<=A.line;Ae++)ds(oe,Ae,"text");U.atomic&&ax(oe.doc),Wn(oe,"markerAdded",oe,U)}return U}var ws=function(c,d){this.markers=c,this.primary=d;for(var A=0;A=0;oe--)xs(this,S[oe]);te?ix(this,te):this.cm&&jl(this.cm)}),undo:ei(function(){Am(this,"undo")}),redo:ei(function(){Am(this,"redo")}),undoSelection:ei(function(){Am(this,"undo",!0)}),redoSelection:ei(function(){Am(this,"redo",!0)}),setExtending:function(c){this.extend=c},getExtending:function(){return this.extend},historySize:function(){for(var c=this.history,d=0,A=0,S=0;S=c.ch)&&d.push(T.marker.parent||T.marker)}return d},findMarks:function(c,d,A){c=Mt(this,c),d=Mt(this,d);var S=[],T=c.line;return this.iter(c.line,d.line+1,function(U){var G=U.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)&&(!A||A(oe.marker))&&S.push(oe.marker.parent||oe.marker)}++T}),S},getAllMarks:function(){var c=[];return this.iter(function(d){var A=d.markedSpans;if(A)for(var S=0;Sc)return d=c,!0;c-=U,++A}),Mt(this,nt(A,d))},indexFromPos:function(c){c=Mt(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()),Lc(d.doc,uu(A,A)),Ie)for(var Ze=0;Ze=0;te--)sl(c.doc,"",S[te].from,S[te].to,"+delete");jl(c)})}function Ev(c,d,A){var S=ne(c.text,d+A,A);return S<0||S>c.text.length?null:S}function Sv(c,d,A){var S=Ev(c,d.ch,A);return S==null?null:new nt(d.line,S,A<0?"after":"before")}function Av(c,d,A,S,T){if(c){d.doc.direction=="rtl"&&(T=-T);var U=Xe(A,d.doc.direction);if(U){var G=T<0?ve(U):U[0],te=T<0==(G.level==1),oe=te?"after":"before",se;if(G.level>0||d.doc.direction=="rtl"){var Ae=Xu(d,A);se=T<0?A.text.length-1:0;var Ie=Ao(d,Ae,se).top;se=pe(function(Ze){return Ao(d,Ae,Ze).top==Ie},T<0==(G.level==1)?G.from:G.to-1,se),oe=="before"&&(se=Ev(A,se,1))}else se=T<0?G.to:G.from;return new nt(S,se,oe)}}return new nt(S,T<0?A.text.length:0,T<0?"before":"after")}function xx(c,d,A,S){var T=Xe(d,c.doc.direction);if(!T)return Sv(d,A,S);A.ch>=d.text.length?(A.ch=d.text.length,A.sticky="before"):A.ch<=0&&(A.ch=0,A.sticky="after");var U=Qe(T,A.ch,A.sticky),G=T[U];if(c.doc.direction=="ltr"&&G.level%2==0&&(S>0?G.to>A.ch:G.from=G.from&&Ze>=Ae.begin)){var $e=Ie?"before":"after";return new nt(A.line,Ze,$e)}}var st=function(Dt,At,bt){for(var Tt=function(Yr,ti){return ti?new nt(A.line,te(Yr,1),"before"):new nt(A.line,Yr,"after")};Dt>=0&&Dt0==(Gt.level!=1),dr=Ut?bt.begin:te(bt.end,-1);if(Gt.from<=dr&&dr0?Ae.end:te(Ae.begin,-1);return yt!=null&&!(S>0&&yt==d.text.length)&&(mt=st(S>0?0:T.length-1,S,se(yt)),mt)?mt:null}var Wc={selectAll:dv,singleSelection:function(c){return c.setSelection(c.getCursor("anchor"),c.getCursor("head"),Be)},killLine:function(c){return uf(c,function(d){if(d.empty()){var A=zt(c.doc,d.head.line).text.length;return d.head.ch==A&&d.head.line0)T=new nt(T.line,T.ch+1),c.replaceRange(U.charAt(T.ch-1)+U.charAt(T.ch-2),nt(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 nt(T.line,1),c.replaceRange(U.charAt(0)+c.doc.lineSeparator()+G.charAt(G.length-1),nt(T.line-1,G.length-1),T,"+transpose"))}}A.push(new Ir(T,T))}c.setSelections(A)})},newlineAndIndent:function(c){return so(c,function(){for(var d=c.listSelections(),A=d.length-1;A>=0;A--)c.replaceRange(c.doc.lineSeparator(),d[A].anchor,d[A].head,"+input");d=c.listSelections();for(var S=0;Sc&&Fe(d,this.pos)==0&&A==this.button};var lf,Gc;function Nx(c,d){var A=+new Date;return Gc&&Gc.compare(A,c,d)?(lf=Gc=null,"triple"):lf&&lf.compare(A,c,d)?(Gc=new Iv(A,c,d),lf=null,"double"):(lf=new Iv(A,c,d),Gc=null,"single")}function Fv(c){var d=this,A=d.display;if(!(wt(d,c)||A.activeTouch&&A.input.supportsTouch())){if(A.input.ensurePolled(),A.shift=c.shiftKey,Ta(A,c)){a||(A.scroller.draggable=!1,setTimeout(function(){return A.scroller.draggable=!0},100));return}if(!_m(d,c)){var S=ia(d,c),T=Fn(c),U=S?Nx(S,T):"single";Ne(d).focus(),T==1&&d.state.selectingText&&d.state.selectingText(c),!(S&&Fm(d,T,S,U,c))&&(T==1?S?$N(d,S,U,c):Er(c)==A.scroller&&Vt(c):T==2?(S&&kc(d.doc,S),setTimeout(function(){return A.input.focus()},20)):T==3&&(R?d.display.input.onContextMenu(c):Ql(d)))}}}function Fm(c,d,A,S,T){var U="Click";return S=="double"?U="Double"+U:S=="triple"&&(U="Triple"+U),U=(d==1?"Left":d==2?"Middle":"Right")+U,Vc(c,Nv(U,T),T,function(G){if(typeof G=="string"&&(G=Wc[G]),!G)return!1;var te=!1;try{c.isReadOnly()&&(c.state.suppressEdits=!0),te=G(c,A)!=We}finally{c.state.suppressEdits=!1}return te})}function HN(c,d,A){var S=c.getOption("configureMouse"),T=S?S(c,d,A):{};if(T.unit==null){var U=I?A.shiftKey&&A.metaKey:A.altKey;T.unit=U?"rectangle":d=="single"?"char":d=="double"?"word":"line"}return(T.extend==null||c.doc.extend)&&(T.extend=c.doc.extend||A.shiftKey),T.addNew==null&&(T.addNew=M?A.metaKey:A.ctrlKey),T.moveOnDrag==null&&(T.moveOnDrag=!(M?A.altKey:A.ctrlKey)),T}function $N(c,d,A,S){u?setTimeout(Pe(nv,c),0):c.curOp.focus=Y(ye(c));var T=HN(c,A,S),U=c.doc.sel,G;c.options.dragDrop&&Aa&&!c.isReadOnly()&&A=="single"&&(G=U.contains(d))>-1&&(Fe((G=U.ranges[G]).from(),d)<0||d.xRel>0)&&(Fe(G.to(),d)>0||d.xRel<0)?WN(c,S,d,T):Sx(c,S,d,T)}function WN(c,d,A,S){var T=c.display,U=!1,G=gn(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),U||(Vt(se),S.addNew||kc(c.doc,A,null,null,S.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){U=U||Math.abs(d.clientX-se.clientX)+Math.abs(d.clientY-se.clientY)>=10},oe=function(){return U=!0};a&&(T.scroller.draggable=!0),c.state.draggingText=G,G.copy=!S.moveOnDrag,Z(T.wrapper.ownerDocument,"mouseup",G),Z(T.wrapper.ownerDocument,"mousemove",te),Z(T.scroller,"dragstart",oe),Z(T.scroller,"drop",G),c.state.delayingBlurEvent=!0,setTimeout(function(){return T.input.focus()},20),T.scroller.dragDrop&&T.scroller.dragDrop()}function Ex(c,d,A){if(A=="char")return new Ir(d,d);if(A=="word")return c.findWordAt(d);if(A=="line")return new Ir(nt(d.line,0),Mt(c.doc,nt(d.line+1,0)));var S=A(c,d);return new Ir(S.from,S.to)}function Sx(c,d,A,S){u&&Ql(c);var T=c.display,U=c.doc;Vt(d);var G,te,oe=U.sel,se=oe.ranges;if(S.addNew&&!S.extend?(te=U.sel.contains(A),te>-1?G=se[te]:G=new Ir(A,A)):(G=U.sel.primary(),te=U.sel.primIndex),S.unit=="rectangle")S.addNew||(G=new Ir(A,A)),A=ia(c,d,!0,!0),te=-1;else{var Ae=Ex(c,A,S.unit);S.extend?G=pv(G,Ae.anchor,Ae.head,S.extend):G=Ae}S.addNew?te==-1?(te=se.length,di(U,oa(c,se.concat([G]),te),{scroll:!1,origin:"*mouse"})):se.length>1&&se[te].empty()&&S.unit=="char"&&!S.extend?(di(U,oa(c,se.slice(0,te).concat(se.slice(te+1)),0),{scroll:!1,origin:"*mouse"}),oe=U.sel):Em(U,te,G,lt):(te=0,di(U,new Co([G],0),lt),oe=U.sel);var Ie=A;function Ze(bt){if(Fe(Ie,bt)!=0)if(Ie=bt,S.unit=="rectangle"){for(var Tt=[],Gt=c.options.tabSize,Ut=Oe(zt(U,A.line).text,A.ch,Gt),dr=Oe(zt(U,bt.line).text,bt.ch,Gt),Yr=Math.min(Ut,dr),ti=Math.max(Ut,dr),zr=Math.min(A.line,bt.line),Gi=Math.min(c.lastLine(),Math.max(A.line,bt.line));zr<=Gi;zr++){var Yi=zt(U,zr).text,Bn=de(Yi,Yr,Gt);Yr==ti?Tt.push(new Ir(nt(zr,Bn),nt(zr,Bn))):Yi.length>Bn&&Tt.push(new Ir(nt(zr,Bn),nt(zr,de(Yi,ti,Gt))))}Tt.length||Tt.push(new Ir(A,A)),di(U,oa(c,oe.ranges.slice(0,te).concat(Tt),te),{origin:"*mouse",scroll:!1}),c.scrollIntoView(bt)}else{var Zi=G,si=Ex(c,bt,S.unit),Vn=Zi.anchor,Ln;Fe(si.anchor,Vn)>0?(Ln=si.head,Vn=Qs(Zi.from(),si.anchor)):(Ln=si.anchor,Vn=mi(Zi.to(),si.head));var tn=oe.ranges.slice(0);tn[te]=VN(c,new Ir(Mt(U,Vn),Ln)),di(U,oa(c,tn,te),lt)}}var $e=T.wrapper.getBoundingClientRect(),st=0;function mt(bt){var Tt=++st,Gt=ia(c,bt,!0,S.unit=="rectangle");if(Gt)if(Fe(Gt,Ie)!=0){c.curOp.focus=Y(ye(c)),Ze(Gt);var Ut=Or(T,U);(Gt.line>=Ut.to||Gt.line$e.bottom?20:0;dr&&setTimeout(gn(c,function(){st==Tt&&(T.scroller.scrollTop+=dr,mt(bt))}),50)}}function yt(bt){c.state.selectingText=!1,st=1/0,bt&&(Vt(bt),T.input.focus()),Ye(T.wrapper.ownerDocument,"mousemove",Dt),Ye(T.wrapper.ownerDocument,"mouseup",At),U.history.lastSelOrigin=null}var Dt=gn(c,function(bt){bt.buttons===0||!Fn(bt)?yt(bt):mt(bt)}),At=gn(c,yt);c.state.selectingText=At,Z(T.wrapper.ownerDocument,"mousemove",Dt),Z(T.wrapper.ownerDocument,"mouseup",At)}function VN(c,d){var A=d.anchor,S=d.head,T=zt(c.doc,A.line);if(Fe(A,S)==0&&A.sticky==S.sticky)return d;var U=Xe(T);if(!U)return d;var G=Qe(U,A.ch,A.sticky),te=U[G];if(te.from!=A.ch&&te.to!=A.ch)return d;var oe=G+(te.from==A.ch==(te.level!=1)?0:1);if(oe==0||oe==U.length)return d;var se;if(S.line!=A.line)se=(S.line-A.line)*(c.doc.direction=="ltr"?1:-1)>0;else{var Ae=Qe(U,S.ch,S.sticky),Ie=Ae-G||(S.ch-A.ch)*(te.level==1?-1:1);Ae==oe-1||Ae==oe?se=Ie<0:se=Ie>0}var Ze=U[oe+(se?-1:0)],$e=se==(Ze.level==1),st=$e?Ze.from:Ze.to,mt=$e?"after":"before";return A.ch==st&&A.sticky==mt?d:new Ir(new nt(A.line,st,mt),S)}function Ax(c,d,A,S){var T,U;if(d.touches)T=d.touches[0].clientX,U=d.touches[0].clientY;else try{T=d.clientX,U=d.clientY}catch{return!1}if(T>=Math.floor(c.display.gutters.getBoundingClientRect().right))return!1;S&&Vt(d);var G=c.display,te=G.lineDiv.getBoundingClientRect();if(U>te.bottom||!ur(c,A))return tr(d);U-=te.top-G.viewOffset;for(var oe=0;oe=T){var Ae=Me(c.doc,U),Ie=c.display.gutterSpecs[oe];return tt(c,A,c,Ae,Ie.className,d),tr(d)}}}function _m(c,d){return Ax(c,d,"gutterClick",!0)}function ai(c,d){Ta(c.display,d)||Cx(c,d)||wt(c,d,"contextmenu")||R||c.display.input.onContextMenu(d)}function Cx(c,d){return ur(c,"gutterContextMenu")?Ax(c,d,"gutterContextMenu",!1):!1}function Mx(c){c.display.wrapper.className=c.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+c.options.theme.replace(/(^|\s)\s*/g," cm-s-"),xc(c)}var ff={toString:function(){return"CodeMirror.Init"}},Tx={},km={};function Ox(c){var d=c.optionHandlers;function A(S,T,U,G){c.defaults[S]=T,U&&(d[S]=G?function(te,oe,se){se!=ff&&U(te,oe,se)}:U)}c.defineOption=A,c.Init=ff,A("value","",function(S,T){return S.setValue(T)},!0),A("mode",null,function(S,T){S.doc.modeOption=T,cv(S)},!0),A("indentUnit",2,cv,!0),A("indentWithTabs",!1),A("smartIndent",!0),A("tabSize",4,function(S){Ic(S),xc(S),$i(S)},!0),A("lineSeparator",null,function(S,T){if(S.doc.lineSep=T,!!T){var U=[],G=S.doc.first;S.doc.iter(function(oe){for(var se=0;;){var Ae=oe.text.indexOf(T,se);if(Ae==-1)break;se=Ae+T.length,U.push(nt(G,Ae))}G++});for(var te=U.length-1;te>=0;te--)sl(S.doc,T,U[te],nt(U[te].line,U[te].ch+T.length))}}),A("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(S,T,U){S.state.specialChars=new RegExp(T.source+(T.test(" ")?"":"| "),"g"),U!=ff&&S.refresh()}),A("specialCharPlaceholder",mN,function(S){return S.refresh()},!0),A("electricChars",!0),A("inputStyle",O?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),A("spellcheck",!1,function(S,T){return S.getInputField().spellcheck=T},!0),A("autocorrect",!1,function(S,T){return S.getInputField().autocorrect=T},!0),A("autocapitalize",!1,function(S,T){return S.getInputField().autocapitalize=T},!0),A("rtlMoveVisually",!F),A("wholeLineUpdateBefore",!0),A("theme","default",function(S){Mx(S),Tc(S)},!0),A("keyMap","default",function(S,T,U){var G=Tm(T),te=U!=ff&&Tm(U);te&&te.detach&&te.detach(S,G),G.attach&&G.attach(S,te||null)}),A("extraKeys",null),A("configureMouse",null),A("lineWrapping",!1,YN,!0),A("gutters",[],function(S,T){S.display.gutterSpecs=bm(T,S.options.lineNumbers),Tc(S)},!0),A("fixedGutter",!0,function(S,T){S.display.gutters.style.left=T?Dc(S.display)+"px":"0",S.refresh()},!0),A("coverGutterNextToScrollbar",!1,function(S){return su(S)},!0),A("scrollbarStyle","native",function(S){U1(S),su(S),S.display.scrollbars.setScrollTop(S.doc.scrollTop),S.display.scrollbars.setScrollLeft(S.doc.scrollLeft)},!0),A("lineNumbers",!1,function(S,T){S.display.gutterSpecs=bm(S.options.gutters,T),Tc(S)},!0),A("firstLineNumber",1,Tc,!0),A("lineNumberFormatter",function(S){return S},Tc,!0),A("showCursorWhenSelecting",!1,Nc,!0),A("resetSelectionOnContextMenu",!0),A("lineWiseCopyCut",!0),A("pasteLinesPerSelection",!0),A("selectionsMayTouch",!1),A("readOnly",!1,function(S,T){T=="nocursor"&&(Qu(S),S.display.input.blur()),S.display.input.readOnlyChanged(T)}),A("screenReaderLabel",null,function(S,T){T=T===""?null:T,S.display.input.screenReaderLabelChanged(T)}),A("disableInput",!1,function(S,T){T||S.display.input.reset()},!0),A("dragDrop",!0,GN),A("allowDropFileTypes",null),A("cursorBlinkRate",530),A("cursorScrollMargin",0),A("cursorHeight",1,Nc,!0),A("singleCursorHeightPerLine",!0,Nc,!0),A("workTime",100),A("workDelay",100),A("flattenSpans",!0,Ic,!0),A("addModeClass",!1,Ic,!0),A("pollInterval",100),A("undoDepth",200,function(S,T){return S.doc.history.undoDepth=T}),A("historyEventDelay",1250),A("viewportMargin",10,function(S){return S.refresh()},!0),A("maxHighlightLength",1e4,Ic,!0),A("moveInputWithCursor",!0,function(S,T){T||S.display.input.resetPosition()}),A("tabindex",null,function(S,T){return S.display.input.getField().tabIndex=T||""}),A("autofocus",null),A("direction","ltr",function(S,T){return S.doc.setDirection(T)},!0),A("phrases",null)}function GN(c,d,A){var S=A&&A!=ff;if(!d!=!S){var T=c.display.dragFunctions,U=d?Z:Ye;U(c.display.scroller,"dragstart",T.start),U(c.display.scroller,"dragenter",T.enter),U(c.display.scroller,"dragover",T.over),U(c.display.scroller,"dragleave",T.leave),U(c.display.scroller,"drop",T.drop)}}function YN(c){c.options.lineWrapping?(le(c.display.wrapper,"CodeMirror-wrap"),c.display.sizer.style.minWidth="",c.display.sizerWidth=null):(z(c.display.wrapper,"CodeMirror-wrap"),Ud(c)),pm(c),$i(c),xc(c),setTimeout(function(){return su(c)},100)}function ln(c,d){var A=this;if(!(this instanceof ln))return new ln(c,d);this.options=d=d?Ce(d):{},Ce(Tx,d,!1);var S=d.value;typeof S=="string"?S=new Vi(S,d.mode,null,d.lineSeparator,d.direction):d.mode&&(S.modeOption=d.mode),this.doc=S;var T=new ln.inputStyles[d.inputStyle](this),U=this.display=new Y1(c,S,T,d);U.wrapper.CodeMirror=this,Mx(this),d.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),U1(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&&U.input.focus(),u&&l<11&&setTimeout(function(){return A.display.input.reset(!0)},20),Ix(this),Cm(),tl(this),this.curOp.forceUpdate=!0,fu(this,S),d.autofocus&&!O||this.hasFocus()?setTimeout(function(){A.hasFocus()&&!A.state.focused&&hm(A)},20):Qu(this);for(var G in km)km.hasOwnProperty(G)&&km[G](this,d[G],ff);V1(this),d.finishInit&&d.finishInit(this);for(var te=0;te20*20}Z(d.scroller,"touchstart",function(oe){if(!wt(c,oe)&&!U(oe)&&!_m(c,oe)){d.input.ensurePolled(),clearTimeout(A);var se=+new Date;d.activeTouch={start:se,moved:!1,prev:se-S.end<=300?S:null},oe.touches.length==1&&(d.activeTouch.left=oe.touches[0].pageX,d.activeTouch.top=oe.touches[0].pageY)}}),Z(d.scroller,"touchmove",function(){d.activeTouch&&(d.activeTouch.moved=!0)}),Z(d.scroller,"touchend",function(oe){var se=d.activeTouch;if(se&&!Ta(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 Ir(Ae,Ae):!se.prev.prev||G(se,se.prev.prev)?Ie=c.findWordAt(Ae):Ie=new Ir(nt(Ae.line,0),Mt(c.doc,nt(Ae.line+1,0))),c.setSelection(Ie.anchor,Ie.head),c.focus(),Vt(oe)}T()}),Z(d.scroller,"touchcancel",T),Z(d.scroller,"scroll",function(){d.scroller.clientHeight&&(vs(c,d.scroller.scrollTop),ju(c,d.scroller.scrollLeft,!0),tt(c,"scroll",c))}),Z(d.scroller,"mousewheel",function(oe){return X1(c,oe)}),Z(d.scroller,"DOMMouseScroll",function(oe){return X1(c,oe)}),Z(d.wrapper,"scroll",function(){return d.wrapper.scrollTop=d.wrapper.scrollLeft=0}),d.dragFunctions={enter:function(oe){wt(c,oe)||ro(oe)},over:function(oe){wt(c,oe)||(Hc(c,oe),ro(oe))},start:function(oe){return BN(c,oe)},drop:gn(c,px),leave:function(oe){wt(c,oe)||bv(c)}};var te=d.input.getField();Z(te,"keyup",function(oe){return Dx.call(c,oe)}),Z(te,"keydown",gn(c,bx)),Z(te,"keypress",gn(c,Ov)),Z(te,"focus",function(oe){return hm(c,oe)}),Z(te,"blur",function(oe){return Qu(c,oe)})}var Bm=[];ln.defineInitHook=function(c){return Bm.push(c)};function Yc(c,d,A,S){var T=c.doc,U;A==null&&(A="add"),A=="smart"&&(T.mode.indent?U=jr(c,d).state:A="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(!S&&!/\S/.test(te.text))Ae=0,A="not";else if(A=="smart"&&(Ae=T.mode.indent(U,te.text.slice(se.length),te.text),Ae==We||Ae>150)){if(!S)return;A="prev"}A=="prev"?d>T.first?Ae=Oe(zt(T,d-1).text,null,G):Ae=0:A=="add"?Ae=oe+c.options.indentUnit:A=="subtract"?Ae=oe-c.options.indentUnit:typeof A=="number"&&(Ae=oe+A),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=Qn(d),se=null;if(te&&S.ranges.length>1)if(aa&&aa.text.join(` +`)==d){if(S.ranges.length%aa.text.length==0){se=[];for(var Ae=0;Ae=0;Ze--){var $e=S.ranges[Ze],st=$e.from(),mt=$e.to();$e.empty()&&(A&&A>0?st=nt(st.line,st.ch-A):c.state.overwrite&&!te?mt=nt(mt.line,Math.min(zt(U,mt.line).text.length,mt.ch+ve(oe).length)):te&&aa&&aa.lineWise&&aa.text.join(` `)==oe.join(` -`)&&(at=mt=nt(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")};Qu(c.doc,yt),Hn(c,"inputRead",c,yt)}d&&!te&&Tx(c,d),Hl(c),c.curOp.updateInput<2&&(c.curOp.updateInput=Ie),c.curOp.typing=!0,c.state.pasteIncoming=c.state.cutIncoming=-1}function Mx(c,d){var A=c.clipboardData&&c.clipboardData.getData("Text");if(A)return c.preventDefault(),!d.isReadOnly()&&!d.options.disableInput&&d.hasFocus()&&di(d,function(){return Rm(d,A,0,null,"paste")}),!0}function Tx(c,d){if(!(!c.options.electricChars||!c.options.smartIndent))for(var A=c.doc.sel,E=A.ranges.length-1;E>=0;E--){var T=A.ranges[E];if(!(T.head.ch>100||E&&A.ranges[E-1].head.line==T.head.line)){var U=c.getModeAt(T.head),G=!1;if(U.electricChars){for(var te=0;te-1){G=ff(c,T.head.line,"smart");break}}else U.electricInput&&U.electricInput.test(zt(c.doc,T.head.line).text.slice(0,T.head.ch))&&(G=ff(c,T.head.line,"smart"));G&&Hn(c,"electricInput",c,T.head.line)}}}function Ox(c){for(var d=[],A=[],E=0;EU&&(ff(this,te.head.line,E,!0),U=te.head.line,G==this.doc.sel.primIndex&&Hl(this));else{var oe=te.from(),se=te.to(),Ae=Math.max(U,oe.line);U=Math.min(this.lastLine(),se.line-(se.ch?0:1))+1;for(var Ie=Ae;Ie0&&Am(this.doc,G,new kr(oe,Ze[G].to()),Be)}}}),getTokenAt:function(E,T){return fc(this,E,T)},getLineTokens:function(E,T){return fc(this,nt(E),T,!0)},getTokenTypeAt:function(E){E=Mt(this.doc,E);var T=b1(this,zt(this.doc,E.line)),U=0,G=(T.length-1)/2,te=E.ch,oe;if(te==0)oe=T[2];else for(;;){var se=U+G>>1;if((se?T[se*2-1]:0)>=te)G=se;else if(T[se*2+1]oe&&(E=oe,G=!0),te=zt(this.doc,E)}else te=E;return wc(this,te,{top:0,left:0},T||"page",U||G).top+(G?this.doc.height-Po(te):0)},defaultTextHeight:function(){return aa(this.display)},defaultCharWidth:function(){return ds(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(E,T,U,G,te){var oe=this.display;E=Yi(this,Mt(this.doc,E));var se=E.bottom,Ae=E.left;if(T.style.position="absolute",T.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(T),oe.sizer.appendChild(T),G=="over")se=E.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"||E.bottom+T.offsetHeight>Ie)&&E.top>T.offsetHeight?se=E.top-T.offsetHeight:E.bottom+T.offsetHeight<=Ie&&(se=E.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"),U&&yN(this,{left:Ae,top:se,right:Ae+T.offsetWidth,bottom:se+T.offsetHeight})},triggerOnKeyDown:$n(xx),triggerOnKeyPress:$n(wx),triggerOnKeyUp:yx,triggerOnMouseDown:$n(Lv),execCommand:function(E){if(af.hasOwnProperty(E))return af[E].call(null,this)},triggerElectric:$n(function(E){Tx(this,E)}),findPosH:function(E,T,U,G){var te=1;T<0&&(te=-1,T=-T);for(var oe=Mt(this.doc,E),se=0;se0&&Ae(U.charAt(G-1));)--G;for(;te.5||this.options.lineWrapping)&&fm(this),tt(this,"refresh",this)}),swapDoc:$n(function(E){var T=this.doc;return T.cm=null,this.state.selectingText&&this.state.selectingText(),J1(this,E),yc(this),this.display.input.reset(),Ac(this,E.scrollLeft,E.scrollTop),this.curOp.forceScroll=!0,Hn(this,"swapDoc",this,T),T}),phrase:function(E){var T=this.options.phrases;return T&&Object.prototype.hasOwnProperty.call(T,E)?T[E]:E},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}},Vr(c),c.registerHelper=function(E,T,U){A.hasOwnProperty(E)||(A[E]=c[E]={_global:[]}),A[E][T]=U},c.registerGlobalHelper=function(E,T,U,G){c.registerHelper(E,T,G),A[E]._global.push({pred:U,val:G})}}function zv(c,d,A,E,T){var U=d,G=A,te=zt(c,d.line),oe=T&&c.direction=="rtl"?-A:A;function se(){var At=d.line+oe;return At=c.first+c.size?!1:(d=new nt(At,d.ch,d.sticky),te=zt(c,At))}function Ae(At){var bt;if(E=="codepoint"){var Ot=te.text.charCodeAt(d.ch+(A>0?0:-1));if(isNaN(Ot))bt=null;else{var Kt=A>0?Ot>=55296&&Ot<56320:Ot>=56320&&Ot<57343;bt=new nt(d.line,Math.max(0,Math.min(te.text.length,d.ch+A*(Kt?2:1))),-A)}}else T?bt=LN(c.cm,te,d,A):bt=Fv(te,d,A);if(bt==null)if(!At&&se())d=_v(T,c.cm,te,d.line,oe);else return!1;else d=bt;return!0}if(E=="char"||E=="codepoint")Ae();else if(E=="column")Ae(!0);else if(E=="word"||E=="group")for(var Ie=null,Ze=E=="group",$e=c.cm&&c.cm.getHelper(d,"wordChars"),at=!0;!(A<0&&!Ae(!at));at=!1){var mt=te.text.charAt(d.ch)||` +`)&&(st=mt=nt(st.line,0)));var yt={from:st,to:mt,text:se?se[Ze%se.length]:oe,origin:T||(te?"paste":c.state.cutIncoming>G?"cut":"+input")};xs(c.doc,yt),Wn(c,"inputRead",c,yt)}d&&!te&&_x(c,d),jl(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 A=c.clipboardData&&c.clipboardData.getData("Text");if(A)return c.preventDefault(),!d.isReadOnly()&&!d.options.disableInput&&d.hasFocus()&&so(d,function(){return _v(d,A,0,null,"paste")}),!0}function _x(c,d){if(!(!c.options.electricChars||!c.options.smartIndent))for(var A=c.doc.sel,S=A.ranges.length-1;S>=0;S--){var T=A.ranges[S];if(!(T.head.ch>100||S&&A.ranges[S-1].head.line==T.head.line)){var U=c.getModeAt(T.head),G=!1;if(U.electricChars){for(var te=0;te-1){G=Yc(c,T.head.line,"smart");break}}else U.electricInput&&U.electricInput.test(zt(c.doc,T.head.line).text.slice(0,T.head.ch))&&(G=Yc(c,T.head.line,"smart"));G&&Wn(c,"electricInput",c,T.head.line)}}}function Lm(c){for(var d=[],A=[],S=0;SU&&(Yc(this,te.head.line,S,!0),U=te.head.line,G==this.doc.sel.primIndex&&jl(this));else{var oe=te.from(),se=te.to(),Ae=Math.max(U,oe.line);U=Math.min(this.lastLine(),se.line-(se.ch?0:1))+1;for(var Ie=Ae;Ie0&&Em(this.doc,G,new Ir(oe,Ze[G].to()),Be)}}}),getTokenAt:function(S,T){return lc(this,S,T)},getLineTokens:function(S,T){return lc(this,nt(S),T,!0)},getTokenTypeAt:function(S){S=Mt(this.doc,S);var T=g1(this,zt(this.doc,S.line)),U=0,G=(T.length-1)/2,te=S.ch,oe;if(te==0)oe=T[2];else for(;;){var se=U+G>>1;if((se?T[se*2-1]:0)>=te)G=se;else if(T[se*2+1]oe&&(S=oe,G=!0),te=zt(this.doc,S)}else te=S;return yc(this,te,{top:0,left:0},T||"page",U||G).top+(G?this.doc.height-Po(te):0)},defaultTextHeight:function(){return na(this.display)},defaultCharWidth:function(){return hs(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(S,T,U,G,te){var oe=this.display;S=Hi(this,Mt(this.doc,S));var se=S.bottom,Ae=S.left;if(T.style.position="absolute",T.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(T),oe.sizer.appendChild(T),G=="over")se=S.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"||S.bottom+T.offsetHeight>Ie)&&S.top>T.offsetHeight?se=S.top-T.offsetHeight:S.bottom+T.offsetHeight<=Ie&&(se=S.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"),U&&DN(this,{left:Ae,top:se,right:Ae+T.offsetWidth,bottom:se+T.offsetHeight})},triggerOnKeyDown:hi(bx),triggerOnKeyPress:hi(Ov),triggerOnKeyUp:Dx,triggerOnMouseDown:hi(Fv),execCommand:function(S){if(Wc.hasOwnProperty(S))return Wc[S].call(null,this)},triggerElectric:hi(function(S){_x(this,S)}),findPosH:function(S,T,U,G){var te=1;T<0&&(te=-1,T=-T);for(var oe=Mt(this.doc,S),se=0;se0&&Ae(U.charAt(G-1));)--G;for(;te.5||this.options.lineWrapping)&&pm(this),tt(this,"refresh",this)}),swapDoc:hi(function(S){var T=this.doc;return T.cm=null,this.state.selectingText&&this.state.selectingText(),fu(this,S),xc(this),this.display.input.reset(),Sc(this,S.scrollLeft,S.scrollTop),this.curOp.forceScroll=!0,Wn(this,"swapDoc",this,T),T}),phrase:function(S){var T=this.options.phrases;return T&&Object.prototype.hasOwnProperty.call(T,S)?T[S]:S},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(S,T,U){A.hasOwnProperty(S)||(A[S]=c[S]={_global:[]}),A[S][T]=U},c.registerGlobalHelper=function(S,T,U,G){c.registerHelper(S,T,G),A[S]._global.push({pred:U,val:G})}}function Bv(c,d,A,S,T){var U=d,G=A,te=zt(c,d.line),oe=T&&c.direction=="rtl"?-A:A;function se(){var At=d.line+oe;return At=c.first+c.size?!1:(d=new nt(At,d.ch,d.sticky),te=zt(c,At))}function Ae(At){var bt;if(S=="codepoint"){var Tt=te.text.charCodeAt(d.ch+(A>0?0:-1));if(isNaN(Tt))bt=null;else{var Gt=A>0?Tt>=55296&&Tt<56320:Tt>=56320&&Tt<57343;bt=new nt(d.line,Math.max(0,Math.min(te.text.length,d.ch+A*(Gt?2:1))),-A)}}else T?bt=xx(c.cm,te,d,A):bt=Sv(te,d,A);if(bt==null)if(!At&&se())d=Av(T,c.cm,te,d.line,oe);else return!1;else d=bt;return!0}if(S=="char"||S=="codepoint")Ae();else if(S=="column")Ae(!0);else if(S=="word"||S=="group")for(var Ie=null,Ze=S=="group",$e=c.cm&&c.cm.getHelper(d,"wordChars"),st=!0;!(A<0&&!Ae(!st));st=!1){var mt=te.text.charAt(d.ch)||` `,yt=Lt(mt,$e)?"w":Ze&&mt==` -`?"n":!Ze||/\s/.test(mt)?null:"p";if(Ze&&!at&&!yt&&(yt="s"),Ie&&Ie!=yt){A<0&&(A=1,Ae(),d.sticky="after");break}if(yt&&(Ie=yt),A>0&&!Ae(!at))break}var Dt=Mm(c,d,U,G,!0);return Ar(U,Dt)&&(Dt.hitSide=!0),Dt}function Fx(c,d,A,E){var T=c.doc,U=d.left,G;if(E=="page"){var te=Math.min(c.display.wrapper.clientHeight,Ne(c).innerHeight||T(c).documentElement.clientHeight),oe=Math.max(te-.5*aa(c.display),3);G=(A>0?d.bottom:d.top)+A*oe}else E=="line"&&(G=A>0?d.bottom+3:d.top-3);for(var se;se=rv(c,U,G),!!se.outside;){if(A<0?G<=0:G>=T.height){se.hitSide=!0;break}G+=A*5}return se}var qr=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};qr.prototype.init=function(c){var d=this,A=this,E=A.cm,T=A.div=c.lineDiv;T.contentEditable=!0,Gc(T,E.options.spellcheck,E.options.autocorrect,E.options.autocapitalize);function U(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}Y(T,"paste",function(te){!U(te)||wt(E,te)||Mx(te,E)||l<=11&&setTimeout(ri(E,function(){return d.updateFromDOM()}),20)}),Y(T,"compositionstart",function(te){d.composing={data:te.data,done:!1}}),Y(T,"compositionupdate",function(te){d.composing||(d.composing={data:te.data,done:!1})}),Y(T,"compositionend",function(te){d.composing&&(te.data!=d.composing.data&&d.readFromDOMSoon(),d.composing.done=!0)}),Y(T,"touchstart",function(){return A.forceCompositionEnd()}),Y(T,"input",function(){d.composing||d.readFromDOMSoon()});function G(te){if(!(!U(te)||wt(E,te))){if(E.somethingSelected())Pm({lineWise:!1,text:E.getSelections()}),te.type=="cut"&&E.replaceSelection("",null,"cut");else if(E.options.lineWiseCopyCut){var oe=Ox(E);Pm({lineWise:!0,text:oe.text}),te.type=="cut"&&E.operation(function(){E.setSelections(oe.ranges,0,Be),E.replaceSelection("",null,"cut")})}else return;if(te.clipboardData){te.clipboardData.clearData();var se=la.text.join(` -`);if(te.clipboardData.setData("Text",se),te.clipboardData.getData("Text")==se){te.preventDefault();return}}var Ae=Ix(),Ie=Ae.firstChild;Gc(Ie),E.display.lineSpace.insertBefore(Ae,E.display.lineSpace.firstChild),Ie.value=la.text.join(` -`);var Ze=Z(ce(T));he(Ie),setTimeout(function(){E.display.lineSpace.removeChild(Ae),Ze.focus(),Ze==T&&A.showPrimarySelection()},50)}}Y(T,"copy",G),Y(T,"cut",G)},qr.prototype.screenReaderLabelChanged=function(c){c?this.div.setAttribute("aria-label",c):this.div.removeAttribute("aria-label")},qr.prototype.prepareSelection=function(){var c=H1(this.cm,!1);return c.focus=Z(ce(this.div))==this.div,c},qr.prototype.showSelection=function(c,d){!c||!this.cm.display.view.length||((c.focus||d)&&this.showPrimarySelection(),this.showMultipleSelections(c))},qr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},qr.prototype.showPrimarySelection=function(){var c=this.getSelection(),d=this.cm,A=d.doc.sel.primary(),E=A.from(),T=A.to();if(d.display.viewTo==d.display.viewFrom||E.line>=d.display.viewTo||T.line=d.display.viewFrom&&_x(d,E)||{node:te[0].measure.map[2],offset:0},se=T.linec.firstLine()&&(E=nt(E.line-1,zt(c.doc,E.line-1).length)),T.ch==zt(c.doc,T.line).text.length&&T.lined.viewTo-1)return!1;var U,G,te;E.line==d.viewFrom||(U=Vu(c,E.line))==0?(G=ue(d.view[0].line),te=d.view[0].node):(G=ue(d.view[U].line),te=d.view[U-1].node.nextSibling);var oe=Vu(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(KN(c,te,Ae,G,se)),Ze=ra(c.doc,nt(G,0),nt(se,zt(c.doc,se).text.length));Ie.length>1&&Ze.length>1;)if(ve(Ie)==ve(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],Dt=Math.min(mt.length,yt.length);$eE.ch&&At.charCodeAt(At.length-at-1)==bt.charCodeAt(bt.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 Kt=nt(G,$e),Vt=nt(se,Ze.length?ve(Ze).length-at:0);if(Ie.length>1||Ie[0]||Fe(Kt,Vt))return Jl(c.doc,Ie,Kt,Vt,"+input"),!0},qr.prototype.ensurePolled=function(){this.forceCompositionEnd()},qr.prototype.reset=function(){this.forceCompositionEnd()},qr.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},qr.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))},qr.prototype.updateFromDOM=function(){var c=this;(this.cm.isReadOnly()||!this.pollContent())&&di(this.cm,function(){return Zi(c.cm)})},qr.prototype.setUneditable=function(c){c.contentEditable="false"},qr.prototype.onKeyPress=function(c){c.charCode==0||this.composing||(c.preventDefault(),this.cm.isReadOnly()||ri(this.cm,Rm)(this.cm,String.fromCharCode(c.charCode==null?c.keyCode:c.charCode),0))},qr.prototype.readOnlyChanged=function(c){this.div.contentEditable=String(c!="nocursor")},qr.prototype.onContextMenu=function(){},qr.prototype.resetPosition=function(){},qr.prototype.needsContentAttribute=!0;function _x(c,d){var A=sm(c,d.line);if(!A||A.hidden)return null;var E=zt(c.doc,d.line),T=tv(A,E,d.line),U=Xe(E,c.doc.direction),G="left";if(U){var te=Qe(U,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 XN(c){for(var d=c;d;d=d.parentNode)if(/CodeMirror-gutter-wrapper/.test(d.className))return!0;return!1}function cf(c,d){return d&&(c.bad=!0),c}function KN(c,d,A,E,T){var U="",G=!1,te=c.doc.lineSeparator(),oe=!1;function se($e){return function(at){return at.id==$e}}function Ae(){G&&(U+=te,oe&&(U+=te),G=oe=!1)}function Ie($e){$e&&(Ae(),U+=$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 Dt=c.findMarks(nt(E,0),nt(T+1,0),se(+mt));Dt.length&&(yt=Dt[0].find(0))&&Ie(ra(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 bt=0;bt<$e.childNodes.length;bt++)Ze($e.childNodes[bt]);/^(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!=A;)d=d.nextSibling,oe=!1;return U}function qm(c,d,A){var E;if(d==c.display.lineDiv){if(E=c.display.lineDiv.childNodes[A],!E)return cf(c.clipPos(nt(c.display.viewTo-1)),!0);d=null,A=0}else for(E=d;;E=E.parentNode){if(!E||E==c.display.lineDiv)return null;if(E.parentNode&&E.parentNode==c.display.lineDiv)break}for(var T=0;T=9&&d.hasSelection&&(d.hasSelection=null),A.poll()}),Y(T,"paste",function(G){wt(E,G)||Mx(G,E)||(E.state.pasteIncoming=+new Date,A.fastPoll())});function U(G){if(!wt(E,G)){if(E.somethingSelected())Pm({lineWise:!1,text:E.getSelections()});else if(E.options.lineWiseCopyCut){var te=Ox(E);Pm({lineWise:!0,text:te.text}),G.type=="cut"?E.setSelections(te.ranges,null,Be):(A.prevInput="",T.value=te.text.join(` -`),he(T))}else return;G.type=="cut"&&(E.state.cutIncoming=+new Date)}}Y(T,"cut",U),Y(T,"copy",U),Y(c.scroller,"paste",function(G){if(!(Fa(c,G)||wt(E,G))){if(!T.dispatchEvent){E.state.pasteIncoming=+new Date,A.focus();return}var te=new Event("paste");te.clipboardData=G.clipboardData,T.dispatchEvent(te)}}),Y(c.lineSpace,"selectstart",function(G){Fa(c,G)||Wt(G)}),Y(T,"compositionstart",function(){var G=E.getCursor("from");A.composing&&A.composing.range.clear(),A.composing={start:G,range:E.markText(G,E.getCursor("to"),{className:"CodeMirror-composing"})}}),Y(T,"compositionend",function(){A.composing&&(A.poll(),A.composing.range.clear(),A.composing=null)})},En.prototype.createField=function(c){this.wrapper=Ix(),this.textarea=this.wrapper.firstChild;var d=this.cm.options;Gc(this.textarea,d.spellcheck,d.autocorrect,d.autocapitalize)},En.prototype.screenReaderLabelChanged=function(c){c?this.textarea.setAttribute("aria-label",c):this.textarea.removeAttribute("aria-label")},En.prototype.prepareSelection=function(){var c=this.cm,d=c.display,A=c.doc,E=H1(c);if(c.options.moveInputWithCursor){var T=Yi(c,A.sel.primary().head,"div"),U=d.wrapper.getBoundingClientRect(),G=d.lineDiv.getBoundingClientRect();E.teTop=Math.max(0,Math.min(d.wrapper.clientHeight-10,T.top+G.top-U.top)),E.teLeft=Math.max(0,Math.min(d.wrapper.clientWidth-10,T.left+G.left-U.left))}return E},En.prototype.showSelection=function(c){var d=this.cm,A=d.display;V(A.cursorDiv,c.cursors),V(A.selectionDiv,c.selection),c.teTop!=null&&(this.wrapper.style.top=c.teTop+"px",this.wrapper.style.left=c.teLeft+"px")},En.prototype.reset=function(c){if(!(this.contextMenuPending||this.composing&&c)){var d=this.cm;if(this.resetting=!0,d.somethingSelected()){this.prevInput="";var A=d.getSelection();this.textarea.value=A,d.state.focused&&he(this.textarea),u&&l>=9&&(this.hasSelection=A)}else c||(this.prevInput=this.textarea.value="",u&&l>=9&&(this.hasSelection=null));this.resetting=!1}},En.prototype.getField=function(){return this.textarea},En.prototype.supportsTouch=function(){return!1},En.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!O||Z(ce(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},En.prototype.blur=function(){this.textarea.blur()},En.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},En.prototype.receivedFocus=function(){this.slowPoll()},En.prototype.slowPoll=function(){var c=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){c.poll(),c.cm.state.focused&&c.slowPoll()})},En.prototype.fastPoll=function(){var c=!1,d=this;d.pollingFast=!0;function A(){var E=d.poll();!E&&!c?(c=!0,d.polling.set(60,A)):(d.pollingFast=!1,d.slowPoll())}d.polling.set(20,A)},En.prototype.poll=function(){var c=this,d=this.cm,A=this.textarea,E=this.prevInput;if(this.contextMenuPending||this.resetting||!d.state.focused||ea(A)&&!E&&!this.composing||d.isReadOnly()||d.options.disableInput||d.state.keySeq)return!1;var T=A.value;if(T==E&&!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 U=T.charCodeAt(0);if(U==8203&&!E&&(E="\u200B"),U==8666)return this.reset(),this.cm.execCommand("undo")}for(var G=0,te=Math.min(E.length,T.length);G1e3||T.indexOf(` -`)>-1?A.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},En.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},En.prototype.onKeyPress=function(){u&&l>=9&&(this.hasSelection=null),this.fastPoll()},En.prototype.onContextMenu=function(c){var d=this,A=d.cm,E=A.display,T=d.textarea;d.contextMenuPending&&d.contextMenuPending();var U=sa(A,c),G=E.scroller.scrollTop;if(!U||h)return;var te=A.options.resetSelectionOnContextMenu;te&&A.doc.sel.contains(U)==-1&&ri(A,vi)(A.doc,ou(U),Be);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; +`?"n":!Ze||/\s/.test(mt)?null:"p";if(Ze&&!st&&!yt&&(yt="s"),Ie&&Ie!=yt){A<0&&(A=1,Ae(),d.sticky="after");break}if(yt&&(Ie=yt),A>0&&!Ae(!st))break}var Dt=Rc(c,d,U,G,!0);return Ar(U,Dt)&&(Dt.hitSide=!0),Dt}function Bx(c,d,A,S){var T=c.doc,U=d.left,G;if(S=="page"){var te=Math.min(c.display.wrapper.clientHeight,Ne(c).innerHeight||T(c).documentElement.clientHeight),oe=Math.max(te-.5*na(c.display),3);G=(A>0?d.bottom:d.top)+A*oe}else S=="line"&&(G=A>0?d.bottom+3:d.top-3);for(var se;se=jd(c,U,G),!!se.outside;){if(A<0?G<=0:G>=T.height){se.hitSide=!0;break}G+=A*5}return se}var qr=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};qr.prototype.init=function(c){var d=this,A=this,S=A.cm,T=A.div=c.lineDiv;T.contentEditable=!0,kv(T,S.options.spellcheck,S.options.autocorrect,S.options.autocapitalize);function U(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}Z(T,"paste",function(te){!U(te)||wt(S,te)||Fx(te,S)||l<=11&&setTimeout(gn(S,function(){return d.updateFromDOM()}),20)}),Z(T,"compositionstart",function(te){d.composing={data:te.data,done:!1}}),Z(T,"compositionupdate",function(te){d.composing||(d.composing={data:te.data,done:!1})}),Z(T,"compositionend",function(te){d.composing&&(te.data!=d.composing.data&&d.readFromDOMSoon(),d.composing.done=!0)}),Z(T,"touchstart",function(){return A.forceCompositionEnd()}),Z(T,"input",function(){d.composing||d.readFromDOMSoon()});function G(te){if(!(!U(te)||wt(S,te))){if(S.somethingSelected())Zc({lineWise:!1,text:S.getSelections()}),te.type=="cut"&&S.replaceSelection("",null,"cut");else if(S.options.lineWiseCopyCut){var oe=Lm(S);Zc({lineWise:!0,text:oe.text}),te.type=="cut"&&S.operation(function(){S.setSelections(oe.ranges,0,Be),S.replaceSelection("",null,"cut")})}else return;if(te.clipboardData){te.clipboardData.clearData();var se=aa.text.join(` +`);if(te.clipboardData.setData("Text",se),te.clipboardData.getData("Text")==se){te.preventDefault();return}}var Ae=kx(),Ie=Ae.firstChild;kv(Ie),S.display.lineSpace.insertBefore(Ae,S.display.lineSpace.firstChild),Ie.value=aa.text.join(` +`);var Ze=Y(ce(T));he(Ie),setTimeout(function(){S.display.lineSpace.removeChild(Ae),Ze.focus(),Ze==T&&A.showPrimarySelection()},50)}}Z(T,"copy",G),Z(T,"cut",G)},qr.prototype.screenReaderLabelChanged=function(c){c?this.div.setAttribute("aria-label",c):this.div.removeAttribute("aria-label")},qr.prototype.prepareSelection=function(){var c=R1(this.cm,!1);return c.focus=Y(ce(this.div))==this.div,c},qr.prototype.showSelection=function(c,d){!c||!this.cm.display.view.length||((c.focus||d)&&this.showPrimarySelection(),this.showMultipleSelections(c))},qr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},qr.prototype.showPrimarySelection=function(){var c=this.getSelection(),d=this.cm,A=d.doc.sel.primary(),S=A.from(),T=A.to();if(d.display.viewTo==d.display.viewFrom||S.line>=d.display.viewTo||T.line=d.display.viewFrom&&Lx(d,S)||{node:te[0].measure.map[2],offset:0},se=T.linec.firstLine()&&(S=nt(S.line-1,zt(c.doc,S.line-1).length)),T.ch==zt(c.doc,T.line).text.length&&T.lined.viewTo-1)return!1;var U,G,te;S.line==d.viewFrom||(U=Ju(c,S.line))==0?(G=ue(d.view[0].line),te=d.view[0].node):(G=ue(d.view[U].line),te=d.view[U-1].node.nextSibling);var oe=Ju(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(KN(c,te,Ae,G,se)),Ze=jo(c.doc,nt(G,0),nt(se,zt(c.doc,se).text.length));Ie.length>1&&Ze.length>1;)if(ve(Ie)==ve(Ze))Ie.pop(),Ze.pop(),se--;else if(Ie[0]==Ze[0])Ie.shift(),Ze.shift(),G++;else break;for(var $e=0,st=0,mt=Ie[0],yt=Ze[0],Dt=Math.min(mt.length,yt.length);$eS.ch&&At.charCodeAt(At.length-st-1)==bt.charCodeAt(bt.length-st-1);)$e--,st++;Ie[Ie.length-1]=At.slice(0,At.length-st).replace(/^\u200b+/,""),Ie[0]=Ie[0].slice($e).replace(/\u200b+$/,"");var Gt=nt(G,$e),Ut=nt(se,Ze.length?ve(Ze).length-st:0);if(Ie.length>1||Ie[0]||Fe(Gt,Ut))return sl(c.doc,Ie,Gt,Ut,"+input"),!0},qr.prototype.ensurePolled=function(){this.forceCompositionEnd()},qr.prototype.reset=function(){this.forceCompositionEnd()},qr.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},qr.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))},qr.prototype.updateFromDOM=function(){var c=this;(this.cm.isReadOnly()||!this.pollContent())&&so(this.cm,function(){return $i(c.cm)})},qr.prototype.setUneditable=function(c){c.contentEditable="false"},qr.prototype.onKeyPress=function(c){c.charCode==0||this.composing||(c.preventDefault(),this.cm.isReadOnly()||gn(this.cm,_v)(this.cm,String.fromCharCode(c.charCode==null?c.keyCode:c.charCode),0))},qr.prototype.readOnlyChanged=function(c){this.div.contentEditable=String(c!="nocursor")},qr.prototype.onContextMenu=function(){},qr.prototype.resetPosition=function(){},qr.prototype.needsContentAttribute=!0;function Lx(c,d){var A=lm(c,d.line);if(!A||A.hidden)return null;var S=zt(c.doc,d.line),T=Qd(A,S,d.line),U=Xe(S,c.doc.direction),G="left";if(U){var te=Qe(U,d.ch);G=te%2?"right":"left"}var oe=O1(T.map,d.ch,G);return oe.offset=oe.collapse=="right"?oe.end:oe.start,oe}function XN(c){for(var d=c;d;d=d.parentNode)if(/CodeMirror-gutter-wrapper/.test(d.className))return!0;return!1}function cf(c,d){return d&&(c.bad=!0),c}function KN(c,d,A,S,T){var U="",G=!1,te=c.doc.lineSeparator(),oe=!1;function se($e){return function(st){return st.id==$e}}function Ae(){G&&(U+=te,oe&&(U+=te),G=oe=!1)}function Ie($e){$e&&(Ae(),U+=$e)}function Ze($e){if($e.nodeType==1){var st=$e.getAttribute("cm-text");if(st){Ie(st);return}var mt=$e.getAttribute("cm-marker"),yt;if(mt){var Dt=c.findMarks(nt(S,0),nt(T+1,0),se(+mt));Dt.length&&(yt=Dt[0].find(0))&&Ie(jo(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 bt=0;bt<$e.childNodes.length;bt++)Ze($e.childNodes[bt]);/^(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!=A;)d=d.nextSibling,oe=!1;return U}function Pm(c,d,A){var S;if(d==c.display.lineDiv){if(S=c.display.lineDiv.childNodes[A],!S)return cf(c.clipPos(nt(c.display.viewTo-1)),!0);d=null,A=0}else for(S=d;;S=S.parentNode){if(!S||S==c.display.lineDiv)return null;if(S.parentNode&&S.parentNode==c.display.lineDiv)break}for(var T=0;T=9&&d.hasSelection&&(d.hasSelection=null),A.poll()}),Z(T,"paste",function(G){wt(S,G)||Fx(G,S)||(S.state.pasteIncoming=+new Date,A.fastPoll())});function U(G){if(!wt(S,G)){if(S.somethingSelected())Zc({lineWise:!1,text:S.getSelections()});else if(S.options.lineWiseCopyCut){var te=Lm(S);Zc({lineWise:!0,text:te.text}),G.type=="cut"?S.setSelections(te.ranges,null,Be):(A.prevInput="",T.value=te.text.join(` +`),he(T))}else return;G.type=="cut"&&(S.state.cutIncoming=+new Date)}}Z(T,"cut",U),Z(T,"copy",U),Z(c.scroller,"paste",function(G){if(!(Ta(c,G)||wt(S,G))){if(!T.dispatchEvent){S.state.pasteIncoming=+new Date,A.focus();return}var te=new Event("paste");te.clipboardData=G.clipboardData,T.dispatchEvent(te)}}),Z(c.lineSpace,"selectstart",function(G){Ta(c,G)||Vt(G)}),Z(T,"compositionstart",function(){var G=S.getCursor("from");A.composing&&A.composing.range.clear(),A.composing={start:G,range:S.markText(G,S.getCursor("to"),{className:"CodeMirror-composing"})}}),Z(T,"compositionend",function(){A.composing&&(A.poll(),A.composing.range.clear(),A.composing=null)})},Sn.prototype.createField=function(c){this.wrapper=kx(),this.textarea=this.wrapper.firstChild;var d=this.cm.options;kv(this.textarea,d.spellcheck,d.autocorrect,d.autocapitalize)},Sn.prototype.screenReaderLabelChanged=function(c){c?this.textarea.setAttribute("aria-label",c):this.textarea.removeAttribute("aria-label")},Sn.prototype.prepareSelection=function(){var c=this.cm,d=c.display,A=c.doc,S=R1(c);if(c.options.moveInputWithCursor){var T=Hi(c,A.sel.primary().head,"div"),U=d.wrapper.getBoundingClientRect(),G=d.lineDiv.getBoundingClientRect();S.teTop=Math.max(0,Math.min(d.wrapper.clientHeight-10,T.top+G.top-U.top)),S.teLeft=Math.max(0,Math.min(d.wrapper.clientWidth-10,T.left+G.left-U.left))}return S},Sn.prototype.showSelection=function(c){var d=this.cm,A=d.display;V(A.cursorDiv,c.cursors),V(A.selectionDiv,c.selection),c.teTop!=null&&(this.wrapper.style.top=c.teTop+"px",this.wrapper.style.left=c.teLeft+"px")},Sn.prototype.reset=function(c){if(!(this.contextMenuPending||this.composing&&c)){var d=this.cm;if(this.resetting=!0,d.somethingSelected()){this.prevInput="";var A=d.getSelection();this.textarea.value=A,d.state.focused&&he(this.textarea),u&&l>=9&&(this.hasSelection=A)}else c||(this.prevInput=this.textarea.value="",u&&l>=9&&(this.hasSelection=null));this.resetting=!1}},Sn.prototype.getField=function(){return this.textarea},Sn.prototype.supportsTouch=function(){return!1},Sn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!O||Y(ce(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},Sn.prototype.blur=function(){this.textarea.blur()},Sn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Sn.prototype.receivedFocus=function(){this.slowPoll()},Sn.prototype.slowPoll=function(){var c=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){c.poll(),c.cm.state.focused&&c.slowPoll()})},Sn.prototype.fastPoll=function(){var c=!1,d=this;d.pollingFast=!0;function A(){var S=d.poll();!S&&!c?(c=!0,d.polling.set(60,A)):(d.pollingFast=!1,d.slowPoll())}d.polling.set(20,A)},Sn.prototype.poll=function(){var c=this,d=this.cm,A=this.textarea,S=this.prevInput;if(this.contextMenuPending||this.resetting||!d.state.focused||Jo(A)&&!S&&!this.composing||d.isReadOnly()||d.options.disableInput||d.state.keySeq)return!1;var T=A.value;if(T==S&&!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 U=T.charCodeAt(0);if(U==8203&&!S&&(S="\u200B"),U==8666)return this.reset(),this.cm.execCommand("undo")}for(var G=0,te=Math.min(S.length,T.length);G1e3||T.indexOf(` +`)>-1?A.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},Sn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Sn.prototype.onKeyPress=function(){u&&l>=9&&(this.hasSelection=null),this.fastPoll()},Sn.prototype.onContextMenu=function(c){var d=this,A=d.cm,S=A.display,T=d.textarea;d.contextMenuPending&&d.contextMenuPending();var U=ia(A,c),G=S.scroller.scrollTop;if(!U||h)return;var te=A.options.resetSelectionOnContextMenu;te&&A.doc.sel.contains(U)==-1&&gn(A,di)(A.doc,uu(U),Be);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),E.input.focus(),a&&T.ownerDocument.defaultView.scrollTo(null,Ie),E.input.reset(),A.somethingSelected()||(T.value=d.prevInput=" "),d.contextMenuPending=$e,E.selForContextMenu=A.doc.sel,clearTimeout(E.detectingSelectAll);function Ze(){if(T.selectionStart!=null){var mt=A.somethingSelected(),yt="\u200B"+(mt?T.value:"");T.value="\u21DA",T.value=yt,d.prevInput=mt?"":"\u200B",T.selectionStart=1,T.selectionEnd=yt.length,E.selForContextMenu=A.doc.sel}}function $e(){if(d.contextMenuPending==$e&&(d.contextMenuPending=!1,d.wrapper.style.cssText=se,T.style.cssText=oe,u&&l<9&&E.scrollbars.setScrollTop(E.scroller.scrollTop=G),T.selectionStart!=null)){(!u||u&&l<9)&&Ze();var mt=0,yt=function(){E.selForContextMenu==A.doc.sel&&T.selectionStart==0&&T.selectionEnd>0&&d.prevInput=="\u200B"?ri(A,Rc)(A):mt++<10?E.detectingSelectAll=setTimeout(yt,500):(E.selForContextMenu=null,E.input.reset())};E.detectingSelectAll=setTimeout(yt,200)}}if(u&&l>=9&&Ze(),R){no(c);var at=function(){Ye(window,"mouseup",at),setTimeout($e,20)};Y(window,"mouseup",at)}else setTimeout($e,50)},En.prototype.readOnlyChanged=function(c){c||this.reset(),this.textarea.disabled=c=="nocursor",this.textarea.readOnly=!!c},En.prototype.setUneditable=function(){},En.prototype.needsContentAttribute=!1;function QN(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 A=Z(ce(c));d.autofocus=A==c||c.getAttribute("autofocus")!=null&&A==document.body}function E(){c.value=te.getValue()}var T;if(c.form&&(Y(c.form,"submit",E),!d.leaveSubmitMethodAlone)){var U=c.form;T=U.submit;try{var G=U.submit=function(){E(),U.submit=T,U.submit(),U.submit=G}}catch{}}d.finishInit=function(oe){oe.save=E,oe.getTextArea=function(){return c},oe.toTextArea=function(){oe.toTextArea=isNaN,E(),c.parentNode.removeChild(oe.getWrapperElement()),c.style.display="",c.form&&(Ye(c.form,"submit",E),!d.leaveSubmitMethodAlone&&typeof c.form.submit=="function"&&(c.form.submit=T))}},c.style.display="none";var te=sn(function(oe){return c.parentNode.insertBefore(oe,c.nextSibling)},d);return te}function jN(c){c.off=Ye,c.on=Y,c.wheelEventPixels=AN,c.Doc=Oi,c.splitLines=jn,c.countColumn=Oe,c.findColumn=de,c.isWordChar=ut,c.Pass=We,c.signal=tt,c.Line=_l,c.changeEnd=au,c.scrollbarModel=lv,c.Pos=nt,c.cmpPos=Fe,c.modes=cs,c.mimeModes=io,c.resolveMode=Ks,c.getMode=Ia,c.modeExtensions=Qt,c.extendMode=$i,c.copyState=Tr,c.startState=ao,c.innerMode=Rt,c.commands=af,c.keyMap=Ba,c.keyName=Ov,c.isModifierKey=px,c.lookupKey=nf,c.normalizeKeyMap=cx,c.StringStream=Jr,c.SharedTextMarker=fu,c.TextMarker=qo,c.LineWidget=zc,c.e_preventDefault=Wt,c.e_stopPropagation=mi,c.e_stop=no,c.addClass=le,c.contains=X,c.rmClass=z,c.keyNames=ka}VN(sn),ZN(sn);var eS="iter insert remove copy getEditor constructor".split(" ");for(var zm in Oi.prototype)Oi.prototype.hasOwnProperty(zm)&&Ee(eS,zm)<0&&(sn.prototype[zm]=function(c){return function(){return c.apply(this.doc,arguments)}}(Oi.prototype[zm]));return Vr(Oi),sn.inputStyles={textarea:En,contenteditable:qr},sn.defineMode=function(c){!sn.defaults.mode&&c!="null"&&(sn.defaults.mode=c),oo.apply(this,arguments)},sn.defineMIME=ta,sn.defineMode("null",function(){return{token:function(c){return c.skipToEnd()}}}),sn.defineMIME("text/plain","null"),sn.defineExtension=function(c,d){sn.prototype[c]=d},sn.defineDocExtension=function(c,d){Oi.prototype[c]=d},sn.fromTextArea=QN,jN(sn),sn.version="5.65.16",sn})});var S$=dt((D$,N$)=>{v();x();g();(function(e){typeof D$=="object"&&typeof N$=="object"?e(Bs()):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(_n){return{type:_n,style:"keyword"}}var Me=ue("keyword a"),st=ue("keyword b"),ht=ue("keyword c"),nt=ue("keyword d"),Fe=ue("operator"),Ar={type:"atom",style:"atom"};return{if:ue("if"),while:Me,with:Me,else:st,do:st,try:st,finally:st,return:nt,break:nt,continue:nt,new:ue("new"),delete:ht,void:ht,throw:ht,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:Fe,typeof:Fe,instanceof:Fe,true:Ar,false:Ar,null:Ar,undefined:Ar,NaN:Ar,Infinity:Ar,this:ue("this"),class:ue("class"),super:ue("atom"),yield:ht,export:ue("export"),import:ue("import"),extends:ht,await:ht}}(),p=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function y(ue){for(var Me=!1,st,ht=!1;(st=ue.next())!=null;){if(!Me){if(st=="/"&&!ht)return;st=="["?ht=!0:ht&&st=="]"&&(ht=!1)}Me=!Me&&st=="\\"}}var N,w;function D(ue,Me,st){return N=ue,w=st,Me}function b(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 D("number","number");if(st=="."&&ue.match(".."))return D("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(st))return D(st);if(st=="="&&ue.eat(">"))return D("=>","operator");if(st=="0"&&ue.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return D("number","number");if(/\d/.test(st))return ue.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),D("number","number");if(st=="/")return ue.eat("*")?(Me.tokenize=M,M(ue,Me)):ue.eat("/")?(ue.skipToEnd(),D("comment","comment")):Un(ue,Me,1)?(y(ue),ue.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),D("regexp","string-2")):(ue.eat("="),D("operator","operator",ue.current()));if(st=="`")return Me.tokenize=I,I(ue,Me);if(st=="#"&&ue.peek()=="!")return ue.skipToEnd(),D("meta","meta");if(st=="#"&&ue.eatWhile(s))return D("variable","property");if(st=="<"&&ue.match("!--")||st=="-"&&ue.match("->")&&!/\S/.test(ue.string.slice(0,ue.start)))return ue.skipToEnd(),D("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(".")?D("."):D("operator","operator",ue.current());if(s.test(st)){ue.eatWhile(s);var ht=ue.current();if(Me.lastType!="."){if(f.propertyIsEnumerable(ht)){var nt=f[ht];return D(nt.type,nt.style,ht)}if(ht=="async"&&ue.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return D("async","keyword",ht)}return D("variable","variable",ht)}}function O(ue){return function(Me,st){var ht=!1,nt;if(o&&Me.peek()=="@"&&Me.match(h))return st.tokenize=b,D("jsonld-keyword","meta");for(;(nt=Me.next())!=null&&!(nt==ue&&!ht);)ht=!ht&&nt=="\\";return ht||(st.tokenize=b),D("string","string")}}function M(ue,Me){for(var st=!1,ht;ht=ue.next();){if(ht=="/"&&st){Me.tokenize=b;break}st=ht=="*"}return D("comment","comment")}function I(ue,Me){for(var st=!1,ht;(ht=ue.next())!=null;){if(!st&&(ht=="`"||ht=="$"&&ue.eat("{"))){Me.tokenize=b;break}st=!st&&ht=="\\"}return D("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 ht=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(ue.string.slice(ue.start,st));ht&&(st=ht.index)}for(var nt=0,Fe=!1,Ar=st-1;Ar>=0;--Ar){var _n=ue.string.charAt(Ar),hi=F.indexOf(_n);if(hi>=0&&hi<3){if(!nt){++Ar;break}if(--nt==0){_n=="("&&(Fe=!0);break}}else if(hi>=3&&hi<6)++nt;else if(s.test(_n))Fe=!0;else if(/["'\/`]/.test(_n))for(;;--Ar){if(Ar==0)return;var Js=ue.string.charAt(Ar-1);if(Js==_n&&ue.string.charAt(Ar-2)!="\\"){Ar--;break}}else if(Fe&&!nt){++Ar;break}}Fe&&!nt&&(Me.fatArrowAt=Ar)}}var P={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function R(ue,Me,st,ht,nt,Fe){this.indented=ue,this.column=Me,this.type=st,this.prev=nt,this.info=Fe,ht!=null&&(this.align=ht)}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 ht=ue.context;ht;ht=ht.prev)for(var st=ht.vars;st;st=st.next)if(st.name==Me)return!0}function z(ue,Me,st,ht,nt){var Fe=ue.cc;for(H.state=ue,H.stream=nt,H.marked=null,H.cc=Fe,H.style=Me,ue.lexical.hasOwnProperty("align")||(ue.lexical.align=!0);;){var Ar=Fe.length?Fe.pop():u?Ee:Oe;if(Ar(st,ht)){for(;Fe.length&&Fe[Fe.length-1].lex;)Fe.pop()();return H.marked?H.marked:st=="variable"&&q(ue,ht)?"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=X(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 X(ue,Me){if(Me)if(Me.block){var st=X(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 ye(){H.state.context=new le(H.state.context,H.state.localVars,!0),H.state.localVars=null}De.lex=ye.lex=!0;function ce(){H.state.localVars=H.state.context.vars,H.state.context=H.state.context.prev}ce.lex=!0;function Ne(ue,Me){var st=function(){var ht=H.state,nt=ht.indented;if(ht.lexical.type=="stat")nt=ht.lexical.indented;else for(var Fe=ht.lexical;Fe&&Fe.type==")"&&Fe.align;Fe=Fe.prev)nt=Fe.indented;ht.lexical=new R(nt,H.stream.column(),ue,null,ht.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(Ne("vardef",Me),mi,Ce(";"),Pe):ue=="keyword a"?W(Ne("form"),We,Oe,Pe):ue=="keyword b"?W(Ne("form"),Oe,Pe):ue=="keyword d"?H.stream.match(/^\s*$/,!1)?W():W(Ne("stat"),lt,Ce(";"),Pe):ue=="debugger"?W(Ce(";")):ue=="{"?W(Ne("}"),ye,pe,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(Ne("form"),We,Oe,Pe,Oa)):ue=="function"?W(jn):ue=="for"?W(Ne("form"),ye,zn,Oe,ce,Pe):ue=="class"||a&&Me=="interface"?(H.marked="keyword",W(Ne("form",ue=="class"?ue:Me),cs,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(Il,Ce("operator"),Xe,Ce(";")):W(Ne("form"),tr,Ce("{"),Ne("}"),pe,Pe,Pe)):a&&Me=="namespace"?(H.marked="keyword",W(Ne("form"),Ee,Oe,Pe)):a&&Me=="abstract"?(H.marked="keyword",W(Oe)):W(Ne("stat"),et):ue=="switch"?W(Ne("form"),We,Ce("{"),Ne("}","switch"),ye,pe,Pe,Pe,ce):ue=="case"?W(Ee,Ce(":")):ue=="default"?W(Ce(":")):ue=="catch"?W(Ne("form"),De,He,Oe,Pe,ce):ue=="export"?W(Ne("stat"),Ks,Pe):ue=="import"?W(Ne("stat"),Qt,Pe):ue=="async"?W(Oe):Me=="@"?W(Ee,Oe):V(Ne("stat"),Ee,Ce(";"),Pe)}function He(ue){if(ue=="(")return W(bo,Ce(")"))}function Ee(ue,Me){return Be(ue,Me,!1)}function ze(ue,Me){return Be(ue,Me,!0)}function We(ue){return ue!="("?V():W(Ne(")"),lt,Ce(")"),Pe)}function Be(ue,Me,st){if(H.state.fatArrowAt==H.stream.start){var ht=st?Re:ve;if(ue=="(")return W(De,Ne(")"),j(bo,")"),Pe,Ce("=>"),ht,ce);if(ue=="variable")return V(De,tr,Ce("=>"),ht,ce)}var nt=st?de:ct;return P.hasOwnProperty(ue)?W(nt):ue=="function"?W(jn,nt):ue=="class"||a&&Me=="interface"?(H.marked="keyword",W(Ne("form"),sc,Pe)):ue=="keyword c"||ue=="async"?W(st?ze:Ee):ue=="("?W(Ne(")"),lt,Ce(")"),Pe,nt):ue=="operator"||ue=="spread"?W(st?ze:Ee):ue=="["?W(Ne("]"),Jr,Pe,nt):ue=="{"?ne(Lt,"}",null,nt):ue=="quasi"?V(be,nt):ue=="new"?W(ke(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 ht=st==!1?ct:de,nt=st==!1?Ee:ze;if(ue=="=>")return W(De,st?Re:ve,ce);if(ue=="operator")return/\+\+|--/.test(Me)||a&&Me=="!"?W(ht):a&&Me=="<"&&H.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?W(Ne(">"),j(Xe,">"),Pe,ht):Me=="?"?W(Ee,Ce(":"),nt):W(nt);if(ue=="quasi")return V(be,ht);if(ue!=";"){if(ue=="(")return ne(ze,")","call",ht);if(ue==".")return W(ut,ht);if(ue=="[")return W(Ne("]"),lt,Ce("]"),Pe,ht);if(a&&Me=="as")return H.marked="keyword",W(Xe,ht);if(ue=="regexp")return H.state.lastType=H.marked="operator",H.stream.backUp(H.stream.pos-H.stream.start-1),W(nt)}}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 ve(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 ke(ue){return function(Me){return Me=="."?W(ue?ot:Je):Me=="variable"&&a?W(ur,ue?de:ct):V(ue?ze:Ee)}}function Je(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 et(ue){return ue==":"?W(Pe,Oe):V(ct,Ce(";"),Pe)}function ut(ue){if(ue=="variable")return H.marked="property",W()}function Lt(ue,Me){if(ue=="async")return H.marked="property",W(Lt);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(Lt);if(ue=="[")return W(Ee,we,Ce("]"),J);if(ue=="spread")return W(ze,J);if(Me=="*")return H.marked="keyword",W(Lt);if(ue==":")return V(J)}}function fe(ue){return ue!="variable"?V(J):(H.marked="property",W(jn))}function J(ue){if(ue==":")return W(ze);if(ue=="(")return V(jn)}function j(ue,Me,st){function ht(nt,Fe){if(st?st.indexOf(nt)>-1:nt==","){var Ar=H.state.lexical;return Ar.info=="call"&&(Ar.pos=(Ar.pos||0)+1),W(function(_n,hi){return _n==Me||hi==Me?V():V(ue)},ht)}return nt==Me||Fe==Me?W():st&&st.indexOf(";")>-1?V(ue):W(Ce(Me))}return function(nt,Fe){return nt==Me||Fe==Me?W():V(ue,ht)}}function ne(ue,Me,st){for(var ht=3;ht"),Xe);if(ue=="quasi")return V(Ye,kt)}function pt(ue){if(ue=="=>")return W(Xe)}function Y(ue){return ue.match(/[\}\)\]]/)?W():ue==","||ue==";"?W(Y):V(xe,Y)}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"),Le,Ce("]"),xe);if(ue=="(")return V(ea,xe);if(!ue.match(/[;\}\)\],]/))return W()}function Ye(ue,Me){return ue!="quasi"?V():Me.slice(Me.length-2)!="${"?W(Ye):W(Xe,tt)}function tt(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 kt(ue,Me){if(Me=="<")return W(Ne(">"),j(Xe,">"),Pe,kt);if(Me=="|"||ue=="."||Me=="&")return W(Xe);if(ue=="[")return W(Xe,Ce("]"),kt);if(Me=="extends"||Me=="implements")return H.marked="keyword",W(Xe);if(Me=="?")return W(Xe,Ce(":"),Xe)}function ur(ue,Me){if(Me=="<")return W(Ne(">"),j(Xe,">"),Pe,kt)}function Vr(){return V(Xe,Wt)}function Wt(ue,Me){if(Me=="=")return W(Xe)}function mi(ue,Me){return Me=="enum"?(H.marked="keyword",W(zt)):V(tr,we,Fn,Ta)}function tr(ue,Me){if(a&&Z(Me))return H.marked="keyword",W(tr);if(ue=="variable")return ie(Me),W();if(ue=="spread")return W(tr);if(ue=="[")return ne(Sr,"]");if(ue=="{")return ne(no,"}")}function no(ue,Me){return ue=="variable"&&!H.stream.match(/^\s*:/,!1)?(ie(Me),W(Fn)):(ue=="variable"&&(H.marked="property"),ue=="spread"?W(tr):ue=="}"?V():ue=="["?W(Ee,Ce("]"),Ce(":"),no):W(Ce(":"),tr,Fn))}function Sr(){return V(tr,Fn)}function Fn(ue,Me){if(Me=="=")return W(ze)}function Ta(ue){if(ue==",")return W(mi)}function Oa(ue,Me){if(ue=="keyword b"&&Me=="else")return W(Ne("form","else"),Oe,Pe)}function zn(ue,Me){if(Me=="await")return W(zn);if(ue=="(")return W(Ne(")"),jo,Pe)}function jo(ue){return ue=="var"?W(mi,Lo):ue=="variable"?W(Lo):V(Lo)}function Lo(ue,Me){return ue==")"?W():ue==";"?W(Lo):Me=="in"||Me=="of"?(H.marked="keyword",W(Ee,Lo)):V(Ee,Lo)}function jn(ue,Me){if(Me=="*")return H.marked="keyword",W(jn);if(ue=="variable")return ie(Me),W(jn);if(ue=="(")return W(De,Ne(")"),j(bo,")"),Pe,Qe,Oe,ce);if(a&&Me=="<")return W(Ne(">"),j(Vr,">"),Pe,jn)}function ea(ue,Me){if(Me=="*")return H.marked="keyword",W(ea);if(ue=="variable")return ie(Me),W(ea);if(ue=="(")return W(De,Ne(")"),j(bo,")"),Pe,Qe,ce);if(a&&Me=="<")return W(Ne(">"),j(Vr,">"),Pe,ea)}function Il(ue,Me){if(ue=="keyword"||ue=="variable")return H.marked="type",W(Il);if(Me=="<")return W(Ne(">"),j(Vr,">"),Pe)}function bo(ue,Me){return Me=="@"&&W(Ee,bo),ue=="spread"?W(bo):a&&Z(Me)?(H.marked="keyword",W(bo)):a&&ue=="this"?W(we,Fn):V(tr,we,Fn)}function sc(ue,Me){return ue=="variable"?cs(ue,Me):io(ue,Me)}function cs(ue,Me){if(ue=="variable")return ie(Me),W(io)}function io(ue,Me){if(Me=="<")return W(Ne(">"),j(Vr,">"),Pe,io);if(Me=="extends"||Me=="implements"||a&&ue==",")return Me=="implements"&&(H.marked="keyword"),W(a?Xe:Ee,io);if(ue=="{")return W(Ne("}"),oo,Pe)}function oo(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(oo);if(ue=="variable"||H.style=="keyword")return H.marked="property",W(ta,oo);if(ue=="number"||ue=="string")return W(ta,oo);if(ue=="[")return W(Ee,we,Ce("]"),ta,oo);if(Me=="*")return H.marked="keyword",W(oo);if(a&&ue=="(")return V(ea,oo);if(ue==";"||ue==",")return W(oo);if(ue=="}")return W();if(Me=="@")return W(Ee,oo)}function ta(ue,Me){if(Me=="!"||Me=="?")return W(ta);if(ue==":")return W(Xe,Fn);if(Me=="=")return W(ze);var st=H.state.lexical.prev,ht=st&&st.info=="interface";return V(ht?ea:jn)}function Ks(ue,Me){return Me=="*"?(H.marked="keyword",W(ao,Ce(";"))):Me=="default"?(H.marked="keyword",W(Ee,Ce(";"))):ue=="{"?W(j(Ia,"}"),ao,Ce(";")):V(Oe)}function Ia(ue,Me){if(Me=="as")return H.marked="keyword",W(Ce("variable"));if(ue=="variable")return V(ze,Ia)}function Qt(ue){return ue=="string"?W():ue=="("?V(Ee):ue=="."?V(ct):V($i,Tr,ao)}function $i(ue,Me){return ue=="{"?ne($i,"}"):(ue=="variable"&&ie(Me),Me=="*"&&(H.marked="keyword"),W(Rt))}function Tr(ue){if(ue==",")return W($i,Tr)}function Rt(ue,Me){if(Me=="as")return H.marked="keyword",W($i)}function ao(ue,Me){if(Me=="from")return H.marked="keyword",W(Ee)}function Jr(ue){return ue=="]"?W():V(j(ze,"]"))}function zt(){return V(Ne("form"),tr,Ce("{"),Ne("}"),j(ra,"}"),Pe,Pe)}function ra(){return V(tr,Fn)}function Lu(ue,Me){return ue.lastType=="operator"||ue.lastType==","||p.test(Me.charAt(0))||/[,.]/.test(Me.charAt(0))}function Un(ue,Me,st){return Me.tokenize==b&&/^(?: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:b,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 N=="comment"?st:(Me.lastType=N=="operator"&&(w=="++"||w=="--")?"incdec":N,z(Me,st,N,w,ue))},indent:function(ue,Me){if(ue.tokenize==M||ue.tokenize==I)return e.Pass;if(ue.tokenize!=b)return 0;var st=Me&&Me.charAt(0),ht=ue.lexical,nt;if(!/^\s*else\b/.test(Me))for(var Fe=ue.cc.length-1;Fe>=0;--Fe){var Ar=ue.cc[Fe];if(Ar==Pe)ht=ht.prev;else if(Ar!=Oa&&Ar!=ce)break}for(;(ht.type=="stat"||ht.type=="form")&&(st=="}"||(nt=ue.cc[ue.cc.length-1])&&(nt==ct||nt==de)&&!/^[,\.=+\-*:?[\(]/.test(Me));)ht=ht.prev;i&&ht.type==")"&&ht.prev.type=="stat"&&(ht=ht.prev);var _n=ht.type,hi=st==_n;return _n=="vardef"?ht.indented+(ue.lastType=="operator"||ue.lastType==","?ht.info.length+1:0):_n=="form"&&st=="{"?ht.indented:_n=="form"?ht.indented+n:_n=="stat"?ht.indented+(Lu(ue,Me)?i||n:0):ht.info=="switch"&&!hi&&r.doubleIndentSwitch!=!1?ht.indented+(/^(?:case|default)\b/.test(Me)?n:2*n):ht.align?ht.column+(hi?0:1):ht.indented+(hi?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:Un,skipExpression:function(ue){z(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 pb=dt((E$,A$)=>{v();x();g();(function(e){typeof E$=="object"&&typeof A$=="object"?e(Bs()):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{v();x();g();(function(e){typeof C$=="object"&&typeof M$=="object"?e(Bs()):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 F$=dt((O$,I$)=>{v();x();g();(function(e){typeof O$=="object"&&typeof I$=="object"?e(Bs()):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,D,b){b&&b!=e.Init&&(w.removeKeyMap(i),w.state.closeBrackets=null),D&&(o(n(D,"pairs")),w.state.closeBrackets=D,w.addKeyMap(i))});function n(w,D){return D=="pairs"&&typeof w=="string"?w:typeof w=="object"&&w[D]!=null?w[D]:t[D]}var i={Backspace:a,Enter:s};function o(w){for(var D=0;D=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 D=l(w),b=D&&n(D,"explode");if(!b||w.getOption("disableInput"))return e.Pass;for(var O=w.listSelections(),M=0;M0?{line:F.head.line,ch:F.head.ch+D}:{line:F.head.line-1};b.push({anchor:C,head:C})}w.setSelections(b,M)}function p(w){var D=e.cmpPos(w.anchor,w.head)>0;return{anchor:new r(w.anchor.line,w.anchor.ch+(D?-1:1)),head:new r(w.head.line,w.head.ch+(D?1:-1))}}function h(w,D){var b=l(w);if(!b||w.getOption("disableInput"))return e.Pass;var O=n(b,"pairs"),M=O.indexOf(D);if(M==-1)return e.Pass;for(var I=n(b,"closeBefore"),F=n(b,"triples"),C=O.charAt(M+1)==D,P=w.listSelections(),R=M%2==0,q,z=0;z=0&&w.getRange(V,r(V.line,V.ch+3))==D+D+D?W="skipThree":W="skip";else if(C&&V.ch>1&&F.indexOf(D)>=0&&w.getRange(r(V.line,V.ch-2),V)==D+D){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!=D&&!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 X=M%2?O.charAt(M-1):D,Z=M%2?D: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{v();x();g();(function(e){typeof _$=="object"&&typeof k$=="object"?e(Bs()):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),N=p.ch-1,w=h&&h.afterCursor;w==null&&(w=/(^| )cm-fat-cursor($| )/.test(f.getWrapperElement().className));var D=i(h),b=!w&&N>=0&&D.test(y.text.charAt(N))&&n[y.text.charAt(N)]||D.test(y.text.charAt(N+1))&&n[y.text.charAt(++N)];if(!b)return null;var O=b.charAt(1)==">"?1:-1;if(h&&h.strict&&O>0!=(N==p.ch))return null;var M=f.getTokenTypeAt(r(p.line,N+1)),I=u(f,r(p.line,N+(O>0?1:0)),O,M,h);return I==null?null:{from:r(p.line,N),to:I&&I.pos,match:I&&I.ch==b.charAt(0),forward:O>0}}function u(f,p,h,y,N){for(var w=N&&N.maxScanLineLength||1e4,D=N&&N.maxScanLines||1e3,b=[],O=i(N),M=h>0?Math.min(p.line+D,f.lastLine()+1):Math.max(f.firstLine()-1,p.line-D),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)b.push(R);else if(b.length)b.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,N=h&&h.highlightNonMatching,w=[],D=f.listSelections(),b=0;b{v();x();g();(function(e){typeof L$=="object"&&typeof P$=="object"?e(Bs()):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,D,b){if(!D)return w.showHint(b);b&&b.async&&(D.async=!0);var O={hint:D};if(b)for(var M in b)O[M]=b[M];return w.showHint(O)},e.defineExtension("showHint",function(w){w=u(this,this.getCursor("start"),w);var D=this.listSelections();if(!(D.length>1)){if(this.somethingSelected()){if(!w.hint.supportsSelection)return;for(var b=0;bF.clientHeight+1:!1,Oe;setTimeout(function(){Oe=O.getScrollInfo()});var He=Pe.bottom-Ne;if(He>0){var Ee=Pe.bottom-Pe.top,ze=Pe.top-(W.bottom-W.top)-2;Ne-Pe.topze&&(F.style.height=(Ee=ze)+"px"),F.style.top=(ie=W.top-Ee)+le+"px",X=!1):F.style.height=Ne-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 Be=F.firstChild;Be;Be=Be.nextSibling)Be.style.paddingRight=O.display.nativeBarWidth+"px";if(O.addKeyMap(this.keyMap=a(w,{moveFocus:function(de,be){b.changeActive(b.selectedHint+de,be)},setFocus:function(de){b.changeActive(de)},menuSize:function(){return b.screenAmount()},length:P.length,close:function(){w.close()},pick:function(){b.pick()},data:D})),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,ve=Ue-(I.pageYOffset||(M.documentElement||M.body).scrollTop);if(X||(ve+=F.offsetHeight),ve<=be.top||ve>=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&&(b.changeActive(be.hintId),b.pick())}),e.on(F,"click",function(de){var be=s(F,de.target||de.srcElement);be&&be.hintId!=null&&(b.changeActive(be.hintId),w.options.completeOnSingleClick&&b.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(D,"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 D=this.completion.cm;this.completion.options.closeOnUnfocus&&(D.off("blur",this.onBlur),D.off("focus",this.onFocus)),D.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,D){if(w>=this.data.list.length?w=D?this.data.list.length-1:0:w<0&&(w=D?0:this.data.list.length-1),this.selectedHint!=w){var b=this.hints.childNodes[this.selectedHint];b&&(b.className=b.className.replace(" "+r,""),b.removeAttribute("aria-selected")),b=this.hints.childNodes[this.selectedHint=w],b.className+=" "+r,b.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",b.id),this.scrollToActive(),e.signal(this.data,"select",this.data.list[this.selectedHint],b)}},scrollToActive:function(){var w=this.getSelectedHintRange(),D=this.hints.childNodes[w.from],b=this.hints.childNodes[w.to],O=this.hints.firstChild;D.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=b.offsetTop+b.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,D){if(!w.somethingSelected())return D;for(var b=[],O=0;O0?F(z):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,D){var b=w.getCursor(),O=w.getTokenAt(b),M,I=e.Pos(b.line,O.start),F=b;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 U$=dt((q$,z$)=>{v();x();g();(function(e){typeof q$=="object"&&typeof z$=="object"?e(Bs(),pb()):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 OC=dt((H$,$$)=>{v();x();g();(function(e){typeof H$=="object"&&typeof $$=="object"?e(Bs()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){"use strict";var t=e.Pos;function r(D){var b=D.flags;return b??(D.ignoreCase?"i":"")+(D.global?"g":"")+(D.multiline?"m":"")}function n(D,b){for(var O=r(D),M=O,I=0;IC);P++){var R=D.getLine(F++);M=M==null?R:M+` + outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ie;a&&(Ie=T.ownerDocument.defaultView.scrollY),S.input.focus(),a&&T.ownerDocument.defaultView.scrollTo(null,Ie),S.input.reset(),A.somethingSelected()||(T.value=d.prevInput=" "),d.contextMenuPending=$e,S.selForContextMenu=A.doc.sel,clearTimeout(S.detectingSelectAll);function Ze(){if(T.selectionStart!=null){var mt=A.somethingSelected(),yt="\u200B"+(mt?T.value:"");T.value="\u21DA",T.value=yt,d.prevInput=mt?"":"\u200B",T.selectionStart=1,T.selectionEnd=yt.length,S.selForContextMenu=A.doc.sel}}function $e(){if(d.contextMenuPending==$e&&(d.contextMenuPending=!1,d.wrapper.style.cssText=se,T.style.cssText=oe,u&&l<9&&S.scrollbars.setScrollTop(S.scroller.scrollTop=G),T.selectionStart!=null)){(!u||u&&l<9)&&Ze();var mt=0,yt=function(){S.selForContextMenu==A.doc.sel&&T.selectionStart==0&&T.selectionEnd>0&&d.prevInput=="\u200B"?gn(A,dv)(A):mt++<10?S.detectingSelectAll=setTimeout(yt,500):(S.selForContextMenu=null,S.input.reset())};S.detectingSelectAll=setTimeout(yt,200)}}if(u&&l>=9&&Ze(),R){ro(c);var st=function(){Ye(window,"mouseup",st),setTimeout($e,20)};Z(window,"mouseup",st)}else setTimeout($e,50)},Sn.prototype.readOnlyChanged=function(c){c||this.reset(),this.textarea.disabled=c=="nocursor",this.textarea.readOnly=!!c},Sn.prototype.setUneditable=function(){},Sn.prototype.needsContentAttribute=!1;function QN(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 A=Y(ce(c));d.autofocus=A==c||c.getAttribute("autofocus")!=null&&A==document.body}function S(){c.value=te.getValue()}var T;if(c.form&&(Z(c.form,"submit",S),!d.leaveSubmitMethodAlone)){var U=c.form;T=U.submit;try{var G=U.submit=function(){S(),U.submit=T,U.submit(),U.submit=G}}catch{}}d.finishInit=function(oe){oe.save=S,oe.getTextArea=function(){return c},oe.toTextArea=function(){oe.toTextArea=isNaN,S(),c.parentNode.removeChild(oe.getWrapperElement()),c.style.display="",c.form&&(Ye(c.form,"submit",S),!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 jN(c){c.off=Ye,c.on=Z,c.wheelEventPixels=TN,c.Doc=Vi,c.splitLines=Qn,c.countColumn=Oe,c.findColumn=de,c.isWordChar=ut,c.Pass=We,c.signal=tt,c.Line=Wl,c.changeEnd=Mo,c.scrollbarModel=z1,c.Pos=nt,c.cmpPos=Fe,c.modes=fs,c.mimeModes=no,c.resolveMode=Js,c.getMode=Ma,c.modeExtensions=Qt,c.extendMode=Ri,c.copyState=Tr,c.startState=oo,c.innerMode=Rt,c.commands=Wc,c.keyMap=Fa,c.keyName=gx,c.isModifierKey=vx,c.lookupKey=sf,c.normalizeKeyMap=LN,c.StringStream=Qr,c.SharedTextMarker=ws,c.TextMarker=hu,c.LineWidget=ul,c.e_preventDefault=Vt,c.e_stopPropagation=pi,c.e_stop=ro,c.addClass=le,c.contains=X,c.rmClass=z,c.keyNames=du}Ox(ln),ZN(ln);var eE="iter insert remove copy getEditor constructor".split(" ");for(var Xc in Vi.prototype)Vi.prototype.hasOwnProperty(Xc)&&Se(eE,Xc)<0&&(ln.prototype[Xc]=function(c){return function(){return c.apply(this.doc,arguments)}}(Vi.prototype[Xc]));return Gr(Vi),ln.inputStyles={textarea:Sn,contenteditable:qr},ln.defineMode=function(c){!ln.defaults.mode&&c!="null"&&(ln.defaults.mode=c),io.apply(this,arguments)},ln.defineMIME=Qo,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){Vi.prototype[c]=d},ln.fromTextArea=QN,jN(ln),ln.version="5.65.16",ln})});var N$=dt((b$,D$)=>{v();x();g();(function(e){typeof b$=="object"&&typeof D$=="object"?e(Ls()):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(_n){return{type:_n,style:"keyword"}}var Me=ue("keyword a"),at=ue("keyword b"),ht=ue("keyword c"),nt=ue("keyword d"),Fe=ue("operator"),Ar={type:"atom",style:"atom"};return{if:ue("if"),while:Me,with:Me,else:at,do:at,try:at,finally:at,return:nt,break:nt,continue:nt,new:ue("new"),delete:ht,void:ht,throw:ht,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:Fe,typeof:Fe,instanceof:Fe,true:Ar,false:Ar,null:Ar,undefined:Ar,NaN:Ar,Infinity:Ar,this:ue("this"),class:ue("class"),super:ue("atom"),yield:ht,export:ue("export"),import:ue("import"),extends:ht,await:ht}}(),p=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function y(ue){for(var Me=!1,at,ht=!1;(at=ue.next())!=null;){if(!Me){if(at=="/"&&!ht)return;at=="["?ht=!0:ht&&at=="]"&&(ht=!1)}Me=!Me&&at=="\\"}}var N,w;function D(ue,Me,at){return N=ue,w=at,Me}function b(ue,Me){var at=ue.next();if(at=='"'||at=="'")return Me.tokenize=O(at),Me.tokenize(ue,Me);if(at=="."&&ue.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return D("number","number");if(at=="."&&ue.match(".."))return D("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(at))return D(at);if(at=="="&&ue.eat(">"))return D("=>","operator");if(at=="0"&&ue.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return D("number","number");if(/\d/.test(at))return ue.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),D("number","number");if(at=="/")return ue.eat("*")?(Me.tokenize=M,M(ue,Me)):ue.eat("/")?(ue.skipToEnd(),D("comment","comment")):$n(ue,Me,1)?(y(ue),ue.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),D("regexp","string-2")):(ue.eat("="),D("operator","operator",ue.current()));if(at=="`")return Me.tokenize=I,I(ue,Me);if(at=="#"&&ue.peek()=="!")return ue.skipToEnd(),D("meta","meta");if(at=="#"&&ue.eatWhile(s))return D("variable","property");if(at=="<"&&ue.match("!--")||at=="-"&&ue.match("->")&&!/\S/.test(ue.string.slice(0,ue.start)))return ue.skipToEnd(),D("comment","comment");if(p.test(at))return(at!=">"||!Me.lexical||Me.lexical.type!=">")&&(ue.eat("=")?(at=="!"||at=="=")&&ue.eat("="):/[<>*+\-|&?]/.test(at)&&(ue.eat(at),at==">"&&ue.eat(at))),at=="?"&&ue.eat(".")?D("."):D("operator","operator",ue.current());if(s.test(at)){ue.eatWhile(s);var ht=ue.current();if(Me.lastType!="."){if(f.propertyIsEnumerable(ht)){var nt=f[ht];return D(nt.type,nt.style,ht)}if(ht=="async"&&ue.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return D("async","keyword",ht)}return D("variable","variable",ht)}}function O(ue){return function(Me,at){var ht=!1,nt;if(o&&Me.peek()=="@"&&Me.match(h))return at.tokenize=b,D("jsonld-keyword","meta");for(;(nt=Me.next())!=null&&!(nt==ue&&!ht);)ht=!ht&&nt=="\\";return ht||(at.tokenize=b),D("string","string")}}function M(ue,Me){for(var at=!1,ht;ht=ue.next();){if(ht=="/"&&at){Me.tokenize=b;break}at=ht=="*"}return D("comment","comment")}function I(ue,Me){for(var at=!1,ht;(ht=ue.next())!=null;){if(!at&&(ht=="`"||ht=="$"&&ue.eat("{"))){Me.tokenize=b;break}at=!at&&ht=="\\"}return D("quasi","string-2",ue.current())}var F="([{}])";function C(ue,Me){Me.fatArrowAt&&(Me.fatArrowAt=null);var at=ue.string.indexOf("=>",ue.start);if(!(at<0)){if(a){var ht=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(ue.string.slice(ue.start,at));ht&&(at=ht.index)}for(var nt=0,Fe=!1,Ar=at-1;Ar>=0;--Ar){var _n=ue.string.charAt(Ar),mi=F.indexOf(_n);if(mi>=0&&mi<3){if(!nt){++Ar;break}if(--nt==0){_n=="("&&(Fe=!0);break}}else if(mi>=3&&mi<6)++nt;else if(s.test(_n))Fe=!0;else if(/["'\/`]/.test(_n))for(;;--Ar){if(Ar==0)return;var Qs=ue.string.charAt(Ar-1);if(Qs==_n&&ue.string.charAt(Ar-2)!="\\"){Ar--;break}}else if(Fe&&!nt){++Ar;break}}Fe&&!nt&&(Me.fatArrowAt=Ar)}}var P={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function R(ue,Me,at,ht,nt,Fe){this.indented=ue,this.column=Me,this.type=at,this.prev=nt,this.info=Fe,ht!=null&&(this.align=ht)}function q(ue,Me){if(!l)return!1;for(var at=ue.localVars;at;at=at.next)if(at.name==Me)return!0;for(var ht=ue.context;ht;ht=ht.prev)for(var at=ht.vars;at;at=at.next)if(at.name==Me)return!0}function z(ue,Me,at,ht,nt){var Fe=ue.cc;for(H.state=ue,H.stream=nt,H.marked=null,H.cc=Fe,H.style=Me,ue.lexical.hasOwnProperty("align")||(ue.lexical.align=!0);;){var Ar=Fe.length?Fe.pop():u?Se:Oe;if(Ar(at,ht)){for(;Fe.length&&Fe[Fe.length-1].lex;)Fe.pop()();return H.marked?H.marked:at=="variable"&&q(ue,ht)?"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 at=Me;at;at=at.next)if(at.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 at=X(ue,Me.context);if(at!=null){Me.context=at;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 X(ue,Me){if(Me)if(Me.block){var at=X(ue,Me.prev);return at?at==Me.prev?Me:new le(at,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 Y(ue){return ue=="public"||ue=="private"||ue=="protected"||ue=="abstract"||ue=="readonly"}function le(ue,Me,at){this.prev=ue,this.vars=Me,this.block=at}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 ye(){H.state.context=new le(H.state.context,H.state.localVars,!0),H.state.localVars=null}De.lex=ye.lex=!0;function ce(){H.state.localVars=H.state.context.vars,H.state.context=H.state.context.prev}ce.lex=!0;function Ne(ue,Me){var at=function(){var ht=H.state,nt=ht.indented;if(ht.lexical.type=="stat")nt=ht.lexical.indented;else for(var Fe=ht.lexical;Fe&&Fe.type==")"&&Fe.align;Fe=Fe.prev)nt=Fe.indented;ht.lexical=new R(nt,H.stream.column(),ue,null,ht.lexical,Me)};return at.lex=!0,at}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(at){return at==ue?W():ue==";"||at=="}"||at==")"||at=="]"?V():W(Me)}return Me}function Oe(ue,Me){return ue=="var"?W(Ne("vardef",Me),pi,Ce(";"),Pe):ue=="keyword a"?W(Ne("form"),We,Oe,Pe):ue=="keyword b"?W(Ne("form"),Oe,Pe):ue=="keyword d"?H.stream.match(/^\s*$/,!1)?W():W(Ne("stat"),lt,Ce(";"),Pe):ue=="debugger"?W(Ce(";")):ue=="{"?W(Ne("}"),ye,pe,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(Ne("form"),We,Oe,Pe,Ca)):ue=="function"?W(Qn):ue=="for"?W(Ne("form"),ye,Hn,Oe,ce,Pe):ue=="class"||a&&Me=="interface"?(H.marked="keyword",W(Ne("form",ue=="class"?ue:Me),fs,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(Ne("form"),tr,Ce("{"),Ne("}"),pe,Pe,Pe)):a&&Me=="namespace"?(H.marked="keyword",W(Ne("form"),Se,Oe,Pe)):a&&Me=="abstract"?(H.marked="keyword",W(Oe)):W(Ne("stat"),et):ue=="switch"?W(Ne("form"),We,Ce("{"),Ne("}","switch"),ye,pe,Pe,Pe,ce):ue=="case"?W(Se,Ce(":")):ue=="default"?W(Ce(":")):ue=="catch"?W(Ne("form"),De,He,Oe,Pe,ce):ue=="export"?W(Ne("stat"),Js,Pe):ue=="import"?W(Ne("stat"),Qt,Pe):ue=="async"?W(Oe):Me=="@"?W(Se,Oe):V(Ne("stat"),Se,Ce(";"),Pe)}function He(ue){if(ue=="(")return W(bo,Ce(")"))}function Se(ue,Me){return Be(ue,Me,!1)}function ze(ue,Me){return Be(ue,Me,!0)}function We(ue){return ue!="("?V():W(Ne(")"),lt,Ce(")"),Pe)}function Be(ue,Me,at){if(H.state.fatArrowAt==H.stream.start){var ht=at?Re:ve;if(ue=="(")return W(De,Ne(")"),j(bo,")"),Pe,Ce("=>"),ht,ce);if(ue=="variable")return V(De,tr,Ce("=>"),ht,ce)}var nt=at?de:ct;return P.hasOwnProperty(ue)?W(nt):ue=="function"?W(Qn,nt):ue=="class"||a&&Me=="interface"?(H.marked="keyword",W(Ne("form"),ac,Pe)):ue=="keyword c"||ue=="async"?W(at?ze:Se):ue=="("?W(Ne(")"),lt,Ce(")"),Pe,nt):ue=="operator"||ue=="spread"?W(at?ze:Se):ue=="["?W(Ne("]"),Qr,Pe,nt):ue=="{"?ne(Lt,"}",null,nt):ue=="quasi"?V(be,nt):ue=="new"?W(ke(at)):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,at){var ht=at==!1?ct:de,nt=at==!1?Se:ze;if(ue=="=>")return W(De,at?Re:ve,ce);if(ue=="operator")return/\+\+|--/.test(Me)||a&&Me=="!"?W(ht):a&&Me=="<"&&H.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?W(Ne(">"),j(Xe,">"),Pe,ht):Me=="?"?W(Se,Ce(":"),nt):W(nt);if(ue=="quasi")return V(be,ht);if(ue!=";"){if(ue=="(")return ne(ze,")","call",ht);if(ue==".")return W(ut,ht);if(ue=="[")return W(Ne("]"),lt,Ce("]"),Pe,ht);if(a&&Me=="as")return H.marked="keyword",W(Xe,ht);if(ue=="regexp")return H.state.lastType=H.marked="operator",H.stream.backUp(H.stream.pos-H.stream.start-1),W(nt)}}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 ve(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 ke(ue){return function(Me){return Me=="."?W(ue?ot:Je):Me=="variable"&&a?W(ur,ue?de:ct):V(ue?ze:Se)}}function Je(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 et(ue){return ue==":"?W(Pe,Oe):V(ct,Ce(";"),Pe)}function ut(ue){if(ue=="variable")return H.marked="property",W()}function Lt(ue,Me){if(ue=="async")return H.marked="property",W(Lt);if(ue=="variable"||H.style=="keyword"){if(H.marked="property",Me=="get"||Me=="set")return W(fe);var at;return a&&H.state.fatArrowAt==H.stream.start&&(at=H.stream.match(/^\s*:\s*/,!1))&&(H.state.fatArrowAt=H.stream.pos+at[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&&Y(Me))return H.marked="keyword",W(Lt);if(ue=="[")return W(Se,we,Ce("]"),J);if(ue=="spread")return W(ze,J);if(Me=="*")return H.marked="keyword",W(Lt);if(ue==":")return V(J)}}function fe(ue){return ue!="variable"?V(J):(H.marked="property",W(Qn))}function J(ue){if(ue==":")return W(ze);if(ue=="(")return V(Qn)}function j(ue,Me,at){function ht(nt,Fe){if(at?at.indexOf(nt)>-1:nt==","){var Ar=H.state.lexical;return Ar.info=="call"&&(Ar.pos=(Ar.pos||0)+1),W(function(_n,mi){return _n==Me||mi==Me?V():V(ue)},ht)}return nt==Me||Fe==Me?W():at&&at.indexOf(";")>-1?V(ue):W(Ce(Me))}return function(nt,Fe){return nt==Me||Fe==Me?W():V(ue,ht)}}function ne(ue,Me,at){for(var ht=3;ht"),Xe);if(ue=="quasi")return V(Ye,kt)}function pt(ue){if(ue=="=>")return W(Xe)}function Z(ue){return ue.match(/[\}\)\]]/)?W():ue==","||ue==";"?W(Z):V(xe,Z)}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"),Le,Ce("]"),xe);if(ue=="(")return V(Jo,xe);if(!ue.match(/[;\}\)\],]/))return W()}function Ye(ue,Me){return ue!="quasi"?V():Me.slice(Me.length-2)!="${"?W(Ye):W(Xe,tt)}function tt(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 kt(ue,Me){if(Me=="<")return W(Ne(">"),j(Xe,">"),Pe,kt);if(Me=="|"||ue=="."||Me=="&")return W(Xe);if(ue=="[")return W(Xe,Ce("]"),kt);if(Me=="extends"||Me=="implements")return H.marked="keyword",W(Xe);if(Me=="?")return W(Xe,Ce(":"),Xe)}function ur(ue,Me){if(Me=="<")return W(Ne(">"),j(Xe,">"),Pe,kt)}function Gr(){return V(Xe,Vt)}function Vt(ue,Me){if(Me=="=")return W(Xe)}function pi(ue,Me){return Me=="enum"?(H.marked="keyword",W(zt)):V(tr,we,Fn,Aa)}function tr(ue,Me){if(a&&Y(Me))return H.marked="keyword",W(tr);if(ue=="variable")return ie(Me),W();if(ue=="spread")return W(tr);if(ue=="[")return ne(Er,"]");if(ue=="{")return ne(ro,"}")}function ro(ue,Me){return ue=="variable"&&!H.stream.match(/^\s*:/,!1)?(ie(Me),W(Fn)):(ue=="variable"&&(H.marked="property"),ue=="spread"?W(tr):ue=="}"?V():ue=="["?W(Se,Ce("]"),Ce(":"),ro):W(Ce(":"),tr,Fn))}function Er(){return V(tr,Fn)}function Fn(ue,Me){if(Me=="=")return W(ze)}function Aa(ue){if(ue==",")return W(pi)}function Ca(ue,Me){if(ue=="keyword b"&&Me=="else")return W(Ne("form","else"),Oe,Pe)}function Hn(ue,Me){if(Me=="await")return W(Hn);if(ue=="(")return W(Ne(")"),Ko,Pe)}function Ko(ue){return ue=="var"?W(pi,Lo):ue=="variable"?W(Lo):V(Lo)}function Lo(ue,Me){return ue==")"?W():ue==";"?W(Lo):Me=="in"||Me=="of"?(H.marked="keyword",W(Se,Lo)):V(Se,Lo)}function Qn(ue,Me){if(Me=="*")return H.marked="keyword",W(Qn);if(ue=="variable")return ie(Me),W(Qn);if(ue=="(")return W(De,Ne(")"),j(bo,")"),Pe,Qe,Oe,ce);if(a&&Me=="<")return W(Ne(">"),j(Gr,">"),Pe,Qn)}function Jo(ue,Me){if(Me=="*")return H.marked="keyword",W(Jo);if(ue=="variable")return ie(Me),W(Jo);if(ue=="(")return W(De,Ne(")"),j(bo,")"),Pe,Qe,ce);if(a&&Me=="<")return W(Ne(">"),j(Gr,">"),Pe,Jo)}function Hl(ue,Me){if(ue=="keyword"||ue=="variable")return H.marked="type",W(Hl);if(Me=="<")return W(Ne(">"),j(Gr,">"),Pe)}function bo(ue,Me){return Me=="@"&&W(Se,bo),ue=="spread"?W(bo):a&&Y(Me)?(H.marked="keyword",W(bo)):a&&ue=="this"?W(we,Fn):V(tr,we,Fn)}function ac(ue,Me){return ue=="variable"?fs(ue,Me):no(ue,Me)}function fs(ue,Me){if(ue=="variable")return ie(Me),W(no)}function no(ue,Me){if(Me=="<")return W(Ne(">"),j(Gr,">"),Pe,no);if(Me=="extends"||Me=="implements"||a&&ue==",")return Me=="implements"&&(H.marked="keyword"),W(a?Xe:Se,no);if(ue=="{")return W(Ne("}"),io,Pe)}function io(ue,Me){if(ue=="async"||ue=="variable"&&(Me=="static"||Me=="get"||Me=="set"||a&&Y(Me))&&H.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return H.marked="keyword",W(io);if(ue=="variable"||H.style=="keyword")return H.marked="property",W(Qo,io);if(ue=="number"||ue=="string")return W(Qo,io);if(ue=="[")return W(Se,we,Ce("]"),Qo,io);if(Me=="*")return H.marked="keyword",W(io);if(a&&ue=="(")return V(Jo,io);if(ue==";"||ue==",")return W(io);if(ue=="}")return W();if(Me=="@")return W(Se,io)}function Qo(ue,Me){if(Me=="!"||Me=="?")return W(Qo);if(ue==":")return W(Xe,Fn);if(Me=="=")return W(ze);var at=H.state.lexical.prev,ht=at&&at.info=="interface";return V(ht?Jo:Qn)}function Js(ue,Me){return Me=="*"?(H.marked="keyword",W(oo,Ce(";"))):Me=="default"?(H.marked="keyword",W(Se,Ce(";"))):ue=="{"?W(j(Ma,"}"),oo,Ce(";")):V(Oe)}function Ma(ue,Me){if(Me=="as")return H.marked="keyword",W(Ce("variable"));if(ue=="variable")return V(ze,Ma)}function Qt(ue){return ue=="string"?W():ue=="("?V(Se):ue=="."?V(ct):V(Ri,Tr,oo)}function Ri(ue,Me){return ue=="{"?ne(Ri,"}"):(ue=="variable"&&ie(Me),Me=="*"&&(H.marked="keyword"),W(Rt))}function Tr(ue){if(ue==",")return W(Ri,Tr)}function Rt(ue,Me){if(Me=="as")return H.marked="keyword",W(Ri)}function oo(ue,Me){if(Me=="from")return H.marked="keyword",W(Se)}function Qr(ue){return ue=="]"?W():V(j(ze,"]"))}function zt(){return V(Ne("form"),tr,Ce("{"),Ne("}"),j(jo,"}"),Pe,Pe)}function jo(){return V(tr,Fn)}function Hu(ue,Me){return ue.lastType=="operator"||ue.lastType==","||p.test(Me.charAt(0))||/[,.]/.test(Me.charAt(0))}function $n(ue,Me,at){return Me.tokenize==b&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(Me.lastType)||Me.lastType=="quasi"&&/\{\s*$/.test(ue.string.slice(0,ue.pos-(at||0)))}return{startState:function(ue){var Me={tokenize:b,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 at=Me.tokenize(ue,Me);return N=="comment"?at:(Me.lastType=N=="operator"&&(w=="++"||w=="--")?"incdec":N,z(Me,at,N,w,ue))},indent:function(ue,Me){if(ue.tokenize==M||ue.tokenize==I)return e.Pass;if(ue.tokenize!=b)return 0;var at=Me&&Me.charAt(0),ht=ue.lexical,nt;if(!/^\s*else\b/.test(Me))for(var Fe=ue.cc.length-1;Fe>=0;--Fe){var Ar=ue.cc[Fe];if(Ar==Pe)ht=ht.prev;else if(Ar!=Ca&&Ar!=ce)break}for(;(ht.type=="stat"||ht.type=="form")&&(at=="}"||(nt=ue.cc[ue.cc.length-1])&&(nt==ct||nt==de)&&!/^[,\.=+\-*:?[\(]/.test(Me));)ht=ht.prev;i&&ht.type==")"&&ht.prev.type=="stat"&&(ht=ht.prev);var _n=ht.type,mi=at==_n;return _n=="vardef"?ht.indented+(ue.lastType=="operator"||ue.lastType==","?ht.info.length+1:0):_n=="form"&&at=="{"?ht.indented:_n=="form"?ht.indented+n:_n=="stat"?ht.indented+(Hu(ue,Me)?i||n:0):ht.info=="switch"&&!mi&&r.doubleIndentSwitch!=!1?ht.indented+(/^(?:case|default)\b/.test(Me)?n:2*n):ht.align?ht.column+(mi?0:1):ht.indented+(mi?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){z(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=dt((E$,S$)=>{v();x();g();(function(e){typeof E$=="object"&&typeof S$=="object"?e(Ls()):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{v();x();g();(function(e){typeof A$=="object"&&typeof C$=="object"?e(Ls()):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 I$=dt((T$,O$)=>{v();x();g();(function(e){typeof T$=="object"&&typeof O$=="object"?e(Ls()):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,D,b){b&&b!=e.Init&&(w.removeKeyMap(i),w.state.closeBrackets=null),D&&(o(n(D,"pairs")),w.state.closeBrackets=D,w.addKeyMap(i))});function n(w,D){return D=="pairs"&&typeof w=="string"?w:typeof w=="object"&&w[D]!=null?w[D]:t[D]}var i={Backspace:a,Enter:s};function o(w){for(var D=0;D=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 D=l(w),b=D&&n(D,"explode");if(!b||w.getOption("disableInput"))return e.Pass;for(var O=w.listSelections(),M=0;M0?{line:F.head.line,ch:F.head.ch+D}:{line:F.head.line-1};b.push({anchor:C,head:C})}w.setSelections(b,M)}function p(w){var D=e.cmpPos(w.anchor,w.head)>0;return{anchor:new r(w.anchor.line,w.anchor.ch+(D?-1:1)),head:new r(w.head.line,w.head.ch+(D?1:-1))}}function h(w,D){var b=l(w);if(!b||w.getOption("disableInput"))return e.Pass;var O=n(b,"pairs"),M=O.indexOf(D);if(M==-1)return e.Pass;for(var I=n(b,"closeBefore"),F=n(b,"triples"),C=O.charAt(M+1)==D,P=w.listSelections(),R=M%2==0,q,z=0;z=0&&w.getRange(V,r(V.line,V.ch+3))==D+D+D?W="skipThree":W="skip";else if(C&&V.ch>1&&F.indexOf(D)>=0&&w.getRange(r(V.line,V.ch-2),V)==D+D){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!=D&&!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 X=M%2?O.charAt(M-1):D,Y=M%2?D: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{v();x();g();(function(e){typeof F$=="object"&&typeof _$=="object"?e(Ls()):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),N=p.ch-1,w=h&&h.afterCursor;w==null&&(w=/(^| )cm-fat-cursor($| )/.test(f.getWrapperElement().className));var D=i(h),b=!w&&N>=0&&D.test(y.text.charAt(N))&&n[y.text.charAt(N)]||D.test(y.text.charAt(N+1))&&n[y.text.charAt(++N)];if(!b)return null;var O=b.charAt(1)==">"?1:-1;if(h&&h.strict&&O>0!=(N==p.ch))return null;var M=f.getTokenTypeAt(r(p.line,N+1)),I=u(f,r(p.line,N+(O>0?1:0)),O,M,h);return I==null?null:{from:r(p.line,N),to:I&&I.pos,match:I&&I.ch==b.charAt(0),forward:O>0}}function u(f,p,h,y,N){for(var w=N&&N.maxScanLineLength||1e4,D=N&&N.maxScanLines||1e3,b=[],O=i(N),M=h>0?Math.min(p.line+D,f.lastLine()+1):Math.max(f.firstLine()-1,p.line-D),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)b.push(R);else if(b.length)b.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,N=h&&h.highlightNonMatching,w=[],D=f.listSelections(),b=0;b{v();x();g();(function(e){typeof B$=="object"&&typeof L$=="object"?e(Ls()):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,D,b){if(!D)return w.showHint(b);b&&b.async&&(D.async=!0);var O={hint:D};if(b)for(var M in b)O[M]=b[M];return w.showHint(O)},e.defineExtension("showHint",function(w){w=u(this,this.getCursor("start"),w);var D=this.listSelections();if(!(D.length>1)){if(this.somethingSelected()){if(!w.hint.supportsSelection)return;for(var b=0;bF.clientHeight+1:!1,Oe;setTimeout(function(){Oe=O.getScrollInfo()});var He=Pe.bottom-Ne;if(He>0){var Se=Pe.bottom-Pe.top,ze=Pe.top-(W.bottom-W.top)-2;Ne-Pe.topze&&(F.style.height=(Se=ze)+"px"),F.style.top=(ie=W.top-Se)+le+"px",X=!1):F.style.height=Ne-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-Y,0))+"px"),Ce)for(var Be=F.firstChild;Be;Be=Be.nextSibling)Be.style.paddingRight=O.display.nativeBarWidth+"px";if(O.addKeyMap(this.keyMap=a(w,{moveFocus:function(de,be){b.changeActive(b.selectedHint+de,be)},setFocus:function(de){b.changeActive(de)},menuSize:function(){return b.screenAmount()},length:P.length,close:function(){w.close()},pick:function(){b.pick()},data:D})),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,ve=Ue-(I.pageYOffset||(M.documentElement||M.body).scrollTop);if(X||(ve+=F.offsetHeight),ve<=be.top||ve>=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&&(b.changeActive(be.hintId),b.pick())}),e.on(F,"click",function(de){var be=s(F,de.target||de.srcElement);be&&be.hintId!=null&&(b.changeActive(be.hintId),w.options.completeOnSingleClick&&b.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(D,"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 D=this.completion.cm;this.completion.options.closeOnUnfocus&&(D.off("blur",this.onBlur),D.off("focus",this.onFocus)),D.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,D){if(w>=this.data.list.length?w=D?this.data.list.length-1:0:w<0&&(w=D?0:this.data.list.length-1),this.selectedHint!=w){var b=this.hints.childNodes[this.selectedHint];b&&(b.className=b.className.replace(" "+r,""),b.removeAttribute("aria-selected")),b=this.hints.childNodes[this.selectedHint=w],b.className+=" "+r,b.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",b.id),this.scrollToActive(),e.signal(this.data,"select",this.data.list[this.selectedHint],b)}},scrollToActive:function(){var w=this.getSelectedHintRange(),D=this.hints.childNodes[w.from],b=this.hints.childNodes[w.to],O=this.hints.firstChild;D.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=b.offsetTop+b.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,D){if(!w.somethingSelected())return D;for(var b=[],O=0;O0?F(z):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,D){var b=w.getCursor(),O=w.getTokenAt(b),M,I=e.Pos(b.line,O.start),F=b;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 z$=dt((R$,q$)=>{v();x();g();(function(e){typeof R$=="object"&&typeof q$=="object"?e(Ls(),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 IC=dt((U$,H$)=>{v();x();g();(function(e){typeof U$=="object"&&typeof H$=="object"?e(Ls()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){"use strict";var t=e.Pos;function r(D){var b=D.flags;return b??(D.ignoreCase?"i":"")+(D.global?"g":"")+(D.multiline?"m":"")}function n(D,b){for(var O=r(D),M=O,I=0;IC);P++){var R=D.getLine(F++);M=M==null?R:M+` `+R}I=I*2,b.lastIndex=O.ch;var q=b.exec(M);if(q){var z=M.slice(0,q.index).split(` `),H=q[0].split(` `),V=O.line+z.length-1,W=z[z.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(D,b,O){for(var M,I=0;I<=D.length;){b.lastIndex=I;var F=b.exec(D);if(!F)break;var C=F.index+F[0].length;if(C>D.length-O)break;(!M||C>M.index+M[0].length)&&(M=F),I=F.index+1}return M}function a(D,b,O){b=n(b,"g");for(var M=O.line,I=O.ch,F=D.firstLine();M>=F;M--,I=-1){var C=D.getLine(M),P=l(C,b,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(D,b,O){if(!i(b))return a(D,b,O);b=n(b,"gm");for(var M,I=1,F=D.getLine(O.line).length-O.ch,C=O.line,P=D.firstLine();C>=P;){for(var R=0;R=P;R++){var q=D.getLine(C--);M=M==null?q:q+` `+M}I*=2;var z=l(M,b,F);if(z){var H=M.slice(0,z.index).split(` `),V=z[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:z}}}}var f,p;String.prototype.normalize?(f=function(D){return D.normalize("NFD").toLowerCase()},p=function(D){return D.normalize("NFD")}):(f=function(D){return D.toLowerCase()},p=function(D){return D});function h(D,b,O,M){if(D.length==b.length)return O;for(var I=0,F=O+Math.max(0,D.length-b.length);;){if(I==F)return I;var C=I+F>>1,P=M(D.slice(0,C)).length;if(P==O)return C;P>O?F=C:I=C+1}}function y(D,b,O,M){if(!b.length)return null;var I=M?f:p,F=I(b).split(/\r|\n\r?/);e:for(var C=O.line,P=O.ch,R=D.lastLine()+1-F.length;C<=R;C++,P=0){var q=D.getLine(C).slice(P),z=I(q);if(F.length==1){var H=z.indexOf(F[0]);if(H==-1)continue e;var O=h(q,z,H,I)+P;return{from:t(C,h(q,z,H,I)+P),to:t(C,h(q,z,H+F[0].length,I)+P)}}else{var V=z.length-F[0].length;if(z.slice(V)!=F[0])continue e;for(var W=1;W=R;C--,P=-1){var q=D.getLine(C);P>-1&&(q=q.slice(0,P));var z=I(q);if(F.length==1){var H=z.lastIndexOf(F[0]);if(H==-1)continue e;return{from:t(C,h(q,z,H,I)),to:t(C,h(q,z,H+F[0].length,I))}}else{var V=F[F.length-1];if(z.slice(0,V.length)!=V)continue e;for(var W=1,O=C-F.length+1;W(this.doc.getLine(b.line)||"").length&&(b.ch=0,b.line++)),e.cmpPos(b,this.doc.clipPos(b))!=0))return this.atOccurrence=!1;var O=this.matches(D,b);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(D?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(D,b){if(this.atOccurrence){var O=e.splitLines(D);this.doc.replaceRange(O,this.pos.from,this.pos.to,b),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(D,b,O){return new w(this.doc,D,b,O)}),e.defineDocExtension("getSearchCursor",function(D,b,O){return new w(this,D,b,O)}),e.defineExtension("selectMatches",function(D,b){for(var O=[],M=this.getSearchCursor(D,this.getCursor("from"),b);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 G$=dt((W$,V$)=>{v();x();g();(function(e){typeof W$=="object"&&typeof V$=="object"?e(Bs(),OC(),pb()):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,z){C.openDialog(P,q,{value:R,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){N(C)},onKeyDown:z,bottom:C.options.search.bottom})}function l(C,P,R,q,z){C.openDialog?C.openDialog(P,z,{value:q,selectValueOnOpen:!0,bottom:C.options.search.bottom}):z(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 z=n(C);if(z.query)return y(C,P);var H=C.getSelection()||z.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!=z.queryText&&(p(C,z,ee),z.posFrom=z.posTo=C.getCursor()),V&&(V.style.opacity=1),y(C,ie.shiftKey,function(X,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,D(C),H,W,function(ee,ie){var X=e.keyName(ee),Z=C.getOption("extraKeys"),le=Z&&Z[X]||e.keyMap[C.getOption("keyMap")][X];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,z,H),y(C,P))}else l(C,D(C),"Search for:",H,function(ee){ee&&!z.query&&C.operation(function(){p(C,z,ee),z.posFrom=z.posTo=C.getCursor(),y(C,P)})})}function y(C,P,R){C.operation(function(){var q=n(C),z=o(C,q.query,P?q.posFrom:q.posTo);!z.find(P)&&(z=o(C,q.query,P?e.Pos(C.lastLine()):e.Pos(C.firstLine(),0)),!z.find(P))||(C.setSelection(z.from(),z.to()),C.scrollIntoView({from:z.from(),to:z.to()},20),q.posFrom=z.from(),q.posTo=z.to(),R&&R(z.from(),z.to()))})}function N(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 z=2;z{v();x();g();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 sr(e){return function(){return e}}var qf=Te(()=>{v();x();g()});function nW(e){return e>1?0:e<-1?Ps:Math.acos(e)}function jC(e){return e>=1?Wg:e<=-1?-Wg:Math.asin(e)}var QC,ji,Ls,rW,Nu,go,Nr,Ri,Ps,Wg,Ja,eo=Te(()=>{v();x();g();QC=Math.abs,ji=Math.atan2,Ls=Math.cos,rW=Math.max,Nu=Math.min,go=Math.sin,Nr=Math.sqrt,Ri=1e-12,Ps=Math.PI,Wg=Ps/2,Ja=2*Ps});function iW(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return iW;let r=10**t;return function(n){this._+=n[0];for(let i=1,o=n.length;i{v();x();g();eM=Math.PI,tM=2*eM,bp=1e-6,K1e=tM-bp;Dp=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?iW:J1e(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>bp)if(!(Math.abs(p*a-s*f)>bp)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let y=n-u,N=i-l,w=a*a+s*s,D=y*y+N*N,b=Math.sqrt(w),O=Math.sqrt(h),M=o*Math.tan((eM-Math.acos((w+h-D)/(2*b*O)))/2),I=M/O,F=M/b;Math.abs(I-1)>bp&&this._append`L${t+I*f},${r+I*p}`,this._append`A${o},${o},0,0,${+(p*y>f*N)},${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)>bp||Math.abs(this._y1-f)>bp)&&this._append`L${s},${f}`,n&&(h<0&&(h=h%tM+tM),h>K1e?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>bp&&this._append`A${n},${n},0,${+(h>=eM)},${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._}};oW.prototype=Dp.prototype});var sW=Te(()=>{v();x();g();aW()});function Su(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 Dp(t)}var Hh=Te(()=>{v();x();g();sW()});function Q1e(e){return e.innerRadius}function j1e(e){return e.outerRadius}function exe(e){return e.startAngle}function txe(e){return e.endAngle}function rxe(e){return e&&e.padAngle}function nxe(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=z,q=H),{cx:R,cy:q,x01:-f,y01:-p,x11:R*(i/F-1),y11:q*(i/F-1)}}function uW(){var e=Q1e,t=j1e,r=sr(0),n=null,i=exe,o=txe,u=rxe,l=null,a=Su(s);function s(){var f,p,h=+e.apply(this,arguments),y=+t.apply(this,arguments),N=i.apply(this,arguments)-Wg,w=o.apply(this,arguments)-Wg,D=QC(w-N),b=w>N;if(l||(l=f=a()),yRi))l.moveTo(0,0);else if(D>Ja-Ri)l.moveTo(y*Ls(N),y*go(N)),l.arc(0,0,y,N,w,!b),h>Ri&&(l.moveTo(h*Ls(w),h*go(w)),l.arc(0,0,h,w,N,b));else{var O=N,M=w,I=N,F=w,C=D,P=D,R=u.apply(this,arguments)/2,q=R>Ri&&(n?+n.apply(this,arguments):Nr(h*h+y*y)),z=Nu(QC(y-h)/2,+r.apply(this,arguments)),H=z,V=z,W,ee;if(q>Ri){var ie=jC(q/h*go(R)),X=jC(q/y*go(R));(C-=ie*2)>Ri?(ie*=b?1:-1,I+=ie,F-=ie):(C=0,I=F=(N+w)/2),(P-=X*2)>Ri?(X*=b?1:-1,O+=X,M-=X):(P=0,O=M=(N+w)/2)}var Z=y*Ls(O),le=y*go(O),re=h*Ls(F),he=h*go(F);if(z>Ri){var De=y*Ls(M),ye=y*go(M),ce=h*Ls(I),Ne=h*go(I),Pe;if(DRi?V>Ri?(W=Db(ce,Ne,Z,le,y,V,b),ee=Db(De,ye,re,he,y,V,b),l.moveTo(W.cx+W.x01,W.cy+W.y01),VRi)||!(C>Ri)?l.lineTo(re,he):H>Ri?(W=Db(re,he,De,ye,h,-H,b),ee=Db(Z,le,ce,Ne,h,-H,b),l.lineTo(W.cx+W.x01,W.cy+W.y01),H{v();x();g();qf();eo();Hh()});function zf(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}var fW,$h=Te(()=>{v();x();g();fW=Array.prototype.slice});function cW(e){this._context=e}function Uf(e){return new cW(e)}var Vg=Te(()=>{v();x();g();cW.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 Wh(e){return e[0]}function Vh(e){return e[1]}var Nb=Te(()=>{v();x();g()});function Gh(e,t){var r=sr(!0),n=null,i=Uf,o=null,u=Su(l);e=typeof e=="function"?e:e===void 0?Wh:sr(e),t=typeof t=="function"?t:t===void 0?Vh:sr(t);function l(a){var s,f=(a=zf(a)).length,p,h=!1,y;for(n==null&&(o=i(y=u())),s=0;s<=f;++s)!(s{v();x();g();$h();qf();Vg();Hh();Nb()});function Eb(e,t,r){var n=null,i=sr(!0),o=null,u=Uf,l=null,a=Su(s);e=typeof e=="function"?e:e===void 0?Wh:sr(+e),t=typeof t=="function"?t:t===void 0?sr(0):sr(+t),r=typeof r=="function"?r:r===void 0?Vh:sr(+r);function s(p){var h,y,N,w=(p=zf(p)).length,D,b=!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;--N)l.point(M[N],I[N]);l.lineEnd(),l.areaEnd()}b&&(M[h]=+e(D,h,p),I[h]=+t(D,h,p),l.point(n?+n(D,h,p):M[h],r?+r(D,h,p):I[h]))}if(O)return l=null,O+""||null}function f(){return Gh().defined(i).curve(u).context(o)}return s.x=function(p){return arguments.length?(e=typeof p=="function"?p:sr(+p),n=null,s):e},s.x0=function(p){return arguments.length?(e=typeof p=="function"?p:sr(+p),s):e},s.x1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:sr(+p),s):n},s.y=function(p){return arguments.length?(t=typeof p=="function"?p:sr(+p),r=null,s):t},s.y0=function(p){return arguments.length?(t=typeof p=="function"?p:sr(+p),s):t},s.y1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:sr(+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:sr(!!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 rM=Te(()=>{v();x();g();$h();qf();Vg();Sb();Hh();Nb()});function pW(e,t){return te?1:t>=e?0:NaN}var mW=Te(()=>{v();x();g()});function hW(e){return e}var dW=Te(()=>{v();x();g()});function vW(){var e=hW,t=pW,r=null,n=sr(0),i=sr(Ja),o=sr(0);function u(l){var a,s=(l=zf(l)).length,f,p,h=0,y=new Array(s),N=new Array(s),w=+n.apply(this,arguments),D=Math.min(Ja,Math.max(-Ja,i.apply(this,arguments)-w)),b,O=Math.min(Math.abs(D)/s,o.apply(this,arguments)),M=O*(D<0?-1:1),I;for(a=0;a0&&(h+=I);for(t!=null?y.sort(function(F,C){return t(N[F],N[C])}):r!=null&&y.sort(function(F,C){return r(l[F],l[C])}),a=0,p=h?(D-s*M)/h:0;a0?I*p:0)+M,N[f]={data:l[f],index:a,value:I,startAngle:w,endAngle:b,padAngle:O};return N}return u.value=function(l){return arguments.length?(e=typeof l=="function"?l:sr(+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:sr(+l),u):n},u.endAngle=function(l){return arguments.length?(i=typeof l=="function"?l:sr(+l),u):i},u.padAngle=function(l){return arguments.length?(o=typeof l=="function"?l:sr(+l),u):o},u}var gW=Te(()=>{v();x();g();$h();qf();mW();dW();eo()});function xW(e){this._curve=e}function Yh(e){function t(r){return new xW(e(r))}return t._curve=e,t}var Ab,nM=Te(()=>{v();x();g();Vg();Ab=Yh(Uf);xW.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 Zh(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(Yh(r)):t()._curve},e}function iM(){return Zh(Gh().curve(Ab))}var oM=Te(()=>{v();x();g();nM();Sb()});function aM(){var e=Eb().curve(Ab),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 Zh(r())},delete e.lineX0,e.lineEndAngle=function(){return Zh(n())},delete e.lineX1,e.lineInnerRadius=function(){return Zh(i())},delete e.lineY0,e.lineOuterRadius=function(){return Zh(o())},delete e.lineY1,e.curve=function(u){return arguments.length?t(Yh(u)):t()._curve},e}var yW=Te(()=>{v();x();g();nM();rM();oM()});function Np(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}var sM=Te(()=>{v();x();g()});function Mb(e){return new Cb(e,!0)}function Tb(e){return new Cb(e,!1)}function wW(e){return new uM(e)}var Cb,uM,lM=Te(()=>{v();x();g();sM();Cb=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}},uM=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=Np(this._x0,this._y0),i=Np(this._x0,this._y0=(this._y0+r)/2),o=Np(t,this._y0),u=Np(t,r);this._context.moveTo(...n),this._context.bezierCurveTo(...i,...o,...u)}this._x0=t,this._y0=r}}});function ixe(e){return e.source}function oxe(e){return e.target}function Gg(e){let t=ixe,r=oxe,n=Wh,i=Vh,o=null,u=null,l=Su(a);function a(){let s,f=fW.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:sr(+s),a):n},a.y=function(s){return arguments.length?(i=typeof s=="function"?s:sr(+s),a):i},a.context=function(s){return arguments.length?(s==null?o=u=null:u=e(o=s),a):o},a}function bW(){return Gg(Mb)}function DW(){return Gg(Tb)}function NW(){let e=Gg(wW);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}var SW=Te(()=>{v();x();g();$h();qf();lM();Hh();Nb()});var axe,Ob,fM=Te(()=>{v();x();g();eo();axe=Nr(3),Ob={draw(e,t){let r=Nr(t+Nu(t/28,.75))*.59436,n=r/2,i=n*axe;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 Xh,cM=Te(()=>{v();x();g();eo();Xh={draw(e,t){let r=Nr(t/Ps);e.moveTo(r,0),e.arc(0,0,r,0,Ja)}}});var Ib,pM=Te(()=>{v();x();g();eo();Ib={draw(e,t){let r=Nr(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 EW,sxe,Fb,mM=Te(()=>{v();x();g();eo();EW=Nr(1/3),sxe=EW*2,Fb={draw(e,t){let r=Nr(t/sxe),n=r*EW;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}}});var _b,hM=Te(()=>{v();x();g();eo();_b={draw(e,t){let r=Nr(t)*.62625;e.moveTo(0,-r),e.lineTo(r,0),e.lineTo(0,r),e.lineTo(-r,0),e.closePath()}}});var kb,dM=Te(()=>{v();x();g();eo();kb={draw(e,t){let r=Nr(t-Nu(t/7,2))*.87559;e.moveTo(-r,0),e.lineTo(r,0),e.moveTo(0,r),e.lineTo(0,-r)}}});var Bb,vM=Te(()=>{v();x();g();eo();Bb={draw(e,t){let r=Nr(t),n=-r/2;e.rect(n,n,r,r)}}});var Lb,gM=Te(()=>{v();x();g();eo();Lb={draw(e,t){let r=Nr(t)*.4431;e.moveTo(r,r),e.lineTo(r,-r),e.lineTo(-r,-r),e.lineTo(-r,r),e.closePath()}}});var uxe,AW,lxe,fxe,Pb,xM=Te(()=>{v();x();g();eo();uxe=.8908130915292852,AW=go(Ps/10)/go(7*Ps/10),lxe=go(Ja/10)*AW,fxe=-Ls(Ja/10)*AW,Pb={draw(e,t){let r=Nr(t*uxe),n=lxe*r,i=fxe*r;e.moveTo(0,-r),e.lineTo(n,i);for(let o=1;o<5;++o){let u=Ja*o/5,l=Ls(u),a=go(u);e.lineTo(a*r,-l*r),e.lineTo(l*n-a*i,a*n+l*i)}e.closePath()}}});var yM,Rb,wM=Te(()=>{v();x();g();eo();yM=Nr(3),Rb={draw(e,t){let r=-Nr(t/(yM*3));e.moveTo(0,r*2),e.lineTo(-yM*r,-r),e.lineTo(yM*r,-r),e.closePath()}}});var cxe,qb,bM=Te(()=>{v();x();g();eo();cxe=Nr(3),qb={draw(e,t){let r=Nr(t)*.6824,n=r/2,i=r*cxe/2;e.moveTo(0,-r),e.lineTo(i,n),e.lineTo(-i,n),e.closePath()}}});var Qa,ja,DM,pxe,zb,NM=Te(()=>{v();x();g();eo();Qa=-.5,ja=Nr(3)/2,DM=1/Nr(12),pxe=(DM/2+1)*3,zb={draw(e,t){let r=Nr(t/pxe),n=r/2,i=r*DM,o=n,u=r*DM+r,l=-o,a=u;e.moveTo(n,i),e.lineTo(o,u),e.lineTo(l,a),e.lineTo(Qa*n-ja*i,ja*n+Qa*i),e.lineTo(Qa*o-ja*u,ja*o+Qa*u),e.lineTo(Qa*l-ja*a,ja*l+Qa*a),e.lineTo(Qa*n+ja*i,Qa*i-ja*n),e.lineTo(Qa*o+ja*u,Qa*u-ja*o),e.lineTo(Qa*l+ja*a,Qa*a-ja*l),e.closePath()}}});var Yg,SM=Te(()=>{v();x();g();eo();Yg={draw(e,t){let r=Nr(t-Nu(t/6,1.7))*.6189;e.moveTo(-r,-r),e.lineTo(r,r),e.moveTo(-r,r),e.lineTo(r,-r)}}});function AM(e,t){let r=null,n=Su(i);e=typeof e=="function"?e:sr(e||Xh),t=typeof t=="function"?t:sr(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:sr(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:sr(+o),i):t},i.context=function(o){return arguments.length?(r=o??null,i):r},i}var EM,CW,MW=Te(()=>{v();x();g();qf();Hh();fM();cM();pM();mM();hM();dM();vM();gM();xM();wM();bM();NM();SM();EM=[Xh,Ib,Fb,Bb,Pb,Rb,zb],CW=[Xh,kb,Yg,qb,Ob,Lb,_b]});function es(){}var Zg=Te(()=>{v();x();g()});function Kh(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 Xg(e){this._context=e}function TW(e){return new Xg(e)}var Kg=Te(()=>{v();x();g();Xg.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:Kh(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:Kh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}});function OW(e){this._context=e}function IW(e){return new OW(e)}var FW=Te(()=>{v();x();g();Zg();Kg();OW.prototype={areaStart:es,areaEnd:es,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:Kh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}});function _W(e){this._context=e}function kW(e){return new _W(e)}var BW=Te(()=>{v();x();g();Kg();_W.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:Kh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}});function LW(e,t){this._basis=new Xg(e),this._beta=t}var PW,RW=Te(()=>{v();x();g();Kg();LW.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)}};PW=function e(t){function r(n){return t===1?new Xg(n):new LW(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 Ub(e,t){this._context=e,this._k=(1-t)/6}var qW,Jg=Te(()=>{v();x();g();Ub.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}};qW=function e(t){function r(n){return new Ub(n,t)}return r.tension=function(n){return e(+n)},r}(0)});function Hb(e,t){this._context=e,this._k=(1-t)/6}var zW,CM=Te(()=>{v();x();g();Zg();Jg();Hb.prototype={areaStart:es,areaEnd:es,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}};zW=function e(t){function r(n){return new Hb(n,t)}return r.tension=function(n){return e(+n)},r}(0)});function $b(e,t){this._context=e,this._k=(1-t)/6}var UW,MM=Te(()=>{v();x();g();Jg();$b.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}};UW=function e(t){function r(n){return new $b(n,t)}return r.tension=function(n){return e(+n)},r}(0)});function Qg(e,t,r){var n=e._x1,i=e._y1,o=e._x2,u=e._y2;if(e._l01_a>Ri){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>Ri){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 HW(e,t){this._context=e,this._alpha=t}var $W,Wb=Te(()=>{v();x();g();eo();Jg();HW.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:Qg(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}};$W=function e(t){function r(n){return t?new HW(n,t):new Ub(n,0)}return r.alpha=function(n){return e(+n)},r}(.5)});function WW(e,t){this._context=e,this._alpha=t}var VW,GW=Te(()=>{v();x();g();CM();Zg();Wb();WW.prototype={areaStart:es,areaEnd:es,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:Qg(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}};VW=function e(t){function r(n){return t?new WW(n,t):new Hb(n,0)}return r.alpha=function(n){return e(+n)},r}(.5)});function YW(e,t){this._context=e,this._alpha=t}var ZW,XW=Te(()=>{v();x();g();MM();Wb();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(){(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:Qg(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 $b(n,0)}return r.alpha=function(n){return e(+n)},r}(.5)});function KW(e){this._context=e}function JW(e){return new KW(e)}var QW=Te(()=>{v();x();g();Zg();KW.prototype={areaStart:es,areaEnd:es,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 jW(e){return e<0?-1:1}function eV(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(jW(o)+jW(u))*Math.min(Math.abs(o),Math.abs(u),.5*Math.abs(l))||0}function tV(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function TM(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 Vb(e){this._context=e}function rV(e){this._context=new nV(e)}function nV(e){this._context=e}function iV(e){return new Vb(e)}function oV(e){return new rV(e)}var aV=Te(()=>{v();x();g();Vb.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:TM(this,this._t0,tV(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,TM(this,tV(this,r=eV(this,e,t)),r);break;default:TM(this,this._t0,r=eV(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};(rV.prototype=Object.create(Vb.prototype)).point=function(e,t){Vb.prototype.point.call(this,t,e)};nV.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 uV(e){this._context=e}function sV(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{v();x();g();uV.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=sV(e),i=sV(t),o=0,u=1;u{v();x();g();Gb.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 Rs(e,t){if((u=e.length)>1)for(var r=1,n,i,o=e[t[0]],u,l=o.length;r{v();x();g()});function qs(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}var jh=Te(()=>{v();x();g()});function mxe(e,t){return e[t]}function hxe(e){let t=[];return t.key=e,t}function dV(){var e=sr([]),t=qs,r=Rs,n=mxe;function i(o){var u=Array.from(e.apply(this,arguments),hxe),l,a=u.length,s=-1,f;for(let p of o)for(l=0,++s;l{v();x();g();$h();qf();Qh();jh()});function gV(e,t){if((n=e.length)>0){for(var r,n,i=0,o=e[0].length,u;i{v();x();g();Qh()});function yV(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 wV=Te(()=>{v();x();g()});function bV(e,t){if((i=e.length)>0){for(var r=0,n=e[t[0]],i,o=n.length;r{v();x();g();Qh()});function NV(e,t){if(!(!((u=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,o,u;n{v();x();g();Qh()});function Yb(e){var t=e.map(dxe);return qs(e).sort(function(r,n){return t[r]-t[n]})}function dxe(e){for(var t=-1,r=0,n=e.length,i,o=-1/0;++to&&(o=i,r=t);return r}var OM=Te(()=>{v();x();g();jh()});function Zb(e){var t=e.map(IM);return qs(e).sort(function(r,n){return t[r]-t[n]})}function IM(e){for(var t=0,r=-1,n=e.length,i;++r{v();x();g();jh()});function EV(e){return Zb(e).reverse()}var AV=Te(()=>{v();x();g();Xb()});function CV(e){var t=e.length,r,n,i=e.map(IM),o=Yb(e),u=0,l=0,a=[],s=[];for(r=0;r{v();x();g();OM();Xb()});function TV(e){return qs(e).reverse()}var OV=Te(()=>{v();x();g();jh()});var jg={};La(jg,{arc:()=>uW,area:()=>Eb,areaRadial:()=>aM,curveBasis:()=>TW,curveBasisClosed:()=>IW,curveBasisOpen:()=>kW,curveBumpX:()=>Mb,curveBumpY:()=>Tb,curveBundle:()=>PW,curveCardinal:()=>qW,curveCardinalClosed:()=>zW,curveCardinalOpen:()=>UW,curveCatmullRom:()=>$W,curveCatmullRomClosed:()=>VW,curveCatmullRomOpen:()=>ZW,curveLinear:()=>Uf,curveLinearClosed:()=>JW,curveMonotoneX:()=>iV,curveMonotoneY:()=>oV,curveNatural:()=>lV,curveStep:()=>cV,curveStepAfter:()=>mV,curveStepBefore:()=>pV,line:()=>Gh,lineRadial:()=>iM,link:()=>Gg,linkHorizontal:()=>bW,linkRadial:()=>NW,linkVertical:()=>DW,pie:()=>vW,pointRadial:()=>Np,radialArea:()=>aM,radialLine:()=>iM,stack:()=>dV,stackOffsetDiverging:()=>yV,stackOffsetExpand:()=>gV,stackOffsetNone:()=>Rs,stackOffsetSilhouette:()=>bV,stackOffsetWiggle:()=>NV,stackOrderAppearance:()=>Yb,stackOrderAscending:()=>Zb,stackOrderDescending:()=>EV,stackOrderInsideOut:()=>CV,stackOrderNone:()=>qs,stackOrderReverse:()=>TV,symbol:()=>AM,symbolAsterisk:()=>Ob,symbolCircle:()=>Xh,symbolCross:()=>Ib,symbolDiamond:()=>Fb,symbolDiamond2:()=>_b,symbolPlus:()=>kb,symbolSquare:()=>Bb,symbolSquare2:()=>Lb,symbolStar:()=>Pb,symbolTimes:()=>Yg,symbolTriangle:()=>Rb,symbolTriangle2:()=>qb,symbolWye:()=>zb,symbolX:()=>Yg,symbols:()=>EM,symbolsFill:()=>EM,symbolsStroke:()=>CW});var e0=Te(()=>{v();x();g();lW();rM();Sb();gW();yW();oM();sM();SW();MW();fM();cM();pM();mM();hM();dM();vM();gM();xM();wM();bM();NM();SM();FW();BW();Kg();lM();RW();CM();MM();Jg();GW();XW();Wb();QW();Vg();aV();fV();hV();vV();xV();wV();Qh();DV();SV();OM();Xb();AV();MV();jh();OV()});function IV(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Sp(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(()=>{v();x();g()});function Eu(e){return e=Sp(Math.abs(e)),e?e[1]:NaN}var r0=Te(()=>{v();x();g();t0()});function FV(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 _V=Te(()=>{v();x();g()});function kV(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var BV=Te(()=>{v();x();g()});function zs(e){if(!(t=vxe.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 vxe,FM=Te(()=>{v();x();g();vxe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;zs.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 LV(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 PV=Te(()=>{v();x();g()});function RV(e,t){var r=Sp(e,t);if(!r)return e+"";var n=r[0],i=r[1],o=i-(_M=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")+Sp(e,Math.max(0,t+o-1))[0]}var _M,kM=Te(()=>{v();x();g();t0()});function BM(e,t){var r=Sp(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 qV=Te(()=>{v();x();g();t0()});var LM,zV=Te(()=>{v();x();g();t0();kM();qV();LM={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:IV,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)=>BM(e*100,t),r:BM,s:RV,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)}});function PM(e){return e}var UV=Te(()=>{v();x();g()});function Kb(e){var t=e.grouping===void 0||e.thousands===void 0?PM:FV(HV.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?PM:kV(HV.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=zs(p);var h=p.fill,y=p.align,N=p.sign,w=p.symbol,D=p.zero,b=p.width,O=p.comma,M=p.precision,I=p.trim,F=p.type;F==="n"?(O=!0,F="g"):LM[F]||(M===void 0&&(M=12),I=!0,F="g"),(D||h==="0"&&y==="=")&&(D=!0,h="0",y="=");var C=w==="$"?r:w==="#"&&/[boxX]/.test(F)?"0"+F.toLowerCase():"",P=w==="$"?n:/[%p]/.test(F)?u:"",R=LM[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 z(H){var V=C,W=P,ee,ie,X;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=LV(H)),Z&&+H==0&&N!=="+"&&(Z=!1),V=(Z?N==="("?N:l:N==="-"||N==="("?"":N)+V,W=(F==="s"?$V[8+_M/3]:"")+W+(Z&&N==="("?")":""),q){for(ee=-1,ie=H.length;++eeX||X>57){W=(X===46?i+H.slice(ee+1):H.slice(ee))+W,H=H.slice(0,ee);break}}}O&&!D&&(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 z.toString=function(){return p+""},z}function f(p,h){var y=s((p=zs(p),p.type="f",p)),N=Math.max(-8,Math.min(8,Math.floor(Eu(h)/3)))*3,w=Math.pow(10,-N),D=$V[8+N/3];return function(b){return y(w*b)+D}}return{format:s,formatPrefix:f}}var HV,$V,RM=Te(()=>{v();x();g();r0();_V();BV();FM();PV();zV();kM();UV();HV=Array.prototype.map,$V=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"]});function Qb(e){return Jb=Kb(e),Ep=Jb.format,i0=Jb.formatPrefix,Jb}var Jb,Ep,i0,WV=Te(()=>{v();x();g();RM();Qb({thousands:",",grouping:[3],currency:["$",""]})});function jb(e){return Math.max(0,-Eu(Math.abs(e)))}var VV=Te(()=>{v();x();g();r0()});function e2(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Eu(t)/3)))*3-Eu(Math.abs(e)))}var GV=Te(()=>{v();x();g();r0()});function t2(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Eu(t)-Eu(e))+1}var YV=Te(()=>{v();x();g();r0()});var ZV={};La(ZV,{FormatSpecifier:()=>n0,format:()=>Ep,formatDefaultLocale:()=>Qb,formatLocale:()=>Kb,formatPrefix:()=>i0,formatSpecifier:()=>zs,precisionFixed:()=>jb,precisionPrefix:()=>e2,precisionRound:()=>t2});var r2=Te(()=>{v();x();g();WV();RM();FM();VV();GV();YV()});function Io(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}var o0=Te(()=>{v();x();g()});function qM(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}var XV=Te(()=>{v();x();g()});function Ap(e){let t,r,n;e.length!==2?(t=Io,r=(l,a)=>Io(e(l),a),n=(l,a)=>e(l)-a):(t=e===Io||e===qM?e:gxe,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 gxe(){return 0}var zM=Te(()=>{v();x();g();o0();XV()});function a0(e){return e===null?NaN:+e}function*KV(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 UM=Te(()=>{v();x();g()});var JV,QV,xxe,yxe,Us,jV=Te(()=>{v();x();g();o0();zM();UM();JV=Ap(Io),QV=JV.right,xxe=JV.left,yxe=Ap(a0).center,Us=QV});function eG({_intern:e,_key:t},r){let n=t(r);return e.has(n)?e.get(n):r}function wxe({_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 Dxe(e){return e!==null&&typeof e=="object"?e.valueOf():e}var ed,tG=Te(()=>{v();x();g();ed=class extends Map{constructor(t,r=Dxe){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(eG(this,t))}has(t){return super.has(eG(this,t))}set(t,r){return super.set(wxe(this,t),r)}delete(t){return super.delete(bxe(this,t))}}});function rG(e=Io){if(e===Io)return HM;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 HM(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}var nG=Te(()=>{v();x();g();o0()});function n2(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>=Nxe?10:o>=Sxe?5:o>=Exe?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{v();x();g();Nxe=Math.sqrt(50),Sxe=Math.sqrt(10),Exe=Math.sqrt(2)});function i2(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 oG=Te(()=>{v();x();g()});function o2(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 aG=Te(()=>{v();x();g()});function a2(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?HM:rG(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)),N=Math.min(n,Math.floor(t+(a-s)*p/a+h));a2(e,t,y,N,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 sG=Te(()=>{v();x();g();nG()});function s2(e,t,r){if(e=Float64Array.from(KV(e,r)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return o2(e);if(t>=1)return i2(e);var n,i=(n-1)*t,o=Math.floor(i),u=i2(a2(e,o).subarray(0,o+1)),l=o2(e.subarray(o+1));return u+(l-u)*(i-o)}}function $M(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 uG=Te(()=>{v();x();g();oG();aG();sG();UM()});function u2(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{v();x();g()});var ts=Te(()=>{v();x();g();jV();o0();zM();uG();lG();iG();tG()});function Tn(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function rs(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 xo=Te(()=>{v();x();g()});function rd(){var e=new ed,t=[],r=[],n=l2;function i(o){let u=e.get(o);if(u===void 0){if(n!==l2)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 ed;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 rd(t,r).unknown(n)},Tn.apply(i,arguments),i}var l2,WM=Te(()=>{v();x();g();ts();xo();l2=Symbol("implicit")});function l0(){var e=rd().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{v();x();g();ts();xo();WM()});function gl(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Hf(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}var f2=Te(()=>{v();x();g()});function Cu(){}function hG(){return this.rgb().formatHex()}function _xe(){return this.rgb().formatHex8()}function kxe(){return bG(this).formatHsl()}function dG(){return this.rgb().formatRgb()}function ns(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Axe.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?vG(t):r===3?new ci(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?c2(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?c2(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=Cxe.exec(e))?new ci(t[1],t[2],t[3],1):(t=Mxe.exec(e))?new ci(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Txe.exec(e))?c2(t[1],t[2],t[3],t[4]):(t=Oxe.exec(e))?c2(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Ixe.exec(e))?yG(t[1],t[2]/100,t[3]/100,1):(t=Fxe.exec(e))?yG(t[1],t[2]/100,t[3]/100,t[4]):mG.hasOwnProperty(e)?vG(mG[e]):e==="transparent"?new ci(NaN,NaN,NaN,0):null}function vG(e){return new ci(e>>16&255,e>>8&255,e&255,1)}function c2(e,t,r,n){return n<=0&&(e=t=r=NaN),new ci(e,t,r,n)}function c0(e){return e instanceof Cu||(e=ns(e)),e?(e=e.rgb(),new ci(e.r,e.g,e.b,e.opacity)):new ci}function Ip(e,t,r,n){return arguments.length===1?c0(e):new ci(e,t,r,n??1)}function ci(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function gG(){return`#${Mp(this.r)}${Mp(this.g)}${Mp(this.b)}`}function Bxe(){return`#${Mp(this.r)}${Mp(this.g)}${Mp(this.b)}${Mp((isNaN(this.opacity)?1:this.opacity)*255)}`}function xG(){let e=m2(this.opacity);return`${e===1?"rgb(":"rgba("}${Tp(this.r)}, ${Tp(this.g)}, ${Tp(this.b)}${e===1?")":`, ${e})`}`}function m2(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Tp(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Mp(e){return e=Tp(e),(e<16?"0":"")+e.toString(16)}function yG(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Hs(e,t,r,n)}function bG(e){if(e instanceof Hs)return new Hs(e.h,e.s,e.l,e.opacity);if(e instanceof Cu||(e=ns(e)),!e)return new Hs;if(e instanceof Hs)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 Hs(u,l,a,e.opacity)}function id(e,t,r,n){return arguments.length===1?bG(e):new Hs(e,t,r,n??1)}function Hs(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function wG(e){return e=(e||0)%360,e<0?e+360:e}function p2(e){return Math.max(0,Math.min(1,e||0))}function VM(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 $f,Op,nd,f0,Au,Axe,Cxe,Mxe,Txe,Oxe,Ixe,Fxe,mG,h2=Te(()=>{v();x();g();f2();$f=.7,Op=1/$f,nd="\\s*([+-]?\\d+)\\s*",f0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Au="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Axe=/^#([0-9a-f]{3,8})$/,Cxe=new RegExp(`^rgb\\(${nd},${nd},${nd}\\)$`),Mxe=new RegExp(`^rgb\\(${Au},${Au},${Au}\\)$`),Txe=new RegExp(`^rgba\\(${nd},${nd},${nd},${f0}\\)$`),Oxe=new RegExp(`^rgba\\(${Au},${Au},${Au},${f0}\\)$`),Ixe=new RegExp(`^hsl\\(${f0},${Au},${Au}\\)$`),Fxe=new RegExp(`^hsla\\(${f0},${Au},${Au},${f0}\\)$`),mG={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};gl(Cu,ns,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:hG,formatHex:hG,formatHex8:_xe,formatHsl:kxe,formatRgb:dG,toString:dG});gl(ci,Ip,Hf(Cu,{brighter(e){return e=e==null?Op:Math.pow(Op,e),new ci(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?$f:Math.pow($f,e),new ci(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ci(Tp(this.r),Tp(this.g),Tp(this.b),m2(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:gG,formatHex:gG,formatHex8:Bxe,formatRgb:xG,toString:xG}));gl(Hs,id,Hf(Cu,{brighter(e){return e=e==null?Op:Math.pow(Op,e),new Hs(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$f:Math.pow($f,e),new Hs(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 ci(VM(e>=240?e-240:e+120,i,n),VM(e,i,n),VM(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Hs(wG(this.h),p2(this.s),p2(this.l),m2(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=m2(this.opacity);return`${e===1?"hsl(":"hsla("}${wG(this.h)}, ${p2(this.s)*100}%, ${p2(this.l)*100}%${e===1?")":`, ${e})`}`}}))});var d2,v2,GM=Te(()=>{v();x();g();d2=Math.PI/180,v2=180/Math.PI});function CG(e){if(e instanceof $s)return new $s(e.l,e.a,e.b,e.opacity);if(e instanceof Mu)return IG(e);e instanceof ci||(e=c0(e));var t=KM(e.r),r=KM(e.g),n=KM(e.b),i=YM((.2225045*t+.7168786*r+.0606169*n)/NG),o,u;return t===r&&r===n?o=u=i:(o=YM((.4360747*t+.3850649*r+.1430804*n)/DG),u=YM((.0139322*t+.0971045*r+.7141733*n)/SG)),new $s(116*i-16,500*(o-i),200*(i-u),e.opacity)}function MG(e,t){return new $s(e,0,0,t??1)}function Fp(e,t,r,n){return arguments.length===1?CG(e):new $s(e,t,r,n??1)}function $s(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}function YM(e){return e>Lxe?Math.pow(e,1/3):e/AG+EG}function ZM(e){return e>od?e*e*e:AG*(e-EG)}function XM(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function KM(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function TG(e){if(e instanceof Mu)return new Mu(e.h,e.c,e.l,e.opacity);if(e instanceof $s||(e=CG(e)),e.a===0&&e.b===0)return new Mu(NaN,0{v();x();g();f2();h2();GM();g2=18,DG=.96422,NG=1,SG=.82521,EG=4/29,od=6/29,AG=3*od*od,Lxe=od*od*od;gl($s,Fp,Hf(Cu,{brighter(e){return new $s(this.l+g2*(e??1),this.a,this.b,this.opacity)},darker(e){return new $s(this.l-g2*(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=DG*ZM(t),e=NG*ZM(e),r=SG*ZM(r),new ci(XM(3.1338561*t-1.6168667*e-.4906146*r),XM(-.9787684*t+1.9161415*e+.033454*r),XM(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}}));gl(Mu,ad,Hf(Cu,{brighter(e){return new Mu(this.h,this.c,this.l+g2*(e??1),this.opacity)},darker(e){return new Mu(this.h,this.c,this.l-g2*(e??1),this.opacity)},rgb(){return IG(this).rgb()}}))});function Pxe(e){if(e instanceof _p)return new _p(e.h,e.s,e.l,e.opacity);e instanceof ci||(e=c0(e));var t=e.r/255,r=e.g/255,n=e.b/255,i=(BG*n+_G*t-kG*r)/(BG+_G-kG),o=n-i,u=(p0*(r-i)-QM*o)/x2,l=Math.sqrt(u*u+o*o)/(p0*i*(1-i)),a=l?Math.atan2(u,o)*v2-120:NaN;return new _p(a<0?a+360:a,l,i,e.opacity)}function kp(e,t,r,n){return arguments.length===1?Pxe(e):new _p(e,t,r,n??1)}function _p(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}var LG,JM,QM,x2,p0,_G,kG,BG,PG=Te(()=>{v();x();g();f2();h2();GM();LG=-.14861,JM=1.78277,QM=-.29227,x2=-.90649,p0=1.97294,_G=p0*x2,kG=p0*JM,BG=JM*QM-x2*LG;gl(_p,kp,Hf(Cu,{brighter(e){return e=e==null?Op:Math.pow(Op,e),new _p(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$f:Math.pow($f,e),new _p(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*d2,t=+this.l,r=isNaN(this.s)?0:this.s*t*(1-t),n=Math.cos(e),i=Math.sin(e);return new ci(255*(t+r*(LG*n+JM*i)),255*(t+r*(QM*n+x2*i)),255*(t+r*(p0*n)),this.opacity)}}))});var y2={};La(y2,{color:()=>ns,cubehelix:()=>kp,gray:()=>MG,hcl:()=>ad,hsl:()=>id,lab:()=>Fp,lch:()=>OG,rgb:()=>Ip});var Ws=Te(()=>{v();x();g();h2();FG();PG()});function jM(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 w2(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{v();x();g()});function D2(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 jM((r-n/t)*t,i,o,u,l)}}var eT=Te(()=>{v();x();g();b2()});var sd,tT=Te(()=>{v();x();g();sd=e=>()=>e});function RG(e,t){return function(r){return e+r*t}}function Rxe(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 Wf(e,t){var r=t-e;return r?RG(e,r>180||r<-180?r-360*Math.round(r/360):r):sd(isNaN(e)?t:e)}function qG(e){return(e=+e)==1?On:function(t,r){return r-t?Rxe(t,r,e):sd(isNaN(t)?r:t)}}function On(e,t){var r=t-e;return r?RG(e,r):sd(isNaN(e)?t:e)}var Bp=Te(()=>{v();x();g();tT()});function zG(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{v();x();g();Ws();b2();eT();Bp();Vf=function e(t){var r=qG(t);function n(i,o){var u=r((i=Ip(i)).r,(o=Ip(o)).r),l=r(i.g,o.g),a=r(i.b,o.b),s=On(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);UG=zG(w2),HG=zG(D2)});function ud(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{v();x();g()});function $G(e,t){return(N2(t)?ud:nT)(e,t)}function nT(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{v();x();g();m0();S2()});function E2(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}var oT=Te(()=>{v();x();g()});function qi(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var h0=Te(()=>{v();x();g()});function A2(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]=Zo(e[i],t[i]):n[i]=t[i];return function(o){for(i in r)n[i]=r[i](o);return n}}var aT=Te(()=>{v();x();g();m0()});function qxe(e){return function(){return e}}function zxe(e){return function(t){return e(t)+""}}function ld(e,t){var r=uT.lastIndex=sT.lastIndex=0,n,i,o,u=-1,l=[],a=[];for(e=e+"",t=t+"";(n=uT.exec(e))&&(i=sT.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:qi(n,i)})),r=sT.lastIndex;return r{v();x();g();h0();uT=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,sT=new RegExp(uT.source,"g")});function Zo(e,t){var r=typeof t,n;return t==null||r==="boolean"?sd(t):(r==="number"?qi:r==="string"?(n=ns(t))?(t=n,Vf):ld:t instanceof ns?Vf:t instanceof Date?E2:N2(t)?ud:Array.isArray(t)?nT:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?A2:qi)(e,t)}var m0=Te(()=>{v();x();g();Ws();rT();iT();oT();h0();aT();lT();tT();S2()});function WG(e){var t=e.length;return function(r){return e[Math.max(0,Math.min(t-1,Math.floor(r*t)))]}}var VG=Te(()=>{v();x();g()});function GG(e,t){var r=Wf(+e,+t);return function(n){var i=r(n);return i-360*Math.floor(i/360)}}var YG=Te(()=>{v();x();g();Bp()});function Gf(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var ZG=Te(()=>{v();x();g()});function fT(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{v();x();g();XG=180/Math.PI,C2={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}});function JG(e){let t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?C2:fT(t.a,t.b,t.c,t.d,t.e,t.f)}function QG(e){return e==null?C2:(M2||(M2=document.createElementNS("http://www.w3.org/2000/svg","g")),M2.setAttribute("transform",e),(e=M2.transform.baseVal.consolidate())?(e=e.matrix,fT(e.a,e.b,e.c,e.d,e.e,e.f)):C2)}var M2,jG=Te(()=>{v();x();g();KG()});function eY(e,t,r,n){function i(s){return s.length?s.pop()+" ":""}function o(s,f,p,h,y,N){if(s!==p||f!==h){var w=y.push("translate(",null,t,null,r);N.push({i:w-4,x:qi(s,p)},{i:w-2,x:qi(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:qi(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:qi(s,f)}):f&&p.push(i(p)+"skewX("+f+n)}function a(s,f,p,h,y,N){if(s!==p||f!==h){var w=y.push(i(y)+"scale(",null,",",null,")");N.push({i:w-4,x:qi(s,p)},{i:w-2,x:qi(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 N=-1,w=h.length,D;++N{v();x();g();h0();jG();T2=eY(JG,"px, ","px)","deg)"),O2=eY(QG,", ",")",")")});function rY(e){return((e=Math.exp(e))+1/e)/2}function Hxe(e){return((e=Math.exp(e))-1/e)/2}function $xe(e){return((e=Math.exp(2*e))-1)/(e+1)}var Uxe,I2,nY=Te(()=>{v();x();g();Uxe=1e-12;I2=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,N=p-a,w=y*y+N*N,D,b;if(w{v();x();g();Ws();Bp();oY=iY(Wf),aY=iY(On)});function cT(e,t){var r=On((e=Fp(e)).l,(t=Fp(t)).l),n=On(e.a,t.a),i=On(e.b,t.b),o=On(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 uY=Te(()=>{v();x();g();Ws();Bp()});function lY(e){return function(t,r){var n=e((t=ad(t)).h,(r=ad(r)).h),i=On(t.c,r.c),o=On(t.l,r.l),u=On(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 fY,cY,pY=Te(()=>{v();x();g();Ws();Bp();fY=lY(Wf),cY=lY(On)});function mY(e){return function t(r){r=+r;function n(i,o){var u=e((i=kp(i)).h,(o=kp(o)).h),l=On(i.s,o.s),a=On(i.l,o.l),s=On(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 hY,dY,vY=Te(()=>{v();x();g();Ws();Bp();hY=mY(Wf),dY=mY(On)});function d0(e,t){t===void 0&&(t=e,e=Zo);for(var r=0,n=t.length-1,i=t[0],o=new Array(n<0?0:n);r{v();x();g();m0()});function xY(e,t){for(var r=new Array(t),n=0;n{v();x();g()});var wY={};La(wY,{interpolate:()=>Zo,interpolateArray:()=>$G,interpolateBasis:()=>w2,interpolateBasisClosed:()=>D2,interpolateCubehelix:()=>hY,interpolateCubehelixLong:()=>dY,interpolateDate:()=>E2,interpolateDiscrete:()=>WG,interpolateHcl:()=>fY,interpolateHclLong:()=>cY,interpolateHsl:()=>oY,interpolateHslLong:()=>aY,interpolateHue:()=>GG,interpolateLab:()=>cT,interpolateNumber:()=>qi,interpolateNumberArray:()=>ud,interpolateObject:()=>A2,interpolateRgb:()=>Vf,interpolateRgbBasis:()=>UG,interpolateRgbBasisClosed:()=>HG,interpolateRound:()=>Gf,interpolateString:()=>ld,interpolateTransformCss:()=>T2,interpolateTransformSvg:()=>O2,interpolateZoom:()=>I2,piecewise:()=>d0,quantize:()=>xY});var xl=Te(()=>{v();x();g();m0();iT();b2();eT();oT();VG();YG();h0();S2();aT();ZG();lT();tY();nY();rT();sY();uY();pY();vY();gY();yY()});function pT(e){return function(){return e}}var bY=Te(()=>{v();x();g()});function Yf(e){return+e}var F2=Te(()=>{v();x();g()});function Ai(e){return e}function mT(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:pT(isNaN(t)?NaN:.5)}function Wxe(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function Vxe(e,t,r){var n=e[0],i=e[1],o=t[0],u=t[1];return i2?Gxe:Vxe,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),qi)))(h)))},p.domain=function(h){return arguments.length?(e=Array.from(h,Yf),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=Gf,f()},p.clamp=function(h){return arguments.length?(u=h?!0:Ai,f()):u!==Ai},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 Pp(){return Lp()(Ai,Ai)}var DY,Ou=Te(()=>{v();x();g();ts();xl();bY();F2();DY=[0,1]});function v0(e,t,r,n){var i=td(e,t,r),o;switch(n=zs(n??",f"),n.type){case"s":{var u=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=e2(i,u))&&(n.precision=o),i0(n,u)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=t2(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=jb(i))&&(n.precision=o-(n.type==="%")*2);break}}return Ep(n)}var hT=Te(()=>{v();x();g();ts();r2()});function Fo(e){var t=e.domain;return e.ticks=function(r){var n=t();return Cp(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return v0(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=Pp();return e.copy=function(){return Tu(e,_2())},Tn.apply(e,arguments),Fo(e)}var yl=Te(()=>{v();x();g();ts();Ou();xo();hT()});function k2(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,Yf),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return k2(e).unknown(t)},e=arguments.length?Array.from(e,Yf):[0,1],Fo(r)}var NY=Te(()=>{v();x();g();yl();F2()});function g0(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],o=e[n],u;return o{v();x();g()});function SY(e){return Math.log(e)}function EY(e){return Math.exp(e)}function Yxe(e){return-Math.log(-e)}function Zxe(e){return-Math.exp(-e)}function Xxe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Kxe(e){return e===10?Xxe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Jxe(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 AY(e){return(t,r)=>-e(-t,r)}function x0(e){let t=e(SY,EY),r=t.domain,n=10,i,o;function u(){return i=Jxe(n),o=Kxe(n),r()[0]<0?(i=AY(i),o=AY(o),e(Yxe,Zxe)):e(SY,EY),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(N=1;Nf)break;b.push(w)}}else for(;h<=y;++h)for(N=n-1;N>=1;--N)if(w=h>0?N/o(-h):N*o(h),!(wf)break;b.push(w)}b.length*2{if(l==null&&(l=10),a==null&&(a=n===10?"s":","),typeof a!="function"&&(!(n%1)&&(a=zs(a)).precision==null&&(a.trim=!0),a=Ep(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(g0(r(),{floor:l=>o(Math.floor(i(l))),ceil:l=>o(Math.ceil(i(l)))})),t}function B2(){let e=x0(Lp()).domain([1,10]);return e.copy=()=>Tu(e,B2()).base(e.base()),Tn.apply(e,arguments),e}var L2=Te(()=>{v();x();g();ts();r2();dT();Ou();xo()});function CY(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function MY(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function y0(e){var t=1,r=e(CY(t),MY(t));return r.constant=function(n){return arguments.length?e(CY(t=+n),MY(t)):t},Fo(r)}function P2(){var e=y0(Lp());return e.copy=function(){return Tu(e,P2()).constant(e.constant())},Tn.apply(e,arguments)}var R2=Te(()=>{v();x();g();yl();Ou();xo()});function TY(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Qxe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function jxe(e){return e<0?-e*e:e*e}function w0(e){var t=e(Ai,Ai),r=1;function n(){return r===1?e(Ai,Ai):r===.5?e(Qxe,jxe):e(TY(r),TY(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Fo(t)}function b0(){var e=w0(Lp());return e.copy=function(){return Tu(e,b0()).exponent(e.exponent())},Tn.apply(e,arguments),e}function OY(){return b0.apply(null,arguments).exponent(.5)}var q2=Te(()=>{v();x();g();yl();Ou();xo()});function IY(e){return Math.sign(e)*e*e}function eye(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function z2(){var e=Pp(),t=[0,1],r=!1,n;function i(o){var u=eye(e(o));return isNaN(u)?n:r?Math.round(u):u}return i.invert=function(o){return e.invert(IY(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,Yf)).map(IY)),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 z2(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Tn.apply(i,arguments),Fo(i)}var FY=Te(()=>{v();x();g();Ou();xo();yl();F2()});function U2(){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{v();x();g();ts();xo()});function H2(){var e=0,t=1,r=1,n=[.5],i=[0,1],o;function u(a){return a!=null&&a<=a?i[Us(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 H2().domain([e,t]).range(i).unknown(o)},Tn.apply(Fo(u),arguments)}var kY=Te(()=>{v();x();g();ts();yl();xo()});function $2(){var e=[.5],t=[0,1],r,n=1;function i(o){return o!=null&&o<=o?t[Us(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 $2().domain(e).range(t).unknown(r)},Tn.apply(i,arguments)}var BY=Te(()=>{v();x();g();ts();xo()});function fn(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(sfn(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)=>(vT.setTime(+o),gT.setTime(+u),e(vT),e(gT),Math.floor(r(vT,gT))),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 vT,gT,wl=Te(()=>{v();x();g();vT=new Date,gT=new Date});var D0,lnr,LY=Te(()=>{v();x();g();wl();D0=fn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);D0.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?fn(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):D0);lnr=D0.range});var is,PY,xT=Te(()=>{v();x();g();wl();is=fn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*1e3)},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds()),PY=is.range});var fd,tye,cd,rye,yT=Te(()=>{v();x();g();wl();fd=fn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getMinutes()),tye=fd.range,cd=fn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes()),rye=cd.range});var pd,nye,md,iye,wT=Te(()=>{v();x();g();wl();pd=fn(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()),nye=pd.range,md=fn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*36e5)},(e,t)=>(t-e)/36e5,e=>e.getUTCHours()),iye=md.range});var bl,oye,zp,aye,W2,sye,bT=Te(()=>{v();x();g();wl();bl=fn(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),oye=bl.range,zp=fn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1),aye=zp.range,W2=fn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5)),sye=W2.range});function Up(e){return fn(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 Hp(e){return fn(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 Dl,hd,qY,zY,Zf,UY,HY,$Y,uye,lye,fye,cye,pye,mye,Nl,dd,WY,VY,Xf,GY,YY,ZY,hye,dye,vye,gye,xye,yye,DT=Te(()=>{v();x();g();wl();Dl=Up(0),hd=Up(1),qY=Up(2),zY=Up(3),Zf=Up(4),UY=Up(5),HY=Up(6),$Y=Dl.range,uye=hd.range,lye=qY.range,fye=zY.range,cye=Zf.range,pye=UY.range,mye=HY.range;Nl=Hp(0),dd=Hp(1),WY=Hp(2),VY=Hp(3),Xf=Hp(4),GY=Hp(5),YY=Hp(6),ZY=Nl.range,hye=dd.range,dye=WY.range,vye=VY.range,gye=Xf.range,xye=GY.range,yye=YY.range});var vd,wye,gd,bye,NT=Te(()=>{v();x();g();wl();vd=fn(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()),wye=vd.range,gd=fn(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=gd.range});var Da,Dye,Na,Nye,ST=Te(()=>{v();x();g();wl();Da=fn(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());Da.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:fn(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)});Dye=Da.range,Na=fn(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());Na.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:fn(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)});Nye=Na.range});function KY(e,t,r,n,i,o){let u=[[is,1,1e3],[is,5,5*1e3],[is,15,15*1e3],[is,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=fD).right(u,h);if(y===u.length)return e.every(td(s/31536e6,f/31536e6,p));if(y===0)return D0.every(Math.max(td(s,f,p),1));let[N,w]=u[h/u[y-1][2]{v();x();g();ts();LY();xT();yT();wT();bT();DT();NT();ST();[ET,AT]=KY(Na,gd,Nl,W2,md,cd),[CT,MT]=KY(Da,vd,Dl,bl,pd,fd)});var V2=Te(()=>{v();x();g();xT();yT();wT();bT();DT();NT();ST();JY()});function TT(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 OT(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 IT(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),N=A0(u),w=E0(l),D=A0(l),b=E0(a),O=A0(a),M={a:Z,A:le,b:re,B:he,c:null,d:nZ,e:nZ,f:Yye,g:nwe,G:owe,H:Wye,I:Vye,j:Gye,L:uZ,m:Zye,M:Xye,p:De,q:ye,Q:aZ,s:sZ,S:Kye,u:Jye,U:Qye,V:jye,w:ewe,W:twe,x:null,X:null,y:rwe,Y:iwe,Z:awe,"%":oZ},I={a:ce,A:Ne,b:Pe,B:Ce,c:null,d:iZ,e:iZ,f:fwe,g:wwe,G:Dwe,H:swe,I:uwe,j:lwe,L:fZ,m:cwe,M:pwe,p:Oe,q:He,Q:aZ,s:sZ,S:mwe,u:hwe,U:dwe,V:vwe,w:gwe,W:xwe,x:null,X:null,y:ywe,Y:bwe,Z:Nwe,"%":oZ},F={a:z,A:H,b:V,B:W,c:ee,d:tZ,e:tZ,f:zye,g:eZ,G:jY,H:rZ,I:rZ,j:Lye,L:qye,m:Bye,M:Pye,p:q,q:kye,Q:Hye,s:$ye,S:Rye,u:Tye,U:Oye,V:Iye,w:Mye,W:Fye,x:ie,X,y:eZ,Y:jY,Z:_ye,"%":Uye};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 Be=[],lt=-1,ct=0,de=Ee.length,be,Ue,ve;for(We instanceof Date||(We=new Date(+We));++lt53)return null;"w"in Be||(Be.w=1),"Z"in Be?(ct=OT(S0(Be.y,0,1)),de=ct.getUTCDay(),ct=de>4||de===0?dd.ceil(ct):dd(ct),ct=zp.offset(ct,(Be.V-1)*7),Be.y=ct.getUTCFullYear(),Be.m=ct.getUTCMonth(),Be.d=ct.getUTCDate()+(Be.w+6)%7):(ct=TT(S0(Be.y,0,1)),de=ct.getDay(),ct=de>4||de===0?hd.ceil(ct):hd(ct),ct=bl.offset(ct,(Be.V-1)*7),Be.y=ct.getFullYear(),Be.m=ct.getMonth(),Be.d=ct.getDate()+(Be.w+6)%7)}else("W"in Be||"U"in Be)&&("w"in Be||(Be.w="u"in Be?Be.u%7:"W"in Be?1:0),de="Z"in Be?OT(S0(Be.y,0,1)).getUTCDay():TT(S0(Be.y,0,1)).getDay(),Be.m=0,Be.d="W"in Be?(Be.w+6)%7+Be.W*7-(de+5)%7:Be.w+Be.U*7-(de+6)%7);return"Z"in Be?(Be.H+=Be.Z/100|0,Be.M+=Be.Z%100,OT(Be)):TT(Be)}}function R(Ee,ze,We,Be){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 QY?ze.charAt(lt++):be],!Ue||(Be=Ue(Ee,We,Be))<0)return-1}else if(be!=We.charCodeAt(Be++))return-1}return Be}function q(Ee,ze,We){var Be=s.exec(ze.slice(We));return Be?(Ee.p=f.get(Be[0].toLowerCase()),We+Be[0].length):-1}function z(Ee,ze,We){var Be=y.exec(ze.slice(We));return Be?(Ee.w=N.get(Be[0].toLowerCase()),We+Be[0].length):-1}function H(Ee,ze,We){var Be=p.exec(ze.slice(We));return Be?(Ee.w=h.get(Be[0].toLowerCase()),We+Be[0].length):-1}function V(Ee,ze,We){var Be=b.exec(ze.slice(We));return Be?(Ee.m=O.get(Be[0].toLowerCase()),We+Be[0].length):-1}function W(Ee,ze,We){var Be=w.exec(ze.slice(We));return Be?(Ee.m=D.get(Be[0].toLowerCase()),We+Be[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 X(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 ye(Ee){return 1+~~(Ee.getMonth()/3)}function ce(Ee){return u[Ee.getUTCDay()]}function Ne(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 zr(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",o=i.length;return n+(o[t.toLowerCase(),r]))}function Mye(e,t,r){var n=zi.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function Tye(e,t,r){var n=zi.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function Oye(e,t,r){var n=zi.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function Iye(e,t,r){var n=zi.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function Fye(e,t,r){var n=zi.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function jY(e,t,r){var n=zi.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function eZ(e,t,r){var n=zi.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function _ye(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 kye(e,t,r){var n=zi.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Bye(e,t,r){var n=zi.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function tZ(e,t,r){var n=zi.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Lye(e,t,r){var n=zi.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function rZ(e,t,r){var n=zi.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function Pye(e,t,r){var n=zi.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Rye(e,t,r){var n=zi.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function qye(e,t,r){var n=zi.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function zye(e,t,r){var n=zi.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Uye(e,t,r){var n=Eye.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function Hye(e,t,r){var n=zi.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function $ye(e,t,r){var n=zi.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function nZ(e,t){return zr(e.getDate(),t,2)}function Wye(e,t){return zr(e.getHours(),t,2)}function Vye(e,t){return zr(e.getHours()%12||12,t,2)}function Gye(e,t){return zr(1+bl.count(Da(e),e),t,3)}function uZ(e,t){return zr(e.getMilliseconds(),t,3)}function Yye(e,t){return uZ(e,t)+"000"}function Zye(e,t){return zr(e.getMonth()+1,t,2)}function Xye(e,t){return zr(e.getMinutes(),t,2)}function Kye(e,t){return zr(e.getSeconds(),t,2)}function Jye(e){var t=e.getDay();return t===0?7:t}function Qye(e,t){return zr(Dl.count(Da(e)-1,e),t,2)}function lZ(e){var t=e.getDay();return t>=4||t===0?Zf(e):Zf.ceil(e)}function jye(e,t){return e=lZ(e),zr(Zf.count(Da(e),e)+(Da(e).getDay()===4),t,2)}function ewe(e){return e.getDay()}function twe(e,t){return zr(hd.count(Da(e)-1,e),t,2)}function rwe(e,t){return zr(e.getFullYear()%100,t,2)}function nwe(e,t){return e=lZ(e),zr(e.getFullYear()%100,t,2)}function iwe(e,t){return zr(e.getFullYear()%1e4,t,4)}function owe(e,t){var r=e.getDay();return e=r>=4||r===0?Zf(e):Zf.ceil(e),zr(e.getFullYear()%1e4,t,4)}function awe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+zr(t/60|0,"0",2)+zr(t%60,"0",2)}function iZ(e,t){return zr(e.getUTCDate(),t,2)}function swe(e,t){return zr(e.getUTCHours(),t,2)}function uwe(e,t){return zr(e.getUTCHours()%12||12,t,2)}function lwe(e,t){return zr(1+zp.count(Na(e),e),t,3)}function fZ(e,t){return zr(e.getUTCMilliseconds(),t,3)}function fwe(e,t){return fZ(e,t)+"000"}function cwe(e,t){return zr(e.getUTCMonth()+1,t,2)}function pwe(e,t){return zr(e.getUTCMinutes(),t,2)}function mwe(e,t){return zr(e.getUTCSeconds(),t,2)}function hwe(e){var t=e.getUTCDay();return t===0?7:t}function dwe(e,t){return zr(Nl.count(Na(e)-1,e),t,2)}function cZ(e){var t=e.getUTCDay();return t>=4||t===0?Xf(e):Xf.ceil(e)}function vwe(e,t){return e=cZ(e),zr(Xf.count(Na(e),e)+(Na(e).getUTCDay()===4),t,2)}function gwe(e){return e.getUTCDay()}function xwe(e,t){return zr(dd.count(Na(e)-1,e),t,2)}function ywe(e,t){return zr(e.getUTCFullYear()%100,t,2)}function wwe(e,t){return e=cZ(e),zr(e.getUTCFullYear()%100,t,2)}function bwe(e,t){return zr(e.getUTCFullYear()%1e4,t,4)}function Dwe(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Xf(e):Xf.ceil(e),zr(e.getUTCFullYear()%1e4,t,4)}function Nwe(){return"+0000"}function oZ(){return"%"}function aZ(e){return+e}function sZ(e){return Math.floor(+e/1e3)}var QY,zi,Eye,Aye,pZ=Te(()=>{v();x();g();V2();QY={"-":"",_:" ",0:"0"},zi=/^\s*\d+/,Eye=/^%/,Aye=/[\\^$*+?|[\]().{}]/g});function FT(e){return xd=IT(e),G2=xd.format,mZ=xd.parse,Y2=xd.utcFormat,hZ=xd.utcParse,xd}var xd,G2,mZ,Y2,hZ,dZ=Te(()=>{v();x();g();pZ();FT({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 _T=Te(()=>{v();x();g();dZ()});function Swe(e){return new Date(e)}function Ewe(e){return e instanceof Date?+e:+new Date(+e)}function Z2(e,t,r,n,i,o,u,l,a,s){var f=Pp(),p=f.invert,h=f.domain,y=s(".%L"),N=s(":%S"),w=s("%I:%M"),D=s("%I %p"),b=s("%a %d"),O=s("%b %d"),M=s("%B"),I=s("%Y");function F(C){return(a(C){v();x();g();V2();_T();Ou();xo();dT()});function LT(){return Tn.apply(Z2(ET,AT,Na,gd,Nl,zp,md,cd,is,Y2).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}var vZ=Te(()=>{v();x();g();V2();_T();BT();xo()});function X2(){var e=0,t=1,r,n,i,o,u=Ai,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,N;return arguments.length?([y,N]=h,u=p(y,N),s):[u(0),u(1)]}}return s.range=f(Zo),s.rangeRound=f(Gf),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 Sl(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function K2(){var e=Fo(X2()(Ai));return e.copy=function(){return Sl(e,K2())},rs.apply(e,arguments)}function PT(){var e=x0(X2()).domain([1,10]);return e.copy=function(){return Sl(e,PT()).base(e.base())},rs.apply(e,arguments)}function RT(){var e=y0(X2());return e.copy=function(){return Sl(e,RT()).constant(e.constant())},rs.apply(e,arguments)}function J2(){var e=w0(X2());return e.copy=function(){return Sl(e,J2()).exponent(e.exponent())},rs.apply(e,arguments)}function gZ(){return J2.apply(null,arguments).exponent(.5)}var qT=Te(()=>{v();x();g();xl();Ou();xo();yl();L2();R2();q2()});function Q2(){var e=[],t=Ai;function r(n){if(n!=null&&!isNaN(n=+n))return t((Us(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(Io),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)=>s2(e,o/n))},r.copy=function(){return Q2(t).domain(e)},rs.apply(r,arguments)}var xZ=Te(()=>{v();x();g();ts();Ou();xo()});function j2(){var e=0,t=.5,r=1,n=1,i,o,u,l,a,s=Ai,f,p=!1,h;function y(w){return isNaN(w=+w)?h:(w=.5+((w=+f(w))-o)*(n*w{v();x();g();xl();Ou();xo();yl();L2();qT();R2();q2()});var bZ={};La(bZ,{scaleBand:()=>l0,scaleDiverging:()=>eD,scaleDivergingLog:()=>zT,scaleDivergingPow:()=>tD,scaleDivergingSqrt:()=>yZ,scaleDivergingSymlog:()=>UT,scaleIdentity:()=>k2,scaleImplicit:()=>l2,scaleLinear:()=>_2,scaleLog:()=>B2,scaleOrdinal:()=>rd,scalePoint:()=>cG,scalePow:()=>b0,scaleQuantile:()=>U2,scaleQuantize:()=>H2,scaleRadial:()=>z2,scaleSequential:()=>K2,scaleSequentialLog:()=>PT,scaleSequentialPow:()=>J2,scaleSequentialQuantile:()=>Q2,scaleSequentialSqrt:()=>gZ,scaleSequentialSymlog:()=>RT,scaleSqrt:()=>OY,scaleSymlog:()=>P2,scaleThreshold:()=>$2,scaleTime:()=>kT,scaleUtc:()=>LT,tickFormat:()=>v0});var DZ=Te(()=>{v();x();g();pG();NY();yl();L2();R2();WM();q2();FY();_Y();kY();BY();BT();vZ();qT();xZ();wZ();hT()});function NZ(e){return e}var SZ=Te(()=>{v();x();g()});function Awe(e){return"translate("+e+",0)"}function Cwe(e){return"translate(0,"+e+")"}function Mwe(e){return t=>+e(t)}function Twe(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),r=>+e(r)+t}function Owe(){return!this.__axis}function iD(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===rD||e===C0?-1:1,f=e===C0||e===nD?"x":"y",p=e===rD||e===HT?Awe:Cwe;function h(y){var N=n??(t.ticks?t.ticks.apply(t,r):t.domain()),w=i??(t.tickFormat?t.tickFormat.apply(t,r):NZ),D=Math.max(o,0)+l,b=t.range(),O=+b[0]+a,M=+b[b.length-1]+a,I=(t.bandwidth?Twe:Mwe)(t.copy(),a),F=y.selection?y.selection():y,C=F.selectAll(".domain").data([null]),P=F.selectAll(".tick").data(N,t).order(),R=P.exit(),q=P.enter().append("g").attr("class","tick"),z=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),z=z.merge(q.append("line").attr("stroke","currentColor").attr(f+"2",s*o)),H=H.merge(q.append("text").attr("fill","currentColor").attr(f,s*D).attr("dy",e===rD?"0em":e===HT?"0.71em":"0.32em")),y!==F&&(C=C.transition(y),P=P.transition(y),z=z.transition(y),H=H.transition(y),R=R.transition(y).attr("opacity",EZ).attr("transform",function(V){return isFinite(V=I(V))?p(V+a):this.getAttribute("transform")}),q.attr("opacity",EZ).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===nD?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)}),z.attr(f+"2",s*o),H.attr(f,s*D).text(w),F.filter(Owe).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===nD?"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 AZ(e){return iD(rD,e)}function CZ(e){return iD(nD,e)}function MZ(e){return iD(HT,e)}function TZ(e){return iD(C0,e)}var rD,nD,HT,C0,EZ,OZ=Te(()=>{v();x();g();SZ();rD=1,nD=2,HT=3,C0=4,EZ=1e-6});var IZ={};La(IZ,{axisBottom:()=>MZ,axisLeft:()=>TZ,axisRight:()=>CZ,axisTop:()=>AZ});var FZ=Te(()=>{v();x();g();OZ()});function kZ(){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 _we(e,t){for(var r=0,n=e.length,i;r{v();x();g();Iwe={value:()=>{}};oD.prototype=kZ.prototype={constructor:oD,on:function(e,t){var r=this._,n=Fwe(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{v();x();g();BZ()});var aD,T0,sD=Te(()=>{v();x();g();aD="http://www.w3.org/1999/xhtml",T0={svg:"http://www.w3.org/2000/svg",xhtml:aD,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}});function Fu(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 uD=Te(()=>{v();x();g();sD()});function kwe(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===aD&&t.documentElement.namespaceURI===aD?t.createElement(e):t.createElementNS(r,e)}}function Bwe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Kf(e){var t=Fu(e);return(t.local?Bwe:kwe)(t)}var O0=Te(()=>{v();x();g();uD();sD()});function Lwe(){}function Jf(e){return e==null?Lwe:function(){return this.querySelector(e)}}var lD=Te(()=>{v();x();g()});function LZ(e){typeof e!="function"&&(e=Jf(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i{v();x();g();os();lD()});function I0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}var WT=Te(()=>{v();x();g()});function Pwe(){return[]}function yd(e){return e==null?Pwe:function(){return this.querySelectorAll(e)}}var VT=Te(()=>{v();x();g()});function Rwe(e){return function(){return I0(e.apply(this,arguments))}}function RZ(e){typeof e=="function"?e=Rwe(e):e=yd(e);for(var t=this._groups,r=t.length,n=[],i=[],o=0;o{v();x();g();os();WT();VT()});function wd(e){return function(){return this.matches(e)}}function fD(e){return function(t){return t.matches(e)}}var F0=Te(()=>{v();x();g()});function zwe(e){return function(){return qwe.call(this.children,e)}}function Uwe(){return this.firstElementChild}function zZ(e){return this.select(e==null?Uwe:zwe(typeof e=="function"?e:fD(e)))}var qwe,UZ=Te(()=>{v();x();g();F0();qwe=Array.prototype.find});function $we(){return Array.from(this.children)}function Wwe(e){return function(){return Hwe.call(this.children,e)}}function HZ(e){return this.selectAll(e==null?$we:Wwe(typeof e=="function"?e:fD(e)))}var Hwe,$Z=Te(()=>{v();x();g();F0();Hwe=Array.prototype.filter});function WZ(e){typeof e!="function"&&(e=wd(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i{v();x();g();os();F0()});function cD(e){return new Array(e.length)}var GT=Te(()=>{v();x();g()});function GZ(){return new bn(this._enter||this._groups.map(cD),this._parents)}function _0(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}var YT=Te(()=>{v();x();g();GT();os();_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 YZ(e){return function(){return e}}var ZZ=Te(()=>{v();x();g()});function Vwe(e,t,r,n,i,o){for(var u=0,l,a=t.length,s=o.length;u=M&&(M=O+1);!(F=D[M])&&++M{v();x();g();os();YT();ZZ()});function JZ(){return new bn(this._exit||this._groups.map(cD),this._parents)}var QZ=Te(()=>{v();x();g();GT();os()});function jZ(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 eX=Te(()=>{v();x();g()});function tX(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{v();x();g();os()});function nX(){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 iX=Te(()=>{v();x();g()});function oX(e){e||(e=Xwe);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 aX=Te(()=>{v();x();g();os()});function sX(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}var uX=Te(()=>{v();x();g()});function lX(){return Array.from(this)}var fX=Te(()=>{v();x();g()});function cX(){for(var e=this._groups,t=0,r=e.length;t{v();x();g()});function mX(){let e=0;for(let t of this)++e;return e}var hX=Te(()=>{v();x();g()});function dX(){return!this.node()}var vX=Te(()=>{v();x();g()});function gX(e){for(var t=this._groups,r=0,n=t.length;r{v();x();g()});function Kwe(e){return function(){this.removeAttribute(e)}}function Jwe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Qwe(e,t){return function(){this.setAttribute(e,t)}}function jwe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ebe(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function tbe(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 yX(e,t){var r=Fu(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?Jwe:Kwe:typeof t=="function"?r.local?tbe:ebe:r.local?jwe:Qwe)(r,t))}var wX=Te(()=>{v();x();g();uD()});function bd(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}var pD=Te(()=>{v();x();g()});function rbe(e){return function(){this.style.removeProperty(e)}}function nbe(e,t,r){return function(){this.style.setProperty(e,t,r)}}function ibe(e,t,r){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function bX(e,t,r){return arguments.length>1?this.each((t==null?rbe:typeof t=="function"?ibe:nbe)(e,t,r??"")):El(this.node(),e)}function El(e,t){return e.style.getPropertyValue(t)||bd(e).getComputedStyle(e,null).getPropertyValue(t)}var ZT=Te(()=>{v();x();g();pD()});function obe(e){return function(){delete this[e]}}function abe(e,t){return function(){this[e]=t}}function sbe(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function DX(e,t){return arguments.length>1?this.each((t==null?obe:typeof t=="function"?sbe:abe)(e,t)):this.node()[e]}var NX=Te(()=>{v();x();g()});function SX(e){return e.trim().split(/^|\s+/)}function XT(e){return e.classList||new EX(e)}function EX(e){this._node=e,this._names=SX(e.getAttribute("class")||"")}function AX(e,t){for(var r=XT(e),n=-1,i=t.length;++n{v();x();g();EX.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 cbe(){this.textContent=""}function pbe(e){return function(){this.textContent=e}}function mbe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function OX(e){return arguments.length?this.each(e==null?cbe:(typeof e=="function"?mbe:pbe)(e)):this.node().textContent}var IX=Te(()=>{v();x();g()});function hbe(){this.innerHTML=""}function dbe(e){return function(){this.innerHTML=e}}function vbe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function FX(e){return arguments.length?this.each(e==null?hbe:(typeof e=="function"?vbe:dbe)(e)):this.node().innerHTML}var _X=Te(()=>{v();x();g()});function gbe(){this.nextSibling&&this.parentNode.appendChild(this)}function kX(){return this.each(gbe)}var BX=Te(()=>{v();x();g()});function xbe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function LX(){return this.each(xbe)}var PX=Te(()=>{v();x();g()});function RX(e){var t=typeof e=="function"?e:Kf(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}var qX=Te(()=>{v();x();g();O0()});function ybe(){return null}function zX(e,t){var r=typeof e=="function"?e:Kf(e),n=t==null?ybe:typeof t=="function"?t:Jf(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}var UX=Te(()=>{v();x();g();O0();lD()});function wbe(){var e=this.parentNode;e&&e.removeChild(this)}function HX(){return this.each(wbe)}var $X=Te(()=>{v();x();g()});function bbe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Dbe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function WX(e){return this.select(e?Dbe:bbe)}var VX=Te(()=>{v();x();g()});function GX(e){return arguments.length?this.property("__data__",e):this.node().__data__}var YX=Te(()=>{v();x();g()});function Nbe(e){return function(t){e.call(this,t,this.__data__)}}function Sbe(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 Ebe(e){return function(){var t=this.__on;if(t){for(var r=0,n=-1,i=t.length,o;r{v();x();g()});function KX(e,t,r){var n=bd(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 Cbe(e,t){return function(){return KX(this,e,t)}}function Mbe(e,t){return function(){return KX(this,e,t.apply(this,arguments))}}function JX(e,t){return this.each((typeof t=="function"?Mbe:Cbe)(e,t))}var QX=Te(()=>{v();x();g();pD()});function*jX(){for(var e=this._groups,t=0,r=e.length;t{v();x();g()});function bn(e,t){this._groups=e,this._parents=t}function tK(){return new bn([[document.documentElement]],k0)}function Tbe(){return this}var k0,_u,os=Te(()=>{v();x();g();PZ();qZ();UZ();$Z();VZ();KZ();YT();QZ();eX();rX();iX();aX();uX();fX();pX();hX();vX();xX();wX();ZT();NX();TX();IX();_X();BX();PX();qX();UX();$X();VX();YX();XX();QX();eK();k0=[null];bn.prototype=tK.prototype={constructor:bn,select:LZ,selectAll:RZ,selectChild:zZ,selectChildren:HZ,filter:WZ,data:XZ,enter:GZ,exit:JZ,join:jZ,merge:tX,selection:Tbe,order:nX,sort:oX,call:sX,nodes:lX,node:cX,size:mX,empty:dX,each:gX,attr:yX,style:bX,property:DX,classed:MX,text:OX,html:FX,raise:kX,lower:LX,append:RX,insert:zX,remove:HX,clone:WX,datum:GX,on:ZX,dispatch:JX,[Symbol.iterator]:jX};_u=tK});function Sa(e){return typeof e=="string"?new bn([[document.querySelector(e)]],[document.documentElement]):new bn([[e]],k0)}var KT=Te(()=>{v();x();g();os()});function rK(e){return Sa(Kf(e).call(document.documentElement))}var nK=Te(()=>{v();x();g();O0();KT()});function mD(){return new JT}function JT(){this._="@"+(++Obe).toString(36)}var Obe,iK=Te(()=>{v();x();g();Obe=0;JT.prototype=mD.prototype={constructor:JT,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 hD(e){let t;for(;t=e.sourceEvent;)e=t;return e}var QT=Te(()=>{v();x();g()});function as(e,t){if(e=hD(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 jT=Te(()=>{v();x();g();QT()});function oK(e,t){return e.target&&(e=hD(e),t===void 0&&(t=e.currentTarget),e=e.touches||[e]),Array.from(e,r=>as(r,t))}var aK=Te(()=>{v();x();g();jT();QT()});function sK(e){return typeof e=="string"?new bn([document.querySelectorAll(e)],[document.documentElement]):new bn([I0(e)],k0)}var uK=Te(()=>{v();x();g();WT();os()});var Vs={};La(Vs,{create:()=>rK,creator:()=>Kf,local:()=>mD,matcher:()=>wd,namespace:()=>Fu,namespaces:()=>T0,pointer:()=>as,pointers:()=>oK,select:()=>Sa,selectAll:()=>sK,selection:()=>_u,selector:()=>Jf,selectorAll:()=>yd,style:()=>El,window:()=>bd});var Jn=Te(()=>{v();x();g();nK();O0();iK();F0();uD();sD();jT();aK();KT();uK();os();lD();VT();ZT();pD()});function vD(e){e.preventDefault(),e.stopImmediatePropagation()}var dD,lK=Te(()=>{v();x();g();dD={capture:!0,passive:!1}});function e3(e){var t=e.document.documentElement,r=Sa(e).on("dragstart.drag",vD,dD);"onselectstart"in t?r.on("selectstart.drag",vD,dD):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function t3(e,t){var r=e.document.documentElement,n=Sa(e).on("dragstart.drag",null);t&&(n.on("click.drag",vD,dD),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 fK=Te(()=>{v();x();g();Jn();lK()});var cK=Te(()=>{v();x();g();fK()});function z0(){return $p||(hK(Ibe),$p=R0.now()+yD)}function Ibe(){$p=0}function q0(){this._call=this._time=this._next=null}function wD(e,t,r){var n=new q0;return n.restart(e,t,r),n}function dK(){z0(),++Dd;for(var e=gD,t;e;)(t=$p-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Dd}function pK(){$p=(xD=R0.now())+yD,Dd=L0=0;try{dK()}finally{Dd=0,_be(),$p=0}}function Fbe(){var e=R0.now(),t=e-xD;t>mK&&(yD-=t,xD=e)}function _be(){for(var e,t=gD,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:gD=r);P0=e,r3(n)}function r3(e){if(!Dd){L0&&(L0=clearTimeout(L0));var t=e-$p;t>24?(e<1/0&&(L0=setTimeout(pK,e-R0.now()-yD)),B0&&(B0=clearInterval(B0))):(B0||(xD=R0.now(),B0=setInterval(Fbe,mK)),Dd=1,hK(pK))}}var Dd,L0,B0,mK,gD,P0,xD,$p,yD,R0,hK,n3=Te(()=>{v();x();g();Dd=0,L0=0,B0=0,mK=1e3,xD=0,$p=0,yD=0,R0=typeof performance=="object"&&performance.now?performance:Date,hK=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};q0.prototype=wD.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:gD=this,P0=this),this._call=e,this._time=r,r3()},stop:function(){this._call&&(this._call=null,this._time=1/0,r3())}}});function bD(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 vK=Te(()=>{v();x();g();n3()});var i3=Te(()=>{v();x();g();n3();vK()});function Qf(e,t,r,n,i,o){var u=e.__transition;if(!u)e.__transition={};else if(r in u)return;Lbe(e,r,{name:t,index:n,group:i,on:kbe,tween:Bbe,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:yK})}function H0(e,t){var r=Ci(e,t);if(r.state>yK)throw new Error("too late; already scheduled");return r}function to(e,t){var r=Ci(e,t);if(r.state>DD)throw new Error("too late; already running");return r}function Ci(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function Lbe(e,t,r){var n=e.__transition,i;n[t]=r,r.timer=wD(o,0,r.time);function o(s){r.state=gK,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!==gK)return a();for(f in n)if(y=n[f],y.name===r.name){if(y.state===DD)return bD(u);y.state===xK?(y.state=U0,y.timer.stop(),y.on.call("interrupt",e,e.__data__,y.index,y.group),delete n[f]):+f{v();x();g();$T();i3();kbe=M0("start","end","cancel","interrupt"),Bbe=[],yK=0,gK=1,ND=2,DD=3,xK=4,SD=5,U0=6});function Wp(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>ND&&n.state{v();x();g();Xo()});function wK(e){return this.each(function(){Wp(this,e)})}var bK=Te(()=>{v();x();g();o3()});function Pbe(e,t){var r,n;return function(){var i=to(this,e),o=i.tween;if(o!==r){n=r=o;for(var u=0,l=n.length;u{v();x();g();Xo()});function ED(e,t){var r;return(typeof t=="number"?qi:t instanceof ns?Vf:(r=ns(t))?(t=r,Vf):ld)(e,t)}var a3=Te(()=>{v();x();g();Ws();xl()});function qbe(e){return function(){this.removeAttribute(e)}}function zbe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ube(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 Hbe(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 $be(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 Wbe(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 NK(e,t){var r=Fu(e),n=r==="transform"?O2:ED;return this.attrTween(e,typeof t=="function"?(r.local?Wbe:$be)(r,n,Nd(this,"attr."+e,t)):t==null?(r.local?zbe:qbe)(r):(r.local?Hbe:Ube)(r,n,t))}var SK=Te(()=>{v();x();g();xl();Jn();$0();a3()});function Vbe(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function Gbe(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function Ybe(e,t){var r,n;function i(){var o=t.apply(this,arguments);return o!==n&&(r=(n=o)&&Gbe(e,o)),r}return i._value=t,i}function Zbe(e,t){var r,n;function i(){var o=t.apply(this,arguments);return o!==n&&(r=(n=o)&&Vbe(e,o)),r}return i._value=t,i}function EK(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=Fu(e);return this.tween(r,(n.local?Ybe:Zbe)(n,t))}var AK=Te(()=>{v();x();g();Jn()});function Xbe(e,t){return function(){H0(this,e).delay=+t.apply(this,arguments)}}function Kbe(e,t){return t=+t,function(){H0(this,e).delay=t}}function CK(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Xbe:Kbe)(t,e)):Ci(this.node(),t).delay}var MK=Te(()=>{v();x();g();Xo()});function Jbe(e,t){return function(){to(this,e).duration=+t.apply(this,arguments)}}function Qbe(e,t){return t=+t,function(){to(this,e).duration=t}}function TK(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Jbe:Qbe)(t,e)):Ci(this.node(),t).duration}var OK=Te(()=>{v();x();g();Xo()});function jbe(e,t){if(typeof t!="function")throw new Error;return function(){to(this,e).ease=t}}function IK(e){var t=this._id;return arguments.length?this.each(jbe(t,e)):Ci(this.node(),t).ease}var FK=Te(()=>{v();x();g();Xo()});function e2e(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;to(this,e).ease=r}}function _K(e){if(typeof e!="function")throw new Error;return this.each(e2e(this._id,e))}var kK=Te(()=>{v();x();g();Xo()});function BK(e){typeof e!="function"&&(e=wd(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i{v();x();g();Jn();Vp()});function PK(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{v();x();g();Vp()});function t2e(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 r2e(e,t,r){var n,i,o=t2e(t)?H0:to;return function(){var u=o(this,e),l=u.on;l!==n&&(i=(n=l).copy()).on(t,r),u.on=i}}function qK(e,t){var r=this._id;return arguments.length<2?Ci(this.node(),r).on.on(e):this.each(r2e(r,e,t))}var zK=Te(()=>{v();x();g();Xo()});function n2e(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function UK(){return this.on("end.remove",n2e(this._id))}var HK=Te(()=>{v();x();g()});function $K(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Jf(e));for(var n=this._groups,i=n.length,o=new Array(i),u=0;u{v();x();g();Jn();Vp();Xo()});function VK(e){var t=this._name,r=this._id;typeof e!="function"&&(e=yd(e));for(var n=this._groups,i=n.length,o=[],u=[],l=0;l{v();x();g();Jn();Vp();Xo()});function YK(){return new i2e(this._groups,this._parents)}var i2e,ZK=Te(()=>{v();x();g();Jn();i2e=_u.prototype.constructor});function o2e(e,t){var r,n,i;return function(){var o=El(this,e),u=(this.style.removeProperty(e),El(this,e));return o===u?null:o===r&&u===n?i:i=t(r=o,n=u)}}function XK(e){return function(){this.style.removeProperty(e)}}function a2e(e,t,r){var n,i=r+"",o;return function(){var u=El(this,e);return u===i?null:u===n?o:o=t(n=u,r)}}function s2e(e,t,r){var n,i,o;return function(){var u=El(this,e),l=r(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),El(this,e))),u===a?null:u===n&&a===i?o:(i=a,o=t(n=u,l))}}function u2e(e,t){var r,n,i,o="style."+t,u="end."+o,l;return function(){var a=to(this,e),s=a.on,f=a.value[o]==null?l||(l=XK(t)):void 0;(s!==r||i!==f)&&(n=(r=s).copy()).on(u,i=f),a.on=n}}function KK(e,t,r){var n=(e+="")=="transform"?T2:ED;return t==null?this.styleTween(e,o2e(e,n)).on("end.style."+e,XK(e)):typeof t=="function"?this.styleTween(e,s2e(e,n,Nd(this,"style."+e,t))).each(u2e(this._id,e)):this.styleTween(e,a2e(e,n,t),r).on("end.style."+e,null)}var JK=Te(()=>{v();x();g();xl();Jn();Xo();$0();a3()});function l2e(e,t,r){return function(n){this.style.setProperty(e,t.call(this,n),r)}}function f2e(e,t,r){var n,i;function o(){var u=t.apply(this,arguments);return u!==i&&(n=(i=u)&&l2e(e,u,r)),n}return o._value=t,o}function QK(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,f2e(e,t,r??""))}var jK=Te(()=>{v();x();g()});function c2e(e){return function(){this.textContent=e}}function p2e(e){return function(){var t=e(this);this.textContent=t??""}}function eJ(e){return this.tween("text",typeof e=="function"?p2e(Nd(this,"text",e)):c2e(e==null?"":e+""))}var tJ=Te(()=>{v();x();g();$0()});function m2e(e){return function(t){this.textContent=e.call(this,t)}}function h2e(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 rJ(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,h2e(e))}var nJ=Te(()=>{v();x();g()});function iJ(){for(var e=this._name,t=this._id,r=AD(),n=this._groups,i=n.length,o=0;o{v();x();g();Vp();Xo()});function aJ(){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=to(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 sJ=Te(()=>{v();x();g();Xo()});function _o(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}function uJ(e){return _u().transition(e)}function AD(){return++d2e}var d2e,Al,Vp=Te(()=>{v();x();g();Jn();SK();AK();MK();OK();FK();kK();LK();RK();zK();HK();WK();GK();ZK();JK();jK();tJ();nJ();oJ();$0();sJ();d2e=0;Al=_u.prototype;_o.prototype=uJ.prototype={constructor:_o,select:$K,selectAll:VK,selectChild:Al.selectChild,selectChildren:Al.selectChildren,filter:BK,merge:PK,selection:YK,transition:iJ,call:Al.call,nodes:Al.nodes,node:Al.node,size:Al.size,empty:Al.empty,each:Al.each,on:qK,attr:NK,attrTween:EK,style:KK,styleTween:QK,text:eJ,textTween:rJ,remove:UK,tween:DK,delay:CK,duration:TK,ease:IK,easeVarying:_K,end:aJ,[Symbol.iterator]:Al[Symbol.iterator]}});function CD(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var lJ=Te(()=>{v();x();g()});var fJ=Te(()=>{v();x();g();lJ()});function g2e(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 cJ(e){var t,r;e instanceof _o?(t=e._id,e=e._name):(t=AD(),(r=v2e).time=z0(),e=e==null?null:e+"");for(var n=this._groups,i=n.length,o=0;o{v();x();g();Vp();Xo();fJ();i3();v2e={time:null,delay:0,duration:250,ease:CD}});var mJ=Te(()=>{v();x();g();Jn();bK();pJ();_u.prototype.interrupt=wK;_u.prototype.transition=cJ});var hJ=Te(()=>{v();x();g();mJ();o3()});var W0,dJ=Te(()=>{v();x();g();W0=e=>()=>e});function s3(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 vJ=Te(()=>{v();x();g()});function ss(e,t,r){this.k=e,this.x=t,this.y=r}function MD(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Sd;return e.__zoom}var Sd,u3=Te(()=>{v();x();g();ss.prototype={constructor:ss,scale:function(e){return e===1?this:new ss(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ss(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+")"}};Sd=new ss(1,0,0);MD.prototype=ss.prototype});function TD(e){e.stopImmediatePropagation()}function Ed(e){e.preventDefault(),e.stopImmediatePropagation()}var gJ=Te(()=>{v();x();g()});function x2e(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function y2e(){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 xJ(){return this.__zoom||Sd}function w2e(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 D2e(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 yJ(){var e=x2e,t=y2e,r=D2e,n=w2e,i=b2e,o=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],l=250,a=I2,s=M0("start","zoom","end"),f,p,h,y=500,N=150,w=0,D=10;function b(ee){ee.property("__zoom",xJ).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",q).on("dblclick.zoom",z).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)")}b.transform=function(ee,ie,X,Z){var le=ee.selection?ee.selection():ee;le.property("__zoom",xJ),ee!==le?F(ee,ie,X,Z):le.interrupt().each(function(){C(this,arguments).event(Z).start().zoom(null,typeof ie=="function"?ie.apply(this,arguments):ie).end()})},b.scaleBy=function(ee,ie,X,Z){b.scaleTo(ee,function(){var le=this.__zoom.k,re=typeof ie=="function"?ie.apply(this,arguments):ie;return le*re},X,Z)},b.scaleTo=function(ee,ie,X,Z){b.transform(ee,function(){var le=t.apply(this,arguments),re=this.__zoom,he=X==null?I(le):typeof X=="function"?X.apply(this,arguments):X,De=re.invert(he),ye=typeof ie=="function"?ie.apply(this,arguments):ie;return r(M(O(re,ye),he,De),le,u)},X,Z)},b.translateBy=function(ee,ie,X,Z){b.transform(ee,function(){return r(this.__zoom.translate(typeof ie=="function"?ie.apply(this,arguments):ie,typeof X=="function"?X.apply(this,arguments):X),t.apply(this,arguments),u)},null,Z)},b.translateTo=function(ee,ie,X,Z,le){b.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(Sd.translate(De[0],De[1]).scale(he.k).translate(typeof ie=="function"?-ie.apply(this,arguments):-ie,typeof X=="function"?-X.apply(this,arguments):-X),re,u)},Z,le)};function O(ee,ie){return ie=Math.max(o[0],Math.min(o[1],ie)),ie===ee.k?ee:new ss(ie,ee.x,ee.y)}function M(ee,ie,X){var Z=ie[0]-X[0]*ee.k,le=ie[1]-X[1]*ee.k;return Z===ee.x&&le===ee.y?ee:new ss(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,X,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),ye=X==null?I(De):typeof X=="function"?X.apply(le,re):X,ce=Math.max(De[1][0]-De[0][0],De[1][1]-De[0][1]),Ne=le.__zoom,Pe=typeof ie=="function"?ie.apply(le,re):ie,Ce=a(Ne.invert(ye).concat(ce/Ne.k),Pe.invert(ye).concat(ce/Pe.k));return function(Oe){if(Oe===1)Oe=Pe;else{var He=Ce(Oe),Ee=ce/He[2];Oe=new ss(Ee,ye[0]-He[0]*Ee,ye[1]-He[1]*Ee)}he.zoom(null,Oe)}})}function C(ee,ie,X){return!X&&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=Sa(this.that).datum();s.call(ee,this.that,new s3(ee,{sourceEvent:this.sourceEvent,target:b,type:ee,transform:this.that.__zoom,dispatch:s}),ie)}};function R(ee,...ie){if(!e.apply(this,arguments))return;var X=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=as(ee);if(X.wheel)(X.mouse[0][0]!==re[0]||X.mouse[0][1]!==re[1])&&(X.mouse[1]=Z.invert(X.mouse[0]=re)),clearTimeout(X.wheel);else{if(Z.k===le)return;X.mouse=[re,Z.invert(re)],Wp(this),X.start()}Ed(ee),X.wheel=setTimeout(he,N),X.zoom("mouse",r(M(O(Z,le),X.mouse[0],X.mouse[1]),X.extent,u));function he(){X.wheel=null,X.end()}}function q(ee,...ie){if(h||!e.apply(this,arguments))return;var X=ee.currentTarget,Z=C(this,ie,!0).event(ee),le=Sa(ee.view).on("mousemove.zoom",ye,!0).on("mouseup.zoom",ce,!0),re=as(ee,X),he=ee.clientX,De=ee.clientY;e3(ee.view),TD(ee),Z.mouse=[re,this.__zoom.invert(re)],Wp(this),Z.start();function ye(Ne){if(Ed(Ne),!Z.moved){var Pe=Ne.clientX-he,Ce=Ne.clientY-De;Z.moved=Pe*Pe+Ce*Ce>w}Z.event(Ne).zoom("mouse",r(M(Z.that.__zoom,Z.mouse[0]=as(Ne,X),Z.mouse[1]),Z.extent,u))}function ce(Ne){le.on("mousemove.zoom mouseup.zoom",null),t3(Ne.view,Z.moved),Ed(Ne),Z.event(Ne).end()}}function z(ee,...ie){if(e.apply(this,arguments)){var X=this.__zoom,Z=as(ee.changedTouches?ee.changedTouches[0]:ee,this),le=X.invert(Z),re=X.k*(ee.shiftKey?.5:2),he=r(M(O(X,re),Z,le),t.apply(this,ie),u);Ed(ee),l>0?Sa(this).transition().duration(l).call(F,he,Z,ee):Sa(this).call(b.transform,he,Z,ee)}}function H(ee,...ie){if(e.apply(this,arguments)){var X=ee.touches,Z=X.length,le=C(this,ie,ee.changedTouches.length===Z).event(ee),re,he,De,ye;for(TD(ee),he=0;he{v();x();g();$T();cK();xl();Jn();hJ();dJ();vJ();u3();gJ()});var bJ={};La(bJ,{ZoomTransform:()=>ss,zoom:()=>yJ,zoomIdentity:()=>Sd,zoomTransform:()=>MD});var DJ=Te(()=>{v();x();g();wJ();u3()});function rn(){rn.init.call(this)}function OD(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function FJ(e){return e._maxListeners===void 0?rn.defaultMaxListeners:e._maxListeners}function AJ(e,t,r,n){var i,o,u,l;if(OD(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=FJ(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 N2e(){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 CJ(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=N2e.bind(n);return i.listener=r,n.wrapFn=i,i}function MJ(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{v();x();g();Ad=typeof Reflect=="object"?Reflect:null,NJ=Ad&&typeof Ad.apply=="function"?Ad.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};IJ=Ad&&typeof Ad.ownKeys=="function"?Ad.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};SJ=Number.isNaN||function(e){return e!=e};OJ=rn,rn.EventEmitter=rn,rn.prototype._events=void 0,rn.prototype._eventsCount=0,rn.prototype._maxListeners=void 0;EJ=10;Object.defineProperty(rn,"defaultMaxListeners",{enumerable:!0,get:function(){return EJ},set:function(e){if(typeof e!="number"||e<0||SJ(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");EJ=e}}),rn.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},rn.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||SJ(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},rn.prototype.getMaxListeners=function(){return FJ(this)},rn.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")NJ(l,this,t);else{var a=l.length,s=_J(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},rn.prototype.listeners=function(e){return MJ(this,e,!0)},rn.prototype.rawListeners=function(e){return MJ(this,e,!1)},rn.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):TJ.call(e,t)},rn.prototype.listenerCount=TJ,rn.prototype.eventNames=function(){return this._eventsCount>0?IJ(this._events):[]};Ko=OJ;Ko.EventEmitter;Ko.defaultMaxListeners;Ko.init;Ko.listenerCount;Ko.EventEmitter;Ko.defaultMaxListeners;Ko.init;Ko.listenerCount});var kJ={};La(kJ,{EventEmitter:()=>S2e,default:()=>Ko,defaultMaxListeners:()=>E2e,init:()=>A2e,listenerCount:()=>C2e,on:()=>M2e,once:()=>T2e});var S2e,E2e,A2e,C2e,M2e,T2e,BJ=Te(()=>{v();x();g();l3();l3();Ko.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)})};Ko.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:S2e,defaultMaxListeners:E2e,init:A2e,listenerCount:C2e,on:M2e,once:T2e}=Ko)});var LJ=dt(f3=>{"use strict";v();x();g();Object.defineProperty(f3,"__esModule",{value:!0});var O2e=(e0(),An(jg)),I2e=(Jn(),An(Vs));function F2e(e){let t=e.owner.meta.xScale,r=e.owner.meta.yScale,n=(0,O2e.line)().x(function(i){return i[0]}).y(function(i){return i[1]});return function(i){i.each(function(){let u=(0,I2e.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()})}}f3.default=F2e});var Cd=dt(G0=>{"use strict";v();x();g();Object.defineProperty(G0,"__esModule",{value:!0});G0.registerGraphType=void 0;var _2e=(Ws(),An(y2)),V0={COLORS:["steelblue","red","#05b378","orange","#4040e8","yellow","brown","magenta","cyan"].map(function(e){return(0,_2e.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 k2e(e,t){if(Object.hasOwn(V0.graphTypes,e))throw new Error(`registerGraphType: graphType ${e} is already registered.`);V0.graphTypes[e]=t}G0.registerGraphType=k2e;G0.default=V0});var ku=dt(Y0=>{"use strict";v();x();g();var B2e=Y0&&Y0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Y0,"__esModule",{value:!0});var PJ=B2e(Cd()),L2e={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%PJ.default.COLORS.length;return e.color||PJ.default.COLORS[r].hex()},infinity:function(){return 9007199254740991}};Y0.default=L2e});var c3=dt((Gvr,RJ)=>{v();x();g();RJ.exports={EOF:0,DELIMITER:1,NUMBER:2,STRING:3,SYMBOL:4}});var m3=dt((Kvr,zJ)=>{v();x();g();var Gp=c3(),P2e={n:` -`,f:"\f",r:"\r",t:" ",v:"\v","'":"'",'"':'"'},R2e={",":!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 Cl(e){return e>="0"&&e<="9"}function qJ(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"}function q2e(e){return e===" "||e==="\r"||e===" "||e===` -`||e==="\v"||e==="\xA0"}function p3(e){return R2e[e]}function z2e(e){return e==="'"||e==='"'}function jf(){}jf.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};jf.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)};jf.prototype.consume=function(){var e=this.peek();return this.index+=1,e};jf.prototype.readNumber=function(){var e="";if(this.peek()===".")e+=this.consume(),Cl(this.peek())||this.throwError("number expected");else{for(;Cl(this.peek());)e+=this.consume();this.peek()==="."&&(e+=this.consume())}for(;Cl(this.peek());)e+=this.consume();if(this.peek()==="e"||this.peek()==="E")for(e+=this.consume(),Cl(this.peek())||this.peek()==="+"||this.peek()==="-"||this.throwError(),(this.peek()==="+"||this.peek()==="-")&&(e+=this.consume()),Cl(this.peek())||this.throwError("number expected");Cl(this.peek());)e+=this.consume();return e};jf.prototype.readIdentifier=function(){for(var e="";qJ(this.peek())||Cl(this.peek());)e+=this.consume();return e};jf.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=P2e[n];o?t+=o:t+=n}r=!1}else{if(n===e)break;n==="\\"?r=!0:t+=n}}return t};zJ.exports=jf});var Gs=dt((egr,HJ)=>{v();x();g();function UJ(){}UJ.prototype.type="Node";HJ.exports=UJ});var d3=dt((igr,$J)=>{v();x();g();var U2e=Gs(),H2e={number:!0,string:!0,boolean:!0,undefined:!0,null:!0};function h3(e,t){if(!H2e[t])throw Error("unsupported type '"+t+"'");this.value=e,this.valueType=t}h3.prototype=Object.create(U2e.prototype);h3.prototype.type="ConstantNode";$J.exports=h3});var g3=dt((ugr,WJ)=>{v();x();g();var $2e=Gs();function v3(e,t){this.op=e,this.args=t||[]}v3.prototype=Object.create($2e.prototype);v3.prototype.type="OperatorNode";WJ.exports=v3});var y3=dt((pgr,VJ)=>{v();x();g();var W2e=Gs();function x3(e,t){this.op=e,this.argument=t}x3.prototype=Object.create(W2e.prototype);x3.prototype.type="UnaryNode";VJ.exports=x3});var b3=dt((vgr,GJ)=>{v();x();g();var V2e=Gs();function w3(e){this.name=e}w3.prototype=Object.create(V2e.prototype);w3.prototype.type="SymbolNode";GJ.exports=w3});var N3=dt((wgr,YJ)=>{v();x();g();var G2e=Gs();function D3(e,t){this.name=e,this.args=t}D3.prototype=Object.create(G2e.prototype);D3.prototype.type="FunctionNode";YJ.exports=D3});var E3=dt((Sgr,ZJ)=>{v();x();g();var Y2e=Gs();function S3(e){this.nodes=e}S3.prototype=Object.create(Y2e.prototype);S3.prototype.type="ArrayNode";ZJ.exports=S3});var C3=dt((Mgr,XJ)=>{v();x();g();var Z2e=Gs();function A3(e,t,r){this.condition=e,this.trueExpr=t,this.falseExpr=r}A3.prototype=Object.create(Z2e.prototype);A3.prototype.type="ConditionalNode";XJ.exports=A3});var T3=dt((Fgr,KJ)=>{v();x();g();var X2e=Gs();function M3(e,t){this.name=e,this.expr=t}M3.prototype=Object.create(X2e.prototype);M3.prototype.type="AssignmentNode";KJ.exports=M3});var I3=dt((Lgr,JJ)=>{v();x();g();var K2e=Gs();function O3(e){this.blocks=e}O3.prototype=Object.create(K2e.prototype);O3.prototype.type="BlockNode";JJ.exports=O3});var eQ=dt((zgr,jJ)=>{v();x();g();var Yp=c3(),J2e=m3(),F3=d3(),Ea=g3(),Q2e=y3(),QJ=b3(),j2e=N3(),eDe=E3(),tDe=C3(),rDe=T3(),nDe=I3();function Wr(){this.lexer=new J2e,this.tokens=null}Wr.prototype.current=function(){return this.tokens[0]};Wr.prototype.next=function(){return this.tokens[1]};Wr.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 Ea(t.value,[e,r])}return e};Wr.prototype.shift=function(){var e=this.additive();if(this.peek(">>","<<",">>>")){var t=this.consume(),r=this.shift();return new Ea(t.value,[e,r])}return e};Wr.prototype.additive=function(){for(var e=this.multiplicative();this.peek("+","-");){var t=this.consume();e=new Ea(t.value,[e,this.multiplicative()])}return e};Wr.prototype.multiplicative=function(){for(var e,t,r=this.unary();this.peek("*","/","%");)e=this.consume(),r=new Ea(e.value,[r,this.unary()]);return this.current().type===Yp.SYMBOL||this.peek("(")||!(r.type instanceof F3)&&this.current().type===Yp.NUMBER?(t=this.multiplicative(),new Ea("*",[r,t])):r};Wr.prototype.unary=function(){if(this.peek("-","+","~")){var e=this.consume(),t=this.unary();return new Q2e(e.value,t)}return this.pow()};Wr.prototype.pow=function(){var e=this.factorial();if(this.peek("^","**")){var t=this.consume(),r=this.unary();return new Ea(t.value,[e,r])}return e};Wr.prototype.factorial=function(){var e=this.symbol();if(this.peek("!")){var t=this.consume();return new Ea(t.value,[e])}return e};Wr.prototype.symbol=function(){var e=this.current();if(e.type===Yp.SYMBOL){var t=this.consume(),r=this.functionCall(t);return r}return this.string()};Wr.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 j2e(t,r)}return new QJ(t)};Wr.prototype.string=function(){return this.current().type===Yp.STRING?new F3(this.consume().value,"string"):this.array()};Wr.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 eDe(e)}return this.number()};Wr.prototype.number=function(){var e=this.current();return e.type===Yp.NUMBER?new F3(this.consume().value,"number"):this.parentheses()};Wr.prototype.parentheses=function(){var e=this.current();if(e.value==="("){this.consume();var t=this.assignment();return this.expect(")"),t}return this.end()};Wr.prototype.end=function(){var e=this.current();if(e.type!==Yp.EOF)throw Error("unexpected end of expression")};jJ.exports=Wr});var rQ=dt((Wgr,tQ)=>{v();x();g();tQ.exports={ArrayNode:E3(),AssignmentNode:T3(),BlockNode:I3(),ConditionalNode:C3(),ConstantNode:d3(),FunctionNode:N3(),Node:Gs(),OperatorNode:g3(),SymbolNode:b3(),UnaryNode:y3()}});var Z0=dt((Zgr,ID)=>{"use strict";v();x();g();ID.exports.Lexer=m3();ID.exports.Parser=eQ();ID.exports.nodeTypes=rQ()});var X0=dt((Qgr,fQ)=>{"use strict";v();x();g();var FD=Object.prototype.hasOwnProperty,lQ=Object.prototype.toString,nQ=Object.defineProperty,iQ=Object.getOwnPropertyDescriptor,oQ=function(t){return typeof Array.isArray=="function"?Array.isArray(t):lQ.call(t)==="[object Array]"},aQ=function(t){if(!t||lQ.call(t)!=="[object Object]")return!1;var r=FD.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&FD.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;var i;for(i in t);return typeof i>"u"||FD.call(t,i)},sQ=function(t,r){nQ&&r.name==="__proto__"?nQ(t,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):t[r.name]=r.newValue},uQ=function(t,r){if(r==="__proto__")if(FD.call(t,r)){if(iQ)return iQ(t,r).value}else return;return t[r]};fQ.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";v();x();g();cQ.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 hQ=dt((a0r,mQ)=>{"use strict";v();x();g();mQ.exports=function(e){return'scope["'+e.name+'"] = '+this.next(e.expr)}});var vQ=dt((f0r,dQ)=>{"use strict";v();x();g();dQ.exports=function(e){var t="!!("+this.next(e.condition)+")",r=this.next(e.trueExpr),n=this.next(e.falseExpr);return"("+t+" ? ("+r+") : ("+n+") )"}});var xQ=dt((h0r,gQ)=>{"use strict";v();x();g();gQ.exports=function(e){return this.options.raw?e.value:this.options.factory+"("+e.value+")"}});var wQ=dt((x0r,_3)=>{"use strict";v();x();g();var iDe=Z0().nodeTypes.SymbolNode,yQ=function(e){return"$$mathCodegen.functionProxy("+this.next(new iDe(e.name))+', "'+e.name+'")'};_3.exports=function(e){var t=this,r=yQ.call(this,e),n=[];return this.rawify(this.options.rawCallExpressionElements,function(){n=e.args.map(function(i){return t.next(i)})}),r+"("+n.join(", ")+")"};_3.exports.functionProxy=yQ});var DQ=dt((D0r,bQ)=>{"use strict";v();x();g();bQ.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 SQ=dt((A0r,NQ)=>{"use strict";v();x();g();var oDe=DQ();NQ.exports=function(e){if(this.options.raw)return["("+this.next(e.args[0]),e.op,this.next(e.args[1])+")"].join(" ");var t=oDe[e.op];if(!t)throw TypeError("unidentified operator");return this.FunctionNode({name:t,args:e.args})}});var AQ=dt((O0r,EQ)=>{"use strict";v();x();g();EQ.exports=function(e){var t=e.name;return'$$mathCodegen.getProperty("'+t+'", scope, ns)'}});var MQ=dt((k0r,CQ)=>{"use strict";v();x();g();CQ.exports={"+":"positive","-":"negative","~":"oneComplement"}});var IQ=dt((R0r,OQ)=>{"use strict";v();x();g();var TQ=MQ();OQ.exports=function(e){if(this.options.raw)return e.op+this.next(e.argument);if(!(e.op in TQ))throw new SyntaxError(e.op+" not implemented");var t=TQ[e.op];return this.FunctionNode({name:t,args:[e.argument]})}});var kQ=dt((H0r,_Q)=>{"use strict";v();x();g();var FQ=X0(),aDe={ArrayNode:pQ(),AssignmentNode:hQ(),ConditionalNode:vQ(),ConstantNode:xQ(),FunctionNode:wQ(),OperatorNode:SQ(),SymbolNode:AQ(),UnaryNode:IQ()},_D=function(e,t){this.owner=e,this.options=FQ({factory:"ns.factory",raw:!1,rawArrayExpressionElements:!0,rawCallExpressionElements:!1},t)};FQ(_D.prototype,aDe);_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)};_Q.exports=_D});var LQ=dt((G0r,BQ)=>{"use strict";v();x();g();var sDe=Z0().Parser,uDe=kQ(),lDe=X0();function kD(e,t){this.statements=[],this.defs=t||{},this.interpreter=new uDe(this,e)}kD.prototype.setDefs=function(e){return this.defs=lDe(this.defs,e),this};kD.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:z}}}}var f,p;String.prototype.normalize?(f=function(D){return D.normalize("NFD").toLowerCase()},p=function(D){return D.normalize("NFD")}):(f=function(D){return D.toLowerCase()},p=function(D){return D});function h(D,b,O,M){if(D.length==b.length)return O;for(var I=0,F=O+Math.max(0,D.length-b.length);;){if(I==F)return I;var C=I+F>>1,P=M(D.slice(0,C)).length;if(P==O)return C;P>O?F=C:I=C+1}}function y(D,b,O,M){if(!b.length)return null;var I=M?f:p,F=I(b).split(/\r|\n\r?/);e:for(var C=O.line,P=O.ch,R=D.lastLine()+1-F.length;C<=R;C++,P=0){var q=D.getLine(C).slice(P),z=I(q);if(F.length==1){var H=z.indexOf(F[0]);if(H==-1)continue e;var O=h(q,z,H,I)+P;return{from:t(C,h(q,z,H,I)+P),to:t(C,h(q,z,H+F[0].length,I)+P)}}else{var V=z.length-F[0].length;if(z.slice(V)!=F[0])continue e;for(var W=1;W=R;C--,P=-1){var q=D.getLine(C);P>-1&&(q=q.slice(0,P));var z=I(q);if(F.length==1){var H=z.lastIndexOf(F[0]);if(H==-1)continue e;return{from:t(C,h(q,z,H,I)),to:t(C,h(q,z,H+F[0].length,I))}}else{var V=F[F.length-1];if(z.slice(0,V.length)!=V)continue e;for(var W=1,O=C-F.length+1;W(this.doc.getLine(b.line)||"").length&&(b.ch=0,b.line++)),e.cmpPos(b,this.doc.clipPos(b))!=0))return this.atOccurrence=!1;var O=this.matches(D,b);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(D?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(D,b){if(this.atOccurrence){var O=e.splitLines(D);this.doc.replaceRange(O,this.pos.from,this.pos.to,b),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(D,b,O){return new w(this.doc,D,b,O)}),e.defineDocExtension("getSearchCursor",function(D,b,O){return new w(this,D,b,O)}),e.defineExtension("selectMatches",function(D,b){for(var O=[],M=this.getSearchCursor(D,this.getCursor("from"),b);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 V$=dt(($$,W$)=>{v();x();g();(function(e){typeof $$=="object"&&typeof W$=="object"?e(Ls(),IC(),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,z){C.openDialog(P,q,{value:R,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){N(C)},onKeyDown:z,bottom:C.options.search.bottom})}function l(C,P,R,q,z){C.openDialog?C.openDialog(P,z,{value:q,selectValueOnOpen:!0,bottom:C.options.search.bottom}):z(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 z=n(C);if(z.query)return y(C,P);var H=C.getSelection()||z.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!=z.queryText&&(p(C,z,ee),z.posFrom=z.posTo=C.getCursor()),V&&(V.style.opacity=1),y(C,ie.shiftKey,function(X,Y){var le;Y.line<3&&document.querySelector&&(le=C.display.wrapper.querySelector(".CodeMirror-dialog"))&&le.getBoundingClientRect().bottom-4>C.cursorCoords(Y,"window").top&&((V=le).style.opacity=.4)}))};u(C,D(C),H,W,function(ee,ie){var X=e.keyName(ee),Y=C.getOption("extraKeys"),le=Y&&Y[X]||e.keyMap[C.getOption("keyMap")][X];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,z,H),y(C,P))}else l(C,D(C),"Search for:",H,function(ee){ee&&!z.query&&C.operation(function(){p(C,z,ee),z.posFrom=z.posTo=C.getCursor(),y(C,P)})})}function y(C,P,R){C.operation(function(){var q=n(C),z=o(C,q.query,P?q.posFrom:q.posTo);!z.find(P)&&(z=o(C,q.query,P?e.Pos(C.lastLine()):e.Pos(C.firstLine(),0)),!z.find(P))||(C.setSelection(z.from(),z.to()),C.scrollIntoView({from:z.from(),to:z.to()},20),q.posFrom=z.from(),q.posTo=z.to(),R&&R(z.from(),z.to()))})}function N(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 z=2;z{v();x();g();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 sr(e){return function(){return e}}var Rf=Te(()=>{v();x();g()});function rW(e){return e>1?0:e<-1?Rs:Math.acos(e)}function eM(e){return e>=1?zg:e<=-1?-zg:Math.asin(e)}var jC,Qi,Ps,tW,Tu,go,Nr,_i,Rs,zg,Ka,ji=Te(()=>{v();x();g();jC=Math.abs,Qi=Math.atan2,Ps=Math.cos,tW=Math.max,Tu=Math.min,go=Math.sin,Nr=Math.sqrt,_i=1e-12,Rs=Math.PI,zg=Rs/2,Ka=2*Rs});function nW(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return nW;let r=10**t;return function(n){this._+=n[0];for(let i=1,o=n.length;i{v();x();g();tM=Math.PI,rM=2*tM,Np=1e-6,K1e=rM-Np;Ep=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?nW:J1e(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>Np)if(!(Math.abs(p*a-s*f)>Np)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let y=n-u,N=i-l,w=a*a+s*s,D=y*y+N*N,b=Math.sqrt(w),O=Math.sqrt(h),M=o*Math.tan((tM-Math.acos((w+h-D)/(2*b*O)))/2),I=M/O,F=M/b;Math.abs(I-1)>Np&&this._append`L${t+I*f},${r+I*p}`,this._append`A${o},${o},0,0,${+(p*y>f*N)},${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)>Np||Math.abs(this._y1-f)>Np)&&this._append`L${s},${f}`,n&&(h<0&&(h=h%rM+rM),h>K1e?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>Np&&this._append`A${n},${n},0,${+(h>=tM)},${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._}};iW.prototype=Ep.prototype});var aW=Te(()=>{v();x();g();oW()});function Ou(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 Ep(t)}var qh=Te(()=>{v();x();g();aW()});function Q1e(e){return e.innerRadius}function j1e(e){return e.outerRadius}function exe(e){return e.startAngle}function txe(e){return e.endAngle}function rxe(e){return e&&e.padAngle}function nxe(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*h<_i))return h=(f*(t-o)-p*(e-i))/h,[e+h*a,t+h*s]}function Sb(e,t,r,n,i,o,u){var l=e-r,a=t-n,s=(u?o:-o)/Nr(l*l+a*a),f=s*a,p=-s*l,h=e+f,y=t+p,N=r+f,w=n+p,D=(h+N)/2,b=(y+w)/2,O=N-h,M=w-y,I=O*O+M*M,F=i-o,C=h*w-N*y,P=(M<0?-1:1)*Nr(tW(0,F*F*I-C*C)),R=(C*M-O*P)/I,q=(-C*O-M*P)/I,z=(C*M+O*P)/I,H=(-C*O+M*P)/I,V=R-D,W=q-b,ee=z-D,ie=H-b;return V*V+W*W>ee*ee+ie*ie&&(R=z,q=H),{cx:R,cy:q,x01:-f,y01:-p,x11:R*(i/F-1),y11:q*(i/F-1)}}function sW(){var e=Q1e,t=j1e,r=sr(0),n=null,i=exe,o=txe,u=rxe,l=null,a=Ou(s);function s(){var f,p,h=+e.apply(this,arguments),y=+t.apply(this,arguments),N=i.apply(this,arguments)-zg,w=o.apply(this,arguments)-zg,D=jC(w-N),b=w>N;if(l||(l=f=a()),y_i))l.moveTo(0,0);else if(D>Ka-_i)l.moveTo(y*Ps(N),y*go(N)),l.arc(0,0,y,N,w,!b),h>_i&&(l.moveTo(h*Ps(w),h*go(w)),l.arc(0,0,h,w,N,b));else{var O=N,M=w,I=N,F=w,C=D,P=D,R=u.apply(this,arguments)/2,q=R>_i&&(n?+n.apply(this,arguments):Nr(h*h+y*y)),z=Tu(jC(y-h)/2,+r.apply(this,arguments)),H=z,V=z,W,ee;if(q>_i){var ie=eM(q/h*go(R)),X=eM(q/y*go(R));(C-=ie*2)>_i?(ie*=b?1:-1,I+=ie,F-=ie):(C=0,I=F=(N+w)/2),(P-=X*2)>_i?(X*=b?1:-1,O+=X,M-=X):(P=0,O=M=(N+w)/2)}var Y=y*Ps(O),le=y*go(O),re=h*Ps(F),he=h*go(F);if(z>_i){var De=y*Ps(M),ye=y*go(M),ce=h*Ps(I),Ne=h*go(I),Pe;if(D_i?V>_i?(W=Sb(ce,Ne,Y,le,y,V,b),ee=Sb(De,ye,re,he,y,V,b),l.moveTo(W.cx+W.x01,W.cy+W.y01),V_i)||!(C>_i)?l.lineTo(re,he):H>_i?(W=Sb(re,he,De,ye,h,-H,b),ee=Sb(Y,le,ce,Ne,h,-H,b),l.lineTo(W.cx+W.x01,W.cy+W.y01),H{v();x();g();Rf();ji();qh()});function qf(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}var lW,zh=Te(()=>{v();x();g();lW=Array.prototype.slice});function fW(e){this._context=e}function zf(e){return new fW(e)}var Ug=Te(()=>{v();x();g();fW.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 Uh(e){return e[0]}function Hh(e){return e[1]}var Ab=Te(()=>{v();x();g()});function $h(e,t){var r=sr(!0),n=null,i=zf,o=null,u=Ou(l);e=typeof e=="function"?e:e===void 0?Uh:sr(e),t=typeof t=="function"?t:t===void 0?Hh:sr(t);function l(a){var s,f=(a=qf(a)).length,p,h=!1,y;for(n==null&&(o=i(y=u())),s=0;s<=f;++s)!(s{v();x();g();zh();Rf();Ug();qh();Ab()});function Mb(e,t,r){var n=null,i=sr(!0),o=null,u=zf,l=null,a=Ou(s);e=typeof e=="function"?e:e===void 0?Uh:sr(+e),t=typeof t=="function"?t:t===void 0?sr(0):sr(+t),r=typeof r=="function"?r:r===void 0?Hh:sr(+r);function s(p){var h,y,N,w=(p=qf(p)).length,D,b=!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;--N)l.point(M[N],I[N]);l.lineEnd(),l.areaEnd()}b&&(M[h]=+e(D,h,p),I[h]=+t(D,h,p),l.point(n?+n(D,h,p):M[h],r?+r(D,h,p):I[h]))}if(O)return l=null,O+""||null}function f(){return $h().defined(i).curve(u).context(o)}return s.x=function(p){return arguments.length?(e=typeof p=="function"?p:sr(+p),n=null,s):e},s.x0=function(p){return arguments.length?(e=typeof p=="function"?p:sr(+p),s):e},s.x1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:sr(+p),s):n},s.y=function(p){return arguments.length?(t=typeof p=="function"?p:sr(+p),r=null,s):t},s.y0=function(p){return arguments.length?(t=typeof p=="function"?p:sr(+p),s):t},s.y1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:sr(+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:sr(!!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 nM=Te(()=>{v();x();g();zh();Rf();Ug();Cb();qh();Ab()});function cW(e,t){return te?1:t>=e?0:NaN}var pW=Te(()=>{v();x();g()});function mW(e){return e}var hW=Te(()=>{v();x();g()});function dW(){var e=mW,t=cW,r=null,n=sr(0),i=sr(Ka),o=sr(0);function u(l){var a,s=(l=qf(l)).length,f,p,h=0,y=new Array(s),N=new Array(s),w=+n.apply(this,arguments),D=Math.min(Ka,Math.max(-Ka,i.apply(this,arguments)-w)),b,O=Math.min(Math.abs(D)/s,o.apply(this,arguments)),M=O*(D<0?-1:1),I;for(a=0;a0&&(h+=I);for(t!=null?y.sort(function(F,C){return t(N[F],N[C])}):r!=null&&y.sort(function(F,C){return r(l[F],l[C])}),a=0,p=h?(D-s*M)/h:0;a0?I*p:0)+M,N[f]={data:l[f],index:a,value:I,startAngle:w,endAngle:b,padAngle:O};return N}return u.value=function(l){return arguments.length?(e=typeof l=="function"?l:sr(+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:sr(+l),u):n},u.endAngle=function(l){return arguments.length?(i=typeof l=="function"?l:sr(+l),u):i},u.padAngle=function(l){return arguments.length?(o=typeof l=="function"?l:sr(+l),u):o},u}var vW=Te(()=>{v();x();g();zh();Rf();pW();hW();ji()});function gW(e){this._curve=e}function Wh(e){function t(r){return new gW(e(r))}return t._curve=e,t}var Tb,iM=Te(()=>{v();x();g();Ug();Tb=Wh(zf);gW.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 Vh(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(Wh(r)):t()._curve},e}function oM(){return Vh($h().curve(Tb))}var aM=Te(()=>{v();x();g();iM();Cb()});function sM(){var e=Mb().curve(Tb),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 Vh(r())},delete e.lineX0,e.lineEndAngle=function(){return Vh(n())},delete e.lineX1,e.lineInnerRadius=function(){return Vh(i())},delete e.lineY0,e.lineOuterRadius=function(){return Vh(o())},delete e.lineY1,e.curve=function(u){return arguments.length?t(Wh(u)):t()._curve},e}var xW=Te(()=>{v();x();g();iM();nM();aM()});function Sp(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}var uM=Te(()=>{v();x();g()});function Ib(e){return new Ob(e,!0)}function Fb(e){return new Ob(e,!1)}function yW(e){return new lM(e)}var Ob,lM,fM=Te(()=>{v();x();g();uM();Ob=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}},lM=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=Sp(this._x0,this._y0),i=Sp(this._x0,this._y0=(this._y0+r)/2),o=Sp(t,this._y0),u=Sp(t,r);this._context.moveTo(...n),this._context.bezierCurveTo(...i,...o,...u)}this._x0=t,this._y0=r}}});function ixe(e){return e.source}function oxe(e){return e.target}function Hg(e){let t=ixe,r=oxe,n=Uh,i=Hh,o=null,u=null,l=Ou(a);function a(){let s,f=lW.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:sr(+s),a):n},a.y=function(s){return arguments.length?(i=typeof s=="function"?s:sr(+s),a):i},a.context=function(s){return arguments.length?(s==null?o=u=null:u=e(o=s),a):o},a}function wW(){return Hg(Ib)}function bW(){return Hg(Fb)}function DW(){let e=Hg(yW);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}var NW=Te(()=>{v();x();g();zh();Rf();fM();qh();Ab()});var axe,_b,cM=Te(()=>{v();x();g();ji();axe=Nr(3),_b={draw(e,t){let r=Nr(t+Tu(t/28,.75))*.59436,n=r/2,i=n*axe;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 Gh,pM=Te(()=>{v();x();g();ji();Gh={draw(e,t){let r=Nr(t/Rs);e.moveTo(r,0),e.arc(0,0,r,0,Ka)}}});var kb,mM=Te(()=>{v();x();g();ji();kb={draw(e,t){let r=Nr(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 EW,sxe,Bb,hM=Te(()=>{v();x();g();ji();EW=Nr(1/3),sxe=EW*2,Bb={draw(e,t){let r=Nr(t/sxe),n=r*EW;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}}});var Lb,dM=Te(()=>{v();x();g();ji();Lb={draw(e,t){let r=Nr(t)*.62625;e.moveTo(0,-r),e.lineTo(r,0),e.lineTo(0,r),e.lineTo(-r,0),e.closePath()}}});var Pb,vM=Te(()=>{v();x();g();ji();Pb={draw(e,t){let r=Nr(t-Tu(t/7,2))*.87559;e.moveTo(-r,0),e.lineTo(r,0),e.moveTo(0,r),e.lineTo(0,-r)}}});var Rb,gM=Te(()=>{v();x();g();ji();Rb={draw(e,t){let r=Nr(t),n=-r/2;e.rect(n,n,r,r)}}});var qb,xM=Te(()=>{v();x();g();ji();qb={draw(e,t){let r=Nr(t)*.4431;e.moveTo(r,r),e.lineTo(r,-r),e.lineTo(-r,-r),e.lineTo(-r,r),e.closePath()}}});var uxe,SW,lxe,fxe,zb,yM=Te(()=>{v();x();g();ji();uxe=.8908130915292852,SW=go(Rs/10)/go(7*Rs/10),lxe=go(Ka/10)*SW,fxe=-Ps(Ka/10)*SW,zb={draw(e,t){let r=Nr(t*uxe),n=lxe*r,i=fxe*r;e.moveTo(0,-r),e.lineTo(n,i);for(let o=1;o<5;++o){let u=Ka*o/5,l=Ps(u),a=go(u);e.lineTo(a*r,-l*r),e.lineTo(l*n-a*i,a*n+l*i)}e.closePath()}}});var wM,Ub,bM=Te(()=>{v();x();g();ji();wM=Nr(3),Ub={draw(e,t){let r=-Nr(t/(wM*3));e.moveTo(0,r*2),e.lineTo(-wM*r,-r),e.lineTo(wM*r,-r),e.closePath()}}});var cxe,Hb,DM=Te(()=>{v();x();g();ji();cxe=Nr(3),Hb={draw(e,t){let r=Nr(t)*.6824,n=r/2,i=r*cxe/2;e.moveTo(0,-r),e.lineTo(i,n),e.lineTo(-i,n),e.closePath()}}});var Ja,Qa,NM,pxe,$b,EM=Te(()=>{v();x();g();ji();Ja=-.5,Qa=Nr(3)/2,NM=1/Nr(12),pxe=(NM/2+1)*3,$b={draw(e,t){let r=Nr(t/pxe),n=r/2,i=r*NM,o=n,u=r*NM+r,l=-o,a=u;e.moveTo(n,i),e.lineTo(o,u),e.lineTo(l,a),e.lineTo(Ja*n-Qa*i,Qa*n+Ja*i),e.lineTo(Ja*o-Qa*u,Qa*o+Ja*u),e.lineTo(Ja*l-Qa*a,Qa*l+Ja*a),e.lineTo(Ja*n+Qa*i,Ja*i-Qa*n),e.lineTo(Ja*o+Qa*u,Ja*u-Qa*o),e.lineTo(Ja*l+Qa*a,Ja*a-Qa*l),e.closePath()}}});var $g,SM=Te(()=>{v();x();g();ji();$g={draw(e,t){let r=Nr(t-Tu(t/6,1.7))*.6189;e.moveTo(-r,-r),e.lineTo(r,r),e.moveTo(-r,r),e.lineTo(r,-r)}}});function CM(e,t){let r=null,n=Ou(i);e=typeof e=="function"?e:sr(e||Gh),t=typeof t=="function"?t:sr(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:sr(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:sr(+o),i):t},i.context=function(o){return arguments.length?(r=o??null,i):r},i}var AM,AW,CW=Te(()=>{v();x();g();Rf();qh();cM();pM();mM();hM();dM();vM();gM();xM();yM();bM();DM();EM();SM();AM=[Gh,kb,Bb,Rb,zb,Ub,$b],AW=[Gh,Pb,$g,Hb,_b,qb,Lb]});function ja(){}var Wg=Te(()=>{v();x();g()});function Yh(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 Vg(e){this._context=e}function MW(e){return new Vg(e)}var Gg=Te(()=>{v();x();g();Vg.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:Yh(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:Yh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}});function TW(e){this._context=e}function OW(e){return new TW(e)}var IW=Te(()=>{v();x();g();Wg();Gg();TW.prototype={areaStart:ja,areaEnd:ja,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:Yh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}});function FW(e){this._context=e}function _W(e){return new FW(e)}var kW=Te(()=>{v();x();g();Gg();FW.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:Yh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}});function BW(e,t){this._basis=new Vg(e),this._beta=t}var LW,PW=Te(()=>{v();x();g();Gg();BW.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)}};LW=function e(t){function r(n){return t===1?new Vg(n):new BW(n,t)}return r.beta=function(n){return e(+n)},r}(.85)});function Zh(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 Wb(e,t){this._context=e,this._k=(1-t)/6}var RW,Yg=Te(()=>{v();x();g();Wb.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:Zh(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:Zh(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}};RW=function e(t){function r(n){return new Wb(n,t)}return r.tension=function(n){return e(+n)},r}(0)});function Vb(e,t){this._context=e,this._k=(1-t)/6}var qW,MM=Te(()=>{v();x();g();Wg();Yg();Vb.prototype={areaStart:ja,areaEnd:ja,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:Zh(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}};qW=function e(t){function r(n){return new Vb(n,t)}return r.tension=function(n){return e(+n)},r}(0)});function Gb(e,t){this._context=e,this._k=(1-t)/6}var zW,TM=Te(()=>{v();x();g();Yg();Gb.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:Zh(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}};zW=function e(t){function r(n){return new Gb(n,t)}return r.tension=function(n){return e(+n)},r}(0)});function Zg(e,t,r){var n=e._x1,i=e._y1,o=e._x2,u=e._y2;if(e._l01_a>_i){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>_i){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 UW(e,t){this._context=e,this._alpha=t}var HW,Yb=Te(()=>{v();x();g();ji();Yg();UW.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:Zg(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}};HW=function e(t){function r(n){return t?new UW(n,t):new Wb(n,0)}return r.alpha=function(n){return e(+n)},r}(.5)});function $W(e,t){this._context=e,this._alpha=t}var WW,VW=Te(()=>{v();x();g();MM();Wg();Yb();$W.prototype={areaStart:ja,areaEnd:ja,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:Zg(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}};WW=function e(t){function r(n){return t?new $W(n,t):new Vb(n,0)}return r.alpha=function(n){return e(+n)},r}(.5)});function GW(e,t){this._context=e,this._alpha=t}var YW,ZW=Te(()=>{v();x();g();TM();Yb();GW.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:Zg(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}};YW=function e(t){function r(n){return t?new GW(n,t):new Gb(n,0)}return r.alpha=function(n){return e(+n)},r}(.5)});function XW(e){this._context=e}function KW(e){return new XW(e)}var JW=Te(()=>{v();x();g();Wg();XW.prototype={areaStart:ja,areaEnd:ja,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 QW(e){return e<0?-1:1}function jW(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(QW(o)+QW(u))*Math.min(Math.abs(o),Math.abs(u),.5*Math.abs(l))||0}function eV(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function OM(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 Zb(e){this._context=e}function tV(e){this._context=new rV(e)}function rV(e){this._context=e}function nV(e){return new Zb(e)}function iV(e){return new tV(e)}var oV=Te(()=>{v();x();g();Zb.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:OM(this,this._t0,eV(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,OM(this,eV(this,r=jW(this,e,t)),r);break;default:OM(this,this._t0,r=jW(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};(tV.prototype=Object.create(Zb.prototype)).point=function(e,t){Zb.prototype.point.call(this,t,e)};rV.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 sV(e){this._context=e}function aV(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{v();x();g();sV.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=aV(e),i=aV(t),o=0,u=1;u{v();x();g();Xb.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 qs(e,t){if((u=e.length)>1)for(var r=1,n,i,o=e[t[0]],u,l=o.length;r{v();x();g()});function zs(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}var Kh=Te(()=>{v();x();g()});function mxe(e,t){return e[t]}function hxe(e){let t=[];return t.key=e,t}function hV(){var e=sr([]),t=zs,r=qs,n=mxe;function i(o){var u=Array.from(e.apply(this,arguments),hxe),l,a=u.length,s=-1,f;for(let p of o)for(l=0,++s;l{v();x();g();zh();Rf();Xh();Kh()});function vV(e,t){if((n=e.length)>0){for(var r,n,i=0,o=e[0].length,u;i{v();x();g();Xh()});function xV(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 yV=Te(()=>{v();x();g()});function wV(e,t){if((i=e.length)>0){for(var r=0,n=e[t[0]],i,o=n.length;r{v();x();g();Xh()});function DV(e,t){if(!(!((u=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,o,u;n{v();x();g();Xh()});function Kb(e){var t=e.map(dxe);return zs(e).sort(function(r,n){return t[r]-t[n]})}function dxe(e){for(var t=-1,r=0,n=e.length,i,o=-1/0;++to&&(o=i,r=t);return r}var IM=Te(()=>{v();x();g();Kh()});function Jb(e){var t=e.map(FM);return zs(e).sort(function(r,n){return t[r]-t[n]})}function FM(e){for(var t=0,r=-1,n=e.length,i;++r{v();x();g();Kh()});function EV(e){return Jb(e).reverse()}var SV=Te(()=>{v();x();g();Qb()});function AV(e){var t=e.length,r,n,i=e.map(FM),o=Kb(e),u=0,l=0,a=[],s=[];for(r=0;r{v();x();g();IM();Qb()});function MV(e){return zs(e).reverse()}var TV=Te(()=>{v();x();g();Kh()});var Xg={};Ba(Xg,{arc:()=>sW,area:()=>Mb,areaRadial:()=>sM,curveBasis:()=>MW,curveBasisClosed:()=>OW,curveBasisOpen:()=>_W,curveBumpX:()=>Ib,curveBumpY:()=>Fb,curveBundle:()=>LW,curveCardinal:()=>RW,curveCardinalClosed:()=>qW,curveCardinalOpen:()=>zW,curveCatmullRom:()=>HW,curveCatmullRomClosed:()=>WW,curveCatmullRomOpen:()=>YW,curveLinear:()=>zf,curveLinearClosed:()=>KW,curveMonotoneX:()=>nV,curveMonotoneY:()=>iV,curveNatural:()=>uV,curveStep:()=>fV,curveStepAfter:()=>pV,curveStepBefore:()=>cV,line:()=>$h,lineRadial:()=>oM,link:()=>Hg,linkHorizontal:()=>wW,linkRadial:()=>DW,linkVertical:()=>bW,pie:()=>dW,pointRadial:()=>Sp,radialArea:()=>sM,radialLine:()=>oM,stack:()=>hV,stackOffsetDiverging:()=>xV,stackOffsetExpand:()=>vV,stackOffsetNone:()=>qs,stackOffsetSilhouette:()=>wV,stackOffsetWiggle:()=>DV,stackOrderAppearance:()=>Kb,stackOrderAscending:()=>Jb,stackOrderDescending:()=>EV,stackOrderInsideOut:()=>AV,stackOrderNone:()=>zs,stackOrderReverse:()=>MV,symbol:()=>CM,symbolAsterisk:()=>_b,symbolCircle:()=>Gh,symbolCross:()=>kb,symbolDiamond:()=>Bb,symbolDiamond2:()=>Lb,symbolPlus:()=>Pb,symbolSquare:()=>Rb,symbolSquare2:()=>qb,symbolStar:()=>zb,symbolTimes:()=>$g,symbolTriangle:()=>Ub,symbolTriangle2:()=>Hb,symbolWye:()=>$b,symbolX:()=>$g,symbols:()=>AM,symbolsFill:()=>AM,symbolsStroke:()=>AW});var Kg=Te(()=>{v();x();g();uW();nM();Cb();vW();xW();aM();uM();NW();CW();cM();pM();mM();hM();dM();vM();gM();xM();yM();bM();DM();EM();SM();IW();kW();Gg();fM();PW();MM();TM();Yg();VW();ZW();Yb();JW();Ug();oV();lV();mV();dV();gV();yV();Xh();bV();NV();IM();Qb();SV();CV();Kh();TV()});function OV(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ap(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 Jg=Te(()=>{v();x();g()});function Iu(e){return e=Ap(Math.abs(e)),e?e[1]:NaN}var Qg=Te(()=>{v();x();g();Jg()});function IV(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 FV=Te(()=>{v();x();g()});function _V(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var kV=Te(()=>{v();x();g()});function Us(e){if(!(t=vxe.exec(e)))throw new Error("invalid format: "+e);var t;return new jg({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 jg(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 vxe,_M=Te(()=>{v();x();g();vxe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;Us.prototype=jg.prototype;jg.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 BV(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 LV=Te(()=>{v();x();g()});function PV(e,t){var r=Ap(e,t);if(!r)return e+"";var n=r[0],i=r[1],o=i-(kM=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")+Ap(e,Math.max(0,t+o-1))[0]}var kM,BM=Te(()=>{v();x();g();Jg()});function LM(e,t){var r=Ap(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 RV=Te(()=>{v();x();g();Jg()});var PM,qV=Te(()=>{v();x();g();Jg();BM();RV();PM={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:OV,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)=>LM(e*100,t),r:LM,s:PV,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)}});function RM(e){return e}var zV=Te(()=>{v();x();g()});function jb(e){var t=e.grouping===void 0||e.thousands===void 0?RM:IV(UV.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?RM:_V(UV.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=Us(p);var h=p.fill,y=p.align,N=p.sign,w=p.symbol,D=p.zero,b=p.width,O=p.comma,M=p.precision,I=p.trim,F=p.type;F==="n"?(O=!0,F="g"):PM[F]||(M===void 0&&(M=12),I=!0,F="g"),(D||h==="0"&&y==="=")&&(D=!0,h="0",y="=");var C=w==="$"?r:w==="#"&&/[boxX]/.test(F)?"0"+F.toLowerCase():"",P=w==="$"?n:/[%p]/.test(F)?u:"",R=PM[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 z(H){var V=C,W=P,ee,ie,X;if(F==="c")W=R(H)+W,H="";else{H=+H;var Y=H<0||1/H<0;if(H=isNaN(H)?a:R(Math.abs(H),M),I&&(H=BV(H)),Y&&+H==0&&N!=="+"&&(Y=!1),V=(Y?N==="("?N:l:N==="-"||N==="("?"":N)+V,W=(F==="s"?HV[8+kM/3]:"")+W+(Y&&N==="("?")":""),q){for(ee=-1,ie=H.length;++eeX||X>57){W=(X===46?i+H.slice(ee+1):H.slice(ee))+W,H=H.slice(0,ee);break}}}O&&!D&&(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 z.toString=function(){return p+""},z}function f(p,h){var y=s((p=Us(p),p.type="f",p)),N=Math.max(-8,Math.min(8,Math.floor(Iu(h)/3)))*3,w=Math.pow(10,-N),D=HV[8+N/3];return function(b){return y(w*b)+D}}return{format:s,formatPrefix:f}}var UV,HV,qM=Te(()=>{v();x();g();Qg();FV();kV();_M();LV();qV();BM();zV();UV=Array.prototype.map,HV=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"]});function t2(e){return e2=jb(e),Cp=e2.format,e0=e2.formatPrefix,e2}var e2,Cp,e0,$V=Te(()=>{v();x();g();qM();t2({thousands:",",grouping:[3],currency:["$",""]})});function r2(e){return Math.max(0,-Iu(Math.abs(e)))}var WV=Te(()=>{v();x();g();Qg()});function n2(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Iu(t)/3)))*3-Iu(Math.abs(e)))}var VV=Te(()=>{v();x();g();Qg()});function i2(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Iu(t)-Iu(e))+1}var GV=Te(()=>{v();x();g();Qg()});var YV={};Ba(YV,{FormatSpecifier:()=>jg,format:()=>Cp,formatDefaultLocale:()=>t2,formatLocale:()=>jb,formatPrefix:()=>e0,formatSpecifier:()=>Us,precisionFixed:()=>r2,precisionPrefix:()=>n2,precisionRound:()=>i2});var o2=Te(()=>{v();x();g();$V();qM();_M();WV();VV();GV()});function Io(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}var t0=Te(()=>{v();x();g()});function zM(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}var ZV=Te(()=>{v();x();g()});function Mp(e){let t,r,n;e.length!==2?(t=Io,r=(l,a)=>Io(e(l),a),n=(l,a)=>e(l)-a):(t=e===Io||e===zM?e:gxe,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 gxe(){return 0}var UM=Te(()=>{v();x();g();t0();ZV()});function r0(e){return e===null?NaN:+e}function*XV(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 HM=Te(()=>{v();x();g()});var KV,JV,xxe,yxe,Hs,QV=Te(()=>{v();x();g();t0();UM();HM();KV=Mp(Io),JV=KV.right,xxe=KV.left,yxe=Mp(r0).center,Hs=JV});function jV({_intern:e,_key:t},r){let n=t(r);return e.has(n)?e.get(n):r}function wxe({_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 Dxe(e){return e!==null&&typeof e=="object"?e.valueOf():e}var Jh,eG=Te(()=>{v();x();g();Jh=class extends Map{constructor(t,r=Dxe){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(jV(this,t))}has(t){return super.has(jV(this,t))}set(t,r){return super.set(wxe(this,t),r)}delete(t){return super.delete(bxe(this,t))}}});function tG(e=Io){if(e===Io)return $M;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 $M(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}var rG=Te(()=>{v();x();g();t0()});function a2(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>=Nxe?10:o>=Exe?5:o>=Sxe?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{v();x();g();Nxe=Math.sqrt(50),Exe=Math.sqrt(10),Sxe=Math.sqrt(2)});function s2(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 iG=Te(()=>{v();x();g()});function u2(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 oG=Te(()=>{v();x();g()});function l2(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?$M:tG(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)),N=Math.min(n,Math.floor(t+(a-s)*p/a+h));l2(e,t,y,N,i)}let o=e[t],u=r,l=n;for(i0(e,r,t),i(e[n],o)>0&&i0(e,r,n);u0;)--l}i(e[r],o)===0?i0(e,r,l):(++l,i0(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function i0(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}var aG=Te(()=>{v();x();g();rG()});function f2(e,t,r){if(e=Float64Array.from(XV(e,r)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return u2(e);if(t>=1)return s2(e);var n,i=(n-1)*t,o=Math.floor(i),u=s2(l2(e,o).subarray(0,o+1)),l=u2(e.subarray(o+1));return u+(l-u)*(i-o)}}function WM(e,t,r=r0){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 sG=Te(()=>{v();x();g();iG();oG();aG();HM()});function c2(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{v();x();g()});var es=Te(()=>{v();x();g();QV();t0();UM();sG();uG();nG();eG()});function Tn(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ts(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 xo=Te(()=>{v();x();g()});function jh(){var e=new Jh,t=[],r=[],n=p2;function i(o){let u=e.get(o);if(u===void 0){if(n!==p2)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 Jh;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 jh(t,r).unknown(n)},Tn.apply(i,arguments),i}var p2,VM=Te(()=>{v();x();g();es();xo();p2=Symbol("implicit")});function o0(){var e=jh().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{v();x();g();es();xo();VM()});function Ml(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Uf(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}var m2=Te(()=>{v();x();g()});function _u(){}function mG(){return this.rgb().formatHex()}function _xe(){return this.rgb().formatHex8()}function kxe(){return wG(this).formatHsl()}function hG(){return this.rgb().formatRgb()}function rs(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Axe.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?dG(t):r===3?new fi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?h2(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?h2(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=Cxe.exec(e))?new fi(t[1],t[2],t[3],1):(t=Mxe.exec(e))?new fi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Txe.exec(e))?h2(t[1],t[2],t[3],t[4]):(t=Oxe.exec(e))?h2(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Ixe.exec(e))?xG(t[1],t[2]/100,t[3]/100,1):(t=Fxe.exec(e))?xG(t[1],t[2]/100,t[3]/100,t[4]):pG.hasOwnProperty(e)?dG(pG[e]):e==="transparent"?new fi(NaN,NaN,NaN,0):null}function dG(e){return new fi(e>>16&255,e>>8&255,e&255,1)}function h2(e,t,r,n){return n<=0&&(e=t=r=NaN),new fi(e,t,r,n)}function s0(e){return e instanceof _u||(e=rs(e)),e?(e=e.rgb(),new fi(e.r,e.g,e.b,e.opacity)):new fi}function _p(e,t,r,n){return arguments.length===1?s0(e):new fi(e,t,r,n??1)}function fi(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function vG(){return`#${Op(this.r)}${Op(this.g)}${Op(this.b)}`}function Bxe(){return`#${Op(this.r)}${Op(this.g)}${Op(this.b)}${Op((isNaN(this.opacity)?1:this.opacity)*255)}`}function gG(){let e=v2(this.opacity);return`${e===1?"rgb(":"rgba("}${Ip(this.r)}, ${Ip(this.g)}, ${Ip(this.b)}${e===1?")":`, ${e})`}`}function v2(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ip(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Op(e){return e=Ip(e),(e<16?"0":"")+e.toString(16)}function xG(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new $s(e,t,r,n)}function wG(e){if(e instanceof $s)return new $s(e.h,e.s,e.l,e.opacity);if(e instanceof _u||(e=rs(e)),!e)return new $s;if(e instanceof $s)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 $s(u,l,a,e.opacity)}function td(e,t,r,n){return arguments.length===1?wG(e):new $s(e,t,r,n??1)}function $s(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function yG(e){return e=(e||0)%360,e<0?e+360:e}function d2(e){return Math.max(0,Math.min(1,e||0))}function GM(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 Hf,Fp,ed,a0,Fu,Axe,Cxe,Mxe,Txe,Oxe,Ixe,Fxe,pG,g2=Te(()=>{v();x();g();m2();Hf=.7,Fp=1/Hf,ed="\\s*([+-]?\\d+)\\s*",a0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Fu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Axe=/^#([0-9a-f]{3,8})$/,Cxe=new RegExp(`^rgb\\(${ed},${ed},${ed}\\)$`),Mxe=new RegExp(`^rgb\\(${Fu},${Fu},${Fu}\\)$`),Txe=new RegExp(`^rgba\\(${ed},${ed},${ed},${a0}\\)$`),Oxe=new RegExp(`^rgba\\(${Fu},${Fu},${Fu},${a0}\\)$`),Ixe=new RegExp(`^hsl\\(${a0},${Fu},${Fu}\\)$`),Fxe=new RegExp(`^hsla\\(${a0},${Fu},${Fu},${a0}\\)$`),pG={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(_u,rs,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:mG,formatHex:mG,formatHex8:_xe,formatHsl:kxe,formatRgb:hG,toString:hG});Ml(fi,_p,Uf(_u,{brighter(e){return e=e==null?Fp:Math.pow(Fp,e),new fi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Hf:Math.pow(Hf,e),new fi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new fi(Ip(this.r),Ip(this.g),Ip(this.b),v2(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:vG,formatHex:vG,formatHex8:Bxe,formatRgb:gG,toString:gG}));Ml($s,td,Uf(_u,{brighter(e){return e=e==null?Fp:Math.pow(Fp,e),new $s(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Hf:Math.pow(Hf,e),new $s(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 fi(GM(e>=240?e-240:e+120,i,n),GM(e,i,n),GM(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new $s(yG(this.h),d2(this.s),d2(this.l),v2(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=v2(this.opacity);return`${e===1?"hsl(":"hsla("}${yG(this.h)}, ${d2(this.s)*100}%, ${d2(this.l)*100}%${e===1?")":`, ${e})`}`}}))});var x2,y2,YM=Te(()=>{v();x();g();x2=Math.PI/180,y2=180/Math.PI});function AG(e){if(e instanceof Ws)return new Ws(e.l,e.a,e.b,e.opacity);if(e instanceof ku)return OG(e);e instanceof fi||(e=s0(e));var t=JM(e.r),r=JM(e.g),n=JM(e.b),i=ZM((.2225045*t+.7168786*r+.0606169*n)/DG),o,u;return t===r&&r===n?o=u=i:(o=ZM((.4360747*t+.3850649*r+.1430804*n)/bG),u=ZM((.0139322*t+.0971045*r+.7141733*n)/NG)),new Ws(116*i-16,500*(o-i),200*(i-u),e.opacity)}function CG(e,t){return new Ws(e,0,0,t??1)}function kp(e,t,r,n){return arguments.length===1?AG(e):new Ws(e,t,r,n??1)}function Ws(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}function ZM(e){return e>Lxe?Math.pow(e,1/3):e/SG+EG}function XM(e){return e>rd?e*e*e:SG*(e-EG)}function KM(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function JM(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function MG(e){if(e instanceof ku)return new ku(e.h,e.c,e.l,e.opacity);if(e instanceof Ws||(e=AG(e)),e.a===0&&e.b===0)return new ku(NaN,0{v();x();g();m2();g2();YM();w2=18,bG=.96422,DG=1,NG=.82521,EG=4/29,rd=6/29,SG=3*rd*rd,Lxe=rd*rd*rd;Ml(Ws,kp,Uf(_u,{brighter(e){return new Ws(this.l+w2*(e??1),this.a,this.b,this.opacity)},darker(e){return new Ws(this.l-w2*(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=bG*XM(t),e=DG*XM(e),r=NG*XM(r),new fi(KM(3.1338561*t-1.6168667*e-.4906146*r),KM(-.9787684*t+1.9161415*e+.033454*r),KM(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}}));Ml(ku,nd,Uf(_u,{brighter(e){return new ku(this.h,this.c,this.l+w2*(e??1),this.opacity)},darker(e){return new ku(this.h,this.c,this.l-w2*(e??1),this.opacity)},rgb(){return OG(this).rgb()}}))});function Pxe(e){if(e instanceof Bp)return new Bp(e.h,e.s,e.l,e.opacity);e instanceof fi||(e=s0(e));var t=e.r/255,r=e.g/255,n=e.b/255,i=(kG*n+FG*t-_G*r)/(kG+FG-_G),o=n-i,u=(u0*(r-i)-jM*o)/b2,l=Math.sqrt(u*u+o*o)/(u0*i*(1-i)),a=l?Math.atan2(u,o)*y2-120:NaN;return new Bp(a<0?a+360:a,l,i,e.opacity)}function Lp(e,t,r,n){return arguments.length===1?Pxe(e):new Bp(e,t,r,n??1)}function Bp(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}var BG,QM,jM,b2,u0,FG,_G,kG,LG=Te(()=>{v();x();g();m2();g2();YM();BG=-.14861,QM=1.78277,jM=-.29227,b2=-.90649,u0=1.97294,FG=u0*b2,_G=u0*QM,kG=QM*jM-b2*BG;Ml(Bp,Lp,Uf(_u,{brighter(e){return e=e==null?Fp:Math.pow(Fp,e),new Bp(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Hf:Math.pow(Hf,e),new Bp(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*x2,t=+this.l,r=isNaN(this.s)?0:this.s*t*(1-t),n=Math.cos(e),i=Math.sin(e);return new fi(255*(t+r*(BG*n+QM*i)),255*(t+r*(jM*n+b2*i)),255*(t+r*(u0*n)),this.opacity)}}))});var D2={};Ba(D2,{color:()=>rs,cubehelix:()=>Lp,gray:()=>CG,hcl:()=>nd,hsl:()=>td,lab:()=>kp,lch:()=>TG,rgb:()=>_p});var Vs=Te(()=>{v();x();g();g2();IG();LG()});function eT(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 N2(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{v();x();g()});function S2(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 eT((r-n/t)*t,i,o,u,l)}}var tT=Te(()=>{v();x();g();E2()});var id,rT=Te(()=>{v();x();g();id=e=>()=>e});function PG(e,t){return function(r){return e+r*t}}function Rxe(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 $f(e,t){var r=t-e;return r?PG(e,r>180||r<-180?r-360*Math.round(r/360):r):id(isNaN(e)?t:e)}function RG(e){return(e=+e)==1?On:function(t,r){return r-t?Rxe(t,r,e):id(isNaN(t)?r:t)}}function On(e,t){var r=t-e;return r?PG(e,r):id(isNaN(e)?t:e)}var Pp=Te(()=>{v();x();g();rT()});function qG(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{v();x();g();Vs();E2();tT();Pp();Wf=function e(t){var r=RG(t);function n(i,o){var u=r((i=_p(i)).r,(o=_p(o)).r),l=r(i.g,o.g),a=r(i.b,o.b),s=On(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);zG=qG(N2),UG=qG(S2)});function od(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{v();x();g()});function HG(e,t){return(A2(t)?od:iT)(e,t)}function iT(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{v();x();g();l0();C2()});function M2(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}var aT=Te(()=>{v();x();g()});function ki(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var f0=Te(()=>{v();x();g()});function T2(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]=Vo(e[i],t[i]):n[i]=t[i];return function(o){for(i in r)n[i]=r[i](o);return n}}var sT=Te(()=>{v();x();g();l0()});function qxe(e){return function(){return e}}function zxe(e){return function(t){return e(t)+""}}function ad(e,t){var r=lT.lastIndex=uT.lastIndex=0,n,i,o,u=-1,l=[],a=[];for(e=e+"",t=t+"";(n=lT.exec(e))&&(i=uT.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:ki(n,i)})),r=uT.lastIndex;return r{v();x();g();f0();lT=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,uT=new RegExp(lT.source,"g")});function Vo(e,t){var r=typeof t,n;return t==null||r==="boolean"?id(t):(r==="number"?ki:r==="string"?(n=rs(t))?(t=n,Wf):ad:t instanceof rs?Wf:t instanceof Date?M2:A2(t)?od:Array.isArray(t)?iT:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?T2:ki)(e,t)}var l0=Te(()=>{v();x();g();Vs();nT();oT();aT();f0();sT();fT();rT();C2()});function $G(e){var t=e.length;return function(r){return e[Math.max(0,Math.min(t-1,Math.floor(r*t)))]}}var WG=Te(()=>{v();x();g()});function VG(e,t){var r=$f(+e,+t);return function(n){var i=r(n);return i-360*Math.floor(i/360)}}var GG=Te(()=>{v();x();g();Pp()});function Vf(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var YG=Te(()=>{v();x();g()});function cT(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{v();x();g();ZG=180/Math.PI,O2={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}});function KG(e){let t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?O2:cT(t.a,t.b,t.c,t.d,t.e,t.f)}function JG(e){return e==null?O2:(I2||(I2=document.createElementNS("http://www.w3.org/2000/svg","g")),I2.setAttribute("transform",e),(e=I2.transform.baseVal.consolidate())?(e=e.matrix,cT(e.a,e.b,e.c,e.d,e.e,e.f)):O2)}var I2,QG=Te(()=>{v();x();g();XG()});function jG(e,t,r,n){function i(s){return s.length?s.pop()+" ":""}function o(s,f,p,h,y,N){if(s!==p||f!==h){var w=y.push("translate(",null,t,null,r);N.push({i:w-4,x:ki(s,p)},{i:w-2,x:ki(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:ki(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:ki(s,f)}):f&&p.push(i(p)+"skewX("+f+n)}function a(s,f,p,h,y,N){if(s!==p||f!==h){var w=y.push(i(y)+"scale(",null,",",null,")");N.push({i:w-4,x:ki(s,p)},{i:w-2,x:ki(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 N=-1,w=h.length,D;++N{v();x();g();f0();QG();F2=jG(KG,"px, ","px)","deg)"),_2=jG(JG,", ",")",")")});function tY(e){return((e=Math.exp(e))+1/e)/2}function Hxe(e){return((e=Math.exp(e))-1/e)/2}function $xe(e){return((e=Math.exp(2*e))-1)/(e+1)}var Uxe,k2,rY=Te(()=>{v();x();g();Uxe=1e-12;k2=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,N=p-a,w=y*y+N*N,D,b;if(w{v();x();g();Vs();Pp();iY=nY($f),oY=nY(On)});function pT(e,t){var r=On((e=kp(e)).l,(t=kp(t)).l),n=On(e.a,t.a),i=On(e.b,t.b),o=On(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 sY=Te(()=>{v();x();g();Vs();Pp()});function uY(e){return function(t,r){var n=e((t=nd(t)).h,(r=nd(r)).h),i=On(t.c,r.c),o=On(t.l,r.l),u=On(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 lY,fY,cY=Te(()=>{v();x();g();Vs();Pp();lY=uY($f),fY=uY(On)});function pY(e){return function t(r){r=+r;function n(i,o){var u=e((i=Lp(i)).h,(o=Lp(o)).h),l=On(i.s,o.s),a=On(i.l,o.l),s=On(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 mY,hY,dY=Te(()=>{v();x();g();Vs();Pp();mY=pY($f),hY=pY(On)});function c0(e,t){t===void 0&&(t=e,e=Vo);for(var r=0,n=t.length-1,i=t[0],o=new Array(n<0?0:n);r{v();x();g();l0()});function gY(e,t){for(var r=new Array(t),n=0;n{v();x();g()});var yY={};Ba(yY,{interpolate:()=>Vo,interpolateArray:()=>HG,interpolateBasis:()=>N2,interpolateBasisClosed:()=>S2,interpolateCubehelix:()=>mY,interpolateCubehelixLong:()=>hY,interpolateDate:()=>M2,interpolateDiscrete:()=>$G,interpolateHcl:()=>lY,interpolateHclLong:()=>fY,interpolateHsl:()=>iY,interpolateHslLong:()=>oY,interpolateHue:()=>VG,interpolateLab:()=>pT,interpolateNumber:()=>ki,interpolateNumberArray:()=>od,interpolateObject:()=>T2,interpolateRgb:()=>Wf,interpolateRgbBasis:()=>zG,interpolateRgbBasisClosed:()=>UG,interpolateRound:()=>Vf,interpolateString:()=>ad,interpolateTransformCss:()=>F2,interpolateTransformSvg:()=>_2,interpolateZoom:()=>k2,piecewise:()=>c0,quantize:()=>gY});var Tl=Te(()=>{v();x();g();l0();oT();E2();tT();aT();WG();GG();f0();C2();sT();YG();fT();eY();rY();nT();aY();sY();cY();dY();vY();xY()});function mT(e){return function(){return e}}var wY=Te(()=>{v();x();g()});function Gf(e){return+e}var B2=Te(()=>{v();x();g()});function Ni(e){return e}function hT(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:mT(isNaN(t)?NaN:.5)}function Wxe(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function Vxe(e,t,r){var n=e[0],i=e[1],o=t[0],u=t[1];return i2?Gxe:Vxe,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),ki)))(h)))},p.domain=function(h){return arguments.length?(e=Array.from(h,Gf),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=Vf,f()},p.clamp=function(h){return arguments.length?(u=h?!0:Ni,f()):u!==Ni},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 qp(){return Rp()(Ni,Ni)}var bY,Lu=Te(()=>{v();x();g();es();Tl();wY();B2();bY=[0,1]});function p0(e,t,r,n){var i=Qh(e,t,r),o;switch(n=Us(n??",f"),n.type){case"s":{var u=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=n2(i,u))&&(n.precision=o),e0(n,u)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=i2(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=r2(i))&&(n.precision=o-(n.type==="%")*2);break}}return Cp(n)}var dT=Te(()=>{v();x();g();es();o2()});function Fo(e){var t=e.domain;return e.ticks=function(r){var n=t();return Tp(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return p0(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=n0(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 L2(){var e=qp();return e.copy=function(){return Bu(e,L2())},Tn.apply(e,arguments),Fo(e)}var Ol=Te(()=>{v();x();g();es();Lu();xo();dT()});function P2(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,Gf),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return P2(e).unknown(t)},e=arguments.length?Array.from(e,Gf):[0,1],Fo(r)}var DY=Te(()=>{v();x();g();Ol();B2()});function m0(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],o=e[n],u;return o{v();x();g()});function NY(e){return Math.log(e)}function EY(e){return Math.exp(e)}function Yxe(e){return-Math.log(-e)}function Zxe(e){return-Math.exp(-e)}function Xxe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Kxe(e){return e===10?Xxe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Jxe(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 SY(e){return(t,r)=>-e(-t,r)}function h0(e){let t=e(NY,EY),r=t.domain,n=10,i,o;function u(){return i=Jxe(n),o=Kxe(n),r()[0]<0?(i=SY(i),o=SY(o),e(Yxe,Zxe)):e(NY,EY),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(N=1;Nf)break;b.push(w)}}else for(;h<=y;++h)for(N=n-1;N>=1;--N)if(w=h>0?N/o(-h):N*o(h),!(wf)break;b.push(w)}b.length*2{if(l==null&&(l=10),a==null&&(a=n===10?"s":","),typeof a!="function"&&(!(n%1)&&(a=Us(a)).precision==null&&(a.trim=!0),a=Cp(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(m0(r(),{floor:l=>o(Math.floor(i(l))),ceil:l=>o(Math.ceil(i(l)))})),t}function R2(){let e=h0(Rp()).domain([1,10]);return e.copy=()=>Bu(e,R2()).base(e.base()),Tn.apply(e,arguments),e}var q2=Te(()=>{v();x();g();es();o2();vT();Lu();xo()});function AY(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function CY(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function d0(e){var t=1,r=e(AY(t),CY(t));return r.constant=function(n){return arguments.length?e(AY(t=+n),CY(t)):t},Fo(r)}function z2(){var e=d0(Rp());return e.copy=function(){return Bu(e,z2()).constant(e.constant())},Tn.apply(e,arguments)}var U2=Te(()=>{v();x();g();Ol();Lu();xo()});function MY(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Qxe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function jxe(e){return e<0?-e*e:e*e}function v0(e){var t=e(Ni,Ni),r=1;function n(){return r===1?e(Ni,Ni):r===.5?e(Qxe,jxe):e(MY(r),MY(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Fo(t)}function g0(){var e=v0(Rp());return e.copy=function(){return Bu(e,g0()).exponent(e.exponent())},Tn.apply(e,arguments),e}function TY(){return g0.apply(null,arguments).exponent(.5)}var H2=Te(()=>{v();x();g();Ol();Lu();xo()});function OY(e){return Math.sign(e)*e*e}function eye(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function $2(){var e=qp(),t=[0,1],r=!1,n;function i(o){var u=eye(e(o));return isNaN(u)?n:r?Math.round(u):u}return i.invert=function(o){return e.invert(OY(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,Gf)).map(OY)),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 $2(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Tn.apply(i,arguments),Fo(i)}var IY=Te(()=>{v();x();g();Lu();xo();Ol();B2()});function W2(){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{v();x();g();es();xo()});function V2(){var e=0,t=1,r=1,n=[.5],i=[0,1],o;function u(a){return a!=null&&a<=a?i[Hs(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 V2().domain([e,t]).range(i).unknown(o)},Tn.apply(Fo(u),arguments)}var _Y=Te(()=>{v();x();g();es();Ol();xo()});function G2(){var e=[.5],t=[0,1],r,n=1;function i(o){return o!=null&&o<=o?t[Hs(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 G2().domain(e).range(t).unknown(r)},Tn.apply(i,arguments)}var kY=Te(()=>{v();x();g();es();xo()});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)=>(gT.setTime(+o),xT.setTime(+u),e(gT),e(xT),Math.floor(r(gT,xT))),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 gT,xT,Il=Te(()=>{v();x();g();gT=new Date,xT=new Date});var x0,lnr,BY=Te(()=>{v();x();g();Il();x0=pn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);x0.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):x0);lnr=x0.range});var ns,LY,yT=Te(()=>{v();x();g();Il();ns=pn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*1e3)},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds()),LY=ns.range});var sd,tye,ud,rye,wT=Te(()=>{v();x();g();Il();sd=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()),tye=sd.range,ud=pn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes()),rye=ud.range});var ld,nye,fd,iye,bT=Te(()=>{v();x();g();Il();ld=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()),nye=ld.range,fd=pn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*36e5)},(e,t)=>(t-e)/36e5,e=>e.getUTCHours()),iye=fd.range});var Fl,oye,Hp,aye,Y2,sye,DT=Te(()=>{v();x();g();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),oye=Fl.range,Hp=pn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1),aye=Hp.range,Y2=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)),sye=Y2.range});function $p(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 Wp(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,cd,RY,qY,Yf,zY,UY,HY,uye,lye,fye,cye,pye,mye,kl,pd,$Y,WY,Zf,VY,GY,YY,hye,dye,vye,gye,xye,yye,NT=Te(()=>{v();x();g();Il();_l=$p(0),cd=$p(1),RY=$p(2),qY=$p(3),Yf=$p(4),zY=$p(5),UY=$p(6),HY=_l.range,uye=cd.range,lye=RY.range,fye=qY.range,cye=Yf.range,pye=zY.range,mye=UY.range;kl=Wp(0),pd=Wp(1),$Y=Wp(2),WY=Wp(3),Zf=Wp(4),VY=Wp(5),GY=Wp(6),YY=kl.range,hye=pd.range,dye=$Y.range,vye=WY.range,gye=Zf.range,xye=VY.range,yye=GY.range});var md,wye,hd,bye,ET=Te(()=>{v();x();g();Il();md=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()),wye=md.range,hd=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=hd.range});var ya,Dye,wa,Nye,ST=Te(()=>{v();x();g();Il();ya=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());ya.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)});Dye=ya.range,wa=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());wa.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)});Nye=wa.range});function XY(e,t,r,n,i,o){let u=[[ns,1,1e3],[ns,5,5*1e3],[ns,15,15*1e3],[ns,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=fD).right(u,h);if(y===u.length)return e.every(Qh(s/31536e6,f/31536e6,p));if(y===0)return x0.every(Math.max(Qh(s,f,p),1));let[N,w]=u[h/u[y-1][2]{v();x();g();es();BY();yT();wT();bT();DT();NT();ET();ST();[AT,CT]=XY(wa,hd,kl,Y2,fd,ud),[MT,TT]=XY(ya,md,_l,Fl,ld,sd)});var Z2=Te(()=>{v();x();g();yT();wT();bT();DT();NT();ET();ST();KY()});function OT(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 IT(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 w0(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function FT(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=b0(i),f=D0(i),p=b0(o),h=D0(o),y=b0(u),N=D0(u),w=b0(l),D=D0(l),b=b0(a),O=D0(a),M={a:Y,A:le,b:re,B:he,c:null,d:rZ,e:rZ,f:Yye,g:nwe,G:owe,H:Wye,I:Vye,j:Gye,L:sZ,m:Zye,M:Xye,p:De,q:ye,Q:oZ,s:aZ,S:Kye,u:Jye,U:Qye,V:jye,w:ewe,W:twe,x:null,X:null,y:rwe,Y:iwe,Z:awe,"%":iZ},I={a:ce,A:Ne,b:Pe,B:Ce,c:null,d:nZ,e:nZ,f:fwe,g:wwe,G:Dwe,H:swe,I:uwe,j:lwe,L:lZ,m:cwe,M:pwe,p:Oe,q:He,Q:oZ,s:aZ,S:mwe,u:hwe,U:dwe,V:vwe,w:gwe,W:xwe,x:null,X:null,y:ywe,Y:bwe,Z:Nwe,"%":iZ},F={a:z,A:H,b:V,B:W,c:ee,d:eZ,e:eZ,f:zye,g:jY,G:QY,H:tZ,I:tZ,j:Lye,L:qye,m:Bye,M:Pye,p:q,q:kye,Q:Hye,s:$ye,S:Rye,u:Tye,U:Oye,V:Iye,w:Mye,W:Fye,x:ie,X,y:jY,Y:QY,Z:_ye,"%":Uye};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 Be=[],lt=-1,ct=0,de=Se.length,be,Ue,ve;for(We instanceof Date||(We=new Date(+We));++lt53)return null;"w"in Be||(Be.w=1),"Z"in Be?(ct=IT(w0(Be.y,0,1)),de=ct.getUTCDay(),ct=de>4||de===0?pd.ceil(ct):pd(ct),ct=Hp.offset(ct,(Be.V-1)*7),Be.y=ct.getUTCFullYear(),Be.m=ct.getUTCMonth(),Be.d=ct.getUTCDate()+(Be.w+6)%7):(ct=OT(w0(Be.y,0,1)),de=ct.getDay(),ct=de>4||de===0?cd.ceil(ct):cd(ct),ct=Fl.offset(ct,(Be.V-1)*7),Be.y=ct.getFullYear(),Be.m=ct.getMonth(),Be.d=ct.getDate()+(Be.w+6)%7)}else("W"in Be||"U"in Be)&&("w"in Be||(Be.w="u"in Be?Be.u%7:"W"in Be?1:0),de="Z"in Be?IT(w0(Be.y,0,1)).getUTCDay():OT(w0(Be.y,0,1)).getDay(),Be.m=0,Be.d="W"in Be?(Be.w+6)%7+Be.W*7-(de+5)%7:Be.w+Be.U*7-(de+6)%7);return"Z"in Be?(Be.H+=Be.Z/100|0,Be.M+=Be.Z%100,IT(Be)):OT(Be)}}function R(Se,ze,We,Be){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 JY?ze.charAt(lt++):be],!Ue||(Be=Ue(Se,We,Be))<0)return-1}else if(be!=We.charCodeAt(Be++))return-1}return Be}function q(Se,ze,We){var Be=s.exec(ze.slice(We));return Be?(Se.p=f.get(Be[0].toLowerCase()),We+Be[0].length):-1}function z(Se,ze,We){var Be=y.exec(ze.slice(We));return Be?(Se.w=N.get(Be[0].toLowerCase()),We+Be[0].length):-1}function H(Se,ze,We){var Be=p.exec(ze.slice(We));return Be?(Se.w=h.get(Be[0].toLowerCase()),We+Be[0].length):-1}function V(Se,ze,We){var Be=b.exec(ze.slice(We));return Be?(Se.m=O.get(Be[0].toLowerCase()),We+Be[0].length):-1}function W(Se,ze,We){var Be=w.exec(ze.slice(We));return Be?(Se.m=D.get(Be[0].toLowerCase()),We+Be[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 X(Se,ze,We){return R(Se,n,ze,We)}function Y(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 ye(Se){return 1+~~(Se.getMonth()/3)}function ce(Se){return u[Se.getUTCDay()]}function Ne(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 Mye(e,t,r){var n=Bi.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function Tye(e,t,r){var n=Bi.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function Oye(e,t,r){var n=Bi.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function Iye(e,t,r){var n=Bi.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function Fye(e,t,r){var n=Bi.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function QY(e,t,r){var n=Bi.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function jY(e,t,r){var n=Bi.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function _ye(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 kye(e,t,r){var n=Bi.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Bye(e,t,r){var n=Bi.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function eZ(e,t,r){var n=Bi.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Lye(e,t,r){var n=Bi.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function tZ(e,t,r){var n=Bi.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function Pye(e,t,r){var n=Bi.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Rye(e,t,r){var n=Bi.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function qye(e,t,r){var n=Bi.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function zye(e,t,r){var n=Bi.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Uye(e,t,r){var n=Sye.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function Hye(e,t,r){var n=Bi.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function $ye(e,t,r){var n=Bi.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function rZ(e,t){return Ur(e.getDate(),t,2)}function Wye(e,t){return Ur(e.getHours(),t,2)}function Vye(e,t){return Ur(e.getHours()%12||12,t,2)}function Gye(e,t){return Ur(1+Fl.count(ya(e),e),t,3)}function sZ(e,t){return Ur(e.getMilliseconds(),t,3)}function Yye(e,t){return sZ(e,t)+"000"}function Zye(e,t){return Ur(e.getMonth()+1,t,2)}function Xye(e,t){return Ur(e.getMinutes(),t,2)}function Kye(e,t){return Ur(e.getSeconds(),t,2)}function Jye(e){var t=e.getDay();return t===0?7:t}function Qye(e,t){return Ur(_l.count(ya(e)-1,e),t,2)}function uZ(e){var t=e.getDay();return t>=4||t===0?Yf(e):Yf.ceil(e)}function jye(e,t){return e=uZ(e),Ur(Yf.count(ya(e),e)+(ya(e).getDay()===4),t,2)}function ewe(e){return e.getDay()}function twe(e,t){return Ur(cd.count(ya(e)-1,e),t,2)}function rwe(e,t){return Ur(e.getFullYear()%100,t,2)}function nwe(e,t){return e=uZ(e),Ur(e.getFullYear()%100,t,2)}function iwe(e,t){return Ur(e.getFullYear()%1e4,t,4)}function owe(e,t){var r=e.getDay();return e=r>=4||r===0?Yf(e):Yf.ceil(e),Ur(e.getFullYear()%1e4,t,4)}function awe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ur(t/60|0,"0",2)+Ur(t%60,"0",2)}function nZ(e,t){return Ur(e.getUTCDate(),t,2)}function swe(e,t){return Ur(e.getUTCHours(),t,2)}function uwe(e,t){return Ur(e.getUTCHours()%12||12,t,2)}function lwe(e,t){return Ur(1+Hp.count(wa(e),e),t,3)}function lZ(e,t){return Ur(e.getUTCMilliseconds(),t,3)}function fwe(e,t){return lZ(e,t)+"000"}function cwe(e,t){return Ur(e.getUTCMonth()+1,t,2)}function pwe(e,t){return Ur(e.getUTCMinutes(),t,2)}function mwe(e,t){return Ur(e.getUTCSeconds(),t,2)}function hwe(e){var t=e.getUTCDay();return t===0?7:t}function dwe(e,t){return Ur(kl.count(wa(e)-1,e),t,2)}function fZ(e){var t=e.getUTCDay();return t>=4||t===0?Zf(e):Zf.ceil(e)}function vwe(e,t){return e=fZ(e),Ur(Zf.count(wa(e),e)+(wa(e).getUTCDay()===4),t,2)}function gwe(e){return e.getUTCDay()}function xwe(e,t){return Ur(pd.count(wa(e)-1,e),t,2)}function ywe(e,t){return Ur(e.getUTCFullYear()%100,t,2)}function wwe(e,t){return e=fZ(e),Ur(e.getUTCFullYear()%100,t,2)}function bwe(e,t){return Ur(e.getUTCFullYear()%1e4,t,4)}function Dwe(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Zf(e):Zf.ceil(e),Ur(e.getUTCFullYear()%1e4,t,4)}function Nwe(){return"+0000"}function iZ(){return"%"}function oZ(e){return+e}function aZ(e){return Math.floor(+e/1e3)}var JY,Bi,Sye,Aye,cZ=Te(()=>{v();x();g();Z2();JY={"-":"",_:" ",0:"0"},Bi=/^\s*\d+/,Sye=/^%/,Aye=/[\\^$*+?|[\]().{}]/g});function _T(e){return dd=FT(e),X2=dd.format,pZ=dd.parse,K2=dd.utcFormat,mZ=dd.utcParse,dd}var dd,X2,pZ,K2,mZ,hZ=Te(()=>{v();x();g();cZ();_T({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 kT=Te(()=>{v();x();g();hZ()});function Ewe(e){return new Date(e)}function Swe(e){return e instanceof Date?+e:+new Date(+e)}function J2(e,t,r,n,i,o,u,l,a,s){var f=qp(),p=f.invert,h=f.domain,y=s(".%L"),N=s(":%S"),w=s("%I:%M"),D=s("%I %p"),b=s("%a %d"),O=s("%b %d"),M=s("%B"),I=s("%Y");function F(C){return(a(C){v();x();g();Z2();kT();Lu();xo();vT()});function PT(){return Tn.apply(J2(AT,CT,wa,hd,kl,Hp,fd,ud,ns,K2).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}var dZ=Te(()=>{v();x();g();Z2();kT();LT();xo()});function Q2(){var e=0,t=1,r,n,i,o,u=Ni,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,N;return arguments.length?([y,N]=h,u=p(y,N),s):[u(0),u(1)]}}return s.range=f(Vo),s.rangeRound=f(Vf),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 j2(){var e=Fo(Q2()(Ni));return e.copy=function(){return Bl(e,j2())},ts.apply(e,arguments)}function RT(){var e=h0(Q2()).domain([1,10]);return e.copy=function(){return Bl(e,RT()).base(e.base())},ts.apply(e,arguments)}function qT(){var e=d0(Q2());return e.copy=function(){return Bl(e,qT()).constant(e.constant())},ts.apply(e,arguments)}function eD(){var e=v0(Q2());return e.copy=function(){return Bl(e,eD()).exponent(e.exponent())},ts.apply(e,arguments)}function vZ(){return eD.apply(null,arguments).exponent(.5)}var zT=Te(()=>{v();x();g();Tl();Lu();xo();Ol();q2();U2();H2()});function tD(){var e=[],t=Ni;function r(n){if(n!=null&&!isNaN(n=+n))return t((Hs(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(Io),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)=>f2(e,o/n))},r.copy=function(){return tD(t).domain(e)},ts.apply(r,arguments)}var gZ=Te(()=>{v();x();g();es();Lu();xo()});function rD(){var e=0,t=.5,r=1,n=1,i,o,u,l,a,s=Ni,f,p=!1,h;function y(w){return isNaN(w=+w)?h:(w=.5+((w=+f(w))-o)*(n*w{v();x();g();Tl();Lu();xo();Ol();q2();zT();U2();H2()});var wZ={};Ba(wZ,{scaleBand:()=>o0,scaleDiverging:()=>nD,scaleDivergingLog:()=>UT,scaleDivergingPow:()=>iD,scaleDivergingSqrt:()=>xZ,scaleDivergingSymlog:()=>HT,scaleIdentity:()=>P2,scaleImplicit:()=>p2,scaleLinear:()=>L2,scaleLog:()=>R2,scaleOrdinal:()=>jh,scalePoint:()=>fG,scalePow:()=>g0,scaleQuantile:()=>W2,scaleQuantize:()=>V2,scaleRadial:()=>$2,scaleSequential:()=>j2,scaleSequentialLog:()=>RT,scaleSequentialPow:()=>eD,scaleSequentialQuantile:()=>tD,scaleSequentialSqrt:()=>vZ,scaleSequentialSymlog:()=>qT,scaleSqrt:()=>TY,scaleSymlog:()=>z2,scaleThreshold:()=>G2,scaleTime:()=>BT,scaleUtc:()=>PT,tickFormat:()=>p0});var bZ=Te(()=>{v();x();g();cG();DY();Ol();q2();U2();VM();H2();IY();FY();_Y();kY();LT();dZ();zT();gZ();yZ();dT()});function DZ(e){return e}var NZ=Te(()=>{v();x();g()});function Awe(e){return"translate("+e+",0)"}function Cwe(e){return"translate(0,"+e+")"}function Mwe(e){return t=>+e(t)}function Twe(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),r=>+e(r)+t}function Owe(){return!this.__axis}function sD(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===oD||e===N0?-1:1,f=e===N0||e===aD?"x":"y",p=e===oD||e===$T?Awe:Cwe;function h(y){var N=n??(t.ticks?t.ticks.apply(t,r):t.domain()),w=i??(t.tickFormat?t.tickFormat.apply(t,r):DZ),D=Math.max(o,0)+l,b=t.range(),O=+b[0]+a,M=+b[b.length-1]+a,I=(t.bandwidth?Twe:Mwe)(t.copy(),a),F=y.selection?y.selection():y,C=F.selectAll(".domain").data([null]),P=F.selectAll(".tick").data(N,t).order(),R=P.exit(),q=P.enter().append("g").attr("class","tick"),z=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),z=z.merge(q.append("line").attr("stroke","currentColor").attr(f+"2",s*o)),H=H.merge(q.append("text").attr("fill","currentColor").attr(f,s*D).attr("dy",e===oD?"0em":e===$T?"0.71em":"0.32em")),y!==F&&(C=C.transition(y),P=P.transition(y),z=z.transition(y),H=H.transition(y),R=R.transition(y).attr("opacity",EZ).attr("transform",function(V){return isFinite(V=I(V))?p(V+a):this.getAttribute("transform")}),q.attr("opacity",EZ).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===N0||e===aD?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)}),z.attr(f+"2",s*o),H.attr(f,s*D).text(w),F.filter(Owe).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===aD?"start":e===N0?"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 SZ(e){return sD(oD,e)}function AZ(e){return sD(aD,e)}function CZ(e){return sD($T,e)}function MZ(e){return sD(N0,e)}var oD,aD,$T,N0,EZ,TZ=Te(()=>{v();x();g();NZ();oD=1,aD=2,$T=3,N0=4,EZ=1e-6});var OZ={};Ba(OZ,{axisBottom:()=>CZ,axisLeft:()=>MZ,axisRight:()=>AZ,axisTop:()=>SZ});var IZ=Te(()=>{v();x();g();TZ()});function _Z(){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 _we(e,t){for(var r=0,n=e.length,i;r{v();x();g();Iwe={value:()=>{}};uD.prototype=_Z.prototype={constructor:uD,on:function(e,t){var r=this._,n=Fwe(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{v();x();g();kZ()});var lD,S0,fD=Te(()=>{v();x();g();lD="http://www.w3.org/1999/xhtml",S0={svg:"http://www.w3.org/2000/svg",xhtml:lD,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}});function Ru(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),S0.hasOwnProperty(t)?{space:S0[t],local:e}:e}var cD=Te(()=>{v();x();g();fD()});function kwe(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===lD&&t.documentElement.namespaceURI===lD?t.createElement(e):t.createElementNS(r,e)}}function Bwe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Xf(e){var t=Ru(e);return(t.local?Bwe:kwe)(t)}var A0=Te(()=>{v();x();g();cD();fD()});function Lwe(){}function Kf(e){return e==null?Lwe:function(){return this.querySelector(e)}}var pD=Te(()=>{v();x();g()});function BZ(e){typeof e!="function"&&(e=Kf(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i{v();x();g();is();pD()});function C0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}var VT=Te(()=>{v();x();g()});function Pwe(){return[]}function vd(e){return e==null?Pwe:function(){return this.querySelectorAll(e)}}var GT=Te(()=>{v();x();g()});function Rwe(e){return function(){return C0(e.apply(this,arguments))}}function PZ(e){typeof e=="function"?e=Rwe(e):e=vd(e);for(var t=this._groups,r=t.length,n=[],i=[],o=0;o{v();x();g();is();VT();GT()});function gd(e){return function(){return this.matches(e)}}function mD(e){return function(t){return t.matches(e)}}var M0=Te(()=>{v();x();g()});function zwe(e){return function(){return qwe.call(this.children,e)}}function Uwe(){return this.firstElementChild}function qZ(e){return this.select(e==null?Uwe:zwe(typeof e=="function"?e:mD(e)))}var qwe,zZ=Te(()=>{v();x();g();M0();qwe=Array.prototype.find});function $we(){return Array.from(this.children)}function Wwe(e){return function(){return Hwe.call(this.children,e)}}function UZ(e){return this.selectAll(e==null?$we:Wwe(typeof e=="function"?e:mD(e)))}var Hwe,HZ=Te(()=>{v();x();g();M0();Hwe=Array.prototype.filter});function $Z(e){typeof e!="function"&&(e=gd(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i{v();x();g();is();M0()});function hD(e){return new Array(e.length)}var YT=Te(()=>{v();x();g()});function VZ(){return new bn(this._enter||this._groups.map(hD),this._parents)}function T0(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}var ZT=Te(()=>{v();x();g();YT();is();T0.prototype={constructor:T0,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 GZ(e){return function(){return e}}var YZ=Te(()=>{v();x();g()});function Vwe(e,t,r,n,i,o){for(var u=0,l,a=t.length,s=o.length;u=M&&(M=O+1);!(F=D[M])&&++M{v();x();g();is();ZT();YZ()});function KZ(){return new bn(this._exit||this._groups.map(hD),this._parents)}var JZ=Te(()=>{v();x();g();YT();is()});function QZ(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 jZ=Te(()=>{v();x();g()});function eX(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{v();x();g();is()});function rX(){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 nX=Te(()=>{v();x();g()});function iX(e){e||(e=Xwe);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 oX=Te(()=>{v();x();g();is()});function aX(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}var sX=Te(()=>{v();x();g()});function uX(){return Array.from(this)}var lX=Te(()=>{v();x();g()});function fX(){for(var e=this._groups,t=0,r=e.length;t{v();x();g()});function pX(){let e=0;for(let t of this)++e;return e}var mX=Te(()=>{v();x();g()});function hX(){return!this.node()}var dX=Te(()=>{v();x();g()});function vX(e){for(var t=this._groups,r=0,n=t.length;r{v();x();g()});function Kwe(e){return function(){this.removeAttribute(e)}}function Jwe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Qwe(e,t){return function(){this.setAttribute(e,t)}}function jwe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ebe(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function tbe(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 xX(e,t){var r=Ru(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?Jwe:Kwe:typeof t=="function"?r.local?tbe:ebe:r.local?jwe:Qwe)(r,t))}var yX=Te(()=>{v();x();g();cD()});function xd(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}var dD=Te(()=>{v();x();g()});function rbe(e){return function(){this.style.removeProperty(e)}}function nbe(e,t,r){return function(){this.style.setProperty(e,t,r)}}function ibe(e,t,r){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function wX(e,t,r){return arguments.length>1?this.each((t==null?rbe:typeof t=="function"?ibe:nbe)(e,t,r??"")):Ll(this.node(),e)}function Ll(e,t){return e.style.getPropertyValue(t)||xd(e).getComputedStyle(e,null).getPropertyValue(t)}var XT=Te(()=>{v();x();g();dD()});function obe(e){return function(){delete this[e]}}function abe(e,t){return function(){this[e]=t}}function sbe(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function bX(e,t){return arguments.length>1?this.each((t==null?obe:typeof t=="function"?sbe:abe)(e,t)):this.node()[e]}var DX=Te(()=>{v();x();g()});function NX(e){return e.trim().split(/^|\s+/)}function KT(e){return e.classList||new EX(e)}function EX(e){this._node=e,this._names=NX(e.getAttribute("class")||"")}function SX(e,t){for(var r=KT(e),n=-1,i=t.length;++n{v();x();g();EX.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 cbe(){this.textContent=""}function pbe(e){return function(){this.textContent=e}}function mbe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function TX(e){return arguments.length?this.each(e==null?cbe:(typeof e=="function"?mbe:pbe)(e)):this.node().textContent}var OX=Te(()=>{v();x();g()});function hbe(){this.innerHTML=""}function dbe(e){return function(){this.innerHTML=e}}function vbe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function IX(e){return arguments.length?this.each(e==null?hbe:(typeof e=="function"?vbe:dbe)(e)):this.node().innerHTML}var FX=Te(()=>{v();x();g()});function gbe(){this.nextSibling&&this.parentNode.appendChild(this)}function _X(){return this.each(gbe)}var kX=Te(()=>{v();x();g()});function xbe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function BX(){return this.each(xbe)}var LX=Te(()=>{v();x();g()});function PX(e){var t=typeof e=="function"?e:Xf(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}var RX=Te(()=>{v();x();g();A0()});function ybe(){return null}function qX(e,t){var r=typeof e=="function"?e:Xf(e),n=t==null?ybe:typeof t=="function"?t:Kf(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}var zX=Te(()=>{v();x();g();A0();pD()});function wbe(){var e=this.parentNode;e&&e.removeChild(this)}function UX(){return this.each(wbe)}var HX=Te(()=>{v();x();g()});function bbe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Dbe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function $X(e){return this.select(e?Dbe:bbe)}var WX=Te(()=>{v();x();g()});function VX(e){return arguments.length?this.property("__data__",e):this.node().__data__}var GX=Te(()=>{v();x();g()});function Nbe(e){return function(t){e.call(this,t,this.__data__)}}function Ebe(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 Sbe(e){return function(){var t=this.__on;if(t){for(var r=0,n=-1,i=t.length,o;r{v();x();g()});function XX(e,t,r){var n=xd(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 Cbe(e,t){return function(){return XX(this,e,t)}}function Mbe(e,t){return function(){return XX(this,e,t.apply(this,arguments))}}function KX(e,t){return this.each((typeof t=="function"?Mbe:Cbe)(e,t))}var JX=Te(()=>{v();x();g();dD()});function*QX(){for(var e=this._groups,t=0,r=e.length;t{v();x();g()});function bn(e,t){this._groups=e,this._parents=t}function eK(){return new bn([[document.documentElement]],O0)}function Tbe(){return this}var O0,qu,is=Te(()=>{v();x();g();LZ();RZ();zZ();HZ();WZ();XZ();ZT();JZ();jZ();tX();nX();oX();sX();lX();cX();mX();dX();gX();yX();XT();DX();MX();OX();FX();kX();LX();RX();zX();HX();WX();GX();ZX();JX();jX();O0=[null];bn.prototype=eK.prototype={constructor:bn,select:BZ,selectAll:PZ,selectChild:qZ,selectChildren:UZ,filter:$Z,data:ZZ,enter:VZ,exit:KZ,join:QZ,merge:eX,selection:Tbe,order:rX,sort:iX,call:aX,nodes:uX,node:fX,size:pX,empty:hX,each:vX,attr:xX,style:wX,property:bX,classed:CX,text:TX,html:IX,raise:_X,lower:BX,append:PX,insert:qX,remove:UX,clone:$X,datum:VX,on:YX,dispatch:KX,[Symbol.iterator]:QX};qu=eK});function ba(e){return typeof e=="string"?new bn([[document.querySelector(e)]],[document.documentElement]):new bn([[e]],O0)}var JT=Te(()=>{v();x();g();is()});function tK(e){return ba(Xf(e).call(document.documentElement))}var rK=Te(()=>{v();x();g();A0();JT()});function vD(){return new QT}function QT(){this._="@"+(++Obe).toString(36)}var Obe,nK=Te(()=>{v();x();g();Obe=0;QT.prototype=vD.prototype={constructor:QT,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 gD(e){let t;for(;t=e.sourceEvent;)e=t;return e}var jT=Te(()=>{v();x();g()});function os(e,t){if(e=gD(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 e3=Te(()=>{v();x();g();jT()});function iK(e,t){return e.target&&(e=gD(e),t===void 0&&(t=e.currentTarget),e=e.touches||[e]),Array.from(e,r=>os(r,t))}var oK=Te(()=>{v();x();g();e3();jT()});function aK(e){return typeof e=="string"?new bn([document.querySelectorAll(e)],[document.documentElement]):new bn([C0(e)],O0)}var sK=Te(()=>{v();x();g();VT();is()});var Gs={};Ba(Gs,{create:()=>tK,creator:()=>Xf,local:()=>vD,matcher:()=>gd,namespace:()=>Ru,namespaces:()=>S0,pointer:()=>os,pointers:()=>iK,select:()=>ba,selectAll:()=>aK,selection:()=>qu,selector:()=>Kf,selectorAll:()=>vd,style:()=>Ll,window:()=>xd});var Kn=Te(()=>{v();x();g();rK();A0();nK();M0();cD();fD();e3();oK();JT();sK();is();pD();GT();XT();dD()});function yD(e){e.preventDefault(),e.stopImmediatePropagation()}var xD,uK=Te(()=>{v();x();g();xD={capture:!0,passive:!1}});function t3(e){var t=e.document.documentElement,r=ba(e).on("dragstart.drag",yD,xD);"onselectstart"in t?r.on("selectstart.drag",yD,xD):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function r3(e,t){var r=e.document.documentElement,n=ba(e).on("dragstart.drag",null);t&&(n.on("click.drag",yD,xD),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 lK=Te(()=>{v();x();g();Kn();uK()});var fK=Te(()=>{v();x();g();lK()});function L0(){return Vp||(mK(Ibe),Vp=k0.now()+DD)}function Ibe(){Vp=0}function B0(){this._call=this._time=this._next=null}function ND(e,t,r){var n=new B0;return n.restart(e,t,r),n}function hK(){L0(),++yd;for(var e=wD,t;e;)(t=Vp-e._time)>=0&&e._call.call(void 0,t),e=e._next;--yd}function cK(){Vp=(bD=k0.now())+DD,yd=F0=0;try{hK()}finally{yd=0,_be(),Vp=0}}function Fbe(){var e=k0.now(),t=e-bD;t>pK&&(DD-=t,bD=e)}function _be(){for(var e,t=wD,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:wD=r);_0=e,n3(n)}function n3(e){if(!yd){F0&&(F0=clearTimeout(F0));var t=e-Vp;t>24?(e<1/0&&(F0=setTimeout(cK,e-k0.now()-DD)),I0&&(I0=clearInterval(I0))):(I0||(bD=k0.now(),I0=setInterval(Fbe,pK)),yd=1,mK(cK))}}var yd,F0,I0,pK,wD,_0,bD,Vp,DD,k0,mK,i3=Te(()=>{v();x();g();yd=0,F0=0,I0=0,pK=1e3,bD=0,Vp=0,DD=0,k0=typeof performance=="object"&&performance.now?performance:Date,mK=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};B0.prototype=ND.prototype={constructor:B0,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?L0():+r)+(t==null?0:+t),!this._next&&_0!==this&&(_0?_0._next=this:wD=this,_0=this),this._call=e,this._time=r,n3()},stop:function(){this._call&&(this._call=null,this._time=1/0,n3())}}});function ED(e,t,r){var n=new B0;return t=t==null?0:+t,n.restart(i=>{n.stop(),e(i+t)},t,r),n}var dK=Te(()=>{v();x();g();i3()});var o3=Te(()=>{v();x();g();i3();dK()});function Jf(e,t,r,n,i,o){var u=e.__transition;if(!u)e.__transition={};else if(r in u)return;Lbe(e,r,{name:t,index:n,group:i,on:kbe,tween:Bbe,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:xK})}function R0(e,t){var r=Ei(e,t);if(r.state>xK)throw new Error("too late; already scheduled");return r}function eo(e,t){var r=Ei(e,t);if(r.state>SD)throw new Error("too late; already running");return r}function Ei(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function Lbe(e,t,r){var n=e.__transition,i;n[t]=r,r.timer=ND(o,0,r.time);function o(s){r.state=vK,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!==vK)return a();for(f in n)if(y=n[f],y.name===r.name){if(y.state===SD)return ED(u);y.state===gK?(y.state=P0,y.timer.stop(),y.on.call("interrupt",e,e.__data__,y.index,y.group),delete n[f]):+f{v();x();g();WT();o3();kbe=E0("start","end","cancel","interrupt"),Bbe=[],xK=0,vK=1,AD=2,SD=3,gK=4,CD=5,P0=6});function Gp(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>AD&&n.state{v();x();g();Go()});function yK(e){return this.each(function(){Gp(this,e)})}var wK=Te(()=>{v();x();g();a3()});function Pbe(e,t){var r,n;return function(){var i=eo(this,e),o=i.tween;if(o!==r){n=r=o;for(var u=0,l=n.length;u{v();x();g();Go()});function MD(e,t){var r;return(typeof t=="number"?ki:t instanceof rs?Wf:(r=rs(t))?(t=r,Wf):ad)(e,t)}var s3=Te(()=>{v();x();g();Vs();Tl()});function qbe(e){return function(){this.removeAttribute(e)}}function zbe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ube(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 Hbe(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 $be(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 Wbe(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 DK(e,t){var r=Ru(e),n=r==="transform"?_2:MD;return this.attrTween(e,typeof t=="function"?(r.local?Wbe:$be)(r,n,wd(this,"attr."+e,t)):t==null?(r.local?zbe:qbe)(r):(r.local?Hbe:Ube)(r,n,t))}var NK=Te(()=>{v();x();g();Tl();Kn();q0();s3()});function Vbe(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function Gbe(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function Ybe(e,t){var r,n;function i(){var o=t.apply(this,arguments);return o!==n&&(r=(n=o)&&Gbe(e,o)),r}return i._value=t,i}function Zbe(e,t){var r,n;function i(){var o=t.apply(this,arguments);return o!==n&&(r=(n=o)&&Vbe(e,o)),r}return i._value=t,i}function EK(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=Ru(e);return this.tween(r,(n.local?Ybe:Zbe)(n,t))}var SK=Te(()=>{v();x();g();Kn()});function Xbe(e,t){return function(){R0(this,e).delay=+t.apply(this,arguments)}}function Kbe(e,t){return t=+t,function(){R0(this,e).delay=t}}function AK(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Xbe:Kbe)(t,e)):Ei(this.node(),t).delay}var CK=Te(()=>{v();x();g();Go()});function Jbe(e,t){return function(){eo(this,e).duration=+t.apply(this,arguments)}}function Qbe(e,t){return t=+t,function(){eo(this,e).duration=t}}function MK(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Jbe:Qbe)(t,e)):Ei(this.node(),t).duration}var TK=Te(()=>{v();x();g();Go()});function jbe(e,t){if(typeof t!="function")throw new Error;return function(){eo(this,e).ease=t}}function OK(e){var t=this._id;return arguments.length?this.each(jbe(t,e)):Ei(this.node(),t).ease}var IK=Te(()=>{v();x();g();Go()});function e2e(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;eo(this,e).ease=r}}function FK(e){if(typeof e!="function")throw new Error;return this.each(e2e(this._id,e))}var _K=Te(()=>{v();x();g();Go()});function kK(e){typeof e!="function"&&(e=gd(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i{v();x();g();Kn();Yp()});function LK(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{v();x();g();Yp()});function t2e(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 r2e(e,t,r){var n,i,o=t2e(t)?R0:eo;return function(){var u=o(this,e),l=u.on;l!==n&&(i=(n=l).copy()).on(t,r),u.on=i}}function RK(e,t){var r=this._id;return arguments.length<2?Ei(this.node(),r).on.on(e):this.each(r2e(r,e,t))}var qK=Te(()=>{v();x();g();Go()});function n2e(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function zK(){return this.on("end.remove",n2e(this._id))}var UK=Te(()=>{v();x();g()});function HK(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Kf(e));for(var n=this._groups,i=n.length,o=new Array(i),u=0;u{v();x();g();Kn();Yp();Go()});function WK(e){var t=this._name,r=this._id;typeof e!="function"&&(e=vd(e));for(var n=this._groups,i=n.length,o=[],u=[],l=0;l{v();x();g();Kn();Yp();Go()});function GK(){return new i2e(this._groups,this._parents)}var i2e,YK=Te(()=>{v();x();g();Kn();i2e=qu.prototype.constructor});function o2e(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 ZK(e){return function(){this.style.removeProperty(e)}}function a2e(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 s2e(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 u2e(e,t){var r,n,i,o="style."+t,u="end."+o,l;return function(){var a=eo(this,e),s=a.on,f=a.value[o]==null?l||(l=ZK(t)):void 0;(s!==r||i!==f)&&(n=(r=s).copy()).on(u,i=f),a.on=n}}function XK(e,t,r){var n=(e+="")=="transform"?F2:MD;return t==null?this.styleTween(e,o2e(e,n)).on("end.style."+e,ZK(e)):typeof t=="function"?this.styleTween(e,s2e(e,n,wd(this,"style."+e,t))).each(u2e(this._id,e)):this.styleTween(e,a2e(e,n,t),r).on("end.style."+e,null)}var KK=Te(()=>{v();x();g();Tl();Kn();Go();q0();s3()});function l2e(e,t,r){return function(n){this.style.setProperty(e,t.call(this,n),r)}}function f2e(e,t,r){var n,i;function o(){var u=t.apply(this,arguments);return u!==i&&(n=(i=u)&&l2e(e,u,r)),n}return o._value=t,o}function JK(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,f2e(e,t,r??""))}var QK=Te(()=>{v();x();g()});function c2e(e){return function(){this.textContent=e}}function p2e(e){return function(){var t=e(this);this.textContent=t??""}}function jK(e){return this.tween("text",typeof e=="function"?p2e(wd(this,"text",e)):c2e(e==null?"":e+""))}var eJ=Te(()=>{v();x();g();q0()});function m2e(e){return function(t){this.textContent=e.call(this,t)}}function h2e(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 tJ(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,h2e(e))}var rJ=Te(()=>{v();x();g()});function nJ(){for(var e=this._name,t=this._id,r=TD(),n=this._groups,i=n.length,o=0;o{v();x();g();Yp();Go()});function oJ(){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=eo(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 aJ=Te(()=>{v();x();g();Go()});function _o(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}function sJ(e){return qu().transition(e)}function TD(){return++d2e}var d2e,Pl,Yp=Te(()=>{v();x();g();Kn();NK();SK();CK();TK();IK();_K();BK();PK();qK();UK();$K();VK();YK();KK();QK();eJ();rJ();iJ();q0();aJ();d2e=0;Pl=qu.prototype;_o.prototype=sJ.prototype={constructor:_o,select:HK,selectAll:WK,selectChild:Pl.selectChild,selectChildren:Pl.selectChildren,filter:kK,merge:LK,selection:GK,transition:nJ,call:Pl.call,nodes:Pl.nodes,node:Pl.node,size:Pl.size,empty:Pl.empty,each:Pl.each,on:RK,attr:DK,attrTween:EK,style:XK,styleTween:JK,text:jK,textTween:tJ,remove:zK,tween:bK,delay:AK,duration:MK,ease:OK,easeVarying:FK,end:oJ,[Symbol.iterator]:Pl[Symbol.iterator]}});function OD(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var uJ=Te(()=>{v();x();g()});var lJ=Te(()=>{v();x();g();uJ()});function g2e(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 fJ(e){var t,r;e instanceof _o?(t=e._id,e=e._name):(t=TD(),(r=v2e).time=L0(),e=e==null?null:e+"");for(var n=this._groups,i=n.length,o=0;o{v();x();g();Yp();Go();lJ();o3();v2e={time:null,delay:0,duration:250,ease:OD}});var pJ=Te(()=>{v();x();g();Kn();wK();cJ();qu.prototype.interrupt=yK;qu.prototype.transition=fJ});var mJ=Te(()=>{v();x();g();pJ();a3()});var z0,hJ=Te(()=>{v();x();g();z0=e=>()=>e});function u3(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 dJ=Te(()=>{v();x();g()});function as(e,t,r){this.k=e,this.x=t,this.y=r}function ID(e){for(;!e.__zoom;)if(!(e=e.parentNode))return bd;return e.__zoom}var bd,l3=Te(()=>{v();x();g();as.prototype={constructor:as,scale:function(e){return e===1?this:new as(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new as(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+")"}};bd=new as(1,0,0);ID.prototype=as.prototype});function FD(e){e.stopImmediatePropagation()}function Dd(e){e.preventDefault(),e.stopImmediatePropagation()}var vJ=Te(()=>{v();x();g()});function x2e(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function y2e(){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 gJ(){return this.__zoom||bd}function w2e(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 D2e(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 xJ(){var e=x2e,t=y2e,r=D2e,n=w2e,i=b2e,o=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],l=250,a=k2,s=E0("start","zoom","end"),f,p,h,y=500,N=150,w=0,D=10;function b(ee){ee.property("__zoom",gJ).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",q).on("dblclick.zoom",z).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)")}b.transform=function(ee,ie,X,Y){var le=ee.selection?ee.selection():ee;le.property("__zoom",gJ),ee!==le?F(ee,ie,X,Y):le.interrupt().each(function(){C(this,arguments).event(Y).start().zoom(null,typeof ie=="function"?ie.apply(this,arguments):ie).end()})},b.scaleBy=function(ee,ie,X,Y){b.scaleTo(ee,function(){var le=this.__zoom.k,re=typeof ie=="function"?ie.apply(this,arguments):ie;return le*re},X,Y)},b.scaleTo=function(ee,ie,X,Y){b.transform(ee,function(){var le=t.apply(this,arguments),re=this.__zoom,he=X==null?I(le):typeof X=="function"?X.apply(this,arguments):X,De=re.invert(he),ye=typeof ie=="function"?ie.apply(this,arguments):ie;return r(M(O(re,ye),he,De),le,u)},X,Y)},b.translateBy=function(ee,ie,X,Y){b.transform(ee,function(){return r(this.__zoom.translate(typeof ie=="function"?ie.apply(this,arguments):ie,typeof X=="function"?X.apply(this,arguments):X),t.apply(this,arguments),u)},null,Y)},b.translateTo=function(ee,ie,X,Y,le){b.transform(ee,function(){var re=t.apply(this,arguments),he=this.__zoom,De=Y==null?I(re):typeof Y=="function"?Y.apply(this,arguments):Y;return r(bd.translate(De[0],De[1]).scale(he.k).translate(typeof ie=="function"?-ie.apply(this,arguments):-ie,typeof X=="function"?-X.apply(this,arguments):-X),re,u)},Y,le)};function O(ee,ie){return ie=Math.max(o[0],Math.min(o[1],ie)),ie===ee.k?ee:new as(ie,ee.x,ee.y)}function M(ee,ie,X){var Y=ie[0]-X[0]*ee.k,le=ie[1]-X[1]*ee.k;return Y===ee.x&&le===ee.y?ee:new as(ee.k,Y,le)}function I(ee){return[(+ee[0][0]+ +ee[1][0])/2,(+ee[0][1]+ +ee[1][1])/2]}function F(ee,ie,X,Y){ee.on("start.zoom",function(){C(this,arguments).event(Y).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(Y).end()}).tween("zoom",function(){var le=this,re=arguments,he=C(le,re).event(Y),De=t.apply(le,re),ye=X==null?I(De):typeof X=="function"?X.apply(le,re):X,ce=Math.max(De[1][0]-De[0][0],De[1][1]-De[0][1]),Ne=le.__zoom,Pe=typeof ie=="function"?ie.apply(le,re):ie,Ce=a(Ne.invert(ye).concat(ce/Ne.k),Pe.invert(ye).concat(ce/Pe.k));return function(Oe){if(Oe===1)Oe=Pe;else{var He=Ce(Oe),Se=ce/He[2];Oe=new as(Se,ye[0]-He[0]*Se,ye[1]-He[1]*Se)}he.zoom(null,Oe)}})}function C(ee,ie,X){return!X&&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=ba(this.that).datum();s.call(ee,this.that,new u3(ee,{sourceEvent:this.sourceEvent,target:b,type:ee,transform:this.that.__zoom,dispatch:s}),ie)}};function R(ee,...ie){if(!e.apply(this,arguments))return;var X=C(this,ie).event(ee),Y=this.__zoom,le=Math.max(o[0],Math.min(o[1],Y.k*Math.pow(2,n.apply(this,arguments)))),re=os(ee);if(X.wheel)(X.mouse[0][0]!==re[0]||X.mouse[0][1]!==re[1])&&(X.mouse[1]=Y.invert(X.mouse[0]=re)),clearTimeout(X.wheel);else{if(Y.k===le)return;X.mouse=[re,Y.invert(re)],Gp(this),X.start()}Dd(ee),X.wheel=setTimeout(he,N),X.zoom("mouse",r(M(O(Y,le),X.mouse[0],X.mouse[1]),X.extent,u));function he(){X.wheel=null,X.end()}}function q(ee,...ie){if(h||!e.apply(this,arguments))return;var X=ee.currentTarget,Y=C(this,ie,!0).event(ee),le=ba(ee.view).on("mousemove.zoom",ye,!0).on("mouseup.zoom",ce,!0),re=os(ee,X),he=ee.clientX,De=ee.clientY;t3(ee.view),FD(ee),Y.mouse=[re,this.__zoom.invert(re)],Gp(this),Y.start();function ye(Ne){if(Dd(Ne),!Y.moved){var Pe=Ne.clientX-he,Ce=Ne.clientY-De;Y.moved=Pe*Pe+Ce*Ce>w}Y.event(Ne).zoom("mouse",r(M(Y.that.__zoom,Y.mouse[0]=os(Ne,X),Y.mouse[1]),Y.extent,u))}function ce(Ne){le.on("mousemove.zoom mouseup.zoom",null),r3(Ne.view,Y.moved),Dd(Ne),Y.event(Ne).end()}}function z(ee,...ie){if(e.apply(this,arguments)){var X=this.__zoom,Y=os(ee.changedTouches?ee.changedTouches[0]:ee,this),le=X.invert(Y),re=X.k*(ee.shiftKey?.5:2),he=r(M(O(X,re),Y,le),t.apply(this,ie),u);Dd(ee),l>0?ba(this).transition().duration(l).call(F,he,Y,ee):ba(this).call(b.transform,he,Y,ee)}}function H(ee,...ie){if(e.apply(this,arguments)){var X=ee.touches,Y=X.length,le=C(this,ie,ee.changedTouches.length===Y).event(ee),re,he,De,ye;for(FD(ee),he=0;he{v();x();g();WT();fK();Tl();Kn();mJ();hJ();dJ();l3();vJ()});var wJ={};Ba(wJ,{ZoomTransform:()=>as,zoom:()=>xJ,zoomIdentity:()=>bd,zoomTransform:()=>ID});var bJ=Te(()=>{v();x();g();yJ();l3()});function on(){on.init.call(this)}function _D(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function IJ(e){return e._maxListeners===void 0?on.defaultMaxListeners:e._maxListeners}function SJ(e,t,r,n){var i,o,u,l;if(_D(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=IJ(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 N2e(){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 AJ(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=N2e.bind(n);return i.listener=r,n.wrapFn=i,i}function CJ(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{v();x();g();Nd=typeof Reflect=="object"?Reflect:null,DJ=Nd&&typeof Nd.apply=="function"?Nd.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};OJ=Nd&&typeof Nd.ownKeys=="function"?Nd.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};NJ=Number.isNaN||function(e){return e!=e};TJ=on,on.EventEmitter=on,on.prototype._events=void 0,on.prototype._eventsCount=0,on.prototype._maxListeners=void 0;EJ=10;Object.defineProperty(on,"defaultMaxListeners",{enumerable:!0,get:function(){return EJ},set:function(e){if(typeof e!="number"||e<0||NJ(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");EJ=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||NJ(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 IJ(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")DJ(l,this,t);else{var a=l.length,s=FJ(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 CJ(this,e,!0)},on.prototype.rawListeners=function(e){return CJ(this,e,!1)},on.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):MJ.call(e,t)},on.prototype.listenerCount=MJ,on.prototype.eventNames=function(){return this._eventsCount>0?OJ(this._events):[]};Yo=TJ;Yo.EventEmitter;Yo.defaultMaxListeners;Yo.init;Yo.listenerCount;Yo.EventEmitter;Yo.defaultMaxListeners;Yo.init;Yo.listenerCount});var _J={};Ba(_J,{EventEmitter:()=>E2e,default:()=>Yo,defaultMaxListeners:()=>S2e,init:()=>A2e,listenerCount:()=>C2e,on:()=>M2e,once:()=>T2e});var E2e,S2e,A2e,C2e,M2e,T2e,kJ=Te(()=>{v();x();g();f3();f3();Yo.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)})};Yo.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:E2e,defaultMaxListeners:S2e,init:A2e,listenerCount:C2e,on:M2e,once:T2e}=Yo)});var BJ=dt(c3=>{"use strict";v();x();g();Object.defineProperty(c3,"__esModule",{value:!0});var O2e=(Kg(),An(Xg)),I2e=(Kn(),An(Gs));function F2e(e){let t=e.owner.meta.xScale,r=e.owner.meta.yScale,n=(0,O2e.line)().x(function(i){return i[0]}).y(function(i){return i[1]});return function(i){i.each(function(){let u=(0,I2e.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()})}}c3.default=F2e});var Ed=dt(H0=>{"use strict";v();x();g();Object.defineProperty(H0,"__esModule",{value:!0});H0.registerGraphType=void 0;var _2e=(Vs(),An(D2)),U0={COLORS:["steelblue","red","#05b378","orange","#4040e8","yellow","brown","magenta","cyan"].map(function(e){return(0,_2e.hsl)(e)}),DEFAULT_WIDTH:550,DEFAULT_HEIGHT:350,DEFAULT_ITERATIONS:null,TIP_X_EPS:1,MAX_ITERATIONS:0,graphTypes:{}};U0.MAX_ITERATIONS=U0.DEFAULT_WIDTH*10;function k2e(e,t){if(Object.hasOwn(U0.graphTypes,e))throw new Error(`registerGraphType: graphType ${e} is already registered.`);U0.graphTypes[e]=t}H0.registerGraphType=k2e;H0.default=U0});var zu=dt($0=>{"use strict";v();x();g();var B2e=$0&&$0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($0,"__esModule",{value:!0});var LJ=B2e(Ed()),L2e={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%LJ.default.COLORS.length;return e.color||LJ.default.COLORS[r].hex()},infinity:function(){return 9007199254740991}};$0.default=L2e});var p3=dt((Gvr,PJ)=>{v();x();g();PJ.exports={EOF:0,DELIMITER:1,NUMBER:2,STRING:3,SYMBOL:4}});var h3=dt((Kvr,qJ)=>{v();x();g();var Zp=p3(),P2e={n:` +`,f:"\f",r:"\r",t:" ",v:"\v","'":"'",'"':'"'},R2e={",":!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 RJ(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"}function q2e(e){return e===" "||e==="\r"||e===" "||e===` +`||e==="\v"||e==="\xA0"}function m3(e){return R2e[e]}function z2e(e){return e==="'"||e==='"'}function Qf(){}Qf.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};Qf.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)};Qf.prototype.consume=function(){var e=this.peek();return this.index+=1,e};Qf.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};Qf.prototype.readIdentifier=function(){for(var e="";RJ(this.peek())||Rl(this.peek());)e+=this.consume();return e};Qf.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=P2e[n];o?t+=o:t+=n}r=!1}else{if(n===e)break;n==="\\"?r=!0:t+=n}}return t};qJ.exports=Qf});var Ys=dt((egr,UJ)=>{v();x();g();function zJ(){}zJ.prototype.type="Node";UJ.exports=zJ});var v3=dt((igr,HJ)=>{v();x();g();var U2e=Ys(),H2e={number:!0,string:!0,boolean:!0,undefined:!0,null:!0};function d3(e,t){if(!H2e[t])throw Error("unsupported type '"+t+"'");this.value=e,this.valueType=t}d3.prototype=Object.create(U2e.prototype);d3.prototype.type="ConstantNode";HJ.exports=d3});var x3=dt((ugr,$J)=>{v();x();g();var $2e=Ys();function g3(e,t){this.op=e,this.args=t||[]}g3.prototype=Object.create($2e.prototype);g3.prototype.type="OperatorNode";$J.exports=g3});var w3=dt((pgr,WJ)=>{v();x();g();var W2e=Ys();function y3(e,t){this.op=e,this.argument=t}y3.prototype=Object.create(W2e.prototype);y3.prototype.type="UnaryNode";WJ.exports=y3});var D3=dt((vgr,VJ)=>{v();x();g();var V2e=Ys();function b3(e){this.name=e}b3.prototype=Object.create(V2e.prototype);b3.prototype.type="SymbolNode";VJ.exports=b3});var E3=dt((wgr,GJ)=>{v();x();g();var G2e=Ys();function N3(e,t){this.name=e,this.args=t}N3.prototype=Object.create(G2e.prototype);N3.prototype.type="FunctionNode";GJ.exports=N3});var A3=dt((Egr,YJ)=>{v();x();g();var Y2e=Ys();function S3(e){this.nodes=e}S3.prototype=Object.create(Y2e.prototype);S3.prototype.type="ArrayNode";YJ.exports=S3});var M3=dt((Mgr,ZJ)=>{v();x();g();var Z2e=Ys();function C3(e,t,r){this.condition=e,this.trueExpr=t,this.falseExpr=r}C3.prototype=Object.create(Z2e.prototype);C3.prototype.type="ConditionalNode";ZJ.exports=C3});var O3=dt((Fgr,XJ)=>{v();x();g();var X2e=Ys();function T3(e,t){this.name=e,this.expr=t}T3.prototype=Object.create(X2e.prototype);T3.prototype.type="AssignmentNode";XJ.exports=T3});var F3=dt((Lgr,KJ)=>{v();x();g();var K2e=Ys();function I3(e){this.blocks=e}I3.prototype=Object.create(K2e.prototype);I3.prototype.type="BlockNode";KJ.exports=I3});var jJ=dt((zgr,QJ)=>{v();x();g();var Xp=p3(),J2e=h3(),_3=v3(),Da=x3(),Q2e=w3(),JJ=D3(),j2e=E3(),eDe=A3(),tDe=M3(),rDe=O3(),nDe=F3();function Vr(){this.lexer=new J2e,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 Da(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 Da(t.value,[e,r])}return e};Vr.prototype.additive=function(){for(var e=this.multiplicative();this.peek("+","-");){var t=this.consume();e=new Da(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 Da(e.value,[r,this.unary()]);return this.current().type===Xp.SYMBOL||this.peek("(")||!(r.type instanceof _3)&&this.current().type===Xp.NUMBER?(t=this.multiplicative(),new Da("*",[r,t])):r};Vr.prototype.unary=function(){if(this.peek("-","+","~")){var e=this.consume(),t=this.unary();return new Q2e(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 Da(t.value,[e,r])}return e};Vr.prototype.factorial=function(){var e=this.symbol();if(this.peek("!")){var t=this.consume();return new Da(t.value,[e])}return e};Vr.prototype.symbol=function(){var e=this.current();if(e.type===Xp.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 j2e(t,r)}return new JJ(t)};Vr.prototype.string=function(){return this.current().type===Xp.STRING?new _3(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 eDe(e)}return this.number()};Vr.prototype.number=function(){var e=this.current();return e.type===Xp.NUMBER?new _3(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!==Xp.EOF)throw Error("unexpected end of expression")};QJ.exports=Vr});var tQ=dt((Wgr,eQ)=>{v();x();g();eQ.exports={ArrayNode:A3(),AssignmentNode:O3(),BlockNode:F3(),ConditionalNode:M3(),ConstantNode:v3(),FunctionNode:E3(),Node:Ys(),OperatorNode:x3(),SymbolNode:D3(),UnaryNode:w3()}});var W0=dt((Zgr,kD)=>{"use strict";v();x();g();kD.exports.Lexer=h3();kD.exports.Parser=jJ();kD.exports.nodeTypes=tQ()});var V0=dt((Qgr,lQ)=>{"use strict";v();x();g();var BD=Object.prototype.hasOwnProperty,uQ=Object.prototype.toString,rQ=Object.defineProperty,nQ=Object.getOwnPropertyDescriptor,iQ=function(t){return typeof Array.isArray=="function"?Array.isArray(t):uQ.call(t)==="[object Array]"},oQ=function(t){if(!t||uQ.call(t)!=="[object Object]")return!1;var r=BD.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&BD.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;var i;for(i in t);return typeof i>"u"||BD.call(t,i)},aQ=function(t,r){rQ&&r.name==="__proto__"?rQ(t,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):t[r.name]=r.newValue},sQ=function(t,r){if(r==="__proto__")if(BD.call(t,r)){if(nQ)return nQ(t,r).value}else return;return t[r]};lQ.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";v();x();g();fQ.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 mQ=dt((a0r,pQ)=>{"use strict";v();x();g();pQ.exports=function(e){return'scope["'+e.name+'"] = '+this.next(e.expr)}});var dQ=dt((f0r,hQ)=>{"use strict";v();x();g();hQ.exports=function(e){var t="!!("+this.next(e.condition)+")",r=this.next(e.trueExpr),n=this.next(e.falseExpr);return"("+t+" ? ("+r+") : ("+n+") )"}});var gQ=dt((h0r,vQ)=>{"use strict";v();x();g();vQ.exports=function(e){return this.options.raw?e.value:this.options.factory+"("+e.value+")"}});var yQ=dt((x0r,k3)=>{"use strict";v();x();g();var iDe=W0().nodeTypes.SymbolNode,xQ=function(e){return"$$mathCodegen.functionProxy("+this.next(new iDe(e.name))+', "'+e.name+'")'};k3.exports=function(e){var t=this,r=xQ.call(this,e),n=[];return this.rawify(this.options.rawCallExpressionElements,function(){n=e.args.map(function(i){return t.next(i)})}),r+"("+n.join(", ")+")"};k3.exports.functionProxy=xQ});var bQ=dt((D0r,wQ)=>{"use strict";v();x();g();wQ.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 NQ=dt((A0r,DQ)=>{"use strict";v();x();g();var oDe=bQ();DQ.exports=function(e){if(this.options.raw)return["("+this.next(e.args[0]),e.op,this.next(e.args[1])+")"].join(" ");var t=oDe[e.op];if(!t)throw TypeError("unidentified operator");return this.FunctionNode({name:t,args:e.args})}});var SQ=dt((O0r,EQ)=>{"use strict";v();x();g();EQ.exports=function(e){var t=e.name;return'$$mathCodegen.getProperty("'+t+'", scope, ns)'}});var CQ=dt((k0r,AQ)=>{"use strict";v();x();g();AQ.exports={"+":"positive","-":"negative","~":"oneComplement"}});var OQ=dt((R0r,TQ)=>{"use strict";v();x();g();var MQ=CQ();TQ.exports=function(e){if(this.options.raw)return e.op+this.next(e.argument);if(!(e.op in MQ))throw new SyntaxError(e.op+" not implemented");var t=MQ[e.op];return this.FunctionNode({name:t,args:[e.argument]})}});var _Q=dt((H0r,FQ)=>{"use strict";v();x();g();var IQ=V0(),aDe={ArrayNode:cQ(),AssignmentNode:mQ(),ConditionalNode:dQ(),ConstantNode:gQ(),FunctionNode:yQ(),OperatorNode:NQ(),SymbolNode:SQ(),UnaryNode:OQ()},LD=function(e,t){this.owner=e,this.options=IQ({factory:"ns.factory",raw:!1,rawArrayExpressionElements:!0,rawCallExpressionElements:!1},t)};IQ(LD.prototype,aDe);LD.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)};LD.prototype.rawify=function(e,t){var r=this.options.raw;e&&(this.options.raw=!0),t(),e&&(this.options.raw=r)};FQ.exports=LD});var BQ=dt((G0r,kQ)=>{"use strict";v();x();g();var sDe=W0().Parser,uDe=_Q(),lDe=V0();function PD(e,t){this.statements=[],this.defs=t||{},this.interpreter=new uDe(this,e)}PD.prototype.setDefs=function(e){return this.defs=lDe(this.defs,e),this};PD.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)};kD.prototype.parse=function(e){var t=this,r=new sDe().parse(e);return this.statements=r.blocks.map(function(n){return t.interpreter.next(n)}),this};BQ.exports=kD});var RQ=dt((K0r,PQ)=>{"use strict";v();x();g();PQ.exports=LQ()});var zQ=dt((e1r,qQ)=>{"use strict";v();x();g();qQ.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 UQ=dt((i1r,B3)=>{"use strict";v();x();g();var fDe=RQ(),k3=zQ()();function cDe(e){Object.keys(e).forEach(function(t){var r=e[t];e[t]=k3.factory(r)})}B3.exports=function(e){return new fDe().setDefs({$$processScope:cDe}).parse(e).compile(k3)};B3.exports.math=k3});var $Q=dt((u1r,HQ)=>{"use strict";v();x();g();HQ.exports=UQ()});var VQ=dt((p1r,WQ)=>{"use strict";v();x();g();WQ.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=dt((v1r,GQ)=>{"use strict";v();x();g();GQ.exports=function(e){return'scope["'+e.name+'"] = '+this.next(e.expr)}});var XQ=dt((w1r,ZQ)=>{"use strict";v();x();g();ZQ.exports=function(e){var t="!!("+this.next(e.condition)+")",r=this.next(e.trueExpr),n=this.next(e.falseExpr);return"("+t+" ? ("+r+") : ("+n+") )"}});var JQ=dt((S1r,KQ)=>{"use strict";v();x();g();KQ.exports=function(e){return this.options.raw?e.value:this.options.factory+"("+e.value+")"}});var jQ=dt((M1r,L3)=>{"use strict";v();x();g();var pDe=Z0().nodeTypes.SymbolNode,QQ=function(e){return"$$mathCodegen.functionProxy("+this.next(new pDe(e.name))+', "'+e.name+'")'};L3.exports=function(e){var t=this,r=QQ.call(this,e),n=[];return this.rawify(this.options.rawCallExpressionElements,function(){n=e.args.map(function(i){return t.next(i)})}),r+"("+n.join(", ")+")"};L3.exports.functionProxy=QQ});var tj=dt((F1r,ej)=>{"use strict";v();x();g();ej.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 nj=dt((L1r,rj)=>{"use strict";v();x();g();var mDe=tj();rj.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 oj=dt((z1r,ij)=>{"use strict";v();x();g();ij.exports=function(e){var t=e.name;return'$$mathCodegen.getProperty("'+t+'", scope, ns)'}});var sj=dt((W1r,aj)=>{"use strict";v();x();g();aj.exports={"+":"positive","-":"negative","~":"oneComplement"}});var fj=dt((Z1r,lj)=>{"use strict";v();x();g();var uj=sj();lj.exports=function(e){if(this.options.raw)return e.op+this.next(e.argument);if(!(e.op in uj))throw new SyntaxError(e.op+" not implemented");var t=uj[e.op];return this.FunctionNode({name:t,args:[e.argument]})}});var mj=dt((Q1r,pj)=>{"use strict";v();x();g();var cj=X0(),hDe={ArrayNode:VQ(),AssignmentNode:YQ(),ConditionalNode:XQ(),ConstantNode:JQ(),FunctionNode:jQ(),OperatorNode:nj(),SymbolNode:oj(),UnaryNode:fj()},BD=function(e,t){this.owner=e,this.options=cj({factory:"ns.factory",raw:!1,rawArrayExpressionElements:!0,rawCallExpressionElements:!1,applyFactoryToScope:!1},t)};cj(BD.prototype,hDe);BD.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)};BD.prototype.rawify=function(e,t){var r=this.options.raw;e&&(this.options.raw=!0),t(),e&&(this.options.raw=r)};pj.exports=BD});var dj=dt((rxr,hj)=>{"use strict";v();x();g();var dDe=Z0().Parser,vDe=mj(),gDe=X0();function LD(e,t){this.statements=[],this.defs=t||{},this.interpreter=new vDe(this,e)}LD.prototype.setDefs=function(e){return this.defs=gDe(this.defs,e),this};LD.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)};PD.prototype.parse=function(e){var t=this,r=new sDe().parse(e);return this.statements=r.blocks.map(function(n){return t.interpreter.next(n)}),this};kQ.exports=PD});var PQ=dt((K0r,LQ)=>{"use strict";v();x();g();LQ.exports=BQ()});var qQ=dt((e1r,RQ)=>{"use strict";v();x();g();RQ.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 zQ=dt((i1r,L3)=>{"use strict";v();x();g();var fDe=PQ(),B3=qQ()();function cDe(e){Object.keys(e).forEach(function(t){var r=e[t];e[t]=B3.factory(r)})}L3.exports=function(e){return new fDe().setDefs({$$processScope:cDe}).parse(e).compile(B3)};L3.exports.math=B3});var HQ=dt((u1r,UQ)=>{"use strict";v();x();g();UQ.exports=zQ()});var WQ=dt((p1r,$Q)=>{"use strict";v();x();g();$Q.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 GQ=dt((v1r,VQ)=>{"use strict";v();x();g();VQ.exports=function(e){return'scope["'+e.name+'"] = '+this.next(e.expr)}});var ZQ=dt((w1r,YQ)=>{"use strict";v();x();g();YQ.exports=function(e){var t="!!("+this.next(e.condition)+")",r=this.next(e.trueExpr),n=this.next(e.falseExpr);return"("+t+" ? ("+r+") : ("+n+") )"}});var KQ=dt((E1r,XQ)=>{"use strict";v();x();g();XQ.exports=function(e){return this.options.raw?e.value:this.options.factory+"("+e.value+")"}});var QQ=dt((M1r,P3)=>{"use strict";v();x();g();var pDe=W0().nodeTypes.SymbolNode,JQ=function(e){return"$$mathCodegen.functionProxy("+this.next(new pDe(e.name))+', "'+e.name+'")'};P3.exports=function(e){var t=this,r=JQ.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=JQ});var ej=dt((F1r,jQ)=>{"use strict";v();x();g();jQ.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 rj=dt((L1r,tj)=>{"use strict";v();x();g();var mDe=ej();tj.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 ij=dt((z1r,nj)=>{"use strict";v();x();g();nj.exports=function(e){var t=e.name;return'$$mathCodegen.getProperty("'+t+'", scope, ns)'}});var aj=dt((W1r,oj)=>{"use strict";v();x();g();oj.exports={"+":"positive","-":"negative","~":"oneComplement"}});var lj=dt((Z1r,uj)=>{"use strict";v();x();g();var sj=aj();uj.exports=function(e){if(this.options.raw)return e.op+this.next(e.argument);if(!(e.op in sj))throw new SyntaxError(e.op+" not implemented");var t=sj[e.op];return this.FunctionNode({name:t,args:[e.argument]})}});var pj=dt((Q1r,cj)=>{"use strict";v();x();g();var fj=V0(),hDe={ArrayNode:WQ(),AssignmentNode:GQ(),ConditionalNode:ZQ(),ConstantNode:KQ(),FunctionNode:QQ(),OperatorNode:rj(),SymbolNode:ij(),UnaryNode:lj()},RD=function(e,t){this.owner=e,this.options=fj({factory:"ns.factory",raw:!1,rawArrayExpressionElements:!0,rawCallExpressionElements:!1,applyFactoryToScope:!1},t)};fj(RD.prototype,hDe);RD.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)};RD.prototype.rawify=function(e,t){var r=this.options.raw;e&&(this.options.raw=!0),t(),e&&(this.options.raw=r)};cj.exports=RD});var hj=dt((rxr,mj)=>{"use strict";v();x();g();var dDe=W0().Parser,vDe=pj(),gDe=V0();function qD(e,t){this.statements=[],this.defs=t||{},this.interpreter=new vDe(this,e)}qD.prototype.setDefs=function(e){return this.defs=gDe(this.defs,e),this};qD.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)};LD.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};hj.exports=LD});var gj=dt((axr,vj)=>{"use strict";v();x();g();vj.exports=dj()});var Bu=dt(Ui=>{"use strict";v();x();g();Object.defineProperty(Ui,"__esModule",{value:!0});Ui.intervalsOverlap=Ui.hasInterval=Ui.hasValue=Ui.zeroIn=Ui.isSingleton=Ui.isWhole=Ui.isEmpty=Ui.isInterval=void 0;function xDe(e){return typeof e=="object"&&typeof e.lo=="number"&&typeof e.hi=="number"}Ui.isInterval=xDe;function Md(e){return e.lo>e.hi}Ui.isEmpty=Md;function yDe(e){return e.lo===-1/0&&e.hi===1/0}Ui.isWhole=yDe;function wDe(e){return e.lo===e.hi}Ui.isSingleton=wDe;function bDe(e){return xj(e,0)}Ui.zeroIn=bDe;function xj(e,t){return Md(e)?!1:e.lo<=t&&t<=e.hi}Ui.hasValue=xj;function DDe(e,t){return Md(e)?!0:!Md(t)&&t.lo<=e.lo&&e.hi<=t.hi}Ui.hasInterval=DDe;function NDe(e,t){return Md(e)||Md(t)?!1:e.lo<=t.lo&&t.lo<=e.hi||t.lo<=e.lo&&e.lo<=t.hi}Ui.intervalsOverlap=NDe});var yj=dt((hxr,Qn)=>{v();x();g();var P3=!1;if(typeof Float64Array<"u")if(Ys=new Float64Array(1),ko=new Uint32Array(Ys.buffer),Ys[0]=1,P3=!0,ko[1]===1072693248){let e=function(n,i){return ko[0]=n,ko[1]=i,Ys[0]},t=function(n){return Ys[0]=n,ko[0]},r=function(n){return Ys[0]=n,ko[1]};SDe=e,EDe=t,ADe=r,Qn.exports=function(i){return Ys[0]=i,[ko[0],ko[1]]},Qn.exports.pack=e,Qn.exports.lo=t,Qn.exports.hi=r}else if(ko[0]===1072693248){let e=function(n,i){return ko[1]=n,ko[0]=i,Ys[0]},t=function(n){return Ys[0]=n,ko[1]},r=function(n){return Ys[0]=n,ko[0]};CDe=e,MDe=t,TDe=r,Qn.exports=function(i){return Ys[0]=i,[ko[1],ko[0]]},Qn.exports.pack=e,Qn.exports.lo=t,Qn.exports.hi=r}else P3=!1;var Ys,ko,SDe,EDe,ADe,CDe,MDe,TDe;if(!P3){let e=function(n,i){return Zs.writeUInt32LE(n,0,!0),Zs.writeUInt32LE(i,4,!0),Zs.readDoubleLE(0,!0)},t=function(n){return Zs.writeDoubleLE(n,0,!0),Zs.readUInt32LE(0,!0)},r=function(n){return Zs.writeDoubleLE(n,0,!0),Zs.readUInt32LE(4,!0)};ODe=e,IDe=t,FDe=r,Zs=new k(8),Qn.exports=function(i){return Zs.writeDoubleLE(i,0,!0),[Zs.readUInt32LE(0,!0),Zs.readUInt32LE(4,!0)]},Qn.exports.pack=e,Qn.exports.lo=t,Qn.exports.hi=r}var Zs,ODe,IDe,FDe;Qn.exports.sign=function(e){return Qn.exports.hi(e)>>>31};Qn.exports.exponent=function(e){var t=Qn.exports.hi(e);return(t<<1>>>21)-1023};Qn.exports.fraction=function(e){var t=Qn.exports.lo(e),r=Qn.exports.hi(e),n=r&(1<<20)-1;return r&2146435072&&(n+=1<<20),[t,n]};Qn.exports.denormalized=function(e){var t=Qn.exports.hi(e);return!(t&2146435072)}});var Nj=dt((xxr,Dj)=>{"use strict";v();x();g();var R3=yj(),wj=Math.pow(2,-1074),bj=-1>>>0;Dj.exports=_De;function _De(e,t){if(isNaN(e)||isNaN(t))return NaN;if(e===t)return e;if(e===0)return t<0?-wj:wj;var r=R3.hi(e),n=R3.lo(e);return t>e==e>0?n===bj?(r+=1,n=0):n+=1:n===0?(n=bj,r-=1):n-=1,R3.pack(n,r)}});var Ml=dt(K0=>{"use strict";v();x();g();var kDe=K0&&K0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(K0,"__esModule",{value:!0});var Ej=kDe(Nj());function BDe(e){return e}function q3(e){return e===1/0?e:(0,Ej.default)(e,-1/0)}function z3(e){return e===-1/0?e:(0,Ej.default)(e,1/0)}function Sj(e){return e<0?Math.ceil(e):Math.floor(e)}var Td={prev:q3,next:z3},wr={safePrev:q3,safeNext:z3,prev(e){return Td.prev(e)},next(e){return Td.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 Sj(wr.prev(e))},intHi(e){return Sj(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(){Td.next=Td.prev=BDe},enable(){Td.next=z3,Td.prev=q3}};K0.default=wr});var ec=dt(Jo=>{"use strict";v();x();g();var LDe=Jo&&Jo.__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]}),PDe=Jo&&Jo.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),RDe=Jo&&Jo.__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)&&LDe(t,e,r);return PDe(t,e),t},qDe=Jo&&Jo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jo,"__esModule",{value:!0});Jo.Interval=Jo._Interval=void 0;var PD=RDe(Bu()),Od=qDe(Ml()),RD=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(PD.isInterval(t)){if(!PD.isSingleton(t))throw new TypeError("Interval: interval `lo` must be a singleton");t=t.lo}if(PD.isInterval(r)){if(!PD.isSingleton(r))throw TypeError("Interval: interval `hi` must be a singleton");r=r.hi}}else{if(typeof t<"u")return Array.isArray(t)?new Id(t[0],t[1]):new Id(t,t);t=r=0}this.assign(t,r)}singleton(t){return this.set(t,t)}bounded(t,r){return this.set(Od.default.prev(t),Od.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(Od.default.safeNext(t),Od.default.safePrev(r))}halfOpenLeft(t,r){return this.assign(Od.default.safeNext(t),r)}halfOpenRight(t,r){return this.assign(t,Od.default.safePrev(r))}toArray(){return[this.lo,this.hi]}clone(){return new Id().set(this.lo,this.hi)}};Jo._Interval=RD;function zDe(e){function t(){for(var r=arguments.length,n=Array(r),i=0;i{"use strict";v();x();g();var UDe=Q0&&Q0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Q0,"__esModule",{value:!0});var tc=ec(),Aj=UDe(Ml()),qD=(3373259426+273688/(1<<21))/(1<<30),zD=(3373259426+273689/(1<<21))/(1<<30),J0={PI_LOW:qD,PI_HIGH:zD,PI_HALF_LOW:qD/2,PI_HALF_HIGH:zD/2,PI_TWICE_LOW:qD*2,PI_TWICE_HIGH:zD*2,get E(){return new tc.Interval(Aj.default.prev(Math.E),Aj.default.next(Math.E))},get PI(){return new tc.Interval(qD,zD)},get PI_HALF(){return new tc.Interval(J0.PI_HALF_LOW,J0.PI_HALF_HIGH)},get PI_TWICE(){return new tc.Interval(J0.PI_TWICE_LOW,J0.PI_TWICE_HIGH)},get ZERO(){return new tc.Interval(0)},get ONE(){return new tc.Interval(1)},get WHOLE(){return new tc.Interval().setWhole()},get EMPTY(){return new tc.Interval().setEmpty()}};Q0.default=J0});var U3=dt(Ur=>{"use strict";v();x();g();var HDe=Ur&&Ur.__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]}),$De=Ur&&Ur.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),WDe=Ur&&Ur.__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)&&HDe(t,e,r);return $De(t,e),t};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.geq=Ur.greaterEqualThan=Ur.leq=Ur.lessEqualThan=Ur.gt=Ur.greaterThan=Ur.lt=Ur.lessThan=Ur.notEqual=Ur.assertIncludes=Ur.almostEqual=Ur.equal=void 0;var Qo=WDe(Bu());function VDe(e,t){return Qo.isEmpty(e)?Qo.isEmpty(t):!Qo.isEmpty(t)&&e.lo===t.lo&&e.hi===t.hi}Ur.equal=VDe;var GDe=1e-7;function UD(e,t){if(!e)throw new Error(t||"assertion failed")}function Cj(e,t){if(!isFinite(e))return UD(e===t,`[Infinity] expected ${e} to be ${t}`);UD(Math.abs(e-t)t.hi}Ur.notEqual=ZDe;function Tj(e,t){return Qo.isEmpty(e)||Qo.isEmpty(t)?!1:e.hit.hi}Ur.greaterThan=Oj;Ur.gt=Oj;function Ij(e,t){return Qo.isEmpty(e)||Qo.isEmpty(t)?!1:e.hi<=t.lo}Ur.lessEqualThan=Ij;Ur.leq=Ij;function Fj(e,t){return Qo.isEmpty(e)||Qo.isEmpty(t)?!1:e.lo>=t.hi}Ur.greaterEqualThan=Fj;Ur.geq=Fj});var Bj=dt(Hi=>{"use strict";v();x();g();var XDe=Hi&&Hi.__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]}),KDe=Hi&&Hi.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),JDe=Hi&&Hi.__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)&&XDe(t,e,r);return KDe(t,e),t},_j=Hi&&Hi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hi,"__esModule",{value:!0});Hi.zero=Hi.negative=Hi.positive=Hi.nonZero=void 0;var j0=ec(),yo=_j(Ml()),kj=JDe(Bu()),H3=_j(Zp());function QDe(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=yo.default.divLo(n,i),u.hi=yo.default.divHi(r,o)):(u.lo=yo.default.divLo(r,i),u.hi=yo.default.divHi(n,o)):r<0?o<0?(u.lo=yo.default.divLo(n,o),u.hi=yo.default.divHi(r,o)):(u.lo=yo.default.divLo(r,i),u.hi=yo.default.divHi(n,i)):o<0?(u.lo=yo.default.divLo(n,o),u.hi=yo.default.divHi(r,i)):(u.lo=yo.default.divLo(r,o),u.hi=yo.default.divHi(n,i)),u}Hi.nonZero=QDe;function jDe(e,t){return e.lo===0&&e.hi===0?e:kj.zeroIn(e)?H3.default.WHOLE:e.hi<0?new j0.Interval(Number.NEGATIVE_INFINITY,yo.default.divHi(e.hi,t)):new j0.Interval(yo.default.divLo(e.lo,t),Number.POSITIVE_INFINITY)}Hi.positive=jDe;function eNe(e,t){return e.lo===0&&e.hi===0?e:kj.zeroIn(e)?H3.default.WHOLE:e.hi<0?new j0.Interval(yo.default.divLo(e.hi,t),Number.POSITIVE_INFINITY):new j0.Interval(Number.NEGATIVE_INFINITY,yo.default.divHi(e.lo,t))}Hi.negative=eNe;function tNe(e){return e.lo===0&&e.hi===0?e:H3.default.WHOLE}Hi.zero=tNe});var Fd=dt(nn=>{"use strict";v();x();g();var rNe=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]}),nNe=nn&&nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Lj=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)&&rNe(t,e,r);return nNe(t,e),t},Pj=nn&&nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(nn,"__esModule",{value:!0});nn.negative=nn.positive=nn.div=nn.divide=nn.mul=nn.multiply=nn.sub=nn.subtract=nn.add=void 0;var t1=ec(),In=Pj(Ml()),$3=Pj(Zp()),e1=Lj(Bu()),HD=Lj(Bj());function iNe(e,t){return new t1.Interval(In.default.addLo(e.lo,t.lo),In.default.addHi(e.hi,t.hi))}nn.add=iNe;function Rj(e,t){return new t1.Interval(In.default.subLo(e.lo,t.hi),In.default.subHi(e.hi,t.lo))}nn.subtract=Rj;nn.sub=Rj;function qj(e,t){if(e1.isEmpty(e)||e1.isEmpty(t))return $3.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(In.default.mulLo(r,o),In.default.mulLo(n,i)),u.hi=Math.max(In.default.mulHi(r,i),In.default.mulHi(n,o))):(u.lo=In.default.mulLo(n,i),u.hi=In.default.mulHi(r,i)):o>0?(u.lo=In.default.mulLo(r,o),u.hi=In.default.mulHi(n,o)):(u.lo=0,u.hi=0):i<0?o>0?(u.lo=In.default.mulLo(r,o),u.hi=In.default.mulHi(r,i)):(u.lo=In.default.mulLo(n,o),u.hi=In.default.mulHi(r,i)):o>0?(u.lo=In.default.mulLo(r,o),u.hi=In.default.mulHi(n,i)):(u.lo=0,u.hi=0):n>0?i<0?o>0?(u.lo=In.default.mulLo(n,i),u.hi=In.default.mulHi(n,o)):(u.lo=In.default.mulLo(n,i),u.hi=In.default.mulHi(r,o)):o>0?(u.lo=In.default.mulLo(r,i),u.hi=In.default.mulHi(n,o)):(u.lo=0,u.hi=0):(u.lo=0,u.hi=0),u}nn.multiply=qj;nn.mul=qj;function zj(e,t){return e1.isEmpty(e)||e1.isEmpty(t)?$3.default.EMPTY:e1.zeroIn(t)?t.lo!==0?t.hi!==0?HD.zero(e):HD.negative(e,t.lo):t.hi!==0?HD.positive(e,t.hi):$3.default.EMPTY:HD.nonZero(e,t)}nn.divide=zj;nn.div=zj;function oNe(e){return new t1.Interval(e.lo,e.hi)}nn.positive=oNe;function aNe(e){return new t1.Interval(-e.hi,-e.lo)}nn.negative=aNe});var $D=dt(pi=>{"use strict";v();x();g();var sNe=pi&&pi.__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]}),uNe=pi&&pi.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Hj=pi&&pi.__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)&&sNe(t,e,r);return uNe(t,e),t},$j=pi&&pi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pi,"__esModule",{value:!0});pi.nthRoot=pi.sqrt=pi.pow=pi.multiplicativeInverse=pi.fmod=void 0;var Aa=ec(),ro=$j(Ml()),us=$j(Zp()),rc=Hj(Bu()),Uj=Hj(Fd());function lNe(e,t){if(rc.isEmpty(e)||rc.isEmpty(t))return us.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),Uj.sub(e,Uj.mul(t,new Aa.Interval(n)))}pi.fmod=lNe;function Wj(e){return rc.isEmpty(e)?us.default.EMPTY:rc.zeroIn(e)?e.lo!==0?e.hi!==0?us.default.WHOLE:new Aa.Interval(Number.NEGATIVE_INFINITY,ro.default.divHi(1,e.lo)):e.hi!==0?new Aa.Interval(ro.default.divLo(1,e.hi),Number.POSITIVE_INFINITY):us.default.EMPTY:new Aa.Interval(ro.default.divLo(1,e.hi),ro.default.divHi(1,e.lo))}pi.multiplicativeInverse=Wj;function Vj(e,t){if(rc.isEmpty(e))return us.default.EMPTY;if(typeof t=="object"){if(!rc.isSingleton(t))return us.default.EMPTY;t=t.lo}if(t===0)return e.lo===0&&e.hi===0?us.default.EMPTY:us.default.ONE;if(t<0)return Vj(Wj(e),-t);if(Number.isSafeInteger(t))if(e.hi<0){let r=ro.default.powLo(-e.hi,t),n=ro.default.powHi(-e.lo,t);return(t&1)===1?new Aa.Interval(-n,-r):new Aa.Interval(r,n)}else return e.lo<0?(t&1)===1?new Aa.Interval(-ro.default.powLo(-e.lo,t),ro.default.powHi(e.hi,t)):new Aa.Interval(0,ro.default.powHi(Math.max(-e.lo,e.hi),t)):new Aa.Interval(ro.default.powLo(e.lo,t),ro.default.powHi(e.hi,t));else return console.warn("power is not an integer, you should use nth-root instead, returning an empty interval"),us.default.EMPTY}pi.pow=Vj;function fNe(e){return Gj(e,2)}pi.sqrt=fNe;function Gj(e,t){if(rc.isEmpty(e)||t<0)return us.default.EMPTY;if(typeof t=="object"){if(!rc.isSingleton(t))return us.default.EMPTY;t=t.lo}let r=1/t;if(e.hi<0){if(Number.isSafeInteger(t)&&(t&1)===1){let n=ro.default.powHi(-e.lo,r),i=ro.default.powLo(-e.hi,r);return new Aa.Interval(-n,-i)}return us.default.EMPTY}else if(e.lo<0){let n=ro.default.powHi(e.hi,r);if(Number.isSafeInteger(t)&&(t&1)===1){let i=-ro.default.powHi(-e.lo,r);return new Aa.Interval(i,n)}return new Aa.Interval(0,n)}else return new Aa.Interval(ro.default.powLo(e.lo,r),ro.default.powHi(e.hi,r))}pi.nthRoot=Gj});var WD=dt(mr=>{"use strict";v();x();g();var cNe=mr&&mr.__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]}),pNe=mr&&mr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Yj=mr&&mr.__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)&&cNe(t,e,r);return pNe(t,e),t},Zj=mr&&mr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mr,"__esModule",{value:!0});mr.clone=mr.min=mr.max=mr.abs=mr.wid=mr.width=mr.difference=mr.union=mr.intersection=mr.hull=mr.log2=mr.LOG_EXP_2=mr.log10=mr.LOG_EXP_10=mr.ln=mr.log=mr.exp=void 0;var Ca=ec(),r1=Zj(Ml()),ls=Zj(Zp()),Mi=Yj(Bu()),W3=Yj(Fd());function mNe(e){return Mi.isEmpty(e)?ls.default.EMPTY:new Ca.Interval(r1.default.expLo(e.lo),r1.default.expHi(e.hi))}mr.exp=mNe;function _d(e){if(Mi.isEmpty(e))return ls.default.EMPTY;let t=e.lo<=0?Number.NEGATIVE_INFINITY:r1.default.logLo(e.lo);return new Ca.Interval(t,r1.default.logHi(e.hi))}mr.log=_d;mr.ln=_d;mr.LOG_EXP_10=_d(new Ca.Interval(10,10));function hNe(e){return Mi.isEmpty(e)?ls.default.EMPTY:W3.div(_d(e),mr.LOG_EXP_10)}mr.log10=hNe;mr.LOG_EXP_2=_d(new Ca.Interval(2,2));function dNe(e){return Mi.isEmpty(e)?ls.default.EMPTY:W3.div(_d(e),mr.LOG_EXP_2)}mr.log2=dNe;function vNe(e,t){let r=Mi.isEmpty(e),n=Mi.isEmpty(t);return r&&n?ls.default.EMPTY:r?t.clone():n?e.clone():new Ca.Interval(Math.min(e.lo,t.lo),Math.max(e.hi,t.hi))}mr.hull=vNe;function gNe(e,t){if(Mi.isEmpty(e)||Mi.isEmpty(t))return ls.default.EMPTY;let r=Math.max(e.lo,t.lo),n=Math.min(e.hi,t.hi);return r<=n?new Ca.Interval(r,n):ls.default.EMPTY}mr.intersection=gNe;function xNe(e,t){if(!Mi.intervalsOverlap(e,t))throw Error("Interval#union: intervals do not overlap");return new Ca.Interval(Math.min(e.lo,t.lo),Math.max(e.hi,t.hi))}mr.union=xNe;function yNe(e,t){if(Mi.isEmpty(e)||Mi.isWhole(t))return ls.default.EMPTY;if(Mi.intervalsOverlap(e,t)){if(e.lo=e.hi&&t.lo===-1/0?ls.default.EMPTY:t.lo<=e.lo?new Ca.Interval().halfOpenLeft(t.hi,e.hi):new Ca.Interval().halfOpenRight(e.lo,t.lo)}return e.clone()}mr.difference=yNe;function Xj(e){return Mi.isEmpty(e)?0:r1.default.subHi(e.hi,e.lo)}mr.width=Xj;mr.wid=Xj;function wNe(e){return Mi.isEmpty(e)||Mi.isWhole(e)?ls.default.EMPTY:e.lo>=0?e.clone():e.hi<=0?W3.negative(e):new Ca.Interval(0,Math.max(-e.lo,e.hi))}mr.abs=wNe;function bNe(e,t){let r=Mi.isEmpty(e),n=Mi.isEmpty(t);return r&&n?ls.default.EMPTY:r?t.clone():n?e.clone():new Ca.Interval(Math.max(e.lo,t.lo),Math.max(e.hi,t.hi))}mr.max=bNe;function DNe(e,t){let r=Mi.isEmpty(e),n=Mi.isEmpty(t);return r&&n?ls.default.EMPTY:r?t.clone():n?e.clone():new Ca.Interval(Math.min(e.lo,t.lo),Math.min(e.hi,t.hi))}mr.min=DNe;function NNe(e){return new Ca.Interval().set(e.lo,e.hi)}mr.clone=NNe});var Y3=dt(on=>{"use strict";v();x();g();var SNe=on&&on.__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]}),ENe=on&&on.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),GD=on&&on.__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)&&SNe(t,e,r);return ENe(t,e),t},Kj=on&&on.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(on,"__esModule",{value:!0});on.tanh=on.cosh=on.sinh=on.atan=on.acos=on.asin=on.tan=on.sin=on.cos=void 0;var Bo=ec(),Ti=Kj(Ml()),Dn=Kj(Zp()),Tl=GD(Bu()),VD=GD(Fd()),Jj=GD($D()),ANe=GD(WD());function V3(e){return!isFinite(e.lo)&&e.lo===e.hi}function Qj(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 G3(e){if(Tl.isEmpty(e)||V3(e))return Dn.default.EMPTY;let t=new Bo.Interval().set(e.lo,e.hi);Qj(t);let r=Dn.default.PI_TWICE,n=Jj.fmod(t,r);if(ANe.width(n)>=r.lo)return new Bo.Interval(-1,1);if(n.lo>=Dn.default.PI_HIGH){let a=G3(VD.sub(n,Dn.default.PI));return VD.negative(a)}let i=n.lo,o=n.hi,u=Ti.default.cosLo(o),l=Ti.default.cosHi(i);return o<=Dn.default.PI_LOW?new Bo.Interval(u,l):o<=r.lo?new Bo.Interval(-1,Math.max(u,l)):new Bo.Interval(-1,1)}on.cos=G3;function CNe(e){return Tl.isEmpty(e)||V3(e)?Dn.default.EMPTY:G3(VD.sub(e,Dn.default.PI_HALF))}on.sin=CNe;function MNe(e){if(Tl.isEmpty(e)||V3(e))return Dn.default.EMPTY;let t=new Bo.Interval().set(e.lo,e.hi);Qj(t);let r=Dn.default.PI,n=Jj.fmod(t,r);return n.lo>=Dn.default.PI_HALF_LOW&&(n=VD.sub(n,r)),n.lo<=-Dn.default.PI_HALF_LOW||n.hi>=Dn.default.PI_HALF_LOW?Dn.default.WHOLE:new Bo.Interval(Ti.default.tanLo(n.lo),Ti.default.tanHi(n.hi))}on.tan=MNe;function TNe(e){if(Tl.isEmpty(e)||e.hi<-1||e.lo>1)return Dn.default.EMPTY;let t=e.lo<=-1?-Dn.default.PI_HALF_HIGH:Ti.default.asinLo(e.lo),r=e.hi>=1?Dn.default.PI_HALF_HIGH:Ti.default.asinHi(e.hi);return new Bo.Interval(t,r)}on.asin=TNe;function ONe(e){if(Tl.isEmpty(e)||e.hi<-1||e.lo>1)return Dn.default.EMPTY;let t=e.hi>=1?0:Ti.default.acosLo(e.hi),r=e.lo<=-1?Dn.default.PI_HIGH:Ti.default.acosHi(e.lo);return new Bo.Interval(t,r)}on.acos=ONe;function INe(e){return Tl.isEmpty(e)?Dn.default.EMPTY:new Bo.Interval(Ti.default.atanLo(e.lo),Ti.default.atanHi(e.hi))}on.atan=INe;function FNe(e){return Tl.isEmpty(e)?Dn.default.EMPTY:new Bo.Interval(Ti.default.sinhLo(e.lo),Ti.default.sinhHi(e.hi))}on.sinh=FNe;function _Ne(e){return Tl.isEmpty(e)?Dn.default.EMPTY:e.hi<0?new Bo.Interval(Ti.default.coshLo(e.hi),Ti.default.coshHi(e.lo)):e.lo>=0?new Bo.Interval(Ti.default.coshLo(e.lo),Ti.default.coshHi(e.hi)):new Bo.Interval(1,Ti.default.coshHi(-e.lo>e.hi?e.lo:e.hi))}on.cosh=_Ne;function kNe(e){return Tl.isEmpty(e)?Dn.default.EMPTY:new Bo.Interval(Ti.default.tanhLo(e.lo),Ti.default.tanhHi(e.hi))}on.tanh=kNe});var nee=dt(Nn=>{"use strict";v();x();g();var jj=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]}),BNe=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),kd=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)&&jj(t,e,r);return BNe(t,e),t},Bd=Nn&&Nn.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&jj(t,e,r)},eee=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 tee=ec();Object.defineProperty(Nn,"Interval",{enumerable:!0,get:function(){return tee._Interval}});var Z3=eee(Ml());Nn.round=Z3.default;var ree=eee(Zp());Nn.constants=ree.default;var LNe=kd(U3()),PNe=kd(Fd()),RNe=kd($D()),qNe=kd(Y3()),zNe=kd(WD()),UNe=kd(Bu()),HNe=Object.assign(tee.Interval,ree.default,Z3.default,zNe,UNe,LNe,PNe,RNe,qNe,{round:Z3.default});Nn.default=HNe;Bd(U3(),Nn);Bd(Fd(),Nn);Bd($D(),Nn);Bd(Y3(),Nn);Bd(WD(),Nn);Bd(Bu(),Nn)});var oee=dt((uyr,iee)=>{"use strict";v();x();g();iee.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 see=dt((pyr,aee)=>{"use strict";v();x();g();aee.exports=function(e){return{disableRounding:function(){e.round.disable()},enableRounding:function(){e.round.enable()}}}});var uee=dt((vyr,YD)=>{"use strict";v();x();g();var $Ne=gj(),Ld=nee().default;oee()(Ld);function WNe(e){Object.keys(e).forEach(function(t){let r=e[t];typeof r=="number"||Array.isArray(r)?e[t]=Ld.factory(r):typeof r=="object"&&"lo"in r&&"hi"in r&&(e[t]=Ld.factory(r.lo,r.hi))})}YD.exports=function(e){return new $Ne().setDefs({$$processScope:WNe}).parse(e).compile(Ld)};YD.exports.policies=see()(Ld);YD.exports.Interval=Ld});var X3=dt((wyr,lee)=>{"use strict";v();x();g();lee.exports=uee()});var ic=dt(nc=>{"use strict";v();x();g();var fee=nc&&nc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(nc,"__esModule",{value:!0});nc.interval=nc.builtIn=void 0;var VNe=fee($Q()),GNe=fee(X3()),cee={interval:GNe.default,builtIn:VNe.default};function YNe(){return typeof global=="object"&&"math"in global?global.math:typeof window=="object"&&"math"in window?window.math:null}var K3=YNe();K3&&(cee.builtIn=K3.compile);function pee(e){function t(o){if(typeof o=="string"){let u=cee[e](o);return K3&&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 ZNe=pee("builtIn");nc.builtIn=ZNe;var XNe=pee("interval");nc.interval=XNe});var vee=dt(n1=>{"use strict";v();x();g();var dee=n1&&n1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n1,"__esModule",{value:!0});var KNe=(e0(),An(jg)),JNe=(Jn(),An(Vs)),Xp=dee(ku()),mee=dee(Cd()),hee=ic();function QNe(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,KNe.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,JNe.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),N=e.owner.meta,w=y.datum().data,D=N.xScale,b=N.yScale,O=N.width,M=N.height,I=l.x,F=l.y;for(a=0;aC[0]-mee.default.TIP_X_EPS&&I{"use strict";v();x();g();var jNe=Xs&&Xs.__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=Xs&&Xs.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),tSe=Xs&&Xs.__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)&&jNe(t,e,r);return eSe(t,e),t},rSe=Xs&&Xs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xs,"__esModule",{value:!0});var Kp=tSe(X3()),gee=ic(),nSe=rSe(ku());Kp.default.policies.disableRounding();function iSe(e){let t=nSe.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";v();x();g();var uSe=a1&&a1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a1,"__esModule",{value:!0});var wo=uSe(ku()),o1=ic();function wee(e,t,r,n,i){if(!i)return{asymptote:!0,d0:e,d1:t};let o=10,u=e[0],l=t[0],a=wo.default.linspace(u,l,o),s,f;for(let p=0;p=2&&n!==y&&Math.abs(h/s)>1){let N=wee(t[a-1],t[a],e,y,3);N.asymptote?(t[a-1][0]=N.d0[0],t[a-1][1]=wo.default.clamp(N.d0[1],o,u),i.push(l),t[a][0]=N.d1[0],t[a][1]=wo.default.clamp(N.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 fSe(e){let t=wo.default.space(e.xAxis,e.range,e.nSamples),r=e.yScale.domain(),n=r[0]-wo.default.infinity(),i=r[1]+wo.default.infinity(),o=[];for(let l=0;l{"use strict";v();x();g();var J3=s1&&s1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s1,"__esModule",{value:!0});var Dee=J3(Cd()),vSe=J3(yee()),gSe=J3(bee());function xSe(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 ySe(e,t){let r=xSe(e.meta.xScale,t),n;if(t.sampler==="builtIn")n=gSe.default;else if(t.sampler==="interval")n=vSe.default;else throw new Error(`Invalid sampler function ${t.sampler}`);let i=t.nSamples||Math.min(Dee.default.MAX_ITERATIONS,Dee.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=ySe});var Eee=dt(u1=>{"use strict";v();x();g();var See=u1&&u1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(u1,"__esModule",{value:!0});var Nee=(Jn(),An(Vs)),Q3=(e0(),An(jg)),XD=See(ku()),wSe=See(ZD());function bSe(e){function t(r){r.each(function(n){let i=t.el=(0,Nee.select)(this),o=n.index,u=(0,wSe.default)(e,n),l=XD.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=XD.default.infinity(),p=-XD.default.infinity());function y(O){return XD.default.clamp(e.meta.yScale(O[1]),p,f)}let N=(0,Q3.line)().curve(Q3.curveLinear).x(function(O){return e.meta.xScale(O[0])}).y(y),w=(0,Q3.area)().x(function(O){return e.meta.xScale(O[0])}).y0(e.meta.yScale(0)).y1(y),D=`line line-${o}`,b=a.enter().append("path").attr("class",D).attr("stroke-width",1).attr("stroke-linecap","round");a.merge(b).each(function(){let O=(0,Nee.select)(this),M;if(n.closed?(O.attr("fill",l),O.attr("fill-opacity",.3),M=w):(O.attr("fill","none"),M=N),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=`${D} ${n.attr[I]}`),O.attr(I,F)}}),a.exit().remove()})}return t}u1.default=bSe});var Cee=dt(l1=>{"use strict";v();x();g();var Aee=l1&&l1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(l1,"__esModule",{value:!0});var DSe=(Jn(),An(Vs)),NSe=Aee(ZD()),SSe=Aee(ku());function ESe(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,N=l.length;y path.line").data(h);t=Math.max(h[0].scaledDx,1);let N=`line line-${f}`,w=y.enter().append("path").attr("class",N).attr("fill","none"),D=y.merge(w).attr("stroke-width",t).attr("stroke",SSe.default.color(a,f)).attr("opacity",p?.5:1).attr("d",function(b){return o(b,p)});if(a.attr)for(let b in a.attr){let O=a.attr[b];b==="class"&&(O=`${N} ${a.attr[b]}`),D.attr(b,O)}y.exit().remove()})}return u}l1.default=ESe});var Tee=dt(f1=>{"use strict";v();x();g();var Mee=f1&&f1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(f1,"__esModule",{value:!0});var ASe=(Jn(),An(Vs)),CSe=(Ws(),An(y2)),MSe=Mee(ku()),TSe=Mee(ZD());function OSe(e){let t=e.meta.xScale,r=e.meta.yScale;function n(i){i.each(function(o){let u,l,a=o.index,s=MSe.default.color(o,a),f=(0,TSe.default)(e,o),p=[];for(u=0;u circle.scatter").data(p),y=`scatter scatter-${a}`,N=h.enter().append("circle").attr("class",y),w=h.merge(N).attr("fill",(0,CSe.hsl)(s.toString()).brighter(1.5).formatHex()).attr("stroke",s).attr("opacity",.7).attr("r",1).attr("cx",function(D){return t(D[0])}).attr("cy",function(D){return r(D[1])});if(o.attr)for(let D in o.attr){let b=o.attr[D];D==="class"&&(b=`${y} ${o.attr[D]}`),w.attr(D,b)}h.exit().remove()})}return n}f1.default=OSe});var Oee=dt(c1=>{"use strict";v();x();g();var ISe=c1&&c1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(c1,"__esModule",{value:!0});var FSe=(Jn(),An(Vs)),_Se=(Ws(),An(y2)),kSe=ISe(ku());function BSe(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,FSe.select)(this).selectAll(":scope > text.fn-text").data([o.location]),l=u.enter().append("text").attr("class",`fn-text fn-text-${o.index}`),a=kSe.default.color(o,o.index),s=u.merge(l).attr("fill",(0,_Se.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=BSe});var p1=dt(fs=>{"use strict";v();x();g();var KD=fs&&fs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fs,"__esModule",{value:!0});fs.text=fs.scatter=fs.interval=fs.polyline=void 0;var LSe=KD(Eee());fs.polyline=LSe.default;var PSe=KD(Cee());fs.interval=PSe.default;var RSe=KD(Tee());fs.scatter=RSe.default;var qSe=KD(Oee());fs.text=qSe.default});var JD=dt(j3=>{"use strict";v();x();g();Object.defineProperty(j3,"__esModule",{value:!0});function zSe(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}j3.default=zSe});var _ee=dt(m1=>{"use strict";v();x();g();var Fee=m1&&m1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(m1,"__esModule",{value:!0});var USe=(Jn(),An(Vs)),HSe=p1(),Iee=ic(),$Se=Fee(JD()),WSe=Fee(ku());function VSe(e){let t=(0,$Se.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:WSe.default.infinity();return t.index=o.index,t.scope={m:(0,Iee.builtIn)(o.derivative,"fn",{x:u}),x0:u,y0:(0,Iee.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,USe.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,HSe.polyline)(e)),s.merge(f).selectAll("path").attr("opacity",.5),s.exit().remove()})};return i}m1.default=VSe});var Lee=dt(h1=>{"use strict";v();x();g();var Bee=h1&&h1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(h1,"__esModule",{value:!0});var GSe=(Jn(),An(Vs)),kee=ic(),YSe=Bee(JD()),ZSe=p1(),XSe=Bee(ku());function KSe(e){let t=(0,YSe.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:XSe.default.infinity();Object.assign(s.scope,{x0:f,x1:p,y0:(0,kee.builtIn)(a,"fn",{x:f}),y1:(0,kee.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";v();x();g();var Pee=d1&&d1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(d1,"__esModule",{value:!0});var JSe=(Jn(),An(Vs)),QSe=Pee(_ee()),jSe=Pee(Lee());function eEe(e){function t(r){r.each(function(){let n=(0,JSe.select)(this);n.call((0,QSe.default)(e)),n.call((0,jSe.default)(e))})}return t}d1.default=eEe});var Hee=dt(Pd=>{"use strict";v();x();g();var Rd=Pd&&Pd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pd,"__esModule",{value:!0});Pd.Chart=void 0;var tEe=(e0(),An(jg)),rEe=(r2(),An(ZV)),Ree=(DZ(),An(bZ)),qee=(FZ(),An(IZ)),nEe=(DJ(),An(bJ)),QD=(Jn(),An(Vs)),zee=(xl(),An(wY)),iEe=Rd((BJ(),An(kJ))),oEe=Rd(LJ()),aEe=Rd(vee()),sEe=Rd(eO()),uEe=Rd(JD()),jD=Rd(Cd());function Uee(e){return e==="linear"?Ree.scaleLinear:Ree.scaleLog}var eN=class e extends iEe.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,QD.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||jD.default.DEFAULT_WIDTH)-t.left-t.right,this.meta.height=(this.options.height||jD.default.DEFAULT_HEIGHT)-t.top-t.bottom,this.initializeAxes()}initializeAxes(){let t=this,r=(0,rEe.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=Uee(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=Uee(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,qee.axisBottom)(this.meta.xScale)),this.meta.xAxis.tickSize(this.options.grid?-this.meta.height:0).tickFormat(n),this.meta.yAxis||(this.meta.yAxis=(0,qee.axisLeft)(this.meta.yScale)),this.meta.yAxis.tickSize(this.options.grid?-this.meta.width:0).tickFormat(n),this.line=(0,tEe.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,QD.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,aEe.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,oEe.default)({owner:t}));let o=n.merge(i).selectAll(":scope > g.graph").data(l=>l.data.map(uEe.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,QD.select)(this);s.call(jD.default.graphTypes[l.graphType](t)),s.call((0,sEe.default)(t))})}buildZoomHelper(){let t=this;this.meta.zoomBehavior||(this.meta.zoomBehavior=(0,nEe.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";v();x();g();Object.defineProperty($ee,"__esModule",{value:!0})});var Xee=dt(cn=>{"use strict";v();x();g();var Vee=cn&&cn.__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]}),lEe=cn&&cn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Gee=cn&&cn.__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)&&Vee(t,e,r);return lEe(t,e),t},Yee=cn&&cn.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Vee(t,e,r)};Object.defineProperty(cn,"__esModule",{value:!0});cn.GraphTypeScatter=cn.GraphTypePolyline=cn.GraphTypeInterval=cn.EvalInterval=cn.EvalBuiltIn=cn.registerGraphType=cn.Chart=void 0;tW();var tO=Hee();Object.defineProperty(cn,"Chart",{enumerable:!0,get:function(){return tO.Chart}});var qd=Gee(Cd());Object.defineProperty(cn,"registerGraphType",{enumerable:!0,get:function(){return qd.registerGraphType}});var Jp=p1(),fEe=Gee(ic());(0,qd.registerGraphType)("polyline",Jp.polyline);(0,qd.registerGraphType)("interval",Jp.interval);(0,qd.registerGraphType)("scatter",Jp.scatter);(0,qd.registerGraphType)("text",Jp.text);function tN(e){e.data=e.data||[];let t=tO.Chart.cache[e.id];return t||(t=new tO.Chart(e)),t.build()}cn.default=tN;tN.globals=qd.default;tN.$eval=fEe;tN.graphTypes={interval:Jp.interval,polyline:Jp.polyline,scatter:Jp.scatter};Yee(Wee(),cn);var Zee=ic();Object.defineProperty(cn,"EvalBuiltIn",{enumerable:!0,get:function(){return Zee.builtIn}});Object.defineProperty(cn,"EvalInterval",{enumerable:!0,get:function(){return Zee.interval}});var rO=p1();Object.defineProperty(cn,"GraphTypeInterval",{enumerable:!0,get:function(){return rO.interval}});Object.defineProperty(cn,"GraphTypePolyline",{enumerable:!0,get:function(){return rO.polyline}});Object.defineProperty(cn,"GraphTypeScatter",{enumerable:!0,get:function(){return rO.scatter}});Yee(eO(),cn)});var Qee=dt((nO,Jee)=>{v();x();g();(function(e,t){var r=t(e);if(typeof define=="function"&&define.amd)define("DeepDiff",function(){return r});else if(typeof nO=="object"||typeof navigator=="object"&&navigator.product.match(/ReactNative/i))Jee.exports=r;else{var n=e.DeepDiff;r.noConflict=function(){return e.DeepDiff===r&&(e.DeepDiff=n),r},e.DeepDiff=r}})(nO,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(!ye&&ce)R.push(new o(ee,P));else if(!ce&&ye)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(X==="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 Ne=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,z=-1,H=R.path?R.path.length-1:0;++z"u"&&(q[R.path[z]]=typeof R.path[z+1]<"u"&&typeof R.path[z+1]=="number"?[]:{}),q=q[R.path[z]];switch(R.kind){case"A":R.path&&typeof q[R.path[z]]>"u"&&(q[R.path[z]]=[]),b(R.path?q[R.path[z]]:q,R.index,R.item);break;case"D":delete q[R.path[z]];break;case"E":case"N":q[R.path[z]]=R.rhs;break}}}function M(C,P,R){if(R.path&&R.path.length){var q=C[P],z,H=R.path.length-1;for(z=0;z"u"&&(q[R.path[z]]={}),q=q[R.path[z]];switch(R.kind){case"A":M(q[R.path[z]],R.index,R.item);break;case"D":q[R.path[z]]=R.lhs;break;case"E":q[R.path[z]]=R.lhs;break;case"N":delete q[R.path[z]];break}}}function F(C,P,R){if(C&&P){var q=function(z){(!R||R(C,P,z))&&O(C,P,z)};y(C,P,q)}}return Object.defineProperties(w,{diff:{value:w,enumerable:!0},orderIndependentDiff:{value:D,enumerable:!0},observableDiff:{value:y,enumerable:!0},orderIndependentObservableDiff:{value:N,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 ute=dt((Nbr,iN)=>{v();x();g();(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 N(C){if(C.stopPropagation){C.stopPropagation();return}C.cancelBubble=!0}function w(C){return C=="shift"||C=="ctrl"||C=="alt"||C=="meta"}function D(){if(!l){l={};for(var C in n)C>95&&C<112||n.hasOwnProperty(C)&&(l[n[C]]=C)}return l}function b(C,P,R){return R||(R=D()[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,z,H=[];for(R=O(C),z=0;z1){le(he,Pe,De,ye);return}Ce=M(he,ye),P._callbacks[Ce.key]=P._callbacks[Ce.key]||[],ee(Ce.key,Ce.modifiers,{type:Ce.action},ce,he,Ne),P._callbacks[Ce.key][ce?"unshift":"push"]({callback:De,modifiers:Ce.modifiers,action:Ce.action,seq:ce,level:Ne,combo:he})}P._bindMultiple=function(he,De,ye){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 iN<"u"&&iN.exports&&(iN.exports=F),typeof define=="function"&&define.amd&&define(function(){return F})})(typeof window<"u"?window:null,typeof window<"u"?document:null)});v();x();g();v();x();g();var Ve=e=>document.querySelector(e),Yn=e=>document.querySelectorAll(e),Gt={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:[]};v();x();g();v();x();g();v();x();g();v();x();g();v();x();g();var $m=jr(Hm(),1);function mu(e){$m.default.modal(e,{bgClose:!1,stack:!0}).show()}function hf(e,t){$m.default.util.on("#dialog-error","beforeshow",()=>{Ve("#errTitle").innerHTML=e,Ve("#errMsg").innerHTML=t}),mu("#dialog-error")}function Ln(e,t){$m.default.notification({message:e,pos:Ge.settings.notifyLocation,status:t||"primary",timeout:+Ge.settings.notifyDuration})}function Wm(e,t){Ve("#confirmMsg").innerHTML=e,mu("#dialog-confirm");let r=n=>{t(),n.stopPropagation(),$m.default.modal("#dialog-confirm").hide(),Ve("#confirm-yes").removeEventListener("click",r)};Ve("#confirm-yes").addEventListener("click",r),$m.default.util.on("#dialog-confirm","hidden",()=>{Ve("#confirm-yes").removeEventListener("click",r)})}var AO=navigator.userAgent.toLowerCase().includes("mac"),_i=navigator.userAgent.toLowerCase().includes("electron");function Rx(){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 qx(){Ve("#resetSizeButton").style.display=_i&&numara.isResized()&&!numara.isMaximized()?"block":"none"}function fS(){numara.isMaximized()?numara.unmaximize():numara.maximize()}function CO(){_i&&(numara.checkUpdate(),numara.notifyUpdate(()=>{Ln('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")||Ln('Restart Numara to finish updating. Restart Now')):Ve("#dialog-about-updateStatus").innerHTML=t}))}v();x();g();v();x();g();v();x();g();v();x();g();var rl=class extends Error{},zx=class extends rl{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}},Ux=class extends rl{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}},Hx=class extends rl{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}},bs=class extends rl{},Vm=class extends rl{constructor(t){super(`Invalid unit ${t}`)}},li=class extends rl{},Ds=class extends rl{constructor(){super("Zone is an abstract class")}};v();x();g();v();x();g();v();x();g();var Ft="numeric",Ns="short",fa="long",df={year:Ft,month:Ft,day:Ft},Vv={year:Ft,month:Ns,day:Ft},cS={year:Ft,month:Ns,day:Ft,weekday:Ns},Gv={year:Ft,month:fa,day:Ft},Yv={year:Ft,month:fa,day:Ft,weekday:fa},Zv={hour:Ft,minute:Ft},Xv={hour:Ft,minute:Ft,second:Ft},Kv={hour:Ft,minute:Ft,second:Ft,timeZoneName:Ns},Jv={hour:Ft,minute:Ft,second:Ft,timeZoneName:fa},Qv={hour:Ft,minute:Ft,hourCycle:"h23"},jv={hour:Ft,minute:Ft,second:Ft,hourCycle:"h23"},eg={hour:Ft,minute:Ft,second:Ft,hourCycle:"h23",timeZoneName:Ns},tg={hour:Ft,minute:Ft,second:Ft,hourCycle:"h23",timeZoneName:fa},rg={year:Ft,month:Ft,day:Ft,hour:Ft,minute:Ft},ng={year:Ft,month:Ft,day:Ft,hour:Ft,minute:Ft,second:Ft},ig={year:Ft,month:Ns,day:Ft,hour:Ft,minute:Ft},og={year:Ft,month:Ns,day:Ft,hour:Ft,minute:Ft,second:Ft},pS={year:Ft,month:Ns,day:Ft,weekday:Ns,hour:Ft,minute:Ft},ag={year:Ft,month:fa,day:Ft,hour:Ft,minute:Ft,timeZoneName:Ns},sg={year:Ft,month:fa,day:Ft,hour:Ft,minute:Ft,second:Ft,timeZoneName:Ns},ug={year:Ft,month:fa,day:Ft,weekday:fa,hour:Ft,minute:Ft,timeZoneName:fa},lg={year:Ft,month:fa,day:Ft,weekday:fa,hour:Ft,minute:Ft,second:Ft,timeZoneName:fa};v();x();g();v();x();g();v();x();g();v();x();g();var Uo=class{get type(){throw new Ds}get name(){throw new Ds}get ianaName(){return this.name}get isUniversal(){throw new Ds}offsetName(t,r){throw new Ds}formatOffset(t,r){throw new Ds}offset(t){throw new Ds}equals(t){throw new Ds}get isValid(){throw new Ds}};var mS=null,vf=class e extends Uo{static get instance(){return mS===null&&(mS=new e),mS}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:r,locale:n}){return Wx(t,r,n)}formatOffset(t,r){return gf(this.offset(t),r)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}};v();x();g();var Gx={};function Vte(e){return Gx[e]||(Gx[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"})),Gx[e]}var Gte={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Yte(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 Zte(e,t){let r=e.formatToParts(t),n=[];for(let i=0;i=0?N:1e3+N,(h-y)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}};v();x();g();var MO={};function Xte(e,t={}){let r=JSON.stringify([e,t]),n=MO[r];return n||(n=new Intl.ListFormat(e,t),MO[r]=n),n}var hS={};function dS(e,t={}){let r=JSON.stringify([e,t]),n=hS[r];return n||(n=new Intl.DateTimeFormat(e,t),hS[r]=n),n}var vS={};function Kte(e,t={}){let r=JSON.stringify([e,t]),n=vS[r];return n||(n=new Intl.NumberFormat(e,t),vS[r]=n),n}var gS={};function Jte(e,t={}){let{base:r,...n}=t,i=JSON.stringify([e,n]),o=gS[i];return o||(o=new Intl.RelativeTimeFormat(e,t),gS[i]=o),o}var fg=null;function Qte(){return fg||(fg=new Intl.DateTimeFormat().resolvedOptions().locale,fg)}var TO={};function jte(e){let t=TO[e];if(!t){let r=new Intl.Locale(e);t="getWeekInfo"in r?r.getWeekInfo():r.weekInfo,TO[e]=t}return t}function ere(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=dS(e).resolvedOptions(),i=e}catch{let a=e.substring(0,r);n=dS(a).resolvedOptions(),i=a}let{numberingSystem:o,calendar:u}=n;return[i,o,u]}}function tre(e,t,r){return(r||t)&&(e.includes("-u-")||(e+="-u"),r&&(e+=`-ca-${r}`),t&&(e+=`-nu-${t}`)),e}function rre(e){let t=[];for(let r=1;r<=12;r++){let n=Dr.utc(2009,r,1);t.push(e(n))}return t}function nre(e){let t=[];for(let r=1;r<=7;r++){let n=Dr.utc(2016,11,13+r);t.push(e(n))}return t}function Yx(e,t,r,n){let i=e.listingMode();return i==="error"?null:i==="en"?r(t):n(t)}function ire(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 xS=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=Kte(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):Ym(t,3);return Pn(r,this.padTo)}}},yS=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&&uo.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=dS(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()}},wS=class{constructor(t,r,n){this.opts={style:"long",...n},!r&&Zx()&&(this.rtf=Jte(t,n))}format(t,r){return this.rtf?this.rtf.format(t,r):OO(r,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,r){return this.rtf?this.rtf.formatToParts(t,r):[]}},ore={firstDay:1,minimalDays:4,weekend:[6,7]},Yr=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||Hr.defaultLocale,l=u||(o?"en-US":Qte()),a=r||Hr.defaultNumberingSystem,s=n||Hr.defaultOutputCalendar,f=cg(i)||Hr.defaultWeekSettings;return new e(l,a,s,f,u)}static resetCache(){fg=null,hS={},vS={},gS={}}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]=ere(t);this.locale=u,this.numberingSystem=r||l||null,this.outputCalendar=n||a||null,this.weekSettings=i,this.intl=tre(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=ire(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,cg(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 Yx(this,t,bS,()=>{let n=r?{month:t,day:"numeric"}:{month:t},i=r?"format":"standalone";return this.monthsCache[i][t]||(this.monthsCache[i][t]=rre(o=>this.extract(o,n,"month"))),this.monthsCache[i][t]})}weekdays(t,r=!1){return Yx(this,t,DS,()=>{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]=nre(o=>this.extract(o,n,"weekday"))),this.weekdaysCache[i][t]})}meridiems(){return Yx(this,void 0,()=>NS,()=>{if(!this.meridiemCache){let t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Dr.utc(2016,11,13,9),Dr.utc(2016,11,13,19)].map(r=>this.extract(r,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Yx(this,t,SS,()=>{let r={era:t};return this.eraCache[t]||(this.eraCache[t]=[Dr.utc(-40,1,1),Dr.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 xS(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,r={}){return new yS(t,this.intl,r)}relFormatter(t={}){return new wS(this.intl,this.isEnglish(),t)}listFormatter(t={}){return Xte(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:Xx()?jte(this.locale):ore}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}};v();x();g();v();x();g();var AS=null,ki=class e extends Uo{static get utcInstance(){return AS===null&&(AS=new e(0)),AS}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(Qc(r[1],r[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${gf(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${gf(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,r){return gf(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}};v();x();g();var Zm=class extends Uo{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 Ss(e,t){let r;if(nr(e)||e===null)return t;if(e instanceof Uo)return e;if(IO(e)){let n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?vf.instance:n==="utc"||n==="gmt"?ki.utcInstance:ki.parseSpecifier(n)||uo.create(e)}else return hu(e)?ki.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new Zm(e)}var FO=()=>Date.now(),_O="system",kO=null,BO=null,LO=null,PO=60,RO,qO=null,Hr=class{static get now(){return FO}static set now(t){FO=t}static set defaultZone(t){_O=t}static get defaultZone(){return Ss(_O,vf.instance)}static get defaultLocale(){return kO}static set defaultLocale(t){kO=t}static get defaultNumberingSystem(){return BO}static set defaultNumberingSystem(t){BO=t}static get defaultOutputCalendar(){return LO}static set defaultOutputCalendar(t){LO=t}static get defaultWeekSettings(){return qO}static set defaultWeekSettings(t){qO=cg(t)}static get twoDigitCutoffYear(){return PO}static set twoDigitCutoffYear(t){PO=t%100}static get throwOnInvalid(){return RO}static set throwOnInvalid(t){RO=t}static resetCaches(){Yr.resetCache(),uo.resetCache()}};v();x();g();v();x();g();var Bi=class{constructor(t,r){this.reason=t,this.explanation=r}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}};var zO=[0,31,59,90,120,151,181,212,243,273,304,334],UO=[0,31,60,91,121,152,182,213,244,274,305,335];function Pa(e,t){return new Bi("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function Kx(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 HO(e,t,r){return r+(ep(e)?UO:zO)[t-1]}function $O(e,t){let r=ep(e)?UO:zO,n=r.findIndex(o=>ojc(n,t,r)?(s=n+1,a=1):s=n,{weekYear:s,weekNumber:a,weekday:l,...hg(e)}}function CS(e,t=4,r=1){let{weekYear:n,weekNumber:i,weekday:o}=e,u=Jx(Kx(n,1,t),r),l=xf(n),a=i*7+o-u-7+t,s;a<1?(s=n-1,a+=xf(s)):a>l?(s=n+1,a-=xf(n)):s=n;let{month:f,day:p}=$O(s,a);return{year:s,month:f,day:p,...hg(e)}}function Qx(e){let{year:t,month:r,day:n}=e,i=HO(t,r,n);return{year:t,ordinal:i,...hg(e)}}function MS(e){let{year:t,ordinal:r}=e,{month:n,day:i}=$O(t,r);return{year:t,month:n,day:i,...hg(e)}}function TS(e,t){if(!nr(e.localWeekday)||!nr(e.localWeekNumber)||!nr(e.localWeekYear)){if(!nr(e.weekday)||!nr(e.weekNumber)||!nr(e.weekYear))throw new bs("Cannot mix locale-based week fields with ISO-based week fields");return nr(e.localWeekday)||(e.weekday=e.localWeekday),nr(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),nr(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 WO(e,t=4,r=1){let n=mg(e.weekYear),i=ca(e.weekNumber,1,jc(e.weekYear,t,r)),o=ca(e.weekday,1,7);return n?i?o?!1:Pa("weekday",e.weekday):Pa("week",e.weekNumber):Pa("weekYear",e.weekYear)}function VO(e){let t=mg(e.year),r=ca(e.ordinal,1,xf(e.year));return t?r?!1:Pa("ordinal",e.ordinal):Pa("year",e.year)}function OS(e){let t=mg(e.year),r=ca(e.month,1,12),n=ca(e.day,1,Xm(e.year,e.month));return t?r?n?!1:Pa("day",e.day):Pa("month",e.month):Pa("year",e.year)}function IS(e){let{hour:t,minute:r,second:n,millisecond:i}=e,o=ca(t,0,23)||t===24&&r===0&&n===0&&i===0,u=ca(r,0,59),l=ca(n,0,59),a=ca(i,0,999);return o?u?l?a?!1:Pa("millisecond",i):Pa("second",n):Pa("minute",r):Pa("hour",t)}function nr(e){return typeof e>"u"}function hu(e){return typeof e=="number"}function mg(e){return typeof e=="number"&&e%1===0}function IO(e){return typeof e=="string"}function YO(e){return Object.prototype.toString.call(e)==="[object Date]"}function Zx(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Xx(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function ZO(e){return Array.isArray(e)?e:[e]}function FS(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 XO(e,t){return t.reduce((r,n)=>(r[n]=e[n],r),{})}function yf(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function cg(e){if(e==null)return null;if(typeof e!="object")throw new li("Week settings must be an object");if(!ca(e.firstDay,1,7)||!ca(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!ca(t,1,7)))throw new li("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function ca(e,t,r){return mg(e)&&e>=t&&e<=r}function are(e,t){return e-t*Math.floor(e/t)}function Pn(e,t=2){let r=e<0,n;return r?n="-"+(""+-e).padStart(t,"0"):n=(""+e).padStart(t,"0"),n}function nl(e){if(!(nr(e)||e===null||e===""))return parseInt(e,10)}function wf(e){if(!(nr(e)||e===null||e===""))return parseFloat(e)}function dg(e){if(!(nr(e)||e===null||e==="")){let t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function Ym(e,t,r=!1){let n=10**t;return(r?Math.trunc:Math.round)(e*n)/n}function ep(e){return e%4===0&&(e%100!==0||e%400===0)}function xf(e){return ep(e)?366:365}function Xm(e,t){let r=are(t-1,12)+1,n=e+(t-r)/12;return r===2?ep(n)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function Gm(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 GO(e,t,r){return-Jx(Kx(e,1,t),r)+t-1}function jc(e,t=4,r=1){let n=GO(e,t,r),i=GO(e+1,t,r);return(xf(e)-n+i)/7}function vg(e){return e>99?e:e>Hr.twoDigitCutoffYear?1900+e:2e3+e}function Wx(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 Qc(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 _S(e){let t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new li(`Invalid unit value ${e}`);return t}function Km(e,t){let r={};for(let n in e)if(yf(e,n)){let i=e[n];if(i==null)continue;r[t(n)]=_S(i)}return r}function gf(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}${Pn(r,2)}:${Pn(n,2)}`;case"narrow":return`${i}${r}${n>0?`:${n}`:""}`;case"techie":return`${i}${Pn(r,2)}${Pn(n,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function hg(e){return XO(e,["hour","minute","second","millisecond"])}var sre=["January","February","March","April","May","June","July","August","September","October","November","December"],kS=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ure=["J","F","M","A","M","J","J","A","S","O","N","D"];function bS(e){switch(e){case"narrow":return[...ure];case"short":return[...kS];case"long":return[...sre];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 BS=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],LS=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],lre=["M","T","W","T","F","S","S"];function DS(e){switch(e){case"narrow":return[...lre];case"short":return[...LS];case"long":return[...BS];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var NS=["AM","PM"],fre=["Before Christ","Anno Domini"],cre=["BC","AD"],pre=["B","A"];function SS(e){switch(e){case"narrow":return[...pre];case"short":return[...cre];case"long":return[...fre];default:return null}}function KO(e){return NS[e.hour<12?0:1]}function JO(e,t){return DS(t)[e.weekday-1]}function QO(e,t){return bS(t)[e.month-1]}function jO(e,t){return SS(t)[e.year<0?0:1]}function OO(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 eI(e,t){let r="";for(let n of e)n.literal?r+=n.val:r+=t(n.val);return r}var mre={D:df,DD:Vv,DDD:Gv,DDDD:Yv,t:Zv,tt:Xv,ttt:Kv,tttt:Jv,T:Qv,TT:jv,TTT:eg,TTTT:tg,f:rg,ff:ig,fff:ag,ffff:ug,F:ng,FF:og,FFF:sg,FFFF:lg},Li=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 mre[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 Pn(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,N)=>this.loc.extract(t,y,N),u=y=>t.isOffsetFixed&&t.offset===0&&y.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,y.format):"",l=()=>n?KO(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(y,N)=>n?QO(t,y):o(N?{month:y}:{month:y,day:"numeric"},"month"),s=(y,N)=>n?JO(t,y):o(N?{weekday:y}:{weekday:y,month:"long",day:"numeric"},"weekday"),f=y=>{let N=e.macroTokenToFormatOpts(y);return N?this.formatWithSystemDefault(t,N):y},p=y=>n?jO(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 eI(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 eI(o,i(l))}};v();x();g();var rI=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Qm(...e){let t=e.reduce((r,n)=>r+n.source,"");return RegExp(`^${t}$`)}function jm(...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 eh(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 nI(...e){return(t,r)=>{let n={},i;for(i=0;iy!==void 0&&(N||y&&f)?-y:y;return[{years:h(wf(r)),months:h(wf(n)),weeks:h(wf(i)),days:h(wf(o)),hours:h(wf(u)),minutes:h(wf(l)),seconds:h(wf(a),a==="-0"),milliseconds:h(dg(s),p)}]}var Are={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?vg(nl(t)):nl(t),month:kS.indexOf(r)+1,day:nl(n),hour:nl(i),minute:nl(o)};return u&&(l.second=nl(u)),e&&(l.weekday=e.length>3?BS.indexOf(e)+1:LS.indexOf(e)+1),l}var Cre=/^(?:(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 Mre(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=Are[a]:s?y=0:y=Qc(f,p),[h,new ki(y)]}function Tre(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var Ore=/^(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$/,Ire=/^(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$/,Fre=/^(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 tI(e){let[,t,r,n,i,o,u,l]=e;return[qS(t,i,n,r,o,u,l),ki.utcInstance]}function _re(e){let[,t,r,n,i,o,u,l]=e;return[qS(t,l,r,n,i,o,u),ki.utcInstance]}var kre=Qm(dre,RS),Bre=Qm(vre,RS),Lre=Qm(gre,RS),Pre=Qm(oI),sI=jm(Dre,th,gg,xg),Rre=jm(xre,th,gg,xg),qre=jm(yre,th,gg,xg),zre=jm(th,gg,xg);function uI(e){return eh(e,[kre,sI],[Bre,Rre],[Lre,qre],[Pre,zre])}function lI(e){return eh(Tre(e),[Cre,Mre])}function fI(e){return eh(e,[Ore,tI],[Ire,tI],[Fre,_re])}function cI(e){return eh(e,[Sre,Ere])}var Ure=jm(th);function pI(e){return eh(e,[Nre,Ure])}var Hre=Qm(wre,bre),$re=Qm(aI),Wre=jm(th,gg,xg);function mI(e){return eh(e,[Hre,sI],[$re,Wre])}var hI="Invalid Duration",vI={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}},Vre={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},...vI},Ra=146097/400,rh=146097/4800,Gre={years:{quarters:4,months:12,weeks:Ra/7,days:Ra,hours:Ra*24,minutes:Ra*24*60,seconds:Ra*24*60*60,milliseconds:Ra*24*60*60*1e3},quarters:{months:3,weeks:Ra/28,days:Ra/4,hours:Ra*24/4,minutes:Ra*24*60/4,seconds:Ra*24*60*60/4,milliseconds:Ra*24*60*60*1e3/4},months:{weeks:rh/7,days:rh,hours:rh*24,minutes:rh*24*60,seconds:rh*24*60*60,milliseconds:rh*24*60*60*1e3},...vI},tp=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Yre=tp.slice(0).reverse();function bf(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 Rn(n)}function gI(e,t){let r=t.milliseconds??0;for(let n of Yre.slice(1))t[n]&&(r+=t[n]*e[n].milliseconds);return r}function dI(e,t){let r=gI(e,t)<0?-1:1;tp.reduceRight((n,i)=>{if(nr(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),tp.reduce((n,i)=>{if(nr(t[i]))return n;if(n){let o=t[n]%1;t[n]-=o,t[i]+=o*e[n][i]}return i},null)}function Zre(e){let t={};for(let[r,n]of Object.entries(e))n!==0&&(t[r]=n);return t}var Rn=class e{constructor(t){let r=t.conversionAccuracy==="longterm"||!1,n=r?Gre:Vre;t.matrix&&(n=t.matrix),this.values=t.values,this.loc=t.loc||Yr.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 li(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new e({values:Km(t,e.normalizeUnit),loc:Yr.fromObject(r),conversionAccuracy:r.conversionAccuracy,matrix:r.matrix})}static fromDurationLike(t){if(hu(t))return e.fromMillis(t);if(e.isDuration(t))return t;if(typeof t=="object")return e.fromObject(t);throw new li(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,r){let[n]=cI(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]=pI(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 li("need to specify a reason the Duration is invalid");let n=t instanceof Bi?t:new Bi(t,r);if(Hr.throwOnInvalid)throw new Hx(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 Vm(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?Li.create(this.loc,n).formatDurationFromString(this,t):hI}toHuman(t={}){if(!this.isValid)return hI;let r=tp.map(n=>{let i=this.values[n];return nr(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+=Ym(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},Dr.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?gI(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 tp)(yf(r.values,i)||yf(this.values,i))&&(n[i]=r.get(i)+this.get(i));return bf(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]=_S(t(this.values[n],n));return bf(this,{values:r},!0)}get(t){return this[e.normalizeUnit(t)]}set(t){if(!this.isValid)return this;let r={...this.values,...Km(t,e.normalizeUnit)};return bf(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 bf(this,u)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;let t=this.toObject();return dI(this.matrix,t),bf(this,{values:t},!0)}rescale(){if(!this.isValid)return this;let t=Zre(this.normalize().shiftToAll().toObject());return bf(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 tp)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;hu(i[u])&&(l+=i[u]);let a=Math.trunc(l);r[u]=a,n[u]=(l*1e3-a*1e3)/1e3}else hu(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 dI(this.matrix,r),bf(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 bf(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 tp)if(!r(this.values[n],t.values[n]))return!1;return!0}};v();x();g();var nh="Invalid Interval";function Xre(e,t){return!e||!e.isValid?il.invalid("missing or invalid start"):!t||!t.isValid?il.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(ih).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=Rn.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()})`:nh}[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=df,r={}){return this.isValid?Li.create(this.s.loc.clone(r),t).formatInterval(this):nh}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:nh}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:nh}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:nh}toFormat(t,{separator:r=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(t)}${r}${this.e.toFormat(t)}`:nh}toDuration(t,r){return this.isValid?this.e.diff(this.s,t,r):Rn.invalid(this.invalidReason)}mapEndpoints(t){return e.fromDateTimes(t(this.s),t(this.e))}};v();x();g();var ol=class{static hasDST(t=Hr.defaultZone){let r=Dr.now().setZone(t).set({month:12});return!t.isUniversal&&r.offset!==r.set({month:6}).offset}static isValidIANAZone(t){return uo.isValidZone(t)}static normalizeZone(t){return Ss(t,Hr.defaultZone)}static getStartOfWeek({locale:t=null,locObj:r=null}={}){return(r||Yr.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:r=null}={}){return(r||Yr.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:r=null}={}){return(r||Yr.create(t)).getWeekendDays().slice()}static months(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Yr.create(r,n,o)).months(t)}static monthsFormat(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Yr.create(r,n,o)).months(t,!0)}static weekdays(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null}={}){return(i||Yr.create(r,n,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null}={}){return(i||Yr.create(r,n,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Yr.create(t).meridiems()}static eras(t="short",{locale:r=null}={}){return Yr.create(r,null,"gregory").eras(t)}static features(){return{relative:Zx(),localeWeek:Xx()}}};v();x();g();function xI(e,t){let r=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=r(t)-r(e);return Math.floor(Rn.fromMillis(n).as("days"))}function Kre(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=xI(a,s);return(f-f%7)/7}],["days",xI]],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 yI(e,t,r,n){let[i,o,u,l]=Kre(e,t,r),a=t-i,s=r.filter(p=>["hours","minutes","seconds","milliseconds"].indexOf(p)>=0);s.length===0&&(u0?Rn.fromMillis(a,n).shiftTo(...s).plus(f):f}v();x();g();v();x();g();var zS={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"},wI={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]},Jre=zS.hanidec.replace(/[\[|\]]/g,"").split("");function bI(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 qa({numberingSystem:e},t=""){return new RegExp(`${zS[e||"latn"]}${t}`)}var Qre="missing Intl.DateTimeFormat.formatToParts support";function $r(e,t=r=>r){return{regex:e,deser:([r])=>t(bI(r))}}var jre="\xA0",SI=`[ ${jre}]`,EI=new RegExp(SI,"g");function ene(e){return e.replace(/\./g,"\\.?").replace(EI,SI)}function DI(e){return e.replace(/\./g,"").replace(EI," ").toLowerCase()}function Es(e,t){return e===null?null:{regex:RegExp(e.map(ene).join("|")),deser:([r])=>e.findIndex(n=>DI(r)===DI(n))+t}}function NI(e,t){return{regex:e,deser:([,r,n])=>Qc(r,n),groups:t}}function jx(e){return{regex:e,deser:([t])=>t}}function tne(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function rne(e,t){let r=qa(t),n=qa(t,"{2}"),i=qa(t,"{3}"),o=qa(t,"{4}"),u=qa(t,"{6}"),l=qa(t,"{1,2}"),a=qa(t,"{1,3}"),s=qa(t,"{1,6}"),f=qa(t,"{1,9}"),p=qa(t,"{2,4}"),h=qa(t,"{4,6}"),y=D=>({regex:RegExp(tne(D.val)),deser:([b])=>b,literal:!0}),w=(D=>{if(e.literal)return y(D);switch(D.val){case"G":return Es(t.eras("short"),0);case"GG":return Es(t.eras("long"),0);case"y":return $r(s);case"yy":return $r(p,vg);case"yyyy":return $r(o);case"yyyyy":return $r(h);case"yyyyyy":return $r(u);case"M":return $r(l);case"MM":return $r(n);case"MMM":return Es(t.months("short",!0),1);case"MMMM":return Es(t.months("long",!0),1);case"L":return $r(l);case"LL":return $r(n);case"LLL":return Es(t.months("short",!1),1);case"LLLL":return Es(t.months("long",!1),1);case"d":return $r(l);case"dd":return $r(n);case"o":return $r(a);case"ooo":return $r(i);case"HH":return $r(n);case"H":return $r(l);case"hh":return $r(n);case"h":return $r(l);case"mm":return $r(n);case"m":return $r(l);case"q":return $r(l);case"qq":return $r(n);case"s":return $r(l);case"ss":return $r(n);case"S":return $r(a);case"SSS":return $r(i);case"u":return jx(f);case"uu":return jx(l);case"uuu":return $r(r);case"a":return Es(t.meridiems(),0);case"kkkk":return $r(o);case"kk":return $r(p,vg);case"W":return $r(l);case"WW":return $r(n);case"E":case"c":return $r(r);case"EEE":return Es(t.weekdays("short",!1),1);case"EEEE":return Es(t.weekdays("long",!1),1);case"ccc":return Es(t.weekdays("short",!0),1);case"cccc":return Es(t.weekdays("long",!0),1);case"Z":case"ZZ":return NI(new RegExp(`([+-]${l.source})(?::(${n.source}))?`),2);case"ZZZ":return NI(new RegExp(`([+-]${l.source})(${n.source})?`),2);case"z":return jx(/[a-z_+-/]{1,256}?/i);case" ":return jx(/[^\S\n\r]/);default:return y(D)}})(e)||{invalidReason:Qre};return w.token=e,w}var nne={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 ine(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=nne[u];if(typeof l=="object"&&(l=l[o]),l)return{literal:!1,val:l}}function one(e){return[`^${e.map(r=>r.regex).reduce((r,n)=>`${r}(${n.source})`,"")}$`,e]}function ane(e,t,r){let n=e.match(t);if(n){let i={},o=1;for(let u in r)if(yf(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 sne(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 nr(e.z)||(r=uo.create(e.z)),nr(e.Z)||(r||(r=new ki(e.Z)),n=e.Z),nr(e.q)||(e.M=(e.q-1)*3+1),nr(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),nr(e.u)||(e.S=dg(e.u)),[Object.keys(e).reduce((o,u)=>{let l=t(u);return l&&(o[l]=e[u]),o},{}),r,n]}var US=null;function une(){return US||(US=Dr.fromMillis(1555555555555)),US}function lne(e,t){if(e.literal)return e;let r=Li.macroTokenToFormatOpts(e.val),n=WS(r,t);return n==null||n.includes(void 0)?e:n}function HS(e,t){return Array.prototype.concat(...e.map(r=>lne(r,t)))}function $S(e,t,r){let n=HS(Li.parseFormat(r),e),i=n.map(u=>rne(u,e)),o=i.find(u=>u.invalidReason);if(o)return{input:t,tokens:n,invalidReason:o.invalidReason};{let[u,l]=one(i),a=RegExp(u,"i"),[s,f]=ane(t,a,l),[p,h,y]=f?sne(f):[null,null,void 0];if(yf(f,"a")&&yf(f,"H"))throw new bs("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 AI(e,t,r){let{result:n,zone:i,specificOffset:o,invalidReason:u}=$S(e,t,r);return[n,i,o,u]}function WS(e,t){if(!e)return null;let n=Li.create(t,e).dtFormatter(une()),i=n.formatToParts(),o=n.resolvedOptions();return i.map(u=>ine(u,e,o))}var VS="Invalid DateTime",CI=864e13;function ey(e){return new Bi("unsupported zone",`the zone "${e.name}" is not supported`)}function GS(e){return e.weekData===null&&(e.weekData=pg(e.c)),e.weekData}function YS(e){return e.localWeekData===null&&(e.localWeekData=pg(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function rp(e,t){let r={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Dr({...r,...t,old:r})}function kI(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 ty(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 ny(e,t,r){return kI(Gm(e),t,r)}function MI(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,Xm(n,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},u=Rn.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=Gm(o),[a,s]=kI(l,r,e.zone);return u!==0&&(a+=u,s=e.zone.offset(a)),{ts:a,o:s}}function yg(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=Dr.fromObject(e,{...r,zone:a,specificOffset:o});return u?s:s.setZone(l)}else return Dr.invalid(new Bi("unparsable",`the input "${i}" can't be parsed as ${n}`))}function ry(e,t,r=!0){return e.isValid?Li.create(Yr.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function ZS(e,t){let r=e.c.year>9999||e.c.year<0,n="";return r&&e.c.year>=0&&(n+="+"),n+=Pn(e.c.year,r?6:4),t?(n+="-",n+=Pn(e.c.month),n+="-",n+=Pn(e.c.day)):(n+=Pn(e.c.month),n+=Pn(e.c.day)),n}function TI(e,t,r,n,i,o){let u=Pn(e.c.hour);return t?(u+=":",u+=Pn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!r)&&(u+=":")):u+=Pn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!r)&&(u+=Pn(e.c.second),(e.c.millisecond!==0||!n)&&(u+=".",u+=Pn(e.c.millisecond,3))),i&&(e.isOffsetFixed&&e.offset===0&&!o?u+="Z":e.o<0?(u+="-",u+=Pn(Math.trunc(-e.o/60)),u+=":",u+=Pn(Math.trunc(-e.o%60))):(u+="+",u+=Pn(Math.trunc(e.o/60)),u+=":",u+=Pn(Math.trunc(e.o%60)))),o&&(u+="["+e.zone.ianaName+"]"),u}var BI={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},fne={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},cne={ordinal:1,hour:0,minute:0,second:0,millisecond:0},LI=["year","month","day","hour","minute","second","millisecond"],pne=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],mne=["year","ordinal","hour","minute","second","millisecond"];function hne(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 Vm(e);return t}function OI(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return hne(e)}}function II(e,t){let r=Ss(t.zone,Hr.defaultZone),n=Yr.fromObject(t),i=Hr.now(),o,u;if(nr(e.year))o=i;else{for(let s of LI)nr(e[s])&&(e[s]=BI[s]);let l=OS(e)||IS(e);if(l)return Dr.invalid(l);let a=r.offset(i);[o,u]=ny(e,a,r)}return new Dr({ts:o,zone:r,loc:n,o:u})}function FI(e,t,r){let n=nr(r.round)?!0:r.round,i=(u,l)=>(u=Ym(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 _I(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 Dr=class e{constructor(t){let r=t.zone||Hr.defaultZone,n=t.invalid||(Number.isNaN(t.ts)?new Bi("invalid input"):null)||(r.isValid?null:ey(r));this.ts=nr(t.ts)?Hr.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=ty(this.ts,l),n=Number.isNaN(i.year)?new Bi("invalid input"):null,i=n?null:i,o=n?null:l}this._zone=r,this.loc=t.loc||Yr.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]=_I(arguments),[n,i,o,u,l,a,s]=r;return II({year:n,month:i,day:o,hour:u,minute:l,second:a,millisecond:s},t)}static utc(){let[t,r]=_I(arguments),[n,i,o,u,l,a,s]=r;return t.zone=ki.utcInstance,II({year:n,month:i,day:o,hour:u,minute:l,second:a,millisecond:s},t)}static fromJSDate(t,r={}){let n=YO(t)?t.valueOf():NaN;if(Number.isNaN(n))return e.invalid("invalid input");let i=Ss(r.zone,Hr.defaultZone);return i.isValid?new e({ts:n,zone:i,loc:Yr.fromObject(r)}):e.invalid(ey(i))}static fromMillis(t,r={}){if(hu(t))return t<-CI||t>CI?e.invalid("Timestamp out of range"):new e({ts:t,zone:Ss(r.zone,Hr.defaultZone),loc:Yr.fromObject(r)});throw new li(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,r={}){if(hu(t))return new e({ts:t*1e3,zone:Ss(r.zone,Hr.defaultZone),loc:Yr.fromObject(r)});throw new li("fromSeconds requires a numerical input")}static fromObject(t,r={}){t=t||{};let n=Ss(r.zone,Hr.defaultZone);if(!n.isValid)return e.invalid(ey(n));let i=Yr.fromObject(r),o=Km(t,OI),{minDaysInFirstWeek:u,startOfWeek:l}=TS(o,i),a=Hr.now(),s=nr(r.specificOffset)?n.offset(a):r.specificOffset,f=!nr(o.ordinal),p=!nr(o.year),h=!nr(o.month)||!nr(o.day),y=p||h,N=o.weekYear||o.weekNumber;if((y||f)&&N)throw new bs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&f)throw new bs("Can't mix ordinal dates with month/day");let w=N||o.weekday&&!y,D,b,O=ty(a,s);w?(D=pne,b=fne,O=pg(O,u,l)):f?(D=mne,b=cne,O=Qx(O)):(D=LI,b=BI);let M=!1;for(let z of D){let H=o[z];nr(H)?M?o[z]=b[z]:o[z]=O[z]:M=!0}let I=w?WO(o,u,l):f?VO(o):OS(o),F=I||IS(o);if(F)return e.invalid(F);let C=w?CS(o,u,l):f?MS(o):o,[P,R]=ny(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]=uI(t);return yg(n,i,r,"ISO 8601",t)}static fromRFC2822(t,r={}){let[n,i]=lI(t);return yg(n,i,r,"RFC 2822",t)}static fromHTTP(t,r={}){let[n,i]=fI(t);return yg(n,i,r,"HTTP",r)}static fromFormat(t,r,n={}){if(nr(t)||nr(r))throw new li("fromFormat requires an input string and a format");let{locale:i=null,numberingSystem:o=null}=n,u=Yr.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0}),[l,a,s,f]=AI(u,t,r);return f?e.invalid(f):yg(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]=mI(t);return yg(n,i,r,"SQL",t)}static invalid(t,r=null){if(!t)throw new li("need to specify a reason the DateTime is invalid");let n=t instanceof Bi?t:new Bi(t,r);if(Hr.throwOnInvalid)throw new zx(n);return new e({invalid:n})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,r={}){let n=WS(t,Yr.fromObject(r));return n?n.map(i=>i?i.val:null).join(""):null}static expandFormat(t,r={}){return HS(Li.parseFormat(t),Yr.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?GS(this).weekYear:NaN}get weekNumber(){return this.isValid?GS(this).weekNumber:NaN}get weekday(){return this.isValid?GS(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?YS(this).weekday:NaN}get localWeekNumber(){return this.isValid?YS(this).weekNumber:NaN}get localWeekYear(){return this.isValid?YS(this).weekYear:NaN}get ordinal(){return this.isValid?Qx(this.c).ordinal:NaN}get monthShort(){return this.isValid?ol.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ol.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ol.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ol.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=Gm(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=ty(a,u),p=ty(s,l);return f.hour===p.hour&&f.minute===p.minute&&f.second===p.second&&f.millisecond===p.millisecond?[rp(this,{ts:a}),rp(this,{ts:s})]:[this]}get isInLeapYear(){return ep(this.year)}get daysInMonth(){return Xm(this.year,this.month)}get daysInYear(){return this.isValid?xf(this.year):NaN}get weeksInWeekYear(){return this.isValid?jc(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?jc(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){let{locale:r,numberingSystem:n,calendar:i}=Li.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:r,numberingSystem:n,outputCalendar:i}}toUTC(t=0,r={}){return this.setZone(ki.instance(t),r)}toLocal(){return this.setZone(Hr.defaultZone)}setZone(t,{keepLocalTime:r=!1,keepCalendarTime:n=!1}={}){if(t=Ss(t,Hr.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]=ny(u,o,t)}return rp(this,{ts:i,zone:t})}else return e.invalid(ey(t))}reconfigure({locale:t,numberingSystem:r,outputCalendar:n}={}){let i=this.loc.clone({locale:t,numberingSystem:r,outputCalendar:n});return rp(this,{loc:i})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;let r=Km(t,OI),{minDaysInFirstWeek:n,startOfWeek:i}=TS(r,this.loc),o=!nr(r.weekYear)||!nr(r.weekNumber)||!nr(r.weekday),u=!nr(r.ordinal),l=!nr(r.year),a=!nr(r.month)||!nr(r.day),s=l||a,f=r.weekYear||r.weekNumber;if((s||u)&&f)throw new bs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&u)throw new bs("Can't mix ordinal dates with month/day");let p;o?p=CS({...pg(this.c,n,i),...r},n,i):nr(r.ordinal)?(p={...this.toObject(),...r},nr(r.day)&&(p.day=Math.min(Xm(p.year,p.month),p.day))):p=MS({...Qx(this.c),...r});let[h,y]=ny(p,this.o,this.zone);return rp(this,{ts:h,o:y})}plus(t){if(!this.isValid)return this;let r=Rn.fromDurationLike(t);return rp(this,MI(this,r))}minus(t){if(!this.isValid)return this;let r=Rn.fromDurationLike(t).negate();return rp(this,MI(this,r))}startOf(t,{useLocaleWeeks:r=!1}={}){if(!this.isValid)return this;let n={},i=Rn.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=yI(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?il.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 li("max requires all arguments be DateTimes");return FS(t,r=>r.valueOf(),Math.max)}static fromFormatExplain(t,r,n={}){let{locale:i=null,numberingSystem:o=null}=n,u=Yr.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});return $S(u,t,r)}static fromStringExplain(t,r,n={}){return e.fromFormatExplain(t,r,n)}static get DATE_SHORT(){return df}static get DATE_MED(){return Vv}static get DATE_MED_WITH_WEEKDAY(){return cS}static get DATE_FULL(){return Gv}static get DATE_HUGE(){return Yv}static get TIME_SIMPLE(){return Zv}static get TIME_WITH_SECONDS(){return Xv}static get TIME_WITH_SHORT_OFFSET(){return Kv}static get TIME_WITH_LONG_OFFSET(){return Jv}static get TIME_24_SIMPLE(){return Qv}static get TIME_24_WITH_SECONDS(){return jv}static get TIME_24_WITH_SHORT_OFFSET(){return eg}static get TIME_24_WITH_LONG_OFFSET(){return tg}static get DATETIME_SHORT(){return rg}static get DATETIME_SHORT_WITH_SECONDS(){return ng}static get DATETIME_MED(){return ig}static get DATETIME_MED_WITH_SECONDS(){return og}static get DATETIME_MED_WITH_WEEKDAY(){return pS}static get DATETIME_FULL(){return ag}static get DATETIME_FULL_WITH_SECONDS(){return sg}static get DATETIME_HUGE(){return ug}static get DATETIME_HUGE_WITH_SECONDS(){return lg}};function ih(e){if(Dr.isDateTime(e))return e;if(e&&e.valueOf&&hu(e.valueOf()))return Dr.fromJSDate(e);if(e&&typeof e=="object")return Dr.fromObject(e);throw new li(`Unknown datetime argument: ${e}, of type ${typeof e}`)}v();x();g();v();x();g();function qn(){return qn=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 dne(e,t){return e.indexOf(t)!==-1}function $I(e,t,r){e[t]!==void 0&&!dne(r,e[t])&&console.warn('Warning: Unknown value "'+e[t]+'" for configuration option "'+t+'". Available options: '+r.map(n=>JSON.stringify(n)).join(", ")+".")}var WA={};La(WA,{createAbs:()=>V_,createAccessorNode:()=>m6,createAcos:()=>$B,createAcosh:()=>VB,createAcot:()=>YB,createAcoth:()=>XB,createAcsc:()=>JB,createAcsch:()=>jB,createAdd:()=>r6,createAddScalar:()=>Z_,createAnd:()=>iw,createAndTransform:()=>OH,createApply:()=>wh,createApplyTransform:()=>nH,createArg:()=>Xk,createArrayNode:()=>h6,createAsec:()=>tL,createAsech:()=>nL,createAsin:()=>oL,createAsinh:()=>aL,createAssignmentNode:()=>g6,createAtan:()=>sL,createAtan2:()=>lL,createAtanh:()=>cL,createAtomicMass:()=>LU,createAvogadro:()=>PU,createBellNumbers:()=>vz,createBigNumberClass:()=>RF,createBignumber:()=>C_,createBin:()=>h5,createBitAnd:()=>Vy,createBitAndTransform:()=>FH,createBitNot:()=>Wk,createBitOr:()=>Gy,createBitOrTransform:()=>_H,createBitXor:()=>Yk,createBlockNode:()=>x6,createBohrMagneton:()=>vU,createBohrRadius:()=>DU,createBoltzmann:()=>RU,createBoolean:()=>A_,createCatalan:()=>xz,createCbrt:()=>Q_,createCeil:()=>j_,createChain:()=>$7,createChainClass:()=>mP,createClassicalElectronRadius:()=>NU,createClone:()=>KF,createColumn:()=>Xy,createColumnTransform:()=>iH,createCombinations:()=>Aq,createCombinationsWithRep:()=>Tq,createCompare:()=>nB,createCompareNatural:()=>sB,createCompareText:()=>lB,createCompile:()=>R6,createComplex:()=>M_,createComplexClass:()=>UF,createComposition:()=>wz,createConcat:()=>Zy,createConcatTransform:()=>gH,createConditionalNode:()=>y6,createConductanceQuantum:()=>gU,createConj:()=>Jk,createConstantNode:()=>E6,createCorr:()=>Nq,createCos:()=>mL,createCosh:()=>dL,createCot:()=>gL,createCoth:()=>yL,createCoulomb:()=>hU,createCount:()=>f4,createCreateUnit:()=>UB,createCross:()=>p4,createCsc:()=>bL,createCsch:()=>NL,createCtranspose:()=>X4,createCube:()=>tk,createCumSum:()=>qw,createCumSumTransform:()=>EH,createDeepEqual:()=>xB,createDenseMatrixClass:()=>ZF,createDerivative:()=>Fz,createDet:()=>V7,createDeuteronMass:()=>TU,createDiag:()=>h4,createDiff:()=>Ky,createDiffTransform:()=>yH,createDistance:()=>cq,createDivide:()=>lq,createDivideScalar:()=>C5,createDot:()=>u6,createDotDivide:()=>U5,createDotMultiply:()=>Lk,createDotPow:()=>q5,createE:()=>Xz,createEfimovFactor:()=>BU,createEigs:()=>Q7,createElectricConstant:()=>pU,createElectronMass:()=>SU,createElementaryCharge:()=>dU,createEqual:()=>fB,createEqualScalar:()=>w_,createEqualText:()=>pB,createErf:()=>i5,createEvaluate:()=>z6,createExp:()=>nk,createExpm:()=>eq,createExpm1:()=>ok,createFactorial:()=>Bq,createFalse:()=>$z,createFaraday:()=>qU,createFermiCoupling:()=>EU,createFft:()=>j4,createFibonacciHeapClass:()=>TB,createFilter:()=>v4,createFilterTransform:()=>aH,createFineStructure:()=>AU,createFirstRadiation:()=>zU,createFix:()=>ak,createFlatten:()=>x4,createFloor:()=>Uy,createForEach:()=>w4,createForEachTransform:()=>sH,createFormat:()=>p5,createFraction:()=>T_,createFractionClass:()=>WF,createFreqz:()=>Rz,createFunctionAssignmentNode:()=>A6,createFunctionNode:()=>k6,createGamma:()=>Iq,createGasConstant:()=>HU,createGcd:()=>pk,createGetMatrixDataType:()=>D4,createGravitationConstant:()=>uU,createGravity:()=>JU,createHartreeEnergy:()=>CU,createHasNumericValue:()=>f_,createHelp:()=>U7,createHelpClass:()=>pP,createHex:()=>x5,createHypot:()=>i6,createI:()=>nU,createIdentity:()=>S4,createIfft:()=>t5,createIm:()=>jk,createImmutableDenseMatrixClass:()=>AB,createIndex:()=>c6,createIndexClass:()=>MB,createIndexNode:()=>C6,createIndexTransform:()=>uH,createInfinity:()=>Vz,createIntersect:()=>pq,createInv:()=>Y7,createInverseConductanceQuantum:()=>xU,createInvmod:()=>kk,createIsInteger:()=>QF,createIsNaN:()=>v_,createIsNegative:()=>a_,createIsNumeric:()=>u_,createIsPositive:()=>p_,createIsPrime:()=>S5,createIsZero:()=>h_,createKldivergence:()=>Pq,createKlitzing:()=>bU,createKron:()=>A4,createLN10:()=>Qz,createLN2:()=>Jz,createLOG10E:()=>eU,createLOG2E:()=>jz,createLarger:()=>dB,createLargerEq:()=>vB,createLcm:()=>hk,createLeafCount:()=>Dz,createLeftShift:()=>J5,createLgamma:()=>_q,createLog:()=>_5,createLog10:()=>vk,createLog1p:()=>B5,createLog2:()=>xk,createLoschmidt:()=>UU,createLsolve:()=>$5,createLsolveAll:()=>Y5,createLup:()=>V6,createLusolve:()=>lP,createLyap:()=>uq,createMad:()=>xq,createMagneticConstant:()=>cU,createMagneticFluxQuantum:()=>yU,createMap:()=>M4,createMapTransform:()=>fH,createMatrix:()=>I_,createMatrixClass:()=>GF,createMatrixFromColumns:()=>P_,createMatrixFromFunction:()=>__,createMatrixFromRows:()=>B_,createMax:()=>pw,createMaxTransform:()=>cH,createMean:()=>zw,createMeanTransform:()=>pH,createMedian:()=>vq,createMin:()=>mw,createMinTransform:()=>mH,createMod:()=>Hy,createMode:()=>u5,createMolarMass:()=>XU,createMolarMassC12:()=>KU,createMolarPlanckConstant:()=>$U,createMolarVolume:()=>WU,createMultinomial:()=>qq,createMultiply:()=>bk,createMultiplyScalar:()=>yk,createNaN:()=>Gz,createNeutronMass:()=>OU,createNode:()=>p6,createNorm:()=>a6,createNot:()=>n4,createNthRoot:()=>Nk,createNthRoots:()=>P5,createNuclearMagneton:()=>wU,createNull:()=>Wz,createNumber:()=>D_,createNumeric:()=>E5,createObjectNode:()=>M6,createOct:()=>v5,createOnes:()=>O4,createOperatorNode:()=>T6,createOr:()=>Yy,createOrTransform:()=>IH,createParenthesisNode:()=>O6,createParse:()=>L6,createParser:()=>$6,createParserClass:()=>U6,createPartitionSelect:()=>bB,createPermutations:()=>Hq,createPhi:()=>Kz,createPi:()=>Yz,createPickRandom:()=>uz,createPinv:()=>X7,createPlanckCharge:()=>tH,createPlanckConstant:()=>lU,createPlanckLength:()=>QU,createPlanckMass:()=>jU,createPlanckTemperature:()=>rH,createPlanckTime:()=>eH,createPolynomialRoot:()=>cP,createPow:()=>T5,createPrint:()=>nw,createPrintTransform:()=>TH,createProd:()=>f5,createProtonMass:()=>MU,createQr:()=>Y6,createQuantileSeq:()=>Hw,createQuantileSeqTransform:()=>NH,createQuantumOfCirculation:()=>IU,createRandom:()=>fz,createRandomInt:()=>pz,createRange:()=>jy,createRangeClass:()=>VF,createRangeNode:()=>I6,createRangeTransform:()=>hH,createRationalize:()=>kz,createRe:()=>t4,createReducedPlanckConstant:()=>fU,createRelationalNode:()=>F6,createReplacer:()=>zz,createReshape:()=>_4,createResize:()=>k4,createResolve:()=>Mz,createResultSet:()=>NF,createReviver:()=>qz,createRightArithShift:()=>j5,createRightLogShift:()=>tB,createRotate:()=>L4,createRotationMatrix:()=>R4,createRound:()=>I5,createRow:()=>ew,createRowTransform:()=>dH,createRydberg:()=>FU,createSQRT1_2:()=>tU,createSQRT2:()=>rU,createSackurTetrode:()=>VU,createSchur:()=>aq,createSec:()=>EL,createSech:()=>CL,createSecondRadiation:()=>GU,createSetCartesian:()=>LL,createSetDifference:()=>RL,createSetDistinct:()=>zL,createSetIntersect:()=>HL,createSetIsSubset:()=>WL,createSetMultiplicity:()=>GL,createSetPowerset:()=>ZL,createSetSize:()=>KL,createSetSymDifference:()=>QL,createSetUnion:()=>e6,createSign:()=>Ek,createSimplify:()=>Sz,createSimplifyConstant:()=>Ez,createSimplifyCore:()=>Cz,createSin:()=>TL,createSinh:()=>IL,createSize:()=>U4,createSlu:()=>sP,createSmaller:()=>mB,createSmallerEq:()=>hB,createSolveODE:()=>n5,createSort:()=>NB,createSpaClass:()=>OB,createSparse:()=>qB,createSparseMatrixClass:()=>b_,createSpeedOfLight:()=>sU,createSplitUnit:()=>q_,createSqrt:()=>Ak,createSqrtm:()=>rq,createSquare:()=>Mk,createSqueeze:()=>$4,createStd:()=>$w,createStdTransform:()=>wH,createStefanBoltzmann:()=>YU,createStirlingS2:()=>hz,createString:()=>S_,createSubset:()=>tw,createSubsetTransform:()=>vH,createSubtract:()=>Ok,createSubtractScalar:()=>K_,createSum:()=>Pw,createSumTransform:()=>DH,createSylvester:()=>iq,createSymbolNode:()=>_6,createSymbolicEqual:()=>Oz,createTan:()=>_L,createTanh:()=>kL,createTau:()=>Zz,createThomsonCrossSection:()=>_U,createTo:()=>D5,createTrace:()=>l6,createTranspose:()=>Y4,createTrue:()=>Hz,createTypeOf:()=>x_,createTyped:()=>DF,createUnaryMinus:()=>U_,createUnaryPlus:()=>$_,createUnequal:()=>yB,createUnitClass:()=>BB,createUnitFunction:()=>PB,createUppercaseE:()=>oU,createUppercasePi:()=>iU,createUsolve:()=>V5,createUsolveAll:()=>X5,createVacuumImpedance:()=>mU,createVariance:()=>Uw,createVarianceTransform:()=>CH,createVersion:()=>aU,createWeakMixingAngle:()=>kU,createWienDisplacement:()=>ZU,createXgcd:()=>Fk,createXor:()=>a4,createZeros:()=>J4,createZeta:()=>a5,createZpk2tf:()=>Lz});v();x();g();v();x();g();var pE=jr(xy(),1);v();x();g();function Nt(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}var Ua=Math.sign||function(e){return e>0?1:e<0?-1:0},YI=Math.log2||function(t){return Math.log(t)/Math.LN2},ZI=Math.log10||function(t){return Math.log(t)/Math.LN10},yy=Math.log1p||function(e){return Math.log(e+1)},XI=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},KI=Math.expm1||function(t){return t>=2e-4||t<=-2e-4?Math.exp(t)-1:t+t*t/2+t*t*t/6};function QS(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 Cs(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}=jS(t);switch(r){case"fixed":return eE(e,n);case"exponential":return JI(e,n);case"engineering":return vne(e,n);case"bin":return QS(e,2,i);case"oct":return QS(e,8,i);case"hex":return QS(e,16,i);case"auto":return gne(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 jS(e){var t="auto",r,n;if(e!==void 0)if(Ut(e))r=e;else if(_t(e))r=e.toNumber();else if(vu(e))e.precision!==void 0&&(r=VI(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),e.wordSize!==void 0&&(n=VI(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 fh(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 vne(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=fh(e),n=wy(r,t),i=n.exponent,o=n.coefficients,u=i%3===0?i:i<0?i-3-i%3:i-i%3;if(Ut(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=Ut(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 eE(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=fh(e),n=typeof t=="number"?wy(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 gne(e,t,r){if(isNaN(e)||!isFinite(e))return String(e);var n=GI(r?.lowerExp,-3),i=GI(r?.upperExp,5),o=fh(e),u=t?wy(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 lh(e){for(var t=[],r=0;r0?!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 VI(e,t){if(Ut(e))return e;if(_t(e))return e.toNumber();t()}function GI(e,t){return Ut(e)?e:_t(e)?e.toNumber():t}v();x();g();v();x();g();v();x();g();v();x();g();function tE(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 aF(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}=jS(t);switch(r){case"fixed":return wne(e,n);case"exponential":return iF(e,n);case"engineering":return yne(e,n);case"bin":return tE(e,2,i);case"oct":return tE(e,8,i);case"hex":return tE(e,16,i);case"auto":{var o=oF(t?.lowerExp,-3),u=oF(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 iF(e,t){return t!==void 0?e.toExponential(t-1):e.toExponential()}function wne(e,t){return e.toFixed(t)}function oF(e,t){return Ut(e)?e:_t(e)?e.toNumber():t}function uF(e,t){var r=e.length-t.length,n=e.length;return e.substring(r,n)===t}function Yt(e,t){var r=bne(e,t);return t&&typeof t=="object"&&"truncate"in t&&r.length>t.truncate?r.substring(0,t.truncate-3)+"...":r}function bne(e,t){if(typeof e=="number")return Cs(e,t);if(_t(e))return aF(e,t);if(Dne(e))return!t||t.fraction!=="decimal"?e.s*e.n+"/"+e.d:e.toString();if(Array.isArray(e))return lF(e,t);if(hn(e))return np(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=>np(n)+": "+Yt(e[n],t));return"{"+r.join(", ")+"}"}return String(e)}function np(e){for(var t=String(e),r="",n=0;n/g,">"),t}function lF(e,t){if(Array.isArray(e)){for(var r="[",n=e.length,i=0;it?1:-1}v();x();g();function Xt(e,t,r){if(!(this instanceof Xt))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}Xt.prototype=new RangeError;Xt.prototype.constructor=RangeError;Xt.prototype.name="DimensionError";Xt.prototype.isDimensionError=!0;v();x();g();function Si(e,t,r){if(!(this instanceof Si))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}Si.prototype=new RangeError;Si.prototype.constructor=RangeError;Si.prototype.name="IndexError";Si.prototype.isIndexError=!0;function Ht(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function fF(e,t,r){var n,i=e.length;if(i!==t[r])throw new Xt(i,t[r]);if(r")}function nE(e,t){var r=t.length===0;if(r){if(Array.isArray(e))throw new Xt(e.length,0)}else fF(e,t,0)}function bg(e,t){var r=e.isMatrix?e._size:Ht(e),n=t._sourceSize;n.forEach((i,o)=>{if(i!==null&&i!==r[o])throw new Xt(i,r[o])})}function Br(e,t){if(e!==void 0){if(!Ut(e)||!Nt(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof t=="number"&&e>=t)throw new Si(e,t)}}function ip(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 cF(e){return e.reduce((t,r)=>t*r,1)}function Nne(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 iE(e,t){return Array.prototype.join.call(e,t)}function sl(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 hF(r,n,t,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function Sne(){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 sE(e,t){var r=Ht(e);if(As(r,t))return e;Sg(r,t);var n=Sne(r,t),i=n.length,o=[...Array(i-r.length).fill(1),...r],u=Ane(e);r.length!Mne(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 Mne(e){return e&&e[0]==="?"}function uE(e){return e&&e[0]==="?"?e.slice(1):e}v();x();g();v();x();g();function un(e,t){if(xF(e)&&vF(e,t))return e[t];throw typeof e[t]=="function"&&Ay(e,t)?new Error('Cannot access method "'+t+'" as a property'):new Error('No access to property "'+t+'"')}function xu(e,t,r){if(xF(e)&&vF(e,t))return e[t]=r,r;throw new Error('No access to property "'+t+'"')}function dF(e,t){return t in e}function vF(e,t){return!e||typeof e!="object"?!1:Et(Tne,t)?!0:!(t in Object.prototype||t in Function.prototype)}function gF(e,t){if(!Ay(e,t))throw new Error('No access to method "'+t+'"');return e[t]}function Ay(e,t){return e==null||typeof e[t]!="function"||Et(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)?!1:Et(One,t)?!0:!(t in Object.prototype||t in Function.prototype)}function xF(e){return typeof e=="object"&&e&&e.constructor===Object}var Tne={length:!0,name:!0},One={toString:!0,valueOf:!0,toLocaleString:!0};var ap=class{constructor(t){this.wrappedObject=t,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(t){return un(this.wrappedObject,t)}set(t,r){return xu(this.wrappedObject,t,r),this}has(t){return dF(this.wrappedObject,t)}entries(){return yF(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}},hh=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 yF(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 yF(e,t){return{next:()=>{var r=e.next();return r.done?r:{value:t(r.value),done:!1}}}}function Ef(){return new Map}function ul(e){if(!e)return Ef();if(lE(e))return e;if(vu(e))return new ap(e);throw new Error("createMap can create maps from objects or Maps")}function wF(e){if(e instanceof ap)return e.wrappedObject;var t={};for(var r of e.keys()){var n=e.get(r);xu(t,r,n)}return t}function lE(e){return e?e instanceof Map||e instanceof ap||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}var bF=function(){return bF=pE.default.create,pE.default},Ine=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],DF=K("typed",Ine,function(t){var{BigNumber:r,Complex:n,DenseMatrix:i,Fraction:o}=t,u=bF();return u.clear(),u.addTypes([{name:"number",test:Ut},{name:"Complex",test:wi},{name:"BigNumber",test:_t},{name:"Fraction",test:pa},{name:"Unit",test:oi},{name:"identifier",test:l=>hn&&/^(?:[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-\u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0F49-\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\uFB40\uF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\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[\u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E22\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]|\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-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uF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D83-\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-\u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DE61\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]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(l)},{name:"string",test:hn},{name:"Chain",test:ah},{name:"Array",test:fr},{name:"Matrix",test:St},{name:"DenseMatrix",test:al},{name:"SparseMatrix",test:ma},{name:"Range",test:Df},{name:"Index",test:du},{name:"boolean",test:oy},{name:"ResultSet",test:ay},{name:"Help",test:oh},{name:"function",test:sy},{name:"Date",test:uy},{name:"RegExp",test:ly},{name:"null",test:fy},{name:"undefined",test:cy},{name:"AccessorNode",test:To},{name:"ArrayNode",test:bi},{name:"AssignmentNode",test:py},{name:"BlockNode",test:my},{name:"ConditionalNode",test:hy},{name:"ConstantNode",test:ir},{name:"FunctionNode",test:Ji},{name:"FunctionAssignmentNode",test:za},{name:"IndexNode",test:Ho},{name:"Node",test:lr},{name:"ObjectNode",test:gu},{name:"OperatorNode",test:Zr},{name:"ParenthesisNode",test:Di},{name:"RangeNode",test:dy},{name:"RelationalNode",test:vy},{name:"SymbolNode",test:Rr},{name:"Map",test:lE},{name:"Object",test:vu}]),u.addConversions([{from:"number",to:"BigNumber",convert:function(a){if(r||fE(a),QI(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||Cy(a),new n(a,0)}},{from:"BigNumber",to:"Complex",convert:function(a){return n||Cy(a),new n(a.toNumber(),0)}},{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||Cy(a),new n(a.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(a){o||cE(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||fE(a);try{return new r(a)}catch{throw new Error('Cannot convert "'+a+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(a){o||cE(a);try{return new o(a)}catch{throw new Error('Cannot convert "'+a+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(a){n||Cy(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||fE(a),new r(+a)}},{from:"boolean",to:"Fraction",convert:function(a){return o||cE(a),new o(+a)}},{from:"boolean",to:"string",convert:function(a){return String(a)}},{from:"Array",to:"Matrix",convert:function(a){return i||Fne(),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 fE(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function Cy(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function Fne(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function cE(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}v();x();g();var _ne="ResultSet",kne=[],NF=K(_ne,kne,()=>{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});v();x();g();v();x();g();var dh=9e15,Tf=1e9,mE="0123456789abcdef",Ty="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Oy="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",hE={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-dh,maxE:dh,crypto:!1},CF,ll,cr=!0,Fy="[DecimalError] ",Mf=Fy+"Invalid argument: ",MF=Fy+"Precision limit exceeded",TF=Fy+"crypto unavailable",OF="[object Decimal]",lo=Math.floor,Ei=Math.pow,Bne=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Lne=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Pne=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,IF=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Os=1e7,or=7,Rne=9007199254740991,qne=Ty.length-1,dE=Oy.length-1,gt={toStringTag:OF};gt.absoluteValue=gt.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),jt(e)};gt.ceil=function(){return jt(new this.constructor(this),this.e+1,2)};gt.clampedTo=gt.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(Mf+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};gt.comparedTo=gt.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};gt.cosine=gt.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())+or,n.rounding=1,r=zne(n,LF(n,r)),n.precision=e,n.rounding=t,jt(ll==2||ll==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};gt.cubeRoot=gt.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(cr=!1,o=f.s*Ei(f.s*f,1/3),!o||Math.abs(o)==1/0?(r=Qi(f.d),e=f.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=Ei(r,1/3),e=lo((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=ln(s.plus(f).times(l),s.plus(a),u+2,1),Qi(l.d).slice(0,u)===(r=Qi(n.d)).slice(0,u))if(r=r.slice(u-3,u+1),r=="9999"||!i&&r=="4999"){if(!i&&(jt(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")&&(jt(n,e+1,1),t=!n.times(n).times(n).eq(f));break}return cr=!0,jt(n,e,p.rounding,t)};gt.decimalPlaces=gt.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-lo(this.e/or))*or,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};gt.dividedBy=gt.div=function(e){return ln(this,new this.constructor(e))};gt.dividedToIntegerBy=gt.divToInt=function(e){var t=this,r=t.constructor;return jt(ln(t,new r(e),0,1,1),r.precision,r.rounding)};gt.equals=gt.eq=function(e){return this.cmp(e)===0};gt.floor=function(){return jt(new this.constructor(this),this.e+1,3)};gt.greaterThan=gt.gt=function(e){return this.cmp(e)>0};gt.greaterThanOrEqualTo=gt.gte=function(e){var t=this.cmp(e);return t==1||t===0};gt.hyperbolicCosine=gt.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/ky(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=vh(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 jt(o,u.precision=r,u.rounding=n,!0)};gt.hyperbolicSine=gt.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=vh(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/ky(5,e)),i=vh(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,jt(i,t,r,!0)};gt.hyperbolicTangent=gt.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,ln(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};gt.inverseCosine=gt.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()?Ts(r,i,o):new r(0):new r(NaN):t.isZero()?Ts(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=Ts(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};gt.inverseHyperbolicCosine=gt.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,cr=!1,r=r.times(r).minus(1).sqrt().plus(r),cr=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};gt.inverseHyperbolicSine=gt.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,cr=!1,r=r.times(r).plus(1).sqrt().plus(r),cr=!0,n.precision=e,n.rounding=t,r.ln())};gt.inverseHyperbolicTangent=gt.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?jt(new o(i),e,t,!0):(o.precision=r=n-i.e,i=ln(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)};gt.inverseSine=gt.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=Ts(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)))};gt.inverseTangent=gt.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<=dE)return u=Ts(f,p+4,h).times(.25),u.s=s.s,u}else{if(!s.s)return new f(NaN);if(p+4<=dE)return u=Ts(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/or+2|0),e=r;e;--e)s=s.div(s.times(s).plus(1).sqrt().plus(1));for(cr=!1,t=Math.ceil(l/or),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};gt.isNaN=function(){return!this.s};gt.isNegative=gt.isNeg=function(){return this.s<0};gt.isPositive=gt.isPos=function(){return this.s>0};gt.isZero=function(){return!!this.d&&this.d[0]===0};gt.lessThan=gt.lt=function(e){return this.cmp(e)<0};gt.lessThanOrEqualTo=gt.lte=function(e){return this.cmp(e)<1};gt.logarithm=gt.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(cr=!1,l=p+y,u=Cf(s,l),n=t?Iy(f,l+10):Cf(e,l),a=ln(u,n,l,1),Eg(a.d,i=p,h))do if(l+=10,u=Cf(s,l),n=t?Iy(f,l+10):Cf(e,l),a=ln(u,n,l,1),!o){+Qi(a.d).slice(i+1,i+15)+1==1e14&&(a=jt(a,p+1,0));break}while(Eg(a.d,i+=10,h));return cr=!0,jt(a,p,h)};gt.minus=gt.sub=function(e){var t,r,n,i,o,u,l,a,s,f,p,h,y=this,N=y.constructor;if(e=new N(e),!y.d||!e.d)return!y.s||!e.s?e=new N(NaN):y.d?e.s=-e.s:e=new N(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=N.precision,a=N.rounding,!s[0]||!h[0]){if(h[0])e.s=-e.s;else if(s[0])e=new N(y);else return new N(a===3?-0:0);return cr?jt(e,l,a):e}if(r=lo(e.e/or),f=lo(y.e/or),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/or),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)/Os|0,s[i]%=Os;for(t&&(s.unshift(t),++n),u=s.length;s[--u]==0;)s.pop();return e.d=s,e.e=_y(s,n),cr?jt(e,l,a):e};gt.precision=gt.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Mf+e);return r.d?(t=FF(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};gt.round=function(){var e=this,t=e.constructor;return jt(new t(e),e.e+1,t.rounding)};gt.sine=gt.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())+or,n.rounding=1,r=Hne(n,LF(n,r)),n.precision=e,n.rounding=t,jt(ll>2?r.neg():r,e,t,!0)):new n(NaN)};gt.squareRoot=gt.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(cr=!1,s=Math.sqrt(+u),s==0||s==1/0?(t=Qi(l),(t.length+a)%2==0&&(t+="0"),s=Math.sqrt(t),a=lo((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(ln(u,o,r+2,1)).times(.5),Qi(o.d).slice(0,r)===(t=Qi(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(jt(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")&&(jt(n,a+1,1),e=!n.times(n).eq(u));break}return cr=!0,jt(n,a,f.rounding,e)};gt.tangent=gt.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=ln(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,jt(ll==2||ll==4?r.neg():r,e,t,!0)):new n(NaN)};gt.times=gt.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=lo(f.e/or)+lo(e.e/or),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%Os|0,t=l/Os|0;o[i]=(o[i]+t)%Os|0}for(;!o[--u];)o.pop();return t?++r:o.shift(),e.d=o,e.e=_y(o,r),cr?jt(e,p.precision,p.rounding):e};gt.toBinary=function(e,t){return xE(this,2,e,t)};gt.toDecimalPlaces=gt.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Wo(e,0,Tf),t===void 0?t=n.rounding:Wo(t,0,8),jt(r,e+r.e+1,t))};gt.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=yu(n,!0):(Wo(e,0,Tf),t===void 0?t=i.rounding:Wo(t,0,8),n=jt(new i(n),e+1,t),r=yu(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};gt.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=yu(i):(Wo(e,0,Tf),t===void 0?t=o.rounding:Wo(t,0,8),n=jt(new o(i),e+i.e+1,t),r=yu(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};gt.toFraction=function(e){var t,r,n,i,o,u,l,a,s,f,p,h,y=this,N=y.d,w=y.constructor;if(!N)return new w(y);if(s=r=new w(1),n=a=new w(0),t=new w(n),o=t.e=FF(N)-y.e-1,u=o%or,t.d[0]=Ei(10,u<0?or+u:u),e==null)e=o>0?t:s;else{if(l=new w(e),!l.isInt()||l.lt(s))throw Error(Mf+l);e=l.gt(t)?o>0?t:s:l}for(cr=!1,l=new w(Qi(N)),f=w.precision,w.precision=o=N.length*or*2;p=ln(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=ln(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=ln(s,n,o,1).minus(y).abs().cmp(ln(a,r,o,1).minus(y).abs())<1?[s,n]:[a,r],w.precision=f,cr=!0,h};gt.toHexadecimal=gt.toHex=function(e,t){return xE(this,16,e,t)};gt.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:Wo(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]?(cr=!1,r=ln(r,e,0,t,1).times(e),cr=!0,jt(r)):(e.s=r.s,r=e),r};gt.toNumber=function(){return+this};gt.toOctal=function(e,t){return xE(this,8,e,t)};gt.toPower=gt.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(Ei(+l,s));if(l=new a(l),l.eq(1))return l;if(n=a.precision,o=a.rounding,e.eq(1))return jt(l,n,o);if(t=lo(e.e/or),t>=e.d.length-1&&(r=s<0?-s:s)<=Rne)return i=_F(a,l,r,n),e.s<0?new a(1).div(i):jt(i,n,o);if(u=l.s,u<0){if(ta.maxE+1||t0?u/0:0):(cr=!1,a.rounding=l.s=1,r=Math.min(12,(t+"").length),i=vE(e.times(Cf(l,n+r)),n),i.d&&(i=jt(i,n+5,1),Eg(i.d,n,o)&&(t=n+10,i=jt(vE(e.times(Cf(l,t+r)),t),t+5,1),+Qi(i.d).slice(n+1,n+15)+1==1e14&&(i=jt(i,n+1,0)))),i.s=u,cr=!0,a.rounding=o,jt(i,n,o))};gt.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=yu(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Wo(e,1,Tf),t===void 0?t=i.rounding:Wo(t,0,8),n=jt(new i(n),e,t),r=yu(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};gt.toSignificantDigits=gt.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Wo(e,1,Tf),t===void 0?t=n.rounding:Wo(t,0,8)),jt(new n(r),e,t)};gt.toString=function(){var e=this,t=e.constructor,r=yu(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};gt.truncated=gt.trunc=function(){return jt(new this.constructor(this),this.e+1,1)};gt.valueOf=gt.toJSON=function(){var e=this,t=e.constructor,r=yu(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Qi(e){var t,r,n,i=e.length-1,o="",u=e[0];if(i>0){for(o+=u,t=1;tr)throw Error(Mf+e)}function Eg(e,t,r,n){var i,o,u,l;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=or,i=0):(i=Math.ceil((t+1)/or),t%=or),o=Ei(10,or-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)==Ei(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)==Ei(10,t-3)-1,u}function My(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 zne(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/ky(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=vh(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 ln=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,N,w,D,b,O,M,I,F,C,P,R,q,z,H,V,W=n.constructor,ee=n.s==i.s?1:-1,ie=n.d,X=i.d;if(!ie||!ie[0]||!X||!X[0])return new W(!n.s||!i.s||(ie?X&&ie[0]==X[0]:!X)?NaN:ie&&ie[0]==0||!X?ee*0:ee/0);for(a?(y=1,f=n.e-i.e):(a=Os,y=or,f=lo(n.e/y)-lo(i.e/y)),H=X.length,q=ie.length,b=new W(ee),O=b.d=[],p=0;X[p]==(ie[p]||0);p++);if(X[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),N=!0;else{if(C=C/y+2|0,p=0,H==1){for(h=0,X=X[0],C++;(p1&&(X=e(X,h,a),ie=e(ie,h,a),H=X.length,q=ie.length),R=H,M=ie.slice(0,H),I=M.length;I=a/2&&++z;do h=0,s=t(X,M,H,I),s<0?(F=M[0],H!=I&&(F=F*a+(M[1]||0)),h=F/z|0,h>1?(h>=a&&(h=a-1),w=e(X,h,a),D=w.length,I=M.length,s=t(w,M,D,I),s==1&&(h--,r(w,H=10;h/=10)p++;b.e=p+f*y-1,jt(b,l?o+b.e+1:o,u,N)}return b}}();function jt(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+=or,u=t,f=p[h=0],a=f/Ei(10,i-u-1)%10|0;else if(h=Math.ceil((o+1)/or),l=p.length,h>=l)if(n){for(;l++<=h;)p.push(0);f=a=0,i=1,o%=or,u=o-or+1}else break e;else{for(f=l=p[h],i=1;l>=10;l/=10)i++;o%=or,u=o-or+i,a=u<0?0:f/Ei(10,i-u-1)%10|0}if(n=n||t<0||p[h+1]!==void 0||(u<0?f:f%Ei(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/Ei(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]=Ei(10,(or-t%or)%or),e.e=-t||0):p[0]=e.e=0,e;if(o==0?(p.length=h,l=1,h--):(p.length=h+1,l=Ei(10,or-o),p[h]=u>0?(f/Ei(10,i-u)%Ei(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]==Os&&(p[0]=1));break}else{if(p[h]+=l,p[h]!=Os)break;p[h--]=0,l=1}for(o=p.length;p[--o]===0;)p.pop()}return cr&&(e.e>y.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+Af(n):u>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Af(-i-1)+o,r&&(n=r-u)>0&&(o+=Af(n))):i>=u?(o+=Af(i+1-u),r&&(n=r-i-1)>0&&(o=o+"."+Af(n))):((n=i+1)0&&(i+1===u&&(o+="."),o+=Af(n))),o}function _y(e,t){var r=e[0];for(t*=or;r>=10;r/=10)t++;return t}function Iy(e,t,r){if(t>qne)throw cr=!0,r&&(e.precision=r),Error(MF);return jt(new e(Ty),t,1,!0)}function Ts(e,t,r){if(t>dE)throw Error(MF);return jt(new e(Oy),t,r,!0)}function FF(e){var t=e.length-1,r=t*or+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 Af(e){for(var t="";e--;)t+="0";return t}function _F(e,t,r,n){var i,o=new e(1),u=Math.ceil(n/or+4);for(cr=!1;;){if(r%2&&(o=o.times(t),EF(o.d,u)&&(i=!0)),r=lo(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),EF(t.d,u)}return cr=!0,o}function SF(e){return e.d[e.d.length-1]&1}function kF(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?(cr=!1,a=N):a=t,l=new h(.03125);e.e>-2;)e=e.times(l),p+=5;for(n=Math.log(Ei(2,p))/Math.LN10*2+5|0,a+=n,r=o=u=new h(1),h.precision=a;;){if(o=jt(o.times(e),a,1),r=r.times(++f),l=u.plus(ln(o,r,a,1)),Qi(l.d).slice(0,a)===Qi(u.d).slice(0,a)){for(i=p;i--;)u=jt(u.times(u),a,1);if(t==null)if(s<3&&Eg(u.d,a-n,y,s))h.precision=a+=10,r=o=l=new h(1),f=0,s++;else return jt(u,h.precision=N,y,cr=!0);else return h.precision=N,u}u=l}}function Cf(e,t){var r,n,i,o,u,l,a,s,f,p,h,y=1,N=10,w=e,D=w.d,b=w.constructor,O=b.rounding,M=b.precision;if(w.s<0||!D||!D[0]||!w.e&&D[0]==1&&D.length==1)return new b(D&&!D[0]?-1/0:w.s!=1?NaN:D?0:w);if(t==null?(cr=!1,f=M):f=t,b.precision=f+=N,r=Qi(D),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=Qi(w.d),n=r.charAt(0),y++;o=w.e,n>1?(w=new b("0."+r),o++):w=new b(n+"."+r.slice(1))}else return s=Iy(b,f+2,M).times(o+""),w=Cf(new b(n+"."+r.slice(1)),f-N).plus(s),b.precision=M,t==null?jt(w,M,O,cr=!0):w;for(p=w,a=u=w=ln(w.minus(1),w.plus(1),f,1),h=jt(w.times(w),f,1),i=3;;){if(u=jt(u.times(h),f,1),s=a.plus(ln(u,new b(i),f,1)),Qi(s.d).slice(0,f)===Qi(a.d).slice(0,f))if(a=a.times(2),o!==0&&(a=a.plus(Iy(b,f+2,M).times(o+""))),a=ln(a,new b(y),f,1),t==null)if(Eg(a.d,f-N,O,l))b.precision=f+=N,s=u=w=ln(p.minus(1),p.plus(1),f,1),h=jt(w.times(w),f,1),i=l=1;else return jt(a,b.precision=M,O,cr=!0);else return b.precision=M,a;a=s,i+=2}}function BF(e){return String(e.s*e.s/0)}function gE(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)%or,r<0&&(n+=or),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),IF.test(t))return gE(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Lne.test(t))r=16,t=t.toLowerCase();else if(Bne.test(t))r=2;else if(Pne.test(t))r=8;else throw Error(Mf+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=_F(n,new n(r),o,o*2)),s=My(t,r,Os),f=s.length-1,o=f;s[o]===0;--o)s.pop();return o<0?new n(e.s*0):(e.e=_y(s,f),e.d=s,cr=!1,u&&(e=ln(e,i,l*4)),a&&(e=e.times(Math.abs(a)<54?Ei(2,a):Ag.pow(2,a))),cr=!0,e)}function Hne(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:vh(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/ky(5,r)),t=vh(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 vh(e,t,r,n,i){var o,u,l,a,s=1,f=e.precision,p=Math.ceil(f/or);for(cr=!1,a=r.times(r),l=new e(n);;){if(u=ln(l.times(a),new e(t++*t++),f,1),l=i?n.plus(u):n.minus(u),n=ln(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 cr=!0,u.d.length=p+1,u}function ky(e,t){for(var r=e;--t;)r*=e;return r}function LF(e,t){var r,n=t.s<0,i=Ts(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return ll=n?4:1,t;if(r=t.divToInt(i),r.isZero())ll=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return ll=SF(r)?n?2:3:n?4:1,t;ll=SF(r)?n?1:4:n?3:2}return t.minus(i).abs()}function xE(e,t,r,n){var i,o,u,l,a,s,f,p,h,y=e.constructor,N=r!==void 0;if(N?(Wo(r,1,Tf),n===void 0?n=y.rounding:Wo(n,0,8)):(r=y.precision,n=y.rounding),!e.isFinite())f=BF(e);else{for(f=yu(e),u=f.indexOf("."),N?(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=My(yu(h),10,i),h.e=h.d.length),p=My(f,10,i),o=a=p.length;p[--a]==0;)p.pop();if(!p[0])f=N?"0p+0":"0";else{if(u<0?o--:(e=new y(e),e.d=p,e.e=o,e=ln(e,h,r,n,0,i),p=e.d,o=e.e,s=CF),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=My(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 $ne(e){return new this(e).abs()}function Wne(e){return new this(e).acos()}function Vne(e){return new this(e).acosh()}function Gne(e,t){return new this(e).plus(t)}function Yne(e){return new this(e).asin()}function Zne(e){return new this(e).asinh()}function Xne(e){return new this(e).atan()}function Kne(e){return new this(e).atanh()}function Jne(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=Ts(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?Ts(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=Ts(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(ln(e,t,o,1)),t=Ts(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(ln(e,t,o,1)),r}function Qne(e){return new this(e).cbrt()}function jne(e){return jt(e=new this(e),e.e+1,2)}function eie(e,t,r){return new this(e).clamp(t,r)}function tie(e){if(!e||typeof e!="object")throw Error(Fy+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Tf,"rounding",0,8,"toExpNeg",-dh,0,"toExpPos",0,dh,"maxE",0,dh,"minE",-dh,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Mf+r+": "+n);if(r="crypto",i&&(this[r]=hE[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(TF);else this[r]=!1;else throw Error(Mf+r+": "+n);return this}function rie(e){return new this(e).cos()}function nie(e){return new this(e).cosh()}function PF(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,AF(o)){s.s=o.s,cr?!o.d||o.e>i.maxE?(s.e=NaN,s.d=null):o.e=10;l/=10)u++;cr?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(TF);else for(;o=10;i/=10)n++;n{var{on:t,config:r}=e,n=sp.clone({precision:r.precision,modulo:sp.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});v();x();g();var Pi=jr(zF(),1);var Oie="Complex",Iie=[],UF=K(Oie,Iie,()=>(Object.defineProperty(Pi.default,"name",{value:"Complex"}),Pi.default.prototype.constructor=Pi.default,Pi.default.prototype.type="Complex",Pi.default.prototype.isComplex=!0,Pi.default.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},Pi.default.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},Pi.default.prototype.format=function(e){var t="",r=this.im,n=this.re,i=Cs(this.re,e),o=Cs(this.im,e),u=Ut(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.im(Object.defineProperty(wu.default,"name",{value:"Fraction"}),wu.default.prototype.constructor=wu.default,wu.default.prototype.type="Fraction",wu.default.prototype.isFraction=!0,wu.default.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},wu.default.fromJSON=function(e){return new wu.default(e)},wu.default),{isClass:!0});v();x();g();var kie="Range",Bie=[],VF=K(kie,Bie,()=>{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(_t(t))t=t.toNumber();else if(typeof t!="number")throw new TypeError("Parameter start must be a number")}if(o){if(_t(r))r=r.toNumber();else if(typeof r!="number")throw new TypeError("Parameter end must be a number")}if(u){if(_t(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 Ua(n)===Ua(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=Cs(this.start,t);return this.step!==1&&(r+=":"+Cs(this.step,t)),r+=":"+Cs(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});v();x();g();var Lie="Matrix",Pie=[],GF=K(Lie,Pie,()=>{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});v();x();g();v();x();g();v();x();g();function YF(e){var t=0,r=1,n=Object.create(null),i=Object.create(null),o=0,u=function(a){var s=i[a];if(s&&(delete n[s],delete i[a],--t,r===s)){if(!t){o=0,r=1;return}for(;!Object.prototype.hasOwnProperty.call(n,++r););}};return e=Math.abs(e),{hit:function(a){var s=i[a],f=++o;if(n[f]=a,i[a]=f,!s)return++t,t<=e?void 0:(a=n[r],u(a),a);if(delete n[s],r===s)for(;!Object.prototype.hasOwnProperty.call(n,++r););},delete:u,clear:function(){t=o=0,r=1,n=Object.create(null),i=Object.create(null)}}}function up(e){var{hasher:t,limit:r}=arguments.length>1&&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:YF(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&&!hn(p))throw new Error("Invalid datatype: "+p);if(St(f))f.type==="DenseMatrix"?(this._data=Bt(f._data),this._size=Bt(f._size),this._datatype=p||f._datatype):(this._data=f.toArray(),this._size=f.size(),this._datatype=p||f._datatype);else if(f&&fr(f.data)&&fr(f.size))this._data=f.data,this._size=f.size,nE(this._data,this._size),this._datatype=p||f.datatype;else if(fr(f))this._data=s(f),this._size=Ht(this._data),nE(this._data,this._size),this._datatype=p;else{if(f)throw new TypeError("Unsupported type of data ("+dr(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 Sf(this._data,dr)},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(!fr(f))throw new TypeError("Array expected");if(f.length!==this._size.length)throw new Xt(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=N.length,F=0;u(f._data,p,h,I,F)}return f}function u(f,p,h,y,N){var w=N===y-1,D=p.dimension(N);w?D.forEach(function(b,O){Br(b),f[b]=h[O[0]]}):D.forEach(function(b,O){Br(b),u(f[b],p,h[O[0]],y,N+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),N=h?this.clone():this;return l(N,y,p)};function l(f,p,h){if(p.length===0){for(var y=f._data;fr(y);)y=y[0];return y}return f._size=p.slice(0),f._data=Ms(f._data,f._size,h),f}r.prototype.reshape=function(f,p){var h=p?this.clone():this;h._data=Dg(h._data,f);var y=h._size.reduce((N,w)=>N*w);return h._size=Ng(f,y),h};function a(f,p,h){for(var y=f._size.slice(0),N=!1;y.lengthy[w]&&(y[w]=p[w],N=!0);N&&l(f,y,h)}r.prototype.clone=function(){var f=new r({data:Bt(this._data),size:Bt(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=By(f),y=function D(b,O){return fr(b)?b.map(function(M,I){return D(M,O.concat(I))}):h===1?f(b):h===2?f(b,O):f(b,O,p)},N=y(this._data,[]),w=this._datatype!==void 0?Sf(N,dr):void 0;return new r(N,w)},r.prototype.forEach=function(f){var p=this,h=function y(N,w){fr(N)?N.forEach(function(D,b){y(D,w.concat(b))}):f(N,w,p)};h(this._data,[])},r.prototype[Symbol.iterator]=function*(){var f=function*p(h,y){if(fr(h))for(var N=0;N[M[b]]);p.push(new r(O,f._datatype))},w=0;w0?f:0,h=f<0?-f:0,y=this._size[0],N=this._size[1],w=Math.min(y-h,N-p),D=[],b=0;b0?h:0,w=h<0?-h:0,D=f[0],b=f[1],O=Math.min(D-w,b-N),M;if(fr(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=_t(M(0))?M(0).mul(0):0);var F=[];if(f.length>0){F=Ms(F,f,y);for(var C=0;C{var{typed:t}=e;return t(XF,{any:Bt})});v();x();g();v();x();g();v();x();g();function Ly(e){var t=e.length,r=e[0].length,n,i,o=[];for(i=0;i=n.length)throw new Si(t,n.length);return St(e)?e.create(Py(e.valueOf(),t,r)):Py(e,t,r)}function Py(e,t,r){var n,i,o,u;if(t<=0)if(Array.isArray(e[0])){for(u=Ly(e),i=[],n=0;n{var{typed:t}=e;return t(JF,{number:Nt,BigNumber:function(n){return n.isInt()},Fraction:function(n){return n.d===1&&isFinite(n.n)},"Array | Matrix":t.referToSelf(r=>n=>Tt(n,r))})});v();x();g();v();x();g();var Vo="number",fl="number, number";function DE(e){return Math.abs(e)}DE.signature=Vo;function NE(e,t){return e+t}NE.signature=fl;function SE(e,t){return e-t}SE.signature=fl;function EE(e,t){return e*t}EE.signature=fl;function Hie(e,t){return e/t}Hie.signature=fl;function AE(e){return-e}AE.signature=Vo;function CE(e){return e}CE.signature=Vo;function gh(e){return XI(e)}gh.signature=Vo;function ME(e){return e*e*e}ME.signature=Vo;function TE(e){return Math.exp(e)}TE.signature=Vo;function OE(e){return KI(e)}OE.signature=Vo;function $ie(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}$ie.signature=fl;function IE(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)}IE.signature=fl;function jF(e,t){return t?Math.log(e)/Math.log(t):Math.log(e)}function FE(e){return ZI(e)}FE.signature=Vo;function _E(e){return YI(e)}_E.signature=Vo;function Wie(e){return yy(e)}Wie.signature=Vo;function Vie(e,t){return t===0?e:e-t*Math.floor(e/t)}Vie.signature=fl;function kE(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 Ry(e){return Ua(e)}Ry.signature=Vo;function Gie(e){return Math.sqrt(e)}Gie.signature=Vo;function BE(e){return e*e}BE.signature=Vo;function LE(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}LE.signature=fl;function PE(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}PE.signature=fl;function xh(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(eE(e,t))}function Yie(e){return Math.abs(e)}Yie.signature=Vo;v();x();g();var Zie="number",yh="number, number";function RE(e,t){if(!Nt(e)||!Nt(t))throw new Error("Integers expected in function bitAnd");return e&t}RE.signature=yh;function qE(e){if(!Nt(e))throw new Error("Integer expected in function bitNot");return~e}qE.signature=Zie;function zE(e,t){if(!Nt(e)||!Nt(t))throw new Error("Integers expected in function bitOr");return e|t}zE.signature=yh;function UE(e,t){if(!Nt(e)||!Nt(t))throw new Error("Integers expected in function bitXor");return e^t}UE.signature=yh;function HE(e,t){if(!Nt(e)||!Nt(t))throw new Error("Integers expected in function leftShift");return e<>t}$E.signature=yh;function WE(e,t){if(!Nt(e)||!Nt(t))throw new Error("Integers expected in function rightLogShift");return e>>>t}WE.signature=yh;v();x();g();v();x();g();function ha(e,t){if(t>1;return ha(e,r)*ha(r+1,t)}function VE(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:ha(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*Cg(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=lp[0];for(var u=1;u=1;n--)r+=i_[n]/(e+n);return QE+(e+.5)*Math.log(t)-t+Math.log(r)}Mg.signature="number";v();x();g();var Cn="number",Qie="number, number";function jie(e){return Math.acos(e)}jie.signature=Cn;function jE(e){return jI(e)}jE.signature=Cn;function eA(e){return Math.atan(1/e)}eA.signature=Cn;function tA(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}tA.signature=Cn;function rA(e){return Math.asin(1/e)}rA.signature=Cn;function nA(e){var t=1/e;return Math.log(t+Math.sqrt(t*t+1))}nA.signature=Cn;function iA(e){return Math.acos(1/e)}iA.signature=Cn;function oA(e){var t=1/e,r=Math.sqrt(t*t-1);return Math.log(r+t)}oA.signature=Cn;function eoe(e){return Math.asin(e)}eoe.signature=Cn;function aA(e){return eF(e)}aA.signature=Cn;function toe(e){return Math.atan(e)}toe.signature=Cn;function roe(e,t){return Math.atan2(e,t)}roe.signature=Qie;function sA(e){return tF(e)}sA.signature=Cn;function noe(e){return Math.cos(e)}noe.signature=Cn;function ioe(e){return by(e)}ioe.signature=Cn;function uA(e){return 1/Math.tan(e)}uA.signature=Cn;function lA(e){var t=Math.exp(2*e);return(t+1)/(t-1)}lA.signature=Cn;function fA(e){return 1/Math.sin(e)}fA.signature=Cn;function cA(e){return e===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*Ua(e)}cA.signature=Cn;function pA(e){return 1/Math.cos(e)}pA.signature=Cn;function mA(e){return 2/(Math.exp(e)+Math.exp(-e))}mA.signature=Cn;function ooe(e){return Math.sin(e)}ooe.signature=Cn;function hA(e){return rF(e)}hA.signature=Cn;function aoe(e){return Math.tan(e)}aoe.signature=Cn;function soe(e){return Dy(e)}soe.signature=Cn;v();x();g();var Tg="number";function uoe(e){return Nt(e)}uoe.signature=Tg;function dA(e){return e<0}dA.signature=Tg;function vA(e){return e>0}vA.signature=Tg;function gA(e){return e===0}gA.signature=Tg;function xA(e){return Number.isNaN(e)}xA.signature=Tg;var o_="isNegative",loe=["typed"],a_=K(o_,loe,e=>{var{typed:t}=e;return t(o_,{number:dA,BigNumber:function(n){return n.isNeg()&&!n.isZero()&&!n.isNaN()},Fraction:function(n){return n.s<0},Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Tt(n,r))})});v();x();g();var s_="isNumeric",foe=["typed"],u_=K(s_,foe,e=>{var{typed:t}=e;return t(s_,{"number | BigNumber | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":t.referToSelf(r=>n=>Tt(n,r))})});v();x();g();var l_="hasNumericValue",coe=["typed","isNumeric"],f_=K(l_,coe,e=>{var{typed:t,isNumeric:r}=e;return t(l_,{boolean:()=>!0,string:function(i){return i.trim().length>0&&!isNaN(Number(i))},any:function(i){return r(i)}})});v();x();g();var c_="isPositive",poe=["typed"],p_=K(c_,poe,e=>{var{typed:t}=e;return t(c_,{number:vA,BigNumber:function(n){return!n.isNeg()&&!n.isZero()&&!n.isNaN()},Fraction:function(n){return n.s>0&&n.n>0},Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Tt(n,r))})});v();x();g();var m_="isZero",moe=["typed"],h_=K(m_,moe,e=>{var{typed:t}=e;return t(m_,{number:gA,BigNumber:function(n){return n.isZero()},Complex:function(n){return n.re===0&&n.im===0},Fraction:function(n){return n.d===1&&n.n===0},Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Tt(n,r))})});v();x();g();var d_="isNaN",hoe=["typed"],v_=K(d_,hoe,e=>{var{typed:t}=e;return t(d_,{number:xA,BigNumber:function(n){return n.isNaN()},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=>Tt(n,r))})});v();x();g();var g_="typeOf",doe=["typed"],x_=K(g_,doe,e=>{var{typed:t}=e;return t(g_,{any:dr})});v();x();g();v();x();g();function ai(e,t,r){if(r==null)return e.eq(t);if(e.eq(t))return!0;if(e.isNaN()||t.isNaN())return!1;if(e.isFinite()&&t.isFinite()){var n=e.minus(t).abs();if(n.isZero())return!0;var i=e.constructor.max(e.abs(),t.abs());return n.lte(i.times(r))}return!1}v();x();g();function y_(e,t,r){return yn(e.re,t.re,r)&&yn(e.im,t.im,r)}v();x();g();var $a=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 qy="equalScalar",voe=["typed","config"],w_=K(qy,voe,e=>{var{typed:t,config:r}=e,n=$a({typed:t});return t(qy,{"boolean, boolean":function(o,u){return o===u},"number, number":function(o,u){return yn(o,u,r.epsilon)},"BigNumber, BigNumber":function(o,u){return o.eq(u)||ai(o,u,r.epsilon)},"Fraction, Fraction":function(o,u){return o.equals(u)},"Complex, Complex":function(o,u){return y_(o,u,r.epsilon)}},n)}),__e=K(qy,["typed","config"],e=>{var{typed:t,config:r}=e;return t(qy,{"number, number":function(i,o){return yn(i,o,r.epsilon)}})});v();x();g();var goe="SparseMatrix",xoe=["typed","equalScalar","Matrix"],b_=K(goe,xoe,e=>{var{typed:t,equalScalar:r,Matrix:n}=e;function i(w,D){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(D&&!hn(D))throw new Error("Invalid datatype: "+D);if(St(w))o(this,w,D);else if(w&&fr(w.index)&&fr(w.ptr)&&fr(w.size))this._values=w.values,this._index=w.index,this._ptr=w.ptr,this._size=w.size,this._datatype=D||w.datatype;else if(fr(w))u(this,w,D);else{if(w)throw new TypeError("Unsupported type of data ("+dr(w)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=D}}function o(w,D,b){D.type==="SparseMatrix"?(w._values=D._values?Bt(D._values):void 0,w._index=Bt(D._index),w._ptr=Bt(D._ptr),w._size=Bt(D._size),w._datatype=b||D._datatype):u(w,D.valueOf(),b||D._datatype)}function u(w,D,b){w._values=[],w._index=[],w._ptr=[],w._datatype=b;var O=D.length,M=0,I=r,F=0;if(hn(b)&&(I=t.find(r,[b,b])||r,F=t.convert(0,b)),O>0){var C=0;do{w._ptr.push(w._index.length);for(var P=0;P");if(M.length===1){var R=D.dimension(0);R.forEach(function(H,V){Br(H),w.set([H,0],b[V[0]],O)})}else{var q=D.dimension(0),z=D.dimension(1);q.forEach(function(H,V){Br(H),z.forEach(function(W,ee){Br(W),w.set([H,W],b[V[0]][ee[0]],O)})})}}return w}i.prototype.get=function(w){if(!fr(w))throw new TypeError("Array expected");if(w.length!==this._size.length)throw new Xt(w.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var D=w[0],b=w[1];Br(D,this._size[0]),Br(b,this._size[1]);var O=s(D,this._ptr[b],this._ptr[b+1],this._index);return OI-1||M>F-1)&&(h(this,Math.max(O+1,I),Math.max(M+1,F),b),I=this._size[0],F=this._size[1]),Br(O,I),Br(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(!Ut(I)||!Nt(I)||I<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Yt(O)+")")});var M=b?this.clone():this;return h(M,O[0],O[1],D)};function h(w,D,b,O){var M=O||0,I=r,F=0;hn(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,z,H;if(b>R){for(z=R;zP){if(C){var V=0;for(z=0;zD-1&&(w._values.splice(H,1),w._index.splice(H,1),ee++)}w._ptr[z]=w._values.length}return w._size[0]=D,w._size[1]=b,w}i.prototype.reshape=function(w,D){if(!fr(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(!Ut(re)||!Nt(re)||re<=-2||re===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+Yt(w)+")")});var b=this._size[0]*this._size[1];w=Ng(w,b);var O=w[0]*w[1];if(b!==O)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var M=D?this.clone():this;if(this._size[0]===w[0]&&this._size[1]===w[1])return M;for(var I=[],F=0;F=D&&X<=b&&H(w._values[ie],X-D,V-O)}else{for(var Z={},le=W;le{"use strict";v();x();g();dj.exports=hj()});var Uu=dt(Li=>{"use strict";v();x();g();Object.defineProperty(Li,"__esModule",{value:!0});Li.intervalsOverlap=Li.hasInterval=Li.hasValue=Li.zeroIn=Li.isSingleton=Li.isWhole=Li.isEmpty=Li.isInterval=void 0;function xDe(e){return typeof e=="object"&&typeof e.lo=="number"&&typeof e.hi=="number"}Li.isInterval=xDe;function Sd(e){return e.lo>e.hi}Li.isEmpty=Sd;function yDe(e){return e.lo===-1/0&&e.hi===1/0}Li.isWhole=yDe;function wDe(e){return e.lo===e.hi}Li.isSingleton=wDe;function bDe(e){return gj(e,0)}Li.zeroIn=bDe;function gj(e,t){return Sd(e)?!1:e.lo<=t&&t<=e.hi}Li.hasValue=gj;function DDe(e,t){return Sd(e)?!0:!Sd(t)&&t.lo<=e.lo&&e.hi<=t.hi}Li.hasInterval=DDe;function NDe(e,t){return Sd(e)||Sd(t)?!1:e.lo<=t.lo&&t.lo<=e.hi||t.lo<=e.lo&&e.lo<=t.hi}Li.intervalsOverlap=NDe});var xj=dt((hxr,Jn)=>{v();x();g();var R3=!1;if(typeof Float64Array<"u")if(Zs=new Float64Array(1),ko=new Uint32Array(Zs.buffer),Zs[0]=1,R3=!0,ko[1]===1072693248){let e=function(n,i){return ko[0]=n,ko[1]=i,Zs[0]},t=function(n){return Zs[0]=n,ko[0]},r=function(n){return Zs[0]=n,ko[1]};EDe=e,SDe=t,ADe=r,Jn.exports=function(i){return Zs[0]=i,[ko[0],ko[1]]},Jn.exports.pack=e,Jn.exports.lo=t,Jn.exports.hi=r}else if(ko[0]===1072693248){let e=function(n,i){return ko[1]=n,ko[0]=i,Zs[0]},t=function(n){return Zs[0]=n,ko[1]},r=function(n){return Zs[0]=n,ko[0]};CDe=e,MDe=t,TDe=r,Jn.exports=function(i){return Zs[0]=i,[ko[1],ko[0]]},Jn.exports.pack=e,Jn.exports.lo=t,Jn.exports.hi=r}else R3=!1;var Zs,ko,EDe,SDe,ADe,CDe,MDe,TDe;if(!R3){let e=function(n,i){return Xs.writeUInt32LE(n,0,!0),Xs.writeUInt32LE(i,4,!0),Xs.readDoubleLE(0,!0)},t=function(n){return Xs.writeDoubleLE(n,0,!0),Xs.readUInt32LE(0,!0)},r=function(n){return Xs.writeDoubleLE(n,0,!0),Xs.readUInt32LE(4,!0)};ODe=e,IDe=t,FDe=r,Xs=new k(8),Jn.exports=function(i){return Xs.writeDoubleLE(i,0,!0),[Xs.readUInt32LE(0,!0),Xs.readUInt32LE(4,!0)]},Jn.exports.pack=e,Jn.exports.lo=t,Jn.exports.hi=r}var Xs,ODe,IDe,FDe;Jn.exports.sign=function(e){return Jn.exports.hi(e)>>>31};Jn.exports.exponent=function(e){var t=Jn.exports.hi(e);return(t<<1>>>21)-1023};Jn.exports.fraction=function(e){var t=Jn.exports.lo(e),r=Jn.exports.hi(e),n=r&(1<<20)-1;return r&2146435072&&(n+=1<<20),[t,n]};Jn.exports.denormalized=function(e){var t=Jn.exports.hi(e);return!(t&2146435072)}});var Dj=dt((xxr,bj)=>{"use strict";v();x();g();var q3=xj(),yj=Math.pow(2,-1074),wj=-1>>>0;bj.exports=_De;function _De(e,t){if(isNaN(e)||isNaN(t))return NaN;if(e===t)return e;if(e===0)return t<0?-yj:yj;var r=q3.hi(e),n=q3.lo(e);return t>e==e>0?n===wj?(r+=1,n=0):n+=1:n===0?(n=wj,r-=1):n-=1,q3.pack(n,r)}});var ql=dt(G0=>{"use strict";v();x();g();var kDe=G0&&G0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(G0,"__esModule",{value:!0});var Ej=kDe(Dj());function BDe(e){return e}function z3(e){return e===1/0?e:(0,Ej.default)(e,-1/0)}function U3(e){return e===-1/0?e:(0,Ej.default)(e,1/0)}function Nj(e){return e<0?Math.ceil(e):Math.floor(e)}var Ad={prev:z3,next:U3},wr={safePrev:z3,safeNext:U3,prev(e){return Ad.prev(e)},next(e){return Ad.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 Nj(wr.prev(e))},intHi(e){return Nj(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(){Ad.next=Ad.prev=BDe},enable(){Ad.next=U3,Ad.prev=z3}};G0.default=wr});var jf=dt(Zo=>{"use strict";v();x();g();var LDe=Zo&&Zo.__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]}),PDe=Zo&&Zo.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),RDe=Zo&&Zo.__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)&&LDe(t,e,r);return PDe(t,e),t},qDe=Zo&&Zo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zo,"__esModule",{value:!0});Zo.Interval=Zo._Interval=void 0;var zD=RDe(Uu()),Cd=qDe(ql()),UD=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(zD.isInterval(t)){if(!zD.isSingleton(t))throw new TypeError("Interval: interval `lo` must be a singleton");t=t.lo}if(zD.isInterval(r)){if(!zD.isSingleton(r))throw TypeError("Interval: interval `hi` must be a singleton");r=r.hi}}else{if(typeof t<"u")return Array.isArray(t)?new Md(t[0],t[1]):new Md(t,t);t=r=0}this.assign(t,r)}singleton(t){return this.set(t,t)}bounded(t,r){return this.set(Cd.default.prev(t),Cd.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(Cd.default.safeNext(t),Cd.default.safePrev(r))}halfOpenLeft(t,r){return this.assign(Cd.default.safeNext(t),r)}halfOpenRight(t,r){return this.assign(t,Cd.default.safePrev(r))}toArray(){return[this.lo,this.hi]}clone(){return new Md().set(this.lo,this.hi)}};Zo._Interval=UD;function zDe(e){function t(){for(var r=arguments.length,n=Array(r),i=0;i{"use strict";v();x();g();var UDe=Z0&&Z0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Z0,"__esModule",{value:!0});var ec=jf(),Sj=UDe(ql()),HD=(3373259426+273688/(1<<21))/(1<<30),$D=(3373259426+273689/(1<<21))/(1<<30),Y0={PI_LOW:HD,PI_HIGH:$D,PI_HALF_LOW:HD/2,PI_HALF_HIGH:$D/2,PI_TWICE_LOW:HD*2,PI_TWICE_HIGH:$D*2,get E(){return new ec.Interval(Sj.default.prev(Math.E),Sj.default.next(Math.E))},get PI(){return new ec.Interval(HD,$D)},get PI_HALF(){return new ec.Interval(Y0.PI_HALF_LOW,Y0.PI_HALF_HIGH)},get PI_TWICE(){return new ec.Interval(Y0.PI_TWICE_LOW,Y0.PI_TWICE_HIGH)},get ZERO(){return new ec.Interval(0)},get ONE(){return new ec.Interval(1)},get WHOLE(){return new ec.Interval().setWhole()},get EMPTY(){return new ec.Interval().setEmpty()}};Z0.default=Y0});var H3=dt(Hr=>{"use strict";v();x();g();var HDe=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]}),$De=Hr&&Hr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),WDe=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)&&HDe(t,e,r);return $De(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 Xo=WDe(Uu());function VDe(e,t){return Xo.isEmpty(e)?Xo.isEmpty(t):!Xo.isEmpty(t)&&e.lo===t.lo&&e.hi===t.hi}Hr.equal=VDe;var GDe=1e-7;function WD(e,t){if(!e)throw new Error(t||"assertion failed")}function Aj(e,t){if(!isFinite(e))return WD(e===t,`[Infinity] expected ${e} to be ${t}`);WD(Math.abs(e-t)t.hi}Hr.notEqual=ZDe;function Mj(e,t){return Xo.isEmpty(e)||Xo.isEmpty(t)?!1:e.hit.hi}Hr.greaterThan=Tj;Hr.gt=Tj;function Oj(e,t){return Xo.isEmpty(e)||Xo.isEmpty(t)?!1:e.hi<=t.lo}Hr.lessEqualThan=Oj;Hr.leq=Oj;function Ij(e,t){return Xo.isEmpty(e)||Xo.isEmpty(t)?!1:e.lo>=t.hi}Hr.greaterEqualThan=Ij;Hr.geq=Ij});var kj=dt(Pi=>{"use strict";v();x();g();var XDe=Pi&&Pi.__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]}),KDe=Pi&&Pi.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),JDe=Pi&&Pi.__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)&&XDe(t,e,r);return KDe(t,e),t},Fj=Pi&&Pi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pi,"__esModule",{value:!0});Pi.zero=Pi.negative=Pi.positive=Pi.nonZero=void 0;var X0=jf(),yo=Fj(ql()),_j=JDe(Uu()),$3=Fj(Kp());function QDe(e,t){let r=e.lo,n=e.hi,i=t.lo,o=t.hi,u=new X0.Interval;return n<0?o<0?(u.lo=yo.default.divLo(n,i),u.hi=yo.default.divHi(r,o)):(u.lo=yo.default.divLo(r,i),u.hi=yo.default.divHi(n,o)):r<0?o<0?(u.lo=yo.default.divLo(n,o),u.hi=yo.default.divHi(r,o)):(u.lo=yo.default.divLo(r,i),u.hi=yo.default.divHi(n,i)):o<0?(u.lo=yo.default.divLo(n,o),u.hi=yo.default.divHi(r,i)):(u.lo=yo.default.divLo(r,o),u.hi=yo.default.divHi(n,i)),u}Pi.nonZero=QDe;function jDe(e,t){return e.lo===0&&e.hi===0?e:_j.zeroIn(e)?$3.default.WHOLE:e.hi<0?new X0.Interval(Number.NEGATIVE_INFINITY,yo.default.divHi(e.hi,t)):new X0.Interval(yo.default.divLo(e.lo,t),Number.POSITIVE_INFINITY)}Pi.positive=jDe;function eNe(e,t){return e.lo===0&&e.hi===0?e:_j.zeroIn(e)?$3.default.WHOLE:e.hi<0?new X0.Interval(yo.default.divLo(e.hi,t),Number.POSITIVE_INFINITY):new X0.Interval(Number.NEGATIVE_INFINITY,yo.default.divHi(e.lo,t))}Pi.negative=eNe;function tNe(e){return e.lo===0&&e.hi===0?e:$3.default.WHOLE}Pi.zero=tNe});var Td=dt(an=>{"use strict";v();x();g();var rNe=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]}),nNe=an&&an.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Bj=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)&&rNe(t,e,r);return nNe(t,e),t},Lj=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 J0=jf(),In=Lj(ql()),W3=Lj(Kp()),K0=Bj(Uu()),VD=Bj(kj());function iNe(e,t){return new J0.Interval(In.default.addLo(e.lo,t.lo),In.default.addHi(e.hi,t.hi))}an.add=iNe;function Pj(e,t){return new J0.Interval(In.default.subLo(e.lo,t.hi),In.default.subHi(e.hi,t.lo))}an.subtract=Pj;an.sub=Pj;function Rj(e,t){if(K0.isEmpty(e)||K0.isEmpty(t))return W3.default.EMPTY;let r=e.lo,n=e.hi,i=t.lo,o=t.hi,u=new J0.Interval;return r<0?n>0?i<0?o>0?(u.lo=Math.min(In.default.mulLo(r,o),In.default.mulLo(n,i)),u.hi=Math.max(In.default.mulHi(r,i),In.default.mulHi(n,o))):(u.lo=In.default.mulLo(n,i),u.hi=In.default.mulHi(r,i)):o>0?(u.lo=In.default.mulLo(r,o),u.hi=In.default.mulHi(n,o)):(u.lo=0,u.hi=0):i<0?o>0?(u.lo=In.default.mulLo(r,o),u.hi=In.default.mulHi(r,i)):(u.lo=In.default.mulLo(n,o),u.hi=In.default.mulHi(r,i)):o>0?(u.lo=In.default.mulLo(r,o),u.hi=In.default.mulHi(n,i)):(u.lo=0,u.hi=0):n>0?i<0?o>0?(u.lo=In.default.mulLo(n,i),u.hi=In.default.mulHi(n,o)):(u.lo=In.default.mulLo(n,i),u.hi=In.default.mulHi(r,o)):o>0?(u.lo=In.default.mulLo(r,i),u.hi=In.default.mulHi(n,o)):(u.lo=0,u.hi=0):(u.lo=0,u.hi=0),u}an.multiply=Rj;an.mul=Rj;function qj(e,t){return K0.isEmpty(e)||K0.isEmpty(t)?W3.default.EMPTY:K0.zeroIn(t)?t.lo!==0?t.hi!==0?VD.zero(e):VD.negative(e,t.lo):t.hi!==0?VD.positive(e,t.hi):W3.default.EMPTY:VD.nonZero(e,t)}an.divide=qj;an.div=qj;function oNe(e){return new J0.Interval(e.lo,e.hi)}an.positive=oNe;function aNe(e){return new J0.Interval(-e.hi,-e.lo)}an.negative=aNe});var GD=dt(ci=>{"use strict";v();x();g();var sNe=ci&&ci.__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]}),uNe=ci&&ci.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Uj=ci&&ci.__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)&&sNe(t,e,r);return uNe(t,e),t},Hj=ci&&ci.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ci,"__esModule",{value:!0});ci.nthRoot=ci.sqrt=ci.pow=ci.multiplicativeInverse=ci.fmod=void 0;var Na=jf(),to=Hj(ql()),ss=Hj(Kp()),tc=Uj(Uu()),zj=Uj(Td());function lNe(e,t){if(tc.isEmpty(e)||tc.isEmpty(t))return ss.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),zj.sub(e,zj.mul(t,new Na.Interval(n)))}ci.fmod=lNe;function $j(e){return tc.isEmpty(e)?ss.default.EMPTY:tc.zeroIn(e)?e.lo!==0?e.hi!==0?ss.default.WHOLE:new Na.Interval(Number.NEGATIVE_INFINITY,to.default.divHi(1,e.lo)):e.hi!==0?new Na.Interval(to.default.divLo(1,e.hi),Number.POSITIVE_INFINITY):ss.default.EMPTY:new Na.Interval(to.default.divLo(1,e.hi),to.default.divHi(1,e.lo))}ci.multiplicativeInverse=$j;function Wj(e,t){if(tc.isEmpty(e))return ss.default.EMPTY;if(typeof t=="object"){if(!tc.isSingleton(t))return ss.default.EMPTY;t=t.lo}if(t===0)return e.lo===0&&e.hi===0?ss.default.EMPTY:ss.default.ONE;if(t<0)return Wj($j(e),-t);if(Number.isSafeInteger(t))if(e.hi<0){let r=to.default.powLo(-e.hi,t),n=to.default.powHi(-e.lo,t);return(t&1)===1?new Na.Interval(-n,-r):new Na.Interval(r,n)}else return e.lo<0?(t&1)===1?new Na.Interval(-to.default.powLo(-e.lo,t),to.default.powHi(e.hi,t)):new Na.Interval(0,to.default.powHi(Math.max(-e.lo,e.hi),t)):new Na.Interval(to.default.powLo(e.lo,t),to.default.powHi(e.hi,t));else return console.warn("power is not an integer, you should use nth-root instead, returning an empty interval"),ss.default.EMPTY}ci.pow=Wj;function fNe(e){return Vj(e,2)}ci.sqrt=fNe;function Vj(e,t){if(tc.isEmpty(e)||t<0)return ss.default.EMPTY;if(typeof t=="object"){if(!tc.isSingleton(t))return ss.default.EMPTY;t=t.lo}let r=1/t;if(e.hi<0){if(Number.isSafeInteger(t)&&(t&1)===1){let n=to.default.powHi(-e.lo,r),i=to.default.powLo(-e.hi,r);return new Na.Interval(-n,-i)}return ss.default.EMPTY}else if(e.lo<0){let n=to.default.powHi(e.hi,r);if(Number.isSafeInteger(t)&&(t&1)===1){let i=-to.default.powHi(-e.lo,r);return new Na.Interval(i,n)}return new Na.Interval(0,n)}else return new Na.Interval(to.default.powLo(e.lo,r),to.default.powHi(e.hi,r))}ci.nthRoot=Vj});var YD=dt(mr=>{"use strict";v();x();g();var cNe=mr&&mr.__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]}),pNe=mr&&mr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Gj=mr&&mr.__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)&&cNe(t,e,r);return pNe(t,e),t},Yj=mr&&mr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mr,"__esModule",{value:!0});mr.clone=mr.min=mr.max=mr.abs=mr.wid=mr.width=mr.difference=mr.union=mr.intersection=mr.hull=mr.log2=mr.LOG_EXP_2=mr.log10=mr.LOG_EXP_10=mr.ln=mr.log=mr.exp=void 0;var Ea=jf(),Q0=Yj(ql()),us=Yj(Kp()),Si=Gj(Uu()),V3=Gj(Td());function mNe(e){return Si.isEmpty(e)?us.default.EMPTY:new Ea.Interval(Q0.default.expLo(e.lo),Q0.default.expHi(e.hi))}mr.exp=mNe;function Od(e){if(Si.isEmpty(e))return us.default.EMPTY;let t=e.lo<=0?Number.NEGATIVE_INFINITY:Q0.default.logLo(e.lo);return new Ea.Interval(t,Q0.default.logHi(e.hi))}mr.log=Od;mr.ln=Od;mr.LOG_EXP_10=Od(new Ea.Interval(10,10));function hNe(e){return Si.isEmpty(e)?us.default.EMPTY:V3.div(Od(e),mr.LOG_EXP_10)}mr.log10=hNe;mr.LOG_EXP_2=Od(new Ea.Interval(2,2));function dNe(e){return Si.isEmpty(e)?us.default.EMPTY:V3.div(Od(e),mr.LOG_EXP_2)}mr.log2=dNe;function vNe(e,t){let r=Si.isEmpty(e),n=Si.isEmpty(t);return r&&n?us.default.EMPTY:r?t.clone():n?e.clone():new Ea.Interval(Math.min(e.lo,t.lo),Math.max(e.hi,t.hi))}mr.hull=vNe;function gNe(e,t){if(Si.isEmpty(e)||Si.isEmpty(t))return us.default.EMPTY;let r=Math.max(e.lo,t.lo),n=Math.min(e.hi,t.hi);return r<=n?new Ea.Interval(r,n):us.default.EMPTY}mr.intersection=gNe;function xNe(e,t){if(!Si.intervalsOverlap(e,t))throw Error("Interval#union: intervals do not overlap");return new Ea.Interval(Math.min(e.lo,t.lo),Math.max(e.hi,t.hi))}mr.union=xNe;function yNe(e,t){if(Si.isEmpty(e)||Si.isWhole(t))return us.default.EMPTY;if(Si.intervalsOverlap(e,t)){if(e.lo=e.hi&&t.lo===-1/0?us.default.EMPTY:t.lo<=e.lo?new Ea.Interval().halfOpenLeft(t.hi,e.hi):new Ea.Interval().halfOpenRight(e.lo,t.lo)}return e.clone()}mr.difference=yNe;function Zj(e){return Si.isEmpty(e)?0:Q0.default.subHi(e.hi,e.lo)}mr.width=Zj;mr.wid=Zj;function wNe(e){return Si.isEmpty(e)||Si.isWhole(e)?us.default.EMPTY:e.lo>=0?e.clone():e.hi<=0?V3.negative(e):new Ea.Interval(0,Math.max(-e.lo,e.hi))}mr.abs=wNe;function bNe(e,t){let r=Si.isEmpty(e),n=Si.isEmpty(t);return r&&n?us.default.EMPTY:r?t.clone():n?e.clone():new Ea.Interval(Math.max(e.lo,t.lo),Math.max(e.hi,t.hi))}mr.max=bNe;function DNe(e,t){let r=Si.isEmpty(e),n=Si.isEmpty(t);return r&&n?us.default.EMPTY:r?t.clone():n?e.clone():new Ea.Interval(Math.min(e.lo,t.lo),Math.min(e.hi,t.hi))}mr.min=DNe;function NNe(e){return new Ea.Interval().set(e.lo,e.hi)}mr.clone=NNe});var Z3=dt(sn=>{"use strict";v();x();g();var ENe=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]}),SNe=sn&&sn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),XD=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)&&ENe(t,e,r);return SNe(t,e),t},Xj=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 Bo=jf(),Ai=Xj(ql()),Dn=Xj(Kp()),zl=XD(Uu()),ZD=XD(Td()),Kj=XD(GD()),ANe=XD(YD());function G3(e){return!isFinite(e.lo)&&e.lo===e.hi}function Jj(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 Y3(e){if(zl.isEmpty(e)||G3(e))return Dn.default.EMPTY;let t=new Bo.Interval().set(e.lo,e.hi);Jj(t);let r=Dn.default.PI_TWICE,n=Kj.fmod(t,r);if(ANe.width(n)>=r.lo)return new Bo.Interval(-1,1);if(n.lo>=Dn.default.PI_HIGH){let a=Y3(ZD.sub(n,Dn.default.PI));return ZD.negative(a)}let i=n.lo,o=n.hi,u=Ai.default.cosLo(o),l=Ai.default.cosHi(i);return o<=Dn.default.PI_LOW?new Bo.Interval(u,l):o<=r.lo?new Bo.Interval(-1,Math.max(u,l)):new Bo.Interval(-1,1)}sn.cos=Y3;function CNe(e){return zl.isEmpty(e)||G3(e)?Dn.default.EMPTY:Y3(ZD.sub(e,Dn.default.PI_HALF))}sn.sin=CNe;function MNe(e){if(zl.isEmpty(e)||G3(e))return Dn.default.EMPTY;let t=new Bo.Interval().set(e.lo,e.hi);Jj(t);let r=Dn.default.PI,n=Kj.fmod(t,r);return n.lo>=Dn.default.PI_HALF_LOW&&(n=ZD.sub(n,r)),n.lo<=-Dn.default.PI_HALF_LOW||n.hi>=Dn.default.PI_HALF_LOW?Dn.default.WHOLE:new Bo.Interval(Ai.default.tanLo(n.lo),Ai.default.tanHi(n.hi))}sn.tan=MNe;function TNe(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:Ai.default.asinLo(e.lo),r=e.hi>=1?Dn.default.PI_HALF_HIGH:Ai.default.asinHi(e.hi);return new Bo.Interval(t,r)}sn.asin=TNe;function ONe(e){if(zl.isEmpty(e)||e.hi<-1||e.lo>1)return Dn.default.EMPTY;let t=e.hi>=1?0:Ai.default.acosLo(e.hi),r=e.lo<=-1?Dn.default.PI_HIGH:Ai.default.acosHi(e.lo);return new Bo.Interval(t,r)}sn.acos=ONe;function INe(e){return zl.isEmpty(e)?Dn.default.EMPTY:new Bo.Interval(Ai.default.atanLo(e.lo),Ai.default.atanHi(e.hi))}sn.atan=INe;function FNe(e){return zl.isEmpty(e)?Dn.default.EMPTY:new Bo.Interval(Ai.default.sinhLo(e.lo),Ai.default.sinhHi(e.hi))}sn.sinh=FNe;function _Ne(e){return zl.isEmpty(e)?Dn.default.EMPTY:e.hi<0?new Bo.Interval(Ai.default.coshLo(e.hi),Ai.default.coshHi(e.lo)):e.lo>=0?new Bo.Interval(Ai.default.coshLo(e.lo),Ai.default.coshHi(e.hi)):new Bo.Interval(1,Ai.default.coshHi(-e.lo>e.hi?e.lo:e.hi))}sn.cosh=_Ne;function kNe(e){return zl.isEmpty(e)?Dn.default.EMPTY:new Bo.Interval(Ai.default.tanhLo(e.lo),Ai.default.tanhHi(e.hi))}sn.tanh=kNe});var ree=dt(Nn=>{"use strict";v();x();g();var Qj=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]}),BNe=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Id=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)&&Qj(t,e,r);return BNe(t,e),t},Fd=Nn&&Nn.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Qj(t,e,r)},jj=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 eee=jf();Object.defineProperty(Nn,"Interval",{enumerable:!0,get:function(){return eee._Interval}});var X3=jj(ql());Nn.round=X3.default;var tee=jj(Kp());Nn.constants=tee.default;var LNe=Id(H3()),PNe=Id(Td()),RNe=Id(GD()),qNe=Id(Z3()),zNe=Id(YD()),UNe=Id(Uu()),HNe=Object.assign(eee.Interval,tee.default,X3.default,zNe,UNe,LNe,PNe,RNe,qNe,{round:X3.default});Nn.default=HNe;Fd(H3(),Nn);Fd(Td(),Nn);Fd(GD(),Nn);Fd(Z3(),Nn);Fd(YD(),Nn);Fd(Uu(),Nn)});var iee=dt((uyr,nee)=>{"use strict";v();x();g();nee.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 aee=dt((pyr,oee)=>{"use strict";v();x();g();oee.exports=function(e){return{disableRounding:function(){e.round.disable()},enableRounding:function(){e.round.enable()}}}});var see=dt((vyr,KD)=>{"use strict";v();x();g();var $Ne=vj(),_d=ree().default;iee()(_d);function WNe(e){Object.keys(e).forEach(function(t){let r=e[t];typeof r=="number"||Array.isArray(r)?e[t]=_d.factory(r):typeof r=="object"&&"lo"in r&&"hi"in r&&(e[t]=_d.factory(r.lo,r.hi))})}KD.exports=function(e){return new $Ne().setDefs({$$processScope:WNe}).parse(e).compile(_d)};KD.exports.policies=aee()(_d);KD.exports.Interval=_d});var K3=dt((wyr,uee)=>{"use strict";v();x();g();uee.exports=see()});var nc=dt(rc=>{"use strict";v();x();g();var lee=rc&&rc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rc,"__esModule",{value:!0});rc.interval=rc.builtIn=void 0;var VNe=lee(HQ()),GNe=lee(K3()),fee={interval:GNe.default,builtIn:VNe.default};function YNe(){return typeof global=="object"&&"math"in global?global.math:typeof window=="object"&&"math"in window?window.math:null}var J3=YNe();J3&&(fee.builtIn=J3.compile);function cee(e){function t(o){if(typeof o=="string"){let u=fee[e](o);return J3&&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 ZNe=cee("builtIn");rc.builtIn=ZNe;var XNe=cee("interval");rc.interval=XNe});var dee=dt(j0=>{"use strict";v();x();g();var hee=j0&&j0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(j0,"__esModule",{value:!0});var KNe=(Kg(),An(Xg)),JNe=(Kn(),An(Gs)),Jp=hee(zu()),pee=hee(Ed()),mee=nc();function QNe(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,KNe.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,JNe.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),N=e.owner.meta,w=y.datum().data,D=N.xScale,b=N.yScale,O=N.width,M=N.height,I=l.x,F=l.y;for(a=0;aC[0]-pee.default.TIP_X_EPS&&I{"use strict";v();x();g();var jNe=Ks&&Ks.__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]}),eEe=Ks&&Ks.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),tEe=Ks&&Ks.__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)&&jNe(t,e,r);return eEe(t,e),t},rEe=Ks&&Ks.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ks,"__esModule",{value:!0});var Qp=tEe(K3()),vee=nc(),nEe=rEe(zu());Qp.default.policies.disableRounding();function iEe(e){let t=nEe.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";v();x();g();var uEe=r1&&r1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r1,"__esModule",{value:!0});var wo=uEe(zu()),t1=nc();function yee(e,t,r,n,i){if(!i)return{asymptote:!0,d0:e,d1:t};let o=10,u=e[0],l=t[0],a=wo.default.linspace(u,l,o),s,f;for(let p=0;p=2&&n!==y&&Math.abs(h/s)>1){let N=yee(t[a-1],t[a],e,y,3);N.asymptote?(t[a-1][0]=N.d0[0],t[a-1][1]=wo.default.clamp(N.d0[1],o,u),i.push(l),t[a][0]=N.d1[0],t[a][1]=wo.default.clamp(N.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 fEe(e){let t=wo.default.space(e.xAxis,e.range,e.nSamples),r=e.yScale.domain(),n=r[0]-wo.default.infinity(),i=r[1]+wo.default.infinity(),o=[];for(let l=0;l{"use strict";v();x();g();var Q3=n1&&n1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n1,"__esModule",{value:!0});var bee=Q3(Ed()),vEe=Q3(xee()),gEe=Q3(wee());function xEe(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 yEe(e,t){let r=xEe(e.meta.xScale,t),n;if(t.sampler==="builtIn")n=gEe.default;else if(t.sampler==="interval")n=vEe.default;else throw new Error(`Invalid sampler function ${t.sampler}`);let i=t.nSamples||Math.min(bee.default.MAX_ITERATIONS,bee.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}n1.default=yEe});var Eee=dt(i1=>{"use strict";v();x();g();var Nee=i1&&i1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i1,"__esModule",{value:!0});var Dee=(Kn(),An(Gs)),j3=(Kg(),An(Xg)),QD=Nee(zu()),wEe=Nee(JD());function bEe(e){function t(r){r.each(function(n){let i=t.el=(0,Dee.select)(this),o=n.index,u=(0,wEe.default)(e,n),l=QD.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=QD.default.infinity(),p=-QD.default.infinity());function y(O){return QD.default.clamp(e.meta.yScale(O[1]),p,f)}let N=(0,j3.line)().curve(j3.curveLinear).x(function(O){return e.meta.xScale(O[0])}).y(y),w=(0,j3.area)().x(function(O){return e.meta.xScale(O[0])}).y0(e.meta.yScale(0)).y1(y),D=`line line-${o}`,b=a.enter().append("path").attr("class",D).attr("stroke-width",1).attr("stroke-linecap","round");a.merge(b).each(function(){let O=(0,Dee.select)(this),M;if(n.closed?(O.attr("fill",l),O.attr("fill-opacity",.3),M=w):(O.attr("fill","none"),M=N),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=`${D} ${n.attr[I]}`),O.attr(I,F)}}),a.exit().remove()})}return t}i1.default=bEe});var Aee=dt(o1=>{"use strict";v();x();g();var See=o1&&o1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o1,"__esModule",{value:!0});var DEe=(Kn(),An(Gs)),NEe=See(JD()),EEe=See(zu());function SEe(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,N=l.length;y path.line").data(h);t=Math.max(h[0].scaledDx,1);let N=`line line-${f}`,w=y.enter().append("path").attr("class",N).attr("fill","none"),D=y.merge(w).attr("stroke-width",t).attr("stroke",EEe.default.color(a,f)).attr("opacity",p?.5:1).attr("d",function(b){return o(b,p)});if(a.attr)for(let b in a.attr){let O=a.attr[b];b==="class"&&(O=`${N} ${a.attr[b]}`),D.attr(b,O)}y.exit().remove()})}return u}o1.default=SEe});var Mee=dt(a1=>{"use strict";v();x();g();var Cee=a1&&a1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a1,"__esModule",{value:!0});var AEe=(Kn(),An(Gs)),CEe=(Vs(),An(D2)),MEe=Cee(zu()),TEe=Cee(JD());function OEe(e){let t=e.meta.xScale,r=e.meta.yScale;function n(i){i.each(function(o){let u,l,a=o.index,s=MEe.default.color(o,a),f=(0,TEe.default)(e,o),p=[];for(u=0;u circle.scatter").data(p),y=`scatter scatter-${a}`,N=h.enter().append("circle").attr("class",y),w=h.merge(N).attr("fill",(0,CEe.hsl)(s.toString()).brighter(1.5).formatHex()).attr("stroke",s).attr("opacity",.7).attr("r",1).attr("cx",function(D){return t(D[0])}).attr("cy",function(D){return r(D[1])});if(o.attr)for(let D in o.attr){let b=o.attr[D];D==="class"&&(b=`${y} ${o.attr[D]}`),w.attr(D,b)}h.exit().remove()})}return n}a1.default=OEe});var Tee=dt(s1=>{"use strict";v();x();g();var IEe=s1&&s1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s1,"__esModule",{value:!0});var FEe=(Kn(),An(Gs)),_Ee=(Vs(),An(D2)),kEe=IEe(zu());function BEe(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,FEe.select)(this).selectAll(":scope > text.fn-text").data([o.location]),l=u.enter().append("text").attr("class",`fn-text fn-text-${o.index}`),a=kEe.default.color(o,o.index),s=u.merge(l).attr("fill",(0,_Ee.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}s1.default=BEe});var u1=dt(ls=>{"use strict";v();x();g();var jD=ls&&ls.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ls,"__esModule",{value:!0});ls.text=ls.scatter=ls.interval=ls.polyline=void 0;var LEe=jD(Eee());ls.polyline=LEe.default;var PEe=jD(Aee());ls.interval=PEe.default;var REe=jD(Mee());ls.scatter=REe.default;var qEe=jD(Tee());ls.text=qEe.default});var eN=dt(eO=>{"use strict";v();x();g();Object.defineProperty(eO,"__esModule",{value:!0});function zEe(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}eO.default=zEe});var Fee=dt(l1=>{"use strict";v();x();g();var Iee=l1&&l1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(l1,"__esModule",{value:!0});var UEe=(Kn(),An(Gs)),HEe=u1(),Oee=nc(),$Ee=Iee(eN()),WEe=Iee(zu());function VEe(e){let t=(0,$Ee.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:WEe.default.infinity();return t.index=o.index,t.scope={m:(0,Oee.builtIn)(o.derivative,"fn",{x:u}),x0:u,y0:(0,Oee.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,UEe.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,HEe.polyline)(e)),s.merge(f).selectAll("path").attr("opacity",.5),s.exit().remove()})};return i}l1.default=VEe});var Bee=dt(f1=>{"use strict";v();x();g();var kee=f1&&f1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(f1,"__esModule",{value:!0});var GEe=(Kn(),An(Gs)),_ee=nc(),YEe=kee(eN()),ZEe=u1(),XEe=kee(zu());function KEe(e){let t=(0,YEe.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:XEe.default.infinity();Object.assign(s.scope,{x0:f,x1:p,y0:(0,_ee.builtIn)(a,"fn",{x:f}),y1:(0,_ee.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";v();x();g();var Lee=c1&&c1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(c1,"__esModule",{value:!0});var JEe=(Kn(),An(Gs)),QEe=Lee(Fee()),jEe=Lee(Bee());function eSe(e){function t(r){r.each(function(){let n=(0,JEe.select)(this);n.call((0,QEe.default)(e)),n.call((0,jEe.default)(e))})}return t}c1.default=eSe});var Uee=dt(kd=>{"use strict";v();x();g();var Bd=kd&&kd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(kd,"__esModule",{value:!0});kd.Chart=void 0;var tSe=(Kg(),An(Xg)),rSe=(o2(),An(YV)),Pee=(bZ(),An(wZ)),Ree=(IZ(),An(OZ)),nSe=(bJ(),An(wJ)),tN=(Kn(),An(Gs)),qee=(Tl(),An(yY)),iSe=Bd((kJ(),An(_J))),oSe=Bd(BJ()),aSe=Bd(dee()),sSe=Bd(tO()),uSe=Bd(eN()),rN=Bd(Ed());function zee(e){return e==="linear"?Pee.scaleLinear:Pee.scaleLog}var nN=class e extends iSe.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,tN.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||rN.default.DEFAULT_WIDTH)-t.left-t.right,this.meta.height=(this.options.height||rN.default.DEFAULT_HEIGHT)-t.top-t.bottom,this.initializeAxes()}initializeAxes(){let t=this,r=(0,rSe.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=zee(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=zee(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,Ree.axisBottom)(this.meta.xScale)),this.meta.xAxis.tickSize(this.options.grid?-this.meta.height:0).tickFormat(n),this.meta.yAxis||(this.meta.yAxis=(0,Ree.axisLeft)(this.meta.yScale)),this.meta.yAxis.tickSize(this.options.grid?-this.meta.width:0).tickFormat(n),this.line=(0,tSe.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,tN.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,aSe.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,oSe.default)({owner:t}));let o=n.merge(i).selectAll(":scope > g.graph").data(l=>l.data.map(uSe.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,tN.select)(this);s.call(rN.default.graphTypes[l.graphType](t)),s.call((0,sSe.default)(t))})}buildZoomHelper(){let t=this;this.meta.zoomBehavior||(this.meta.zoomBehavior=(0,nSe.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";v();x();g();Object.defineProperty(Hee,"__esModule",{value:!0})});var Zee=dt(mn=>{"use strict";v();x();g();var Wee=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]}),lSe=mn&&mn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Vee=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)&&Wee(t,e,r);return lSe(t,e),t},Gee=mn&&mn.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Wee(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;eW();var rO=Uee();Object.defineProperty(mn,"Chart",{enumerable:!0,get:function(){return rO.Chart}});var Ld=Vee(Ed());Object.defineProperty(mn,"registerGraphType",{enumerable:!0,get:function(){return Ld.registerGraphType}});var jp=u1(),fSe=Vee(nc());(0,Ld.registerGraphType)("polyline",jp.polyline);(0,Ld.registerGraphType)("interval",jp.interval);(0,Ld.registerGraphType)("scatter",jp.scatter);(0,Ld.registerGraphType)("text",jp.text);function iN(e){e.data=e.data||[];let t=rO.Chart.cache[e.id];return t||(t=new rO.Chart(e)),t.build()}mn.default=iN;iN.globals=Ld.default;iN.$eval=fSe;iN.graphTypes={interval:jp.interval,polyline:jp.polyline,scatter:jp.scatter};Gee($ee(),mn);var Yee=nc();Object.defineProperty(mn,"EvalBuiltIn",{enumerable:!0,get:function(){return Yee.builtIn}});Object.defineProperty(mn,"EvalInterval",{enumerable:!0,get:function(){return Yee.interval}});var nO=u1();Object.defineProperty(mn,"GraphTypeInterval",{enumerable:!0,get:function(){return nO.interval}});Object.defineProperty(mn,"GraphTypePolyline",{enumerable:!0,get:function(){return nO.polyline}});Object.defineProperty(mn,"GraphTypeScatter",{enumerable:!0,get:function(){return nO.scatter}});Gee(tO(),mn)});var Jee=dt((iO,Kee)=>{v();x();g();(function(e,t){var r=t(e);if(typeof define=="function"&&define.amd)define("DeepDiff",function(){return r});else if(typeof iO=="object"||typeof navigator=="object"&&navigator.product.match(/ReactNative/i))Kee.exports=r;else{var n=e.DeepDiff;r.noConflict=function(){return e.DeepDiff===r&&(e.DeepDiff=n),r},e.DeepDiff=r}})(iO,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=Y!=="undefined"||V&&V.length>0&&V[V.length-1].rhs&&Object.getOwnPropertyDescriptor(V[V.length-1].rhs,H);if(!ye&&ce)R.push(new o(ee,P));else if(!ce&&ye)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(X==="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 Ne=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,z=-1,H=R.path?R.path.length-1:0;++z"u"&&(q[R.path[z]]=typeof R.path[z+1]<"u"&&typeof R.path[z+1]=="number"?[]:{}),q=q[R.path[z]];switch(R.kind){case"A":R.path&&typeof q[R.path[z]]>"u"&&(q[R.path[z]]=[]),b(R.path?q[R.path[z]]:q,R.index,R.item);break;case"D":delete q[R.path[z]];break;case"E":case"N":q[R.path[z]]=R.rhs;break}}}function M(C,P,R){if(R.path&&R.path.length){var q=C[P],z,H=R.path.length-1;for(z=0;z"u"&&(q[R.path[z]]={}),q=q[R.path[z]];switch(R.kind){case"A":M(q[R.path[z]],R.index,R.item);break;case"D":q[R.path[z]]=R.lhs;break;case"E":q[R.path[z]]=R.lhs;break;case"N":delete q[R.path[z]];break}}}function F(C,P,R){if(C&&P){var q=function(z){(!R||R(C,P,z))&&O(C,P,z)};y(C,P,q)}}return Object.defineProperties(w,{diff:{value:w,enumerable:!0},orderIndependentDiff:{value:D,enumerable:!0},observableDiff:{value:y,enumerable:!0},orderIndependentObservableDiff:{value:N,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 ste=dt((Nbr,sN)=>{v();x();g();(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 N(C){if(C.stopPropagation){C.stopPropagation();return}C.cancelBubble=!0}function w(C){return C=="shift"||C=="ctrl"||C=="alt"||C=="meta"}function D(){if(!l){l={};for(var C in n)C>95&&C<112||n.hasOwnProperty(C)&&(l[n[C]]=C)}return l}function b(C,P,R){return R||(R=D()[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,z,H=[];for(R=O(C),z=0;z1){le(he,Pe,De,ye);return}Ce=M(he,ye),P._callbacks[Ce.key]=P._callbacks[Ce.key]||[],ee(Ce.key,Ce.modifiers,{type:Ce.action},ce,he,Ne),P._callbacks[Ce.key][ce?"unshift":"push"]({callback:De,modifiers:Ce.modifiers,action:Ce.action,seq:ce,level:Ne,combo:he})}P._bindMultiple=function(he,De,ye){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 sN<"u"&&sN.exports&&(sN.exports=F),typeof define=="function"&&define.amd&&define(function(){return F})})(typeof window<"u"?window:null,typeof window<"u"?document:null)});v();x();g();v();x();g();var Ve=e=>document.querySelector(e),Gn=e=>document.querySelectorAll(e),Yt={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:[]};v();x();g();v();x();g();v();x();g();v();x();g();v();x();g();var zm=en(qm(),1);function yu(e){zm.default.modal(e,{bgClose:!1,stack:!0}).show()}function mf(e,t){zm.default.util.on("#dialog-error","beforeshow",()=>{Ve("#errTitle").innerHTML=e,Ve("#errMsg").innerHTML=t}),yu("#dialog-error")}function Rn(e,t){zm.default.notification({message:e,pos:Ge.settings.notifyLocation,status:t||"primary",timeout:+Ge.settings.notifyDuration})}function Um(e,t){Ve("#confirmMsg").innerHTML=e,yu("#dialog-confirm");let r=n=>{t(),n.stopPropagation(),zm.default.modal("#dialog-confirm").hide(),Ve("#confirm-yes").removeEventListener("click",r)};Ve("#confirm-yes").addEventListener("click",r),zm.default.util.on("#dialog-confirm","hidden",()=>{Ve("#confirm-yes").removeEventListener("click",r)})}var SO=navigator.userAgent.toLowerCase().includes("mac"),Mi=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=Mi&&numara.isResized()&&!numara.isMaximized()?"block":"none"}function cE(){numara.isMaximized()?numara.unmaximize():numara.maximize()}function AO(){Mi&&(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}))}v();x();g();v();x();g();v();x();g();v();x();g();var ml=class extends Error{},$x=class extends ml{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}},Wx=class extends ml{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}},Vx=class extends ml{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}},Ds=class extends ml{},Hm=class extends ml{constructor(t){super(`Invalid unit ${t}`)}},ui=class extends ml{},Ns=class extends ml{constructor(){super("Zone is an abstract class")}};v();x();g();v();x();g();v();x();g();var Ft="numeric",Es="short",sa="long",hf={year:Ft,month:Ft,day:Ft},Uv={year:Ft,month:Es,day:Ft},pE={year:Ft,month:Es,day:Ft,weekday:Es},Hv={year:Ft,month:sa,day:Ft},$v={year:Ft,month:sa,day:Ft,weekday:sa},Wv={hour:Ft,minute:Ft},Vv={hour:Ft,minute:Ft,second:Ft},Gv={hour:Ft,minute:Ft,second:Ft,timeZoneName:Es},Yv={hour:Ft,minute:Ft,second:Ft,timeZoneName:sa},Zv={hour:Ft,minute:Ft,hourCycle:"h23"},Xv={hour:Ft,minute:Ft,second:Ft,hourCycle:"h23"},Kv={hour:Ft,minute:Ft,second:Ft,hourCycle:"h23",timeZoneName:Es},Jv={hour:Ft,minute:Ft,second:Ft,hourCycle:"h23",timeZoneName:sa},Qv={year:Ft,month:Ft,day:Ft,hour:Ft,minute:Ft},jv={year:Ft,month:Ft,day:Ft,hour:Ft,minute:Ft,second:Ft},eg={year:Ft,month:Es,day:Ft,hour:Ft,minute:Ft},tg={year:Ft,month:Es,day:Ft,hour:Ft,minute:Ft,second:Ft},mE={year:Ft,month:Es,day:Ft,weekday:Es,hour:Ft,minute:Ft},rg={year:Ft,month:sa,day:Ft,hour:Ft,minute:Ft,timeZoneName:Es},ng={year:Ft,month:sa,day:Ft,hour:Ft,minute:Ft,second:Ft,timeZoneName:Es},ig={year:Ft,month:sa,day:Ft,weekday:sa,hour:Ft,minute:Ft,timeZoneName:sa},og={year:Ft,month:sa,day:Ft,weekday:sa,hour:Ft,minute:Ft,second:Ft,timeZoneName:sa};v();x();g();v();x();g();v();x();g();v();x();g();var Ro=class{get type(){throw new Ns}get name(){throw new Ns}get ianaName(){return this.name}get isUniversal(){throw new Ns}offsetName(t,r){throw new Ns}formatOffset(t,r){throw new Ns}offset(t){throw new Ns}equals(t){throw new Ns}get isValid(){throw new Ns}};var hE=null,df=class e extends Ro{static get instance(){return hE===null&&(hE=new e),hE}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 vf(this.offset(t),r)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}};v();x();g();var Xx={};function Vte(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 Gte={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Yte(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 Zte(e,t){let r=e.formatToParts(t),n=[];for(let i=0;i=0?N:1e3+N,(h-y)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}};v();x();g();var CO={};function Xte(e,t={}){let r=JSON.stringify([e,t]),n=CO[r];return n||(n=new Intl.ListFormat(e,t),CO[r]=n),n}var dE={};function vE(e,t={}){let r=JSON.stringify([e,t]),n=dE[r];return n||(n=new Intl.DateTimeFormat(e,t),dE[r]=n),n}var gE={};function Kte(e,t={}){let r=JSON.stringify([e,t]),n=gE[r];return n||(n=new Intl.NumberFormat(e,t),gE[r]=n),n}var xE={};function Jte(e,t={}){let{base:r,...n}=t,i=JSON.stringify([e,n]),o=xE[i];return o||(o=new Intl.RelativeTimeFormat(e,t),xE[i]=o),o}var ag=null;function Qte(){return ag||(ag=new Intl.DateTimeFormat().resolvedOptions().locale,ag)}var MO={};function jte(e){let t=MO[e];if(!t){let r=new Intl.Locale(e);t="getWeekInfo"in r?r.getWeekInfo():r.weekInfo,MO[e]=t}return t}function ere(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=vE(e).resolvedOptions(),i=e}catch{let a=e.substring(0,r);n=vE(a).resolvedOptions(),i=a}let{numberingSystem:o,calendar:u}=n;return[i,o,u]}}function tre(e,t,r){return(r||t)&&(e.includes("-u-")||(e+="-u"),r&&(e+=`-ca-${r}`),t&&(e+=`-nu-${t}`)),e}function rre(e){let t=[];for(let r=1;r<=12;r++){let n=Dr.utc(2009,r,1);t.push(e(n))}return t}function nre(e){let t=[];for(let r=1;r<=7;r++){let n=Dr.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 ire(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 yE=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=Kte(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):Wm(t,3);return qn(r,this.padTo)}}},wE=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&&uo.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=vE(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()}},bE=class{constructor(t,r,n){this.opts={style:"long",...n},!r&&Jx()&&(this.rtf=Jte(t,n))}format(t,r){return this.rtf?this.rtf.format(t,r):TO(r,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,r){return this.rtf?this.rtf.formatToParts(t,r):[]}},ore={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":Qte()),a=r||$r.defaultNumberingSystem,s=n||$r.defaultOutputCalendar,f=sg(i)||$r.defaultWeekSettings;return new e(l,a,s,f,u)}static resetCache(){ag=null,dE={},gE={},xE={}}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]=ere(t);this.locale=u,this.numberingSystem=r||l||null,this.outputCalendar=n||a||null,this.weekSettings=i,this.intl=tre(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=ire(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,sg(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,DE,()=>{let n=r?{month:t,day:"numeric"}:{month:t},i=r?"format":"standalone";return this.monthsCache[i][t]||(this.monthsCache[i][t]=rre(o=>this.extract(o,n,"month"))),this.monthsCache[i][t]})}weekdays(t,r=!1){return Kx(this,t,NE,()=>{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]=nre(o=>this.extract(o,n,"weekday"))),this.weekdaysCache[i][t]})}meridiems(){return Kx(this,void 0,()=>EE,()=>{if(!this.meridiemCache){let t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Dr.utc(2016,11,13,9),Dr.utc(2016,11,13,19)].map(r=>this.extract(r,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Kx(this,t,SE,()=>{let r={era:t};return this.eraCache[t]||(this.eraCache[t]=[Dr.utc(-40,1,1),Dr.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 yE(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,r={}){return new wE(t,this.intl,r)}relFormatter(t={}){return new bE(this.intl,this.isEnglish(),t)}listFormatter(t={}){return Xte(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()?jte(this.locale):ore}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}};v();x();g();v();x();g();var CE=null,Ti=class e extends Ro{static get utcInstance(){return CE===null&&(CE=new e(0)),CE}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(ep(r[1],r[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${vf(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${vf(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,r){return vf(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}};v();x();g();var Vm=class extends Ro{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 Ss(e,t){let r;if(nr(e)||e===null)return t;if(e instanceof Ro)return e;if(OO(e)){let n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?df.instance:n==="utc"||n==="gmt"?Ti.utcInstance:Ti.parseSpecifier(n)||uo.create(e)}else return wu(e)?Ti.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new Vm(e)}var IO=()=>Date.now(),FO="system",_O=null,kO=null,BO=null,LO=60,PO,RO=null,$r=class{static get now(){return IO}static set now(t){IO=t}static set defaultZone(t){FO=t}static get defaultZone(){return Ss(FO,df.instance)}static get defaultLocale(){return _O}static set defaultLocale(t){_O=t}static get defaultNumberingSystem(){return kO}static set defaultNumberingSystem(t){kO=t}static get defaultOutputCalendar(){return BO}static set defaultOutputCalendar(t){BO=t}static get defaultWeekSettings(){return RO}static set defaultWeekSettings(t){RO=sg(t)}static get twoDigitCutoffYear(){return LO}static set twoDigitCutoffYear(t){LO=t%100}static get throwOnInvalid(){return PO}static set throwOnInvalid(t){PO=t}static resetCaches(){Zr.resetCache(),uo.resetCache()}};v();x();g();v();x();g();var Oi=class{constructor(t,r){this.reason=t,this.explanation=r}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}};var qO=[0,31,59,90,120,151,181,212,243,273,304,334],zO=[0,31,60,91,121,152,182,213,244,274,305,335];function La(e,t){return new Oi("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 UO(e,t,r){return r+(rp(e)?zO:qO)[t-1]}function HO(e,t){let r=rp(e)?zO:qO,n=r.findIndex(o=>otp(n,t,r)?(s=n+1,a=1):s=n,{weekYear:s,weekNumber:a,weekday:l,...fg(e)}}function ME(e,t=4,r=1){let{weekYear:n,weekNumber:i,weekday:o}=e,u=ey(jx(n,1,t),r),l=gf(n),a=i*7+o-u-7+t,s;a<1?(s=n-1,a+=gf(s)):a>l?(s=n+1,a-=gf(n)):s=n;let{month:f,day:p}=HO(s,a);return{year:s,month:f,day:p,...fg(e)}}function ty(e){let{year:t,month:r,day:n}=e,i=UO(t,r,n);return{year:t,ordinal:i,...fg(e)}}function TE(e){let{year:t,ordinal:r}=e,{month:n,day:i}=HO(t,r);return{year:t,month:n,day:i,...fg(e)}}function OE(e,t){if(!nr(e.localWeekday)||!nr(e.localWeekNumber)||!nr(e.localWeekYear)){if(!nr(e.weekday)||!nr(e.weekNumber)||!nr(e.weekYear))throw new Ds("Cannot mix locale-based week fields with ISO-based week fields");return nr(e.localWeekday)||(e.weekday=e.localWeekday),nr(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),nr(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 $O(e,t=4,r=1){let n=lg(e.weekYear),i=ua(e.weekNumber,1,tp(e.weekYear,t,r)),o=ua(e.weekday,1,7);return n?i?o?!1:La("weekday",e.weekday):La("week",e.weekNumber):La("weekYear",e.weekYear)}function WO(e){let t=lg(e.year),r=ua(e.ordinal,1,gf(e.year));return t?r?!1:La("ordinal",e.ordinal):La("year",e.year)}function IE(e){let t=lg(e.year),r=ua(e.month,1,12),n=ua(e.day,1,Gm(e.year,e.month));return t?r?n?!1:La("day",e.day):La("month",e.month):La("year",e.year)}function FE(e){let{hour:t,minute:r,second:n,millisecond:i}=e,o=ua(t,0,23)||t===24&&r===0&&n===0&&i===0,u=ua(r,0,59),l=ua(n,0,59),a=ua(i,0,999);return o?u?l?a?!1:La("millisecond",i):La("second",n):La("minute",r):La("hour",t)}function nr(e){return typeof e>"u"}function wu(e){return typeof e=="number"}function lg(e){return typeof e=="number"&&e%1===0}function OO(e){return typeof e=="string"}function GO(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 YO(e){return Array.isArray(e)?e:[e]}function _E(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 ZO(e,t){return t.reduce((r,n)=>(r[n]=e[n],r),{})}function xf(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function sg(e){if(e==null)return null;if(typeof e!="object")throw new ui("Week settings must be an object");if(!ua(e.firstDay,1,7)||!ua(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!ua(t,1,7)))throw new ui("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function ua(e,t,r){return lg(e)&&e>=t&&e<=r}function are(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 hl(e){if(!(nr(e)||e===null||e===""))return parseInt(e,10)}function yf(e){if(!(nr(e)||e===null||e===""))return parseFloat(e)}function cg(e){if(!(nr(e)||e===null||e==="")){let t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function Wm(e,t,r=!1){let n=10**t;return(r?Math.trunc:Math.round)(e*n)/n}function rp(e){return e%4===0&&(e%100!==0||e%400===0)}function gf(e){return rp(e)?366:365}function Gm(e,t){let r=are(t-1,12)+1,n=e+(t-r)/12;return r===2?rp(n)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function $m(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 VO(e,t,r){return-ey(jx(e,1,t),r)+t-1}function tp(e,t=4,r=1){let n=VO(e,t,r),i=VO(e+1,t,r);return(gf(e)-n+i)/7}function pg(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 ep(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 kE(e){let t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new ui(`Invalid unit value ${e}`);return t}function Ym(e,t){let r={};for(let n in e)if(xf(e,n)){let i=e[n];if(i==null)continue;r[t(n)]=kE(i)}return r}function vf(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 fg(e){return ZO(e,["hour","minute","second","millisecond"])}var sre=["January","February","March","April","May","June","July","August","September","October","November","December"],BE=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ure=["J","F","M","A","M","J","J","A","S","O","N","D"];function DE(e){switch(e){case"narrow":return[...ure];case"short":return[...BE];case"long":return[...sre];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 LE=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],PE=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],lre=["M","T","W","T","F","S","S"];function NE(e){switch(e){case"narrow":return[...lre];case"short":return[...PE];case"long":return[...LE];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var EE=["AM","PM"],fre=["Before Christ","Anno Domini"],cre=["BC","AD"],pre=["B","A"];function SE(e){switch(e){case"narrow":return[...pre];case"short":return[...cre];case"long":return[...fre];default:return null}}function XO(e){return EE[e.hour<12?0:1]}function KO(e,t){return NE(t)[e.weekday-1]}function JO(e,t){return DE(t)[e.month-1]}function QO(e,t){return SE(t)[e.year<0?0:1]}function TO(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 jO(e,t){let r="";for(let n of e)n.literal?r+=n.val:r+=t(n.val);return r}var mre={D:hf,DD:Uv,DDD:Hv,DDDD:$v,t:Wv,tt:Vv,ttt:Gv,tttt:Yv,T:Zv,TT:Xv,TTT:Kv,TTTT:Jv,f:Qv,ff:eg,fff:rg,ffff:ig,F:jv,FF:tg,FFF:ng,FFFF:og},Ii=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 mre[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,N)=>this.loc.extract(t,y,N),u=y=>t.isOffsetFixed&&t.offset===0&&y.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,y.format):"",l=()=>n?XO(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(y,N)=>n?JO(t,y):o(N?{month:y}:{month:y,day:"numeric"},"month"),s=(y,N)=>n?KO(t,y):o(N?{weekday:y}:{weekday:y,month:"long",day:"numeric"},"weekday"),f=y=>{let N=e.macroTokenToFormatOpts(y);return N?this.formatWithSystemDefault(t,N):y},p=y=>n?QO(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 jO(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 jO(o,i(l))}};v();x();g();var tI=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Xm(...e){let t=e.reduce((r,n)=>r+n.source,"");return RegExp(`^${t}$`)}function Km(...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 Jm(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 rI(...e){return(t,r)=>{let n={},i;for(i=0;iy!==void 0&&(N||y&&f)?-y:y;return[{years:h(yf(r)),months:h(yf(n)),weeks:h(yf(i)),days:h(yf(o)),hours:h(yf(u)),minutes:h(yf(l)),seconds:h(yf(a),a==="-0"),milliseconds:h(cg(s),p)}]}var Are={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 zE(e,t,r,n,i,o,u){let l={year:t.length===2?pg(hl(t)):hl(t),month:BE.indexOf(r)+1,day:hl(n),hour:hl(i),minute:hl(o)};return u&&(l.second=hl(u)),e&&(l.weekday=e.length>3?LE.indexOf(e)+1:PE.indexOf(e)+1),l}var Cre=/^(?:(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 Mre(e){let[,t,r,n,i,o,u,l,a,s,f,p]=e,h=zE(t,i,n,r,o,u,l),y;return a?y=Are[a]:s?y=0:y=ep(f,p),[h,new Ti(y)]}function Tre(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var Ore=/^(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$/,Ire=/^(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$/,Fre=/^(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 eI(e){let[,t,r,n,i,o,u,l]=e;return[zE(t,i,n,r,o,u,l),Ti.utcInstance]}function _re(e){let[,t,r,n,i,o,u,l]=e;return[zE(t,l,r,n,i,o,u),Ti.utcInstance]}var kre=Xm(dre,qE),Bre=Xm(vre,qE),Lre=Xm(gre,qE),Pre=Xm(iI),aI=Km(Dre,Qm,mg,hg),Rre=Km(xre,Qm,mg,hg),qre=Km(yre,Qm,mg,hg),zre=Km(Qm,mg,hg);function sI(e){return Jm(e,[kre,aI],[Bre,Rre],[Lre,qre],[Pre,zre])}function uI(e){return Jm(Tre(e),[Cre,Mre])}function lI(e){return Jm(e,[Ore,eI],[Ire,eI],[Fre,_re])}function fI(e){return Jm(e,[Ere,Sre])}var Ure=Km(Qm);function cI(e){return Jm(e,[Nre,Ure])}var Hre=Xm(wre,bre),$re=Xm(oI),Wre=Km(Qm,mg,hg);function pI(e){return Jm(e,[Hre,aI],[$re,Wre])}var mI="Invalid Duration",dI={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}},Vre={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},...dI},Pa=146097/400,jm=146097/4800,Gre={years:{quarters:4,months:12,weeks:Pa/7,days:Pa,hours:Pa*24,minutes:Pa*24*60,seconds:Pa*24*60*60,milliseconds:Pa*24*60*60*1e3},quarters:{months:3,weeks:Pa/28,days:Pa/4,hours:Pa*24/4,minutes:Pa*24*60/4,seconds:Pa*24*60*60/4,milliseconds:Pa*24*60*60*1e3/4},months:{weeks:jm/7,days:jm,hours:jm*24,minutes:jm*24*60,seconds:jm*24*60*60,milliseconds:jm*24*60*60*1e3},...dI},np=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Yre=np.slice(0).reverse();function wf(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 vI(e,t){let r=t.milliseconds??0;for(let n of Yre.slice(1))t[n]&&(r+=t[n]*e[n].milliseconds);return r}function hI(e,t){let r=vI(e,t)<0?-1:1;np.reduceRight((n,i)=>{if(nr(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),np.reduce((n,i)=>{if(nr(t[i]))return n;if(n){let o=t[n]%1;t[n]-=o,t[i]+=o*e[n][i]}return i},null)}function Zre(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?Gre:Vre;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 ui(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new e({values:Ym(t,e.normalizeUnit),loc:Zr.fromObject(r),conversionAccuracy:r.conversionAccuracy,matrix:r.matrix})}static fromDurationLike(t){if(wu(t))return e.fromMillis(t);if(e.isDuration(t))return t;if(typeof t=="object")return e.fromObject(t);throw new ui(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,r){let[n]=fI(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]=cI(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 ui("need to specify a reason the Duration is invalid");let n=t instanceof Oi?t:new Oi(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 Hm(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?Ii.create(this.loc,n).formatDurationFromString(this,t):mI}toHuman(t={}){if(!this.isValid)return mI;let r=np.map(n=>{let i=this.values[n];return nr(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+=Wm(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},Dr.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?vI(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 np)(xf(r.values,i)||xf(this.values,i))&&(n[i]=r.get(i)+this.get(i));return wf(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]=kE(t(this.values[n],n));return wf(this,{values:r},!0)}get(t){return this[e.normalizeUnit(t)]}set(t){if(!this.isValid)return this;let r={...this.values,...Ym(t,e.normalizeUnit)};return wf(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 wf(this,u)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;let t=this.toObject();return hI(this.matrix,t),wf(this,{values:t},!0)}rescale(){if(!this.isValid)return this;let t=Zre(this.normalize().shiftToAll().toObject());return wf(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 np)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;wu(i[u])&&(l+=i[u]);let a=Math.trunc(l);r[u]=a,n[u]=(l*1e3-a*1e3)/1e3}else wu(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 hI(this.matrix,r),wf(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 wf(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 np)if(!r(this.values[n],t.values[n]))return!1;return!0}};v();x();g();var eh="Invalid Interval";function Xre(e,t){return!e||!e.isValid?dl.invalid("missing or invalid start"):!t||!t.isValid?dl.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(th).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()})`:eh}[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=hf,r={}){return this.isValid?Ii.create(this.s.loc.clone(r),t).formatInterval(this):eh}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:eh}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:eh}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:eh}toFormat(t,{separator:r=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(t)}${r}${this.e.toFormat(t)}`:eh}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))}};v();x();g();var vl=class{static hasDST(t=$r.defaultZone){let r=Dr.now().setZone(t).set({month:12});return!t.isUniversal&&r.offset!==r.set({month:6}).offset}static isValidIANAZone(t){return uo.isValidZone(t)}static normalizeZone(t){return Ss(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()}}};v();x();g();function gI(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 Kre(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=gI(a,s);return(f-f%7)/7}],["days",gI]],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 xI(e,t,r,n){let[i,o,u,l]=Kre(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}v();x();g();v();x();g();var UE={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"},yI={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]},Jre=UE.hanidec.replace(/[\[|\]]/g,"").split("");function wI(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 Ra({numberingSystem:e},t=""){return new RegExp(`${UE[e||"latn"]}${t}`)}var Qre="missing Intl.DateTimeFormat.formatToParts support";function Wr(e,t=r=>r){return{regex:e,deser:([r])=>t(wI(r))}}var jre="\xA0",NI=`[ ${jre}]`,EI=new RegExp(NI,"g");function ene(e){return e.replace(/\./g,"\\.?").replace(EI,NI)}function bI(e){return e.replace(/\./g,"").replace(EI," ").toLowerCase()}function As(e,t){return e===null?null:{regex:RegExp(e.map(ene).join("|")),deser:([r])=>e.findIndex(n=>bI(r)===bI(n))+t}}function DI(e,t){return{regex:e,deser:([,r,n])=>ep(r,n),groups:t}}function ry(e){return{regex:e,deser:([t])=>t}}function tne(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function rne(e,t){let r=Ra(t),n=Ra(t,"{2}"),i=Ra(t,"{3}"),o=Ra(t,"{4}"),u=Ra(t,"{6}"),l=Ra(t,"{1,2}"),a=Ra(t,"{1,3}"),s=Ra(t,"{1,6}"),f=Ra(t,"{1,9}"),p=Ra(t,"{2,4}"),h=Ra(t,"{4,6}"),y=D=>({regex:RegExp(tne(D.val)),deser:([b])=>b,literal:!0}),w=(D=>{if(e.literal)return y(D);switch(D.val){case"G":return As(t.eras("short"),0);case"GG":return As(t.eras("long"),0);case"y":return Wr(s);case"yy":return Wr(p,pg);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 As(t.months("short",!0),1);case"MMMM":return As(t.months("long",!0),1);case"L":return Wr(l);case"LL":return Wr(n);case"LLL":return As(t.months("short",!1),1);case"LLLL":return As(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 As(t.meridiems(),0);case"kkkk":return Wr(o);case"kk":return Wr(p,pg);case"W":return Wr(l);case"WW":return Wr(n);case"E":case"c":return Wr(r);case"EEE":return As(t.weekdays("short",!1),1);case"EEEE":return As(t.weekdays("long",!1),1);case"ccc":return As(t.weekdays("short",!0),1);case"cccc":return As(t.weekdays("long",!0),1);case"Z":case"ZZ":return DI(new RegExp(`([+-]${l.source})(?::(${n.source}))?`),2);case"ZZZ":return DI(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(D)}})(e)||{invalidReason:Qre};return w.token=e,w}var nne={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 ine(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=nne[u];if(typeof l=="object"&&(l=l[o]),l)return{literal:!1,val:l}}function one(e){return[`^${e.map(r=>r.regex).reduce((r,n)=>`${r}(${n.source})`,"")}$`,e]}function ane(e,t,r){let n=e.match(t);if(n){let i={},o=1;for(let u in r)if(xf(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 sne(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 nr(e.z)||(r=uo.create(e.z)),nr(e.Z)||(r||(r=new Ti(e.Z)),n=e.Z),nr(e.q)||(e.M=(e.q-1)*3+1),nr(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),nr(e.u)||(e.S=cg(e.u)),[Object.keys(e).reduce((o,u)=>{let l=t(u);return l&&(o[l]=e[u]),o},{}),r,n]}var HE=null;function une(){return HE||(HE=Dr.fromMillis(1555555555555)),HE}function lne(e,t){if(e.literal)return e;let r=Ii.macroTokenToFormatOpts(e.val),n=VE(r,t);return n==null||n.includes(void 0)?e:n}function $E(e,t){return Array.prototype.concat(...e.map(r=>lne(r,t)))}function WE(e,t,r){let n=$E(Ii.parseFormat(r),e),i=n.map(u=>rne(u,e)),o=i.find(u=>u.invalidReason);if(o)return{input:t,tokens:n,invalidReason:o.invalidReason};{let[u,l]=one(i),a=RegExp(u,"i"),[s,f]=ane(t,a,l),[p,h,y]=f?sne(f):[null,null,void 0];if(xf(f,"a")&&xf(f,"H"))throw new Ds("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 SI(e,t,r){let{result:n,zone:i,specificOffset:o,invalidReason:u}=WE(e,t,r);return[n,i,o,u]}function VE(e,t){if(!e)return null;let n=Ii.create(t,e).dtFormatter(une()),i=n.formatToParts(),o=n.resolvedOptions();return i.map(u=>ine(u,e,o))}var GE="Invalid DateTime",AI=864e13;function ny(e){return new Oi("unsupported zone",`the zone "${e.name}" is not supported`)}function YE(e){return e.weekData===null&&(e.weekData=ug(e.c)),e.weekData}function ZE(e){return e.localWeekData===null&&(e.localWeekData=ug(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function ip(e,t){let r={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Dr({...r,...t,old:r})}function _I(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 _I($m(e),t,r)}function CI(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,Gm(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=$m(o),[a,s]=_I(l,r,e.zone);return u!==0&&(a+=u,s=e.zone.offset(a)),{ts:a,o:s}}function dg(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=Dr.fromObject(e,{...r,zone:a,specificOffset:o});return u?s:s.setZone(l)}else return Dr.invalid(new Oi("unparsable",`the input "${i}" can't be parsed as ${n}`))}function oy(e,t,r=!0){return e.isValid?Ii.create(Zr.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function XE(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 MI(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 kI={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},fne={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},cne={ordinal:1,hour:0,minute:0,second:0,millisecond:0},BI=["year","month","day","hour","minute","second","millisecond"],pne=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],mne=["year","ordinal","hour","minute","second","millisecond"];function hne(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 Hm(e);return t}function TI(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return hne(e)}}function OI(e,t){let r=Ss(t.zone,$r.defaultZone),n=Zr.fromObject(t),i=$r.now(),o,u;if(nr(e.year))o=i;else{for(let s of BI)nr(e[s])&&(e[s]=kI[s]);let l=IE(e)||FE(e);if(l)return Dr.invalid(l);let a=r.offset(i);[o,u]=ay(e,a,r)}return new Dr({ts:o,zone:r,loc:n,o:u})}function II(e,t,r){let n=nr(r.round)?!0:r.round,i=(u,l)=>(u=Wm(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 FI(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 Dr=class e{constructor(t){let r=t.zone||$r.defaultZone,n=t.invalid||(Number.isNaN(t.ts)?new Oi("invalid input"):null)||(r.isValid?null:ny(r));this.ts=nr(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 Oi("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]=FI(arguments),[n,i,o,u,l,a,s]=r;return OI({year:n,month:i,day:o,hour:u,minute:l,second:a,millisecond:s},t)}static utc(){let[t,r]=FI(arguments),[n,i,o,u,l,a,s]=r;return t.zone=Ti.utcInstance,OI({year:n,month:i,day:o,hour:u,minute:l,second:a,millisecond:s},t)}static fromJSDate(t,r={}){let n=GO(t)?t.valueOf():NaN;if(Number.isNaN(n))return e.invalid("invalid input");let i=Ss(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(wu(t))return t<-AI||t>AI?e.invalid("Timestamp out of range"):new e({ts:t,zone:Ss(r.zone,$r.defaultZone),loc:Zr.fromObject(r)});throw new ui(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,r={}){if(wu(t))return new e({ts:t*1e3,zone:Ss(r.zone,$r.defaultZone),loc:Zr.fromObject(r)});throw new ui("fromSeconds requires a numerical input")}static fromObject(t,r={}){t=t||{};let n=Ss(r.zone,$r.defaultZone);if(!n.isValid)return e.invalid(ny(n));let i=Zr.fromObject(r),o=Ym(t,TI),{minDaysInFirstWeek:u,startOfWeek:l}=OE(o,i),a=$r.now(),s=nr(r.specificOffset)?n.offset(a):r.specificOffset,f=!nr(o.ordinal),p=!nr(o.year),h=!nr(o.month)||!nr(o.day),y=p||h,N=o.weekYear||o.weekNumber;if((y||f)&&N)throw new Ds("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&f)throw new Ds("Can't mix ordinal dates with month/day");let w=N||o.weekday&&!y,D,b,O=iy(a,s);w?(D=pne,b=fne,O=ug(O,u,l)):f?(D=mne,b=cne,O=ty(O)):(D=BI,b=kI);let M=!1;for(let z of D){let H=o[z];nr(H)?M?o[z]=b[z]:o[z]=O[z]:M=!0}let I=w?$O(o,u,l):f?WO(o):IE(o),F=I||FE(o);if(F)return e.invalid(F);let C=w?ME(o,u,l):f?TE(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]=sI(t);return dg(n,i,r,"ISO 8601",t)}static fromRFC2822(t,r={}){let[n,i]=uI(t);return dg(n,i,r,"RFC 2822",t)}static fromHTTP(t,r={}){let[n,i]=lI(t);return dg(n,i,r,"HTTP",r)}static fromFormat(t,r,n={}){if(nr(t)||nr(r))throw new ui("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]=SI(u,t,r);return f?e.invalid(f):dg(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]=pI(t);return dg(n,i,r,"SQL",t)}static invalid(t,r=null){if(!t)throw new ui("need to specify a reason the DateTime is invalid");let n=t instanceof Oi?t:new Oi(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=VE(t,Zr.fromObject(r));return n?n.map(i=>i?i.val:null).join(""):null}static expandFormat(t,r={}){return $E(Ii.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?YE(this).weekYear:NaN}get weekNumber(){return this.isValid?YE(this).weekNumber:NaN}get weekday(){return this.isValid?YE(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?ZE(this).weekday:NaN}get localWeekNumber(){return this.isValid?ZE(this).weekNumber:NaN}get localWeekYear(){return this.isValid?ZE(this).weekYear:NaN}get ordinal(){return this.isValid?ty(this.c).ordinal:NaN}get monthShort(){return this.isValid?vl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?vl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?vl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?vl.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=$m(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?[ip(this,{ts:a}),ip(this,{ts:s})]:[this]}get isInLeapYear(){return rp(this.year)}get daysInMonth(){return Gm(this.year,this.month)}get daysInYear(){return this.isValid?gf(this.year):NaN}get weeksInWeekYear(){return this.isValid?tp(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?tp(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){let{locale:r,numberingSystem:n,calendar:i}=Ii.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:r,numberingSystem:n,outputCalendar:i}}toUTC(t=0,r={}){return this.setZone(Ti.instance(t),r)}toLocal(){return this.setZone($r.defaultZone)}setZone(t,{keepLocalTime:r=!1,keepCalendarTime:n=!1}={}){if(t=Ss(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 ip(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 ip(this,{loc:i})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;let r=Ym(t,TI),{minDaysInFirstWeek:n,startOfWeek:i}=OE(r,this.loc),o=!nr(r.weekYear)||!nr(r.weekNumber)||!nr(r.weekday),u=!nr(r.ordinal),l=!nr(r.year),a=!nr(r.month)||!nr(r.day),s=l||a,f=r.weekYear||r.weekNumber;if((s||u)&&f)throw new Ds("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&u)throw new Ds("Can't mix ordinal dates with month/day");let p;o?p=ME({...ug(this.c,n,i),...r},n,i):nr(r.ordinal)?(p={...this.toObject(),...r},nr(r.day)&&(p.day=Math.min(Gm(p.year,p.month),p.day))):p=TE({...ty(this.c),...r});let[h,y]=ay(p,this.o,this.zone);return ip(this,{ts:h,o:y})}plus(t){if(!this.isValid)return this;let r=zn.fromDurationLike(t);return ip(this,CI(this,r))}minus(t){if(!this.isValid)return this;let r=zn.fromDurationLike(t).negate();return ip(this,CI(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=xI(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?dl.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 ui("max requires all arguments be DateTimes");return _E(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 WE(u,t,r)}static fromStringExplain(t,r,n={}){return e.fromFormatExplain(t,r,n)}static get DATE_SHORT(){return hf}static get DATE_MED(){return Uv}static get DATE_MED_WITH_WEEKDAY(){return pE}static get DATE_FULL(){return Hv}static get DATE_HUGE(){return $v}static get TIME_SIMPLE(){return Wv}static get TIME_WITH_SECONDS(){return Vv}static get TIME_WITH_SHORT_OFFSET(){return Gv}static get TIME_WITH_LONG_OFFSET(){return Yv}static get TIME_24_SIMPLE(){return Zv}static get TIME_24_WITH_SECONDS(){return Xv}static get TIME_24_WITH_SHORT_OFFSET(){return Kv}static get TIME_24_WITH_LONG_OFFSET(){return Jv}static get DATETIME_SHORT(){return Qv}static get DATETIME_SHORT_WITH_SECONDS(){return jv}static get DATETIME_MED(){return eg}static get DATETIME_MED_WITH_SECONDS(){return tg}static get DATETIME_MED_WITH_WEEKDAY(){return mE}static get DATETIME_FULL(){return rg}static get DATETIME_FULL_WITH_SECONDS(){return ng}static get DATETIME_HUGE(){return ig}static get DATETIME_HUGE_WITH_SECONDS(){return og}};function th(e){if(Dr.isDateTime(e))return e;if(e&&e.valueOf&&wu(e.valueOf()))return Dr.fromJSDate(e);if(e&&typeof e=="object")return Dr.fromObject(e);throw new ui(`Unknown datetime argument: ${e}, of type ${typeof e}`)}v();x();g();v();x();g();function Un(){return Un=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 dne(e,t){return e.indexOf(t)!==-1}function HI(e,t,r){e[t]!==void 0&&!dne(r,e[t])&&console.warn('Warning: Unknown value "'+e[t]+'" for configuration option "'+t+'". Available options: '+r.map(n=>JSON.stringify(n)).join(", ")+".")}var VA={};Ba(VA,{createAbs:()=>W_,createAccessorNode:()=>p6,createAcos:()=>HB,createAcosh:()=>WB,createAcot:()=>GB,createAcoth:()=>ZB,createAcsc:()=>KB,createAcsch:()=>QB,createAdd:()=>t6,createAddScalar:()=>Y_,createAnd:()=>sw,createAndTransform:()=>TH,createApply:()=>gh,createApplyTransform:()=>rH,createArg:()=>Zk,createArrayNode:()=>m6,createAsec:()=>eL,createAsech:()=>rL,createAsin:()=>iL,createAsinh:()=>oL,createAssignmentNode:()=>v6,createAtan:()=>aL,createAtan2:()=>uL,createAtanh:()=>fL,createAtomicMass:()=>BU,createAvogadro:()=>LU,createBellNumbers:()=>dz,createBigNumberClass:()=>PF,createBignumber:()=>A_,createBin:()=>m5,createBitAnd:()=>Zy,createBitAndTransform:()=>IH,createBitNot:()=>$k,createBitOr:()=>Xy,createBitOrTransform:()=>FH,createBitXor:()=>Gk,createBlockNode:()=>g6,createBohrMagneton:()=>dU,createBohrRadius:()=>bU,createBoltzmann:()=>PU,createBoolean:()=>S_,createCatalan:()=>gz,createCbrt:()=>J_,createCeil:()=>Q_,createChain:()=>H7,createChainClass:()=>pP,createClassicalElectronRadius:()=>DU,createClone:()=>XF,createColumn:()=>Qy,createColumnTransform:()=>nH,createCombinations:()=>Sq,createCombinationsWithRep:()=>Mq,createCompare:()=>rB,createCompareNatural:()=>aB,createCompareText:()=>uB,createCompile:()=>P6,createComplex:()=>C_,createComplexClass:()=>zF,createComposition:()=>yz,createConcat:()=>Jy,createConcatTransform:()=>vH,createConditionalNode:()=>x6,createConductanceQuantum:()=>vU,createConj:()=>Kk,createConstantNode:()=>E6,createCorr:()=>Dq,createCos:()=>pL,createCosh:()=>hL,createCot:()=>vL,createCoth:()=>xL,createCoulomb:()=>mU,createCount:()=>l4,createCreateUnit:()=>zB,createCross:()=>c4,createCsc:()=>wL,createCsch:()=>DL,createCtranspose:()=>Z4,createCube:()=>ek,createCumSum:()=>Hw,createCumSumTransform:()=>EH,createDeepEqual:()=>gB,createDenseMatrixClass:()=>YF,createDerivative:()=>Iz,createDet:()=>W7,createDeuteronMass:()=>MU,createDiag:()=>m4,createDiff:()=>jy,createDiffTransform:()=>xH,createDistance:()=>fq,createDivide:()=>uq,createDivideScalar:()=>A5,createDot:()=>s6,createDotDivide:()=>z5,createDotMultiply:()=>Bk,createDotPow:()=>R5,createE:()=>Zz,createEfimovFactor:()=>kU,createEigs:()=>J7,createElectricConstant:()=>cU,createElectronMass:()=>NU,createElementaryCharge:()=>hU,createEqual:()=>lB,createEqualScalar:()=>y_,createEqualText:()=>cB,createErf:()=>n5,createEvaluate:()=>q6,createExp:()=>rk,createExpm:()=>j7,createExpm1:()=>ik,createFactorial:()=>kq,createFalse:()=>Hz,createFaraday:()=>RU,createFermiCoupling:()=>EU,createFft:()=>Q4,createFibonacciHeapClass:()=>MB,createFilter:()=>d4,createFilterTransform:()=>oH,createFineStructure:()=>SU,createFirstRadiation:()=>qU,createFix:()=>ok,createFlatten:()=>g4,createFloor:()=>Wy,createForEach:()=>y4,createForEachTransform:()=>aH,createFormat:()=>c5,createFraction:()=>M_,createFractionClass:()=>$F,createFreqz:()=>Pz,createFunctionAssignmentNode:()=>S6,createFunctionNode:()=>_6,createGamma:()=>Oq,createGasConstant:()=>UU,createGcd:()=>ck,createGetMatrixDataType:()=>b4,createGravitationConstant:()=>sU,createGravity:()=>KU,createHartreeEnergy:()=>AU,createHasNumericValue:()=>l_,createHelp:()=>z7,createHelpClass:()=>cP,createHex:()=>g5,createHypot:()=>n6,createI:()=>rU,createIdentity:()=>N4,createIfft:()=>e5,createIm:()=>Qk,createImmutableDenseMatrixClass:()=>SB,createIndex:()=>f6,createIndexClass:()=>CB,createIndexNode:()=>A6,createIndexTransform:()=>sH,createInfinity:()=>Wz,createIntersect:()=>cq,createInv:()=>G7,createInverseConductanceQuantum:()=>gU,createInvmod:()=>_k,createIsInteger:()=>JF,createIsNaN:()=>d_,createIsNegative:()=>o_,createIsNumeric:()=>s_,createIsPositive:()=>c_,createIsPrime:()=>N5,createIsZero:()=>m_,createKldivergence:()=>Lq,createKlitzing:()=>wU,createKron:()=>S4,createLN10:()=>Jz,createLN2:()=>Kz,createLOG10E:()=>jz,createLOG2E:()=>Qz,createLarger:()=>hB,createLargerEq:()=>dB,createLcm:()=>mk,createLeafCount:()=>bz,createLeftShift:()=>K5,createLgamma:()=>Fq,createLog:()=>F5,createLog10:()=>dk,createLog1p:()=>k5,createLog2:()=>gk,createLoschmidt:()=>zU,createLsolve:()=>H5,createLsolveAll:()=>G5,createLup:()=>W6,createLusolve:()=>uP,createLyap:()=>sq,createMad:()=>gq,createMagneticConstant:()=>fU,createMagneticFluxQuantum:()=>xU,createMap:()=>C4,createMapTransform:()=>lH,createMatrix:()=>O_,createMatrixClass:()=>VF,createMatrixFromColumns:()=>L_,createMatrixFromFunction:()=>F_,createMatrixFromRows:()=>k_,createMax:()=>dw,createMaxTransform:()=>fH,createMean:()=>$w,createMeanTransform:()=>cH,createMedian:()=>dq,createMin:()=>vw,createMinTransform:()=>pH,createMod:()=>Vy,createMode:()=>s5,createMolarMass:()=>ZU,createMolarMassC12:()=>XU,createMolarPlanckConstant:()=>HU,createMolarVolume:()=>$U,createMultinomial:()=>Rq,createMultiply:()=>wk,createMultiplyScalar:()=>xk,createNaN:()=>Vz,createNeutronMass:()=>TU,createNode:()=>c6,createNorm:()=>o6,createNot:()=>r4,createNthRoot:()=>Dk,createNthRoots:()=>L5,createNuclearMagneton:()=>yU,createNull:()=>$z,createNumber:()=>b_,createNumeric:()=>E5,createObjectNode:()=>C6,createOct:()=>d5,createOnes:()=>T4,createOperatorNode:()=>M6,createOr:()=>Ky,createOrTransform:()=>OH,createParenthesisNode:()=>T6,createParse:()=>B6,createParser:()=>H6,createParserClass:()=>z6,createPartitionSelect:()=>wB,createPermutations:()=>Uq,createPhi:()=>Xz,createPi:()=>Gz,createPickRandom:()=>sz,createPinv:()=>Z7,createPlanckCharge:()=>eH,createPlanckConstant:()=>uU,createPlanckLength:()=>JU,createPlanckMass:()=>QU,createPlanckTemperature:()=>tH,createPlanckTime:()=>jU,createPolynomialRoot:()=>fP,createPow:()=>M5,createPrint:()=>aw,createPrintTransform:()=>MH,createProd:()=>l5,createProtonMass:()=>CU,createQr:()=>G6,createQuantileSeq:()=>Vw,createQuantileSeqTransform:()=>DH,createQuantumOfCirculation:()=>OU,createRandom:()=>lz,createRandomInt:()=>cz,createRange:()=>rw,createRangeClass:()=>WF,createRangeNode:()=>O6,createRangeTransform:()=>mH,createRationalize:()=>_z,createRe:()=>e4,createReducedPlanckConstant:()=>lU,createRelationalNode:()=>I6,createReplacer:()=>qz,createReshape:()=>F4,createResize:()=>_4,createResolve:()=>Cz,createResultSet:()=>DF,createReviver:()=>Rz,createRightArithShift:()=>Q5,createRightLogShift:()=>eB,createRotate:()=>B4,createRotationMatrix:()=>P4,createRound:()=>O5,createRow:()=>nw,createRowTransform:()=>hH,createRydberg:()=>IU,createSQRT1_2:()=>eU,createSQRT2:()=>tU,createSackurTetrode:()=>WU,createSchur:()=>oq,createSec:()=>EL,createSech:()=>AL,createSecondRadiation:()=>VU,createSetCartesian:()=>BL,createSetDifference:()=>PL,createSetDistinct:()=>qL,createSetIntersect:()=>UL,createSetIsSubset:()=>$L,createSetMultiplicity:()=>VL,createSetPowerset:()=>YL,createSetSize:()=>XL,createSetSymDifference:()=>JL,createSetUnion:()=>jL,createSign:()=>Ek,createSimplify:()=>Nz,createSimplifyConstant:()=>Ez,createSimplifyCore:()=>Az,createSin:()=>ML,createSinh:()=>OL,createSize:()=>z4,createSlu:()=>aP,createSmaller:()=>pB,createSmallerEq:()=>mB,createSolveODE:()=>r5,createSort:()=>DB,createSpaClass:()=>TB,createSparse:()=>RB,createSparseMatrixClass:()=>w_,createSpeedOfLight:()=>aU,createSplitUnit:()=>R_,createSqrt:()=>Sk,createSqrtm:()=>tq,createSquare:()=>Ck,createSqueeze:()=>H4,createStd:()=>Gw,createStdTransform:()=>yH,createStefanBoltzmann:()=>GU,createStirlingS2:()=>mz,createString:()=>N_,createSubset:()=>iw,createSubsetTransform:()=>dH,createSubtract:()=>Tk,createSubtractScalar:()=>X_,createSum:()=>zw,createSumTransform:()=>bH,createSylvester:()=>nq,createSymbolNode:()=>F6,createSymbolicEqual:()=>Tz,createTan:()=>FL,createTanh:()=>_L,createTau:()=>Yz,createThomsonCrossSection:()=>FU,createTo:()=>b5,createTrace:()=>u6,createTranspose:()=>G4,createTrue:()=>Uz,createTypeOf:()=>g_,createTyped:()=>bF,createUnaryMinus:()=>z_,createUnaryPlus:()=>H_,createUnequal:()=>xB,createUnitClass:()=>kB,createUnitFunction:()=>LB,createUppercaseE:()=>iU,createUppercasePi:()=>nU,createUsolve:()=>W5,createUsolveAll:()=>Z5,createVacuumImpedance:()=>pU,createVariance:()=>Ww,createVarianceTransform:()=>AH,createVersion:()=>oU,createWeakMixingAngle:()=>_U,createWienDisplacement:()=>YU,createXgcd:()=>Ik,createXor:()=>o4,createZeros:()=>K4,createZeta:()=>o5,createZpk2tf:()=>Bz});v();x();g();v();x();g();var mS=en(by(),1);v();x();g();function Nt(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}var za=Math.sign||function(e){return e>0?1:e<0?-1:0},GI=Math.log2||function(t){return Math.log(t)/Math.LN2},YI=Math.log10||function(t){return Math.log(t)/Math.LN10},Dy=Math.log1p||function(e){return Math.log(e+1)},ZI=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},XI=Math.expm1||function(t){return t>=2e-4||t<=-2e-4?Math.exp(t)-1:t+t*t/2+t*t*t/6};function jE(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 Ms(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}=eS(t);switch(r){case"fixed":return tS(e,n);case"exponential":return KI(e,n);case"engineering":return vne(e,n);case"bin":return jE(e,2,i);case"oct":return jE(e,8,i);case"hex":return jE(e,16,i);case"auto":return gne(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 eS(e){var t="auto",r,n;if(e!==void 0)if(Ht(e))r=e;else if(_t(e))r=e.toNumber();else if(Du(e))e.precision!==void 0&&(r=WI(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),e.wordSize!==void 0&&(n=WI(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 sh(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 vne(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=sh(e),n=Ny(r,t),i=n.exponent,o=n.coefficients,u=i%3===0?i:i<0?i-3-i%3:i-i%3;if(Ht(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=Ht(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 tS(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=sh(e),n=typeof t=="number"?Ny(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 gne(e,t,r){if(isNaN(e)||!isFinite(e))return String(e);var n=VI(r?.lowerExp,-3),i=VI(r?.upperExp,5),o=sh(e),u=t?Ny(o,t):o;if(u.exponent=i)return KI(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 ah(e){for(var t=[],r=0;r0?!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 WI(e,t){if(Ht(e))return e;if(_t(e))return e.toNumber();t()}function VI(e,t){return Ht(e)?e:_t(e)?e.toNumber():t}v();x();g();v();x();g();v();x();g();v();x();g();function rS(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 oF(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}=eS(t);switch(r){case"fixed":return wne(e,n);case"exponential":return nF(e,n);case"engineering":return yne(e,n);case"bin":return rS(e,2,i);case"oct":return rS(e,8,i);case"hex":return rS(e,16,i);case"auto":{var o=iF(t?.lowerExp,-3),u=iF(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 nF(e,t){return t!==void 0?e.toExponential(t-1):e.toExponential()}function wne(e,t){return e.toFixed(t)}function iF(e,t){return Ht(e)?e:_t(e)?e.toNumber():t}function sF(e,t){var r=e.length-t.length,n=e.length;return e.substring(r,n)===t}function Zt(e,t){var r=bne(e,t);return t&&typeof t=="object"&&"truncate"in t&&r.length>t.truncate?r.substring(0,t.truncate-3)+"...":r}function bne(e,t){if(typeof e=="number")return Ms(e,t);if(_t(e))return oF(e,t);if(Dne(e))return!t||t.fraction!=="decimal"?e.s*e.n+"/"+e.d:e.toString();if(Array.isArray(e))return uF(e,t);if(dn(e))return op(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=>op(n)+": "+Zt(e[n],t));return"{"+r.join(", ")+"}"}return String(e)}function op(e){for(var t=String(e),r="",n=0;n/g,">"),t}function uF(e,t){if(Array.isArray(e)){for(var r="[",n=e.length,i=0;it?1:-1}v();x();g();function Kt(e,t,r){if(!(this instanceof Kt))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}Kt.prototype=new RangeError;Kt.prototype.constructor=RangeError;Kt.prototype.name="DimensionError";Kt.prototype.isDimensionError=!0;v();x();g();function bi(e,t,r){if(!(this instanceof bi))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}bi.prototype=new RangeError;bi.prototype.constructor=RangeError;bi.prototype.name="IndexError";bi.prototype.isIndexError=!0;function $t(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function lF(e,t,r){var n,i=e.length;if(i!==t[r])throw new Kt(i,t[r]);if(r")}function iS(e,t){var r=t.length===0;if(r){if(Array.isArray(e))throw new Kt(e.length,0)}else lF(e,t,0)}function gg(e,t){var r=e.isMatrix?e._size:$t(e),n=t._sourceSize;n.forEach((i,o)=>{if(i!==null&&i!==r[o])throw new Kt(i,r[o])})}function Br(e,t){if(e!==void 0){if(!Ht(e)||!Nt(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof t=="number"&&e>=t)throw new bi(e,t)}}function ap(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 fF(e){return e.reduce((t,r)=>t*r,1)}function Nne(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 oS(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 mF(r,n,t,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function Ene(){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 uS(e,t){var r=$t(e);if(Cs(r,t))return e;wg(r,t);var n=Ene(r,t),i=n.length,o=[...Array(i-r.length).fill(1),...r],u=Ane(e);r.length!Mne(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 Mne(e){return e&&e[0]==="?"}function lS(e){return e&&e[0]==="?"?e.slice(1):e}v();x();g();v();x();g();function fn(e,t){if(gF(e)&&dF(e,t))return e[t];throw typeof e[t]=="function"&&Ty(e,t)?new Error('Cannot access method "'+t+'" as a property'):new Error('No access to property "'+t+'"')}function Eu(e,t,r){if(gF(e)&&dF(e,t))return e[t]=r,r;throw new Error('No access to property "'+t+'"')}function hF(e,t){return t in e}function dF(e,t){return!e||typeof e!="object"?!1:St(Tne,t)?!0:!(t in Object.prototype||t in Function.prototype)}function vF(e,t){if(!Ty(e,t))throw new Error('No access to method "'+t+'"');return e[t]}function Ty(e,t){return e==null||typeof e[t]!="function"||St(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)?!1:St(One,t)?!0:!(t in Object.prototype||t in Function.prototype)}function gF(e){return typeof e=="object"&&e&&e.constructor===Object}var Tne={length:!0,name:!0},One={toString:!0,valueOf:!0,toLocaleString:!0};var up=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 hF(this.wrappedObject,t)}entries(){return xF(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}},ch=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 xF(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 xF(e,t){return{next:()=>{var r=e.next();return r.done?r:{value:t(r.value),done:!1}}}}function Ef(){return new Map}function yl(e){if(!e)return Ef();if(fS(e))return e;if(Du(e))return new up(e);throw new Error("createMap can create maps from objects or Maps")}function yF(e){if(e instanceof up)return e.wrappedObject;var t={};for(var r of e.keys()){var n=e.get(r);Eu(t,r,n)}return t}function fS(e){return e?e instanceof Map||e instanceof up||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}var wF=function(){return wF=mS.default.create,mS.default},Ine=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],bF=K("typed",Ine,function(t){var{BigNumber:r,Complex:n,DenseMatrix:i,Fraction:o}=t,u=wF();return u.clear(),u.addTypes([{name:"number",test:Ht},{name:"Complex",test:gi},{name:"BigNumber",test:_t},{name:"Fraction",test:la},{name:"Unit",test:ri},{name:"identifier",test:l=>dn&&/^(?:[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\uA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uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\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]|\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\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[\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]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(l)},{name:"string",test:dn},{name:"Chain",test:nh},{name:"Array",test:fr},{name:"Matrix",test:Et},{name:"DenseMatrix",test:gl},{name:"SparseMatrix",test:fa},{name:"Range",test:bf},{name:"Index",test:bu},{name:"boolean",test:uy},{name:"ResultSet",test:ly},{name:"Help",test:rh},{name:"function",test:fy},{name:"Date",test:cy},{name:"RegExp",test:py},{name:"null",test:my},{name:"undefined",test:hy},{name:"AccessorNode",test:To},{name:"ArrayNode",test:xi},{name:"AssignmentNode",test:dy},{name:"BlockNode",test:vy},{name:"ConditionalNode",test:gy},{name:"ConstantNode",test:ir},{name:"FunctionNode",test:Ki},{name:"FunctionAssignmentNode",test:qa},{name:"IndexNode",test:qo},{name:"Node",test:lr},{name:"ObjectNode",test:Nu},{name:"OperatorNode",test:Xr},{name:"ParenthesisNode",test:yi},{name:"RangeNode",test:xy},{name:"RelationalNode",test:yy},{name:"SymbolNode",test:Rr},{name:"Map",test:fS},{name:"Object",test:Du}]),u.addConversions([{from:"number",to:"BigNumber",convert:function(a){if(r||cS(a),JI(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||Oy(a),new n(a,0)}},{from:"BigNumber",to:"Complex",convert:function(a){return n||Oy(a),new n(a.toNumber(),0)}},{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||Oy(a),new n(a.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(a){o||pS(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||cS(a);try{return new r(a)}catch{throw new Error('Cannot convert "'+a+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(a){o||pS(a);try{return new o(a)}catch{throw new Error('Cannot convert "'+a+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(a){n||Oy(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||cS(a),new r(+a)}},{from:"boolean",to:"Fraction",convert:function(a){return o||pS(a),new o(+a)}},{from:"boolean",to:"string",convert:function(a){return String(a)}},{from:"Array",to:"Matrix",convert:function(a){return i||Fne(),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 cS(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function Oy(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function Fne(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function pS(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}v();x();g();var _ne="ResultSet",kne=[],DF=K(_ne,kne,()=>{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});v();x();g();v();x();g();var ph=9e15,Mf=1e9,hS="0123456789abcdef",Fy="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",_y="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",dS={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ph,maxE:ph,crypto:!1},AF,wl,cr=!0,By="[DecimalError] ",Cf=By+"Invalid argument: ",CF=By+"Precision limit exceeded",MF=By+"crypto unavailable",TF="[object Decimal]",lo=Math.floor,Di=Math.pow,Bne=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Lne=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Pne=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,OF=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Is=1e7,or=7,Rne=9007199254740991,qne=Fy.length-1,vS=_y.length-1,xt={toStringTag:TF};xt.absoluteValue=xt.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),jt(e)};xt.ceil=function(){return jt(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(Cf+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())+or,n.rounding=1,r=zne(n,BF(n,r)),n.precision=e,n.rounding=t,jt(wl==2||wl==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(cr=!1,o=f.s*Di(f.s*f,1/3),!o||Math.abs(o)==1/0?(r=Ji(f.d),e=f.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=Di(r,1/3),e=lo((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),Ji(l.d).slice(0,u)===(r=Ji(n.d)).slice(0,u))if(r=r.slice(u-3,u+1),r=="9999"||!i&&r=="4999"){if(!i&&(jt(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")&&(jt(n,e+1,1),t=!n.times(n).times(n).eq(f));break}return cr=!0,jt(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-lo(this.e/or))*or,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 jt(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 jt(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=mh(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 jt(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=mh(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=mh(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,jt(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()?Os(r,i,o):new r(0):new r(NaN):t.isZero()?Os(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=Os(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,cr=!1,r=r.times(r).minus(1).sqrt().plus(r),cr=!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,cr=!1,r=r.times(r).plus(1).sqrt().plus(r),cr=!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?jt(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=Os(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<=vS)return u=Os(f,p+4,h).times(.25),u.s=s.s,u}else{if(!s.s)return new f(NaN);if(p+4<=vS)return u=Os(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/or+2|0),e=r;e;--e)s=s.div(s.times(s).plus(1).sqrt().plus(1));for(cr=!1,t=Math.ceil(l/or),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(cr=!1,l=p+y,u=Af(s,l),n=t?ky(f,l+10):Af(e,l),a=cn(u,n,l,1),bg(a.d,i=p,h))do if(l+=10,u=Af(s,l),n=t?ky(f,l+10):Af(e,l),a=cn(u,n,l,1),!o){+Ji(a.d).slice(i+1,i+15)+1==1e14&&(a=jt(a,p+1,0));break}while(bg(a.d,i+=10,h));return cr=!0,jt(a,p,h)};xt.minus=xt.sub=function(e){var t,r,n,i,o,u,l,a,s,f,p,h,y=this,N=y.constructor;if(e=new N(e),!y.d||!e.d)return!y.s||!e.s?e=new N(NaN):y.d?e.s=-e.s:e=new N(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=N.precision,a=N.rounding,!s[0]||!h[0]){if(h[0])e.s=-e.s;else if(s[0])e=new N(y);else return new N(a===3?-0:0);return cr?jt(e,l,a):e}if(r=lo(e.e/or),f=lo(y.e/or),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/or),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)/Is|0,s[i]%=Is;for(t&&(s.unshift(t),++n),u=s.length;s[--u]==0;)s.pop();return e.d=s,e.e=Ly(s,n),cr?jt(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(Cf+e);return r.d?(t=IF(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};xt.round=function(){var e=this,t=e.constructor;return jt(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())+or,n.rounding=1,r=Hne(n,BF(n,r)),n.precision=e,n.rounding=t,jt(wl>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(cr=!1,s=Math.sqrt(+u),s==0||s==1/0?(t=Ji(l),(t.length+a)%2==0&&(t+="0"),s=Math.sqrt(t),a=lo((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),Ji(o.d).slice(0,r)===(t=Ji(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(jt(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")&&(jt(n,a+1,1),e=!n.times(n).eq(u));break}return cr=!0,jt(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,jt(wl==2||wl==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=lo(f.e/or)+lo(e.e/or),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%Is|0,t=l/Is|0;o[i]=(o[i]+t)%Is|0}for(;!o[--u];)o.pop();return t?++r:o.shift(),e.d=o,e.e=Ly(o,r),cr?jt(e,p.precision,p.rounding):e};xt.toBinary=function(e,t){return yS(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:(Uo(e,0,Mf),t===void 0?t=n.rounding:Uo(t,0,8),jt(r,e+r.e+1,t))};xt.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Su(n,!0):(Uo(e,0,Mf),t===void 0?t=i.rounding:Uo(t,0,8),n=jt(new i(n),e+1,t),r=Su(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=Su(i):(Uo(e,0,Mf),t===void 0?t=o.rounding:Uo(t,0,8),n=jt(new o(i),e+i.e+1,t),r=Su(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,N=y.d,w=y.constructor;if(!N)return new w(y);if(s=r=new w(1),n=a=new w(0),t=new w(n),o=t.e=IF(N)-y.e-1,u=o%or,t.d[0]=Di(10,u<0?or+u:u),e==null)e=o>0?t:s;else{if(l=new w(e),!l.isInt()||l.lt(s))throw Error(Cf+l);e=l.gt(t)?o>0?t:s:l}for(cr=!1,l=new w(Ji(N)),f=w.precision,w.precision=o=N.length*or*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,cr=!0,h};xt.toHexadecimal=xt.toHex=function(e,t){return yS(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:Uo(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]?(cr=!1,r=cn(r,e,0,t,1).times(e),cr=!0,jt(r)):(e.s=r.s,r=e),r};xt.toNumber=function(){return+this};xt.toOctal=function(e,t){return yS(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(Di(+l,s));if(l=new a(l),l.eq(1))return l;if(n=a.precision,o=a.rounding,e.eq(1))return jt(l,n,o);if(t=lo(e.e/or),t>=e.d.length-1&&(r=s<0?-s:s)<=Rne)return i=FF(a,l,r,n),e.s<0?new a(1).div(i):jt(i,n,o);if(u=l.s,u<0){if(ta.maxE+1||t0?u/0:0):(cr=!1,a.rounding=l.s=1,r=Math.min(12,(t+"").length),i=gS(e.times(Af(l,n+r)),n),i.d&&(i=jt(i,n+5,1),bg(i.d,n,o)&&(t=n+10,i=jt(gS(e.times(Af(l,t+r)),t),t+5,1),+Ji(i.d).slice(n+1,n+15)+1==1e14&&(i=jt(i,n+1,0)))),i.s=u,cr=!0,a.rounding=o,jt(i,n,o))};xt.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Su(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Uo(e,1,Mf),t===void 0?t=i.rounding:Uo(t,0,8),n=jt(new i(n),e,t),r=Su(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):(Uo(e,1,Mf),t===void 0?t=n.rounding:Uo(t,0,8)),jt(new n(r),e,t)};xt.toString=function(){var e=this,t=e.constructor,r=Su(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};xt.truncated=xt.trunc=function(){return jt(new this.constructor(this),this.e+1,1)};xt.valueOf=xt.toJSON=function(){var e=this,t=e.constructor,r=Su(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Ji(e){var t,r,n,i=e.length-1,o="",u=e[0];if(i>0){for(o+=u,t=1;tr)throw Error(Cf+e)}function bg(e,t,r,n){var i,o,u,l;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=or,i=0):(i=Math.ceil((t+1)/or),t%=or),o=Di(10,or-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)==Di(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)==Di(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 zne(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=mh(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,N,w,D,b,O,M,I,F,C,P,R,q,z,H,V,W=n.constructor,ee=n.s==i.s?1:-1,ie=n.d,X=i.d;if(!ie||!ie[0]||!X||!X[0])return new W(!n.s||!i.s||(ie?X&&ie[0]==X[0]:!X)?NaN:ie&&ie[0]==0||!X?ee*0:ee/0);for(a?(y=1,f=n.e-i.e):(a=Is,y=or,f=lo(n.e/y)-lo(i.e/y)),H=X.length,q=ie.length,b=new W(ee),O=b.d=[],p=0;X[p]==(ie[p]||0);p++);if(X[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),N=!0;else{if(C=C/y+2|0,p=0,H==1){for(h=0,X=X[0],C++;(p1&&(X=e(X,h,a),ie=e(ie,h,a),H=X.length,q=ie.length),R=H,M=ie.slice(0,H),I=M.length;I=a/2&&++z;do h=0,s=t(X,M,H,I),s<0?(F=M[0],H!=I&&(F=F*a+(M[1]||0)),h=F/z|0,h>1?(h>=a&&(h=a-1),w=e(X,h,a),D=w.length,I=M.length,s=t(w,M,D,I),s==1&&(h--,r(w,H=10;h/=10)p++;b.e=p+f*y-1,jt(b,l?o+b.e+1:o,u,N)}return b}}();function jt(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+=or,u=t,f=p[h=0],a=f/Di(10,i-u-1)%10|0;else if(h=Math.ceil((o+1)/or),l=p.length,h>=l)if(n){for(;l++<=h;)p.push(0);f=a=0,i=1,o%=or,u=o-or+1}else break e;else{for(f=l=p[h],i=1;l>=10;l/=10)i++;o%=or,u=o-or+i,a=u<0?0:f/Di(10,i-u-1)%10|0}if(n=n||t<0||p[h+1]!==void 0||(u<0?f:f%Di(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/Di(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]=Di(10,(or-t%or)%or),e.e=-t||0):p[0]=e.e=0,e;if(o==0?(p.length=h,l=1,h--):(p.length=h+1,l=Di(10,or-o),p[h]=u>0?(f/Di(10,i-u)%Di(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]==Is&&(p[0]=1));break}else{if(p[h]+=l,p[h]!=Is)break;p[h--]=0,l=1}for(o=p.length;p[--o]===0;)p.pop()}return cr&&(e.e>y.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+Sf(n):u>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Sf(-i-1)+o,r&&(n=r-u)>0&&(o+=Sf(n))):i>=u?(o+=Sf(i+1-u),r&&(n=r-i-1)>0&&(o=o+"."+Sf(n))):((n=i+1)0&&(i+1===u&&(o+="."),o+=Sf(n))),o}function Ly(e,t){var r=e[0];for(t*=or;r>=10;r/=10)t++;return t}function ky(e,t,r){if(t>qne)throw cr=!0,r&&(e.precision=r),Error(CF);return jt(new e(Fy),t,1,!0)}function Os(e,t,r){if(t>vS)throw Error(CF);return jt(new e(_y),t,r,!0)}function IF(e){var t=e.length-1,r=t*or+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 Sf(e){for(var t="";e--;)t+="0";return t}function FF(e,t,r,n){var i,o=new e(1),u=Math.ceil(n/or+4);for(cr=!1;;){if(r%2&&(o=o.times(t),EF(o.d,u)&&(i=!0)),r=lo(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),EF(t.d,u)}return cr=!0,o}function NF(e){return e.d[e.d.length-1]&1}function _F(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?(cr=!1,a=N):a=t,l=new h(.03125);e.e>-2;)e=e.times(l),p+=5;for(n=Math.log(Di(2,p))/Math.LN10*2+5|0,a+=n,r=o=u=new h(1),h.precision=a;;){if(o=jt(o.times(e),a,1),r=r.times(++f),l=u.plus(cn(o,r,a,1)),Ji(l.d).slice(0,a)===Ji(u.d).slice(0,a)){for(i=p;i--;)u=jt(u.times(u),a,1);if(t==null)if(s<3&&bg(u.d,a-n,y,s))h.precision=a+=10,r=o=l=new h(1),f=0,s++;else return jt(u,h.precision=N,y,cr=!0);else return h.precision=N,u}u=l}}function Af(e,t){var r,n,i,o,u,l,a,s,f,p,h,y=1,N=10,w=e,D=w.d,b=w.constructor,O=b.rounding,M=b.precision;if(w.s<0||!D||!D[0]||!w.e&&D[0]==1&&D.length==1)return new b(D&&!D[0]?-1/0:w.s!=1?NaN:D?0:w);if(t==null?(cr=!1,f=M):f=t,b.precision=f+=N,r=Ji(D),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=Ji(w.d),n=r.charAt(0),y++;o=w.e,n>1?(w=new b("0."+r),o++):w=new b(n+"."+r.slice(1))}else return s=ky(b,f+2,M).times(o+""),w=Af(new b(n+"."+r.slice(1)),f-N).plus(s),b.precision=M,t==null?jt(w,M,O,cr=!0):w;for(p=w,a=u=w=cn(w.minus(1),w.plus(1),f,1),h=jt(w.times(w),f,1),i=3;;){if(u=jt(u.times(h),f,1),s=a.plus(cn(u,new b(i),f,1)),Ji(s.d).slice(0,f)===Ji(a.d).slice(0,f))if(a=a.times(2),o!==0&&(a=a.plus(ky(b,f+2,M).times(o+""))),a=cn(a,new b(y),f,1),t==null)if(bg(a.d,f-N,O,l))b.precision=f+=N,s=u=w=cn(p.minus(1),p.plus(1),f,1),h=jt(w.times(w),f,1),i=l=1;else return jt(a,b.precision=M,O,cr=!0);else return b.precision=M,a;a=s,i+=2}}function kF(e){return String(e.s*e.s/0)}function xS(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)%or,r<0&&(n+=or),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),OF.test(t))return xS(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Lne.test(t))r=16,t=t.toLowerCase();else if(Bne.test(t))r=2;else if(Pne.test(t))r=8;else throw Error(Cf+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=FF(n,new n(r),o,o*2)),s=Iy(t,r,Is),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,cr=!1,u&&(e=cn(e,i,l*4)),a&&(e=e.times(Math.abs(a)<54?Di(2,a):Dg.pow(2,a))),cr=!0,e)}function Hne(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:mh(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/Py(5,r)),t=mh(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 mh(e,t,r,n,i){var o,u,l,a,s=1,f=e.precision,p=Math.ceil(f/or);for(cr=!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 cr=!0,u.d.length=p+1,u}function Py(e,t){for(var r=e;--t;)r*=e;return r}function BF(e,t){var r,n=t.s<0,i=Os(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return wl=n?4:1,t;if(r=t.divToInt(i),r.isZero())wl=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return wl=NF(r)?n?2:3:n?4:1,t;wl=NF(r)?n?1:4:n?3:2}return t.minus(i).abs()}function yS(e,t,r,n){var i,o,u,l,a,s,f,p,h,y=e.constructor,N=r!==void 0;if(N?(Uo(r,1,Mf),n===void 0?n=y.rounding:Uo(n,0,8)):(r=y.precision,n=y.rounding),!e.isFinite())f=kF(e);else{for(f=Su(e),u=f.indexOf("."),N?(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(Su(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=N?"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=AF),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 $ne(e){return new this(e).abs()}function Wne(e){return new this(e).acos()}function Vne(e){return new this(e).acosh()}function Gne(e,t){return new this(e).plus(t)}function Yne(e){return new this(e).asin()}function Zne(e){return new this(e).asinh()}function Xne(e){return new this(e).atan()}function Kne(e){return new this(e).atanh()}function Jne(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=Os(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?Os(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=Os(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=Os(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 Qne(e){return new this(e).cbrt()}function jne(e){return jt(e=new this(e),e.e+1,2)}function eie(e,t,r){return new this(e).clamp(t,r)}function tie(e){if(!e||typeof e!="object")throw Error(By+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Mf,"rounding",0,8,"toExpNeg",-ph,0,"toExpPos",0,ph,"maxE",0,ph,"minE",-ph,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Cf+r+": "+n);if(r="crypto",i&&(this[r]=dS[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(MF);else this[r]=!1;else throw Error(Cf+r+": "+n);return this}function rie(e){return new this(e).cos()}function nie(e){return new this(e).cosh()}function LF(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,SF(o)){s.s=o.s,cr?!o.d||o.e>i.maxE?(s.e=NaN,s.d=null):o.e=10;l/=10)u++;cr?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(MF);else for(;o=10;i/=10)n++;n{var{on:t,config:r}=e,n=lp.clone({precision:r.precision,modulo:lp.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});v();x();g();var Fi=en(qF(),1);var Oie="Complex",Iie=[],zF=K(Oie,Iie,()=>(Object.defineProperty(Fi.default,"name",{value:"Complex"}),Fi.default.prototype.constructor=Fi.default,Fi.default.prototype.type="Complex",Fi.default.prototype.isComplex=!0,Fi.default.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},Fi.default.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},Fi.default.prototype.format=function(e){var t="",r=this.im,n=this.re,i=Ms(this.re,e),o=Ms(this.im,e),u=Ht(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.im(Object.defineProperty(Au.default,"name",{value:"Fraction"}),Au.default.prototype.constructor=Au.default,Au.default.prototype.type="Fraction",Au.default.prototype.isFraction=!0,Au.default.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Au.default.fromJSON=function(e){return new Au.default(e)},Au.default),{isClass:!0});v();x();g();var kie="Range",Bie=[],WF=K(kie,Bie,()=>{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(_t(t))t=t.toNumber();else if(typeof t!="number")throw new TypeError("Parameter start must be a number")}if(o){if(_t(r))r=r.toNumber();else if(typeof r!="number")throw new TypeError("Parameter end must be a number")}if(u){if(_t(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 za(n)===za(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=Ms(this.start,t);return this.step!==1&&(r+=":"+Ms(this.step,t)),r+=":"+Ms(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});v();x();g();var Lie="Matrix",Pie=[],VF=K(Lie,Pie,()=>{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});v();x();g();v();x();g();v();x();g();function GF(e){var t=0,r=1,n=Object.create(null),i=Object.create(null),o=0,u=function(a){var s=i[a];if(s&&(delete n[s],delete i[a],--t,r===s)){if(!t){o=0,r=1;return}for(;!Object.prototype.hasOwnProperty.call(n,++r););}};return e=Math.abs(e),{hit:function(a){var s=i[a],f=++o;if(n[f]=a,i[a]=f,!s)return++t,t<=e?void 0:(a=n[r],u(a),a);if(delete n[s],r===s)for(;!Object.prototype.hasOwnProperty.call(n,++r););},delete:u,clear:function(){t=o=0,r=1,n=Object.create(null),i=Object.create(null)}}}function fp(e){var{hasher:t,limit:r}=arguments.length>1&&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:GF(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&&!dn(p))throw new Error("Invalid datatype: "+p);if(Et(f))f.type==="DenseMatrix"?(this._data=Bt(f._data),this._size=Bt(f._size),this._datatype=p||f._datatype):(this._data=f.toArray(),this._size=f.size(),this._datatype=p||f._datatype);else if(f&&fr(f.data)&&fr(f.size))this._data=f.data,this._size=f.size,iS(this._data,this._size),this._datatype=p||f.datatype;else if(fr(f))this._data=s(f),this._size=$t(this._data),iS(this._data,this._size),this._datatype=p;else{if(f)throw new TypeError("Unsupported type of data ("+hr(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 Nf(this._data,hr)},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(!fr(f))throw new TypeError("Array expected");if(f.length!==this._size.length)throw new Kt(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=N.length,F=0;u(f._data,p,h,I,F)}return f}function u(f,p,h,y,N){var w=N===y-1,D=p.dimension(N);w?D.forEach(function(b,O){Br(b),f[b]=h[O[0]]}):D.forEach(function(b,O){Br(b),u(f[b],p,h[O[0]],y,N+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),N=h?this.clone():this;return l(N,y,p)};function l(f,p,h){if(p.length===0){for(var y=f._data;fr(y);)y=y[0];return y}return f._size=p.slice(0),f._data=Ts(f._data,f._size,h),f}r.prototype.reshape=function(f,p){var h=p?this.clone():this;h._data=xg(h._data,f);var y=h._size.reduce((N,w)=>N*w);return h._size=yg(f,y),h};function a(f,p,h){for(var y=f._size.slice(0),N=!1;y.lengthy[w]&&(y[w]=p[w],N=!0);N&&l(f,y,h)}r.prototype.clone=function(){var f=new r({data:Bt(this._data),size:Bt(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=Ry(f),y=function D(b,O){return fr(b)?b.map(function(M,I){return D(M,O.concat(I))}):h===1?f(b):h===2?f(b,O):f(b,O,p)},N=y(this._data,[]),w=this._datatype!==void 0?Nf(N,hr):void 0;return new r(N,w)},r.prototype.forEach=function(f){var p=this,h=function y(N,w){fr(N)?N.forEach(function(D,b){y(D,w.concat(b))}):f(N,w,p)};h(this._data,[])},r.prototype[Symbol.iterator]=function*(){var f=function*p(h,y){if(fr(h))for(var N=0;N[M[b]]);p.push(new r(O,f._datatype))},w=0;w0?f:0,h=f<0?-f:0,y=this._size[0],N=this._size[1],w=Math.min(y-h,N-p),D=[],b=0;b0?h:0,w=h<0?-h:0,D=f[0],b=f[1],O=Math.min(D-w,b-N),M;if(fr(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};y||(y=_t(M(0))?M(0).mul(0):0);var F=[];if(f.length>0){F=Ts(F,f,y);for(var C=0;C{var{typed:t}=e;return t(ZF,{any:Bt})});v();x();g();v();x();g();v();x();g();function qy(e){var t=e.length,r=e[0].length,n,i,o=[];for(i=0;i=n.length)throw new bi(t,n.length);return Et(e)?e.create(zy(e.valueOf(),t,r)):zy(e,t,r)}function zy(e,t,r){var n,i,o,u;if(t<=0)if(Array.isArray(e[0])){for(u=qy(e),i=[],n=0;n{var{typed:t}=e;return t(KF,{number:Nt,BigNumber:function(n){return n.isInt()},Fraction:function(n){return n.d===1&&isFinite(n.n)},"Array | Matrix":t.referToSelf(r=>n=>Ot(n,r))})});v();x();g();v();x();g();var Ho="number",bl="number, number";function NS(e){return Math.abs(e)}NS.signature=Ho;function ES(e,t){return e+t}ES.signature=bl;function SS(e,t){return e-t}SS.signature=bl;function AS(e,t){return e*t}AS.signature=bl;function Hie(e,t){return e/t}Hie.signature=bl;function CS(e){return-e}CS.signature=Ho;function MS(e){return e}MS.signature=Ho;function hh(e){return ZI(e)}hh.signature=Ho;function TS(e){return e*e*e}TS.signature=Ho;function OS(e){return Math.exp(e)}OS.signature=Ho;function IS(e){return XI(e)}IS.signature=Ho;function $ie(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}$ie.signature=bl;function FS(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)}FS.signature=bl;function QF(e,t){return t?Math.log(e)/Math.log(t):Math.log(e)}function _S(e){return YI(e)}_S.signature=Ho;function kS(e){return GI(e)}kS.signature=Ho;function Wie(e){return Dy(e)}Wie.signature=Ho;function Vie(e,t){return t===0?e:e-t*Math.floor(e/t)}Vie.signature=bl;function BS(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 Uy(e){return za(e)}Uy.signature=Ho;function Gie(e){return Math.sqrt(e)}Gie.signature=Ho;function LS(e){return e*e}LS.signature=Ho;function PS(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}PS.signature=bl;function RS(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}RS.signature=bl;function dh(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(tS(e,t))}function Yie(e){return Math.abs(e)}Yie.signature=Ho;v();x();g();var Zie="number",vh="number, number";function qS(e,t){if(!Nt(e)||!Nt(t))throw new Error("Integers expected in function bitAnd");return e&t}qS.signature=vh;function zS(e){if(!Nt(e))throw new Error("Integer expected in function bitNot");return~e}zS.signature=Zie;function US(e,t){if(!Nt(e)||!Nt(t))throw new Error("Integers expected in function bitOr");return e|t}US.signature=vh;function HS(e,t){if(!Nt(e)||!Nt(t))throw new Error("Integers expected in function bitXor");return e^t}HS.signature=vh;function $S(e,t){if(!Nt(e)||!Nt(t))throw new Error("Integers expected in function leftShift");return e<>t}WS.signature=vh;function VS(e,t){if(!Nt(e)||!Nt(t))throw new Error("Integers expected in function rightLogShift");return e>>>t}VS.signature=vh;v();x();g();v();x();g();function ca(e,t){if(t>1;return ca(e,r)*ca(r+1,t)}function GS(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:ca(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*Ng(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=cp[0];for(var u=1;u=1;n--)r+=n_[n]/(e+n);return jS+(e+.5)*Math.log(t)-t+Math.log(r)}Eg.signature="number";v();x();g();var Cn="number",Qie="number, number";function jie(e){return Math.acos(e)}jie.signature=Cn;function eA(e){return QI(e)}eA.signature=Cn;function tA(e){return Math.atan(1/e)}tA.signature=Cn;function rA(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}rA.signature=Cn;function nA(e){return Math.asin(1/e)}nA.signature=Cn;function iA(e){var t=1/e;return Math.log(t+Math.sqrt(t*t+1))}iA.signature=Cn;function oA(e){return Math.acos(1/e)}oA.signature=Cn;function aA(e){var t=1/e,r=Math.sqrt(t*t-1);return Math.log(r+t)}aA.signature=Cn;function eoe(e){return Math.asin(e)}eoe.signature=Cn;function sA(e){return jI(e)}sA.signature=Cn;function toe(e){return Math.atan(e)}toe.signature=Cn;function roe(e,t){return Math.atan2(e,t)}roe.signature=Qie;function uA(e){return eF(e)}uA.signature=Cn;function noe(e){return Math.cos(e)}noe.signature=Cn;function ioe(e){return Ey(e)}ioe.signature=Cn;function lA(e){return 1/Math.tan(e)}lA.signature=Cn;function fA(e){var t=Math.exp(2*e);return(t+1)/(t-1)}fA.signature=Cn;function cA(e){return 1/Math.sin(e)}cA.signature=Cn;function pA(e){return e===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*za(e)}pA.signature=Cn;function mA(e){return 1/Math.cos(e)}mA.signature=Cn;function hA(e){return 2/(Math.exp(e)+Math.exp(-e))}hA.signature=Cn;function ooe(e){return Math.sin(e)}ooe.signature=Cn;function dA(e){return tF(e)}dA.signature=Cn;function aoe(e){return Math.tan(e)}aoe.signature=Cn;function soe(e){return Sy(e)}soe.signature=Cn;v();x();g();var Sg="number";function uoe(e){return Nt(e)}uoe.signature=Sg;function vA(e){return e<0}vA.signature=Sg;function gA(e){return e>0}gA.signature=Sg;function xA(e){return e===0}xA.signature=Sg;function yA(e){return Number.isNaN(e)}yA.signature=Sg;var i_="isNegative",loe=["typed"],o_=K(i_,loe,e=>{var{typed:t}=e;return t(i_,{number:vA,BigNumber:function(n){return n.isNeg()&&!n.isZero()&&!n.isNaN()},Fraction:function(n){return n.s<0},Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Ot(n,r))})});v();x();g();var a_="isNumeric",foe=["typed"],s_=K(a_,foe,e=>{var{typed:t}=e;return t(a_,{"number | BigNumber | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":t.referToSelf(r=>n=>Ot(n,r))})});v();x();g();var u_="hasNumericValue",coe=["typed","isNumeric"],l_=K(u_,coe,e=>{var{typed:t,isNumeric:r}=e;return t(u_,{boolean:()=>!0,string:function(i){return i.trim().length>0&&!isNaN(Number(i))},any:function(i){return r(i)}})});v();x();g();var f_="isPositive",poe=["typed"],c_=K(f_,poe,e=>{var{typed:t}=e;return t(f_,{number:gA,BigNumber:function(n){return!n.isNeg()&&!n.isZero()&&!n.isNaN()},Fraction:function(n){return n.s>0&&n.n>0},Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Ot(n,r))})});v();x();g();var p_="isZero",moe=["typed"],m_=K(p_,moe,e=>{var{typed:t}=e;return t(p_,{number:xA,BigNumber:function(n){return n.isZero()},Complex:function(n){return n.re===0&&n.im===0},Fraction:function(n){return n.d===1&&n.n===0},Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Ot(n,r))})});v();x();g();var h_="isNaN",hoe=["typed"],d_=K(h_,hoe,e=>{var{typed:t}=e;return t(h_,{number:yA,BigNumber:function(n){return n.isNaN()},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=>Ot(n,r))})});v();x();g();var v_="typeOf",doe=["typed"],g_=K(v_,doe,e=>{var{typed:t}=e;return t(v_,{any:hr})});v();x();g();v();x();g();function ni(e,t,r){if(r==null)return e.eq(t);if(e.eq(t))return!0;if(e.isNaN()||t.isNaN())return!1;if(e.isFinite()&&t.isFinite()){var n=e.minus(t).abs();if(n.isZero())return!0;var i=e.constructor.max(e.abs(),t.abs());return n.lte(i.times(r))}return!1}v();x();g();function x_(e,t,r){return yn(e.re,t.re,r)&&yn(e.im,t.im,r)}v();x();g();var Ha=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 Hy="equalScalar",voe=["typed","config"],y_=K(Hy,voe,e=>{var{typed:t,config:r}=e,n=Ha({typed:t});return t(Hy,{"boolean, boolean":function(o,u){return o===u},"number, number":function(o,u){return yn(o,u,r.epsilon)},"BigNumber, BigNumber":function(o,u){return o.eq(u)||ni(o,u,r.epsilon)},"Fraction, Fraction":function(o,u){return o.equals(u)},"Complex, Complex":function(o,u){return x_(o,u,r.epsilon)}},n)}),__e=K(Hy,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Hy,{"number, number":function(i,o){return yn(i,o,r.epsilon)}})});v();x();g();var goe="SparseMatrix",xoe=["typed","equalScalar","Matrix"],w_=K(goe,xoe,e=>{var{typed:t,equalScalar:r,Matrix:n}=e;function i(w,D){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(D&&!dn(D))throw new Error("Invalid datatype: "+D);if(Et(w))o(this,w,D);else if(w&&fr(w.index)&&fr(w.ptr)&&fr(w.size))this._values=w.values,this._index=w.index,this._ptr=w.ptr,this._size=w.size,this._datatype=D||w.datatype;else if(fr(w))u(this,w,D);else{if(w)throw new TypeError("Unsupported type of data ("+hr(w)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=D}}function o(w,D,b){D.type==="SparseMatrix"?(w._values=D._values?Bt(D._values):void 0,w._index=Bt(D._index),w._ptr=Bt(D._ptr),w._size=Bt(D._size),w._datatype=b||D._datatype):u(w,D.valueOf(),b||D._datatype)}function u(w,D,b){w._values=[],w._index=[],w._ptr=[],w._datatype=b;var O=D.length,M=0,I=r,F=0;if(dn(b)&&(I=t.find(r,[b,b])||r,F=t.convert(0,b)),O>0){var C=0;do{w._ptr.push(w._index.length);for(var P=0;P");if(M.length===1){var R=D.dimension(0);R.forEach(function(H,V){Br(H),w.set([H,0],b[V[0]],O)})}else{var q=D.dimension(0),z=D.dimension(1);q.forEach(function(H,V){Br(H),z.forEach(function(W,ee){Br(W),w.set([H,W],b[V[0]][ee[0]],O)})})}}return w}i.prototype.get=function(w){if(!fr(w))throw new TypeError("Array expected");if(w.length!==this._size.length)throw new Kt(w.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var D=w[0],b=w[1];Br(D,this._size[0]),Br(b,this._size[1]);var O=s(D,this._ptr[b],this._ptr[b+1],this._index);return OI-1||M>F-1)&&(h(this,Math.max(O+1,I),Math.max(M+1,F),b),I=this._size[0],F=this._size[1]),Br(O,I),Br(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(!Ht(I)||!Nt(I)||I<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Zt(O)+")")});var M=b?this.clone():this;return h(M,O[0],O[1],D)};function h(w,D,b,O){var M=O||0,I=r,F=0;dn(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,z,H;if(b>R){for(z=R;zP){if(C){var V=0;for(z=0;zD-1&&(w._values.splice(H,1),w._index.splice(H,1),ee++)}w._ptr[z]=w._values.length}return w._size[0]=D,w._size[1]=b,w}i.prototype.reshape=function(w,D){if(!fr(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(!Ht(re)||!Nt(re)||re<=-2||re===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+Zt(w)+")")});var b=this._size[0]*this._size[1];w=yg(w,b);var O=w[0]*w[1];if(b!==O)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var M=D?this.clone():this;if(this._size[0]===w[0]&&this._size[1]===w[1])return M;for(var I=[],F=0;F=D&&X<=b&&H(w._values[ie],X-D,V-O)}else{for(var Y={},le=W;le "+(this._values?Yt(this._values[P],w):"X")}return M},i.prototype.toString=function(){return Yt(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(_t(w)&&(w=w.toNumber()),!Ut(w)||!Nt(w))throw new TypeError("The parameter k must be an integer number")}else w=0;var D=w>0?w:0,b=w<0?-w:0,O=this._size[0],M=this._size[1],I=Math.min(O-b,M-D),F=[],C=[],P=[];P[0]=0;for(var R=D;R0?b:0,P=b<0?-b:0,R=w[0],q=w[1],z=Math.min(R-P,q-C),H;if(fr(D)){if(D.length!==z)throw new Error("Invalid value array length");H=function(he){return D[he]}}else if(St(D)){var V=D.size();if(V.length!==1||V[0]!==z)throw new Error("Invalid matrix length");H=function(he){return D.get([he])}}else H=function(){return D};for(var W=[],ee=[],ie=[],X=0;X=0&&Z=P||M[q]!==D)){var H=O?O[R]:void 0;M.splice(q,0,D),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});v();x();g();var yoe="number",woe=["typed"];function boe(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 Doe(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=boe(i);if(o)return Doe(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()},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=>Tt(i,n))});return r.fromJSON=function(n){return parseFloat(n.value)},r});v();x();g();var N_="string",Noe=["typed"],S_=K(N_,Noe,e=>{var{typed:t}=e;return t(N_,{"":function(){return""},number:Cs,null:function(n){return"null"},boolean:function(n){return n+""},string:function(n){return n},"Array | Matrix":t.referToSelf(r=>n=>Tt(n,r)),any:function(n){return String(n)}})});v();x();g();var E_="boolean",Soe=["typed"],A_=K(E_,Soe,e=>{var{typed:t}=e;return t(E_,{"":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=>Tt(n,r))})});v();x();g();var Eoe="bignumber",Aoe=["typed","BigNumber"],C_=K(Eoe,Aoe,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},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=>Tt(i,n))})});v();x();g();var Coe="complex",Moe=["typed","Complex"],M_=K(Coe,Moe,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=>Tt(i,n))})});v();x();g();var Toe="fraction",Ooe=["typed","Fraction"],T_=K(Toe,Ooe,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())},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=>Tt(i,n))})});v();x();g();var O_="matrix",Ioe=["typed","Matrix","DenseMatrix","SparseMatrix"],I_=K(O_,Ioe,e=>{var{typed:t,Matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(O_,{"":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)+".")}});v();x();g();var F_="matrixFromFunction",Foe=["typed","matrix","isZero"],__=K(F_,Foe,e=>{var{typed:t,matrix:r,isZero:n}=e;return t(F_,{"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}});v();x();g();var k_="matrixFromRows",_oe=["typed","matrix","flatten","size"],B_=K(k_,_oe,e=>{var{typed:t,matrix:r,flatten:n,size:i}=e;return t(k_,{"...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.")}});v();x();g();var L_="matrixFromColumns",koe=["typed","matrix","flatten","size"],P_=K(L_,koe,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 column is needed to construct a matrix.");for(var a=u(l[0]),s=[],f=0;f{var{typed:t}=e;return t(R_,{"Unit, Array":function(n,i){return n.splitUnit(i)}})});v();x();g();var z_="unaryMinus",Loe=["typed"],U_=K(z_,Loe,e=>{var{typed:t}=e;return t(z_,{number:AE,"Complex | BigNumber | Fraction":r=>r.neg(),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=>Tt(n,r,!0))})});v();x();g();var H_="unaryPlus",Poe=["typed","config","BigNumber"],$_=K(H_,Poe,e=>{var{typed:t,config:r,BigNumber:n}=e;return t(H_,{number:CE,Complex:function(o){return o},BigNumber:function(o){return o},Fraction:function(o){return o},Unit:function(o){return o.clone()},"Array | Matrix":t.referToSelf(i=>o=>Tt(o,i,!0)),"boolean | string":function(o){return r.number==="BigNumber"?new n(+o):+o}})});v();x();g();var W_="abs",Roe=["typed"],V_=K(W_,Roe,e=>{var{typed:t}=e;return t(W_,{number:DE,"Complex | BigNumber | Fraction | Unit":r=>r.abs(),"Array | Matrix":t.referToSelf(r=>n=>Tt(n,r,!0))})});v();x();g();var G_="apply",qoe=["typed","isInteger"],wh=K(G_,qoe,e=>{var{typed:t,isInteger:r}=e;return t(G_,{"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)?Ht(i):i.size();if(o<0||o>=l.length)throw new Si(o,l.length);return St(i)?i.create(zy(i.valueOf(),o,u)):zy(i,o,u)}})});function zy(e,t,r){var n,i,o;if(t<=0)if(Array.isArray(e[0])){for(o=zoe(e),i=[],n=0;n{var{typed:t}=e;return t(Y_,{"number, number":NE,"Complex, Complex":function(n,i){return n.add(i)},"BigNumber, BigNumber":function(n,i){return n.plus(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})})});v();x();g();var X_="subtractScalar",Hoe=["typed"],K_=K(X_,Hoe,e=>{var{typed:t}=e;return t(X_,{"number, number":SE,"Complex, Complex":function(n,i){return n.sub(i)},"BigNumber, BigNumber":function(n,i){return n.minus(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})})});v();x();g();var J_="cbrt",$oe=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],Q_=K(J_,$oe,e=>{var{config:t,typed:r,isNegative:n,unaryMinus:i,matrix:o,Complex:u,BigNumber:l,Fraction:a}=e;return r(J_,{number:gh,Complex:s,"Complex, boolean":s,BigNumber:function(h){return h.cbrt()},Unit:f});function s(p,h){var y=p.arg()/3,N=p.abs(),w=new u(gh(N),0).mul(new u(0,y).exp());if(h){var D=[w,new u(gh(N),0).mul(new u(0,y+Math.PI*2/3).exp()),new u(gh(N),0).mul(new u(0,y-Math.PI*2/3).exp())];return t.matrix==="Array"?D:o(D)}else return w}function f(p){if(p.value&&wi(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 N;_t(p.value)?N=new l(1).div(3):pa(p.value)?N=new a(1,3):N=1/3;var w=p.pow(N);return y&&(w.value=i(w.value)),w}}});v();x();g();v();x();g();var Woe="matAlgo11xS0s",Voe=["typed","equalScalar"],Lr=K(Woe,Voe,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],N=p[1],w,D=r,b=0,O=u;typeof h=="string"&&(w=h,D=t.find(r,[w,w]),b=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],N=p[1],w,D=u;typeof h=="string"&&(w=h,o=t.convert(o,w),D=t.find(u,[w,w]));for(var b=[],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:Bt(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(yA,{number:function(o){return yn(o,n(o),r.epsilon)?n(o):Math.ceil(o)},"number, number":function(o,u){if(yn(o,n(o,u),r.epsilon))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))}})}),j_=K(yA,Koe,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:u,DenseMatrix:l}=e,a=Lr({typed:t,equalScalar:o}),s=Er({typed:t,DenseMatrix:l}),f=Zn({typed:t}),p=Joe({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,N){return y.ceil(N)},"Complex, BigNumber":function(y,N){return y.ceil(N.toNumber())},BigNumber:function(y){return ai(y,n(y),r.epsilon)?n(y):y.ceil()},"BigNumber, BigNumber":function(y,N){return ai(y,n(y,N),r.epsilon)?n(y,N):y.toDecimalPlaces(N.toNumber(),sp.ROUND_CEIL)},Fraction:function(y){return y.ceil()},"Fraction, number":function(y,N){return y.ceil(N)},"Fraction, BigNumber":function(y,N){return y.ceil(N.toNumber())},"Array | Matrix":t.referToSelf(h=>y=>Tt(y,h,!0)),"Array, number | BigNumber":t.referToSelf(h=>(y,N)=>Tt(y,w=>h(w,N),!0)),"SparseMatrix, number | BigNumber":t.referToSelf(h=>(y,N)=>a(y,N,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(y,N)=>f(y,N,h,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(h=>(y,N)=>f(i(N),y,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(h=>(y,N)=>o(y,0)?u(N.size(),N.storage()):N.storage()==="dense"?f(N,y,h,!0):s(N,y,h,!0))})});v();x();g();var ek="cube",Qoe=["typed"],tk=K(ek,Qoe,e=>{var{typed:t}=e;return t(ek,{number:ME,Complex:function(n){return n.mul(n).mul(n)},BigNumber:function(n){return n.times(n).times(n)},Fraction:function(n){return n.pow(3)},Unit:function(n){return n.pow(3)}})});v();x();g();var rk="exp",joe=["typed"],nk=K(rk,joe,e=>{var{typed:t}=e;return t(rk,{number:TE,Complex:function(n){return n.exp()},BigNumber:function(n){return n.exp()}})});v();x();g();var ik="expm1",eae=["typed","Complex"],ok=K(ik,eae,e=>{var{typed:t,Complex:r}=e;return t(ik,{number:OE,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)}})});v();x();g();var wA="fix",tae=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],rae=K(wA,["typed","ceil","floor"],e=>{var{typed:t,ceil:r,floor:n}=e;return t(wA,{number:function(o){return o>0?n(o):r(o)},"number, number":function(o,u){return o>0?n(o,u):r(o,u)}})}),ak=K(wA,tae,e=>{var{typed:t,Complex:r,matrix:n,ceil:i,floor:o,equalScalar:u,zeros:l,DenseMatrix:a}=e,s=Er({typed:t,DenseMatrix:a}),f=Zn({typed:t}),p=rae({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,N){return new r(y.re>0?o(y.re,N):i(y.re,N),y.im>0?o(y.im,N):i(y.im,N))},"Complex, BigNumber":function(y,N){var w=N.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,N){return y.isNegative()?i(y,N):o(y,N)},Fraction:function(y){return y.s<0?y.ceil():y.floor()},"Fraction, number | BigNumber":function(y,N){return y.s<0?i(y,N):o(y,N)},"Array | Matrix":t.referToSelf(h=>y=>Tt(y,h,!0)),"Array | Matrix, number | BigNumber":t.referToSelf(h=>(y,N)=>Tt(y,w=>h(w,N),!0)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(h=>(y,N)=>f(n(N),y,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(h=>(y,N)=>u(y,0)?l(N.size(),N.storage()):N.storage()==="dense"?f(N,y,h,!0):s(N,y,h,!0))})});v();x();g();var bA="floor",nae=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],iae=K(bA,["typed","config","round"],e=>{var{typed:t,config:r,round:n}=e;return t(bA,{number:function(o){return yn(o,n(o),r.epsilon)?n(o):Math.floor(o)},"number, number":function(o,u){if(yn(o,n(o,u),r.epsilon))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))}})}),Uy=K(bA,nae,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:u,DenseMatrix:l}=e,a=Lr({typed:t,equalScalar:o}),s=Er({typed:t,DenseMatrix:l}),f=Zn({typed:t}),p=iae({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,N){return y.floor(N)},"Complex, BigNumber":function(y,N){return y.floor(N.toNumber())},BigNumber:function(y){return ai(y,n(y),r.epsilon)?n(y):y.floor()},"BigNumber, BigNumber":function(y,N){return ai(y,n(y,N),r.epsilon)?n(y,N):y.toDecimalPlaces(N.toNumber(),sp.ROUND_FLOOR)},Fraction:function(y){return y.floor()},"Fraction, number":function(y,N){return y.floor(N)},"Fraction, BigNumber":function(y,N){return y.floor(N.toNumber())},"Array | Matrix":t.referToSelf(h=>y=>Tt(y,h,!0)),"Array, number | BigNumber":t.referToSelf(h=>(y,N)=>Tt(y,w=>h(w,N),!0)),"SparseMatrix, number | BigNumber":t.referToSelf(h=>(y,N)=>a(y,N,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(y,N)=>f(y,N,h,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(h=>(y,N)=>f(i(N),y,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(h=>(y,N)=>o(y,0)?u(N.size(),N.storage()):N.storage()==="dense"?f(N,y,h,!0):s(N,y,h,!0))})});v();x();g();v();x();g();v();x();g();var oae="matAlgo02xDS0",aae=["typed","equalScalar"],Xn=K(oae,aae,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,N=o._size,w=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(s.length!==N.length)throw new Xt(s.length,N.length);if(s[0]!==N[0]||s[1]!==N[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+N+")");if(!p)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var D=s[0],b=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,N=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(a.length!==y.length)throw new Xt(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],D=a[1],b,O=0,M=o;typeof s=="string"&&s===N&&s!=="mixed"&&(b=s,O=t.convert(0,b),M=t.find(o,[b,b]));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,N=o._ptr,w=o._size,D=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==w.length)throw new Xt(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 b=f[0],O=f[1],M,I=r,F=0,C=u;typeof p=="string"&&p===D&&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=[],z=P?[]:void 0,H=P?[]:void 0,V=[],W=[],ee,ie,X,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 Xt(a.length,p.length);for(var N=0;N0?r(D,0,y,y[0],l,f):[];return i.createDenseMatrix({data:b,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((N,w)=>N===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=sk({typed:t}),o=Zn({typed:t}),u=uk({concat:n});return function(a){var s=a.elop,f=a.SD||a.DS,p;s?(p={"DenseMatrix, DenseMatrix":(w,D)=>i(...u(w,D),s),"Array, Array":(w,D)=>i(...u(r(w),r(D)),s).valueOf(),"Array, DenseMatrix":(w,D)=>i(...u(r(w),D),s),"DenseMatrix, Array":(w,D)=>i(...u(w,r(D)),s)},a.SS&&(p["SparseMatrix, SparseMatrix"]=(w,D)=>a.SS(...u(w,D),s,!1)),a.DS&&(p["DenseMatrix, SparseMatrix"]=(w,D)=>a.DS(...u(w,D),s,!1),p["Array, SparseMatrix"]=(w,D)=>a.DS(...u(r(w),D),s,!1)),f&&(p["SparseMatrix, DenseMatrix"]=(w,D)=>f(...u(D,w),s,!0),p["SparseMatrix, Array"]=(w,D)=>f(...u(r(D),w),s,!0))):(p={"DenseMatrix, DenseMatrix":t.referToSelf(w=>(D,b)=>i(...u(D,b),w)),"Array, Array":t.referToSelf(w=>(D,b)=>i(...u(r(D),r(b)),w).valueOf()),"Array, DenseMatrix":t.referToSelf(w=>(D,b)=>i(...u(r(D),b),w)),"DenseMatrix, Array":t.referToSelf(w=>(D,b)=>i(...u(D,r(b)),w))},a.SS&&(p["SparseMatrix, SparseMatrix"]=t.referToSelf(w=>(D,b)=>a.SS(...u(D,b),w,!1))),a.DS&&(p["DenseMatrix, SparseMatrix"]=t.referToSelf(w=>(D,b)=>a.DS(...u(D,b),w,!1)),p["Array, SparseMatrix"]=t.referToSelf(w=>(D,b)=>a.DS(...u(r(D),b),w,!1))),f&&(p["SparseMatrix, DenseMatrix"]=t.referToSelf(w=>(D,b)=>f(...u(b,D),w,!0)),p["SparseMatrix, Array"]=t.referToSelf(w=>(D,b)=>f(...u(r(b),D),w,!0))));var h=a.scalar||"any",y=a.Ds||a.Ss;y&&(s?(p["DenseMatrix,"+h]=(w,D)=>o(w,D,s,!1),p[h+", DenseMatrix"]=(w,D)=>o(D,w,s,!0),p["Array,"+h]=(w,D)=>o(r(w),D,s,!1).valueOf(),p[h+", Array"]=(w,D)=>o(r(D),w,s,!0).valueOf()):(p["DenseMatrix,"+h]=t.referToSelf(w=>(D,b)=>o(D,b,w,!1)),p[h+", DenseMatrix"]=t.referToSelf(w=>(D,b)=>o(b,D,w,!0)),p["Array,"+h]=t.referToSelf(w=>(D,b)=>o(r(D),b,w,!1).valueOf()),p[h+", Array"]=t.referToSelf(w=>(D,b)=>o(r(b),D,w,!0).valueOf())));var N=a.sS!==void 0?a.sS:a.Ss;return s?(a.Ss&&(p["SparseMatrix,"+h]=(w,D)=>a.Ss(w,D,s,!1)),N&&(p[h+", SparseMatrix"]=(w,D)=>N(D,w,s,!0))):(a.Ss&&(p["SparseMatrix,"+h]=t.referToSelf(w=>(D,b)=>a.Ss(D,b,w,!1))),N&&(p[h+", SparseMatrix"]=t.referToSelf(w=>(D,b)=>N(b,D,w,!0)))),s&&s.signatures&&gy(p,s.signatures),p}});var lk="mod",gae=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],Hy=K(lk,gae,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:u,DenseMatrix:l,concat:a}=e,s=Uy({typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:u,DenseMatrix:l}),f=Xn({typed:t,equalScalar:o}),p=Xr({typed:t}),h=If({typed:t,equalScalar:o}),y=Lr({typed:t,equalScalar:o}),N=Er({typed:t,DenseMatrix:l}),w=er({typed:t,matrix:i,concat:a});return t(lk,{"number, number":D,"BigNumber, BigNumber":function(O,M){return M.isZero()?O:O.sub(M.mul(s(O.div(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:N}));function D(b,O){return O===0?b:b-O*s(b/O)}});v();x();g();var xae="matAlgo01xDSid",yae=["typed"],co=K(xae,yae,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,N=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(a.length!==y.length)throw new Xt(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],D=a[1],b=typeof s=="string"&&s!=="mixed"&&s===N?s:void 0,O=b?t.find(o,[b,b]):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,N=o._ptr,w=o._size,D=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==w.length)throw new Xt(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 b=f[0],O=f[1],M,I=r,F=0,C=u;typeof p=="string"&&p===D&&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=[],z=l&&h?[]:void 0,H=l&&h?[]:void 0,V=[],W=[],ee,ie,X,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],N=p[1],w,D=u;typeof h=="string"&&(w=h,o=t.convert(o,w),D=t.find(u,[w,w]));for(var b=[],O=[],M=[],I=0;IArray.isArray(t))}var pk=K(fk,Sae,e=>{var{typed:t,matrix:r,config:n,round:i,equalScalar:o,zeros:u,BigNumber:l,DenseMatrix:a,concat:s}=e,f=Hy({typed:t,config:n,round:i,matrix:r,equalScalar:o,zeros:u,DenseMatrix:a,concat:s}),p=co({typed:t}),h=bh({typed:t,equalScalar:o}),y=Go({typed:t,DenseMatrix:a}),N=er({typed:t,matrix:r,concat:s});return t(fk,{"number, number":w,"BigNumber, BigNumber":D,"Fraction, Fraction":(b,O)=>b.gcd(O)},N({SS:h,DS:p,Ss:y}),{[Eae]:t.referToSelf(b=>(O,M,I)=>{for(var F=b(O,M),C=0;CO=>{if(O.length===1&&Array.isArray(O[0])&&ck(O[0]))return b(...O[0]);if(ck(O))return b(...O);throw new da("gcd() supports only 1d matrices!")}),Matrix:t.referToSelf(b=>O=>b(O.toArray()))});function w(b,O){if(!Nt(b)||!Nt(O))throw new Error("Parameters in function gcd must be integer numbers");for(var M;O!==0;)M=f(b,O),b=O,O=M;return b<0?-b:b}function D(b,O){if(!b.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(b,O);b=O,O=I}return b.lt(M)?b.neg():b}});v();x();g();v();x();g();var Aae="matAlgo06xS0S0",Cae=["typed","equalScalar"],Ff=K(Aae,Cae,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 Xt(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],N=a[1],w,D=r,b=0,O=u;typeof s=="string"&&s===h&&s!=="mixed"&&(w=s,D=t.find(r,[w,w]),b=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=Xn({typed:t,equalScalar:n}),u=Ff({typed:t,equalScalar:n}),l=Lr({typed:t,equalScalar:n}),a=er({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,N,w)=>{for(var D=h(y,N),b=0;bh.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 N=h.times(y);!y.isZero();){var w=y;y=h.mod(w),h=w}return N.div(h).abs()}});v();x();g();var dk="log10",Tae=["typed","config","Complex"],vk=K(dk,Tae,e=>{var{typed:t,config:r,Complex:n}=e;return t(dk,{number:function(o){return o>=0||r.predictable?FE(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=>Tt(o,i))})});v();x();g();var gk="log2",Oae=["typed","config","Complex"],xk=K(gk,Oae,e=>{var{typed:t,config:r,Complex:n}=e;return t(gk,{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=>Tt(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)}});v();x();g();var Iae="multiplyScalar",Fae=["typed"],yk=K(Iae,Fae,e=>{var{typed:t}=e;return t("multiplyScalar",{"number, number":EE,"Complex, Complex":function(n,i){return n.mul(i)},"BigNumber, BigNumber":function(n,i){return n.times(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)})});v();x();g();var wk="multiply",_ae=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],bk=K(wk,_ae,e=>{var{typed:t,matrix:r,addScalar:n,multiplyScalar:i,equalScalar:o,dot:u}=e,l=Lr({typed:t,equalScalar:o}),a=Zn({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(),z=C._data,H=C._size,V=C._datatype||C.getDataType(),W=R[0],ee=H[1],ie,X=n,Z=i;q&&V&&q===V&&typeof q=="string"&&q!=="mixed"&&(ie=q,X=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(Ht(C),Ht(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):N(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),z=0;z{var{typed:t,matrix:r,equalScalar:n,BigNumber:i,concat:o}=e,u=co({typed:t}),l=Xn({typed:t,equalScalar:n}),a=Ff({typed:t,equalScalar:n}),s=Lr({typed:t,equalScalar:n}),f=er({typed:t,matrix:r,concat:o});function p(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return t(Dk,{number:kE,"number, number":kE,BigNumber:y=>h(y,new i(2)),"BigNumber, BigNumber":h,Complex:p,"Complex, number":p,Array:t.referTo("DenseMatrix,number",y=>N=>y(r(N),2).valueOf()),DenseMatrix:t.referTo("DenseMatrix,number",y=>N=>y(N,2)),SparseMatrix:t.referTo("SparseMatrix,number",y=>N=>y(N,2)),"SparseMatrix, SparseMatrix":t.referToSelf(y=>(N,w)=>{if(w.density()===1)return a(N,w,y);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":t.referToSelf(y=>(N,w)=>{if(w.density()===1)return u(N,w,y,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":t.referTo("DenseMatrix,SparseMatrix",y=>(N,w)=>y(r(N),w)),"number | BigNumber, SparseMatrix":t.referToSelf(y=>(N,w)=>{if(w.density()===1)return s(w,N,y,!0);throw new Error("Root must be non-zero")})},f({scalar:"number | BigNumber",SD:l,Ss:s,sS:!1}));function h(y,N){var w=i.precision,D=i.clone({precision:w+2}),b=new i(0),O=new D(1),M=N.isNegative();if(M&&(N=N.neg()),N.isZero())throw new Error("Root must be non-zero");if(y.isNegative()&&!N.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(y.isZero())return M?new D(1/0):0;if(!y.isFinite())return M?b:y;var I=y.abs().pow(O.div(N));return I=y.isNeg()?I.neg():I,new i((M?O.div(I):I).toPrecision(w))}});v();x();g();var Sk="sign",Bae=["typed","BigNumber","Fraction","complex"],Ek=K(Sk,Bae,e=>{var{typed:t,BigNumber:r,complex:n,Fraction:i}=e;return t(Sk,{number:Ry,Complex:function(u){return u.im===0?n(Ry(u.re)):u.sign()},BigNumber:function(u){return new r(u.cmp(0))},Fraction:function(u){return new i(u.s,1)},"Array | Matrix":t.referToSelf(o=>u=>Tt(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)})})});v();x();g();var Lae="sqrt",Pae=["config","typed","Complex"],Ak=K(Lae,Pae,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()}});v();x();g();var Ck="square",Rae=["typed"],Mk=K(Ck,Rae,e=>{var{typed:t}=e;return t(Ck,{number:BE,Complex:function(n){return n.mul(n)},BigNumber:function(n){return n.times(n)},Fraction:function(n){return n.mul(n)},Unit:function(n){return n.pow(2)}})});v();x();g();var Tk="subtract",qae=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],Ok=K(Tk,qae,e=>{var{typed:t,matrix:r,equalScalar:n,subtractScalar:i,unaryMinus:o,DenseMatrix:u,concat:l}=e,a=co({typed:t}),s=Xr({typed:t}),f=If({typed:t,equalScalar:n}),p=Go({typed:t,DenseMatrix:u}),h=Er({typed:t,DenseMatrix:u}),y=er({typed:t,matrix:r,concat:l});return t(Tk,{"any, any":i},y({elop:i,SS:f,DS:a,SD:s,Ss:h,sS:p}))});v();x();g();var Ik="xgcd",zae=["typed","config","matrix","BigNumber"],Fk=K(Ik,zae,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(Ik,{"number, number":function(l,a){var s=LE(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,N=h,w=h,D=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=N.minus(s.times(y)),N=a,a=w,w=D.minus(s.times(w)),D=a,u=l,l=f;var b;return u.lt(p)?b=[u.neg(),N.neg(),D.neg()]:b=[u,u.isZero()?0:N,D],r.matrix==="Array"?b:n(b)}});v();x();g();var _k="invmod",Uae=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],kk=K(_k,Uae,e=>{var{typed:t,config:r,BigNumber:n,xgcd:i,equal:o,smaller:u,mod:l,add:a,isInteger:s}=e;return t(_k,{"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[N,w]=y;return o(N,n(1))?(w=l(w,h),u(w,n(0))&&(w=a(w,h)),w):NaN}});v();x();g();v();x();g();var Hae="matAlgo09xS0Sf",$ae=["typed","equalScalar"],$y=K(Hae,$ae,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,N=o._ptr,w=o._size,D=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==w.length)throw new Xt(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 b=f[0],O=f[1],M,I=r,F=0,C=u;typeof p=="string"&&p===D&&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=[],z=P?[]:void 0,H=[],V,W,ee,ie,X;for(W=0;W{var{typed:t,matrix:r,equalScalar:n,multiplyScalar:i,concat:o}=e,u=Xn({typed:t,equalScalar:n}),l=$y({typed:t,equalScalar:n}),a=Lr({typed:t,equalScalar:n}),s=er({typed:t,matrix:r,concat:o});return t(Bk,s({elop:i,SS:l,DS:u,Ss:a}))});v();x();g();v();x();g();function Pk(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 NA(e,t,function(n,i){return n&i})}function Dh(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 Rk(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:NA(e,t,function(i,o){return i|o})}function NA(e,t,r){var n=e.constructor,i,o,u=+(e.s<0),l=+(t.s<0);if(u){i=Wy(Dh(e));for(var a=0;a0;)r(f[--y],p[--N])===w&&(D=D.plus(b)),b=b.times(O);for(;N>0;)r(h,p[--N])===w&&(D=D.plus(b)),b=b.times(O);return n.config({precision:M}),w===0&&(D.s=-D.s),D}function Wy(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 qk(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)?Dh(t):t.eq(n)?Dh(e):!e.isFinite()||!t.isFinite()?!e.isFinite()&&!t.isFinite()?n:new r(e.isNegative()===t.isNegative()?1/0:-1/0):NA(e,t,function(i,o){return i^o})}function zk(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 Uk(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 Hk="bitAnd",Vae=["typed","matrix","equalScalar","concat"],Vy=K(Hk,Vae,e=>{var{typed:t,matrix:r,equalScalar:n,concat:i}=e,o=Xn({typed:t,equalScalar:n}),u=Ff({typed:t,equalScalar:n}),l=Lr({typed:t,equalScalar:n}),a=er({typed:t,matrix:r,concat:i});return t(Hk,{"number, number":RE,"BigNumber, BigNumber":Pk},a({SS:u,DS:o,Ss:l}))});v();x();g();var $k="bitNot",Gae=["typed"],Wk=K($k,Gae,e=>{var{typed:t}=e;return t($k,{number:qE,BigNumber:Dh,"Array | Matrix":t.referToSelf(r=>n=>Tt(n,r))})});v();x();g();var Vk="bitOr",Yae=["typed","matrix","equalScalar","DenseMatrix","concat"],Gy=K(Vk,Yae,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,u=co({typed:t}),l=bh({typed:t,equalScalar:n}),a=Go({typed:t,DenseMatrix:i}),s=er({typed:t,matrix:r,concat:o});return t(Vk,{"number, number":zE,"BigNumber, BigNumber":Rk},s({SS:l,DS:u,Ss:a}))});v();x();g();v();x();g();var Zae="matAlgo07xSSf",Xae=["typed","DenseMatrix"],fi=K(Zae,Xae,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 Xt(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],N,w=0,D=l;typeof s=="string"&&s===p&&s!=="mixed"&&(N=s,w=t.convert(0,N),D=t.find(l,[N,N]));var b,O,M=[];for(b=0;b{var{typed:t,matrix:r,DenseMatrix:n,concat:i}=e,o=Xr({typed:t}),u=fi({typed:t,DenseMatrix:n}),l=Er({typed:t,DenseMatrix:n}),a=er({typed:t,matrix:r,concat:i});return t(Gk,{"number, number":UE,"BigNumber, BigNumber":qk},a({SS:u,DS:o,Ss:l}))});v();x();g();var Zk="arg",Jae=["typed"],Xk=K(Zk,Jae,e=>{var{typed:t}=e;return t(Zk,{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=>Tt(n,r))})});v();x();g();var Kk="conj",Qae=["typed"],Jk=K(Kk,Qae,e=>{var{typed:t}=e;return t(Kk,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.conjugate(),"Array | Matrix":t.referToSelf(r=>n=>Tt(n,r))})});v();x();g();var Qk="im",jae=["typed"],jk=K(Qk,jae,e=>{var{typed:t}=e;return t(Qk,{number:()=>0,"BigNumber | Fraction":r=>r.mul(0),Complex:r=>r.im,"Array | Matrix":t.referToSelf(r=>n=>Tt(n,r))})});v();x();g();var e4="re",ese=["typed"],t4=K(e4,ese,e=>{var{typed:t}=e;return t(e4,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.re,"Array | Matrix":t.referToSelf(r=>n=>Tt(n,r))})});v();x();g();var r4="not",tse=["typed"],n4=K(r4,tse,e=>{var{typed:t}=e;return t(r4,{"null | undefined":()=>!0,number:YE,Complex:function(n){return n.re===0&&n.im===0},BigNumber:function(n){return n.isZero()||n.isNaN()},Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Tt(n,r))})});v();x();g();var i4="or",rse=["typed","matrix","equalScalar","DenseMatrix","concat"],Yy=K(i4,rse,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,u=Xr({typed:t}),l=If({typed:t,equalScalar:n}),a=Er({typed:t,DenseMatrix:i}),s=er({typed:t,matrix:r,concat:o});return t(i4,{"number, number":ZE,"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()},"Unit, Unit":t.referToSelf(f=>(p,h)=>f(p.value||0,h.value||0))},s({SS:l,DS:u,Ss:a}))});v();x();g();var o4="xor",nse=["typed","matrix","DenseMatrix","concat"],a4=K(o4,nse,e=>{var{typed:t,matrix:r,DenseMatrix:n,concat:i}=e,o=Xr({typed:t}),u=fi({typed:t,DenseMatrix:n}),l=Er({typed:t,DenseMatrix:n}),a=er({typed:t,matrix:r,concat:i});return t(o4,{"number, number":XE,"Complex, Complex":function(f,p){return(f.re!==0||f.im!==0)!=(p.re!==0||p.im!==0)},"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}))});v();x();g();var s4="concat",ise=["typed","matrix","isInteger"],Zy=K(s4,ise,e=>{var{typed:t,matrix:r,isInteger:n}=e;return t(s4,{"...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 Si(a,s+1)}else{var y=Bt(h).valueOf(),N=Ht(y);if(p[u]=y,s=a,a=N.length-1,u>0&&a!==s)throw new Xt(s+1,a+1)}}if(p.length===0)throw new SyntaxError("At least one matrix expected");for(var w=p.shift();p.length;)w=aE(w,p.shift(),a);return f?r(w):w},"...string":function(o){return o.join("")}})});v();x();g();var u4="column",ose=["typed","Index","matrix","range"],Xy=K(u4,ose,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(Bt(l)),a).valueOf()}});function o(u,l){if(u.size().length!==2)throw new Error("Only two dimensional matrix is supported");Br(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]])}});v();x();g();var l4="count",ase=["typed","size","prod"],f4=K(l4,ase,e=>{var{typed:t,size:r,prod:n}=e;return t(l4,{string:function(o){return o.length},"Matrix | Array":function(o){return n(r(o))}})});v();x();g();var c4="cross",sse=["typed","matrix","subtract","multiply"],p4=K(c4,sse,e=>{var{typed:t,matrix:r,subtract:n,multiply:i}=e;return t(c4,{"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(Ht(u).length,Ht(l).length);u=ch(u),l=ch(l);var s=Ht(u),f=Ht(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}});v();x();g();var m4="diag",use=["typed","matrix","DenseMatrix","SparseMatrix"],h4=K(m4,use,e=>{var{typed:t,matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(m4,{Array:function(s){return o(s,0,Ht(s),null)},"Array, number":function(s,f){return o(s,f,Ht(s),null)},"Array, BigNumber":function(s,f){return o(s,f.toNumber(),Ht(s),null)},"Array, string":function(s,f){return o(s,0,Ht(s),f)},"Array, number, string":function(s,f,p){return o(s,f,Ht(s),p)},"Array, BigNumber, string":function(s,f,p){return o(s,f.toNumber(),Ht(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 N=[p+h,p+y];if(f&&f!=="sparse"&&f!=="dense")throw new TypeError("Unknown matrix type ".concat(f,'"'));var w=f==="sparse"?i.diagonal(N,a,s):n.diagonal(N,a,s);return f!==null?w:w.valueOf()}function l(a,s,f,p,h,y){if(St(a)){var N=a.diagonal(s);return f!==null?f!==N.storage()?r(N,f):N:N.valueOf()}for(var w=Math.min(p[0]-h,p[1]-y),D=[],b=0;b=2&&w.push("index: ".concat(dr(r))),y.length>=3&&w.push("array: ".concat(dr(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(D.message))}}}var lse="filter",fse=["typed"],v4=K(lse,fse,e=>{var{typed:t}=e;return t("filter",{"Array, function":d4,"Matrix, function":function(n,i){return n.create(d4(n.toArray(),i))},"Array, RegExp":ph,"Matrix, RegExp":function(n,i){return n.create(ph(n.toArray(),i))}})});function d4(e,t){return Ey(e,function(r,n,i){return Wa(t,r,[n],i,"filter")})}v();x();g();var g4="flatten",cse=["typed","matrix"],x4=K(g4,cse,e=>{var{typed:t,matrix:r}=e;return t(g4,{Array:function(i){return rr(i)},Matrix:function(i){var o=rr(i.toArray());return r(o)}})});v();x();g();var y4="forEach",pse=["typed"],w4=K(y4,pse,e=>{var{typed:t}=e;return t(y4,{"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))Nf(i,function(u,l){n(u,o.concat(l))});else return Wa(t,i,o,e,"forEach")};r(e,[])}v();x();g();var b4="getMatrixDataType",hse=["typed"],D4=K(b4,hse,e=>{var{typed:t}=e;return t(b4,{Array:function(n){return Sf(n,dr)},Matrix:function(n){return n.getDataType()}})});v();x();g();var N4="identity",dse=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],S4=K(N4,dse,e=>{var{typed:t,config:r,matrix:n,BigNumber:i,DenseMatrix:o,SparseMatrix:u}=e;return t(N4,{"":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=_t(s)||_t(f)?i:null;if(_t(s)&&(s=s.toNumber()),_t(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,N=h?new h(0):0,w=[s,f];if(p){if(p==="sparse")return u.diagonal(w,y,0,N);if(p==="dense")return o.diagonal(w,y,0,N);throw new TypeError('Unknown matrix type "'.concat(p,'"'))}for(var D=Ms([],w,N),b=s{var{typed:t,matrix:r,multiplyScalar:n}=e;return t(E4,{"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(Ht(o).length===1&&(o=[o]),Ht(u).length===1&&(u=[u]),Ht(o).length>2||Ht(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}});v();x();g();var C4="map",gse=["typed"],M4=K(C4,gse,e=>{var{typed:t}=e;return t(C4,{"Array, function":xse,"Matrix, function":function(n,i){return n.map(i)}})});function xse(e,t){var r=function n(i,o){return Array.isArray(i)?i.map(function(u,l){return n(u,o.concat(l))}):Wa(t,i,o,e,"map")};return r(e,[])}v();x();g();var T4="diff",yse=["typed","matrix","subtract","number"],Ky=K(T4,yse,e=>{var{typed:t,matrix:r,subtract:n,number:i}=e;return t(T4,{"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?Ms(y,a,p):y}}function u(a){var s=!1;return a.forEach(function(f,p,h){_t(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")})}});v();x();g();v();x();g();function Nh(){throw new Error('No "bignumber" implementation available')}function Jy(){throw new Error('No "fraction" implementation available')}function Qy(){throw new Error('No "matrix" implementation available')}var I4="range",Dse=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],jy=K(I4,Dse,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(I4,{string:h,"string, boolean":h,"number, number":function(D,b){return p(y(D,b,1,!1))},"number, number, number":function(D,b,O){return p(y(D,b,O,!1))},"number, number, boolean":function(D,b,O){return p(y(D,b,1,O))},"number, number, number, boolean":function(D,b,O,M){return p(y(D,b,O,M))},"BigNumber, BigNumber":function(D,b){var O=D.constructor;return p(y(D,b,new O(1),!1))},"BigNumber, BigNumber, BigNumber":function(D,b,O){return p(y(D,b,O,!1))},"BigNumber, BigNumber, boolean":function(D,b,O){var M=D.constructor;return p(y(D,b,new M(1),O))},"BigNumber, BigNumber, BigNumber, boolean":function(D,b,O,M){return p(y(D,b,O,M))},"Unit, Unit, Unit":function(D,b,O){return p(y(D,b,O,!1))},"Unit, Unit, Unit, boolean":function(D,b,O,M){return p(y(D,b,O,M))}});function p(w){return r.matrix==="Matrix"?n?n(w):Qy():w}function h(w,D){var b=N(w);if(!b)throw new SyntaxError('String "'+w+'" is no valid range');return r.number==="BigNumber"?(i===void 0&&Nh(),p(y(i(b.start),i(b.end),i(b.step)),D)):p(y(b.start,b.end,b.step,D))}function y(w,D,b,O){for(var M=[],I=f(b)?O?u:o:O?a:l,F=w;I(F,D);)M.push(F),F=s(F,b);return M}function N(w){var D=w.split(":"),b=D.map(function(M){return Number(M)}),O=b.some(function(M){return isNaN(M)});if(O)return null;switch(b.length){case 2:return{start:b[0],end:b[1],step:1};case 3:return{start:b[0],end:b[2],step:b[1]};default:return null}}});v();x();g();var F4="reshape",Nse=["typed","isInteger","matrix"],_4=K(F4,Nse,e=>{var{typed:t,isInteger:r}=e;return t(F4,{"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)}),Dg(i,o)}})});v();x();g();var Sse="resize",Ese=["config","matrix"],k4=K(Sse,Ese,e=>{var{config:t,matrix:r}=e;return function(o,u,l){if(arguments.length!==2&&arguments.length!==3)throw new da("resize",arguments.length,2,3);if(St(u)&&(u=u.valueOf()),_t(u[0])&&(u=u.map(function(f){return _t(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 Bt(o)}else{Array.isArray(o)||(o=[o]),o=Bt(o);var s=Ms(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 Xt(o.length,1);var l=o[0];if(typeof l!="number"||!Nt(l))throw new TypeError("Invalid size, must contain positive integers (size: "+Yt(o)+")");if(i.length>l)return i.substring(0,l);if(i.length{var{typed:t,multiply:r,rotationMatrix:n}=e;return t(B4,{"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)?Ht(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))}});v();x();g();var P4="rotationMatrix",Cse=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],R4=K(P4,Cse,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(P4,{"":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 N(F),b(M,F,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(M,I){N(I);var F=I.storage()||(r.matrix==="Matrix"?"dense":void 0);return b(M,I,F)},"number | BigNumber | Complex | Unit, Array, string":function(M,I,F){var C=a(I);return N(C),b(M,C,F)},"number | BigNumber | Complex | Unit, Matrix, string":function(M,I,F){return N(I),b(M,I,F)}});function y(O,M){var I=_t(O),F=I?new l(-1):-1,C=p(O),P=h(O),R=[[C,n(F,P)],[P,C]];return D(R,M)}function N(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 D(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 b(O,M,I){var F=u(M);if(F===0)throw new RangeError("Rotation around zero vector");var C=_t(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,z=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])),X=i(w([q,z,W]),w([R,H,ee])),Z=i(w([q,H,W]),w([z,ee])),le=i(w([q,z,W]),w([H,ee])),re=i(V,w([z,z,W])),he=i(w([z,H,W]),w([R,q,ee])),De=i(w([q,H,W]),w([R,z,ee])),ye=i(w([z,H,W]),w([q,ee])),ce=i(V,w([H,H,W])),Ne=[[ie,X,Z],[le,re,he],[De,ye,ce]];return D(Ne,I)}});v();x();g();var q4="row",Mse=["typed","Index","matrix","range"],ew=K(q4,Mse,e=>{var{typed:t,Index:r,matrix:n,range:i}=e;return t(q4,{"Matrix, number":o,"Array, number":function(l,a){return o(n(Bt(l)),a).valueOf()}});function o(u,l){if(u.size().length!==2)throw new Error("Only two dimensional matrix is supported");Br(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]])}});v();x();g();var z4="size",Tse=["typed","config","?matrix"],U4=K(z4,Tse,e=>{var{typed:t,config:r,matrix:n}=e;return t(z4,{Matrix:function(o){return o.create(o.size())},Array:Ht,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([]):Qy()}})});v();x();g();var H4="squeeze",Ose=["typed","matrix"],$4=K(H4,Ose,e=>{var{typed:t,matrix:r}=e;return t(H4,{Array:function(i){return ch(Bt(i))},Matrix:function(i){var o=ch(i.toArray());return Array.isArray(o)?r(o):o},any:function(i){return Bt(i)}})});v();x();g();var W4="subset",Ise=["typed","matrix","zeros","add"],tw=K(W4,Ise,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e;return t(W4,{"Matrix, Index":function(l,a){return ip(a)?r():(bg(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":_se,"string, Index":Fse,"Matrix, Index, any, any":function(l,a,s,f){return ip(a)?l:(bg(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":V4,"string, Index, string, string":V4,"Object, Index, any":kse});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 Fse(e,t){if(!du(t))throw new TypeError("Index expected");if(ip(t))return"";if(bg(Array.from(e),t),t.size().length!==1)throw new Xt(t.size().length,1);var r=e.length;Br(t.min()[0],r),Br(t.max()[0],r);var n=t.dimension(0),i="";return n.forEach(function(o){i+=e.charAt(o)}),i}function V4(e,t,r,n){if(!t||t.isIndex!==!0)throw new TypeError("Index expected");if(ip(t))return e;if(bg(Array.from(e),t),t.size().length!==1)throw new Xt(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 Xt(i.size()[0],r.length);var u=e.length;Br(t.min()[0]),Br(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(G4,{Array:u=>n(r(u)).valueOf(),Matrix:n,any:Bt});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: "+Yt(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: "+Yt(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(Z4,{any:function(o){return n(r(o))}})});v();x();g();var K4="zeros",Pse=["typed","config","matrix","BigNumber"],J4=K(K4,Pse,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(K4,{"":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?Ms(y,a,p):y}}function u(a){var s=!1;return a.forEach(function(f,p,h){_t(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")})}});v();x();g();var Q4="fft",Rse=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],j4=K(Q4,Rse,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(Q4,{Array:N,Matrix:function(M){return M.create(N(M.toArray()))}});function N(O){var M=Ht(O);return M.length===1?b(O,M[0]):w(O.map(I=>N(I,M.slice(1))),0)}function w(O,M){var I=Ht(O);if(M!==0)return new Array(I[0]).fill(0).map((C,P)=>w(O[P],M-1));if(I.length===1)return b(O);function F(C){var P=Ht(C);return new Array(P[1]).fill(0).map((R,q)=>new Array(P[0]).fill(0).map((z,H)=>C[H][q]))}return F(w(F(O),1))}function D(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((X,Z)=>o(1,F[Z])),...new Array(P-(M+M-1)).fill(0)],z=b(R),H=b(q),V=new Array(P).fill(0).map((X,Z)=>i(z[Z],H[Z])),W=s(f(N(f(V))),P),ee=[],ie=M-1;ieq%2===0),M/2),...b(O.filter((R,q)=>q%2===1),M/2)],F=0;F{var{typed:t,fft:r,dotDivide:n,conj:i}=e;return t(e5,{"Array | Matrix":function(u){var l=St(u)?u.size():Ht(u);return n(i(r(i(u))),l.reduce((a,s)=>a*s,1))}})});v();x();g();v();x();g();v();x();g();v();x();g();function _f(e){"@babel/helpers - typeof";return _f=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},_f(e)}v();x();g();function SA(e,t){if(_f(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(_f(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function EA(e){var t=SA(e,"string");return _f(t)=="symbol"?t:t+""}function Cr(e,t,r){return t=EA(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r5(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 zse(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:N,unaryMinus:w}=e;function D(R){return function(q,z,H,V){var W=!(z.length===2&&(z.every(C)||z.every(oi)));if(W)throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var ee=z[0],ie=z[1],X=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(et=>et!==void 0);if(!(he.every(C)||he.every(oi)))throw new Error('Inconsistent type of "t" dependant variables');for(var De=1,ye=V.tol?V.tol:1e-4,ce=V.minDelta?V.minDelta:.2,Ne=V.maxDelta?V.maxDelta:5,Pe=V.maxIter?V.maxIter:1e4,Ce=[ee,ie,...H,le,re].some(_t),[Oe,He,Ee,ze]=Ce?[N(R.a),N(R.c),N(R.b),N(R.bp)]:[R.a,R.c,R.b,R.bp],We=Z?X?Z:w(Z):o(n(ie,ee),De),Be=[ee],lt=[H],ct=n(Ee,ze),de=0,be=0,Ue=I(X),ve=F(X);Ue(Be[de],ie);){var Re=[];We=ve(Be[de],ie,We),Re.push(q(Be[de],lt[de]));for(var ke=1;keoi(et)?et.value:et)));Je1/4&&(Be.push(r(Be[de],We)),lt.push(r(lt[de],i(We,Ee,Re))),de++);var ot=.84*(ye/Je)**(1/5);if(h(ot,ce)?ot=ce:p(ot,Ne)&&(ot=Ne),ot=Ce?N(ot):ot,We=i(We,ot),le&&p(a(We),le)?We=X?le:w(le):re&&h(a(We),re)&&(We=X?re:w(re)),be++,be>Pe)throw new Error("Maximum number of iterations reached, try changing options")}return{t:Be,y:lt}}}function b(R,q,z,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],X={a:V,c:W,b:ee,bp:ie};return D(X)(R,q,z,H)}function O(R,q,z,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],X={a:V,c:W,b:ee,bp:ie};return D(X)(R,q,z,H)}function M(R,q,z,H){var V=H.method?H.method:"RK45",W={RK23:b,RK45:O};if(V.toUpperCase()in W){var ee=zse({},H);return delete ee.method,W[V.toUpperCase()](R,q,z,ee)}else{var ie=Object.keys(W).map(Z=>'"'.concat(Z,'"')),X="".concat(ie.slice(0,-1).join(", ")," and ").concat(ie.slice(-1));throw new Error('Unavailable method "'.concat(V,'". Available methods are ').concat(X))}}function I(R){return R?h:p}function F(R){var q=R?p:h;return function(z,H,V){var W=r(z,V);return q(W,H)?n(H,z):V}}function C(R){return _t(R)||Ut(R)}function P(R,q,z,H){var V=M(R,q.toArray(),z.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,z)=>M(R,q,z,{}),"function, Matrix, Matrix":(R,q,z)=>P(R,q,z,{}),"function, Array, number | BigNumber | Unit":(R,q,z)=>{var H=M(R,q,[z],{});return{t:H.t,y:H.y.map(V=>V[0])}},"function, Matrix, number | BigNumber | Unit":(R,q,z)=>{var H=M(R,q.toArray(),[z],{});return{t:y(H.t),y:y(H.y.map(V=>V[0]))}},"function, Array, number | BigNumber | Unit, Object":(R,q,z,H)=>{var V=M(R,q,[z],H);return{t:V.t,y:V.y.map(W=>W[0])}},"function, Matrix, number | BigNumber | Unit, Object":(R,q,z,H)=>{var V=M(R,q.toArray(),[z],H);return{t:y(V.t),y:y(V.y.map(W=>W[0]))}}})});v();x();g();var $se="erf",Wse=["typed"],i5=K($se,Wse,e=>{var{typed:t}=e;return t("name",{number:function(u){var l=Math.abs(u);return l>=Yse?Ua(u):l<=Vse?Ua(u)*r(l):l<=4?Ua(u)*(1-n(l)):Ua(u)*(1-i(l))},"Array | Matrix":t.referToSelf(o=>u=>Tt(u,o))});function r(o){var u=o*o,l=cl[0][4]*u,a=u,s;for(s=0;s<3;s+=1)l=(l+cl[0][s])*u,a=(a+Sh[0][s])*u;return o*(l+cl[0][3])/(a+Sh[0][3])}function n(o){var u=cl[1][8]*o,l=o,a;for(a=0;a<7;a+=1)u=(u+cl[1][a])*o,l=(l+Sh[1][a])*o;var s=(u+cl[1][7])/(l+Sh[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=cl[2][5]*u,a=u,s;for(s=0;s<4;s+=1)l=(l+cl[2][s])*u,a=(a+Sh[2][s])*u;var f=u*(l+cl[2][4])/(a+Sh[2][4]);f=(Gse-f)/o,u=parseInt(o*16)/16;var p=(o-u)*(o+u);return Math.exp(-u*u)*Math.exp(-p)*f}}),Vse=.46875,Gse=.5641895835477563,cl=[[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]],Sh=[[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]],Yse=Math.pow(2,53);v();x();g();var o5="zeta",Zse=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],a5=K(o5,Zse,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:N,BigNumber:w,pi:D}=e;return t(o5,{number:C=>b(C,P=>P,()=>20),BigNumber:C=>b(C,P=>new w(P),()=>Math.abs(Math.log10(r.epsilon))),Complex:O});function b(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 N(-.5):C.re===1?new N(NaN,NaN):C.re===1/0&&C.im===0?new N(1):C.im===1/0||C.re===-1/0?new N(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 z=R(C);if(q(C)>-(z-1)/2)return F(C,P(z),P);var H=n(i(2,C),i(P(D),h(C,1)));return H=n(H,p(n(o(P(D),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 z=o(n(u(y(P,h(q,1))),i(4,q)),n(u(h(P,q)),u(n(2,q))));R=y(R,z)}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))))),z=R(0),H=R(1);a(H,P);H=y(H,1))z=y(z,o(n((-1)**(H-1),I(H,P)),i(H,C)));return n(q,z)}});v();x();g();var s5="mode",Xse=["typed","isNaN","isNumeric"],u5=K(s5,Xse,e=>{var{typed:t,isNaN:r,isNumeric:n}=e;return t(s5,{"Array | Matrix":i,"...":function(u){return i(u)}});function i(o){o=rr(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}});v();x();g();v();x();g();function Mn(e,t,r){var n;return String(e).indexOf("Unexpected type")!==-1?(n=arguments.length>2?" (type: "+dr(r)+", value: "+JSON.stringify(r)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+n)):String(e).indexOf("complex numbers")!==-1?(n=arguments.length>2?" (type: "+dr(r)+", value: "+JSON.stringify(r)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+n)):e}var l5="prod",Kse=["typed","config","multiplyScalar","numeric"],f5=K(l5,Kse,e=>{var{typed:t,config:r,multiplyScalar:n,numeric:i}=e;return t(l5,{"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(fo(u,function(a){try{l=l===void 0?a:n(l,a)}catch(s){throw Mn(s,"prod",a)}}),typeof l=="string"&&(l=i(l,r.number)),l===void 0)throw new Error("Cannot calculate prod of an empty array");return l}});v();x();g();var c5="format",Jse=["typed"],p5=K(c5,Jse,e=>{var{typed:t}=e;return t(c5,{any:Yt,"any, Object | function | number | BigNumber":Yt})});v();x();g();var m5="bin",Qse=["typed","format"],h5=K(m5,Qse,e=>{var{typed:t,format:r}=e;return t(m5,{"number | BigNumber":function(i){return r(i,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(i,o){return r(i,{notation:"bin",wordSize:o})}})});v();x();g();var d5="oct",jse=["typed","format"],v5=K(d5,jse,e=>{var{typed:t,format:r}=e;return t(d5,{"number | BigNumber":function(i){return r(i,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(i,o){return r(i,{notation:"oct",wordSize:o})}})});v();x();g();var g5="hex",eue=["typed","format"],x5=K(g5,eue,e=>{var{typed:t,format:r}=e;return t(g5,{"number | BigNumber":function(i){return r(i,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(i,o){return r(i,{notation:"hex",wordSize:o})}})});v();x();g();v();x();g();var rw=/\$([\w.]+)/g;var y5="print",tue=["typed"],nw=K(y5,tue,e=>{var{typed:t}=e;return t(y5,{"string, Object | Array":w5,"string, Object | Array, number | Object":w5})});function w5(e,t,r){return e.replace(rw,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?hn(u)?u:Yt(u,r):n})}v();x();g();var b5="to",rue=["typed","matrix","concat"],D5=K(b5,rue,e=>{var{typed:t,matrix:r,concat:n}=e,i=er({typed:t,matrix:r,concat:n});return t(b5,{"Unit, Unit | string":(o,u)=>o.to(u)},i({Ds:!0}))});v();x();g();var N5="isPrime",nue=["typed"],S5=K(N5,nue,e=>{var{typed:t}=e;return t(N5,{number:function(n){if(n*0!==0)return!1;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},BigNumber:function(n){if(n.toNumber()*0!==0)return!1;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=>Tt(n,r))})});v();x();g();var iue="numeric",oue=["number","?bignumber","?fraction"],E5=K(iue,oue,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):Nh,Fraction:n?u=>n(u):Jy};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=dr(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)}});v();x();g();var A5="divideScalar",aue=["typed","numeric"],C5=K(A5,aue,e=>{var{typed:t,numeric:r}=e;return t(A5,{"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)},"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)})});v();x();g();var M5="pow",sue=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],T5=K(M5,sue,e=>{var{typed:t,config:r,identity:n,multiply:i,matrix:o,inv:u,number:l,fraction:a,Complex:s}=e;return t(M5,{"number, number":f,"Complex, Complex":function(N,w){return N.pow(w)},"BigNumber, BigNumber":function(N,w){return w.isInteger()||N>=0||r.predictable?N.pow(w):new s(N.toNumber(),0).pow(w.toNumber(),0)},"Fraction, Fraction":function(N,w){var D=N.pow(w);if(D!=null)return D;if(r.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return f(N.valueOf(),w.valueOf())},"Array, number":p,"Array, BigNumber":function(N,w){return p(N,w.toNumber())},"Matrix, number":h,"Matrix, BigNumber":function(N,w){return h(N,w.toNumber())},"Unit, number | BigNumber":function(N,w){return N.pow(w)}});function f(y,N){if(r.predictable&&!Nt(N)&&y<0)try{var w=a(N),D=l(w);if((N===D||Math.abs((N-D)/N)<1e-14)&&w.d%2===1)return(w.n%2===0?1:-1)*Math.pow(-y,N)}catch{}return r.predictable&&(y<-1&&N===1/0||y>-1&&y<0&&N===-1/0)?NaN:Nt(N)||y>=0||r.predictable?PE(y,N):y*y<1&&N===1/0||y*y>1&&N===-1/0?0:new s(y,0).pow(N,0)}function p(y,N){if(!Nt(N))throw new TypeError("For A^b, b must be an integer (value is "+N+")");var w=Ht(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(N<0)try{return p(u(y),-N)}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 "+N+")"):O}for(var D=n(w[0]).valueOf(),b=y;N>=1;)(N&1)===1&&(D=i(b,D)),N>>=1,b=i(b,b);return D}function h(y,N){return o(p(y.valueOf(),N))}});v();x();g();var Eh="Number of decimals in function round must be an integer",O5="round",uue=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],I5=K(O5,uue,e=>{var{typed:t,config:r,matrix:n,equalScalar:i,zeros:o,BigNumber:u,DenseMatrix:l}=e,a=Lr({typed:t,equalScalar:i}),s=Er({typed:t,DenseMatrix:l}),f=Zn({typed:t});function p(h){return Math.abs(fh(h).exponent)}return t(O5,{number:function(y){var N=xh(y,p(r.epsilon)),w=yn(y,N,r.epsilon)?N:y;return xh(w)},"number, number":function(y,N){var w=p(r.epsilon);if(N>=w)return xh(y,N);var D=xh(y,w),b=yn(y,D,r.epsilon)?D:y;return xh(b,N)},"number, BigNumber":function(y,N){if(!N.isInteger())throw new TypeError(Eh);return new u(y).toDecimalPlaces(N.toNumber())},Complex:function(y){return y.round()},"Complex, number":function(y,N){if(N%1)throw new TypeError(Eh);return y.round(N)},"Complex, BigNumber":function(y,N){if(!N.isInteger())throw new TypeError(Eh);var w=N.toNumber();return y.round(w)},BigNumber:function(y){var N=new u(y).toDecimalPlaces(p(r.epsilon)),w=ai(y,N,r.epsilon)?N:y;return w.toDecimalPlaces(0)},"BigNumber, BigNumber":function(y,N){if(!N.isInteger())throw new TypeError(Eh);var w=p(r.epsilon);if(N>=w)return y.toDecimalPlaces(N.toNumber());var D=y.toDecimalPlaces(w),b=ai(y,D,r.epsilon)?D:y;return b.toDecimalPlaces(N.toNumber())},Fraction:function(y){return y.round()},"Fraction, number":function(y,N){if(N%1)throw new TypeError(Eh);return y.round(N)},"Fraction, BigNumber":function(y,N){if(!N.isInteger())throw new TypeError(Eh);return y.round(N.toNumber())},"Unit, number, Unit":t.referToSelf(h=>function(y,N,w){var D=y.toNumeric(w);return w.multiply(h(D,N))}),"Unit, BigNumber, Unit":t.referToSelf(h=>(y,N,w)=>h(y,N.toNumber(),w)),"Unit, Unit":t.referToSelf(h=>(y,N)=>h(y,0,N)),"Array | Matrix, number, Unit":t.referToSelf(h=>(y,N,w)=>Tt(y,D=>h(D,N,w),!0)),"Array | Matrix, BigNumber, Unit":t.referToSelf(h=>(y,N,w)=>h(y,N.toNumber(),w)),"Array | Matrix, Unit":t.referToSelf(h=>(y,N)=>h(y,0,N)),"Array | Matrix":t.referToSelf(h=>y=>Tt(y,h,!0)),"SparseMatrix, number | BigNumber":t.referToSelf(h=>(y,N)=>a(y,N,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(y,N)=>f(y,N,h,!1)),"Array, number | BigNumber":t.referToSelf(h=>(y,N)=>f(n(y),N,h,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":t.referToSelf(h=>(y,N)=>i(y,0)?o(N.size(),N.storage()):s(N,y,h,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":t.referToSelf(h=>(y,N)=>i(y,0)?o(N.size(),N.storage()):f(N,y,h,!0)),"number | Complex | BigNumber | Fraction, Array":t.referToSelf(h=>(y,N)=>f(n(N),y,h,!0).valueOf())})});v();x();g();var F5="log",lue=["config","typed","divideScalar","Complex"],_5=K(F5,lue,e=>{var{typed:t,config:r,divideScalar:n,Complex:i}=e;return t(F5,{number:function(u){return u>=0||r.predictable?jF(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)))})});v();x();g();var k5="log1p",fue=["typed","config","divideScalar","log","Complex"],B5=K(k5,fue,e=>{var{typed:t,config:r,divideScalar:n,log:i,Complex:o}=e;return t(k5,{number:function(a){return a>=-1||r.predictable?yy(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=>Tt(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))}});v();x();g();var L5="nthRoots",cue=["config","typed","divideScalar","Complex"],P5=K(L5,cue,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=[],N=Math.pow(h,1/a),w=0;w{var{typed:t,equalScalar:r,matrix:n,pow:i,DenseMatrix:o,concat:u}=e,l=Xr({typed:t}),a=fi({typed:t,DenseMatrix:o}),s=Lr({typed:t,equalScalar:r}),f=Er({typed:t,DenseMatrix:o}),p=er({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 N=t(h);return t(R5,p({elop:N,SS:a,DS:l,Ss:s,sS:f}))});v();x();g();var z5="dotDivide",mue=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],U5=K(z5,mue,e=>{var{typed:t,matrix:r,equalScalar:n,divideScalar:i,DenseMatrix:o,concat:u}=e,l=Xn({typed:t,equalScalar:n}),a=Xr({typed:t}),s=fi({typed:t,DenseMatrix:o}),f=Lr({typed:t,equalScalar:n}),p=Er({typed:t,DenseMatrix:o}),h=er({typed:t,matrix:r,concat:u});return t(z5,h({elop:i,SS:s,DS:a,SD:l,Ss:f,sS:p}))});v();x();g();v();x();g();function bu(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: "+Yt(u)+")");var l=u[0],a=u[1];if(l!==a)throw new RangeError("Matrix must be square (size: "+Yt(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=bu({DenseMatrix:l});return t(H5,{"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 N=r(h),w=s(N,y);return w.valueOf()}});function s(p,h){h=a(p,h,!0);for(var y=h._data,N=p._size[0],w=p._size[1],D=[],b=p._data,O=0;OI&&(P.push(D[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=bu({DenseMatrix:l});return t(W5,{"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 N=r(h),w=s(N,y);return w.valueOf()}});function s(p,h){h=a(p,h,!0);for(var y=h._data,N=p._size[0],w=p._size[1],D=[],b=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=b[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,b[C][O]))]}D[O]=[I]}return new l({data:D,size:[N,1]})}function f(p,h){h=a(p,h,!0);for(var y=h._data,N=p._size[0],w=p._size[1],D=p._values,b=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],z=O[I+1],H=z-1;H>=q;H--){var V=b[H];V===I?C=D[H]:V{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:u,DenseMatrix:l}=e,a=bu({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 N=r(h),w=s(N,y);return w.map(D=>D.valueOf())}});function s(p,h){for(var y=[a(p,h,!0)._data.map(R=>R[0])],N=p._data,w=p._size[0],D=p._size[1],b=0;bnew 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])],N=p._size[0],w=p._size[1],D=p._values,b=p._index,O=p._ptr,M=0;MM&&(P.push(D[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(ye=>[ye]),size:[N,1]}))}});v();x();g();var Z5="usolveAll",gue=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],X5=K(Z5,gue,e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:u,DenseMatrix:l}=e,a=bu({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 N=r(h),w=s(N,y);return w.map(D=>D.valueOf())}});function s(p,h){for(var y=[a(p,h,!0)._data.map(R=>R[0])],N=p._data,w=p._size[0],D=p._size[1],b=D-1;b>=0;b--)for(var O=y.length,M=0;M=0;P--)C[P]=o(C[P],N[P][b]);y.push(C)}}else{if(M===0)return[];y.splice(M,1),M-=1,O-=1}else{I[b]=n(I[b],N[b][b]);for(var F=b-1;F>=0;F--)I[F]=o(I[F],i(I[b],N[F][b]))}}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])],N=p._size[0],w=p._size[1],D=p._values,b=p._index,O=p._ptr,M=w-1;M>=0;M--)for(var I=y.length,F=0;F=q;V--){var W=b[V];W===M?H=D[V]:Wnew l({data:De.map(ye=>[ye]),size:[N,1]}))}});v();x();g();v();x();g();var xue="matAlgo08xS0Sid",yue=["typed","equalScalar"],Ah=K(xue,yue,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,N=o._ptr,w=o._size,D=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==w.length)throw new Xt(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 b=f[0],O=f[1],M,I=r,F=0,C=u;typeof p=="string"&&p===D&&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=[],z=[],H=[],V,W,ee,ie,X=0;X{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 K5="leftShift",wue=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],J5=K(K5,wue,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:o,concat:u}=e,l=co({typed:t}),a=Xn({typed:t,equalScalar:n}),s=Ah({typed:t,equalScalar:n}),f=Go({typed:t,DenseMatrix:o}),p=Lr({typed:t,equalScalar:n}),h=Zn({typed:t}),y=er({typed:t,matrix:r,concat:u}),N=Ch({typed:t,matrix:r});return t(K5,{"number, number":HE,"BigNumber, BigNumber":zk,"SparseMatrix, number | BigNumber":t.referToSelf(w=>(D,b)=>n(b,0)?D.clone():p(D,b,w,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(w=>(D,b)=>n(b,0)?D.clone():h(D,b,w,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(w=>(D,b)=>n(D,0)?i(b.size(),b.storage()):f(b,D,w,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(w=>(D,b)=>n(D,0)?i(b.size(),b.storage()):h(b,D,w,!0))},N,y({SS:s,DS:l,SD:a}))});v();x();g();var Q5="rightArithShift",bue=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],j5=K(Q5,bue,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:o,concat:u}=e,l=co({typed:t}),a=Xn({typed:t,equalScalar:n}),s=Ah({typed:t,equalScalar:n}),f=Go({typed:t,DenseMatrix:o}),p=Lr({typed:t,equalScalar:n}),h=Zn({typed:t}),y=er({typed:t,matrix:r,concat:u}),N=Ch({typed:t,matrix:r});return t(Q5,{"number, number":$E,"BigNumber, BigNumber":Uk,"SparseMatrix, number | BigNumber":t.referToSelf(w=>(D,b)=>n(b,0)?D.clone():p(D,b,w,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(w=>(D,b)=>n(b,0)?D.clone():h(D,b,w,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(w=>(D,b)=>n(D,0)?i(b.size(),b.storage()):f(b,D,w,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(w=>(D,b)=>n(D,0)?i(b.size(),b.storage()):h(b,D,w,!0))},N,y({SS:s,DS:l,SD:a}))});v();x();g();var eB="rightLogShift",Due=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],tB=K(eB,Due,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:o,concat:u}=e,l=co({typed:t}),a=Xn({typed:t,equalScalar:n}),s=Ah({typed:t,equalScalar:n}),f=Go({typed:t,DenseMatrix:o}),p=Lr({typed:t,equalScalar:n}),h=Zn({typed:t}),y=er({typed:t,matrix:r,concat:u}),N=Ch({typed:t,matrix:r});return t(eB,{"number, number":WE,"SparseMatrix, number | BigNumber":t.referToSelf(w=>(D,b)=>n(b,0)?D.clone():p(D,b,w,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(w=>(D,b)=>n(b,0)?D.clone():h(D,b,w,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(w=>(D,b)=>n(D,0)?i(b.size(),b.storage()):f(b,D,w,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(w=>(D,b)=>n(D,0)?i(b.size(),b.storage()):h(b,D,w,!0))},N,y({SS:s,DS:l,SD:a}))});v();x();g();var rB="and",Nue=["typed","matrix","equalScalar","zeros","not","concat"],iw=K(rB,Nue,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:u}=e,l=Xn({typed:t,equalScalar:n}),a=Ff({typed:t,equalScalar:n}),s=Lr({typed:t,equalScalar:n}),f=Zn({typed:t}),p=er({typed:t,matrix:r,concat:u});return t(rB,{"number, number":KE,"Complex, Complex":function(y,N){return(y.re!==0||y.im!==0)&&(N.re!==0||N.im!==0)},"BigNumber, BigNumber":function(y,N){return!y.isZero()&&!N.isZero()&&!y.isNaN()&&!N.isNaN()},"Unit, Unit":t.referToSelf(h=>(y,N)=>h(y.value||0,N.value||0)),"SparseMatrix, any":t.referToSelf(h=>(y,N)=>o(N)?i(y.size(),y.storage()):s(y,N,h,!1)),"DenseMatrix, any":t.referToSelf(h=>(y,N)=>o(N)?i(y.size(),y.storage()):f(y,N,h,!1)),"any, SparseMatrix":t.referToSelf(h=>(y,N)=>o(y)?i(y.size(),y.storage()):s(N,y,h,!0)),"any, DenseMatrix":t.referToSelf(h=>(y,N)=>o(y)?i(y.size(),y.storage()):f(N,y,h,!0)),"Array, any":t.referToSelf(h=>(y,N)=>h(r(y),N).valueOf()),"any, Array":t.referToSelf(h=>(y,N)=>h(y,r(N)).valueOf())},p({SS:a,DS:l}))});v();x();g();var ow="compare",Sue=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],nB=K(ow,Sue,e=>{var{typed:t,config:r,equalScalar:n,matrix:i,BigNumber:o,Fraction:u,DenseMatrix:l,concat:a}=e,s=Xr({typed:t}),f=If({typed:t,equalScalar:n}),p=Er({typed:t,DenseMatrix:l}),h=er({typed:t,matrix:i,concat:a}),y=$a({typed:t});return t(ow,Eue({typed:t,config:r}),{"boolean, boolean":function(w,D){return w===D?0:w>D?1:-1},"BigNumber, BigNumber":function(w,D){return ai(w,D,r.epsilon)?new o(0):new o(w.cmp(D))},"Fraction, Fraction":function(w,D){return new u(w.compare(D))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},y,h({SS:f,DS:s,Ss:p}))}),Eue=K(ow,["typed","config"],e=>{var{typed:t,config:r}=e;return t(ow,{"number, number":function(i,o){return yn(i,o,r.epsilon)?0:i>o?1:-1}})});v();x();g();var fp=jr(oB(),1);var aB="compareNatural",Aue=["typed","compare"],sB=K(aB,Aue,e=>{var{typed:t,compare:r}=e,n=r.signatures["boolean,boolean"];return t(aB,{"any, any":i});function i(a,s){var f=dr(a),p=dr(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,fp.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,fp.default)(f,p);if(f!==p)return(0,fp.default)(f,p);if(f==="Complex")return Cue(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,fp.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 ma(s)&&ma(f)?u(a,s.toJSON().values,f.toJSON().values):ma(s)?o(a,s.toArray(),f):ma(f)?o(a,s,f.toArray()):al(s)?o(a,s.toJSON().data,f):al(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=er({typed:t,matrix:r,concat:n});return t(uB,Ny,i({elop:Ny,Ds:!0}))});v();x();g();var aw="equal",Tue=["typed","matrix","equalScalar","DenseMatrix","concat"],fB=K(aw,Tue,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,u=Xr({typed:t}),l=fi({typed:t,DenseMatrix:i}),a=Er({typed:t,DenseMatrix:i}),s=er({typed:t,matrix:r,concat:o});return t(aw,Oue({typed:t,equalScalar:n}),s({elop:n,SS:l,DS:u,Ss:a}))}),Oue=K(aw,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t(aw,{"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)}})});v();x();g();var cB="equalText",Iue=["typed","compareText","isZero"],pB=K(cB,Iue,e=>{var{typed:t,compareText:r,isZero:n}=e;return t(cB,{"any, any":function(o,u){return n(r(o,u))}})});v();x();g();var sw="smaller",Fue=["typed","config","matrix","DenseMatrix","concat"],mB=K(sw,Fue,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,u=Xr({typed:t}),l=fi({typed:t,DenseMatrix:i}),a=Er({typed:t,DenseMatrix:i}),s=er({typed:t,matrix:n,concat:o}),f=$a({typed:t});return t(sw,_ue({typed:t,config:r}),{"boolean, boolean":(p,h)=>pp.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}))}),_ue=K(sw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(sw,{"number, number":function(i,o){return i{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,u=Xr({typed:t}),l=fi({typed:t,DenseMatrix:i}),a=Er({typed:t,DenseMatrix:i}),s=er({typed:t,matrix:n,concat:o}),f=$a({typed:t});return t(uw,Bue({typed:t,config:r}),{"boolean, boolean":(p,h)=>p<=h,"BigNumber, BigNumber":function(h,y){return h.lte(y)||ai(h,y,r.epsilon)},"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}))}),Bue=K(uw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(uw,{"number, number":function(i,o){return i<=o||yn(i,o,r.epsilon)}})});v();x();g();var lw="larger",Lue=["typed","config","matrix","DenseMatrix","concat"],dB=K(lw,Lue,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,u=Xr({typed:t}),l=fi({typed:t,DenseMatrix:i}),a=Er({typed:t,DenseMatrix:i}),s=er({typed:t,matrix:n,concat:o}),f=$a({typed:t});return t(lw,Pue({typed:t,config:r}),{"boolean, boolean":(p,h)=>p>h,"BigNumber, BigNumber":function(h,y){return h.gt(y)&&!ai(h,y,r.epsilon)},"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}))}),Pue=K(lw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(lw,{"number, number":function(i,o){return i>o&&!yn(i,o,r.epsilon)}})});v();x();g();var fw="largerEq",Rue=["typed","config","matrix","DenseMatrix","concat"],vB=K(fw,Rue,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,u=Xr({typed:t}),l=fi({typed:t,DenseMatrix:i}),a=Er({typed:t,DenseMatrix:i}),s=er({typed:t,matrix:n,concat:o}),f=$a({typed:t});return t(fw,que({typed:t,config:r}),{"boolean, boolean":(p,h)=>p>=h,"BigNumber, BigNumber":function(h,y){return h.gte(y)||ai(h,y,r.epsilon)},"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(fw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(fw,{"number, number":function(i,o){return i>=o||yn(i,o,r.epsilon)}})});v();x();g();var gB="deepEqual",zue=["typed","equal"],xB=K(gB,zue,e=>{var{typed:t,equal:r}=e;return t(gB,{"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=Xr({typed:t}),a=fi({typed:t,DenseMatrix:o}),s=Er({typed:t,DenseMatrix:o}),f=er({typed:t,matrix:i,concat:u});return t(cw,Hue({typed:t,equalScalar:n}),f({elop:p,SS:a,DS:l,Ss:s}));function p(h,y){return!n(h,y)}}),Hue=K(cw,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t(cw,{"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)}})});v();x();g();var wB="partitionSelect",$ue=["typed","isNumeric","isNaN","compare"],bB=K(wB,$ue,e=>{var{typed:t,isNumeric:r,isNaN:n,compare:i}=e,o=i,u=(s,f)=>-i(s,f);return t(wB,{"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[D];s[D]=s[w],s[w]=O,--D}else++w;p(s[w],b)>0&&--w,f<=w?N=w:y=w+1}return s[f]}});v();x();g();var DB="sort",Wue=["typed","matrix","compare","compareNatural"],NB=K(DB,Wue,e=>{var{typed:t,matrix:r,compare:n,compareNatural:i}=e,o=n,u=(f,p)=>-n(f,p);return t(DB,{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(Ht(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")}});v();x();g();var SB="max",Vue=["typed","config","numeric","larger"],pw=K(SB,Vue,e=>{var{typed:t,config:r,numeric:n,larger:i}=e;return t(SB,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(a,s){return Of(a,s.valueOf(),o)},"...":function(a){if(Ha(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 Mn(s,"max",a)}}function u(l){var a;if(fo(l,function(s){try{isNaN(s)&&typeof s=="number"?a=NaN:(a===void 0||i(s,a))&&(a=s)}catch(f){throw Mn(f,"max",s)}}),a===void 0)throw new Error("Cannot calculate max of an empty array");return typeof a=="string"&&(a=n(a,r.number)),a}});v();x();g();var EB="min",Gue=["typed","config","numeric","smaller"],mw=K(EB,Gue,e=>{var{typed:t,config:r,numeric:n,smaller:i}=e;return t(EB,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(a,s){return Of(a,s.valueOf(),o)},"...":function(a){if(Ha(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 Mn(s,"min",a)}}function u(l){var a;if(fo(l,function(s){try{isNaN(s)&&typeof s=="number"?a=NaN:(a===void 0||i(s,a))&&(a=s)}catch(f){throw Mn(f,"min",s)}}),a===void 0)throw new Error("Cannot calculate min of an empty array");return typeof a=="string"&&(a=n(a,r.number)),a}});v();x();g();var Yue="ImmutableDenseMatrix",Zue=["smaller","DenseMatrix"],AB=K(Yue,Zue,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&&!hn(o))throw new Error("Invalid datatype: "+o);if(St(i)||fr(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&&fr(i.data)&&fr(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 ("+dr(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:Bt(this._data),size:Bt(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});v();x();g();var Xue="Index",Kue=["ImmutableDenseMatrix","getMatrixDataType"],MB=K(Xue,Kue,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}v();x();g();var Jue="FibonacciHeap",Que=["smaller","larger"],TB=K(Jue,Que,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 N=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=N,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),N=0,w=f;if(w)for(N++,w=w.right;w!==f;)N++,w=w.right;for(var D;N>0;){for(var b=w.degree,O=w.right;D=y[b],!!D;){if(r(w.key,D.key)){var M=D;D=w,w=M}a(D,w),y[b]=null,b++}y[b]=w,w=O,N--}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:N,Complex:w,BigNumber:D,Fraction:b}=e,O=N;function M(de,be){if(!(this instanceof M))throw new Error("Constructor must be called with the new operator");if(!(de==null||h(de)||wi(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(ve=>0);else if(typeof be=="string"){var Ue=M.parse(be);this.units=Ue.units,this.dimensions=Ue.dimensions}else if(oi(be)&&be.value===null)this.fixPrefix=be.fixPrefix,this.skipAutomaticSimplification=be.skipAutomaticSimplification,this.dimensions=be.dimensions.slice(0),this.units=be.units.map(ve=>qn({},ve));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===" ";)z()}function R(de){return de>="0"&&de<="9"||de==="."}function q(de){return de>="0"&&de<="9"}function z(){F++,C=I.charAt(F)}function H(de){F=de,C=I.charAt(F)}function V(){var de="",be=F;if(C==="+"?z():C==="-"&&(de+=C,z()),!R(C))return H(be),null;if(C==="."){if(de+=C,z(),!q(C))return H(be),null}else{for(;q(C);)de+=C,z();C==="."&&(de+=C,z())}for(;q(C);)de+=C,z();if(C==="E"||C==="e"){var Ue="",ve=F;if(Ue+=C,z(),(C==="+"||C==="-")&&(Ue+=C,z()),!q(C))return H(ve),de;for(de=de+Ue;q(C);)de+=C,z()}return de}function W(){for(var de="";q(C)||M.isValidAlpha(C);)de+=C,z();var be=de.charAt(0);return M.isValidAlpha(be)?de:null}function ee(de){return C===de?(z(),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 ve=1,Re=!1;z(),P();var ke=V(),Je=null;if(ke){if(r.number==="BigNumber")Je=new D(ke);else if(r.number==="Fraction")try{Je=new b(ke)}catch{Je=parseFloat(ke)}else Je=parseFloat(ke);P(),ee("*")?(ve=1,Re=!0):ee("/")&&(ve=-1,Re=!0)}for(var ot=[],et=1;;){for(P();C==="(";)ot.push(ve),et*=ve,ve=1,z(),P();var ut=void 0;if(C){var Lt=C;if(ut=W(),ut===null)throw new SyntaxError('Unexpected "'+Lt+'" in "'+I+'" at index '+F.toString())}else break;var fe=ie(ut);if(fe===null)throw new SyntaxError('Unit "'+ut+'" not found.');var J=ve*et;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(dr(de)),ve=0;ve{if(Et(ce,de)){var be=ce[de],Ue=be.prefixes[""];return{unit:be,prefix:Ue}}for(var ve in ce)if(Et(ce,ve)&&uF(de,ve)){var Re=ce[ve],ke=de.length-ve.length,Je=de.substring(0,ke),ot=Et(Re.prefixes,Je)?Re.prefixes[Je]: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=oi(de)?de:new M(de),ve=0;ve1e-12&&(Et(Oe,ot)?be.push({unit:Oe[ot].unit,prefix:Oe[ot].prefix,power:de.dimensions[Je]||0}):ke=!0)}be.length1e-12)if(Et(Ce.si,ve))be.push({unit:Ce.si[ve].unit,prefix:Ce.si[ve].prefix,power:de.dimensions[Ue]||0});else throw new Error("Cannot express custom unit "+ve+" 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,ve=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&&ve++;if(ve>0)for(var ke=0;ke0?(be+=" "+this.units[ke].prefix.name+this.units[ke].unit.name,Math.abs(this.units[ke].power+1)>1e-15&&(be+="^"+-this.units[ke].power)):(be+=" "+this.units[ke].prefix.name+this.units[ke].unit.name,be+="^"+this.units[ke].power));de=de.substr(1),be=be.substr(1),Ue>1&&ve>0&&(de="("+de+")"),ve>1&&Ue>0&&(be="("+be+")");var Je=de;return Ue>0&&ve>0&&(Je+=" / "),Je+=be,Je},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&&wi(be.value)&&(Ue=Math.abs(be.value.re)<1e-14);for(var ve in be.units)Et(be.units,ve)&&be.units[ve].unit&&(be.units[ve].unit.name==="VA"&&Ue?be.units[ve].unit=ce.VAR:be.units[ve].unit.name==="VAR"&&!Ue&&(be.units[ve].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),ke=be.value!==null?y(Re,de||{}):"",Je=be.formatUnits();return be.value&&wi(be.value)&&(ke="("+ke+")"),Je.length>0&&ke.length>0&&(ke+=" "),ke+=Je,ke},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 ve=this.units[0].power,Re=Math.log(de/Math.pow(Ue.value*be,ve))/Math.LN10-1.2;if(Re>-2.200001&&Re<1.800001)return Ue;Re=Math.abs(Re);var ke=this.units[0].unit.prefixes;for(var Je in ke)if(Et(ke,Je)){var ot=ke[Je];if(ot.scientific){var et=Math.abs(Math.log(de/Math.pow(ot.value*be,ve))/Math.LN10-1.2);(et0)},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 b(5,9),offset:459.67},degR:{name:"degR",base:re.TEMPERATURE,prefixes:Z.SHORT,value:new b(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 b(5,9),offset:459.67},rankine:{name:"rankine",base:re.TEMPERATURE,prefixes:Z.LONG,value:new b(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}},Ne={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=Ig(D);ce.rad.value=new D(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:ye,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 D(be.n).div(be.d).times(be.s):new D(be+"")},Fraction:function(be){return new b(be)},Complex:function(be){return be},number:function(be){return be!=null&&be.isFraction?N(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 Ne)if(Et(Ne,ze)){var We=ce[Ne[ze]],Be={};for(var lt in We)Et(We,lt)&&(Be[lt]=We[lt]);Be.name=ze,ce[ze]=Be}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 ve=0;ve"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,ve=[],Re=0,ke,Je,ot;if(be&&be.type==="Unit")Ue=be.clone();else if(typeof be=="string")be!==""&&(ke=be);else if(typeof be=="object")ke=be.definition,Je=be.prefixes,Re=be.offset,ot=be.baseName,be.aliases&&(ve=be.aliases.valueOf());else throw new TypeError('Cannot create unit "'+de+'" from "'+be.toString()+'": expecting "string" or "Unit" or "Object"');if(ve){for(var et=0;et1e-12){pe=!1;break}if(pe){j=!0,ut.base=re[ne];break}}if(!j){ot=ot||de+"_STUFF";var Le={dimensions:Ue.dimensions.slice(0)};Le.key=ot,re[ot]=Le,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 Lt in re)Et(re,Lt)&&(re[Lt].dimensions[le.length-1]=0);for(var fe={dimensions:[]},J=0;J{var{typed:t,Unit:r}=e;return t(LB,{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=>Tt(i,n))})});v();x();g();var RB="sparse",ile=["typed","SparseMatrix"],qB=K(RB,ile,e=>{var{typed:t,SparseMatrix:r}=e;return t(RB,{"":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)}})});v();x();g();var zB="createUnit",ole=["typed","Unit"],UB=K(zB,ole,e=>{var{typed:t,Unit:r}=e;return t(zB,{"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,{})}})});v();x();g();var HB="acos",ale=["typed","config","Complex"],$B=K(HB,ale,e=>{var{typed:t,config:r,Complex:n}=e;return t(HB,{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()}})});v();x();g();var WB="acosh",sle=["typed","config","Complex"],VB=K(WB,sle,e=>{var{typed:t,config:r,Complex:n}=e;return t(WB,{number:function(o){return o>=1||r.predictable?jE(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()}})});v();x();g();var GB="acot",ule=["typed","BigNumber"],YB=K(GB,ule,e=>{var{typed:t,BigNumber:r}=e;return t(GB,{number:eA,Complex:function(i){return i.acot()},BigNumber:function(i){return new r(1).div(i).atan()}})});v();x();g();var ZB="acoth",lle=["typed","config","Complex","BigNumber"],XB=K(ZB,lle,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(ZB,{number:function(u){return u>=1||u<=-1||r.predictable?tA(u):new n(u,0).acoth()},Complex:function(u){return u.acoth()},BigNumber:function(u){return new i(1).div(u).atanh()}})});v();x();g();var KB="acsc",fle=["typed","config","Complex","BigNumber"],JB=K(KB,fle,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(KB,{number:function(u){return u<=-1||u>=1||r.predictable?rA(u):new n(u,0).acsc()},Complex:function(u){return u.acsc()},BigNumber:function(u){return new i(1).div(u).asin()}})});v();x();g();var QB="acsch",cle=["typed","BigNumber"],jB=K(QB,cle,e=>{var{typed:t,BigNumber:r}=e;return t(QB,{number:nA,Complex:function(i){return i.acsch()},BigNumber:function(i){return new r(1).div(i).asinh()}})});v();x();g();var eL="asec",ple=["typed","config","Complex","BigNumber"],tL=K(eL,ple,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(eL,{number:function(u){return u<=-1||u>=1||r.predictable?iA(u):new n(u,0).asec()},Complex:function(u){return u.asec()},BigNumber:function(u){return new i(1).div(u).acos()}})});v();x();g();var rL="asech",mle=["typed","config","Complex","BigNumber"],nL=K(rL,mle,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(rL,{number:function(u){if(u<=1&&u>=-1||r.predictable){var l=1/u;if(l>0||r.predictable)return oA(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()}})});v();x();g();var iL="asin",hle=["typed","config","Complex"],oL=K(iL,hle,e=>{var{typed:t,config:r,Complex:n}=e;return t(iL,{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()}})});v();x();g();var dle="asinh",vle=["typed"],aL=K(dle,vle,e=>{var{typed:t}=e;return t("asinh",{number:aA,Complex:function(n){return n.asinh()},BigNumber:function(n){return n.asinh()}})});v();x();g();var gle="atan",xle=["typed"],sL=K(gle,xle,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()}})});v();x();g();var uL="atan2",yle=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],lL=K(uL,yle,e=>{var{typed:t,matrix:r,equalScalar:n,BigNumber:i,DenseMatrix:o,concat:u}=e,l=Xn({typed:t,equalScalar:n}),a=Xr({typed:t}),s=$y({typed:t,equalScalar:n}),f=Lr({typed:t,equalScalar:n}),p=Er({typed:t,DenseMatrix:o}),h=er({typed:t,matrix:r,concat:u});return t(uL,{"number, number":Math.atan2,"BigNumber, BigNumber":(y,N)=>i.atan2(y,N)},h({scalar:"number | BigNumber",SS:s,DS:a,SD:l,Ss:f,sS:p}))});v();x();g();var fL="atanh",wle=["typed","config","Complex"],cL=K(fL,wle,e=>{var{typed:t,config:r,Complex:n}=e;return t(fL,{number:function(o){return o<=1&&o>=-1||r.predictable?sA(o):new n(o,0).atanh()},Complex:function(o){return o.atanh()},BigNumber:function(o){return o.atanh()}})});v();x();g();v();x();g();var Va=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 pL="cos",ble=["typed"],mL=K(pL,ble,e=>{var{typed:t}=e,r=Va({typed:t});return t(pL,{number:Math.cos,"Complex | BigNumber":n=>n.cos()},r)});v();x();g();var hL="cosh",Dle=["typed"],dL=K(hL,Dle,e=>{var{typed:t}=e;return t(hL,{number:by,"Complex | BigNumber":r=>r.cosh()})});v();x();g();var vL="cot",Nle=["typed","BigNumber"],gL=K(vL,Nle,e=>{var{typed:t,BigNumber:r}=e,n=Va({typed:t});return t(vL,{number:uA,Complex:i=>i.cot(),BigNumber:i=>new r(1).div(i.tan())},n)});v();x();g();var xL="coth",Sle=["typed","BigNumber"],yL=K(xL,Sle,e=>{var{typed:t,BigNumber:r}=e;return t(xL,{number:lA,Complex:n=>n.coth(),BigNumber:n=>new r(1).div(n.tanh())})});v();x();g();var wL="csc",Ele=["typed","BigNumber"],bL=K(wL,Ele,e=>{var{typed:t,BigNumber:r}=e,n=Va({typed:t});return t(wL,{number:fA,Complex:i=>i.csc(),BigNumber:i=>new r(1).div(i.sin())},n)});v();x();g();var DL="csch",Ale=["typed","BigNumber"],NL=K(DL,Ale,e=>{var{typed:t,BigNumber:r}=e;return t(DL,{number:cA,Complex:n=>n.csch(),BigNumber:n=>new r(1).div(n.sinh())})});v();x();g();var SL="sec",Cle=["typed","BigNumber"],EL=K(SL,Cle,e=>{var{typed:t,BigNumber:r}=e,n=Va({typed:t});return t(SL,{number:pA,Complex:i=>i.sec(),BigNumber:i=>new r(1).div(i.cos())},n)});v();x();g();var AL="sech",Mle=["typed","BigNumber"],CL=K(AL,Mle,e=>{var{typed:t,BigNumber:r}=e;return t(AL,{number:mA,Complex:n=>n.sech(),BigNumber:n=>new r(1).div(n.cosh())})});v();x();g();var ML="sin",Tle=["typed"],TL=K(ML,Tle,e=>{var{typed:t}=e,r=Va({typed:t});return t(ML,{number:Math.sin,"Complex | BigNumber":n=>n.sin()},r)});v();x();g();var OL="sinh",Ole=["typed"],IL=K(OL,Ole,e=>{var{typed:t}=e;return t(OL,{number:hA,"Complex | BigNumber":r=>r.sinh()})});v();x();g();var FL="tan",Ile=["typed"],_L=K(FL,Ile,e=>{var{typed:t}=e,r=Va({typed:t});return t(FL,{number:Math.tan,"Complex | BigNumber":n=>n.tan()},r)});v();x();g();var Fle="tanh",_le=["typed"],kL=K(Fle,_le,e=>{var{typed:t}=e;return t("tanh",{number:Dy,"Complex | BigNumber":r=>r.tanh()})});v();x();g();var BL="setCartesian",kle=["typed","size","subset","compareNatural","Index","DenseMatrix"],LL=K(BL,kle,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:u}=e;return t(BL,{"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=rr(Array.isArray(a)?a:a.toArray()).sort(i),h=rr(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(PL,{"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 rr(a.toArray());var p=sl(rr(Array.isArray(a)?a:a.toArray()).sort(i)),h=sl(rr(Array.isArray(s)?s:s.toArray()).sort(i));f=[];for(var y,N=0;N{var{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:u}=e;return t(qL,{"Array | Matrix":function(a){var s;if(n(r(a),new o(0))===0)s=[];else{var f=rr(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(UL,{"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=sl(rr(Array.isArray(a)?a:a.toArray()).sort(i)),h=sl(rr(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($L,{"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=sl(rr(Array.isArray(l)?l:l.toArray()).sort(i)),f=sl(rr(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(VL,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(l,a){if(n(r(a),new o(0))===0)return 0;for(var s=rr(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(YL,{"Array | Matrix":function(s){if(n(r(s),new o(0))===0)return[];for(var f=rr(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}});v();x();g();var XL="setSize",Ule=["typed","compareNatural"],KL=K(XL,Ule,e=>{var{typed:t,compareNatural:r}=e;return t(XL,{"Array | Matrix":function(i){return Array.isArray(i)?rr(i).length:rr(i.toArray()).length},"Array | Matrix, boolean":function(i,o){if(o===!1||i.length===0)return Array.isArray(i)?rr(i).length:rr(i.toArray()).length;for(var u=rr(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(JL,{"Array | Matrix, Array | Matrix":function(a,s){if(i(r(a),new u(0))===0)return rr(s);if(i(r(s),new u(0))===0)return rr(a);var f=rr(a),p=rr(s);return n(o(f,p),o(p,f))}})});v();x();g();var jL="setUnion",$le=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],e6=K(jL,$le,e=>{var{typed:t,size:r,concat:n,subset:i,setIntersect:o,setSymDifference:u,Index:l}=e;return t(jL,{"Array | Matrix, Array | Matrix":function(s,f){if(i(r(s),new l(0))===0)return rr(f);if(i(r(f),new l(0))===0)return rr(s);var p=rr(s),h=rr(f);return n(u(p,h),o(p,h))}})});v();x();g();var t6="add",Wle=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],r6=K(t6,Wle,e=>{var{typed:t,matrix:r,addScalar:n,equalScalar:i,DenseMatrix:o,SparseMatrix:u,concat:l}=e,a=co({typed:t}),s=bh({typed:t,equalScalar:i}),f=Go({typed:t,DenseMatrix:o}),p=er({typed:t,matrix:r,concat:l});return t(t6,{"any, any":n,"any, any, ...any":t.referToSelf(h=>(y,N,w)=>{for(var D=h(y,N),b=0;b{var{typed:t,abs:r,addScalar:n,divideScalar:i,multiplyScalar:o,sqrt:u,smaller:l,isPositive:a}=e;return t(n6,{"... number | BigNumber":s,Array:s,Matrix:f=>s(rr(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(o6,{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 N(P){var R=0;return P.forEach(function(q){var z=r(q);s(z,R)&&(R=z)},!0),R}function w(P){var R;return P.forEach(function(q){var z=r(q);(!R||f(z,R))&&(R=z)},!0),R||0}function D(P,R){if(R===Number.POSITIVE_INFINITY||R==="inf")return N(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(z){q=n(i(r(z),R),q)},!0),i(q,1/R)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function b(P){var R=0;return P.forEach(function(q,z){R=n(R,l(q,o(q)))}),r(u(R))}function O(P){var R=[],q=0;return P.forEach(function(z,H){var V=H[1],W=n(R[V]||0,r(z));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),z=l(q,P),H=y(z).values.toArray(),V=H[H.length-1];return r(u(V))}function I(P){var R=[],q=0;return P.forEach(function(z,H){var V=H[0],W=n(R[V]||0,r(z));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 b(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 D(P,R);if(q.length===2){if(q[0]&&q[1])return F(P,R);throw new RangeError("Invalid matrix dimensions")}}});v();x();g();var s6="dot",Yle=["typed","addScalar","multiplyScalar","conj","size"],u6=K(s6,Yle,e=>{var{typed:t,addScalar:r,multiplyScalar:n,conj:i,size:o}=e;return t(s6,{"Array | DenseMatrix, Array | DenseMatrix":l,"SparseMatrix, SparseMatrix":a});function u(f,p){var h=s(f),y=s(p),N,w;if(h.length===1)N=h[0];else if(h.length===2&&h[1]===1)N=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(N!==w)throw new RangeError("Vectors must have equal length ("+N+" != "+w+")");if(N===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return N}function l(f,p){var h=u(f,p),y=St(f)?f._data:f,N=St(f)?f._datatype||f.getDataType():void 0,w=St(p)?p._data:p,D=St(p)?p._datatype||p.getDataType():void 0,b=s(f).length===2,O=s(p).length===2,M=r,I=n;if(N&&D&&N===D&&typeof N=="string"&&N!=="mixed"){var F=N;M=t.find(r,[F,F]),I=t.find(n,[F,F])}if(!b&&!O){for(var C=I(i(y[0]),w[0]),P=1;PC){I++;continue}F===C&&(D=b(D,O(y[M],w[I])),M++,I++)}return D}function s(f){return St(f)?f.size():o(f)}});v();x();g();var Zle="trace",Xle=["typed","matrix","add"],l6=K(Zle,Xle,e=>{var{typed:t,matrix:r,add:n}=e;return t("trace",{Array:function(l){return i(r(l))},SparseMatrix:o,DenseMatrix:i,any:Bt});function i(u){var l=u._size,a=u._data;switch(l.length){case 1:if(l[0]===1)return Bt(a[0]);throw new RangeError("Matrix must be square (size: "+Yt(l)+")");case 2:{var s=l[0],f=l[1];if(s===f){for(var p=0,h=0;h0)for(var N=0;NN)break}return y}throw new RangeError("Matrix must be square (size: "+Yt(f)+")")}});v();x();g();var f6="index",Kle=["typed","Index"],c6=K(f6,Kle,e=>{var{typed:t,Index:r}=e;return t(f6,{"...number | string | BigNumber | Range | Array | Matrix":function(i){var o=i.map(function(l){return _t(l)?l.toNumber():fr(l)||St(l)?l.map(function(a){return _t(a)?a.toNumber():a}):l}),u=new r;return r.apply(u,o),u}})});v();x();g();v();x();g();var dw=new Set(["end"]);var Jle="Node",Qle=["mathWithTransform"],p6=K(Jle,Qle,e=>{var{mathWithTransform:t}=e;function r(i){for(var o of[...dw])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=ul(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(!lr(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&&As(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});v();x();g();v();x();g();v();x();g();function Kr(e){return e&&e.isIndexError?new Si(e.index+1,e.min+1,e.max!==void 0?e.max+1:void 0):e}function vw(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 un(n,i.getObjectProperty())}else throw new TypeError("Cannot apply index: unsupported type of object")}catch(o){throw Kr(o)}}}var gw="AccessorNode",jle=["subset","Node"],m6=K(gw,jle,e=>{var{subset:t,Node:r}=e,n=vw({subset:t});function i(u){return!(To(u)||bi(u)||ir(u)||Ji(u)||gu(u)||Di(u)||Rr(u))}class o extends r{constructor(l,a){if(super(),!lr(l))throw new TypeError('Node expected for parameter "object"');if(!Ho(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 gw}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,N,w){return un(s(y,N,w),p)}}else return function(y,N,w){var D=s(y,N,w),b=f(y,N,D);return n(D,b)}}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:gw,object:this.object,index:this.index}}static fromJSON(l){return new o(l.object,l.index)}}return Cr(o,"name",gw),o},{isClass:!0,isNode:!0});v();x();g();var xw="ArrayNode",efe=["Node"],h6=K(xw,efe,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),this.items=i||[],!Array.isArray(this.items)||!this.items.every(lr))throw new TypeError("Array containing Nodes expected")}get type(){return xw}get isArrayNode(){return!0}_compile(i,o){var u=$o(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($o(u,function(y){return y(f,p,h)}))}}else return function(f,p,h){return $o(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(bi)&&!u.every(bi),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 Cr(r,"name",xw),r},{isClass:!0,isNode:!0});v();x();g();v();x();g();function d6(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 xu(i,o.getObjectProperty(),u),i}else throw new TypeError("Cannot apply index: unsupported type of object")}}catch(a){throw Kr(a)}}}v();x();g();var Ga=[{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 yw(e,t){if(!t||t!=="auto")return e;for(var r=e;Di(r);)r=r.content;return r}function Fr(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=vw({subset:t}),o=d6({subset:t,matrix:r});function u(a,s,f){s||(s="keep");var p=Fr(a,s,f),h=Fr(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,!Rr(s)&&!To(s))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(Rr(s)&&s.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!Ho(this.index))throw new TypeError('IndexNode expected as "index"');if(!lr(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 bw}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),N=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 xu(P,w,R),R}}else{if(Rr(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(N,o(P,q,R)),R};var D=this.object.object._compile(s,f);if(this.object.index.isObjectProperty()){var b=this.object.index.getObjectProperty();return function(I,F,C){var P=D(I,F,C),R=un(P,b),q=h(I,F,R),z=y(I,F,C);return xu(P,b,o(R,q,z)),z}}else{var O=this.object.index._compile(s,f);return function(I,F,C){var P=D(I,F,C),R=O(I,F,P),q=i(P,R),z=h(I,F,q),H=y(I,F,C);return o(P,R,o(q,z,H)),H}}}else{if(!Rr(this.object))throw new TypeError("SymbolNode expected as object");return function(I,F,C){var P=y(I,F,C);return I.set(N,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:bw,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 Cr(l,"name",bw),l},{isClass:!0,isNode:!0});v();x();g();var Dw="BlockNode",rfe=["ResultSet","Node"],x6=K(Dw,rfe,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(!lr(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 Dw}get isBlockNode(){return!0}_compile(o,u){var l=$o(this.blocks,function(a){return{evaluate:a.node._compile(o,u),visible:a.visible}});return function(s,f,p){var h=[];return Nf(l,function(N){var w=N.evaluate(s,f,p);N.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 Cr(n,"name",Dw),n},{isClass:!0,isNode:!0});v();x();g();var Nw="ConditionalNode",nfe=["Node"],y6=K(Nw,nfe,e=>{var{Node:t}=e;function r(i){if(typeof i=="number"||typeof i=="boolean"||typeof i=="string")return!!i;if(i){if(_t(i))return!i.isZero();if(wi(i))return!!(i.re||i.im);if(oi(i))return!!i.value}if(i==null)return!1;throw new TypeError('Unsupported type of condition "'+dr(i)+'"')}class n extends t{constructor(o,u,l){if(super(),!lr(o))throw new TypeError("Parameter condition must be a Node");if(!lr(u))throw new TypeError("Parameter trueExpr must be a Node");if(!lr(l))throw new TypeError("Parameter falseExpr must be a Node");this.condition=o,this.trueExpr=u,this.falseExpr=l}get type(){return Nw}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=Fr(this,u,o&&o.implicit),a=this.condition.toString(o),s=Fr(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=Fr(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=Fr(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:Nw,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=Fr(this,u,o&&o.implicit),a=this.condition.toHTML(o),s=Fr(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=Fr(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=Fr(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 Cr(n,"name",Nw),n},{isClass:!0,isNode:!0});v();x();g();v();x();g();var N6=jr(b6(),1);var MA={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{?}"},Mr={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"},TA={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(Mr.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(Mr.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(Mr.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(Mr.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(Mr.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(Mr.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(Mr.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(Mr.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(Mr.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(Mr.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(Mr.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(Mr.bitAnd,"${args[1]}\\right)")},bitNot:{1:Mr.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(Mr.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(Mr.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(Mr.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(Mr.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(Mr.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(Mr.and,"${args[1]}\\right)")},not:{1:Mr.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(Mr.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(Mr.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(Mr.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(Mr.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(Mr.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(Mr.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(Mr.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(Mr.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(Mr.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(Mr.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(Mr.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(Mr.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(Mr.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)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(MA.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)"}},S6="\\mathrm{${name}}\\left(${args}\\right)",D6={deg:"^\\circ"};function Sw(e){return(0,N6.default)(e,{preserveFormatting:!0})}function Ew(e,t){return t=typeof t>"u"?!1:t,t?Et(D6,e)?D6[e]:"\\mathrm{"+Sw(e)+"}":Et(MA,e)?MA[e]:Sw(e)}var Aw="ConstantNode",sfe=["Node"],E6=K(Aw,sfe,e=>{var{Node:t}=e;class r extends t{constructor(i){super(),this.value=i}get type(){return Aw}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 Yt(this.value,i)}_toHTML(i){var o=this._toString(i);switch(dr(this.value)){case"number":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:Aw,value:this.value}}static fromJSON(i){return new r(i.value)}_toTex(i){var o=this._toString(i),u=dr(this.value);switch(u){case"string":return"\\mathtt{"+Sw(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"Fraction":return this.value.toLatex();default:return o}}}return Cr(r,"name",Aw),r},{isClass:!0,isNode:!0});v();x();g();var Cw="FunctionAssignmentNode",ufe=["typed","Node"],A6=K(Cw,ufe,e=>{var{typed:t,Node:r}=e;function n(o,u,l){var a=Fr(o,u,l),s=Fr(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(!lr(a))throw new TypeError('Node expected for parameter "expr"');if(dw.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 Cw}get isFunctionAssignmentNode(){return!0}_compile(u,l){var a=Object.create(l);Nf(this.params,function(N){a[N]=!0});var s=this.expr._compile(u,a),f=this.name,p=this.params,h=iE(this.types,","),y=f+"("+iE(this.params,", ")+")";return function(w,D,b){var O={};O[h]=function(){for(var I=Object.create(D),F=0;F'+Ni(this.params[s])+"");var f=this.expr.toHTML(u);return n(this,l,u&&u.implicit)&&(f='('+f+')'),''+Ni(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(Ew).join(",")+"\\right)="+a}}return Cr(i,"name",Cw),i},{isClass:!0,isNode:!0});v();x();g();var Mw="IndexNode",lfe=["Node","size"],C6=K(Mw,lfe,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(lr))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 Mw}get isIndexNode(){return!0}_compile(o,u){var l=$o(this.dimensions,function(s,f){var p=s.filter(N=>N.isSymbolNode&&N.name==="end").length>0;if(p){var h=Object.create(u);h.end=!0;var y=s._compile(o,h);return function(w,D,b){if(!St(b)&&!fr(b)&&!hn(b))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+dr(b));var O=r(b).valueOf(),M=Object.create(D);return M.end=O[f],y(w,M,b)}}else return s._compile(o,u)}),a=un(o,"index");return function(f,p,h){var y=$o(l,function(N){return N(f,p,h)});return a(...y)}}forEach(o){for(var u=0;u.'+Ni(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 Cr(n,"name",Mw),n},{isClass:!0,isNode:!0});v();x();g();var Tw="ObjectNode",ffe=["Node"],M6=K(Tw,ffe,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 lr(i[o])})))throw new TypeError("Object containing Nodes expected")}get type(){return Tw}get isObjectNode(){return!0}_compile(i,o){var u={};for(var l in this.properties)if(Et(this.properties,l)){var a=np(l),s=JSON.parse(a),f=un(this.properties,l);u[s]=f._compile(i,o)}return function(h,y,N){var w={};for(var D in u)Et(u,D)&&(w[D]=u[D](h,y,N));return w}}forEach(i){for(var o in this.properties)Et(this.properties,o)&&i(this.properties[o],"properties["+np(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["+np(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(np(u)+": "+this.properties[u].toString(i));return"{"+o.join(", ")+"}"}toJSON(){return{mathjs:Tw,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(''+Ni(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 Cr(r,"name",Tw),r},{isClass:!0,isNode:!0});v();x();g();v();x();g();function cp(e,t){return new hh(e,new ap(t),new Set(Object.keys(t)))}var Ow="OperatorNode",cfe=["Node"],T6=K(Ow,cfe,e=>{var{Node:t}=e;function r(o,u){var l=o;if(u==="auto")for(;Di(l);)l=l.content;return ir(l)?!0:Zr(l)?r(l.args[0],u):!1}function n(o,u,l,a,s){var f=Fr(o,u,l),p=Mh(o,u);if(u==="all"||a.length>2&&o.getIdentifier()!=="OperatorNode:add"&&o.getIdentifier()!=="OperatorNode:multiply")return a.map(function(z){switch(z.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=Fr(a[0],u,l,o);if(s&&y!==null){var N,w;if(u==="keep"?(N=a[0].getIdentifier(),w=o.getIdentifier()):(N=a[0].getContent().getIdentifier(),w=o.getContent().getIdentifier()),Ga[f][w].latexLeftParens===!1){h=[!1];break}if(Ga[y][N].latexParens===!1){h=[!1];break}}if(y===null){h=[!1];break}if(y<=f){h=[!0];break}h=[!1]}break;case 2:{var D,b=Fr(a[0],u,l,o),O=ww(o,a[0],u);b===null?D=!1:b===f&&p==="right"&&!O||b=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 D=s.map(function(b,O){return b=b.toString(u),f[O]&&(b="("+b+")"),b});return this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&a==="hide"?D.join(" "):D.join(" "+this.op+" ")}else return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:Ow,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=Mh(this,l),h=s[0].toHTML(u);return f[0]&&(h='('+h+')'),p==="right"?''+Ni(this.op)+""+h:h+''+Ni(this.op)+""}else if(s.length===2){var y=s[0].toHTML(u),N=s[1].toHTML(u);return f[0]&&(y='('+y+')'),f[1]&&(N='('+N+')'),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&a==="hide"?y+''+N:y+''+Ni(this.op)+""+N}else{var w=s.map(function(D,b){return D=D.toHTML(u),f[b]&&(D='('+D+')'),D});return s.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")?this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&a==="hide"?w.join(''):w.join(''+Ni(this.op)+""):''+Ni(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=Mr[this.fn];if(p=typeof p>"u"?this.op:p,s.length===1){var h=Mh(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 N=s[0],w=N.toTex(u);f[0]&&(w="\\left(".concat(w,"\\right)"));var D=s[1],b=D.toTex(u);f[1]&&(b="\\left(".concat(b,"\\right)"));var O;switch(l==="keep"?O=N.getIdentifier():O=N.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return p+"{"+w+"}{"+b+"}";case"OperatorNode:pow":switch(w="{"+w+"}",b="{"+b+"}",O){case"ConditionalNode":case"OperatorNode:divide":w="\\left(".concat(w,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&a==="hide")return w+"~"+b}return w+p+b}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 Cr(i,"name",Ow),i},{isClass:!0,isNode:!0});v();x();g();var Iw="ParenthesisNode",pfe=["Node"],O6=K(Iw,pfe,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),!lr(i))throw new TypeError('Node expected for parameter "content"');this.content=i}get type(){return Iw}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:Iw,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 Cr(r,"name",Iw),r},{isClass:!0,isNode:!0});v();x();g();var Fw="RangeNode",mfe=["Node"],I6=K(Fw,mfe,e=>{var{Node:t}=e;function r(i,o,u){var l=Fr(i,o,u),a={},s=Fr(i.start,o,u);if(a.start=s!==null&&s<=l||o==="all",i.step){var f=Fr(i.step,o,u);a.step=f!==null&&f<=l||o==="all"}var p=Fr(i.end,o,u);return a.end=p!==null&&p<=l||o==="all",a}class n extends t{constructor(o,u,l){if(super(),!lr(o))throw new TypeError("Node expected");if(!lr(u))throw new TypeError("Node expected");if(l&&!lr(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 Fw}get isRangeNode(){return!0}needsEnd(){var o=this.filter(function(u){return Rr(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,N){return l(a(h,y,N),s(h,y,N),f(h,y,N))}}else return function(h,y,N){return l(a(h,y,N),s(h,y,N))}}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:Fw,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 Cr(n,"name",Fw),n},{isClass:!0,isNode:!0});v();x();g();var _w="RelationalNode",hfe=["Node"],F6=K(_w,hfe,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,N=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=Fr(this,u,o&&o.implicit),a=this.params.map(function(p,h){var y=Fr(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'+Ni(r[this.conditionals[f]])+""+a[f+1];return s}_toTex(o){for(var u=o&&o.parenthesis?o.parenthesis:"keep",l=Fr(this,u,o&&o.implicit),a=this.params.map(function(p,h){var y=Fr(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 un(h,s)};if(s in l)return function(p,h,y){return p.has(s)?p.get(s):un(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=Ni(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=Ew(this.name,a);return s[0]==="\\"?s:" "+s}}return o},{isClass:!0,isNode:!0});v();x();g();var kw="FunctionNode",gfe=["math","Node","SymbolNode"],k6=K(kw,gfe,e=>{var t,{math:r,Node:n,SymbolNode:i}=e,o=a=>Yt(a,{truncate:78});function u(a,s,f){for(var p="",h=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,y=0,N;(N=h.exec(a))!==null;)if(p+=a.substring(y,N.index),y=N.index,N[0]==="$$")p+="$",y++;else{y+=N[0].length;var w=s[N[1]];if(!w)throw new ReferenceError("Template: Property "+N[1]+" does not exist.");if(N[2]===void 0)switch(typeof w){case"string":p+=w;break;case"object":if(lr(w))p+=w.toTex(f);else if(Array.isArray(w))p+=w.map(function(D,b){if(lr(D))return D.toTex(f);throw new TypeError("Template: "+N[1]+"["+b+"] is not a Node.")}).join(",");else throw new TypeError("Template: "+N[1]+" has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: "+N[1]+" has to be a Node, String or array of Nodes")}else if(lr(w[N[2]]&&w[N[2]]))p+=w[N[2]].toTex(f);else throw new TypeError("Template: "+N[1]+"["+N[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)),!lr(s))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(f)||!f.every(lr))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 kw}get isFunctionNode(){return!0}_compile(s,f){var p=this.args.map(R=>R._compile(s,f));if(Rr(this.fn)){var h=this.fn.name;if(f[h]){var b=this.args;return function(q,z,H){var V=un(z,h);if(typeof V!="function")throw new TypeError("Argument '".concat(h,"' was not a function; received: ").concat(o(V)));if(V.rawArgs)return V(b,s,cp(q,z));var W=p.map(ee=>ee(q,z,H));return V.apply(V,W)}}else{var y=h in s?un(s,h):void 0,N=typeof y=="function"&&y.rawArgs===!0,w=R=>{var q;if(R.has(h))q=R.get(h);else if(h in s)q=un(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(N){var D=this.args;return function(q,z,H){var V=w(q);return V(D,s,cp(q,z))}}else switch(p.length){case 0:return function(q,z,H){var V=w(q);return V()};case 1:return function(q,z,H){var V=w(q),W=p[0];return V(W(q,z,H))};case 2:return function(q,z,H){var V=w(q),W=p[0],ee=p[1];return V(W(q,z,H),ee(q,z,H))};default:return function(q,z,H){var V=w(q),W=p.map(ee=>ee(q,z,H));return V(...W)}}}}else if(To(this.fn)&&Ho(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,z,H){var V=O(q,z,H),W=gF(V,M);if(W!=null&&W.rawArgs)return W(I,s,cp(q,z));var ee=p.map(ie=>ie(q,z,H));return W.apply(V,ee)}}else{var F=this.fn.toString(),C=this.fn._compile(s,f),P=this.args;return function(q,z,H){var V=C(q,z,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,cp(q,z));var W=p.map(ee=>ee(q,z,H));return V.apply(V,W)}}}forEach(s){s(this.fn,"fn",this);for(var f=0;f'+Ni(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;TA[this.name]&&(p=TA[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(S6,this,s)}getIdentifier(){return this.type+":"+this.name}}return t=l,Cr(l,"name",kw),Cr(l,"onUndefinedFunction",function(a){throw new Error("Undefined function "+a)}),Cr(l,"fromJSON",function(a){return new t(a.fn,a.args)}),l},{isClass:!0,isNode:!0});v();x();g();var B6="parse",xfe=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],L6=K(B6,xfe,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:N,ParenthesisNode:w,RangeNode:D,RelationalNode:b,SymbolNode:O}=e,M=t(B6,{string:function(xe){return De(xe,{})},"Array | Matrix":function(xe){return I(xe,{})},"string, Object":function(xe,Ye){var tt=Ye.nodes!==void 0?Ye.nodes:{};return De(xe,tt)},"Array | Matrix, Object":I});function I(Y){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ye=xe.nodes!==void 0?xe.nodes:{};return Tt(Y,function(tt){if(typeof tt!="string")throw new TypeError("String expected");return De(tt,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"],z={'"':'"',"'":"'","\\":"\\","/":"/",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(Y,xe){return Y.expression.substr(Y.index,xe)}function W(Y){return V(Y,1)}function ee(Y){Y.index++}function ie(Y){return Y.expression.charAt(Y.index-1)}function X(Y){return Y.expression.charAt(Y.index+1)}function Z(Y){for(Y.tokenType=F.NULL,Y.token="",Y.comment="";;){if(W(Y)==="#")for(;W(Y)!==` -`&&W(Y)!=="";)Y.comment+=W(Y),ee(Y);if(M.isWhitespace(W(Y),Y.nestingLevel))ee(Y);else break}if(W(Y)===""){Y.tokenType=F.DELIMITER;return}if(W(Y)===` -`&&!Y.nestingLevel){Y.tokenType=F.DELIMITER,Y.token=W(Y),ee(Y);return}var xe=W(Y),Ye=V(Y,2),tt=V(Y,3);if(tt.length===3&&C[tt]){Y.tokenType=F.DELIMITER,Y.token=tt,ee(Y),ee(Y),ee(Y);return}if(Ye.length===2&&C[Ye]){Y.tokenType=F.DELIMITER,Y.token=Ye,ee(Y),ee(Y);return}if(C[xe]){Y.tokenType=F.DELIMITER,Y.token=xe,ee(Y);return}if(M.isDigitDot(xe)){Y.tokenType=F.NUMBER;var wt=V(Y,2);if(wt==="0b"||wt==="0o"||wt==="0x"){for(Y.token+=W(Y),ee(Y),Y.token+=W(Y),ee(Y);M.isHexDigit(W(Y));)Y.token+=W(Y),ee(Y);if(W(Y)===".")for(Y.token+=".",ee(Y);M.isHexDigit(W(Y));)Y.token+=W(Y),ee(Y);else if(W(Y)==="i")for(Y.token+="i",ee(Y);M.isDigit(W(Y));)Y.token+=W(Y),ee(Y);return}if(W(Y)==="."){if(Y.token+=W(Y),ee(Y),!M.isDigit(W(Y))){Y.tokenType=F.DELIMITER;return}}else{for(;M.isDigit(W(Y));)Y.token+=W(Y),ee(Y);M.isDecimalMark(W(Y),X(Y))&&(Y.token+=W(Y),ee(Y))}for(;M.isDigit(W(Y));)Y.token+=W(Y),ee(Y);if(W(Y)==="E"||W(Y)==="e"){if(M.isDigit(X(Y))||X(Y)==="-"||X(Y)==="+"){if(Y.token+=W(Y),ee(Y),(W(Y)==="+"||W(Y)==="-")&&(Y.token+=W(Y),ee(Y)),!M.isDigit(W(Y)))throw Xe(Y,'Digit expected, got "'+W(Y)+'"');for(;M.isDigit(W(Y));)Y.token+=W(Y),ee(Y);if(M.isDecimalMark(W(Y),X(Y)))throw Xe(Y,'Digit expected, got "'+W(Y)+'"')}else if(X(Y)===".")throw ee(Y),Xe(Y,'Digit expected, got "'+W(Y)+'"')}return}if(M.isAlpha(W(Y),ie(Y),X(Y))){for(;M.isAlpha(W(Y),ie(Y),X(Y))||M.isDigit(W(Y));)Y.token+=W(Y),ee(Y);Et(P,Y.token)?Y.tokenType=F.DELIMITER:Y.tokenType=F.SYMBOL;return}for(Y.tokenType=F.UNKNOWN;W(Y)!=="";)Y.token+=W(Y),ee(Y);throw Xe(Y,'Syntax error in part "'+Y.token+'"')}function le(Y){do Z(Y);while(Y.token===` -`)}function re(Y){Y.nestingLevel++}function he(Y){Y.nestingLevel--}M.isAlpha=function(xe,Ye,tt){return M.isValidLatinOrGreek(xe)||M.isValidMathSymbol(xe,tt)||M.isValidMathSymbol(Ye,xe)},M.isValidLatinOrGreek=function(xe){return/^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(xe)},M.isValidMathSymbol=function(xe,Ye){return/^[\uD835]$/.test(xe)&&/^[\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(xe,Ye){return xe===" "||xe===" "||xe===` -`&&Ye>0},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(Y,xe){var Ye=H();qn(Ye,{expression:Y,extraNodes:xe}),Z(Ye);var tt=ye(Ye);if(Ye.token!=="")throw Ye.tokenType===F.DELIMITER?pt(Ye,"Unexpected operator "+Ye.token):Xe(Ye,'Unexpected part "'+Ye.token+'"');return tt}function ye(Y){var xe,Ye=[],tt;for(Y.token!==""&&Y.token!==` -`&&Y.token!==";"&&(xe=ce(Y),Y.comment&&(xe.comment=Y.comment));Y.token===` -`||Y.token===";";)Ye.length===0&&xe&&(tt=Y.token!==";",Ye.push({node:xe,visible:tt})),Z(Y),Y.token!==` -`&&Y.token!==";"&&Y.token!==""&&(xe=ce(Y),Y.comment&&(xe.comment=Y.comment),tt=Y.token!==";",Ye.push({node:xe,visible:tt}));return Ye.length>0?new l(Ye):(xe||(xe=new s(void 0),Y.comment&&(xe.comment=Y.comment)),xe)}function ce(Y){var xe,Ye,tt,wt,kt=Ne(Y);if(Y.token==="="){if(Rr(kt))return xe=kt.name,le(Y),tt=ce(Y),new u(new O(xe),tt);if(To(kt))return le(Y),tt=ce(Y),new u(kt.object,kt.index,tt);if(Ji(kt)&&Rr(kt.fn)&&(wt=!0,Ye=[],xe=kt.name,kt.args.forEach(function(ur,Vr){Rr(ur)?Ye[Vr]=ur.name:wt=!1}),wt))return le(Y),tt=ce(Y),new f(xe,Ye,tt);throw Xe(Y,"Invalid left hand side of assignment operator =")}return kt}function Ne(Y){for(var xe=Pe(Y);Y.token==="?";){var Ye=Y.conditionalLevel;Y.conditionalLevel=Y.nestingLevel,le(Y);var tt=xe,wt=ce(Y);if(Y.token!==":")throw Xe(Y,"False part of conditional expression expected");Y.conditionalLevel=null,le(Y);var kt=ce(Y);xe=new a(tt,wt,kt),Y.conditionalLevel=Ye}return xe}function Pe(Y){for(var xe=Ce(Y);Y.token==="or";)le(Y),xe=new N("or","or",[xe,Ce(Y)]);return xe}function Ce(Y){for(var xe=Oe(Y);Y.token==="xor";)le(Y),xe=new N("xor","xor",[xe,Oe(Y)]);return xe}function Oe(Y){for(var xe=He(Y);Y.token==="and";)le(Y),xe=new N("and","and",[xe,He(Y)]);return xe}function He(Y){for(var xe=Ee(Y);Y.token==="|";)le(Y),xe=new N("|","bitOr",[xe,Ee(Y)]);return xe}function Ee(Y){for(var xe=ze(Y);Y.token==="^|";)le(Y),xe=new N("^|","bitXor",[xe,ze(Y)]);return xe}function ze(Y){for(var xe=We(Y);Y.token==="&";)le(Y),xe=new N("&","bitAnd",[xe,We(Y)]);return xe}function We(Y){for(var xe=[Be(Y)],Ye=[],tt={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};Et(tt,Y.token);){var wt={name:Y.token,fn:tt[Y.token]};Ye.push(wt),le(Y),xe.push(Be(Y))}return xe.length===1?xe[0]:xe.length===2?new N(Ye[0].name,Ye[0].fn,xe):new b(Ye.map(kt=>kt.fn),xe)}function Be(Y){var xe,Ye,tt,wt;xe=lt(Y);for(var kt={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};Et(kt,Y.token);)Ye=Y.token,tt=kt[Ye],le(Y),wt=[xe,lt(Y)],xe=new N(Ye,tt,wt);return xe}function lt(Y){var xe,Ye,tt,wt;xe=ct(Y);for(var kt={to:"to",in:"to"};Et(kt,Y.token);)Ye=Y.token,tt=kt[Ye],le(Y),Ye==="in"&&Y.token===""?xe=new N("*","multiply",[xe,new O("in")],!0):(wt=[xe,ct(Y)],xe=new N(Ye,tt,wt));return xe}function ct(Y){var xe,Ye=[];if(Y.token===":"?xe=new s(1):xe=de(Y),Y.token===":"&&Y.conditionalLevel!==Y.nestingLevel){for(Ye.push(xe);Y.token===":"&&Ye.length<3;)le(Y),Y.token===")"||Y.token==="]"||Y.token===","||Y.token===""?Ye.push(new O("end")):Ye.push(de(Y));Ye.length===3?xe=new D(Ye[0],Ye[2],Ye[1]):xe=new D(Ye[0],Ye[1])}return xe}function de(Y){var xe,Ye,tt,wt;xe=be(Y);for(var kt={"+":"add","-":"subtract"};Et(kt,Y.token);){Ye=Y.token,tt=kt[Ye],le(Y);var ur=be(Y);ur.isPercentage?wt=[xe,new N("*","multiply",[xe,ur])]:wt=[xe,ur],xe=new N(Ye,tt,wt)}return xe}function be(Y){var xe,Ye,tt,wt;xe=Ue(Y),Ye=xe;for(var kt={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};Et(kt,Y.token);)tt=Y.token,wt=kt[tt],le(Y),Ye=Ue(Y),xe=new N(tt,wt,[xe,Ye]);return xe}function Ue(Y){var xe,Ye;for(xe=ve(Y),Ye=xe;Y.tokenType===F.SYMBOL||Y.token==="in"&&ir(xe)||Y.tokenType===F.NUMBER&&!ir(Ye)&&(!Zr(Ye)||Ye.op==="!")||Y.token==="(";)Ye=ve(Y),xe=new N("*","multiply",[xe,Ye],!0);return xe}function ve(Y){for(var xe=Re(Y),Ye=xe,tt=[];Y.token==="/"&&wg(Ye);)if(tt.push(qn({},Y)),le(Y),Y.tokenType===F.NUMBER)if(tt.push(qn({},Y)),le(Y),Y.tokenType===F.SYMBOL||Y.token==="(")qn(Y,tt.pop()),tt.pop(),Ye=Re(Y),xe=new N("/","divide",[xe,Ye]);else{tt.pop(),qn(Y,tt.pop());break}else{qn(Y,tt.pop());break}return xe}function Re(Y){var xe,Ye,tt,wt;xe=ke(Y);for(var kt={"%":"mod",mod:"mod"};Et(kt,Y.token);)Ye=Y.token,tt=kt[Ye],le(Y),Ye==="%"&&Y.tokenType===F.DELIMITER&&Y.token!=="("?xe=new N("/","divide",[xe,new s(100)],!1,!0):(wt=[xe,ke(Y)],xe=new N(Ye,tt,wt));return xe}function ke(Y){var xe,Ye,tt,wt={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return Et(wt,Y.token)?(tt=wt[Y.token],xe=Y.token,le(Y),Ye=[ke(Y)],new N(xe,tt,Ye)):Je(Y)}function Je(Y){var xe,Ye,tt,wt;return xe=ot(Y),(Y.token==="^"||Y.token===".^")&&(Ye=Y.token,tt=Ye==="^"?"pow":"dotPow",le(Y),wt=[xe,ke(Y)],xe=new N(Ye,tt,wt)),xe}function ot(Y){var xe,Ye,tt,wt;xe=et(Y);for(var kt={"!":"factorial","'":"ctranspose"};Et(kt,Y.token);)Ye=Y.token,tt=kt[Ye],Z(Y),wt=[xe],xe=new N(Ye,tt,wt),xe=Lt(Y,xe);return xe}function et(Y){var xe=[];if(Y.tokenType===F.SYMBOL&&Et(Y.extraNodes,Y.token)){var Ye=Y.extraNodes[Y.token];if(Z(Y),Y.token==="("){if(xe=[],re(Y),Z(Y),Y.token!==")")for(xe.push(ce(Y));Y.token===",";)Z(Y),xe.push(ce(Y));if(Y.token!==")")throw Xe(Y,"Parenthesis ) expected");he(Y),Z(Y)}return new Ye(xe)}return ut(Y)}function ut(Y){var xe,Ye;return Y.tokenType===F.SYMBOL||Y.tokenType===F.DELIMITER&&Y.token in P?(Ye=Y.token,Z(Y),Et(R,Ye)?xe=new s(R[Ye]):q.indexOf(Ye)!==-1?xe=new s(r(Ye,"number")):xe=new O(Ye),xe=Lt(Y,xe),xe):fe(Y)}function Lt(Y,xe,Ye){for(var tt;(Y.token==="("||Y.token==="["||Y.token===".")&&(!Ye||Ye.indexOf(Y.token)!==-1);)if(tt=[],Y.token==="(")if(Rr(xe)||To(xe)){if(re(Y),Z(Y),Y.token!==")")for(tt.push(ce(Y));Y.token===",";)Z(Y),tt.push(ce(Y));if(Y.token!==")")throw Xe(Y,"Parenthesis ) expected");he(Y),Z(Y),xe=new p(xe,tt)}else return xe;else if(Y.token==="["){if(re(Y),Z(Y),Y.token!=="]")for(tt.push(ce(Y));Y.token===",";)Z(Y),tt.push(ce(Y));if(Y.token!=="]")throw Xe(Y,"Parenthesis ] expected");he(Y),Z(Y),xe=new i(xe,new h(tt))}else{Z(Y);var wt=Y.tokenType===F.SYMBOL||Y.tokenType===F.DELIMITER&&Y.token in P;if(!wt)throw Xe(Y,"Property name expected after dot");tt.push(new s(Y.token)),Z(Y);var kt=!0;xe=new i(xe,new h(tt,kt))}return xe}function fe(Y){var xe,Ye;return Y.token==='"'||Y.token==="'"?(Ye=J(Y,Y.token),xe=new s(Ye),xe=Lt(Y,xe),xe):j(Y)}function J(Y,xe){for(var Ye="";W(Y)!==""&&W(Y)!==xe;)if(W(Y)==="\\"){ee(Y);var tt=W(Y),wt=z[tt];if(wt!==void 0)Ye+=wt,Y.index+=1;else if(tt==="u"){var kt=Y.expression.slice(Y.index+1,Y.index+5);if(/^[0-9A-Fa-f]{4}$/.test(kt))Ye+=String.fromCharCode(parseInt(kt,16)),Y.index+=5;else throw Xe(Y,"Invalid unicode character \\u".concat(kt))}else throw Xe(Y,"Bad escape character \\".concat(tt))}else Ye+=W(Y),ee(Y);if(Z(Y),Y.token!==xe)throw Xe(Y,"End of string ".concat(xe," expected"));return Z(Y),Ye}function j(Y){var xe,Ye,tt,wt;if(Y.token==="["){if(re(Y),Z(Y),Y.token!=="]"){var kt=ne(Y);if(Y.token===";"){for(tt=1,Ye=[kt];Y.token===";";)Z(Y),Y.token!=="]"&&(Ye[tt]=ne(Y),tt++);if(Y.token!=="]")throw Xe(Y,"End of matrix ] expected");he(Y),Z(Y),wt=Ye[0].items.length;for(var ur=1;ur{var{typed:t,parse:r}=e;return t(P6,{string:function(i){return r(i).compile()},"Array | Matrix":function(i){return Tt(i,function(o){return r(o).compile()})}})});v();x();g();var q6="evaluate",wfe=["typed","parse"],z6=K(q6,wfe,e=>{var{typed:t,parse:r}=e;return t(q6,{string:function(i){var o=Ef();return r(i).compile().evaluate(o)},"string, Map | Object":function(i,o){return r(i).compile().evaluate(o)},"Array | Matrix":function(i){var o=Ef();return Tt(i,function(u){return r(u).compile().evaluate(o)})},"Array | Matrix, Map | Object":function(i,o){return Tt(i,function(u){return r(u).compile().evaluate(o)})}})});v();x();g();var bfe="Parser",Dfe=["evaluate"],U6=K(bfe,Dfe,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:Ef(),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 wF(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});v();x();g();var H6="parser",Nfe=["typed","Parser"],$6=K(H6,Nfe,e=>{var{typed:t,Parser:r}=e;return t(H6,{"":function(){return new r}})});v();x();g();var W6="lup",Sfe=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],V6=K(W6,Sfe,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(W6,{DenseMatrix:function(b){return N(b)},SparseMatrix:function(b){return w(b)},Array:function(b){var O=r(b),M=N(O);return{L:M.L.valueOf(),U:M.U.valueOf(),p:M.p}}});function N(D){var b=D._size[0],O=D._size[1],M=Math.min(b,O),I=Bt(D._data),F=[],C=[b,M],P=[],R=[M,O],q,z,H,V=[];for(q=0;q0)for(q=0;q "+(this._values?Zt(this._values[P],w):"X")}return M},i.prototype.toString=function(){return Zt(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(_t(w)&&(w=w.toNumber()),!Ht(w)||!Nt(w))throw new TypeError("The parameter k must be an integer number")}else w=0;var D=w>0?w:0,b=w<0?-w:0,O=this._size[0],M=this._size[1],I=Math.min(O-b,M-D),F=[],C=[],P=[];P[0]=0;for(var R=D;R0?b:0,P=b<0?-b:0,R=w[0],q=w[1],z=Math.min(R-P,q-C),H;if(fr(D)){if(D.length!==z)throw new Error("Invalid value array length");H=function(he){return D[he]}}else if(Et(D)){var V=D.size();if(V.length!==1||V[0]!==z)throw new Error("Invalid matrix length");H=function(he){return D.get([he])}}else H=function(){return D};for(var W=[],ee=[],ie=[],X=0;X=0&&Y=P||M[q]!==D)){var H=O?O[R]:void 0;M.splice(q,0,D),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});v();x();g();var yoe="number",woe=["typed"];function boe(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 Doe(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=boe(i);if(o)return Doe(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()},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=>Ot(i,n))});return r.fromJSON=function(n){return parseFloat(n.value)},r});v();x();g();var D_="string",Noe=["typed"],N_=K(D_,Noe,e=>{var{typed:t}=e;return t(D_,{"":function(){return""},number:Ms,null:function(n){return"null"},boolean:function(n){return n+""},string:function(n){return n},"Array | Matrix":t.referToSelf(r=>n=>Ot(n,r)),any:function(n){return String(n)}})});v();x();g();var E_="boolean",Eoe=["typed"],S_=K(E_,Eoe,e=>{var{typed:t}=e;return t(E_,{"":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=>Ot(n,r))})});v();x();g();var Soe="bignumber",Aoe=["typed","BigNumber"],A_=K(Soe,Aoe,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},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=>Ot(i,n))})});v();x();g();var Coe="complex",Moe=["typed","Complex"],C_=K(Coe,Moe,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=>Ot(i,n))})});v();x();g();var Toe="fraction",Ooe=["typed","Fraction"],M_=K(Toe,Ooe,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())},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=>Ot(i,n))})});v();x();g();var T_="matrix",Ioe=["typed","Matrix","DenseMatrix","SparseMatrix"],O_=K(T_,Ioe,e=>{var{typed:t,Matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(T_,{"":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)+".")}});v();x();g();var I_="matrixFromFunction",Foe=["typed","matrix","isZero"],F_=K(I_,Foe,e=>{var{typed:t,matrix:r,isZero:n}=e;return t(I_,{"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}});v();x();g();var __="matrixFromRows",_oe=["typed","matrix","flatten","size"],k_=K(__,_oe,e=>{var{typed:t,matrix:r,flatten:n,size:i}=e;return t(__,{"...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.")}});v();x();g();var B_="matrixFromColumns",koe=["typed","matrix","flatten","size"],L_=K(B_,koe,e=>{var{typed:t,matrix:r,flatten:n,size:i}=e;return t(B_,{"...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(P_,{"Unit, Array":function(n,i){return n.splitUnit(i)}})});v();x();g();var q_="unaryMinus",Loe=["typed"],z_=K(q_,Loe,e=>{var{typed:t}=e;return t(q_,{number:CS,"Complex | BigNumber | Fraction":r=>r.neg(),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=>Ot(n,r,!0))})});v();x();g();var U_="unaryPlus",Poe=["typed","config","BigNumber"],H_=K(U_,Poe,e=>{var{typed:t,config:r,BigNumber:n}=e;return t(U_,{number:MS,Complex:function(o){return o},BigNumber:function(o){return o},Fraction:function(o){return o},Unit:function(o){return o.clone()},"Array | Matrix":t.referToSelf(i=>o=>Ot(o,i,!0)),"boolean | string":function(o){return r.number==="BigNumber"?new n(+o):+o}})});v();x();g();var $_="abs",Roe=["typed"],W_=K($_,Roe,e=>{var{typed:t}=e;return t($_,{number:NS,"Complex | BigNumber | Fraction | Unit":r=>r.abs(),"Array | Matrix":t.referToSelf(r=>n=>Ot(n,r,!0))})});v();x();g();var V_="apply",qoe=["typed","isInteger"],gh=K(V_,qoe,e=>{var{typed:t,isInteger:r}=e;return t(V_,{"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)?$t(i):i.size();if(o<0||o>=l.length)throw new bi(o,l.length);return Et(i)?i.create($y(i.valueOf(),o,u)):$y(i,o,u)}})});function $y(e,t,r){var n,i,o;if(t<=0)if(Array.isArray(e[0])){for(o=zoe(e),i=[],n=0;n{var{typed:t}=e;return t(G_,{"number, number":ES,"Complex, Complex":function(n,i){return n.add(i)},"BigNumber, BigNumber":function(n,i){return n.plus(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})})});v();x();g();var Z_="subtractScalar",Hoe=["typed"],X_=K(Z_,Hoe,e=>{var{typed:t}=e;return t(Z_,{"number, number":SS,"Complex, Complex":function(n,i){return n.sub(i)},"BigNumber, BigNumber":function(n,i){return n.minus(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})})});v();x();g();var K_="cbrt",$oe=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],J_=K(K_,$oe,e=>{var{config:t,typed:r,isNegative:n,unaryMinus:i,matrix:o,Complex:u,BigNumber:l,Fraction:a}=e;return r(K_,{number:hh,Complex:s,"Complex, boolean":s,BigNumber:function(h){return h.cbrt()},Unit:f});function s(p,h){var y=p.arg()/3,N=p.abs(),w=new u(hh(N),0).mul(new u(0,y).exp());if(h){var D=[w,new u(hh(N),0).mul(new u(0,y+Math.PI*2/3).exp()),new u(hh(N),0).mul(new u(0,y-Math.PI*2/3).exp())];return t.matrix==="Array"?D:o(D)}else return w}function f(p){if(p.value&&gi(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 N;_t(p.value)?N=new l(1).div(3):la(p.value)?N=new a(1,3):N=1/3;var w=p.pow(N);return y&&(w.value=i(w.value)),w}}});v();x();g();v();x();g();var Woe="matAlgo11xS0s",Voe=["typed","equalScalar"],Lr=K(Woe,Voe,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],N=p[1],w,D=r,b=0,O=u;typeof h=="string"&&(w=h,D=t.find(r,[w,w]),b=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],N=p[1],w,D=u;typeof h=="string"&&(w=h,o=t.convert(o,w),D=t.find(u,[w,w]));for(var b=[],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:Bt(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(wA,{number:function(o){return yn(o,n(o),r.epsilon)?n(o):Math.ceil(o)},"number, number":function(o,u){if(yn(o,n(o,u),r.epsilon))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))}})}),Q_=K(wA,Koe,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:u,DenseMatrix:l}=e,a=Lr({typed:t,equalScalar:o}),s=Sr({typed:t,DenseMatrix:l}),f=Yn({typed:t}),p=Joe({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,N){return y.ceil(N)},"Complex, BigNumber":function(y,N){return y.ceil(N.toNumber())},BigNumber:function(y){return ni(y,n(y),r.epsilon)?n(y):y.ceil()},"BigNumber, BigNumber":function(y,N){return ni(y,n(y,N),r.epsilon)?n(y,N):y.toDecimalPlaces(N.toNumber(),lp.ROUND_CEIL)},Fraction:function(y){return y.ceil()},"Fraction, number":function(y,N){return y.ceil(N)},"Fraction, BigNumber":function(y,N){return y.ceil(N.toNumber())},"Array | Matrix":t.referToSelf(h=>y=>Ot(y,h,!0)),"Array, number | BigNumber":t.referToSelf(h=>(y,N)=>Ot(y,w=>h(w,N),!0)),"SparseMatrix, number | BigNumber":t.referToSelf(h=>(y,N)=>a(y,N,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(y,N)=>f(y,N,h,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(h=>(y,N)=>f(i(N),y,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(h=>(y,N)=>o(y,0)?u(N.size(),N.storage()):N.storage()==="dense"?f(N,y,h,!0):s(N,y,h,!0))})});v();x();g();var j_="cube",Qoe=["typed"],ek=K(j_,Qoe,e=>{var{typed:t}=e;return t(j_,{number:TS,Complex:function(n){return n.mul(n).mul(n)},BigNumber:function(n){return n.times(n).times(n)},Fraction:function(n){return n.pow(3)},Unit:function(n){return n.pow(3)}})});v();x();g();var tk="exp",joe=["typed"],rk=K(tk,joe,e=>{var{typed:t}=e;return t(tk,{number:OS,Complex:function(n){return n.exp()},BigNumber:function(n){return n.exp()}})});v();x();g();var nk="expm1",eae=["typed","Complex"],ik=K(nk,eae,e=>{var{typed:t,Complex:r}=e;return t(nk,{number:IS,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)}})});v();x();g();var bA="fix",tae=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],rae=K(bA,["typed","ceil","floor"],e=>{var{typed:t,ceil:r,floor:n}=e;return t(bA,{number:function(o){return o>0?n(o):r(o)},"number, number":function(o,u){return o>0?n(o,u):r(o,u)}})}),ok=K(bA,tae,e=>{var{typed:t,Complex:r,matrix:n,ceil:i,floor:o,equalScalar:u,zeros:l,DenseMatrix:a}=e,s=Sr({typed:t,DenseMatrix:a}),f=Yn({typed:t}),p=rae({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,N){return new r(y.re>0?o(y.re,N):i(y.re,N),y.im>0?o(y.im,N):i(y.im,N))},"Complex, BigNumber":function(y,N){var w=N.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,N){return y.isNegative()?i(y,N):o(y,N)},Fraction:function(y){return y.s<0?y.ceil():y.floor()},"Fraction, number | BigNumber":function(y,N){return y.s<0?i(y,N):o(y,N)},"Array | Matrix":t.referToSelf(h=>y=>Ot(y,h,!0)),"Array | Matrix, number | BigNumber":t.referToSelf(h=>(y,N)=>Ot(y,w=>h(w,N),!0)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(h=>(y,N)=>f(n(N),y,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(h=>(y,N)=>u(y,0)?l(N.size(),N.storage()):N.storage()==="dense"?f(N,y,h,!0):s(N,y,h,!0))})});v();x();g();var DA="floor",nae=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],iae=K(DA,["typed","config","round"],e=>{var{typed:t,config:r,round:n}=e;return t(DA,{number:function(o){return yn(o,n(o),r.epsilon)?n(o):Math.floor(o)},"number, number":function(o,u){if(yn(o,n(o,u),r.epsilon))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))}})}),Wy=K(DA,nae,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:u,DenseMatrix:l}=e,a=Lr({typed:t,equalScalar:o}),s=Sr({typed:t,DenseMatrix:l}),f=Yn({typed:t}),p=iae({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,N){return y.floor(N)},"Complex, BigNumber":function(y,N){return y.floor(N.toNumber())},BigNumber:function(y){return ni(y,n(y),r.epsilon)?n(y):y.floor()},"BigNumber, BigNumber":function(y,N){return ni(y,n(y,N),r.epsilon)?n(y,N):y.toDecimalPlaces(N.toNumber(),lp.ROUND_FLOOR)},Fraction:function(y){return y.floor()},"Fraction, number":function(y,N){return y.floor(N)},"Fraction, BigNumber":function(y,N){return y.floor(N.toNumber())},"Array | Matrix":t.referToSelf(h=>y=>Ot(y,h,!0)),"Array, number | BigNumber":t.referToSelf(h=>(y,N)=>Ot(y,w=>h(w,N),!0)),"SparseMatrix, number | BigNumber":t.referToSelf(h=>(y,N)=>a(y,N,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(y,N)=>f(y,N,h,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(h=>(y,N)=>f(i(N),y,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(h=>(y,N)=>o(y,0)?u(N.size(),N.storage()):N.storage()==="dense"?f(N,y,h,!0):s(N,y,h,!0))})});v();x();g();v();x();g();v();x();g();var oae="matAlgo02xDS0",aae=["typed","equalScalar"],Zn=K(oae,aae,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,N=o._size,w=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(s.length!==N.length)throw new Kt(s.length,N.length);if(s[0]!==N[0]||s[1]!==N[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+N+")");if(!p)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var D=s[0],b=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,N=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(a.length!==y.length)throw new Kt(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],D=a[1],b,O=0,M=o;typeof s=="string"&&s===N&&s!=="mixed"&&(b=s,O=t.convert(0,b),M=t.find(o,[b,b]));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,N=o._ptr,w=o._size,D=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==w.length)throw new Kt(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 b=f[0],O=f[1],M,I=r,F=0,C=u;typeof p=="string"&&p===D&&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=[],z=P?[]:void 0,H=P?[]:void 0,V=[],W=[],ee,ie,X,Y;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 Kt(a.length,p.length);for(var N=0;N0?r(D,0,y,y[0],l,f):[];return i.createDenseMatrix({data:b,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((N,w)=>N===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=ak({typed:t}),o=Yn({typed:t}),u=sk({concat:n});return function(a){var s=a.elop,f=a.SD||a.DS,p;s?(p={"DenseMatrix, DenseMatrix":(w,D)=>i(...u(w,D),s),"Array, Array":(w,D)=>i(...u(r(w),r(D)),s).valueOf(),"Array, DenseMatrix":(w,D)=>i(...u(r(w),D),s),"DenseMatrix, Array":(w,D)=>i(...u(w,r(D)),s)},a.SS&&(p["SparseMatrix, SparseMatrix"]=(w,D)=>a.SS(...u(w,D),s,!1)),a.DS&&(p["DenseMatrix, SparseMatrix"]=(w,D)=>a.DS(...u(w,D),s,!1),p["Array, SparseMatrix"]=(w,D)=>a.DS(...u(r(w),D),s,!1)),f&&(p["SparseMatrix, DenseMatrix"]=(w,D)=>f(...u(D,w),s,!0),p["SparseMatrix, Array"]=(w,D)=>f(...u(r(D),w),s,!0))):(p={"DenseMatrix, DenseMatrix":t.referToSelf(w=>(D,b)=>i(...u(D,b),w)),"Array, Array":t.referToSelf(w=>(D,b)=>i(...u(r(D),r(b)),w).valueOf()),"Array, DenseMatrix":t.referToSelf(w=>(D,b)=>i(...u(r(D),b),w)),"DenseMatrix, Array":t.referToSelf(w=>(D,b)=>i(...u(D,r(b)),w))},a.SS&&(p["SparseMatrix, SparseMatrix"]=t.referToSelf(w=>(D,b)=>a.SS(...u(D,b),w,!1))),a.DS&&(p["DenseMatrix, SparseMatrix"]=t.referToSelf(w=>(D,b)=>a.DS(...u(D,b),w,!1)),p["Array, SparseMatrix"]=t.referToSelf(w=>(D,b)=>a.DS(...u(r(D),b),w,!1))),f&&(p["SparseMatrix, DenseMatrix"]=t.referToSelf(w=>(D,b)=>f(...u(b,D),w,!0)),p["SparseMatrix, Array"]=t.referToSelf(w=>(D,b)=>f(...u(r(b),D),w,!0))));var h=a.scalar||"any",y=a.Ds||a.Ss;y&&(s?(p["DenseMatrix,"+h]=(w,D)=>o(w,D,s,!1),p[h+", DenseMatrix"]=(w,D)=>o(D,w,s,!0),p["Array,"+h]=(w,D)=>o(r(w),D,s,!1).valueOf(),p[h+", Array"]=(w,D)=>o(r(D),w,s,!0).valueOf()):(p["DenseMatrix,"+h]=t.referToSelf(w=>(D,b)=>o(D,b,w,!1)),p[h+", DenseMatrix"]=t.referToSelf(w=>(D,b)=>o(b,D,w,!0)),p["Array,"+h]=t.referToSelf(w=>(D,b)=>o(r(D),b,w,!1).valueOf()),p[h+", Array"]=t.referToSelf(w=>(D,b)=>o(r(b),D,w,!0).valueOf())));var N=a.sS!==void 0?a.sS:a.Ss;return s?(a.Ss&&(p["SparseMatrix,"+h]=(w,D)=>a.Ss(w,D,s,!1)),N&&(p[h+", SparseMatrix"]=(w,D)=>N(D,w,s,!0))):(a.Ss&&(p["SparseMatrix,"+h]=t.referToSelf(w=>(D,b)=>a.Ss(D,b,w,!1))),N&&(p[h+", SparseMatrix"]=t.referToSelf(w=>(D,b)=>N(b,D,w,!0)))),s&&s.signatures&&wy(p,s.signatures),p}});var uk="mod",gae=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],Vy=K(uk,gae,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:u,DenseMatrix:l,concat:a}=e,s=Wy({typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:u,DenseMatrix:l}),f=Zn({typed:t,equalScalar:o}),p=Kr({typed:t}),h=Of({typed:t,equalScalar:o}),y=Lr({typed:t,equalScalar:o}),N=Sr({typed:t,DenseMatrix:l}),w=er({typed:t,matrix:i,concat:a});return t(uk,{"number, number":D,"BigNumber, BigNumber":function(O,M){return M.isZero()?O:O.sub(M.mul(s(O.div(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:N}));function D(b,O){return O===0?b:b-O*s(b/O)}});v();x();g();var xae="matAlgo01xDSid",yae=["typed"],co=K(xae,yae,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,N=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(a.length!==y.length)throw new Kt(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],D=a[1],b=typeof s=="string"&&s!=="mixed"&&s===N?s:void 0,O=b?t.find(o,[b,b]):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,N=o._ptr,w=o._size,D=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==w.length)throw new Kt(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 b=f[0],O=f[1],M,I=r,F=0,C=u;typeof p=="string"&&p===D&&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=[],z=l&&h?[]:void 0,H=l&&h?[]:void 0,V=[],W=[],ee,ie,X,Y,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],N=p[1],w,D=u;typeof h=="string"&&(w=h,o=t.convert(o,w),D=t.find(u,[w,w]));for(var b=[],O=[],M=[],I=0;IArray.isArray(t))}var ck=K(lk,Eae,e=>{var{typed:t,matrix:r,config:n,round:i,equalScalar:o,zeros:u,BigNumber:l,DenseMatrix:a,concat:s}=e,f=Vy({typed:t,config:n,round:i,matrix:r,equalScalar:o,zeros:u,DenseMatrix:a,concat:s}),p=co({typed:t}),h=xh({typed:t,equalScalar:o}),y=$o({typed:t,DenseMatrix:a}),N=er({typed:t,matrix:r,concat:s});return t(lk,{"number, number":w,"BigNumber, BigNumber":D,"Fraction, Fraction":(b,O)=>b.gcd(O)},N({SS:h,DS:p,Ss:y}),{[Sae]:t.referToSelf(b=>(O,M,I)=>{for(var F=b(O,M),C=0;CO=>{if(O.length===1&&Array.isArray(O[0])&&fk(O[0]))return b(...O[0]);if(fk(O))return b(...O);throw new pa("gcd() supports only 1d matrices!")}),Matrix:t.referToSelf(b=>O=>b(O.toArray()))});function w(b,O){if(!Nt(b)||!Nt(O))throw new Error("Parameters in function gcd must be integer numbers");for(var M;O!==0;)M=f(b,O),b=O,O=M;return b<0?-b:b}function D(b,O){if(!b.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(b,O);b=O,O=I}return b.lt(M)?b.neg():b}});v();x();g();v();x();g();var Aae="matAlgo06xS0S0",Cae=["typed","equalScalar"],If=K(Aae,Cae,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 Kt(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],N=a[1],w,D=r,b=0,O=u;typeof s=="string"&&s===h&&s!=="mixed"&&(w=s,D=t.find(r,[w,w]),b=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=Zn({typed:t,equalScalar:n}),u=If({typed:t,equalScalar:n}),l=Lr({typed:t,equalScalar:n}),a=er({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,N,w)=>{for(var D=h(y,N),b=0;bh.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 N=h.times(y);!y.isZero();){var w=y;y=h.mod(w),h=w}return N.div(h).abs()}});v();x();g();var hk="log10",Tae=["typed","config","Complex"],dk=K(hk,Tae,e=>{var{typed:t,config:r,Complex:n}=e;return t(hk,{number:function(o){return o>=0||r.predictable?_S(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=>Ot(o,i))})});v();x();g();var vk="log2",Oae=["typed","config","Complex"],gk=K(vk,Oae,e=>{var{typed:t,config:r,Complex:n}=e;return t(vk,{number:function(u){return u>=0||r.predictable?kS(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=>Ot(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)}});v();x();g();var Iae="multiplyScalar",Fae=["typed"],xk=K(Iae,Fae,e=>{var{typed:t}=e;return t("multiplyScalar",{"number, number":AS,"Complex, Complex":function(n,i){return n.mul(i)},"BigNumber, BigNumber":function(n,i){return n.times(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)})});v();x();g();var yk="multiply",_ae=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],wk=K(yk,_ae,e=>{var{typed:t,matrix:r,addScalar:n,multiplyScalar:i,equalScalar:o,dot:u}=e,l=Lr({typed:t,equalScalar:o}),a=Yn({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(),z=C._data,H=C._size,V=C._datatype||C.getDataType(),W=R[0],ee=H[1],ie,X=n,Y=i;q&&V&&q===V&&typeof q=="string"&&q!=="mixed"&&(ie=q,X=t.find(n,[ie,ie]),Y=t.find(i,[ie,ie]));for(var le=[],re=0;reOe)for(var Se=0,ze=0;ze(C,P)=>{s($t(C),$t(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?y(C,P):N(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),z=0;z{var{typed:t,matrix:r,equalScalar:n,BigNumber:i,concat:o}=e,u=co({typed:t}),l=Zn({typed:t,equalScalar:n}),a=If({typed:t,equalScalar:n}),s=Lr({typed:t,equalScalar:n}),f=er({typed:t,matrix:r,concat:o});function p(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return t(bk,{number:BS,"number, number":BS,BigNumber:y=>h(y,new i(2)),"BigNumber, BigNumber":h,Complex:p,"Complex, number":p,Array:t.referTo("DenseMatrix,number",y=>N=>y(r(N),2).valueOf()),DenseMatrix:t.referTo("DenseMatrix,number",y=>N=>y(N,2)),SparseMatrix:t.referTo("SparseMatrix,number",y=>N=>y(N,2)),"SparseMatrix, SparseMatrix":t.referToSelf(y=>(N,w)=>{if(w.density()===1)return a(N,w,y);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":t.referToSelf(y=>(N,w)=>{if(w.density()===1)return u(N,w,y,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":t.referTo("DenseMatrix,SparseMatrix",y=>(N,w)=>y(r(N),w)),"number | BigNumber, SparseMatrix":t.referToSelf(y=>(N,w)=>{if(w.density()===1)return s(w,N,y,!0);throw new Error("Root must be non-zero")})},f({scalar:"number | BigNumber",SD:l,Ss:s,sS:!1}));function h(y,N){var w=i.precision,D=i.clone({precision:w+2}),b=new i(0),O=new D(1),M=N.isNegative();if(M&&(N=N.neg()),N.isZero())throw new Error("Root must be non-zero");if(y.isNegative()&&!N.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(y.isZero())return M?new D(1/0):0;if(!y.isFinite())return M?b:y;var I=y.abs().pow(O.div(N));return I=y.isNeg()?I.neg():I,new i((M?O.div(I):I).toPrecision(w))}});v();x();g();var Nk="sign",Bae=["typed","BigNumber","Fraction","complex"],Ek=K(Nk,Bae,e=>{var{typed:t,BigNumber:r,complex:n,Fraction:i}=e;return t(Nk,{number:Uy,Complex:function(u){return u.im===0?n(Uy(u.re)):u.sign()},BigNumber:function(u){return new r(u.cmp(0))},Fraction:function(u){return new i(u.s,1)},"Array | Matrix":t.referToSelf(o=>u=>Ot(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)})})});v();x();g();var Lae="sqrt",Pae=["config","typed","Complex"],Sk=K(Lae,Pae,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()}});v();x();g();var Ak="square",Rae=["typed"],Ck=K(Ak,Rae,e=>{var{typed:t}=e;return t(Ak,{number:LS,Complex:function(n){return n.mul(n)},BigNumber:function(n){return n.times(n)},Fraction:function(n){return n.mul(n)},Unit:function(n){return n.pow(2)}})});v();x();g();var Mk="subtract",qae=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],Tk=K(Mk,qae,e=>{var{typed:t,matrix:r,equalScalar:n,subtractScalar:i,unaryMinus:o,DenseMatrix:u,concat:l}=e,a=co({typed:t}),s=Kr({typed:t}),f=Of({typed:t,equalScalar:n}),p=$o({typed:t,DenseMatrix:u}),h=Sr({typed:t,DenseMatrix:u}),y=er({typed:t,matrix:r,concat:l});return t(Mk,{"any, any":i},y({elop:i,SS:f,DS:a,SD:s,Ss:h,sS:p}))});v();x();g();var Ok="xgcd",zae=["typed","config","matrix","BigNumber"],Ik=K(Ok,zae,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(Ok,{"number, number":function(l,a){var s=PS(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,N=h,w=h,D=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=N.minus(s.times(y)),N=a,a=w,w=D.minus(s.times(w)),D=a,u=l,l=f;var b;return u.lt(p)?b=[u.neg(),N.neg(),D.neg()]:b=[u,u.isZero()?0:N,D],r.matrix==="Array"?b:n(b)}});v();x();g();var Fk="invmod",Uae=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],_k=K(Fk,Uae,e=>{var{typed:t,config:r,BigNumber:n,xgcd:i,equal:o,smaller:u,mod:l,add:a,isInteger:s}=e;return t(Fk,{"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[N,w]=y;return o(N,n(1))?(w=l(w,h),u(w,n(0))&&(w=a(w,h)),w):NaN}});v();x();g();v();x();g();var Hae="matAlgo09xS0Sf",$ae=["typed","equalScalar"],Gy=K(Hae,$ae,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,N=o._ptr,w=o._size,D=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==w.length)throw new Kt(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 b=f[0],O=f[1],M,I=r,F=0,C=u;typeof p=="string"&&p===D&&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=[],z=P?[]:void 0,H=[],V,W,ee,ie,X;for(W=0;W{var{typed:t,matrix:r,equalScalar:n,multiplyScalar:i,concat:o}=e,u=Zn({typed:t,equalScalar:n}),l=Gy({typed:t,equalScalar:n}),a=Lr({typed:t,equalScalar:n}),s=er({typed:t,matrix:r,concat:o});return t(kk,s({elop:i,SS:l,DS:u,Ss:a}))});v();x();g();v();x();g();function Lk(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 EA(e,t,function(n,i){return n&i})}function yh(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 Pk(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:EA(e,t,function(i,o){return i|o})}function EA(e,t,r){var n=e.constructor,i,o,u=+(e.s<0),l=+(t.s<0);if(u){i=Yy(yh(e));for(var a=0;a0;)r(f[--y],p[--N])===w&&(D=D.plus(b)),b=b.times(O);for(;N>0;)r(h,p[--N])===w&&(D=D.plus(b)),b=b.times(O);return n.config({precision:M}),w===0&&(D.s=-D.s),D}function Yy(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 Rk(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)?yh(t):t.eq(n)?yh(e):!e.isFinite()||!t.isFinite()?!e.isFinite()&&!t.isFinite()?n:new r(e.isNegative()===t.isNegative()?1/0:-1/0):EA(e,t,function(i,o){return i^o})}function qk(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 zk(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 Uk="bitAnd",Vae=["typed","matrix","equalScalar","concat"],Zy=K(Uk,Vae,e=>{var{typed:t,matrix:r,equalScalar:n,concat:i}=e,o=Zn({typed:t,equalScalar:n}),u=If({typed:t,equalScalar:n}),l=Lr({typed:t,equalScalar:n}),a=er({typed:t,matrix:r,concat:i});return t(Uk,{"number, number":qS,"BigNumber, BigNumber":Lk},a({SS:u,DS:o,Ss:l}))});v();x();g();var Hk="bitNot",Gae=["typed"],$k=K(Hk,Gae,e=>{var{typed:t}=e;return t(Hk,{number:zS,BigNumber:yh,"Array | Matrix":t.referToSelf(r=>n=>Ot(n,r))})});v();x();g();var Wk="bitOr",Yae=["typed","matrix","equalScalar","DenseMatrix","concat"],Xy=K(Wk,Yae,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,u=co({typed:t}),l=xh({typed:t,equalScalar:n}),a=$o({typed:t,DenseMatrix:i}),s=er({typed:t,matrix:r,concat:o});return t(Wk,{"number, number":US,"BigNumber, BigNumber":Pk},s({SS:l,DS:u,Ss:a}))});v();x();g();v();x();g();var Zae="matAlgo07xSSf",Xae=["typed","DenseMatrix"],li=K(Zae,Xae,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 Kt(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],N,w=0,D=l;typeof s=="string"&&s===p&&s!=="mixed"&&(N=s,w=t.convert(0,N),D=t.find(l,[N,N]));var b,O,M=[];for(b=0;b{var{typed:t,matrix:r,DenseMatrix:n,concat:i}=e,o=Kr({typed:t}),u=li({typed:t,DenseMatrix:n}),l=Sr({typed:t,DenseMatrix:n}),a=er({typed:t,matrix:r,concat:i});return t(Vk,{"number, number":HS,"BigNumber, BigNumber":Rk},a({SS:u,DS:o,Ss:l}))});v();x();g();var Yk="arg",Jae=["typed"],Zk=K(Yk,Jae,e=>{var{typed:t}=e;return t(Yk,{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=>Ot(n,r))})});v();x();g();var Xk="conj",Qae=["typed"],Kk=K(Xk,Qae,e=>{var{typed:t}=e;return t(Xk,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.conjugate(),"Array | Matrix":t.referToSelf(r=>n=>Ot(n,r))})});v();x();g();var Jk="im",jae=["typed"],Qk=K(Jk,jae,e=>{var{typed:t}=e;return t(Jk,{number:()=>0,"BigNumber | Fraction":r=>r.mul(0),Complex:r=>r.im,"Array | Matrix":t.referToSelf(r=>n=>Ot(n,r))})});v();x();g();var jk="re",ese=["typed"],e4=K(jk,ese,e=>{var{typed:t}=e;return t(jk,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.re,"Array | Matrix":t.referToSelf(r=>n=>Ot(n,r))})});v();x();g();var t4="not",tse=["typed"],r4=K(t4,tse,e=>{var{typed:t}=e;return t(t4,{"null | undefined":()=>!0,number:ZS,Complex:function(n){return n.re===0&&n.im===0},BigNumber:function(n){return n.isZero()||n.isNaN()},Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Ot(n,r))})});v();x();g();var n4="or",rse=["typed","matrix","equalScalar","DenseMatrix","concat"],Ky=K(n4,rse,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,u=Kr({typed:t}),l=Of({typed:t,equalScalar:n}),a=Sr({typed:t,DenseMatrix:i}),s=er({typed:t,matrix:r,concat:o});return t(n4,{"number, number":XS,"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()},"Unit, Unit":t.referToSelf(f=>(p,h)=>f(p.value||0,h.value||0))},s({SS:l,DS:u,Ss:a}))});v();x();g();var i4="xor",nse=["typed","matrix","DenseMatrix","concat"],o4=K(i4,nse,e=>{var{typed:t,matrix:r,DenseMatrix:n,concat:i}=e,o=Kr({typed:t}),u=li({typed:t,DenseMatrix:n}),l=Sr({typed:t,DenseMatrix:n}),a=er({typed:t,matrix:r,concat:i});return t(i4,{"number, number":KS,"Complex, Complex":function(f,p){return(f.re!==0||f.im!==0)!=(p.re!==0||p.im!==0)},"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}))});v();x();g();var a4="concat",ise=["typed","matrix","isInteger"],Jy=K(a4,ise,e=>{var{typed:t,matrix:r,isInteger:n}=e;return t(a4,{"...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 bi(a,s+1)}else{var y=Bt(h).valueOf(),N=$t(y);if(p[u]=y,s=a,a=N.length-1,u>0&&a!==s)throw new Kt(s+1,a+1)}}if(p.length===0)throw new SyntaxError("At least one matrix expected");for(var w=p.shift();p.length;)w=sS(w,p.shift(),a);return f?r(w):w},"...string":function(o){return o.join("")}})});v();x();g();var s4="column",ose=["typed","Index","matrix","range"],Qy=K(s4,ose,e=>{var{typed:t,Index:r,matrix:n,range:i}=e;return t(s4,{"Matrix, number":o,"Array, number":function(l,a){return o(n(Bt(l)),a).valueOf()}});function o(u,l){if(u.size().length!==2)throw new Error("Only two dimensional matrix is supported");Br(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]])}});v();x();g();var u4="count",ase=["typed","size","prod"],l4=K(u4,ase,e=>{var{typed:t,size:r,prod:n}=e;return t(u4,{string:function(o){return o.length},"Matrix | Array":function(o){return n(r(o))}})});v();x();g();var f4="cross",sse=["typed","matrix","subtract","multiply"],c4=K(f4,sse,e=>{var{typed:t,matrix:r,subtract:n,multiply:i}=e;return t(f4,{"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($t(u).length,$t(l).length);u=uh(u),l=uh(l);var s=$t(u),f=$t(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}});v();x();g();var p4="diag",use=["typed","matrix","DenseMatrix","SparseMatrix"],m4=K(p4,use,e=>{var{typed:t,matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(p4,{Array:function(s){return o(s,0,$t(s),null)},"Array, number":function(s,f){return o(s,f,$t(s),null)},"Array, BigNumber":function(s,f){return o(s,f.toNumber(),$t(s),null)},"Array, string":function(s,f){return o(s,0,$t(s),f)},"Array, number, string":function(s,f,p){return o(s,f,$t(s),p)},"Array, BigNumber, string":function(s,f,p){return o(s,f.toNumber(),$t(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 N=[p+h,p+y];if(f&&f!=="sparse"&&f!=="dense")throw new TypeError("Unknown matrix type ".concat(f,'"'));var w=f==="sparse"?i.diagonal(N,a,s):n.diagonal(N,a,s);return f!==null?w:w.valueOf()}function l(a,s,f,p,h,y){if(Et(a)){var N=a.diagonal(s);return f!==null?f!==N.storage()?r(N,f):N:N.valueOf()}for(var w=Math.min(p[0]-h,p[1]-y),D=[],b=0;b=2&&w.push("index: ".concat(hr(r))),y.length>=3&&w.push("array: ".concat(hr(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(D.message))}}}var lse="filter",fse=["typed"],d4=K(lse,fse,e=>{var{typed:t}=e;return t("filter",{"Array, function":h4,"Matrix, function":function(n,i){return n.create(h4(n.toArray(),i))},"Array, RegExp":lh,"Matrix, RegExp":function(n,i){return n.create(lh(n.toArray(),i))}})});function h4(e,t){return My(e,function(r,n,i){return $a(t,r,[n],i,"filter")})}v();x();g();var v4="flatten",cse=["typed","matrix"],g4=K(v4,cse,e=>{var{typed:t,matrix:r}=e;return t(v4,{Array:function(i){return rr(i)},Matrix:function(i){var o=rr(i.toArray());return r(o)}})});v();x();g();var x4="forEach",pse=["typed"],y4=K(x4,pse,e=>{var{typed:t}=e;return t(x4,{"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))Df(i,function(u,l){n(u,o.concat(l))});else return $a(t,i,o,e,"forEach")};r(e,[])}v();x();g();var w4="getMatrixDataType",hse=["typed"],b4=K(w4,hse,e=>{var{typed:t}=e;return t(w4,{Array:function(n){return Nf(n,hr)},Matrix:function(n){return n.getDataType()}})});v();x();g();var D4="identity",dse=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],N4=K(D4,dse,e=>{var{typed:t,config:r,matrix:n,BigNumber:i,DenseMatrix:o,SparseMatrix:u}=e;return t(D4,{"":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=_t(s)||_t(f)?i:null;if(_t(s)&&(s=s.toNumber()),_t(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,N=h?new h(0):0,w=[s,f];if(p){if(p==="sparse")return u.diagonal(w,y,0,N);if(p==="dense")return o.diagonal(w,y,0,N);throw new TypeError('Unknown matrix type "'.concat(p,'"'))}for(var D=Ts([],w,N),b=s{var{typed:t,matrix:r,multiplyScalar:n}=e;return t(E4,{"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($t(o).length===1&&(o=[o]),$t(u).length===1&&(u=[u]),$t(o).length>2||$t(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}});v();x();g();var A4="map",gse=["typed"],C4=K(A4,gse,e=>{var{typed:t}=e;return t(A4,{"Array, function":xse,"Matrix, function":function(n,i){return n.map(i)}})});function xse(e,t){var r=function n(i,o){return Array.isArray(i)?i.map(function(u,l){return n(u,o.concat(l))}):$a(t,i,o,e,"map")};return r(e,[])}v();x();g();var M4="diff",yse=["typed","matrix","subtract","number"],jy=K(M4,yse,e=>{var{typed:t,matrix:r,subtract:n,number:i}=e;return t(M4,{"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 y=[];return a.length>0?Ts(y,a,p):y}}function u(a){var s=!1;return a.forEach(function(f,p,h){_t(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")})}});v();x();g();v();x();g();function wh(){throw new Error('No "bignumber" implementation available')}function ew(){throw new Error('No "fraction" implementation available')}function tw(){throw new Error('No "matrix" implementation available')}var O4="range",Dse=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],rw=K(O4,Dse,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(O4,{string:h,"string, boolean":h,"number, number":function(D,b){return p(y(D,b,1,!1))},"number, number, number":function(D,b,O){return p(y(D,b,O,!1))},"number, number, boolean":function(D,b,O){return p(y(D,b,1,O))},"number, number, number, boolean":function(D,b,O,M){return p(y(D,b,O,M))},"BigNumber, BigNumber":function(D,b){var O=D.constructor;return p(y(D,b,new O(1),!1))},"BigNumber, BigNumber, BigNumber":function(D,b,O){return p(y(D,b,O,!1))},"BigNumber, BigNumber, boolean":function(D,b,O){var M=D.constructor;return p(y(D,b,new M(1),O))},"BigNumber, BigNumber, BigNumber, boolean":function(D,b,O,M){return p(y(D,b,O,M))},"Unit, Unit, Unit":function(D,b,O){return p(y(D,b,O,!1))},"Unit, Unit, Unit, boolean":function(D,b,O,M){return p(y(D,b,O,M))}});function p(w){return r.matrix==="Matrix"?n?n(w):tw():w}function h(w,D){var b=N(w);if(!b)throw new SyntaxError('String "'+w+'" is no valid range');return r.number==="BigNumber"?(i===void 0&&wh(),p(y(i(b.start),i(b.end),i(b.step)),D)):p(y(b.start,b.end,b.step,D))}function y(w,D,b,O){for(var M=[],I=f(b)?O?u:o:O?a:l,F=w;I(F,D);)M.push(F),F=s(F,b);return M}function N(w){var D=w.split(":"),b=D.map(function(M){return Number(M)}),O=b.some(function(M){return isNaN(M)});if(O)return null;switch(b.length){case 2:return{start:b[0],end:b[1],step:1};case 3:return{start:b[0],end:b[2],step:b[1]};default:return null}}});v();x();g();var I4="reshape",Nse=["typed","isInteger","matrix"],F4=K(I4,Nse,e=>{var{typed:t,isInteger:r}=e;return t(I4,{"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)}),xg(i,o)}})});v();x();g();var Ese="resize",Sse=["config","matrix"],_4=K(Ese,Sse,e=>{var{config:t,matrix:r}=e;return function(o,u,l){if(arguments.length!==2&&arguments.length!==3)throw new pa("resize",arguments.length,2,3);if(Et(u)&&(u=u.valueOf()),_t(u[0])&&(u=u.map(function(f){return _t(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 Bt(o)}else{Array.isArray(o)||(o=[o]),o=Bt(o);var s=Ts(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 Kt(o.length,1);var l=o[0];if(typeof l!="number"||!Nt(l))throw new TypeError("Invalid size, must contain positive integers (size: "+Zt(o)+")");if(i.length>l)return i.substring(0,l);if(i.length{var{typed:t,multiply:r,rotationMatrix:n}=e;return t(k4,{"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)?$t(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))}});v();x();g();var L4="rotationMatrix",Cse=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],P4=K(L4,Cse,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(L4,{"":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 N(F),b(M,F,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(M,I){N(I);var F=I.storage()||(r.matrix==="Matrix"?"dense":void 0);return b(M,I,F)},"number | BigNumber | Complex | Unit, Array, string":function(M,I,F){var C=a(I);return N(C),b(M,C,F)},"number | BigNumber | Complex | Unit, Matrix, string":function(M,I,F){return N(I),b(M,I,F)}});function y(O,M){var I=_t(O),F=I?new l(-1):-1,C=p(O),P=h(O),R=[[C,n(F,P)],[P,C]];return D(R,M)}function N(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 D(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 b(O,M,I){var F=u(M);if(F===0)throw new RangeError("Rotation around zero vector");var C=_t(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,z=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])),X=i(w([q,z,W]),w([R,H,ee])),Y=i(w([q,H,W]),w([z,ee])),le=i(w([q,z,W]),w([H,ee])),re=i(V,w([z,z,W])),he=i(w([z,H,W]),w([R,q,ee])),De=i(w([q,H,W]),w([R,z,ee])),ye=i(w([z,H,W]),w([q,ee])),ce=i(V,w([H,H,W])),Ne=[[ie,X,Y],[le,re,he],[De,ye,ce]];return D(Ne,I)}});v();x();g();var R4="row",Mse=["typed","Index","matrix","range"],nw=K(R4,Mse,e=>{var{typed:t,Index:r,matrix:n,range:i}=e;return t(R4,{"Matrix, number":o,"Array, number":function(l,a){return o(n(Bt(l)),a).valueOf()}});function o(u,l){if(u.size().length!==2)throw new Error("Only two dimensional matrix is supported");Br(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]])}});v();x();g();var q4="size",Tse=["typed","config","?matrix"],z4=K(q4,Tse,e=>{var{typed:t,config:r,matrix:n}=e;return t(q4,{Matrix:function(o){return o.create(o.size())},Array:$t,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([]):tw()}})});v();x();g();var U4="squeeze",Ose=["typed","matrix"],H4=K(U4,Ose,e=>{var{typed:t,matrix:r}=e;return t(U4,{Array:function(i){return uh(Bt(i))},Matrix:function(i){var o=uh(i.toArray());return Array.isArray(o)?r(o):o},any:function(i){return Bt(i)}})});v();x();g();var $4="subset",Ise=["typed","matrix","zeros","add"],iw=K($4,Ise,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e;return t($4,{"Matrix, Index":function(l,a){return ap(a)?r():(gg(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":_se,"string, Index":Fse,"Matrix, Index, any, any":function(l,a,s,f){return ap(a)?l:(gg(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":W4,"string, Index, string, string":W4,"Object, Index, any":kse});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 Fse(e,t){if(!bu(t))throw new TypeError("Index expected");if(ap(t))return"";if(gg(Array.from(e),t),t.size().length!==1)throw new Kt(t.size().length,1);var r=e.length;Br(t.min()[0],r),Br(t.max()[0],r);var n=t.dimension(0),i="";return n.forEach(function(o){i+=e.charAt(o)}),i}function W4(e,t,r,n){if(!t||t.isIndex!==!0)throw new TypeError("Index expected");if(ap(t))return e;if(gg(Array.from(e),t),t.size().length!==1)throw new Kt(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 Kt(i.size()[0],r.length);var u=e.length;Br(t.min()[0]),Br(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(V4,{Array:u=>n(r(u)).valueOf(),Matrix:n,any:Bt});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: "+Zt(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: "+Zt(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(Y4,{any:function(o){return n(r(o))}})});v();x();g();var X4="zeros",Pse=["typed","config","matrix","BigNumber"],K4=K(X4,Pse,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(X4,{"":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?Ts(y,a,p):y}}function u(a){var s=!1;return a.forEach(function(f,p,h){_t(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")})}});v();x();g();var J4="fft",Rse=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],Q4=K(J4,Rse,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(J4,{Array:N,Matrix:function(M){return M.create(N(M.toArray()))}});function N(O){var M=$t(O);return M.length===1?b(O,M[0]):w(O.map(I=>N(I,M.slice(1))),0)}function w(O,M){var I=$t(O);if(M!==0)return new Array(I[0]).fill(0).map((C,P)=>w(O[P],M-1));if(I.length===1)return b(O);function F(C){var P=$t(C);return new Array(P[1]).fill(0).map((R,q)=>new Array(P[0]).fill(0).map((z,H)=>C[H][q]))}return F(w(F(O),1))}function D(O){for(var M=O.length,I=u(o(i(-1,i(a,l)),M)),F=[],C=1-M;Ci(O[Y],F[M-1+Y])),...new Array(P-M).fill(0)],q=[...new Array(M+M-1).fill(0).map((X,Y)=>o(1,F[Y])),...new Array(P-(M+M-1)).fill(0)],z=b(R),H=b(q),V=new Array(P).fill(0).map((X,Y)=>i(z[Y],H[Y])),W=s(f(N(f(V))),P),ee=[],ie=M-1;ieq%2===0),M/2),...b(O.filter((R,q)=>q%2===1),M/2)],F=0;F{var{typed:t,fft:r,dotDivide:n,conj:i}=e;return t(j4,{"Array | Matrix":function(u){var l=Et(u)?u.size():$t(u);return n(i(r(i(u))),l.reduce((a,s)=>a*s,1))}})});v();x();g();v();x();g();v();x();g();v();x();g();function Ff(e){"@babel/helpers - typeof";return Ff=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},Ff(e)}v();x();g();function SA(e,t){if(Ff(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ff(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function AA(e){var t=SA(e,"string");return Ff(t)=="symbol"?t:t+""}function Cr(e,t,r){return t=AA(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t5(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 zse(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:N,unaryMinus:w}=e;function D(R){return function(q,z,H,V){var W=!(z.length===2&&(z.every(C)||z.every(ri)));if(W)throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var ee=z[0],ie=z[1],X=p(ie,ee),Y=V.firstStep;if(Y!==void 0&&!s(Y))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,Y,re,le].filter(et=>et!==void 0);if(!(he.every(C)||he.every(ri)))throw new Error('Inconsistent type of "t" dependant variables');for(var De=1,ye=V.tol?V.tol:1e-4,ce=V.minDelta?V.minDelta:.2,Ne=V.maxDelta?V.maxDelta:5,Pe=V.maxIter?V.maxIter:1e4,Ce=[ee,ie,...H,le,re].some(_t),[Oe,He,Se,ze]=Ce?[N(R.a),N(R.c),N(R.b),N(R.bp)]:[R.a,R.c,R.b,R.bp],We=Y?X?Y:w(Y):o(n(ie,ee),De),Be=[ee],lt=[H],ct=n(Se,ze),de=0,be=0,Ue=I(X),ve=F(X);Ue(Be[de],ie);){var Re=[];We=ve(Be[de],ie,We),Re.push(q(Be[de],lt[de]));for(var ke=1;keri(et)?et.value:et)));Je1/4&&(Be.push(r(Be[de],We)),lt.push(r(lt[de],i(We,Se,Re))),de++);var ot=.84*(ye/Je)**(1/5);if(h(ot,ce)?ot=ce:p(ot,Ne)&&(ot=Ne),ot=Ce?N(ot):ot,We=i(We,ot),le&&p(a(We),le)?We=X?le:w(le):re&&h(a(We),re)&&(We=X?re:w(re)),be++,be>Pe)throw new Error("Maximum number of iterations reached, try changing options")}return{t:Be,y:lt}}}function b(R,q,z,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],X={a:V,c:W,b:ee,bp:ie};return D(X)(R,q,z,H)}function O(R,q,z,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],X={a:V,c:W,b:ee,bp:ie};return D(X)(R,q,z,H)}function M(R,q,z,H){var V=H.method?H.method:"RK45",W={RK23:b,RK45:O};if(V.toUpperCase()in W){var ee=zse({},H);return delete ee.method,W[V.toUpperCase()](R,q,z,ee)}else{var ie=Object.keys(W).map(Y=>'"'.concat(Y,'"')),X="".concat(ie.slice(0,-1).join(", ")," and ").concat(ie.slice(-1));throw new Error('Unavailable method "'.concat(V,'". Available methods are ').concat(X))}}function I(R){return R?h:p}function F(R){var q=R?p:h;return function(z,H,V){var W=r(z,V);return q(W,H)?n(H,z):V}}function C(R){return _t(R)||Ht(R)}function P(R,q,z,H){var V=M(R,q.toArray(),z.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,z)=>M(R,q,z,{}),"function, Matrix, Matrix":(R,q,z)=>P(R,q,z,{}),"function, Array, number | BigNumber | Unit":(R,q,z)=>{var H=M(R,q,[z],{});return{t:H.t,y:H.y.map(V=>V[0])}},"function, Matrix, number | BigNumber | Unit":(R,q,z)=>{var H=M(R,q.toArray(),[z],{});return{t:y(H.t),y:y(H.y.map(V=>V[0]))}},"function, Array, number | BigNumber | Unit, Object":(R,q,z,H)=>{var V=M(R,q,[z],H);return{t:V.t,y:V.y.map(W=>W[0])}},"function, Matrix, number | BigNumber | Unit, Object":(R,q,z,H)=>{var V=M(R,q.toArray(),[z],H);return{t:y(V.t),y:y(V.y.map(W=>W[0]))}}})});v();x();g();var $se="erf",Wse=["typed"],n5=K($se,Wse,e=>{var{typed:t}=e;return t("name",{number:function(u){var l=Math.abs(u);return l>=Yse?za(u):l<=Vse?za(u)*r(l):l<=4?za(u)*(1-n(l)):za(u)*(1-i(l))},"Array | Matrix":t.referToSelf(o=>u=>Ot(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+bh[0][s])*u;return o*(l+Dl[0][3])/(a+bh[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+bh[1][a])*o;var s=(u+Dl[1][7])/(l+bh[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+bh[2][s])*u;var f=u*(l+Dl[2][4])/(a+bh[2][4]);f=(Gse-f)/o,u=parseInt(o*16)/16;var p=(o-u)*(o+u);return Math.exp(-u*u)*Math.exp(-p)*f}}),Vse=.46875,Gse=.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]],bh=[[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]],Yse=Math.pow(2,53);v();x();g();var i5="zeta",Zse=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],o5=K(i5,Zse,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:N,BigNumber:w,pi:D}=e;return t(i5,{number:C=>b(C,P=>P,()=>20),BigNumber:C=>b(C,P=>new w(P),()=>Math.abs(Math.log10(r.epsilon))),Complex:O});function b(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 N(-.5):C.re===1?new N(NaN,NaN):C.re===1/0&&C.im===0?new N(1):C.im===1/0||C.re===-1/0?new N(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 z=R(C);if(q(C)>-(z-1)/2)return F(C,P(z),P);var H=n(i(2,C),i(P(D),h(C,1)));return H=n(H,p(n(o(P(D),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 z=o(n(u(y(P,h(q,1))),i(4,q)),n(u(h(P,q)),u(n(2,q))));R=y(R,z)}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))))),z=R(0),H=R(1);a(H,P);H=y(H,1))z=y(z,o(n((-1)**(H-1),I(H,P)),i(H,C)));return n(q,z)}});v();x();g();var a5="mode",Xse=["typed","isNaN","isNumeric"],s5=K(a5,Xse,e=>{var{typed:t,isNaN:r,isNumeric:n}=e;return t(a5,{"Array | Matrix":i,"...":function(u){return i(u)}});function i(o){o=rr(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}});v();x();g();v();x();g();function Mn(e,t,r){var n;return String(e).indexOf("Unexpected type")!==-1?(n=arguments.length>2?" (type: "+hr(r)+", value: "+JSON.stringify(r)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+n)):String(e).indexOf("complex numbers")!==-1?(n=arguments.length>2?" (type: "+hr(r)+", value: "+JSON.stringify(r)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+n)):e}var u5="prod",Kse=["typed","config","multiplyScalar","numeric"],l5=K(u5,Kse,e=>{var{typed:t,config:r,multiplyScalar:n,numeric:i}=e;return t(u5,{"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(fo(u,function(a){try{l=l===void 0?a:n(l,a)}catch(s){throw Mn(s,"prod",a)}}),typeof l=="string"&&(l=i(l,r.number)),l===void 0)throw new Error("Cannot calculate prod of an empty array");return l}});v();x();g();var f5="format",Jse=["typed"],c5=K(f5,Jse,e=>{var{typed:t}=e;return t(f5,{any:Zt,"any, Object | function | number | BigNumber":Zt})});v();x();g();var p5="bin",Qse=["typed","format"],m5=K(p5,Qse,e=>{var{typed:t,format:r}=e;return t(p5,{"number | BigNumber":function(i){return r(i,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(i,o){return r(i,{notation:"bin",wordSize:o})}})});v();x();g();var h5="oct",jse=["typed","format"],d5=K(h5,jse,e=>{var{typed:t,format:r}=e;return t(h5,{"number | BigNumber":function(i){return r(i,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(i,o){return r(i,{notation:"oct",wordSize:o})}})});v();x();g();var v5="hex",eue=["typed","format"],g5=K(v5,eue,e=>{var{typed:t,format:r}=e;return t(v5,{"number | BigNumber":function(i){return r(i,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(i,o){return r(i,{notation:"hex",wordSize:o})}})});v();x();g();v();x();g();var ow=/\$([\w.]+)/g;var x5="print",tue=["typed"],aw=K(x5,tue,e=>{var{typed:t}=e;return t(x5,{"string, Object | Array":y5,"string, Object | Array, number | Object":y5})});function y5(e,t,r){return e.replace(ow,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?dn(u)?u:Zt(u,r):n})}v();x();g();var w5="to",rue=["typed","matrix","concat"],b5=K(w5,rue,e=>{var{typed:t,matrix:r,concat:n}=e,i=er({typed:t,matrix:r,concat:n});return t(w5,{"Unit, Unit | string":(o,u)=>o.to(u)},i({Ds:!0}))});v();x();g();var D5="isPrime",nue=["typed"],N5=K(D5,nue,e=>{var{typed:t}=e;return t(D5,{number:function(n){if(n*0!==0)return!1;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},BigNumber:function(n){if(n.toNumber()*0!==0)return!1;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=>Ot(n,r))})});v();x();g();var iue="numeric",oue=["number","?bignumber","?fraction"],E5=K(iue,oue,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):wh,Fraction:n?u=>n(u):ew};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=hr(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)}});v();x();g();var S5="divideScalar",aue=["typed","numeric"],A5=K(S5,aue,e=>{var{typed:t,numeric:r}=e;return t(S5,{"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)},"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)})});v();x();g();var C5="pow",sue=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],M5=K(C5,sue,e=>{var{typed:t,config:r,identity:n,multiply:i,matrix:o,inv:u,number:l,fraction:a,Complex:s}=e;return t(C5,{"number, number":f,"Complex, Complex":function(N,w){return N.pow(w)},"BigNumber, BigNumber":function(N,w){return w.isInteger()||N>=0||r.predictable?N.pow(w):new s(N.toNumber(),0).pow(w.toNumber(),0)},"Fraction, Fraction":function(N,w){var D=N.pow(w);if(D!=null)return D;if(r.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return f(N.valueOf(),w.valueOf())},"Array, number":p,"Array, BigNumber":function(N,w){return p(N,w.toNumber())},"Matrix, number":h,"Matrix, BigNumber":function(N,w){return h(N,w.toNumber())},"Unit, number | BigNumber":function(N,w){return N.pow(w)}});function f(y,N){if(r.predictable&&!Nt(N)&&y<0)try{var w=a(N),D=l(w);if((N===D||Math.abs((N-D)/N)<1e-14)&&w.d%2===1)return(w.n%2===0?1:-1)*Math.pow(-y,N)}catch{}return r.predictable&&(y<-1&&N===1/0||y>-1&&y<0&&N===-1/0)?NaN:Nt(N)||y>=0||r.predictable?RS(y,N):y*y<1&&N===1/0||y*y>1&&N===-1/0?0:new s(y,0).pow(N,0)}function p(y,N){if(!Nt(N))throw new TypeError("For A^b, b must be an integer (value is "+N+")");var w=$t(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(N<0)try{return p(u(y),-N)}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 "+N+")"):O}for(var D=n(w[0]).valueOf(),b=y;N>=1;)(N&1)===1&&(D=i(b,D)),N>>=1,b=i(b,b);return D}function h(y,N){return o(p(y.valueOf(),N))}});v();x();g();var Dh="Number of decimals in function round must be an integer",T5="round",uue=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],O5=K(T5,uue,e=>{var{typed:t,config:r,matrix:n,equalScalar:i,zeros:o,BigNumber:u,DenseMatrix:l}=e,a=Lr({typed:t,equalScalar:i}),s=Sr({typed:t,DenseMatrix:l}),f=Yn({typed:t});function p(h){return Math.abs(sh(h).exponent)}return t(T5,{number:function(y){var N=dh(y,p(r.epsilon)),w=yn(y,N,r.epsilon)?N:y;return dh(w)},"number, number":function(y,N){var w=p(r.epsilon);if(N>=w)return dh(y,N);var D=dh(y,w),b=yn(y,D,r.epsilon)?D:y;return dh(b,N)},"number, BigNumber":function(y,N){if(!N.isInteger())throw new TypeError(Dh);return new u(y).toDecimalPlaces(N.toNumber())},Complex:function(y){return y.round()},"Complex, number":function(y,N){if(N%1)throw new TypeError(Dh);return y.round(N)},"Complex, BigNumber":function(y,N){if(!N.isInteger())throw new TypeError(Dh);var w=N.toNumber();return y.round(w)},BigNumber:function(y){var N=new u(y).toDecimalPlaces(p(r.epsilon)),w=ni(y,N,r.epsilon)?N:y;return w.toDecimalPlaces(0)},"BigNumber, BigNumber":function(y,N){if(!N.isInteger())throw new TypeError(Dh);var w=p(r.epsilon);if(N>=w)return y.toDecimalPlaces(N.toNumber());var D=y.toDecimalPlaces(w),b=ni(y,D,r.epsilon)?D:y;return b.toDecimalPlaces(N.toNumber())},Fraction:function(y){return y.round()},"Fraction, number":function(y,N){if(N%1)throw new TypeError(Dh);return y.round(N)},"Fraction, BigNumber":function(y,N){if(!N.isInteger())throw new TypeError(Dh);return y.round(N.toNumber())},"Unit, number, Unit":t.referToSelf(h=>function(y,N,w){var D=y.toNumeric(w);return w.multiply(h(D,N))}),"Unit, BigNumber, Unit":t.referToSelf(h=>(y,N,w)=>h(y,N.toNumber(),w)),"Unit, Unit":t.referToSelf(h=>(y,N)=>h(y,0,N)),"Array | Matrix, number, Unit":t.referToSelf(h=>(y,N,w)=>Ot(y,D=>h(D,N,w),!0)),"Array | Matrix, BigNumber, Unit":t.referToSelf(h=>(y,N,w)=>h(y,N.toNumber(),w)),"Array | Matrix, Unit":t.referToSelf(h=>(y,N)=>h(y,0,N)),"Array | Matrix":t.referToSelf(h=>y=>Ot(y,h,!0)),"SparseMatrix, number | BigNumber":t.referToSelf(h=>(y,N)=>a(y,N,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(y,N)=>f(y,N,h,!1)),"Array, number | BigNumber":t.referToSelf(h=>(y,N)=>f(n(y),N,h,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":t.referToSelf(h=>(y,N)=>i(y,0)?o(N.size(),N.storage()):s(N,y,h,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":t.referToSelf(h=>(y,N)=>i(y,0)?o(N.size(),N.storage()):f(N,y,h,!0)),"number | Complex | BigNumber | Fraction, Array":t.referToSelf(h=>(y,N)=>f(n(N),y,h,!0).valueOf())})});v();x();g();var I5="log",lue=["config","typed","divideScalar","Complex"],F5=K(I5,lue,e=>{var{typed:t,config:r,divideScalar:n,Complex:i}=e;return t(I5,{number:function(u){return u>=0||r.predictable?QF(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)))})});v();x();g();var _5="log1p",fue=["typed","config","divideScalar","log","Complex"],k5=K(_5,fue,e=>{var{typed:t,config:r,divideScalar:n,log:i,Complex:o}=e;return t(_5,{number:function(a){return a>=-1||r.predictable?Dy(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=>Ot(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))}});v();x();g();var B5="nthRoots",cue=["config","typed","divideScalar","Complex"],L5=K(B5,cue,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=[],N=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=li({typed:t,DenseMatrix:o}),s=Lr({typed:t,equalScalar:r}),f=Sr({typed:t,DenseMatrix:o}),p=er({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 N=t(h);return t(P5,p({elop:N,SS:a,DS:l,Ss:s,sS:f}))});v();x();g();var q5="dotDivide",mue=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],z5=K(q5,mue,e=>{var{typed:t,matrix:r,equalScalar:n,divideScalar:i,DenseMatrix:o,concat:u}=e,l=Zn({typed:t,equalScalar:n}),a=Kr({typed:t}),s=li({typed:t,DenseMatrix:o}),f=Lr({typed:t,equalScalar:n}),p=Sr({typed:t,DenseMatrix:o}),h=er({typed:t,matrix:r,concat:u});return t(q5,h({elop:i,SS:s,DS:a,SD:l,Ss:f,sS:p}))});v();x();g();v();x();g();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: "+Zt(u)+")");var l=u[0],a=u[1];if(l!==a)throw new RangeError("Matrix must be square (size: "+Zt(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=Cu({DenseMatrix:l});return t(U5,{"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 N=r(h),w=s(N,y);return w.valueOf()}});function s(p,h){h=a(p,h,!0);for(var y=h._data,N=p._size[0],w=p._size[1],D=[],b=p._data,O=0;OI&&(P.push(D[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($5,{"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 N=r(h),w=s(N,y);return w.valueOf()}});function s(p,h){h=a(p,h,!0);for(var y=h._data,N=p._size[0],w=p._size[1],D=[],b=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=b[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,b[C][O]))]}D[O]=[I]}return new l({data:D,size:[N,1]})}function f(p,h){h=a(p,h,!0);for(var y=h._data,N=p._size[0],w=p._size[1],D=p._values,b=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],z=O[I+1],H=z-1;H>=q;H--){var V=b[H];V===I?C=D[H]:V{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:u,DenseMatrix:l}=e,a=Cu({DenseMatrix:l});return t(V5,{"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 N=r(h),w=s(N,y);return w.map(D=>D.valueOf())}});function s(p,h){for(var y=[a(p,h,!0)._data.map(R=>R[0])],N=p._data,w=p._size[0],D=p._size[1],b=0;bnew 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])],N=p._size[0],w=p._size[1],D=p._values,b=p._index,O=p._ptr,M=0;MM&&(P.push(D[V]),R.push(W))}if(u(H,0))if(u(C[M],0)){if(F===0){var Y=[...C];Y[M]=1;for(var le=0,re=R.length;lenew l({data:De.map(ye=>[ye]),size:[N,1]}))}});v();x();g();var Y5="usolveAll",gue=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],Z5=K(Y5,gue,e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:u,DenseMatrix:l}=e,a=Cu({DenseMatrix:l});return t(Y5,{"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 N=r(h),w=s(N,y);return w.map(D=>D.valueOf())}});function s(p,h){for(var y=[a(p,h,!0)._data.map(R=>R[0])],N=p._data,w=p._size[0],D=p._size[1],b=D-1;b>=0;b--)for(var O=y.length,M=0;M=0;P--)C[P]=o(C[P],N[P][b]);y.push(C)}}else{if(M===0)return[];y.splice(M,1),M-=1,O-=1}else{I[b]=n(I[b],N[b][b]);for(var F=b-1;F>=0;F--)I[F]=o(I[F],i(I[b],N[F][b]))}}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])],N=p._size[0],w=p._size[1],D=p._values,b=p._index,O=p._ptr,M=w-1;M>=0;M--)for(var I=y.length,F=0;F=q;V--){var W=b[V];W===M?H=D[V]:Wnew l({data:De.map(ye=>[ye]),size:[N,1]}))}});v();x();g();v();x();g();var xue="matAlgo08xS0Sid",yue=["typed","equalScalar"],Nh=K(xue,yue,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,N=o._ptr,w=o._size,D=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==w.length)throw new Kt(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 b=f[0],O=f[1],M,I=r,F=0,C=u;typeof p=="string"&&p===D&&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=[],z=[],H=[],V,W,ee,ie,X=0;X{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 X5="leftShift",wue=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],K5=K(X5,wue,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:o,concat:u}=e,l=co({typed:t}),a=Zn({typed:t,equalScalar:n}),s=Nh({typed:t,equalScalar:n}),f=$o({typed:t,DenseMatrix:o}),p=Lr({typed:t,equalScalar:n}),h=Yn({typed:t}),y=er({typed:t,matrix:r,concat:u}),N=Eh({typed:t,matrix:r});return t(X5,{"number, number":$S,"BigNumber, BigNumber":qk,"SparseMatrix, number | BigNumber":t.referToSelf(w=>(D,b)=>n(b,0)?D.clone():p(D,b,w,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(w=>(D,b)=>n(b,0)?D.clone():h(D,b,w,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(w=>(D,b)=>n(D,0)?i(b.size(),b.storage()):f(b,D,w,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(w=>(D,b)=>n(D,0)?i(b.size(),b.storage()):h(b,D,w,!0))},N,y({SS:s,DS:l,SD:a}))});v();x();g();var J5="rightArithShift",bue=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],Q5=K(J5,bue,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:o,concat:u}=e,l=co({typed:t}),a=Zn({typed:t,equalScalar:n}),s=Nh({typed:t,equalScalar:n}),f=$o({typed:t,DenseMatrix:o}),p=Lr({typed:t,equalScalar:n}),h=Yn({typed:t}),y=er({typed:t,matrix:r,concat:u}),N=Eh({typed:t,matrix:r});return t(J5,{"number, number":WS,"BigNumber, BigNumber":zk,"SparseMatrix, number | BigNumber":t.referToSelf(w=>(D,b)=>n(b,0)?D.clone():p(D,b,w,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(w=>(D,b)=>n(b,0)?D.clone():h(D,b,w,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(w=>(D,b)=>n(D,0)?i(b.size(),b.storage()):f(b,D,w,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(w=>(D,b)=>n(D,0)?i(b.size(),b.storage()):h(b,D,w,!0))},N,y({SS:s,DS:l,SD:a}))});v();x();g();var j5="rightLogShift",Due=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],eB=K(j5,Due,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:o,concat:u}=e,l=co({typed:t}),a=Zn({typed:t,equalScalar:n}),s=Nh({typed:t,equalScalar:n}),f=$o({typed:t,DenseMatrix:o}),p=Lr({typed:t,equalScalar:n}),h=Yn({typed:t}),y=er({typed:t,matrix:r,concat:u}),N=Eh({typed:t,matrix:r});return t(j5,{"number, number":VS,"SparseMatrix, number | BigNumber":t.referToSelf(w=>(D,b)=>n(b,0)?D.clone():p(D,b,w,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(w=>(D,b)=>n(b,0)?D.clone():h(D,b,w,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(w=>(D,b)=>n(D,0)?i(b.size(),b.storage()):f(b,D,w,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(w=>(D,b)=>n(D,0)?i(b.size(),b.storage()):h(b,D,w,!0))},N,y({SS:s,DS:l,SD:a}))});v();x();g();var tB="and",Nue=["typed","matrix","equalScalar","zeros","not","concat"],sw=K(tB,Nue,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:u}=e,l=Zn({typed:t,equalScalar:n}),a=If({typed:t,equalScalar:n}),s=Lr({typed:t,equalScalar:n}),f=Yn({typed:t}),p=er({typed:t,matrix:r,concat:u});return t(tB,{"number, number":JS,"Complex, Complex":function(y,N){return(y.re!==0||y.im!==0)&&(N.re!==0||N.im!==0)},"BigNumber, BigNumber":function(y,N){return!y.isZero()&&!N.isZero()&&!y.isNaN()&&!N.isNaN()},"Unit, Unit":t.referToSelf(h=>(y,N)=>h(y.value||0,N.value||0)),"SparseMatrix, any":t.referToSelf(h=>(y,N)=>o(N)?i(y.size(),y.storage()):s(y,N,h,!1)),"DenseMatrix, any":t.referToSelf(h=>(y,N)=>o(N)?i(y.size(),y.storage()):f(y,N,h,!1)),"any, SparseMatrix":t.referToSelf(h=>(y,N)=>o(y)?i(y.size(),y.storage()):s(N,y,h,!0)),"any, DenseMatrix":t.referToSelf(h=>(y,N)=>o(y)?i(y.size(),y.storage()):f(N,y,h,!0)),"Array, any":t.referToSelf(h=>(y,N)=>h(r(y),N).valueOf()),"any, Array":t.referToSelf(h=>(y,N)=>h(y,r(N)).valueOf())},p({SS:a,DS:l}))});v();x();g();var uw="compare",Eue=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],rB=K(uw,Eue,e=>{var{typed:t,config:r,equalScalar:n,matrix:i,BigNumber:o,Fraction:u,DenseMatrix:l,concat:a}=e,s=Kr({typed:t}),f=Of({typed:t,equalScalar:n}),p=Sr({typed:t,DenseMatrix:l}),h=er({typed:t,matrix:i,concat:a}),y=Ha({typed:t});return t(uw,Sue({typed:t,config:r}),{"boolean, boolean":function(w,D){return w===D?0:w>D?1:-1},"BigNumber, BigNumber":function(w,D){return ni(w,D,r.epsilon)?new o(0):new o(w.cmp(D))},"Fraction, Fraction":function(w,D){return new u(w.compare(D))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},y,h({SS:f,DS:s,Ss:p}))}),Sue=K(uw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(uw,{"number, number":function(i,o){return yn(i,o,r.epsilon)?0:i>o?1:-1}})});v();x();g();var pp=en(iB(),1);var oB="compareNatural",Aue=["typed","compare"],aB=K(oB,Aue,e=>{var{typed:t,compare:r}=e,n=r.signatures["boolean,boolean"];return t(oB,{"any, any":i});function i(a,s){var f=hr(a),p=hr(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,pp.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,pp.default)(f,p);if(f!==p)return(0,pp.default)(f,p);if(f==="Complex")return Cue(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,pp.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 fa(s)&&fa(f)?u(a,s.toJSON().values,f.toJSON().values):fa(s)?o(a,s.toArray(),f):fa(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=er({typed:t,matrix:r,concat:n});return t(sB,Ay,i({elop:Ay,Ds:!0}))});v();x();g();var lw="equal",Tue=["typed","matrix","equalScalar","DenseMatrix","concat"],lB=K(lw,Tue,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,u=Kr({typed:t}),l=li({typed:t,DenseMatrix:i}),a=Sr({typed:t,DenseMatrix:i}),s=er({typed:t,matrix:r,concat:o});return t(lw,Oue({typed:t,equalScalar:n}),s({elop:n,SS:l,DS:u,Ss:a}))}),Oue=K(lw,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t(lw,{"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)}})});v();x();g();var fB="equalText",Iue=["typed","compareText","isZero"],cB=K(fB,Iue,e=>{var{typed:t,compareText:r,isZero:n}=e;return t(fB,{"any, any":function(o,u){return n(r(o,u))}})});v();x();g();var fw="smaller",Fue=["typed","config","matrix","DenseMatrix","concat"],pB=K(fw,Fue,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,u=Kr({typed:t}),l=li({typed:t,DenseMatrix:i}),a=Sr({typed:t,DenseMatrix:i}),s=er({typed:t,matrix:n,concat:o}),f=Ha({typed:t});return t(fw,_ue({typed:t,config:r}),{"boolean, boolean":(p,h)=>pp.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}))}),_ue=K(fw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(fw,{"number, number":function(i,o){return i{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,u=Kr({typed:t}),l=li({typed:t,DenseMatrix:i}),a=Sr({typed:t,DenseMatrix:i}),s=er({typed:t,matrix:n,concat:o}),f=Ha({typed:t});return t(cw,Bue({typed:t,config:r}),{"boolean, boolean":(p,h)=>p<=h,"BigNumber, BigNumber":function(h,y){return h.lte(y)||ni(h,y,r.epsilon)},"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}))}),Bue=K(cw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(cw,{"number, number":function(i,o){return i<=o||yn(i,o,r.epsilon)}})});v();x();g();var pw="larger",Lue=["typed","config","matrix","DenseMatrix","concat"],hB=K(pw,Lue,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,u=Kr({typed:t}),l=li({typed:t,DenseMatrix:i}),a=Sr({typed:t,DenseMatrix:i}),s=er({typed:t,matrix:n,concat:o}),f=Ha({typed:t});return t(pw,Pue({typed:t,config:r}),{"boolean, boolean":(p,h)=>p>h,"BigNumber, BigNumber":function(h,y){return h.gt(y)&&!ni(h,y,r.epsilon)},"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}))}),Pue=K(pw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(pw,{"number, number":function(i,o){return i>o&&!yn(i,o,r.epsilon)}})});v();x();g();var mw="largerEq",Rue=["typed","config","matrix","DenseMatrix","concat"],dB=K(mw,Rue,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,u=Kr({typed:t}),l=li({typed:t,DenseMatrix:i}),a=Sr({typed:t,DenseMatrix:i}),s=er({typed:t,matrix:n,concat:o}),f=Ha({typed:t});return t(mw,que({typed:t,config:r}),{"boolean, boolean":(p,h)=>p>=h,"BigNumber, BigNumber":function(h,y){return h.gte(y)||ni(h,y,r.epsilon)},"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(mw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(mw,{"number, number":function(i,o){return i>=o||yn(i,o,r.epsilon)}})});v();x();g();var vB="deepEqual",zue=["typed","equal"],gB=K(vB,zue,e=>{var{typed:t,equal:r}=e;return t(vB,{"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=li({typed:t,DenseMatrix:o}),s=Sr({typed:t,DenseMatrix:o}),f=er({typed:t,matrix:i,concat:u});return t(hw,Hue({typed:t,equalScalar:n}),f({elop:p,SS:a,DS:l,Ss:s}));function p(h,y){return!n(h,y)}}),Hue=K(hw,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t(hw,{"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)}})});v();x();g();var yB="partitionSelect",$ue=["typed","isNumeric","isNaN","compare"],wB=K(yB,$ue,e=>{var{typed:t,isNumeric:r,isNaN:n,compare:i}=e,o=i,u=(s,f)=>-i(s,f);return t(yB,{"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[D];s[D]=s[w],s[w]=O,--D}else++w;p(s[w],b)>0&&--w,f<=w?N=w:y=w+1}return s[f]}});v();x();g();var bB="sort",Wue=["typed","matrix","compare","compareNatural"],DB=K(bB,Wue,e=>{var{typed:t,matrix:r,compare:n,compareNatural:i}=e,o=n,u=(f,p)=>-n(f,p);return t(bB,{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($t(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")}});v();x();g();var NB="max",Vue=["typed","config","numeric","larger"],dw=K(NB,Vue,e=>{var{typed:t,config:r,numeric:n,larger:i}=e;return t(NB,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(a,s){return Tf(a,s.valueOf(),o)},"...":function(a){if(Ua(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 Mn(s,"max",a)}}function u(l){var a;if(fo(l,function(s){try{isNaN(s)&&typeof s=="number"?a=NaN:(a===void 0||i(s,a))&&(a=s)}catch(f){throw Mn(f,"max",s)}}),a===void 0)throw new Error("Cannot calculate max of an empty array");return typeof a=="string"&&(a=n(a,r.number)),a}});v();x();g();var EB="min",Gue=["typed","config","numeric","smaller"],vw=K(EB,Gue,e=>{var{typed:t,config:r,numeric:n,smaller:i}=e;return t(EB,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(a,s){return Tf(a,s.valueOf(),o)},"...":function(a){if(Ua(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 Mn(s,"min",a)}}function u(l){var a;if(fo(l,function(s){try{isNaN(s)&&typeof s=="number"?a=NaN:(a===void 0||i(s,a))&&(a=s)}catch(f){throw Mn(f,"min",s)}}),a===void 0)throw new Error("Cannot calculate min of an empty array");return typeof a=="string"&&(a=n(a,r.number)),a}});v();x();g();var Yue="ImmutableDenseMatrix",Zue=["smaller","DenseMatrix"],SB=K(Yue,Zue,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&&!dn(o))throw new Error("Invalid datatype: "+o);if(Et(i)||fr(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&&fr(i.data)&&fr(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 ("+hr(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:Bt(this._data),size:Bt(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});v();x();g();var Xue="Index",Kue=["ImmutableDenseMatrix","getMatrixDataType"],CB=K(Xue,Kue,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}v();x();g();var Jue="FibonacciHeap",Que=["smaller","larger"],MB=K(Jue,Que,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 N=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=N,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),N=0,w=f;if(w)for(N++,w=w.right;w!==f;)N++,w=w.right;for(var D;N>0;){for(var b=w.degree,O=w.right;D=y[b],!!D;){if(r(w.key,D.key)){var M=D;D=w,w=M}a(D,w),y[b]=null,b++}y[b]=w,w=O,N--}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:N,Complex:w,BigNumber:D,Fraction:b}=e,O=N;function M(de,be){if(!(this instanceof M))throw new Error("Constructor must be called with the new operator");if(!(de==null||h(de)||gi(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(ve=>0);else if(typeof be=="string"){var Ue=M.parse(be);this.units=Ue.units,this.dimensions=Ue.dimensions}else if(ri(be)&&be.value===null)this.fixPrefix=be.fixPrefix,this.skipAutomaticSimplification=be.skipAutomaticSimplification,this.dimensions=be.dimensions.slice(0),this.units=be.units.map(ve=>Un({},ve));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===" ";)z()}function R(de){return de>="0"&&de<="9"||de==="."}function q(de){return de>="0"&&de<="9"}function z(){F++,C=I.charAt(F)}function H(de){F=de,C=I.charAt(F)}function V(){var de="",be=F;if(C==="+"?z():C==="-"&&(de+=C,z()),!R(C))return H(be),null;if(C==="."){if(de+=C,z(),!q(C))return H(be),null}else{for(;q(C);)de+=C,z();C==="."&&(de+=C,z())}for(;q(C);)de+=C,z();if(C==="E"||C==="e"){var Ue="",ve=F;if(Ue+=C,z(),(C==="+"||C==="-")&&(Ue+=C,z()),!q(C))return H(ve),de;for(de=de+Ue;q(C);)de+=C,z()}return de}function W(){for(var de="";q(C)||M.isValidAlpha(C);)de+=C,z();var be=de.charAt(0);return M.isValidAlpha(be)?de:null}function ee(de){return C===de?(z(),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 ve=1,Re=!1;z(),P();var ke=V(),Je=null;if(ke){if(r.number==="BigNumber")Je=new D(ke);else if(r.number==="Fraction")try{Je=new b(ke)}catch{Je=parseFloat(ke)}else Je=parseFloat(ke);P(),ee("*")?(ve=1,Re=!0):ee("/")&&(ve=-1,Re=!0)}for(var ot=[],et=1;;){for(P();C==="(";)ot.push(ve),et*=ve,ve=1,z(),P();var ut=void 0;if(C){var Lt=C;if(ut=W(),ut===null)throw new SyntaxError('Unexpected "'+Lt+'" in "'+I+'" at index '+F.toString())}else break;var fe=ie(ut);if(fe===null)throw new SyntaxError('Unit "'+ut+'" not found.');var J=ve*et;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(hr(de)),ve=0;ve{if(St(ce,de)){var be=ce[de],Ue=be.prefixes[""];return{unit:be,prefix:Ue}}for(var ve in ce)if(St(ce,ve)&&sF(de,ve)){var Re=ce[ve],ke=de.length-ve.length,Je=de.substring(0,ke),ot=St(Re.prefixes,Je)?Re.prefixes[Je]: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=ri(de)?de:new M(de),ve=0;ve1e-12&&(St(Oe,ot)?be.push({unit:Oe[ot].unit,prefix:Oe[ot].prefix,power:de.dimensions[Je]||0}):ke=!0)}be.length1e-12)if(St(Ce.si,ve))be.push({unit:Ce.si[ve].unit,prefix:Ce.si[ve].prefix,power:de.dimensions[Ue]||0});else throw new Error("Cannot express custom unit "+ve+" 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,ve=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&&ve++;if(ve>0)for(var ke=0;ke0?(be+=" "+this.units[ke].prefix.name+this.units[ke].unit.name,Math.abs(this.units[ke].power+1)>1e-15&&(be+="^"+-this.units[ke].power)):(be+=" "+this.units[ke].prefix.name+this.units[ke].unit.name,be+="^"+this.units[ke].power));de=de.substr(1),be=be.substr(1),Ue>1&&ve>0&&(de="("+de+")"),ve>1&&Ue>0&&(be="("+be+")");var Je=de;return Ue>0&&ve>0&&(Je+=" / "),Je+=be,Je},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&&gi(be.value)&&(Ue=Math.abs(be.value.re)<1e-14);for(var ve in be.units)St(be.units,ve)&&be.units[ve].unit&&(be.units[ve].unit.name==="VA"&&Ue?be.units[ve].unit=ce.VAR:be.units[ve].unit.name==="VAR"&&!Ue&&(be.units[ve].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),ke=be.value!==null?y(Re,de||{}):"",Je=be.formatUnits();return be.value&&gi(be.value)&&(ke="("+ke+")"),Je.length>0&&ke.length>0&&(ke+=" "),ke+=Je,ke},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 ve=this.units[0].power,Re=Math.log(de/Math.pow(Ue.value*be,ve))/Math.LN10-1.2;if(Re>-2.200001&&Re<1.800001)return Ue;Re=Math.abs(Re);var ke=this.units[0].unit.prefixes;for(var Je in ke)if(St(ke,Je)){var ot=ke[Je];if(ot.scientific){var et=Math.abs(Math.log(de/Math.pow(ot.value*be,ve))/Math.LN10-1.2);(et0)},ce={meter:{name:"meter",base:re.LENGTH,prefixes:Y.LONG,value:1,offset:0},inch:{name:"inch",base:re.LENGTH,prefixes:Y.NONE,value:.0254,offset:0},foot:{name:"foot",base:re.LENGTH,prefixes:Y.NONE,value:.3048,offset:0},yard:{name:"yard",base:re.LENGTH,prefixes:Y.NONE,value:.9144,offset:0},mile:{name:"mile",base:re.LENGTH,prefixes:Y.NONE,value:1609.344,offset:0},link:{name:"link",base:re.LENGTH,prefixes:Y.NONE,value:.201168,offset:0},rod:{name:"rod",base:re.LENGTH,prefixes:Y.NONE,value:5.0292,offset:0},chain:{name:"chain",base:re.LENGTH,prefixes:Y.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:re.LENGTH,prefixes:Y.NONE,value:1e-10,offset:0},m:{name:"m",base:re.LENGTH,prefixes:Y.SHORT,value:1,offset:0},in:{name:"in",base:re.LENGTH,prefixes:Y.NONE,value:.0254,offset:0},ft:{name:"ft",base:re.LENGTH,prefixes:Y.NONE,value:.3048,offset:0},yd:{name:"yd",base:re.LENGTH,prefixes:Y.NONE,value:.9144,offset:0},mi:{name:"mi",base:re.LENGTH,prefixes:Y.NONE,value:1609.344,offset:0},li:{name:"li",base:re.LENGTH,prefixes:Y.NONE,value:.201168,offset:0},rd:{name:"rd",base:re.LENGTH,prefixes:Y.NONE,value:5.02921,offset:0},ch:{name:"ch",base:re.LENGTH,prefixes:Y.NONE,value:20.1168,offset:0},mil:{name:"mil",base:re.LENGTH,prefixes:Y.NONE,value:254e-7,offset:0},m2:{name:"m2",base:re.SURFACE,prefixes:Y.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:re.SURFACE,prefixes:Y.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:re.SURFACE,prefixes:Y.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:re.SURFACE,prefixes:Y.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:re.SURFACE,prefixes:Y.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:re.SURFACE,prefixes:Y.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:re.SURFACE,prefixes:Y.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:re.SURFACE,prefixes:Y.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:re.SURFACE,prefixes:Y.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:re.SURFACE,prefixes:Y.NONE,value:1e4,offset:0},m3:{name:"m3",base:re.VOLUME,prefixes:Y.CUBIC,value:1,offset:0},L:{name:"L",base:re.VOLUME,prefixes:Y.SHORT,value:.001,offset:0},l:{name:"l",base:re.VOLUME,prefixes:Y.SHORT,value:.001,offset:0},litre:{name:"litre",base:re.VOLUME,prefixes:Y.LONG,value:.001,offset:0},cuin:{name:"cuin",base:re.VOLUME,prefixes:Y.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:re.VOLUME,prefixes:Y.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:re.VOLUME,prefixes:Y.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:re.VOLUME,prefixes:Y.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:re.VOLUME,prefixes:Y.NONE,value:15e-6,offset:0},drop:{name:"drop",base:re.VOLUME,prefixes:Y.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:re.VOLUME,prefixes:Y.NONE,value:5e-8,offset:0},minim:{name:"minim",base:re.VOLUME,prefixes:Y.NONE,value:6161152e-14,offset:0},fluiddram:{name:"fluiddram",base:re.VOLUME,prefixes:Y.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:re.VOLUME,prefixes:Y.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:re.VOLUME,prefixes:Y.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:re.VOLUME,prefixes:Y.NONE,value:1e-6,offset:0},cup:{name:"cup",base:re.VOLUME,prefixes:Y.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:re.VOLUME,prefixes:Y.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:re.VOLUME,prefixes:Y.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:re.VOLUME,prefixes:Y.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:re.VOLUME,prefixes:Y.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:re.VOLUME,prefixes:Y.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:re.VOLUME,prefixes:Y.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:re.VOLUME,prefixes:Y.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:re.VOLUME,prefixes:Y.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:re.VOLUME,prefixes:Y.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:re.VOLUME,prefixes:Y.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:re.VOLUME,prefixes:Y.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:re.VOLUME,prefixes:Y.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:re.VOLUME,prefixes:Y.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:re.VOLUME,prefixes:Y.NONE,value:.1173478,offset:0},obl:{name:"obl",base:re.VOLUME,prefixes:Y.NONE,value:.1589873,offset:0},g:{name:"g",base:re.MASS,prefixes:Y.SHORT,value:.001,offset:0},gram:{name:"gram",base:re.MASS,prefixes:Y.LONG,value:.001,offset:0},ton:{name:"ton",base:re.MASS,prefixes:Y.SHORT,value:907.18474,offset:0},t:{name:"t",base:re.MASS,prefixes:Y.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:re.MASS,prefixes:Y.LONG,value:1e3,offset:0},grain:{name:"grain",base:re.MASS,prefixes:Y.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:re.MASS,prefixes:Y.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:re.MASS,prefixes:Y.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:re.MASS,prefixes:Y.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:re.MASS,prefixes:Y.NONE,value:45.359237,offset:0},stick:{name:"stick",base:re.MASS,prefixes:Y.NONE,value:.115,offset:0},stone:{name:"stone",base:re.MASS,prefixes:Y.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:re.MASS,prefixes:Y.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:re.MASS,prefixes:Y.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:re.MASS,prefixes:Y.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:re.MASS,prefixes:Y.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:re.MASS,prefixes:Y.NONE,value:45.359237,offset:0},s:{name:"s",base:re.TIME,prefixes:Y.SHORT,value:1,offset:0},min:{name:"min",base:re.TIME,prefixes:Y.NONE,value:60,offset:0},h:{name:"h",base:re.TIME,prefixes:Y.NONE,value:3600,offset:0},second:{name:"second",base:re.TIME,prefixes:Y.LONG,value:1,offset:0},sec:{name:"sec",base:re.TIME,prefixes:Y.LONG,value:1,offset:0},minute:{name:"minute",base:re.TIME,prefixes:Y.NONE,value:60,offset:0},hour:{name:"hour",base:re.TIME,prefixes:Y.NONE,value:3600,offset:0},day:{name:"day",base:re.TIME,prefixes:Y.NONE,value:86400,offset:0},week:{name:"week",base:re.TIME,prefixes:Y.NONE,value:7*86400,offset:0},month:{name:"month",base:re.TIME,prefixes:Y.NONE,value:2629800,offset:0},year:{name:"year",base:re.TIME,prefixes:Y.NONE,value:31557600,offset:0},decade:{name:"decade",base:re.TIME,prefixes:Y.NONE,value:315576e3,offset:0},century:{name:"century",base:re.TIME,prefixes:Y.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:re.TIME,prefixes:Y.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:re.FREQUENCY,prefixes:Y.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:re.FREQUENCY,prefixes:Y.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:re.ANGLE,prefixes:Y.SHORT,value:1,offset:0},radian:{name:"radian",base:re.ANGLE,prefixes:Y.LONG,value:1,offset:0},deg:{name:"deg",base:re.ANGLE,prefixes:Y.SHORT,value:null,offset:0},degree:{name:"degree",base:re.ANGLE,prefixes:Y.LONG,value:null,offset:0},grad:{name:"grad",base:re.ANGLE,prefixes:Y.SHORT,value:null,offset:0},gradian:{name:"gradian",base:re.ANGLE,prefixes:Y.LONG,value:null,offset:0},cycle:{name:"cycle",base:re.ANGLE,prefixes:Y.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:re.ANGLE,prefixes:Y.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:re.ANGLE,prefixes:Y.NONE,value:null,offset:0},A:{name:"A",base:re.CURRENT,prefixes:Y.SHORT,value:1,offset:0},ampere:{name:"ampere",base:re.CURRENT,prefixes:Y.LONG,value:1,offset:0},K:{name:"K",base:re.TEMPERATURE,prefixes:Y.SHORT,value:1,offset:0},degC:{name:"degC",base:re.TEMPERATURE,prefixes:Y.SHORT,value:1,offset:273.15},degF:{name:"degF",base:re.TEMPERATURE,prefixes:Y.SHORT,value:new b(5,9),offset:459.67},degR:{name:"degR",base:re.TEMPERATURE,prefixes:Y.SHORT,value:new b(5,9),offset:0},kelvin:{name:"kelvin",base:re.TEMPERATURE,prefixes:Y.LONG,value:1,offset:0},celsius:{name:"celsius",base:re.TEMPERATURE,prefixes:Y.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:re.TEMPERATURE,prefixes:Y.LONG,value:new b(5,9),offset:459.67},rankine:{name:"rankine",base:re.TEMPERATURE,prefixes:Y.LONG,value:new b(5,9),offset:0},mol:{name:"mol",base:re.AMOUNT_OF_SUBSTANCE,prefixes:Y.SHORT,value:1,offset:0},mole:{name:"mole",base:re.AMOUNT_OF_SUBSTANCE,prefixes:Y.LONG,value:1,offset:0},cd:{name:"cd",base:re.LUMINOUS_INTENSITY,prefixes:Y.SHORT,value:1,offset:0},candela:{name:"candela",base:re.LUMINOUS_INTENSITY,prefixes:Y.LONG,value:1,offset:0},N:{name:"N",base:re.FORCE,prefixes:Y.SHORT,value:1,offset:0},newton:{name:"newton",base:re.FORCE,prefixes:Y.LONG,value:1,offset:0},dyn:{name:"dyn",base:re.FORCE,prefixes:Y.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:re.FORCE,prefixes:Y.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:re.FORCE,prefixes:Y.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:re.FORCE,prefixes:Y.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:re.FORCE,prefixes:Y.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:re.FORCE,prefixes:Y.NONE,value:9.80665,offset:0},J:{name:"J",base:re.ENERGY,prefixes:Y.SHORT,value:1,offset:0},joule:{name:"joule",base:re.ENERGY,prefixes:Y.LONG,value:1,offset:0},erg:{name:"erg",base:re.ENERGY,prefixes:Y.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:re.ENERGY,prefixes:Y.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:re.ENERGY,prefixes:Y.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:re.ENERGY,prefixes:Y.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:re.ENERGY,prefixes:Y.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:re.POWER,prefixes:Y.SHORT,value:1,offset:0},watt:{name:"watt",base:re.POWER,prefixes:Y.LONG,value:1,offset:0},hp:{name:"hp",base:re.POWER,prefixes:Y.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:re.POWER,prefixes:Y.SHORT,value:w.I,offset:0},VA:{name:"VA",base:re.POWER,prefixes:Y.SHORT,value:1,offset:0},Pa:{name:"Pa",base:re.PRESSURE,prefixes:Y.SHORT,value:1,offset:0},psi:{name:"psi",base:re.PRESSURE,prefixes:Y.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:re.PRESSURE,prefixes:Y.NONE,value:101325,offset:0},bar:{name:"bar",base:re.PRESSURE,prefixes:Y.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:re.PRESSURE,prefixes:Y.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:re.PRESSURE,prefixes:Y.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:re.PRESSURE,prefixes:Y.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:re.PRESSURE,prefixes:Y.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:re.ELECTRIC_CHARGE,prefixes:Y.LONG,value:1,offset:0},C:{name:"C",base:re.ELECTRIC_CHARGE,prefixes:Y.SHORT,value:1,offset:0},farad:{name:"farad",base:re.ELECTRIC_CAPACITANCE,prefixes:Y.LONG,value:1,offset:0},F:{name:"F",base:re.ELECTRIC_CAPACITANCE,prefixes:Y.SHORT,value:1,offset:0},volt:{name:"volt",base:re.ELECTRIC_POTENTIAL,prefixes:Y.LONG,value:1,offset:0},V:{name:"V",base:re.ELECTRIC_POTENTIAL,prefixes:Y.SHORT,value:1,offset:0},ohm:{name:"ohm",base:re.ELECTRIC_RESISTANCE,prefixes:Y.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:re.ELECTRIC_INDUCTANCE,prefixes:Y.LONG,value:1,offset:0},H:{name:"H",base:re.ELECTRIC_INDUCTANCE,prefixes:Y.SHORT,value:1,offset:0},siemens:{name:"siemens",base:re.ELECTRIC_CONDUCTANCE,prefixes:Y.LONG,value:1,offset:0},S:{name:"S",base:re.ELECTRIC_CONDUCTANCE,prefixes:Y.SHORT,value:1,offset:0},weber:{name:"weber",base:re.MAGNETIC_FLUX,prefixes:Y.LONG,value:1,offset:0},Wb:{name:"Wb",base:re.MAGNETIC_FLUX,prefixes:Y.SHORT,value:1,offset:0},tesla:{name:"tesla",base:re.MAGNETIC_FLUX_DENSITY,prefixes:Y.LONG,value:1,offset:0},T:{name:"T",base:re.MAGNETIC_FLUX_DENSITY,prefixes:Y.SHORT,value:1,offset:0},b:{name:"b",base:re.BIT,prefixes:Y.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:re.BIT,prefixes:Y.BINARY_LONG,value:1,offset:0},B:{name:"B",base:re.BIT,prefixes:Y.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:re.BIT,prefixes:Y.BINARY_LONG,value:8,offset:0}},Ne={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=Cg(D);ce.rad.value=new D(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:ye,prefix:Y.NONE[""]},LENGTH:{unit:ce.m,prefix:Y.SHORT[""]},MASS:{unit:ce.g,prefix:Y.SHORT.k},TIME:{unit:ce.s,prefix:Y.SHORT[""]},CURRENT:{unit:ce.A,prefix:Y.SHORT[""]},TEMPERATURE:{unit:ce.K,prefix:Y.SHORT[""]},LUMINOUS_INTENSITY:{unit:ce.cd,prefix:Y.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:ce.mol,prefix:Y.SHORT[""]},ANGLE:{unit:ce.rad,prefix:Y.SHORT[""]},BIT:{unit:ce.bits,prefix:Y.SHORT[""]},FORCE:{unit:ce.N,prefix:Y.SHORT[""]},ENERGY:{unit:ce.J,prefix:Y.SHORT[""]},POWER:{unit:ce.W,prefix:Y.SHORT[""]},PRESSURE:{unit:ce.Pa,prefix:Y.SHORT[""]},ELECTRIC_CHARGE:{unit:ce.C,prefix:Y.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:ce.F,prefix:Y.SHORT[""]},ELECTRIC_POTENTIAL:{unit:ce.V,prefix:Y.SHORT[""]},ELECTRIC_RESISTANCE:{unit:ce.ohm,prefix:Y.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:ce.H,prefix:Y.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:ce.S,prefix:Y.SHORT[""]},MAGNETIC_FLUX:{unit:ce.Wb,prefix:Y.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:ce.T,prefix:Y.SHORT[""]},FREQUENCY:{unit:ce.Hz,prefix:Y.SHORT[""]}}};Ce.cgs=JSON.parse(JSON.stringify(Ce.si)),Ce.cgs.LENGTH={unit:ce.m,prefix:Y.SHORT.c},Ce.cgs.MASS={unit:ce.g,prefix:Y.SHORT[""]},Ce.cgs.FORCE={unit:ce.dyn,prefix:Y.SHORT[""]},Ce.cgs.ENERGY={unit:ce.erg,prefix:Y.NONE[""]},Ce.us=JSON.parse(JSON.stringify(Ce.si)),Ce.us.LENGTH={unit:ce.ft,prefix:Y.NONE[""]},Ce.us.MASS={unit:ce.lbm,prefix:Y.NONE[""]},Ce.us.TEMPERATURE={unit:ce.degF,prefix:Y.NONE[""]},Ce.us.FORCE={unit:ce.lbf,prefix:Y.NONE[""]},Ce.us.ENERGY={unit:ce.BTU,prefix:Y.BTU[""]},Ce.us.POWER={unit:ce.hp,prefix:Y.NONE[""]},Ce.us.PRESSURE={unit:ce.psi,prefix:Y.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 D(be.n).div(be.d).times(be.s):new D(be+"")},Fraction:function(be){return new b(be)},Complex:function(be){return be},number:function(be){return be!=null&&be.isFraction?N(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 Ne)if(St(Ne,ze)){var We=ce[Ne[ze]],Be={};for(var lt in We)St(We,lt)&&(Be[lt]=We[lt]);Be.name=ze,ce[ze]=Be}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 ve=0;ve"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,ve=[],Re=0,ke,Je,ot;if(be&&be.type==="Unit")Ue=be.clone();else if(typeof be=="string")be!==""&&(ke=be);else if(typeof be=="object")ke=be.definition,Je=be.prefixes,Re=be.offset,ot=be.baseName,be.aliases&&(ve=be.aliases.valueOf());else throw new TypeError('Cannot create unit "'+de+'" from "'+be.toString()+'": expecting "string" or "Unit" or "Object"');if(ve){for(var et=0;et1e-12){pe=!1;break}if(pe){j=!0,ut.base=re[ne];break}}if(!j){ot=ot||de+"_STUFF";var Le={dimensions:Ue.dimensions.slice(0)};Le.key=ot,re[ot]=Le,Oe[ot]={unit:ut,prefix:Y.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 Lt in re)St(re,Lt)&&(re[Lt].dimensions[le.length-1]=0);for(var fe={dimensions:[]},J=0;J{var{typed:t,Unit:r}=e;return t(BB,{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=>Ot(i,n))})});v();x();g();var PB="sparse",ile=["typed","SparseMatrix"],RB=K(PB,ile,e=>{var{typed:t,SparseMatrix:r}=e;return t(PB,{"":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)}})});v();x();g();var qB="createUnit",ole=["typed","Unit"],zB=K(qB,ole,e=>{var{typed:t,Unit:r}=e;return t(qB,{"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,{})}})});v();x();g();var UB="acos",ale=["typed","config","Complex"],HB=K(UB,ale,e=>{var{typed:t,config:r,Complex:n}=e;return t(UB,{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()}})});v();x();g();var $B="acosh",sle=["typed","config","Complex"],WB=K($B,sle,e=>{var{typed:t,config:r,Complex:n}=e;return t($B,{number:function(o){return o>=1||r.predictable?eA(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()}})});v();x();g();var VB="acot",ule=["typed","BigNumber"],GB=K(VB,ule,e=>{var{typed:t,BigNumber:r}=e;return t(VB,{number:tA,Complex:function(i){return i.acot()},BigNumber:function(i){return new r(1).div(i).atan()}})});v();x();g();var YB="acoth",lle=["typed","config","Complex","BigNumber"],ZB=K(YB,lle,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(YB,{number:function(u){return u>=1||u<=-1||r.predictable?rA(u):new n(u,0).acoth()},Complex:function(u){return u.acoth()},BigNumber:function(u){return new i(1).div(u).atanh()}})});v();x();g();var XB="acsc",fle=["typed","config","Complex","BigNumber"],KB=K(XB,fle,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(XB,{number:function(u){return u<=-1||u>=1||r.predictable?nA(u):new n(u,0).acsc()},Complex:function(u){return u.acsc()},BigNumber:function(u){return new i(1).div(u).asin()}})});v();x();g();var JB="acsch",cle=["typed","BigNumber"],QB=K(JB,cle,e=>{var{typed:t,BigNumber:r}=e;return t(JB,{number:iA,Complex:function(i){return i.acsch()},BigNumber:function(i){return new r(1).div(i).asinh()}})});v();x();g();var jB="asec",ple=["typed","config","Complex","BigNumber"],eL=K(jB,ple,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(jB,{number:function(u){return u<=-1||u>=1||r.predictable?oA(u):new n(u,0).asec()},Complex:function(u){return u.asec()},BigNumber:function(u){return new i(1).div(u).acos()}})});v();x();g();var tL="asech",mle=["typed","config","Complex","BigNumber"],rL=K(tL,mle,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(tL,{number:function(u){if(u<=1&&u>=-1||r.predictable){var l=1/u;if(l>0||r.predictable)return aA(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()}})});v();x();g();var nL="asin",hle=["typed","config","Complex"],iL=K(nL,hle,e=>{var{typed:t,config:r,Complex:n}=e;return t(nL,{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()}})});v();x();g();var dle="asinh",vle=["typed"],oL=K(dle,vle,e=>{var{typed:t}=e;return t("asinh",{number:sA,Complex:function(n){return n.asinh()},BigNumber:function(n){return n.asinh()}})});v();x();g();var gle="atan",xle=["typed"],aL=K(gle,xle,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()}})});v();x();g();var sL="atan2",yle=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],uL=K(sL,yle,e=>{var{typed:t,matrix:r,equalScalar:n,BigNumber:i,DenseMatrix:o,concat:u}=e,l=Zn({typed:t,equalScalar:n}),a=Kr({typed:t}),s=Gy({typed:t,equalScalar:n}),f=Lr({typed:t,equalScalar:n}),p=Sr({typed:t,DenseMatrix:o}),h=er({typed:t,matrix:r,concat:u});return t(sL,{"number, number":Math.atan2,"BigNumber, BigNumber":(y,N)=>i.atan2(y,N)},h({scalar:"number | BigNumber",SS:s,DS:a,SD:l,Ss:f,sS:p}))});v();x();g();var lL="atanh",wle=["typed","config","Complex"],fL=K(lL,wle,e=>{var{typed:t,config:r,Complex:n}=e;return t(lL,{number:function(o){return o<=1&&o>=-1||r.predictable?uA(o):new n(o,0).atanh()},Complex:function(o){return o.atanh()},BigNumber:function(o){return o.atanh()}})});v();x();g();v();x();g();var Wa=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 cL="cos",ble=["typed"],pL=K(cL,ble,e=>{var{typed:t}=e,r=Wa({typed:t});return t(cL,{number:Math.cos,"Complex | BigNumber":n=>n.cos()},r)});v();x();g();var mL="cosh",Dle=["typed"],hL=K(mL,Dle,e=>{var{typed:t}=e;return t(mL,{number:Ey,"Complex | BigNumber":r=>r.cosh()})});v();x();g();var dL="cot",Nle=["typed","BigNumber"],vL=K(dL,Nle,e=>{var{typed:t,BigNumber:r}=e,n=Wa({typed:t});return t(dL,{number:lA,Complex:i=>i.cot(),BigNumber:i=>new r(1).div(i.tan())},n)});v();x();g();var gL="coth",Ele=["typed","BigNumber"],xL=K(gL,Ele,e=>{var{typed:t,BigNumber:r}=e;return t(gL,{number:fA,Complex:n=>n.coth(),BigNumber:n=>new r(1).div(n.tanh())})});v();x();g();var yL="csc",Sle=["typed","BigNumber"],wL=K(yL,Sle,e=>{var{typed:t,BigNumber:r}=e,n=Wa({typed:t});return t(yL,{number:cA,Complex:i=>i.csc(),BigNumber:i=>new r(1).div(i.sin())},n)});v();x();g();var bL="csch",Ale=["typed","BigNumber"],DL=K(bL,Ale,e=>{var{typed:t,BigNumber:r}=e;return t(bL,{number:pA,Complex:n=>n.csch(),BigNumber:n=>new r(1).div(n.sinh())})});v();x();g();var NL="sec",Cle=["typed","BigNumber"],EL=K(NL,Cle,e=>{var{typed:t,BigNumber:r}=e,n=Wa({typed:t});return t(NL,{number:mA,Complex:i=>i.sec(),BigNumber:i=>new r(1).div(i.cos())},n)});v();x();g();var SL="sech",Mle=["typed","BigNumber"],AL=K(SL,Mle,e=>{var{typed:t,BigNumber:r}=e;return t(SL,{number:hA,Complex:n=>n.sech(),BigNumber:n=>new r(1).div(n.cosh())})});v();x();g();var CL="sin",Tle=["typed"],ML=K(CL,Tle,e=>{var{typed:t}=e,r=Wa({typed:t});return t(CL,{number:Math.sin,"Complex | BigNumber":n=>n.sin()},r)});v();x();g();var TL="sinh",Ole=["typed"],OL=K(TL,Ole,e=>{var{typed:t}=e;return t(TL,{number:dA,"Complex | BigNumber":r=>r.sinh()})});v();x();g();var IL="tan",Ile=["typed"],FL=K(IL,Ile,e=>{var{typed:t}=e,r=Wa({typed:t});return t(IL,{number:Math.tan,"Complex | BigNumber":n=>n.tan()},r)});v();x();g();var Fle="tanh",_le=["typed"],_L=K(Fle,_le,e=>{var{typed:t}=e;return t("tanh",{number:Sy,"Complex | BigNumber":r=>r.tanh()})});v();x();g();var kL="setCartesian",kle=["typed","size","subset","compareNatural","Index","DenseMatrix"],BL=K(kL,kle,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:u}=e;return t(kL,{"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=rr(Array.isArray(a)?a:a.toArray()).sort(i),h=rr(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(LL,{"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 rr(a.toArray());var p=xl(rr(Array.isArray(a)?a:a.toArray()).sort(i)),h=xl(rr(Array.isArray(s)?s:s.toArray()).sort(i));f=[];for(var y,N=0;N{var{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:u}=e;return t(RL,{"Array | Matrix":function(a){var s;if(n(r(a),new o(0))===0)s=[];else{var f=rr(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(zL,{"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(rr(Array.isArray(a)?a:a.toArray()).sort(i)),h=xl(rr(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(HL,{"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(rr(Array.isArray(l)?l:l.toArray()).sort(i)),f=xl(rr(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(WL,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(l,a){if(n(r(a),new o(0))===0)return 0;for(var s=rr(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(GL,{"Array | Matrix":function(s){if(n(r(s),new o(0))===0)return[];for(var f=rr(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}});v();x();g();var ZL="setSize",Ule=["typed","compareNatural"],XL=K(ZL,Ule,e=>{var{typed:t,compareNatural:r}=e;return t(ZL,{"Array | Matrix":function(i){return Array.isArray(i)?rr(i).length:rr(i.toArray()).length},"Array | Matrix, boolean":function(i,o){if(o===!1||i.length===0)return Array.isArray(i)?rr(i).length:rr(i.toArray()).length;for(var u=rr(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(KL,{"Array | Matrix, Array | Matrix":function(a,s){if(i(r(a),new u(0))===0)return rr(s);if(i(r(s),new u(0))===0)return rr(a);var f=rr(a),p=rr(s);return n(o(f,p),o(p,f))}})});v();x();g();var QL="setUnion",$le=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],jL=K(QL,$le,e=>{var{typed:t,size:r,concat:n,subset:i,setIntersect:o,setSymDifference:u,Index:l}=e;return t(QL,{"Array | Matrix, Array | Matrix":function(s,f){if(i(r(s),new l(0))===0)return rr(f);if(i(r(f),new l(0))===0)return rr(s);var p=rr(s),h=rr(f);return n(u(p,h),o(p,h))}})});v();x();g();var e6="add",Wle=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],t6=K(e6,Wle,e=>{var{typed:t,matrix:r,addScalar:n,equalScalar:i,DenseMatrix:o,SparseMatrix:u,concat:l}=e,a=co({typed:t}),s=xh({typed:t,equalScalar:i}),f=$o({typed:t,DenseMatrix:o}),p=er({typed:t,matrix:r,concat:l});return t(e6,{"any, any":n,"any, any, ...any":t.referToSelf(h=>(y,N,w)=>{for(var D=h(y,N),b=0;b{var{typed:t,abs:r,addScalar:n,divideScalar:i,multiplyScalar:o,sqrt:u,smaller:l,isPositive:a}=e;return t(r6,{"... number | BigNumber":s,Array:s,Matrix:f=>s(rr(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(i6,{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 N(P){var R=0;return P.forEach(function(q){var z=r(q);s(z,R)&&(R=z)},!0),R}function w(P){var R;return P.forEach(function(q){var z=r(q);(!R||f(z,R))&&(R=z)},!0),R||0}function D(P,R){if(R===Number.POSITIVE_INFINITY||R==="inf")return N(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(z){q=n(i(r(z),R),q)},!0),i(q,1/R)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function b(P){var R=0;return P.forEach(function(q,z){R=n(R,l(q,o(q)))}),r(u(R))}function O(P){var R=[],q=0;return P.forEach(function(z,H){var V=H[1],W=n(R[V]||0,r(z));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),z=l(q,P),H=y(z).values.toArray(),V=H[H.length-1];return r(u(V))}function I(P){var R=[],q=0;return P.forEach(function(z,H){var V=H[0],W=n(R[V]||0,r(z));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 b(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 D(P,R);if(q.length===2){if(q[0]&&q[1])return F(P,R);throw new RangeError("Invalid matrix dimensions")}}});v();x();g();var a6="dot",Yle=["typed","addScalar","multiplyScalar","conj","size"],s6=K(a6,Yle,e=>{var{typed:t,addScalar:r,multiplyScalar:n,conj:i,size:o}=e;return t(a6,{"Array | DenseMatrix, Array | DenseMatrix":l,"SparseMatrix, SparseMatrix":a});function u(f,p){var h=s(f),y=s(p),N,w;if(h.length===1)N=h[0];else if(h.length===2&&h[1]===1)N=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(N!==w)throw new RangeError("Vectors must have equal length ("+N+" != "+w+")");if(N===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return N}function l(f,p){var h=u(f,p),y=Et(f)?f._data:f,N=Et(f)?f._datatype||f.getDataType():void 0,w=Et(p)?p._data:p,D=Et(p)?p._datatype||p.getDataType():void 0,b=s(f).length===2,O=s(p).length===2,M=r,I=n;if(N&&D&&N===D&&typeof N=="string"&&N!=="mixed"){var F=N;M=t.find(r,[F,F]),I=t.find(n,[F,F])}if(!b&&!O){for(var C=I(i(y[0]),w[0]),P=1;PC){I++;continue}F===C&&(D=b(D,O(y[M],w[I])),M++,I++)}return D}function s(f){return Et(f)?f.size():o(f)}});v();x();g();var Zle="trace",Xle=["typed","matrix","add"],u6=K(Zle,Xle,e=>{var{typed:t,matrix:r,add:n}=e;return t("trace",{Array:function(l){return i(r(l))},SparseMatrix:o,DenseMatrix:i,any:Bt});function i(u){var l=u._size,a=u._data;switch(l.length){case 1:if(l[0]===1)return Bt(a[0]);throw new RangeError("Matrix must be square (size: "+Zt(l)+")");case 2:{var s=l[0],f=l[1];if(s===f){for(var p=0,h=0;h0)for(var N=0;NN)break}return y}throw new RangeError("Matrix must be square (size: "+Zt(f)+")")}});v();x();g();var l6="index",Kle=["typed","Index"],f6=K(l6,Kle,e=>{var{typed:t,Index:r}=e;return t(l6,{"...number | string | BigNumber | Range | Array | Matrix":function(i){var o=i.map(function(l){return _t(l)?l.toNumber():fr(l)||Et(l)?l.map(function(a){return _t(a)?a.toNumber():a}):l}),u=new r;return r.apply(u,o),u}})});v();x();g();v();x();g();var xw=new Set(["end"]);var Jle="Node",Qle=["mathWithTransform"],c6=K(Jle,Qle,e=>{var{mathWithTransform:t}=e;function r(i){for(var o of[...xw])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=yl(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(!lr(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&&Cs(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});v();x();g();v();x();g();v();x();g();function Jr(e){return e&&e.isIndexError?new bi(e.index+1,e.min+1,e.max!==void 0?e.max+1:void 0):e}function yw(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 ww="AccessorNode",jle=["subset","Node"],p6=K(ww,jle,e=>{var{subset:t,Node:r}=e,n=yw({subset:t});function i(u){return!(To(u)||xi(u)||ir(u)||Ki(u)||Nu(u)||yi(u)||Rr(u))}class o extends r{constructor(l,a){if(super(),!lr(l))throw new TypeError('Node expected for parameter "object"');if(!qo(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 ww}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,N,w){return fn(s(y,N,w),p)}}else return function(y,N,w){var D=s(y,N,w),b=f(y,N,D);return n(D,b)}}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:ww,object:this.object,index:this.index}}static fromJSON(l){return new o(l.object,l.index)}}return Cr(o,"name",ww),o},{isClass:!0,isNode:!0});v();x();g();var bw="ArrayNode",efe=["Node"],m6=K(bw,efe,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),this.items=i||[],!Array.isArray(this.items)||!this.items.every(lr))throw new TypeError("Array containing Nodes expected")}get type(){return bw}get isArrayNode(){return!0}_compile(i,o){var u=zo(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(zo(u,function(y){return y(f,p,h)}))}}else return function(f,p,h){return zo(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(xi)&&!u.every(xi),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 Cr(r,"name",bw),r},{isClass:!0,isNode:!0});v();x();g();v();x();g();function h6(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)}}}v();x();g();var Va=[{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 Dw(e,t){if(!t||t!=="auto")return e;for(var r=e;yi(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=yw({subset:t}),o=h6({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,!Rr(s)&&!To(s))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(Rr(s)&&s.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!qo(this.index))throw new TypeError('IndexNode expected as "index"');if(!lr(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 Ew}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),N=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(Rr(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(N,o(P,q,R)),R};var D=this.object.object._compile(s,f);if(this.object.index.isObjectProperty()){var b=this.object.index.getObjectProperty();return function(I,F,C){var P=D(I,F,C),R=fn(P,b),q=h(I,F,R),z=y(I,F,C);return Eu(P,b,o(R,q,z)),z}}else{var O=this.object.index._compile(s,f);return function(I,F,C){var P=D(I,F,C),R=O(I,F,P),q=i(P,R),z=h(I,F,q),H=y(I,F,C);return o(P,R,o(q,z,H)),H}}}else{if(!Rr(this.object))throw new TypeError("SymbolNode expected as object");return function(I,F,C){var P=y(I,F,C);return I.set(N,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:Ew,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 Cr(l,"name",Ew),l},{isClass:!0,isNode:!0});v();x();g();var Sw="BlockNode",rfe=["ResultSet","Node"],g6=K(Sw,rfe,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(!lr(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 Sw}get isBlockNode(){return!0}_compile(o,u){var l=zo(this.blocks,function(a){return{evaluate:a.node._compile(o,u),visible:a.visible}});return function(s,f,p){var h=[];return Df(l,function(N){var w=N.evaluate(s,f,p);N.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 Cr(n,"name",Sw),n},{isClass:!0,isNode:!0});v();x();g();var Aw="ConditionalNode",nfe=["Node"],x6=K(Aw,nfe,e=>{var{Node:t}=e;function r(i){if(typeof i=="number"||typeof i=="boolean"||typeof i=="string")return!!i;if(i){if(_t(i))return!i.isZero();if(gi(i))return!!(i.re||i.im);if(ri(i))return!!i.value}if(i==null)return!1;throw new TypeError('Unsupported type of condition "'+hr(i)+'"')}class n extends t{constructor(o,u,l){if(super(),!lr(o))throw new TypeError("Parameter condition must be a Node");if(!lr(u))throw new TypeError("Parameter trueExpr must be a Node");if(!lr(l))throw new TypeError("Parameter falseExpr must be a Node");this.condition=o,this.trueExpr=u,this.falseExpr=l}get type(){return Aw}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:Aw,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 Cr(n,"name",Aw),n},{isClass:!0,isNode:!0});v();x();g();v();x();g();var D6=en(w6(),1);var TA={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{?}"},Mr={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"},OA={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(Mr.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(Mr.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(Mr.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(Mr.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(Mr.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(Mr.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(Mr.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(Mr.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(Mr.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(Mr.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(Mr.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(Mr.bitAnd,"${args[1]}\\right)")},bitNot:{1:Mr.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(Mr.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(Mr.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(Mr.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(Mr.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(Mr.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(Mr.and,"${args[1]}\\right)")},not:{1:Mr.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(Mr.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(Mr.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(Mr.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(Mr.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(Mr.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(Mr.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(Mr.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(Mr.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(Mr.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(Mr.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(Mr.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(Mr.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(Mr.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)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(TA.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)"}},N6="\\mathrm{${name}}\\left(${args}\\right)",b6={deg:"^\\circ"};function Cw(e){return(0,D6.default)(e,{preserveFormatting:!0})}function Mw(e,t){return t=typeof t>"u"?!1:t,t?St(b6,e)?b6[e]:"\\mathrm{"+Cw(e)+"}":St(TA,e)?TA[e]:Cw(e)}var Tw="ConstantNode",sfe=["Node"],E6=K(Tw,sfe,e=>{var{Node:t}=e;class r extends t{constructor(i){super(),this.value=i}get type(){return Tw}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 Zt(this.value,i)}_toHTML(i){var o=this._toString(i);switch(hr(this.value)){case"number":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:Tw,value:this.value}}static fromJSON(i){return new r(i.value)}_toTex(i){var o=this._toString(i),u=hr(this.value);switch(u){case"string":return"\\mathtt{"+Cw(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"Fraction":return this.value.toLatex();default:return o}}}return Cr(r,"name",Tw),r},{isClass:!0,isNode:!0});v();x();g();var Ow="FunctionAssignmentNode",ufe=["typed","Node"],S6=K(Ow,ufe,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(!lr(a))throw new TypeError('Node expected for parameter "expr"');if(xw.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 Ow}get isFunctionAssignmentNode(){return!0}_compile(u,l){var a=Object.create(l);Df(this.params,function(N){a[N]=!0});var s=this.expr._compile(u,a),f=this.name,p=this.params,h=oS(this.types,","),y=f+"("+oS(this.params,", ")+")";return function(w,D,b){var O={};O[h]=function(){for(var I=Object.create(D),F=0;F'+wi(this.params[s])+"");var f=this.expr.toHTML(u);return n(this,l,u&&u.implicit)&&(f='('+f+')'),''+wi(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(Mw).join(",")+"\\right)="+a}}return Cr(i,"name",Ow),i},{isClass:!0,isNode:!0});v();x();g();var Iw="IndexNode",lfe=["Node","size"],A6=K(Iw,lfe,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(lr))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 Iw}get isIndexNode(){return!0}_compile(o,u){var l=zo(this.dimensions,function(s,f){var p=s.filter(N=>N.isSymbolNode&&N.name==="end").length>0;if(p){var h=Object.create(u);h.end=!0;var y=s._compile(o,h);return function(w,D,b){if(!Et(b)&&!fr(b)&&!dn(b))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+hr(b));var O=r(b).valueOf(),M=Object.create(D);return M.end=O[f],y(w,M,b)}}else return s._compile(o,u)}),a=fn(o,"index");return function(f,p,h){var y=zo(l,function(N){return N(f,p,h)});return a(...y)}}forEach(o){for(var u=0;u.'+wi(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 Cr(n,"name",Iw),n},{isClass:!0,isNode:!0});v();x();g();var Fw="ObjectNode",ffe=["Node"],C6=K(Fw,ffe,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 lr(i[o])})))throw new TypeError("Object containing Nodes expected")}get type(){return Fw}get isObjectNode(){return!0}_compile(i,o){var u={};for(var l in this.properties)if(St(this.properties,l)){var a=op(l),s=JSON.parse(a),f=fn(this.properties,l);u[s]=f._compile(i,o)}return function(h,y,N){var w={};for(var D in u)St(u,D)&&(w[D]=u[D](h,y,N));return w}}forEach(i){for(var o in this.properties)St(this.properties,o)&&i(this.properties[o],"properties["+op(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["+op(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(op(u)+": "+this.properties[u].toString(i));return"{"+o.join(", ")+"}"}toJSON(){return{mathjs:Fw,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(''+wi(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 Cr(r,"name",Fw),r},{isClass:!0,isNode:!0});v();x();g();v();x();g();function mp(e,t){return new ch(e,new up(t),new Set(Object.keys(t)))}var _w="OperatorNode",cfe=["Node"],M6=K(_w,cfe,e=>{var{Node:t}=e;function r(o,u){var l=o;if(u==="auto")for(;yi(l);)l=l.content;return ir(l)?!0:Xr(l)?r(l.args[0],u):!1}function n(o,u,l,a,s){var f=_r(o,u,l),p=Sh(o,u);if(u==="all"||a.length>2&&o.getIdentifier()!=="OperatorNode:add"&&o.getIdentifier()!=="OperatorNode:multiply")return a.map(function(z){switch(z.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 N,w;if(u==="keep"?(N=a[0].getIdentifier(),w=o.getIdentifier()):(N=a[0].getContent().getIdentifier(),w=o.getContent().getIdentifier()),Va[f][w].latexLeftParens===!1){h=[!1];break}if(Va[y][N].latexParens===!1){h=[!1];break}}if(y===null){h=[!1];break}if(y<=f){h=[!0];break}h=[!1]}break;case 2:{var D,b=_r(a[0],u,l,o),O=Nw(o,a[0],u);b===null?D=!1:b===f&&p==="right"&&!O||b=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 D=s.map(function(b,O){return b=b.toString(u),f[O]&&(b="("+b+")"),b});return this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&a==="hide"?D.join(" "):D.join(" "+this.op+" ")}else return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:_w,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=Sh(this,l),h=s[0].toHTML(u);return f[0]&&(h='('+h+')'),p==="right"?''+wi(this.op)+""+h:h+''+wi(this.op)+""}else if(s.length===2){var y=s[0].toHTML(u),N=s[1].toHTML(u);return f[0]&&(y='('+y+')'),f[1]&&(N='('+N+')'),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&a==="hide"?y+''+N:y+''+wi(this.op)+""+N}else{var w=s.map(function(D,b){return D=D.toHTML(u),f[b]&&(D='('+D+')'),D});return s.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")?this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&a==="hide"?w.join(''):w.join(''+wi(this.op)+""):''+wi(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=Mr[this.fn];if(p=typeof p>"u"?this.op:p,s.length===1){var h=Sh(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 N=s[0],w=N.toTex(u);f[0]&&(w="\\left(".concat(w,"\\right)"));var D=s[1],b=D.toTex(u);f[1]&&(b="\\left(".concat(b,"\\right)"));var O;switch(l==="keep"?O=N.getIdentifier():O=N.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return p+"{"+w+"}{"+b+"}";case"OperatorNode:pow":switch(w="{"+w+"}",b="{"+b+"}",O){case"ConditionalNode":case"OperatorNode:divide":w="\\left(".concat(w,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&a==="hide")return w+"~"+b}return w+p+b}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 Cr(i,"name",_w),i},{isClass:!0,isNode:!0});v();x();g();var kw="ParenthesisNode",pfe=["Node"],T6=K(kw,pfe,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),!lr(i))throw new TypeError('Node expected for parameter "content"');this.content=i}get type(){return kw}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:kw,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 Cr(r,"name",kw),r},{isClass:!0,isNode:!0});v();x();g();var Bw="RangeNode",mfe=["Node"],O6=K(Bw,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(),!lr(o))throw new TypeError("Node expected");if(!lr(u))throw new TypeError("Node expected");if(l&&!lr(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 Bw}get isRangeNode(){return!0}needsEnd(){var o=this.filter(function(u){return Rr(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,N){return l(a(h,y,N),s(h,y,N),f(h,y,N))}}else return function(h,y,N){return l(a(h,y,N),s(h,y,N))}}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:Bw,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 Cr(n,"name",Bw),n},{isClass:!0,isNode:!0});v();x();g();var Lw="RelationalNode",hfe=["Node"],I6=K(Lw,hfe,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 Lw}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,N=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'+wi(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=wi(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=Mw(this.name,a);return s[0]==="\\"?s:" "+s}}return o},{isClass:!0,isNode:!0});v();x();g();var Pw="FunctionNode",gfe=["math","Node","SymbolNode"],_6=K(Pw,gfe,e=>{var t,{math:r,Node:n,SymbolNode:i}=e,o=a=>Zt(a,{truncate:78});function u(a,s,f){for(var p="",h=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,y=0,N;(N=h.exec(a))!==null;)if(p+=a.substring(y,N.index),y=N.index,N[0]==="$$")p+="$",y++;else{y+=N[0].length;var w=s[N[1]];if(!w)throw new ReferenceError("Template: Property "+N[1]+" does not exist.");if(N[2]===void 0)switch(typeof w){case"string":p+=w;break;case"object":if(lr(w))p+=w.toTex(f);else if(Array.isArray(w))p+=w.map(function(D,b){if(lr(D))return D.toTex(f);throw new TypeError("Template: "+N[1]+"["+b+"] is not a Node.")}).join(",");else throw new TypeError("Template: "+N[1]+" has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: "+N[1]+" has to be a Node, String or array of Nodes")}else if(lr(w[N[2]]&&w[N[2]]))p+=w[N[2]].toTex(f);else throw new TypeError("Template: "+N[1]+"["+N[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)),!lr(s))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(f)||!f.every(lr))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 Pw}get isFunctionNode(){return!0}_compile(s,f){var p=this.args.map(R=>R._compile(s,f));if(Rr(this.fn)){var h=this.fn.name;if(f[h]){var b=this.args;return function(q,z,H){var V=fn(z,h);if(typeof V!="function")throw new TypeError("Argument '".concat(h,"' was not a function; received: ").concat(o(V)));if(V.rawArgs)return V(b,s,mp(q,z));var W=p.map(ee=>ee(q,z,H));return V.apply(V,W)}}else{var y=h in s?fn(s,h):void 0,N=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(N){var D=this.args;return function(q,z,H){var V=w(q);return V(D,s,mp(q,z))}}else switch(p.length){case 0:return function(q,z,H){var V=w(q);return V()};case 1:return function(q,z,H){var V=w(q),W=p[0];return V(W(q,z,H))};case 2:return function(q,z,H){var V=w(q),W=p[0],ee=p[1];return V(W(q,z,H),ee(q,z,H))};default:return function(q,z,H){var V=w(q),W=p.map(ee=>ee(q,z,H));return V(...W)}}}}else if(To(this.fn)&&qo(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,z,H){var V=O(q,z,H),W=vF(V,M);if(W!=null&&W.rawArgs)return W(I,s,mp(q,z));var ee=p.map(ie=>ie(q,z,H));return W.apply(V,ee)}}else{var F=this.fn.toString(),C=this.fn._compile(s,f),P=this.args;return function(q,z,H){var V=C(q,z,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,mp(q,z));var W=p.map(ee=>ee(q,z,H));return V.apply(V,W)}}}forEach(s){s(this.fn,"fn",this);for(var f=0;f'+wi(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(y){return y.toTex(s)}),p;OA[this.name]&&(p=OA[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(N6,this,s)}getIdentifier(){return this.type+":"+this.name}}return t=l,Cr(l,"name",Pw),Cr(l,"onUndefinedFunction",function(a){throw new Error("Undefined function "+a)}),Cr(l,"fromJSON",function(a){return new t(a.fn,a.args)}),l},{isClass:!0,isNode:!0});v();x();g();var k6="parse",xfe=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],B6=K(k6,xfe,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:N,ParenthesisNode:w,RangeNode:D,RelationalNode:b,SymbolNode:O}=e,M=t(k6,{string:function(xe){return De(xe,{})},"Array | Matrix":function(xe){return I(xe,{})},"string, Object":function(xe,Ye){var tt=Ye.nodes!==void 0?Ye.nodes:{};return De(xe,tt)},"Array | Matrix, Object":I});function I(Z){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ye=xe.nodes!==void 0?xe.nodes:{};return Ot(Z,function(tt){if(typeof tt!="string")throw new TypeError("String expected");return De(tt,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"],z={'"':'"',"'":"'","\\":"\\","/":"/",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(Z,xe){return Z.expression.substr(Z.index,xe)}function W(Z){return V(Z,1)}function ee(Z){Z.index++}function ie(Z){return Z.expression.charAt(Z.index-1)}function X(Z){return Z.expression.charAt(Z.index+1)}function Y(Z){for(Z.tokenType=F.NULL,Z.token="",Z.comment="";;){if(W(Z)==="#")for(;W(Z)!==` +`&&W(Z)!=="";)Z.comment+=W(Z),ee(Z);if(M.isWhitespace(W(Z),Z.nestingLevel))ee(Z);else break}if(W(Z)===""){Z.tokenType=F.DELIMITER;return}if(W(Z)===` +`&&!Z.nestingLevel){Z.tokenType=F.DELIMITER,Z.token=W(Z),ee(Z);return}var xe=W(Z),Ye=V(Z,2),tt=V(Z,3);if(tt.length===3&&C[tt]){Z.tokenType=F.DELIMITER,Z.token=tt,ee(Z),ee(Z),ee(Z);return}if(Ye.length===2&&C[Ye]){Z.tokenType=F.DELIMITER,Z.token=Ye,ee(Z),ee(Z);return}if(C[xe]){Z.tokenType=F.DELIMITER,Z.token=xe,ee(Z);return}if(M.isDigitDot(xe)){Z.tokenType=F.NUMBER;var wt=V(Z,2);if(wt==="0b"||wt==="0o"||wt==="0x"){for(Z.token+=W(Z),ee(Z),Z.token+=W(Z),ee(Z);M.isHexDigit(W(Z));)Z.token+=W(Z),ee(Z);if(W(Z)===".")for(Z.token+=".",ee(Z);M.isHexDigit(W(Z));)Z.token+=W(Z),ee(Z);else if(W(Z)==="i")for(Z.token+="i",ee(Z);M.isDigit(W(Z));)Z.token+=W(Z),ee(Z);return}if(W(Z)==="."){if(Z.token+=W(Z),ee(Z),!M.isDigit(W(Z))){Z.tokenType=F.DELIMITER;return}}else{for(;M.isDigit(W(Z));)Z.token+=W(Z),ee(Z);M.isDecimalMark(W(Z),X(Z))&&(Z.token+=W(Z),ee(Z))}for(;M.isDigit(W(Z));)Z.token+=W(Z),ee(Z);if(W(Z)==="E"||W(Z)==="e"){if(M.isDigit(X(Z))||X(Z)==="-"||X(Z)==="+"){if(Z.token+=W(Z),ee(Z),(W(Z)==="+"||W(Z)==="-")&&(Z.token+=W(Z),ee(Z)),!M.isDigit(W(Z)))throw Xe(Z,'Digit expected, got "'+W(Z)+'"');for(;M.isDigit(W(Z));)Z.token+=W(Z),ee(Z);if(M.isDecimalMark(W(Z),X(Z)))throw Xe(Z,'Digit expected, got "'+W(Z)+'"')}else if(X(Z)===".")throw ee(Z),Xe(Z,'Digit expected, got "'+W(Z)+'"')}return}if(M.isAlpha(W(Z),ie(Z),X(Z))){for(;M.isAlpha(W(Z),ie(Z),X(Z))||M.isDigit(W(Z));)Z.token+=W(Z),ee(Z);St(P,Z.token)?Z.tokenType=F.DELIMITER:Z.tokenType=F.SYMBOL;return}for(Z.tokenType=F.UNKNOWN;W(Z)!=="";)Z.token+=W(Z),ee(Z);throw Xe(Z,'Syntax error in part "'+Z.token+'"')}function le(Z){do Y(Z);while(Z.token===` +`)}function re(Z){Z.nestingLevel++}function he(Z){Z.nestingLevel--}M.isAlpha=function(xe,Ye,tt){return M.isValidLatinOrGreek(xe)||M.isValidMathSymbol(xe,tt)||M.isValidMathSymbol(Ye,xe)},M.isValidLatinOrGreek=function(xe){return/^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(xe)},M.isValidMathSymbol=function(xe,Ye){return/^[\uD835]$/.test(xe)&&/^[\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(xe,Ye){return xe===" "||xe===" "||xe===` +`&&Ye>0},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(Z,xe){var Ye=H();Un(Ye,{expression:Z,extraNodes:xe}),Y(Ye);var tt=ye(Ye);if(Ye.token!=="")throw Ye.tokenType===F.DELIMITER?pt(Ye,"Unexpected operator "+Ye.token):Xe(Ye,'Unexpected part "'+Ye.token+'"');return tt}function ye(Z){var xe,Ye=[],tt;for(Z.token!==""&&Z.token!==` +`&&Z.token!==";"&&(xe=ce(Z),Z.comment&&(xe.comment=Z.comment));Z.token===` +`||Z.token===";";)Ye.length===0&&xe&&(tt=Z.token!==";",Ye.push({node:xe,visible:tt})),Y(Z),Z.token!==` +`&&Z.token!==";"&&Z.token!==""&&(xe=ce(Z),Z.comment&&(xe.comment=Z.comment),tt=Z.token!==";",Ye.push({node:xe,visible:tt}));return Ye.length>0?new l(Ye):(xe||(xe=new s(void 0),Z.comment&&(xe.comment=Z.comment)),xe)}function ce(Z){var xe,Ye,tt,wt,kt=Ne(Z);if(Z.token==="="){if(Rr(kt))return xe=kt.name,le(Z),tt=ce(Z),new u(new O(xe),tt);if(To(kt))return le(Z),tt=ce(Z),new u(kt.object,kt.index,tt);if(Ki(kt)&&Rr(kt.fn)&&(wt=!0,Ye=[],xe=kt.name,kt.args.forEach(function(ur,Gr){Rr(ur)?Ye[Gr]=ur.name:wt=!1}),wt))return le(Z),tt=ce(Z),new f(xe,Ye,tt);throw Xe(Z,"Invalid left hand side of assignment operator =")}return kt}function Ne(Z){for(var xe=Pe(Z);Z.token==="?";){var Ye=Z.conditionalLevel;Z.conditionalLevel=Z.nestingLevel,le(Z);var tt=xe,wt=ce(Z);if(Z.token!==":")throw Xe(Z,"False part of conditional expression expected");Z.conditionalLevel=null,le(Z);var kt=ce(Z);xe=new a(tt,wt,kt),Z.conditionalLevel=Ye}return xe}function Pe(Z){for(var xe=Ce(Z);Z.token==="or";)le(Z),xe=new N("or","or",[xe,Ce(Z)]);return xe}function Ce(Z){for(var xe=Oe(Z);Z.token==="xor";)le(Z),xe=new N("xor","xor",[xe,Oe(Z)]);return xe}function Oe(Z){for(var xe=He(Z);Z.token==="and";)le(Z),xe=new N("and","and",[xe,He(Z)]);return xe}function He(Z){for(var xe=Se(Z);Z.token==="|";)le(Z),xe=new N("|","bitOr",[xe,Se(Z)]);return xe}function Se(Z){for(var xe=ze(Z);Z.token==="^|";)le(Z),xe=new N("^|","bitXor",[xe,ze(Z)]);return xe}function ze(Z){for(var xe=We(Z);Z.token==="&";)le(Z),xe=new N("&","bitAnd",[xe,We(Z)]);return xe}function We(Z){for(var xe=[Be(Z)],Ye=[],tt={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};St(tt,Z.token);){var wt={name:Z.token,fn:tt[Z.token]};Ye.push(wt),le(Z),xe.push(Be(Z))}return xe.length===1?xe[0]:xe.length===2?new N(Ye[0].name,Ye[0].fn,xe):new b(Ye.map(kt=>kt.fn),xe)}function Be(Z){var xe,Ye,tt,wt;xe=lt(Z);for(var kt={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};St(kt,Z.token);)Ye=Z.token,tt=kt[Ye],le(Z),wt=[xe,lt(Z)],xe=new N(Ye,tt,wt);return xe}function lt(Z){var xe,Ye,tt,wt;xe=ct(Z);for(var kt={to:"to",in:"to"};St(kt,Z.token);)Ye=Z.token,tt=kt[Ye],le(Z),Ye==="in"&&Z.token===""?xe=new N("*","multiply",[xe,new O("in")],!0):(wt=[xe,ct(Z)],xe=new N(Ye,tt,wt));return xe}function ct(Z){var xe,Ye=[];if(Z.token===":"?xe=new s(1):xe=de(Z),Z.token===":"&&Z.conditionalLevel!==Z.nestingLevel){for(Ye.push(xe);Z.token===":"&&Ye.length<3;)le(Z),Z.token===")"||Z.token==="]"||Z.token===","||Z.token===""?Ye.push(new O("end")):Ye.push(de(Z));Ye.length===3?xe=new D(Ye[0],Ye[2],Ye[1]):xe=new D(Ye[0],Ye[1])}return xe}function de(Z){var xe,Ye,tt,wt;xe=be(Z);for(var kt={"+":"add","-":"subtract"};St(kt,Z.token);){Ye=Z.token,tt=kt[Ye],le(Z);var ur=be(Z);ur.isPercentage?wt=[xe,new N("*","multiply",[xe,ur])]:wt=[xe,ur],xe=new N(Ye,tt,wt)}return xe}function be(Z){var xe,Ye,tt,wt;xe=Ue(Z),Ye=xe;for(var kt={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};St(kt,Z.token);)tt=Z.token,wt=kt[tt],le(Z),Ye=Ue(Z),xe=new N(tt,wt,[xe,Ye]);return xe}function Ue(Z){var xe,Ye;for(xe=ve(Z),Ye=xe;Z.tokenType===F.SYMBOL||Z.token==="in"&&ir(xe)||Z.tokenType===F.NUMBER&&!ir(Ye)&&(!Xr(Ye)||Ye.op==="!")||Z.token==="(";)Ye=ve(Z),xe=new N("*","multiply",[xe,Ye],!0);return xe}function ve(Z){for(var xe=Re(Z),Ye=xe,tt=[];Z.token==="/"&&vg(Ye);)if(tt.push(Un({},Z)),le(Z),Z.tokenType===F.NUMBER)if(tt.push(Un({},Z)),le(Z),Z.tokenType===F.SYMBOL||Z.token==="(")Un(Z,tt.pop()),tt.pop(),Ye=Re(Z),xe=new N("/","divide",[xe,Ye]);else{tt.pop(),Un(Z,tt.pop());break}else{Un(Z,tt.pop());break}return xe}function Re(Z){var xe,Ye,tt,wt;xe=ke(Z);for(var kt={"%":"mod",mod:"mod"};St(kt,Z.token);)Ye=Z.token,tt=kt[Ye],le(Z),Ye==="%"&&Z.tokenType===F.DELIMITER&&Z.token!=="("?xe=new N("/","divide",[xe,new s(100)],!1,!0):(wt=[xe,ke(Z)],xe=new N(Ye,tt,wt));return xe}function ke(Z){var xe,Ye,tt,wt={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return St(wt,Z.token)?(tt=wt[Z.token],xe=Z.token,le(Z),Ye=[ke(Z)],new N(xe,tt,Ye)):Je(Z)}function Je(Z){var xe,Ye,tt,wt;return xe=ot(Z),(Z.token==="^"||Z.token===".^")&&(Ye=Z.token,tt=Ye==="^"?"pow":"dotPow",le(Z),wt=[xe,ke(Z)],xe=new N(Ye,tt,wt)),xe}function ot(Z){var xe,Ye,tt,wt;xe=et(Z);for(var kt={"!":"factorial","'":"ctranspose"};St(kt,Z.token);)Ye=Z.token,tt=kt[Ye],Y(Z),wt=[xe],xe=new N(Ye,tt,wt),xe=Lt(Z,xe);return xe}function et(Z){var xe=[];if(Z.tokenType===F.SYMBOL&&St(Z.extraNodes,Z.token)){var Ye=Z.extraNodes[Z.token];if(Y(Z),Z.token==="("){if(xe=[],re(Z),Y(Z),Z.token!==")")for(xe.push(ce(Z));Z.token===",";)Y(Z),xe.push(ce(Z));if(Z.token!==")")throw Xe(Z,"Parenthesis ) expected");he(Z),Y(Z)}return new Ye(xe)}return ut(Z)}function ut(Z){var xe,Ye;return Z.tokenType===F.SYMBOL||Z.tokenType===F.DELIMITER&&Z.token in P?(Ye=Z.token,Y(Z),St(R,Ye)?xe=new s(R[Ye]):q.indexOf(Ye)!==-1?xe=new s(r(Ye,"number")):xe=new O(Ye),xe=Lt(Z,xe),xe):fe(Z)}function Lt(Z,xe,Ye){for(var tt;(Z.token==="("||Z.token==="["||Z.token===".")&&(!Ye||Ye.indexOf(Z.token)!==-1);)if(tt=[],Z.token==="(")if(Rr(xe)||To(xe)){if(re(Z),Y(Z),Z.token!==")")for(tt.push(ce(Z));Z.token===",";)Y(Z),tt.push(ce(Z));if(Z.token!==")")throw Xe(Z,"Parenthesis ) expected");he(Z),Y(Z),xe=new p(xe,tt)}else return xe;else if(Z.token==="["){if(re(Z),Y(Z),Z.token!=="]")for(tt.push(ce(Z));Z.token===",";)Y(Z),tt.push(ce(Z));if(Z.token!=="]")throw Xe(Z,"Parenthesis ] expected");he(Z),Y(Z),xe=new i(xe,new h(tt))}else{Y(Z);var wt=Z.tokenType===F.SYMBOL||Z.tokenType===F.DELIMITER&&Z.token in P;if(!wt)throw Xe(Z,"Property name expected after dot");tt.push(new s(Z.token)),Y(Z);var kt=!0;xe=new i(xe,new h(tt,kt))}return xe}function fe(Z){var xe,Ye;return Z.token==='"'||Z.token==="'"?(Ye=J(Z,Z.token),xe=new s(Ye),xe=Lt(Z,xe),xe):j(Z)}function J(Z,xe){for(var Ye="";W(Z)!==""&&W(Z)!==xe;)if(W(Z)==="\\"){ee(Z);var tt=W(Z),wt=z[tt];if(wt!==void 0)Ye+=wt,Z.index+=1;else if(tt==="u"){var kt=Z.expression.slice(Z.index+1,Z.index+5);if(/^[0-9A-Fa-f]{4}$/.test(kt))Ye+=String.fromCharCode(parseInt(kt,16)),Z.index+=5;else throw Xe(Z,"Invalid unicode character \\u".concat(kt))}else throw Xe(Z,"Bad escape character \\".concat(tt))}else Ye+=W(Z),ee(Z);if(Y(Z),Z.token!==xe)throw Xe(Z,"End of string ".concat(xe," expected"));return Y(Z),Ye}function j(Z){var xe,Ye,tt,wt;if(Z.token==="["){if(re(Z),Y(Z),Z.token!=="]"){var kt=ne(Z);if(Z.token===";"){for(tt=1,Ye=[kt];Z.token===";";)Y(Z),Z.token!=="]"&&(Ye[tt]=ne(Z),tt++);if(Z.token!=="]")throw Xe(Z,"End of matrix ] expected");he(Z),Y(Z),wt=Ye[0].items.length;for(var ur=1;ur{var{typed:t,parse:r}=e;return t(L6,{string:function(i){return r(i).compile()},"Array | Matrix":function(i){return Ot(i,function(o){return r(o).compile()})}})});v();x();g();var R6="evaluate",wfe=["typed","parse"],q6=K(R6,wfe,e=>{var{typed:t,parse:r}=e;return t(R6,{string:function(i){var o=Ef();return r(i).compile().evaluate(o)},"string, Map | Object":function(i,o){return r(i).compile().evaluate(o)},"Array | Matrix":function(i){var o=Ef();return Ot(i,function(u){return r(u).compile().evaluate(o)})},"Array | Matrix, Map | Object":function(i,o){return Ot(i,function(u){return r(u).compile().evaluate(o)})}})});v();x();g();var bfe="Parser",Dfe=["evaluate"],z6=K(bfe,Dfe,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:Ef(),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 yF(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});v();x();g();var U6="parser",Nfe=["typed","Parser"],H6=K(U6,Nfe,e=>{var{typed:t,Parser:r}=e;return t(U6,{"":function(){return new r}})});v();x();g();var $6="lup",Efe=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],W6=K($6,Efe,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($6,{DenseMatrix:function(b){return N(b)},SparseMatrix:function(b){return w(b)},Array:function(b){var O=r(b),M=N(O);return{L:M.L.valueOf(),U:M.U.valueOf(),p:M.p}}});function N(D){var b=D._size[0],O=D._size[1],M=Math.min(b,O),I=Bt(D._data),F=[],C=[b,M],P=[],R=[M,O],q,z,H,V=[];for(q=0;q0)for(q=0;q0&&ce.forEach(0,X-1,function(Ee,ze){h._forEachRow(Ee,P,R,q,function(We,Be){We>Ee&&ce.accumulate(We,f(u(Be,ze)))})});var Ce=X,Oe=ce.get(X),He=n(Oe);ce.forEach(X+1,b-1,function(Ee,ze){var We=n(ze);a(We,He)&&(Ce=Ee,He=We,Oe=ze)}),X!==Ce&&(h._swapRows(X,Ce,z[1],P,R,q),h._swapRows(X,Ce,ee[1],H,V,W),ce.swap(X,Ce),he(X,Ce)),ce.forEach(0,b-1,function(Ee,ze){Ee<=X?(H.push(ze),V.push(Ee)):(ze=o(ze,Oe),s(ze,0)||(P.push(ze),R.push(Ee)))})};for(X=0;X0&&ce.forEach(0,X-1,function(Se,ze){h._forEachRow(Se,P,R,q,function(We,Be){We>Se&&ce.accumulate(We,f(u(Be,ze)))})});var Ce=X,Oe=ce.get(X),He=n(Oe);ce.forEach(X+1,b-1,function(Se,ze){var We=n(ze);a(We,He)&&(Ce=Se,He=We,Oe=ze)}),X!==Ce&&(h._swapRows(X,Ce,z[1],P,R,q),h._swapRows(X,Ce,ee[1],H,V,W),ce.swap(X,Ce),he(X,Ce)),ce.forEach(0,b-1,function(Se,ze){Se<=X?(H.push(ze),V.push(Se)):(ze=o(ze,Oe),s(ze,0)||(P.push(ze),R.push(Se)))})};for(X=0;X{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:N,complex:w}=e;return qn(t(G6,{DenseMatrix:function(I){return b(I)},SparseMatrix:function(I){return O(I)},Array:function(I){var F=r(I),C=b(F);return{Q:C.Q.valueOf(),R:C.R.valueOf()}}}),{_denseQRimpl:D});function D(M){var I=M._size[0],F=M._size[1],C=i([I],"dense"),P=C._data,R=M.clone(),q=R._data,z,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 X6(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],N=h[1],w=0,D=Math.max(16,10*Math.sqrt(N));D=Math.min(N-2,D);var b=i(f,p,y,N,D);J6(b,a,null);for(var O=b._index,M=b._ptr,I=M[N],F=[],C=[],P=0,R=N+1,q=2*(N+1),z=3*(N+1),H=4*(N+1),V=5*(N+1),W=6*(N+1),ee=7*(N+1),ie=F,X=o(N,M,C,P,z,ie,q,ee,R,W,H,V),Z=u(N,M,C,V,H,W,D,R,z,ie,q),le=0,re,he,De,ye,ce,Ne,Pe,Ce,Oe,He,Ee,ze,We,Be,lt,ct;Zde?(Ne=De,Pe=ve,Ce=C[P+De]-de):(Ne=O[ve++],Pe=M[Ne],Ce=C[P+Ne]),ce=1;ce<=Ce;ce++)re=O[Pe++],!((Oe=C[R+re])<=0)&&(Ue+=Oe,C[R+re]=-Oe,O[ke++]=re,C[q+re]!==-1&&(ie[C[q+re]]=ie[re]),ie[re]!==-1?C[q+ie[re]]=C[q+re]:C[z+C[V+re]]=C[q+re]);Ne!==De&&(M[Ne]=Is(De),C[W+Ne]=0)}for(de!==0&&(I=ke),C[V+De]=Ue,M[De]=Re,C[P+De]=ke-Re,C[H+De]=-2,X=l(X,w,C,W,N),He=Re;He=X?C[W+Ne]-=Oe:C[W+Ne]!==0&&(C[W+Ne]=C[V+Ne]+Je)}for(He=Re;He0?(ct+=ot,O[Be++]=Ne,lt+=Ne):(M[Ne]=Is(De),C[W+Ne]=0)}C[H+re]=Be-ze+1;var et=Be,ut=ze+C[P+re];for(ve=We+1;ve=0))for(lt=ie[re],re=C[ee+lt],C[ee+lt]=-1;re!==-1&&C[q+re]!==-1;re=C[q+re],X++){for(Ce=C[P+re],Ee=C[H+re],ve=M[re]+1;ve<=M[re]+Ce-1;ve++)C[W+O[ve]]=X;var fe=re;for(he=C[q+re];he!==-1;){var J=C[P+he]===Ce&&C[H+he]===Ee;for(ve=M[he]+1;J&&ve<=M[he]+Ce-1;ve++)C[W+O[ve]]!==X&&(J=0);J?(M[he]=Is(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(ve=Re,He=Re;He=0;he--)C[R+he]>0||(C[q+he]=C[z+M[he]],C[z+M[he]]=he);for(Ne=N;Ne>=0;Ne--)C[R+Ne]<=0||M[Ne]!==-1&&(C[q+Ne]=C[z+M[Ne]],C[z+M[Ne]]=Ne);for(De=0,re=0;re<=N;re++)M[re]===-1&&(De=Bw(re,De,C,z,q,F,W));return F.splice(F.length-1,1),F};function i(s,f,p,h,y){var N=n(f);if(s===1&&h===p)return t(f,N);if(s===2){for(var w=N._index,D=N._ptr,b=0,O=0;Oy))for(var I=D[O+1];Mw)p[D+F]=0,p[y+F]=-1,I++,f[F]=Is(s),p[D+s]++;else{var P=p[b+C];P!==-1&&(O[P]=F),p[M+F]=p[b+C],p[b+C]=F}}return I}function l(s,f,p,h,y){if(s<2||s+f<0){for(var N=0;N{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,N,w,D=4*a+(o?a+l+1:0),b=[],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&&(b[O+f]=n[f])}for(f=0;f{var{add:t,multiply:r,transpose:n}=e,i=Q6({add:t,multiply:r,transpose:n}),o=eP({transpose:n});return function(a,s,f){var p=s._ptr,h=s._size,y=h[1],N,w={};if(w.q=i(a,s),a&&!w.q)return null;if(f){var D=a?Z6(s,null,w.q,0):s;w.parent=K6(D,1);var b=X6(w.parent,y);if(w.cp=o(D,w.parent,b,1),D&&w.parent&&w.cp&&u(D,w))for(w.unz=0,N=0;N=0;P--)for(q=s[P],z=s[P+1],R=q;R=0;C--)w[C]=-1,P=D[C],P!==-1&&(b[F+P]++===0&&(b[I+P]=C),b[O+C]=b[M+P],b[M+P]=C);for(a.lnz=0,a.m2=h,P=0;P=0;){e=n[h];var y=i?i[e]:e;Fg(u,e)||(Lw(u,e),n[a+h]=y<0?0:OA(u[y]));var N=1;for(f=n[a+h],p=y<0?0:OA(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,N=o._ptr,w=o._size,D=w[1],b=u._values,O=u._index,M=u._ptr,I,F,C,P,R=nP(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=iP({divideScalar:r,multiply:n,subtract:i});return function(f,p,h){if(!f)return null;var y=f._size,N=y[1],w,D=100,b=100;p&&(w=p.q,D=p.lnz||D,b=p.unz||b);var O=[],M=[],I=[],F=new l({values:O,index:M,ptr:I,size:[N,N]}),C=[],P=[],R=[],q=new l({values:C,index:P,ptr:R,size:[N,N]}),z=[],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=tP({add:n,multiply:i,transpose:o}),h=oP({abs:r,divideScalar:u,multiply:i,subtract:l,larger:a,largerEq:s,SparseMatrix:f});return t(aP,{"SparseMatrix, number, number":function(N,w,D){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(D<0||D>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var b=p(w,N,!1),O=h(N,b,D);return{L:O.L,U:O.U,p:O.pinv,q:b.q,toString:function(){return"L: "+this.L.toString()+` +P: `+this.p}}}});v();x();g();var V6="qr",Sfe=["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtractScalar","complex"],G6=K(V6,Sfe,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:N,complex:w}=e;return Un(t(V6,{DenseMatrix:function(I){return b(I)},SparseMatrix:function(I){return O(I)},Array:function(I){var F=r(I),C=b(F);return{Q:C.Q.valueOf(),R:C.R.valueOf()}}}),{_denseQRimpl:D});function D(M){var I=M._size[0],F=M._size[1],C=i([I],"dense"),P=C._data,R=M.clone(),q=R._data,z,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 Z6(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],N=h[1],w=0,D=Math.max(16,10*Math.sqrt(N));D=Math.min(N-2,D);var b=i(f,p,y,N,D);K6(b,a,null);for(var O=b._index,M=b._ptr,I=M[N],F=[],C=[],P=0,R=N+1,q=2*(N+1),z=3*(N+1),H=4*(N+1),V=5*(N+1),W=6*(N+1),ee=7*(N+1),ie=F,X=o(N,M,C,P,z,ie,q,ee,R,W,H,V),Y=u(N,M,C,V,H,W,D,R,z,ie,q),le=0,re,he,De,ye,ce,Ne,Pe,Ce,Oe,He,Se,ze,We,Be,lt,ct;Yde?(Ne=De,Pe=ve,Ce=C[P+De]-de):(Ne=O[ve++],Pe=M[Ne],Ce=C[P+Ne]),ce=1;ce<=Ce;ce++)re=O[Pe++],!((Oe=C[R+re])<=0)&&(Ue+=Oe,C[R+re]=-Oe,O[ke++]=re,C[q+re]!==-1&&(ie[C[q+re]]=ie[re]),ie[re]!==-1?C[q+ie[re]]=C[q+re]:C[z+C[V+re]]=C[q+re]);Ne!==De&&(M[Ne]=Fs(De),C[W+Ne]=0)}for(de!==0&&(I=ke),C[V+De]=Ue,M[De]=Re,C[P+De]=ke-Re,C[H+De]=-2,X=l(X,w,C,W,N),He=Re;He=X?C[W+Ne]-=Oe:C[W+Ne]!==0&&(C[W+Ne]=C[V+Ne]+Je)}for(He=Re;He0?(ct+=ot,O[Be++]=Ne,lt+=Ne):(M[Ne]=Fs(De),C[W+Ne]=0)}C[H+re]=Be-ze+1;var et=Be,ut=ze+C[P+re];for(ve=We+1;ve=0))for(lt=ie[re],re=C[ee+lt],C[ee+lt]=-1;re!==-1&&C[q+re]!==-1;re=C[q+re],X++){for(Ce=C[P+re],Se=C[H+re],ve=M[re]+1;ve<=M[re]+Ce-1;ve++)C[W+O[ve]]=X;var fe=re;for(he=C[q+re];he!==-1;){var J=C[P+he]===Ce&&C[H+he]===Se;for(ve=M[he]+1;J&&ve<=M[he]+Ce-1;ve++)C[W+O[ve]]!==X&&(J=0);J?(M[he]=Fs(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(ve=Re,He=Re;He=0;he--)C[R+he]>0||(C[q+he]=C[z+M[he]],C[z+M[he]]=he);for(Ne=N;Ne>=0;Ne--)C[R+Ne]<=0||M[Ne]!==-1&&(C[q+Ne]=C[z+M[Ne]],C[z+M[Ne]]=Ne);for(De=0,re=0;re<=N;re++)M[re]===-1&&(De=Rw(re,De,C,z,q,F,W));return F.splice(F.length-1,1),F};function i(s,f,p,h,y){var N=n(f);if(s===1&&h===p)return t(f,N);if(s===2){for(var w=N._index,D=N._ptr,b=0,O=0;Oy))for(var I=D[O+1];Mw)p[D+F]=0,p[y+F]=-1,I++,f[F]=Fs(s),p[D+s]++;else{var P=p[b+C];P!==-1&&(O[P]=F),p[M+F]=p[b+C],p[b+C]=F}}return I}function l(s,f,p,h,y){if(s<2||s+f<0){for(var N=0;N{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,N,w,D=4*a+(o?a+l+1:0),b=[],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&&(b[O+f]=n[f])}for(f=0;f{var{add:t,multiply:r,transpose:n}=e,i=J6({add:t,multiply:r,transpose:n}),o=j6({transpose:n});return function(a,s,f){var p=s._ptr,h=s._size,y=h[1],N,w={};if(w.q=i(a,s),a&&!w.q)return null;if(f){var D=a?Y6(s,null,w.q,0):s;w.parent=X6(D,1);var b=Z6(w.parent,y);if(w.cp=o(D,w.parent,b,1),D&&w.parent&&w.cp&&u(D,w))for(w.unz=0,N=0;N=0;P--)for(q=s[P],z=s[P+1],R=q;R=0;C--)w[C]=-1,P=D[C],P!==-1&&(b[F+P]++===0&&(b[I+P]=C),b[O+C]=b[M+P],b[M+P]=C);for(a.lnz=0,a.m2=h,P=0;P=0;){e=n[h];var y=i?i[e]:e;Mg(u,e)||(qw(u,e),n[a+h]=y<0?0:IA(u[y]));var N=1;for(f=n[a+h],p=y<0?0:IA(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,N=o._ptr,w=o._size,D=w[1],b=u._values,O=u._index,M=u._ptr,I,F,C,P,R=rP(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=nP({divideScalar:r,multiply:n,subtract:i});return function(f,p,h){if(!f)return null;var y=f._size,N=y[1],w,D=100,b=100;p&&(w=p.q,D=p.lnz||D,b=p.unz||b);var O=[],M=[],I=[],F=new l({values:O,index:M,ptr:I,size:[N,N]}),C=[],P=[],R=[],q=new l({values:C,index:P,ptr:R,size:[N,N]}),z=[],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=eP({add:n,multiply:i,transpose:o}),h=iP({abs:r,divideScalar:u,multiply:i,subtract:l,larger:a,largerEq:s,SparseMatrix:f});return t(oP,{"SparseMatrix, number, number":function(N,w,D){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(D<0||D>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var b=p(w,N,!1),O=h(N,b,D);return{L:O.L,U:O.U,p:O.pinv,q:b.q,toString:function(){return"L: "+this.L.toString()+` U: `+this.U.toString()+` p: `+this.p.toString()+(this.q?` q: `+this.q.toString():"")+` -`}}}})});v();x();g();v();x();g();function IA(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=bu({DenseMatrix:l});return t(uP,{"Array, Array | Matrix":function(h,y){h=r(h);var N=n(h),w=f(N.L,N.U,N.p,null,y);return w.valueOf()},"DenseMatrix, Array | Matrix":function(h,y){var N=n(h);return f(N.L,N.U,N.p,null,y)},"SparseMatrix, Array | Matrix":function(h,y){var N=n(h);return f(N.L,N.U,N.p,null,y)},"SparseMatrix, Array | Matrix, number, number":function(h,y,N,w){var D=i(h,N,w);return f(D.L,D.U,D.p,D.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(fr(p))return r(p);throw new TypeError("Invalid Matrix LU decomposition")}function f(p,h,y,N,w){p=s(p),h=s(h),y&&(w=a(p,w,!0),w._data=IA(y,w._data));var D=u(p,w),b=o(h,D);return N&&(b._data=IA(N,b._data)),b}});v();x();g();var fP="polynomialRoot",Rfe=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],cP=K(fP,Rfe,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(fP,{"number|Complex, ...number|Complex":(N,w)=>{for(var D=[N,...w];D.length>0&&r(D[D.length-1]);)D.pop();if(D.length<2)throw new RangeError("Polynomial [".concat(N,", ").concat(w,"] must have a non-zero non-constant coefficient"));switch(D.length){case 2:return[s(l(D[0],D[1]))];case 3:{var[b,O,M]=D,I=u(2,M),F=u(O,O),C=u(4,M,b);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,z,H]=D,V=s(u(3,H)),W=u(z,z),ee=u(3,H,q),ie=i(u(2,z,z,z),u(27,H,H,R)),X=u(9,H,z,q);if(n(W,ee)&&n(ie,X))return[l(z,V)];var Z=o(W,ee),le=o(ie,X),re=i(u(18,H,z,q,R),u(z,z,q,q)),he=i(u(4,z,z,z,R),u(4,H,q,q,q),u(27,H,H,R,R));if(n(re,he))return[l(o(u(4,H,z,q),i(u(9,H,H,R),u(z,z,z))),u(H,Z)),l(o(u(9,H,R),u(z,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 ye=!0,ce=f(De,ye).toArray().map(Ne=>l(i(z,Ne,l(Z,Ne)),V));return ce.map(Ne=>p(Ne)==="Complex"&&n(y(Ne),y(Ne)+h(Ne))?y(Ne):Ne)}default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(D))}}})});v();x();g();var qfe="Help",zfe=["evaluate"],pP=K(qfe,zfe,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=` +`}}}})});v();x();g();v();x();g();function FA(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(sP,{"Array, Array | Matrix":function(h,y){h=r(h);var N=n(h),w=f(N.L,N.U,N.p,null,y);return w.valueOf()},"DenseMatrix, Array | Matrix":function(h,y){var N=n(h);return f(N.L,N.U,N.p,null,y)},"SparseMatrix, Array | Matrix":function(h,y){var N=n(h);return f(N.L,N.U,N.p,null,y)},"SparseMatrix, Array | Matrix, number, number":function(h,y,N,w){var D=i(h,N,w);return f(D.L,D.U,D.p,D.q,y)},"Object, Array | Matrix":function(h,y){return f(h.L,h.U,h.p,h.q,y)}});function s(p){if(Et(p))return p;if(fr(p))return r(p);throw new TypeError("Invalid Matrix LU decomposition")}function f(p,h,y,N,w){p=s(p),h=s(h),y&&(w=a(p,w,!0),w._data=FA(y,w._data));var D=u(p,w),b=o(h,D);return N&&(b._data=FA(N,b._data)),b}});v();x();g();var lP="polynomialRoot",Rfe=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],fP=K(lP,Rfe,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(lP,{"number|Complex, ...number|Complex":(N,w)=>{for(var D=[N,...w];D.length>0&&r(D[D.length-1]);)D.pop();if(D.length<2)throw new RangeError("Polynomial [".concat(N,", ").concat(w,"] must have a non-zero non-constant coefficient"));switch(D.length){case 2:return[s(l(D[0],D[1]))];case 3:{var[b,O,M]=D,I=u(2,M),F=u(O,O),C=u(4,M,b);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,z,H]=D,V=s(u(3,H)),W=u(z,z),ee=u(3,H,q),ie=i(u(2,z,z,z),u(27,H,H,R)),X=u(9,H,z,q);if(n(W,ee)&&n(ie,X))return[l(z,V)];var Y=o(W,ee),le=o(ie,X),re=i(u(18,H,z,q,R),u(z,z,q,q)),he=i(u(4,z,z,z,R),u(4,H,q,q,q),u(27,H,H,R,R));if(n(re,he))return[l(o(u(4,H,z,q),i(u(9,H,H,R),u(z,z,z))),u(H,Y)),l(o(u(9,H,R),u(z,q)),u(2,Y))];var De;n(W,ee)?De=le:De=l(i(le,a(o(u(le,le),u(4,Y,Y,Y)))),2);var ye=!0,ce=f(De,ye).toArray().map(Ne=>l(i(z,Ne,l(Y,Ne)),V));return ce.map(Ne=>p(Ne)==="Complex"&&n(y(Ne),y(Ne)+h(Ne))?y(Ne):Ne)}default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(D))}}})});v();x();g();var qfe="Help",zfe=["evaluate"],cP=K(qfe,zfe,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});v();x();g();var Ufe="Chain",Hfe=["?on","math","typed"],mP=K(Ufe,Hfe,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");ah(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 Yt(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){uh(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[N])};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});v();x();g();v();x();g();v();x();g();var FA={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"]};v();x();g();var hP={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]};v();x();g();var dP={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:[]};v();x();g();var vP={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:[]};v();x();g();var gP={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]};v();x();g();var xP={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]};v();x();g();var yP={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:[]};v();x();g();var wP={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:[]};v();x();g();var bP={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]};v();x();g();var DP={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]};v();x();g();var NP={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:[]};v();x();g();var _A={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"]};v();x();g();var SP={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:[]};v();x();g();var EP={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]};v();x();g();var AP={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"]};v();x();g();var CP={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]};v();x();g();var MP={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]};v();x();g();var TP={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","complex","fraction","index","matrix","string","unit"]};v();x();g();var OP={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"]};v();x();g();var IP={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"]};v();x();g();var FP={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"]};v();x();g();var _P={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"]};v();x();g();var kP={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"]};v();x();g();var BP={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"]};v();x();g();var LP={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","boolean","complex","fraction","index","matrix","string","unit"]};v();x();g();var PP={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"]};v();x();g();var RP={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"]};v();x();g();var qP={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"]};v();x();g();var zP={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"]};v();x();g();var UP={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:[]};v();x();g();var HP={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:[]};v();x();g();var $P={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:[]};v();x();g();var WP={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"]};v();x();g();var VP={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"]};v();x();g();var GP={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"]};v();x();g();var YP={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"]};v();x();g();var ZP={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"]};v();x();g();var XP={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"]};v();x();g();var KP={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"]};v();x();g();var JP={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"]};v();x();g();var QP={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"]};v();x();g();var jP={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"]};v();x();g();var e8={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"]};v();x();g();var t8={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"]};v();x();g();var r8={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"]};v();x();g();var n8={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"]};v();x();g();var i8={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"]};v();x();g();var o8={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"]};v();x();g();var a8={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"]};v();x();g();var s8={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]};v();x();g();var u8={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"]};v();x();g();var l8={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"]};v();x();g();var f8={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"]};v();x();g();var c8={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"]};v();x();g();var p8={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"]};v();x();g();var m8={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"]};v();x();g();var h8={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"]};v();x();g();var d8={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"]};v();x();g();var v8={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"]};v();x();g();var g8={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"]};v();x();g();var x8={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"]};v();x();g();var y8={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"]};v();x();g();var w8={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"]};v();x();g();var b8={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"]};v();x();g();var D8={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"]};v();x();g();var N8={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"]};v();x();g();var S8={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"]};v();x();g();var E8={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"]};v();x();g();var A8={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"]};v();x();g();var C8={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"]};v();x();g();var M8={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"]};v();x();g();var T8={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"]};v();x();g();var O8={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"]};v();x();g();var I8={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")']};v();x();g();var F8={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"]};v();x();g();var _8={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"]};v();x();g();var k8={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"]};v();x();g();var B8={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"]};v();x();g();var L8={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"]};v();x();g();var P8={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"]};v();x();g();var R8={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"]};v();x();g();var q8={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"]};v();x();g();var z8={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"]};v();x();g();var U8={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"]};v();x();g();var H8={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"]};v();x();g();var $8={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"]};v();x();g();var W8={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"]};v();x();g();var V8={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]};v();x();g();var G8={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"]};v();x();g();var Y8={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"]};v();x();g();var Z8={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"]};v();x();g();var X8={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"]};v();x();g();var K8={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"]};v();x();g();var J8={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"]};v();x();g();var Q8={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"]};v();x();g();var j8={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"]};v();x();g();var eR={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"]};v();x();g();var tR={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"]};v();x();g();var rR={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"]};v();x();g();var nR={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"]};v();x();g();var iR={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"]};v();x();g();var oR={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"]};v();x();g();var aR={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"]};v();x();g();var sR={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"]};v();x();g();var uR={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:[]};v();x();g();var lR={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]};v();x();g();var fR={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:[]};v();x();g();var cR={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:[]};v();x();g();var pR={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"]};v();x();g();var mR={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"]};v();x();g();var hR={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"]};v();x();g();var dR={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"]};v();x();g();var vR={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"]};v();x();g();var gR={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"]};v();x();g();var xR={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"]};v();x();g();var yR={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"]};v();x();g();var wR={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"]};v();x();g();var bR={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"]};v();x();g();var DR={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"]};v();x();g();var NR={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"]};v();x();g();var SR={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"]};v();x();g();var ER={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"]};v();x();g();var AR={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"]};v();x();g();var CR={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"]};v();x();g();var MR={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"]};v();x();g();var TR={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"]};v();x();g();var OR={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"]};v();x();g();var IR={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"]};v();x();g();var FR={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"]};v();x();g();var _R={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"]};v();x();g();var kR={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"]};v();x();g();var BR={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"]};v();x();g();var LR={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"]};v();x();g();var PR={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"]};v();x();g();var RR={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"]};v();x();g();var qR={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"]};v();x();g();var zR={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"]};v();x();g();var UR={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"]};v();x();g();var HR={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"]};v();x();g();var $R={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"]};v();x();g();var WR={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"]};v();x();g();var VR={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"]};v();x();g();var GR={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"]};v();x();g();var YR={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"]};v();x();g();var ZR={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"]};v();x();g();var XR={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"]};v();x();g();var KR={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"]};v();x();g();var JR={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"]};v();x();g();var QR={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"]};v();x();g();var jR={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]};v();x();g();var e9={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]};v();x();g();var t9={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"]};v();x();g();var r9={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"]};v();x();g();var n9={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"]};v();x();g();var i9={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"]};v();x();g();var o9={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"]};v();x();g();var a9={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:[]};v();x();g();var s9={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"]};v();x();g();var u9={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"]};v();x();g();var l9={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"]};v();x();g();var f9={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"]};v();x();g();var c9={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"]};v();x();g();var p9={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"]};v();x();g();var m9={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"]};v();x();g();var h9={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"]};v();x();g();var d9={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"]};v();x();g();var v9={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"]};v();x();g();var g9={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"]};v();x();g();var x9={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"]};v();x();g();var y9={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"]};v();x();g();var w9={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"]};v();x();g();var b9={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"]};v();x();g();var D9={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"]};v();x();g();var N9={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"]};v();x();g();var S9={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"]};v();x();g();var E9={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"]};v();x();g();var A9={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"]};v();x();g();var C9={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"]};v();x();g();var M9={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"]};v();x();g();var T9={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"]};v();x();g();var O9={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"]};v();x();g();var I9={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"]};v();x();g();var F9={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"]};v();x();g();var _9={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:[]};v();x();g();var k9={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:[]};v();x();g();var B9={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:[]};v();x();g();var L9={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:[]};v();x();g();var P9={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"]};v();x();g();var R9={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"]};v();x();g();var q9={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"]};v();x();g();var z9={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"]};v();x();g();var U9={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"]};v();x();g();var H9={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"]};v();x();g();var $9={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"]};v();x();g();var W9={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=Bt(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});v();x();g();var Ufe="Chain",Hfe=["?on","math","typed"],pP=K(Ufe,Hfe,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");nh(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 Zt(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){oh(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[N])};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});v();x();g();v();x();g();v();x();g();var _A={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"]};v();x();g();var mP={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]};v();x();g();var hP={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:[]};v();x();g();var dP={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:[]};v();x();g();var vP={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]};v();x();g();var gP={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]};v();x();g();var xP={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:[]};v();x();g();var yP={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:[]};v();x();g();var wP={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]};v();x();g();var bP={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]};v();x();g();var DP={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:[]};v();x();g();var kA={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"]};v();x();g();var NP={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:[]};v();x();g();var EP={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]};v();x();g();var SP={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"]};v();x();g();var AP={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]};v();x();g();var CP={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]};v();x();g();var MP={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","complex","fraction","index","matrix","string","unit"]};v();x();g();var TP={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"]};v();x();g();var OP={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"]};v();x();g();var IP={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"]};v();x();g();var FP={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"]};v();x();g();var _P={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"]};v();x();g();var kP={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"]};v();x();g();var BP={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","boolean","complex","fraction","index","matrix","string","unit"]};v();x();g();var LP={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"]};v();x();g();var PP={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"]};v();x();g();var RP={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"]};v();x();g();var qP={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"]};v();x();g();var zP={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:[]};v();x();g();var UP={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:[]};v();x();g();var HP={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:[]};v();x();g();var $P={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"]};v();x();g();var WP={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"]};v();x();g();var VP={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"]};v();x();g();var GP={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"]};v();x();g();var YP={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"]};v();x();g();var ZP={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"]};v();x();g();var XP={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"]};v();x();g();var KP={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"]};v();x();g();var JP={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"]};v();x();g();var QP={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"]};v();x();g();var jP={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"]};v();x();g();var e8={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"]};v();x();g();var t8={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"]};v();x();g();var r8={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"]};v();x();g();var n8={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"]};v();x();g();var i8={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"]};v();x();g();var o8={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"]};v();x();g();var a8={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]};v();x();g();var s8={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"]};v();x();g();var u8={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"]};v();x();g();var l8={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"]};v();x();g();var f8={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"]};v();x();g();var c8={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"]};v();x();g();var p8={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"]};v();x();g();var m8={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"]};v();x();g();var h8={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"]};v();x();g();var d8={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"]};v();x();g();var v8={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"]};v();x();g();var g8={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"]};v();x();g();var x8={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"]};v();x();g();var y8={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"]};v();x();g();var w8={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"]};v();x();g();var b8={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"]};v();x();g();var D8={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"]};v();x();g();var N8={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"]};v();x();g();var E8={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"]};v();x();g();var S8={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"]};v();x();g();var A8={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"]};v();x();g();var C8={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"]};v();x();g();var M8={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"]};v();x();g();var T8={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"]};v();x();g();var O8={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")']};v();x();g();var I8={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"]};v();x();g();var F8={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"]};v();x();g();var _8={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"]};v();x();g();var k8={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"]};v();x();g();var B8={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"]};v();x();g();var L8={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"]};v();x();g();var P8={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"]};v();x();g();var R8={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"]};v();x();g();var q8={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"]};v();x();g();var z8={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"]};v();x();g();var U8={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"]};v();x();g();var H8={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"]};v();x();g();var $8={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"]};v();x();g();var W8={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]};v();x();g();var V8={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"]};v();x();g();var G8={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"]};v();x();g();var Y8={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"]};v();x();g();var Z8={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"]};v();x();g();var X8={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"]};v();x();g();var K8={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"]};v();x();g();var J8={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"]};v();x();g();var Q8={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"]};v();x();g();var j8={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"]};v();x();g();var eR={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"]};v();x();g();var tR={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"]};v();x();g();var rR={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"]};v();x();g();var nR={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"]};v();x();g();var iR={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"]};v();x();g();var oR={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"]};v();x();g();var aR={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"]};v();x();g();var sR={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:[]};v();x();g();var uR={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]};v();x();g();var lR={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:[]};v();x();g();var fR={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:[]};v();x();g();var cR={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"]};v();x();g();var pR={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"]};v();x();g();var mR={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"]};v();x();g();var hR={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"]};v();x();g();var dR={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"]};v();x();g();var vR={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"]};v();x();g();var gR={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"]};v();x();g();var xR={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"]};v();x();g();var yR={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"]};v();x();g();var wR={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"]};v();x();g();var bR={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"]};v();x();g();var DR={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"]};v();x();g();var NR={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"]};v();x();g();var ER={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"]};v();x();g();var SR={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"]};v();x();g();var AR={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"]};v();x();g();var CR={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"]};v();x();g();var MR={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"]};v();x();g();var TR={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"]};v();x();g();var OR={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"]};v();x();g();var IR={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"]};v();x();g();var FR={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"]};v();x();g();var _R={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"]};v();x();g();var kR={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"]};v();x();g();var BR={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"]};v();x();g();var LR={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"]};v();x();g();var PR={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"]};v();x();g();var RR={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"]};v();x();g();var qR={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"]};v();x();g();var zR={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"]};v();x();g();var UR={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"]};v();x();g();var HR={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"]};v();x();g();var $R={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"]};v();x();g();var WR={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"]};v();x();g();var VR={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"]};v();x();g();var GR={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"]};v();x();g();var YR={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"]};v();x();g();var ZR={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"]};v();x();g();var XR={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"]};v();x();g();var KR={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"]};v();x();g();var JR={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"]};v();x();g();var QR={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]};v();x();g();var jR={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]};v();x();g();var e9={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"]};v();x();g();var t9={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"]};v();x();g();var r9={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"]};v();x();g();var n9={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"]};v();x();g();var i9={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"]};v();x();g();var o9={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:[]};v();x();g();var a9={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"]};v();x();g();var s9={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"]};v();x();g();var u9={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"]};v();x();g();var l9={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"]};v();x();g();var f9={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"]};v();x();g();var c9={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"]};v();x();g();var p9={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"]};v();x();g();var m9={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"]};v();x();g();var h9={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"]};v();x();g();var d9={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"]};v();x();g();var v9={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"]};v();x();g();var g9={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"]};v();x();g();var x9={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"]};v();x();g();var y9={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"]};v();x();g();var w9={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"]};v();x();g();var b9={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"]};v();x();g();var D9={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"]};v();x();g();var N9={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"]};v();x();g();var E9={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"]};v();x();g();var S9={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"]};v();x();g();var A9={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"]};v();x();g();var C9={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"]};v();x();g();var M9={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"]};v();x();g();var T9={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"]};v();x();g();var O9={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"]};v();x();g();var I9={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"]};v();x();g();var F9={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:[]};v();x();g();var _9={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:[]};v();x();g();var k9={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:[]};v();x();g();var B9={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:[]};v();x();g();var L9={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"]};v();x();g();var P9={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"]};v();x();g();var R9={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"]};v();x();g();var q9={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"]};v();x();g();var z9={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"]};v();x();g();var U9={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"]};v();x();g();var H9={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"]};v();x();g();var $9={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"]};v();x();g();var V9={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"]};v();x();g();var G9={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"]};v();x();g();var Y9={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"]};v();x();g();var Z9={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"]};v();x();g();var X9={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"]};v();x();g();var K9={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"]};v();x();g();var J9={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"]};v();x();g();var Q9={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"]};v();x();g();var j9={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"]};v();x();g();var e7={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"]};v();x();g();var t7={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"]};v();x();g();var r7={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"]};v();x();g();var n7={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]};v();x();g();var i7={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"]};v();x();g();var o7={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"]};v();x();g();var a7={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"]};v();x();g();var s7={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"]};v();x();g();var u7={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"]};v();x();g();var l7={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"]};v();x();g();var f7={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]};v();x();g();var c7={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"]};v();x();g();var p7={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"]};v();x();g();var m7={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"]};v();x();g();var h7={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"]};v();x();g();var d7={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"]};v();x();g();var v7={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"]};v();x();g();var g7={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"]};v();x();g();var x7={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]};v();x();g();var y7={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"]};v();x();g();var w7={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"]};v();x();g();var b7={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:[]};v();x();g();var D7={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]};v();x();g();var N7={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:[]};v();x();g();var S7={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"]};v();x();g();var E7={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"]};v();x();g();var A7={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]};v();x();g();var C7={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"]};v();x();g();var M7={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"]};v();x();g();var T7={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"]};v();x();g();var O7={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"]};v();x();g();var I7={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"]};v();x();g();var F7={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"]};v();x();g();var _7={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"]};v();x();g();var k7={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","fraction","bignumber","string","format"]};v();x();g();var B7={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]};v();x();g();var L7={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"]};v();x();g();var P7={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"]};v();x();g();var R7={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 q7={bignumber:TP,boolean:OP,complex:IP,createUnit:FP,fraction:_P,index:kP,matrix:BP,number:LP,sparse:PP,splitUnit:RP,string:qP,unit:zP,e:FA,E:FA,false:hP,i:dP,Infinity:vP,LN2:xP,LN10:gP,LOG2E:wP,LOG10E:yP,NaN:bP,null:DP,pi:_A,PI:_A,phi:NP,SQRT1_2:SP,SQRT2:EP,tau:AP,true:CP,version:MP,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:WP,lsolve:GP,lsolveAll:YP,lup:ZP,lusolve:XP,leafCount:VP,polynomialRoot:KP,resolve:jP,simplify:e8,simplifyConstant:t8,simplifyCore:r8,symbolicEqual:i8,rationalize:QP,slu:n8,usolve:o8,usolveAll:a8,qr:JP,abs:s8,add:u8,cbrt:l8,ceil:f8,cube:c8,divide:p8,dotDivide:m8,dotMultiply:h8,dotPow:d8,exp:v8,expm:g8,expm1:x8,fix:y8,floor:w8,gcd:b8,hypot:D8,lcm:S8,log:E8,log2:M8,log1p:C8,log10:A8,mod:T8,multiply:O8,norm:I8,nthRoot:F8,nthRoots:_8,pow:k8,round:B8,sign:L8,sqrt:P8,sqrtm:R8,square:H8,subtract:$8,unaryMinus:W8,unaryPlus:V8,xgcd:G8,invmod:N8,bitAnd:Y8,bitNot:Z8,bitOr:X8,bitXor:K8,leftShift:J8,rightArithShift:Q8,rightLogShift:j8,bellNumbers:eR,catalan:tR,composition:rR,stirlingS2:nR,config:UP,import:HP,typed:$P,arg:iR,conj:oR,re:sR,im:aR,evaluate:uR,help:lR,distance:fR,intersect:cR,and:pR,not:mR,or:hR,xor:dR,concat:gR,count:xR,cross:yR,column:vR,ctranspose:wR,det:bR,diag:DR,diff:NR,dot:SR,getMatrixDataType:TR,identity:OR,filter:AR,flatten:CR,forEach:MR,inv:IR,pinv:FR,eigs:ER,kron:_R,matrixFromFunction:LR,matrixFromRows:PR,matrixFromColumns:BR,map:kR,ones:RR,partitionSelect:qR,range:zR,resize:HR,reshape:UR,rotate:$R,rotationMatrix:WR,row:VR,size:GR,sort:YR,squeeze:ZR,subset:XR,trace:KR,transpose:JR,zeros:QR,fft:jR,ifft:e9,sylvester:q8,schur:z8,lyap:U8,solveODE:R7,combinations:t9,combinationsWithRep:r9,factorial:n9,gamma:i9,kldivergence:a9,lgamma:o9,multinomial:s9,permutations:u9,pickRandom:l9,random:f9,randomInt:c9,compare:p9,compareNatural:m9,compareText:h9,deepEqual:d9,equal:v9,equalText:g9,larger:x9,largerEq:y9,smaller:w9,smallerEq:b9,unequal:D9,setCartesian:N9,setDifference:S9,setDistinct:E9,setIntersect:A9,setIsSubset:C9,setMultiplicity:M9,setPowerset:T9,setSize:O9,setSymDifference:I9,setUnion:F9,zpk2tf:_9,freqz:k9,erf:B9,zeta:L9,cumsum:G9,mad:P9,max:R9,mean:q9,median:z9,min:U9,mode:H9,prod:$9,quantileSeq:W9,std:V9,sum:Y9,variance:Z9,corr:X9,acos:K9,acosh:J9,acot:Q9,acoth:j9,acsc:e7,acsch:t7,asec:r7,asech:n7,asin:i7,asinh:o7,atan:a7,atanh:u7,atan2:s7,cos:l7,cosh:f7,cot:c7,coth:p7,csc:m7,csch:h7,sec:d7,sech:v7,sin:g7,sinh:x7,tan:y7,tanh:w7,to:b7,clone:N7,format:S7,bin:D7,oct:B7,hex:A7,isNaN:M7,isInteger:C7,isNegative:T7,isNumeric:O7,hasNumericValue:E7,isPositive:I7,isPrime:F7,isZero:_7,print:L7,typeOf:P7,numeric:k7};var z7="help",$fe=["typed","mathWithTransform","Help"],U7=K(z7,$fe,e=>{var{typed:t,mathWithTransform:r,Help:n}=e;return t(z7,{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=un(q7,l);if(!a){var s=typeof l=="function"?l.name:l;throw new Error('No documentation found on "'+s+'"')}return new n(a)}})});v();x();g();var H7="chain",Wfe=["typed","Chain"],$7=K(H7,Wfe,e=>{var{typed:t,Chain:r}=e;return t(H7,{"":function(){return new r},any:function(i){return new r(i)}})});v();x();g();var W7="det",Vfe=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],V7=K(W7,Vfe,e=>{var{typed:t,matrix:r,subtractScalar:n,multiply:i,divideScalar:o,isZero:u,unaryMinus:l}=e;return t(W7,{any:function(f){return Bt(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 Bt(f);case 1:if(p[0]===1)return Bt(f.valueOf()[0]);if(p[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+Yt(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: "+Yt(p)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Yt(p)+")")}}});function a(s,f,p){if(f===1)return Bt(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),N=0;N{var{typed:t,matrix:r,divideScalar:n,addScalar:i,multiply:o,unaryMinus:u,det:l,identity:a,abs:s}=e;return t(G7,{"Array | Matrix":function(h){var y=St(h)?h.size():Ht(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: "+Yt(y)+")");case 2:{var N=y[0],w=y[1];if(N===w)return St(h)?r(f(h.valueOf(),N,w),h.storage()):f(h,N,w);throw new RangeError("Matrix must be square (size: "+Yt(y)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Yt(y)+")")}},any:function(h){return n(1,h)}});function f(p,h,y){var N,w,D,b,O;if(h===1){if(b=p[0][0],b===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,b)]]}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(N=0;NP&&(P=s(I[N][C]),R=N),N++;if(P===0)throw Error("Cannot calculate inverse, determinant is zero");N=R,N!==C&&(O=I[C],I[C]=I[N],I[N]=O,O=F[C],F[C]=F[N],F[N]=O);var q=I[C],z=F[C];for(N=0;N{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(Z7,{"Array | Matrix":function(M){var I=St(M)?M.size():Ht(M);switch(I.length){case 1:return b(M)?a(M):I[0]===1?n(M):u(a(M),l(M,M));case 2:{if(b(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: "+Yt(I)+")")}},any:function(M){return o(M,0)?Bt(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 N(O,M,I){for(var F=Bt(O),C=0,P=0;PR.filter((z,H)=>H!D(l(F[q],F[q])));return{C,F:P}}function D(O){return o(p(O,h(1,1)),p(0,h(1,1)))}function b(O){return i(p(O,h(1,1)),p(f(O,0),h(1,1)))}});v();x();g();v();x();g();function K7(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:N,usolve:w,usolveAll:D,equal:b,complex:O,larger:M,smaller:I,matrixFromColumns:F,dot:C}=e;function P(ye,ce,Ne,Pe){var Ce=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,Oe=R(ye,ce,Ne,Pe,Ce);q(ye,ce,Ne,Pe,Ce,Oe);var{values:He,C:Ee}=z(ye,ce,Ne,Pe,Ce);if(Ce){var ze=H(ye,ce,Ee,Oe,He,Ne,Pe);return{values:He,eigenvectors:ze}}return{values:He}}function R(ye,ce,Ne,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,Be=Oe?s(10):2,lt=o(Be,Be),ct;Ce&&(ct=Array(ce).fill(ze));for(var de=!1;!de;){de=!0;for(var be=0;be1&&(de=f(Array(Be-1).fill(Ee)))),Be-=1,ze.pop();for(var ot=0;ot2&&(de=f(Array(Be-2).fill(Ee)))),Be-=2,ze.pop(),ze.pop();for(var ut=0;ut+r(a(J),a(j))),be>100){var Lt=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+We.join(", "));throw Lt.values=We,Lt.vectors=[],Lt}var fe=Ce?i(ct,ie(lt,ce)):void 0;return{values:We,C:fe}}function H(ye,ce,Ne,Pe,Ce,Oe,He){var Ee=y(Ne),ze=i(Ee,ye,Ne),We=He==="BigNumber",Be=He==="Complex",lt=We?s(0):Be?O(0):0,ct=We?s(1):Be?O(1):1,de=[],be=[];for(var Ue of Ce){var ve=X(de,Ue,b);ve===-1?(de.push(Ue),be.push(1)):be[ve]+=1}for(var Re=[],ke=de.length,Je=Array(ce).fill(lt),ot=f(Array(ce).fill(ct)),et=function(){var fe=de[ut],J=r(ze,i(fe,ot)),j=D(J,Je);for(j.shift();j.lengthi(pe,we)),Re.push(...j.map(we=>({value:fe,vector:n(we)})))},ut=0;ut=5)return null;for(Ee=0;;){var ze=w(ye,He);if(I(he(re(He,[ze])),Pe))break;if(++Ee>=10)return null;He=De(ze)}return He}function le(ye,ce,Ne){var Pe=Ne==="BigNumber",Ce=Ne==="Complex",Oe=Array(ye).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,Ne)}function re(ye,ce){var Ne=p(ye);for(var Pe of ce)Pe=h(Pe,Ne),ye=r(ye,i(u(C(Pe,ye),C(Pe,Pe)),Pe));return ye}function he(ye){return a(l(C(ye,ye)))}function De(ye,ce){var Ne=ce==="BigNumber",Pe=ce==="Complex",Ce=Ne?s(1):Pe?O(1):1;return i(u(Ce,he(ye)),ye)}return P}v();x();g();function J7(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,z){var H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.epsilon,V=arguments.length>3?arguments[3]:void 0,W=arguments.length>4?arguments[4]:void 0;if(V==="number")return N(q,H,W);if(V==="BigNumber")return w(q,H,W);throw TypeError("Unsupported data type: "+V)}function N(q,z,H){var V=q.length,W=Math.abs(z/V),ee,ie;if(H){ie=new Array(V);for(var X=0;X=Math.abs(W);){var le=Z[0][0],re=Z[0][1];ee=D(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=b(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:ye}));return{values:W,eigenvectors:De}}return y}var Zfe="eigs",Xfe=["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"],Q7=K(Zfe,Xfe,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:N,multiply:w,add:D,larger:b,column:O,flatten:M,number:I,complex:F,sqrt:C,diag:P,size:R,reshape:q,qr:z,usolve:H,usolveAll:V,im:W,re:ee,smaller:ie,matrixFromColumns:X,dot:Z}=e,le=J7({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:N,complex:F,multiply:w,add:D}),re=K7({config:t,addScalar:i,subtract:o,multiply:w,multiplyScalar:p,flatten:M,divideScalar:h,sqrt:C,abs:l,bignumber:N,diag:P,size:R,reshape:q,qr:z,inv:y,usolve:H,usolveAll:V,equal:u,complex:F,larger:b,smaller:ie,matrixFromColumns:X,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 qn(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.epsilon,We=De(Ce,ze,Ee);return He.matricize&&(We.values=n(We.values),Ee&&(We.eigenvectors=We.eigenvectors.map(Be=>{var{value:lt,vector:ct}=Be;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(Yt(ze),")"));var We=ze[0];if(ce(Ee,We,Oe)&&(Ne(Ee,We),ye(Ee,We,Oe))){var Be=Pe(Ce,Ee,We);return le(Ee,We,Oe,Be,He)}var lt=Pe(Ce,Ee,We);return re(Ee,We,Oe,lt,He)}function ye(Ce,Oe,He){for(var Ee=0;Ee{var{typed:t,abs:r,add:n,identity:i,inv:o,multiply:u}=e;return t(j7,{Matrix:function(p){var h=p.size();if(h.length!==2||h[0]!==h[1])throw new RangeError("Matrix must be square (size: "+Yt(h)+")");for(var y=h[0],N=1e-15,w=l(p),D=a(w,N),b=D.q,O=D.j,M=u(p,Math.pow(2,-O)),I=i(y),F=i(y),C=1,P=M,R=-1,q=1;q<=b;q++)q>1&&(P=u(P,M),R=-R),C=C*(b-q+1)/((2*b-q+1)*q),I=n(I,u(C,P)),F=n(F,u(C*R,P));for(var z=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 N(w){var D,b=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))),D=f(r(l(O,I))),D>y&&++b>h)throw new Error("computing square root of matrix: iterative method could not converge")}while(D>y);return O}return t(tq,{"Array | Matrix":function(D){var b=St(D)?D.size():Ht(D);switch(b.length){case 1:if(b[0]===1)return o(D,u);throw new RangeError("Matrix must be square (size: "+Yt(b)+")");case 2:{var O=b[0],M=b[1];if(O===M)return N(D);throw new RangeError("Matrix must be square (size: "+Yt(b)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+Yt(b)+")")}}})});v();x();g();var nq="sylvester",Qfe=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],iq=K(nq,Qfe,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:N,abs:w}=e;return t(nq,{"Matrix, Matrix, Matrix":D,"Array, Matrix, Matrix":function(O,M,I){return D(i(O),M,I)},"Array, Array, Matrix":function(O,M,I){return D(i(O),i(M),I)},"Array, Matrix, Array":function(O,M,I){return D(i(O),M,i(I))},"Matrix, Array, Matrix":function(O,M,I){return D(O,i(M),I)},"Matrix, Array, Array":function(O,M,I){return D(O,i(M),i(I))},"Matrix, Matrix, Array":function(O,M,I){return D(O,M,i(I))},"Array, Array, Array":function(O,M,I){return D(i(O),i(M),i(I)).toArray()}});function D(b,O,M){for(var I=O.size()[0],F=b.size()[0],C=r(b),P=C.T,R=C.U,q=r(o(-1,O)),z=q.T,H=q.U,V=o(o(a(R),M),H),W=u(0,F),ee=[],ie=(Be,lt)=>l(Be,lt,1),X=(Be,lt)=>l(Be,lt,0),Z=0;Z1e-5){for(var le=X(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(oq,{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,N;do{N=p;var w=o(p),D=w.Q,b=w.R;if(p=i(b,D),h=i(h,D),y++>100)break}while(u(l(p,N))>1e-4);return{U:h,T:p}}});v();x();g();var sq="lyap",ece=["typed","matrix","sylvester","multiply","transpose"],uq=K(sq,ece,e=>{var{typed:t,matrix:r,sylvester:n,multiply:i,transpose:o}=e;return t(sq,{"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()}})});v();x();g();var tce="divide",rce=["typed","matrix","multiply","equalScalar","divideScalar","inv"],lq=K(tce,rce,e=>{var{typed:t,matrix:r,multiply:n,equalScalar:i,divideScalar:o,inv:u}=e,l=Lr({typed:t,equalScalar:i}),a=Zn({typed:t});return t("divide",gy({"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))});v();x();g();var fq="distance",nce=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],cq=K(fq,nce,e=>{var{typed:t,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:o,deepEqual:u,sqrt:l,abs:a}=e;return t(fq,{"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]),z=n(i(P[0],C[1]),i(C[0],P[1]));return D(F[0],F[1],R,q,z)}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(N(C),N(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),z=n(i(P.lineTwoPtX,C.lineOnePtY),i(C.lineOnePtX,P.lineTwoPtY));return D(F.pointX,F.pointY,R,q,z)}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 D(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 b(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 D(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 b(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"||_t(I)}function f(I){return I.constructor!==Array&&(I=N(I)),s(I[0])&&s(I[1])}function p(I){return I.constructor!==Array&&(I=N(I)),s(I[0])&&s(I[1])&&s(I[2])}function h(I){return Array.isArray(I)||(I=N(I)),I.every(s)}function y(I){return I.constructor!==Array&&(I=N(I)),s(I[0])&&s(I[1])&&s(I[2])&&s(I[3])&&s(I[4])&&s(I[5])}function N(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 D(I,F,C,P,R){var q=a(r(r(i(C,I),i(P,F)),R)),z=l(r(i(C,C),i(P,P)));return o(q,z)}function b(I,F,C,P,R,q,z,H,V){var W=[n(i(n(R,F),V),i(n(q,C),H)),n(i(n(q,C),z),i(n(P,I),V)),n(i(n(P,I),H),i(n(R,F),z))];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(z,z),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:N,isNumeric:w}=e;return t("intersect",{"Array, Array, Array":D,"Array, Array, Array, Array":b,"Matrix, Matrix, Matrix":function(H,V,W){var ee=D(H.valueOf(),V.valueOf(),W.valueOf());return ee===null?null:u(ee)},"Matrix, Matrix, Matrix, Matrix":function(H,V,W,ee){var ie=b(H.valueOf(),V.valueOf(),W.valueOf(),ee.valueOf());return ie===null?null:u(ie)}});function D(z,H,V){if(z=O(z),H=O(H),V=O(V),!I(z))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(z[0],z[1],z[2],H[0],H[1],H[2],V[0],V[1],V[2],V[3])}function b(z,H,V,W){if(z=O(z),H=O(H),V=O(V),W=O(W),z.length===2){if(!M(z))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(z,H,V,W)}else if(z.length===3){if(!I(z))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(z[0],z[1],z[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(z){return z.length===1?z[0]:z.length>1&&Array.isArray(z[0])&&z.every(H=>Array.isArray(H)&&H.length===1)?y(z):z}function M(z){return z.length===2&&w(z[0])&&w(z[1])}function I(z){return z.length===3&&w(z[0])&&w(z[1])&&w(z[2])}function F(z){return z.length===4&&w(z[0])&&w(z[1])&&w(z[2])&&w(z[3])}function C(z,H,V,W){var ee=z,ie=V,X=f(ee,H),Z=f(ie,W),le=f(a(X[0],Z[1]),a(Z[0],X[1]));if(N(le)||p(n(le),r.epsilon))return null;var re=a(Z[0],ee[1]),he=a(Z[1],ee[0]),De=a(Z[0],ie[1]),ye=a(Z[1],ie[0]),ce=s(o(f(f(re,he),De),ye),le);return i(l(X,ce),ee)}function P(z,H,V,W,ee,ie,X,Z,le,re,he,De){var ye=a(f(z,H),f(V,W)),ce=a(f(ee,ie),f(X,Z)),Ne=a(f(le,re),f(he,De));return o(o(ye,ce),Ne)}function R(z,H,V,W,ee,ie,X,Z,le,re,he,De){var ye=P(z,X,re,X,H,Z,he,Z,V,le,De,le),ce=P(re,X,W,z,he,Z,ee,H,De,le,ie,V),Ne=P(z,X,W,z,H,Z,ee,H,V,le,ie,V),Pe=P(re,X,re,X,he,Z,he,Z,De,le,De,le),Ce=P(W,z,W,z,ee,H,ee,H,ie,V,ie,V),Oe=f(a(ye,ce),a(Ne,Pe)),He=f(a(Ce,Pe),a(ce,ce));if(N(He))return null;var Ee=s(Oe,He),ze=s(o(ye,a(Ee,ce)),Pe),We=o(z,a(Ee,f(W,z))),Be=o(H,a(Ee,f(ee,H))),lt=o(V,a(Ee,f(ie,V))),ct=o(X,a(ze,f(re,X))),de=o(Z,a(ze,f(he,Z))),be=o(le,a(ze,f(De,le)));return h(We,ct)&&h(Be,de)&&h(lt,be)?[We,Be,lt]:null}function q(z,H,V,W,ee,ie,X,Z,le,re){var he=a(z,X),De=a(W,X),ye=a(H,Z),ce=a(ee,Z),Ne=a(V,le),Pe=a(ie,le),Ce=f(f(f(re,he),ye),Ne),Oe=f(f(f(o(o(De,ce),Pe),he),ye),Ne),He=s(Ce,Oe),Ee=o(z,a(He,f(W,z))),ze=o(H,a(He,f(ee,H))),We=o(V,a(He,f(ie,V)));return[Ee,ze,We]}});v();x();g();var mq="sum",ace=["typed","config","add","numeric"],Pw=K(mq,ace,e=>{var{typed:t,config:r,add:n,numeric:i}=e;return t(mq,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":u,"...":function(a){if(Ha(a))throw new TypeError("Scalar values expected in function sum");return o(a)}});function o(l){var a;return fo(l,function(s){try{a=a===void 0?s:n(a,s)}catch(f){throw Mn(f,"sum",s)}}),a===void 0&&(a=i(0,r.number)),typeof a=="string"&&(a=i(a,r.number)),a}function u(l,a){try{var s=Of(l,a,n);return s}catch(f){throw Mn(f,"sum")}}});v();x();g();var Rw="cumsum",sce=["typed","add","unaryPlus"],qw=K(Rw,sce,e=>{var{typed:t,add:r,unaryPlus:n}=e;return t(Rw,{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(Ha(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 Mn(s,Rw)}}function o(a){if(a.length===0)return[];for(var s=[n(a[0])],f=1;f=f.length)throw new Si(s,f.length);try{return l(a,s)}catch(p){throw Mn(p,Rw)}}function l(a,s){var f,p,h;if(s<=0){var y=a[0][0];if(Array.isArray(y)){for(h=Ly(a),p=[],f=0;f{var{typed:t,add:r,divide:n}=e;return t(hq,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":i,"...":function(l){if(Ha(l))throw new TypeError("Scalar values expected in function mean");return o(l)}});function i(u,l){try{var a=Of(u,l,r),s=Array.isArray(u)?Ht(u):u.size();return n(a,s[l])}catch(f){throw Mn(f,"mean")}}function o(u){var l,a=0;if(fo(u,function(s){try{l=l===void 0?s:r(l,s),a++}catch(f){throw Mn(f,"mean",s)}}),a===0)throw new Error("Cannot calculate the mean of an empty array");return n(l,a)}});v();x();g();var dq="median",lce=["typed","add","divide","compare","partitionSelect"],vq=K(dq,lce,e=>{var{typed:t,add:r,divide:n,compare:i,partitionSelect:o}=e;function u(s){try{s=rr(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],N=0;N0&&(y=s[N]);return a(y,h)}else{var w=o(s,(f-1)/2);return l(w)}}catch(D){throw Mn(D,"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(dq,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(f,p){throw new Error("median(A, dim) is not yet supported")},"...":function(f){if(Ha(f))throw new TypeError("Scalar values expected in function median");return u(f)}})});v();x();g();var gq="mad",fce=["typed","abs","map","median","subtract"],xq=K(gq,fce,e=>{var{typed:t,abs:r,map:n,median:i,subtract:o}=e;return t(gq,{"Array | Matrix":u,"...":function(a){return u(a)}});function u(l){if(l=rr(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.indexOf("median")!==-1?new TypeError(s.message.replace("median","mad")):Mn(s,"mad")}}});v();x();g();var kA="unbiased",yq="variance",cce=["typed","add","subtract","multiply","divide","apply","isNaN"],Uw=K(yq,cce,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:o,apply:u,isNaN:l}=e;return t(yq,{"Array | Matrix":function(p){return a(p,kA)},"Array | Matrix, string":a,"Array | Matrix, number | BigNumber":function(p,h){return s(p,h,kA)},"Array | Matrix, number | BigNumber, string":s,"...":function(p){return a(p,kA)}});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(fo(f,function(D){try{h=h===void 0?D:r(h,D),y++}catch(b){throw Mn(b,"variance",D)}}),y===0)throw new Error("Cannot calculate variance of an empty array");var N=o(h,y);if(h=void 0,fo(f,function(D){var b=n(D,N);h=h===void 0?i(b,b):r(h,i(b,b))}),l(h))return h;switch(p){case"uncorrected":return o(h,y);case"biased":return o(h,y+1);case"unbiased":{var w=_t(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 Mn(y,"variance")}}});v();x();g();var wq="quantileSeq",pce=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],Hw=K(wq,pce,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=wh({typed:t,isInteger:s});return t(wq,{"Array | Matrix, number | BigNumber":(O,M)=>w(O,M,!1),"Array | Matrix, number | BigNumber, number":(O,M,I)=>N(O,M,!1,I,w),"Array | Matrix, number | BigNumber, boolean":w,"Array | Matrix, number | BigNumber, boolean, number":(O,M,I,F)=>N(O,M,I,F,w),"Array | Matrix, Array | Matrix":(O,M)=>D(O,M,!1),"Array | Matrix, Array | Matrix, number":(O,M,I)=>N(O,M,!1,I,D),"Array | Matrix, Array | Matrix, boolean":D,"Array | Matrix, Array | Matrix, boolean, number":(O,M,I,F)=>N(O,M,I,F,D)});function N(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 Ut(M)?b(C,M,I):r(b(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(b(C,q,I))}return Ut(M)?F:r(F)}}function D(O,M,I){for(var F=O.valueOf(),C=M.valueOf(),P=[],R=0;R0&&(z=F[V])}return n(u(z,i(1,q)),u(H,q))}});v();x();g();var bq="std",mce=["typed","map","sqrt","variance"],$w=K(bq,mce,e=>{var{typed:t,map:r,sqrt:n,variance:i}=e;return t(bq,{"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.indexOf(" variance")!==-1?new TypeError(s.message.replace(" variance"," std")):s}}});v();x();g();var Dq="corr",hce=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],Nq=K(Dq,hce,e=>{var{typed:t,matrix:r,sqrt:n,sum:i,add:o,subtract:u,multiply:l,pow:a,divide:s}=e;return t(Dq,{"Array, Array":function(y,N){return f(y,N)},"Matrix, Matrix":function(y,N){var w=f(y.toArray(),N.toArray());return Array.isArray(w)?r(w):w}});function f(h,y){var N=[];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(N,b),l(w,D)),F=n(l(u(l(N,O),a(w,2)),u(l(N,M),a(D,2))));return s(I,F)}});v();x();g();var Sq="combinations",dce=["typed"],Aq=K(Sq,dce,e=>{var{typed:t}=e;return t(Sq,{"number, number":VE,"BigNumber, BigNumber":function(n,i){var o=n.constructor,u,l,a=n.minus(i),s=new o(1);if(!Eq(n)||!Eq(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 Eq(e){return e.isInteger()&&e.gte(0)}v();x();g();var Cq="combinationsWithRep",vce=["typed"],Tq=K(Cq,vce,e=>{var{typed:t}=e;return t(Cq,{"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 Cg(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(lp[0],0),y=1;y2;)h-=2,N+=h,y=y.times(N);return new o(y.toPrecision(o.precision))}});v();x();g();var Fq="lgamma",xce=["Complex","typed"],_q=K(Fq,xce,e=>{var{Complex:t,typed:r}=e,n=7,i=7,o=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return r(Fq,{number:Mg,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(Mg(s.re),0);if(s.re>=n||Math.abs(s.im)>=i)return l(s);if(s.re<=h){var y=nF(f,s.im)*Math.floor(.5*s.re+.25),N=s.mul(Math.PI).sin().log(),w=u(new t(1-s.re,-s.im));return new t(p,y).sub(N).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(QE),p=new t(1,0).div(s),h=p.div(s),y=o[0],N=o[1],w=2*h.re,D=h.re*h.re+h.im*h.im,b=2;b<8;b++){var O=N;N=-D*y+o[b],y=w*y+O}var M=p.mul(h.mul(y).add(N));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))}});v();x();g();var kq="factorial",yce=["typed","gamma"],Bq=K(kq,yce,e=>{var{typed:t,gamma:r}=e;return t(kq,{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=>Tt(i,n))})});v();x();g();var Lq="kldivergence",wce=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],Pq=K(Lq,wce,e=>{var{typed:t,matrix:r,divide:n,sum:i,multiply:o,map:u,dotDivide:l,log:a,isNumeric:s}=e;return t(Lq,{"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,N=p.size().length;if(y>1)throw new Error("first object must be one dimensional");if(N>1)throw new Error("second object must be one dimensional");if(y!==N)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 D=i(h);if(D===0)throw new Error("Sum of elements in second object must be non zero");var b=n(p,i(p)),O=n(h,i(h)),M=i(o(b,u(l(b,O),I=>a(I))));return s(M)?M:Number.NaN}});v();x();g();var Rq="multinomial",bce=["typed","add","divide","multiply","factorial","isInteger","isPositive"],qq=K(Rq,bce,e=>{var{typed:t,add:r,divide:n,multiply:i,factorial:o,isInteger:u,isPositive:l}=e;return t(Rq,{"Array | Matrix":function(s){var f=0,p=1;return fo(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)}})});v();x();g();var zq="permutations",Dce=["typed","factorial"],Hq=K(zq,Dce,e=>{var{typed:t,factorial:r}=e;return t(zq,{"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 ha(i-o+1,i)},"BigNumber, BigNumber":function(i,o){var u,l;if(!Uq(i)||!Uq(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 Uq(e){return e.isInteger()&&e.gte(0)}v();x();g();v();x();g();var UA=jr(az(),1),Oce=(0,UA.default)(Date.now());function pl(e){var t;function r(i){t=i===null?Oce:(0,UA.default)(String(i))}r(e);function n(){return t()}return n}var sz="pickRandom",Ice=["typed","config","?on"],uz=K(sz,Ice,e=>{var{typed:t,config:r,on:n}=e,i=pl(r.randomSeed);return n&&n("config",function(u,l){u.randomSeed!==l.randomSeed&&(i=pl(u.randomSeed))}),t(sz,{"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=rr(u),s=rr(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 N=0,w=s.length;N"u")O=u[Math.floor(i()*D)];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=pl(r.randomSeed);return n&&n("config",function(l,a){l.randomSeed!==a.randomSeed&&(i=pl(l.randomSeed))}),t(lz,{"":()=>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=_g(l.valueOf(),()=>u(a,s));return St(l)?l.create(f):f}function u(l,a){return l+i()*(a-l)}});v();x();g();var cz="randomInt",_ce=["typed","config","?on"],pz=K(cz,_ce,e=>{var{typed:t,config:r,on:n}=e,i=pl(r.randomSeed);return n&&n("config",function(l,a){l.randomSeed!==a.randomSeed&&(i=pl(l.randomSeed))}),t(cz,{"":()=>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=_g(l.valueOf(),()=>u(a,s));return St(l)?l.create(f):f}function u(l,a){return Math.floor(l+i()*(a-l))}});v();x();g();var mz="stirlingS2",kce=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],hz=K(mz,kce,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,N=[],w=[];return t(mz,{"number | BigNumber, number | BigNumber":function(b,O){if(!f(b)||s(b)||!f(O)||s(O))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(y(O,b))throw new TypeError("k must be less than or equal to n in function stirlingS2");var M=!(Ut(b)&&Ut(O)),I=M?w:N,F=M?h:p,C=p(b),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],z=I[R-1],H=q.length;H<=R&&H<=P;++H)H===R?q[H]=1:q[H]=r(i(F(H),z[H]),z[H-1]);return I[C][P]}})});v();x();g();var dz="bellNumbers",Bce=["typed","addScalar","isNegative","isInteger","stirlingS2"],vz=K(dz,Bce,e=>{var{typed:t,addScalar:r,isNegative:n,isInteger:i,stirlingS2:o}=e;return t(dz,{"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}})});v();x();g();var gz="catalan",Lce=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],xz=K(gz,Lce,e=>{var{typed:t,addScalar:r,divideScalar:n,multiplyScalar:i,combinations:o,isNegative:u,isInteger:l}=e;return t(gz,{"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))}})});v();x();g();var yz="composition",Pce=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],wz=K(yz,Pce,e=>{var{typed:t,addScalar:r,combinations:n,isPositive:i,isNegative:o,isInteger:u,larger:l}=e;return t(yz,{"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))}})});v();x();g();var bz="leafCount",Rce=["parse","typed"],Dz=K(bz,Rce,e=>{var{parse:t,typed:r}=e;function n(i){var o=0;return i.forEach(u=>{o+=n(u)}),o||1}return r(bz,{Node:function(o){return n(o)}})});v();x();g();v();x();g();function HA(e){return ir(e)||Zr(e)&&e.isUnary()&&ir(e.args[0])}function kg(e){return!!(ir(e)||(Ji(e)||Zr(e))&&e.args.every(kg)||Di(e)&&kg(e.content))}v();x();g();function Nz(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 $A(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:Zr(M)?C=M.fn.toString():Ji(M)?C=M.name:Di(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=$A({},M);for(var C in I)Et(M,C)?F[C]=$A($A({},I[C]),M[C]):F[C]=I[C];return F}function N(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 b(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 Zr(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:N,allChildren:w,unflattenr:D,unflattenl:b,defaultContext:l,realContext:a,positiveContext:s}});var Uce="simplify",Hce=["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"],Sz=K(Uce,Hce,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:N,bignumber:w,mathWithTransform:D,matrix:b,AccessorNode:O,ArrayNode:M,ConstantNode:I,FunctionNode:F,IndexNode:C,ObjectNode:P,OperatorNode:R,ParenthesisNode:q,SymbolNode:z}=e,{hasProperty:H,isCommutative:V,isAssociative:W,mergeContext:ee,flatten:ie,unflattenr:X,unflattenl:Z,createMakeNodeFunction:le,defaultContext:re,realContext:he,positiveContext:De}=Th({FunctionNode:F,OperatorNode:R,SymbolNode:z});r.addConversion({from:"Object",to:"Map",convert:ul});var ye=r("simplify",{Node:Ee,"Node, Map":(ve,Re)=>Ee(ve,!1,Re),"Node, Map, Object":(ve,Re,ke)=>Ee(ve,!1,Re,ke),"Node, Array":Ee,"Node, Array, Map":Ee,"Node, Array, Map, Object":Ee});r.removeConversion({from:"Object",to:"Map",convert:ul}),ye.defaultContext=re,ye.realContext=he,ye.positiveContext=De;function ce(ve){return ve.transform(function(Re,ke,Je){return Di(Re)?ce(Re.content):Re})}var Ne={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};ye.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(ve,Re){var ke={};if(ve.s){var Je=ve.s.split("->");if(Je.length===2)ke.l=Je[0],ke.r=Je[1];else throw SyntaxError("Could not parse rule: "+ve.s)}else ke.l=ve.l,ke.r=ve.r;ke.l=ce(n(ke.l)),ke.r=ce(n(ke.r));for(var ot of["imposeContext","repeat","assuming"])ot in ve&&(ke[ot]=ve[ot]);if(ve.evaluate&&(ke.evaluate=n(ve.evaluate)),W(ke.l,Re)){var et=!V(ke.l,Re),ut;et&&(ut=He());var Lt=le(ke.l),fe=He();ke.expanded={},ke.expanded.l=Lt([ke.l,fe]),ie(ke.expanded.l,Re),X(ke.expanded.l,Re),ke.expanded.r=Lt([ke.r,fe]),et&&(ke.expandedNC1={},ke.expandedNC1.l=Lt([ut,ke.l]),ke.expandedNC1.r=Lt([ut,ke.r]),ke.expandedNC2={},ke.expandedNC2.l=Lt([ut,ke.expanded.l]),ke.expandedNC2.r=Lt([ut,ke.expanded.r]))}return ke}function Ce(ve,Re){for(var ke=[],Je=0;Je2&&arguments[2]!==void 0?arguments[2]:Ef(),Je=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},ot=Je.consoleDebug;Re=Ce(Re||ye.rules,Je.context);var et=p(ve,ke);et=ce(et);for(var ut={},Lt=et.toString({parenthesis:"all"});!ut[Lt];){ut[Lt]=!0,Oe=0;var fe=Lt;ot&&console.log("Working on: ",Lt);for(var J=0;J ").concat(Re[J].r.toString()))),ot){var ne=et.toString({parenthesis:"all"});ne!==fe&&(console.log("Applying",j,"produced",ne),fe=ne)}Z(et,Je.context)}Lt=et.toString({parenthesis:"all"})}return et}function ze(ve,Re,ke){var Je=ve;if(ve)for(var ot=0;ot1&&(fe=et(ve.args.slice(0,Lt))),ot=ve.args.slice(Lt),Je=ot.length===1?ot[0]:et(ot),ke.push(et([fe,Je]))}return ke}function lt(ve,Re){var ke={placeholders:{}};if(!ve.placeholders&&!Re.placeholders)return ke;if(ve.placeholders){if(!Re.placeholders)return ve}else return Re;for(var Je in ve.placeholders)if(Et(ve.placeholders,Je)&&(ke.placeholders[Je]=ve.placeholders[Je],Et(Re.placeholders,Je)&&!Ue(ve.placeholders[Je],Re.placeholders[Je])))return null;for(var ot in Re.placeholders)Et(Re.placeholders,ot)&&(ke.placeholders[ot]=Re.placeholders[ot]);return ke}function ct(ve,Re){var ke=[];if(ve.length===0||Re.length===0)return ke;for(var Je,ot=0;ot2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var fe=be(ve.args[0],Re.args[1],ke);if(fe.length===0)return[];var J=be(ve.args[1],Re.args[0],ke);if(J.length===0)return[];et=[fe,J]}ot=de(et)}else if(Re.args.length>=2&&ve.args.length===2){for(var j=Be(Re,ke),ne=[],pe=0;pe2)throw Error("Unexpected non-binary associative function: "+ve.toString());return[]}}else if(ve instanceof z){if(ve.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(Ne[ve.name]){if(ve.name!==Re.name)return[]}else switch(ve.name[1]>="a"&&ve.name[1]<="z"?ve.name.substring(0,2):ve.name[0]){case"n":case"_p":ot[0].placeholders[ve.name]=Re;break;case"c":case"cl":if(ir(Re))ot[0].placeholders[ve.name]=Re;else return[];break;case"v":if(!ir(Re))ot[0].placeholders[ve.name]=Re;else return[];break;case"vl":if(Rr(Re))ot[0].placeholders[ve.name]=Re;else return[];break;case"cd":if(HA(Re))ot[0].placeholders[ve.name]=Re;else return[];break;case"vd":if(!HA(Re))ot[0].placeholders[ve.name]=Re;else return[];break;case"ce":if(kg(Re))ot[0].placeholders[ve.name]=Re;else return[];break;case"ve":if(!kg(Re))ot[0].placeholders[ve.name]=Re;else return[];break;default:throw new Error("Invalid symbol in rule: "+ve.name)}}else if(ve instanceof I){if(!f(ve.value,Re.value))return[]}else return[];return ot}function Ue(ve,Re){if(ve instanceof I&&Re instanceof I){if(!f(ve.value,Re.value))return!1}else if(ve instanceof z&&Re instanceof z){if(ve.name!==Re.name)return!1}else if(ve instanceof R&&Re instanceof R||ve instanceof F&&Re instanceof F){if(ve instanceof R){if(ve.op!==Re.op||ve.fn!==Re.fn)return!1}else if(ve instanceof F&&ve.name!==Re.name)return!1;if(ve.args.length!==Re.args.length)return!1;for(var ke=0;ke{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:N}=e,{isCommutative:w,isAssociative:D,allChildren:b,createMakeNodeFunction:O}=Th({FunctionNode:f,OperatorNode:y,SymbolNode:N}),M=t("simplifyConstant",{Node:ie=>P(ee(ie,{})),"Node, Object":function(X,Z){return P(ee(X,Z))}});function I(ie){return pa(ie)?ie.valueOf():ie instanceof Array?ie.map(I):St(ie)?i(I(ie.valueOf())):ie}function F(ie,X,Z){try{return n[ie].apply(null,X)}catch{return X=X.map(I),q(n[ie].apply(null,X),Z)}}var C=t({Fraction:H,number:function(X){return X<0?z(new s(-X)):new s(X)},BigNumber:function(X){return X<0?z(new s(-X)):new s(X)},Complex:function(X){throw new Error("Cannot convert Complex number to Node")},string:function(X){return new s(X)},Matrix:function(X){return new a(X.valueOf().map(Z=>C(Z)))}});function P(ie){return lr(ie)?ie:C(ie)}function R(ie,X){var Z=X&&X.exactFractions!==!1;if(Z&&isFinite(ie)&&o){var le=o(ie),re=X&&typeof X.fractionsLimit=="number"?X.fractionsLimit:1/0;if(le.valueOf()===ie&&le.n0;)if(ir(le[0])&&typeof le[0].value!="string"){var re=q(le.shift().value,Z);bi(ie)?ie=ie.items[re-1]:(ie=ie.valueOf()[re-1],ie instanceof Array&&(ie=i(ie)))}else if(le.length>1&&ir(le[1])&&typeof le[1].value!="string"){var he=q(le[1].value,Z),De=[],ye=bi(ie)?ie.items:ie.valueOf();for(var ce of ye)if(bi(ce))De.push(ce.items[he-1]);else if(St(ie))De.push(ce[he-1]);else break;if(De.length===ye.length)bi(ie)?ie=new a(De):ie=i(De),le.splice(1,1);else break}else break;return le.length===X.dimensions.length?new l(P(ie),X):le.length>0?(X=new p(le),new l(P(ie),X)):ie}if(gu(ie)&&X.dimensions.length===1&&ir(X.dimensions[0])){var Ne=X.dimensions[0].value;return Ne in ie.properties?ie.properties[Ne]:new s}return new l(P(ie),X)}function W(ie,X,Z,le){var re=X.shift(),he=X.reduce((De,ye)=>{if(!lr(ye)){var ce=De.pop();if(lr(ce))return[ce,ye];try{return De.push(F(ie,[ce,ye],le)),De}catch{De.push(ce)}}De.push(P(De.pop()));var Ne=De.length===1?De[0]:Z(De);return[Z([Ne,P(ye)])]},[re]);return he.length===1?he[0]:Z([he[0],C(he[1])])}function ee(ie,X){switch(ie.type){case"SymbolNode":return ie;case"ConstantNode":switch(typeof ie.value){case"number":return q(ie.value,X);case"string":return ie.value;default:if(!isNaN(ie.value))return q(ie.value,X)}return ie;case"FunctionNode":if(n[ie.name]&&n[ie.name].rawArgs)return ie;{var Z=["add","multiply"];if(Z.indexOf(ie.name)===-1){var le=ie.args.map(We=>ee(We,X));if(!le.some(lr))try{return F(ie.name,le,X)}catch{}if(ie.name==="size"&&le.length===1&&bi(le[0])){for(var re=[],he=le[0];bi(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(),ye,ce,Ne=O(ie);if(Zr(ie)&&ie.isUnary())ye=[ee(ie.args[0],X)],lr(ye[0])?ce=Ne(ye):ce=F(De,ye,X);else if(D(ie,X.context))if(ye=b(ie,X.context),ye=ye.map(We=>ee(We,X)),w(De,X.context)){for(var Pe=[],Ce=[],Oe=0;Oe1?(ce=W(De,Pe,Ne,X),Ce.unshift(ce),ce=W(De,Ce,Ne,X)):ce=W(De,ye,Ne,X)}else ce=W(De,ye,Ne,X);else ye=ie.args.map(We=>ee(We,X)),ce=W(De,ye,Ne,X);return ce}case"ParenthesisNode":return ee(ie.content,X);case"AccessorNode":return V(ee(ie.object,X),ee(ie.index,X),X);case"ArrayNode":{var He=ie.items.map(We=>ee(We,X));return He.some(lr)?new a(He.map(P)):i(He)}case"IndexNode":return new p(ie.dimensions.map(We=>M(We,X)));case"ObjectNode":{var Ee={};for(var ze in ie.properties)Ee[ze]=M(ie.properties[ze],X);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});v();x();g();var Az="simplifyCore",Vce=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],Cz=K(Az,Vce,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:N,ObjectNode:w,OperatorNode:D,ParenthesisNode:b,SymbolNode:O}=e,M=new h(0),I=new h(1),F=new h(!0),C=new h(!1);function P(H){return Zr(H)&&["and","not","or"].includes(H.op)}var{hasProperty:R,isCommutative:q}=Th({FunctionNode:y,OperatorNode:D,SymbolNode:O});function z(H){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W=V?V.context:void 0;if(R(H,"trivial",W)){if(Ji(H)&&H.args.length===1)return z(H.args[0],V);var ee=!1,ie=0;if(H.forEach(Ce=>{++ie,ie===1&&(ee=z(Ce,V))}),ie===1)return ee}var X=H;if(Ji(X)){var Z=v6(X.name);if(Z){if(X.args.length>2&&R(X,"associative",W))for(;X.args.length>2;){var le=X.args.pop(),re=X.args.pop();X.args.push(new D(Z,X.name,[le,re]))}X=new D(Z,X.name,X.args)}else return new y(z(X.fn),X.args.map(Ce=>z(Ce,V)))}if(Zr(X)&&X.isUnary()){var he=z(X.args[0],V);if(X.op==="~"&&Zr(he)&&he.isUnary()&&he.op==="~"||X.op==="not"&&Zr(he)&&he.isUnary()&&he.op==="not"&&P(he.args[0]))return he.args[0];var De=!0;if(X.op==="-"&&Zr(he)&&(he.isBinary()&&he.fn==="subtract"&&(X=new D("-","subtract",[he.args[1],he.args[0]]),De=!1),he.isUnary()&&he.op==="-"))return he.args[0];if(De)return new D(X.op,X.fn,[he])}if(Zr(X)&&X.isBinary()){var ye=z(X.args[0],V),ce=z(X.args[1],V);if(X.op==="+"){if(ir(ye)&&i(ye.value))return ce;if(ir(ce)&&i(ce.value))return ye;Zr(ce)&&ce.isUnary()&&ce.op==="-"&&(ce=ce.args[0],X=new D("-","subtract",[ye,ce]))}if(X.op==="-")return Zr(ce)&&ce.isUnary()&&ce.op==="-"?z(new D("+","add",[ye,ce.args[0]]),V):ir(ye)&&i(ye.value)?z(new D("-","unaryMinus",[ce])):ir(ce)&&i(ce.value)?ye:new D(X.op,X.fn,[ye,ce]);if(X.op==="*"){if(ir(ye)){if(i(ye.value))return M;if(n(ye.value,1))return ce}if(ir(ce)){if(i(ce.value))return M;if(n(ce.value,1))return ye;if(q(X,W))return new D(X.op,X.fn,[ce,ye],X.implicit)}return new D(X.op,X.fn,[ye,ce],X.implicit)}if(X.op==="/")return ir(ye)&&i(ye.value)?M:ir(ce)&&n(ce.value,1)?ye:new D(X.op,X.fn,[ye,ce]);if(X.op==="^"&&ir(ce)){if(i(ce.value))return I;if(n(ce.value,1))return ye}if(X.op==="and"){if(ir(ye))if(ye.value){if(P(ce))return ce;if(ir(ce))return ce.value?F:C}else return C;if(ir(ce))if(ce.value){if(P(ye))return ye}else return C}if(X.op==="or"){if(ir(ye)){if(ye.value)return F;if(P(ce))return ce}if(ir(ce)){if(ce.value)return F;if(P(ye))return ye}}return new D(X.op,X.fn,[ye,ce])}if(Zr(X))return new D(X.op,X.fn,X.args.map(Ce=>z(Ce,V)));if(bi(X))return new p(X.items.map(Ce=>z(Ce,V)));if(To(X))return new f(z(X.object,V),z(X.index,V));if(Ho(X))return new N(X.dimensions.map(Ce=>z(Ce,V)));if(gu(X)){var Ne={};for(var Pe in X.properties)Ne[Pe]=z(X.properties[Pe],V);return new w(Ne)}return X}return t(Az,{Node:z,"Node,Object":z})});v();x();g();var Gce="resolve",Yce=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],Mz=K(Gce,Yce,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(Rr(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(lr(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(Zr(a)){var N=a.args.map(function(D){return l(D,s,f)});return new o(a.op,a.fn,N,a.implicit)}else{if(Di(a))return new u(l(a.content,s,f));if(Ji(a)){var w=a.args.map(function(D){return l(D,s,f)});return new i(a.name,w)}}return a.map(D=>l(D,s,f))}return t("resolve",{Node:l,"Node, Map | null | undefined":l,"Node, Object":(a,s)=>l(a,ul(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,ul(f))),"Matrix, Object":t.referTo("Matrix,Map",a=>(s,f)=>a(s,ul(f))),"Array | Matrix, Map":t.referToSelf(a=>(s,f)=>s.map(p=>a(p,f)))})});v();x();g();var Tz="symbolicEqual",Zce=["parse","simplify","typed","OperatorNode"],Oz=K(Tz,Zce,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 ir(f)&&!f.value}return n(Tz,{"Node, Node":o,"Node, Node, Object":o})});v();x();g();var Iz="derivative",Xce=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],Fz=K(Iz,Xce,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={};D(C,M,I.name);var P=b(M,C);return F.simplify?i(P):P}t.addConversion({from:"identifier",to:"SymbolNode",convert:n});var N=t(Iz,{"Node, SymbolNode":y,"Node, SymbolNode, Object":y});t.removeConversion({from:"identifier",to:"SymbolNode",convert:n}),N._simplify=!0,N.toTex=function(M){return w.apply(null,M.args)};var w=t("_derivTex",{"Node, SymbolNode":function(I,F){return ir(I)&&dr(I.value)==="string"?w(n(I.value).toString(),F.toString(),1):w(I.toTex(),F.toString(),1)},"Node, ConstantNode":function(I,F){if(dr(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]")}}),D=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 D(I,F.content,C)},"Object, FunctionAssignmentNode, string":function(I,F,C){return F.params.indexOf(C)===-1?(I[F]=!0,!0):D(I,F.expr,C)},"Object, FunctionNode | OperatorNode, string":function(I,F,C){if(F.args.length>0){for(var P=D(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(b(R,F));return new f("*","multiply",q)}return new f("+","add",I.args.map(function(ie){return new f("*","multiply",I.args.map(function(X){return X===ie?b(X,F):X.clone()}))}))}if(I.op==="/"&&I.isBinary()){var z=I.args[0],H=I.args[1];return F[H]!==void 0?new f("/","divide",[b(z,F),H]):F[z]!==void 0?new f("*","multiply",[new f("-","unaryMinus",[z]),new f("/","divide",[b(H,F),new f("^","pow",[H.clone(),O(2)])])]):new f("/","divide",[new f("-","subtract",[new f("*","multiply",[b(z,F),H.clone()]),new f("*","multiply",[z.clone(),b(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 ir(V)&&(u(V.value)||o(V.value,1))?O(0):new f("*","multiply",[I,new f("*","multiply",[new s("log",[V.clone()]),b(W.clone(),F)])]);if(F[W]!==void 0){if(ir(W)){if(u(W.value))return O(0);if(o(W.value,1))return b(V,F)}var ee=new f("^","pow",[V.clone(),new f("-","subtract",[W,O(1)])]);return new f("*","multiply",[W.clone(),new f("*","multiply",[b(V,F),ee])])}return new f("*","multiply",[new f("^","pow",[V.clone(),W.clone()]),new f("+","add",[new f("*","multiply",[b(V,F),new f("/","divide",[W.clone(),V.clone()])]),new f("*","multiply",[b(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||r.number))}return N});v();x();g();var _z="rationalize",Kce=["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"],kz=K(_z,Kce,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:N,bignumber:w,mathWithTransform:D,matrix:b,AccessorNode:O,ArrayNode:M,ConstantNode:I,FunctionNode:F,IndexNode:C,ObjectNode:P,OperatorNode:R,SymbolNode:q,ParenthesisNode:z}=e;function H(X){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(X,Z,!0,re.firstRules),De=he.variables.length,ye={exactFractions:!1},ce={exactFractions:!0};if(X=he.expression,De>=1){X=ee(X);var Ne,Pe,Ce=!0,Oe=!1;X=y(X,re.firstRules,{},ye);for(var He;Pe=Ce?re.distrDivRules:re.sucDivRules,X=y(X,Pe,{},ce),Ce=!Ce,He=X.toString(),He!==Ne;)Oe=!0,Ne=He;Oe&&(X=y(X,re.firstRulesAgain,{},ye)),X=y(X,re.finalRules,{},ye)}var Ee=[],ze={};return X.type==="OperatorNode"&&X.isBinary()&&X.op==="/"?(De===1&&(X.args[0]=ie(X.args[0],Ee),X.args[1]=ie(X.args[1])),le&&(ze.numerator=X.args[0],ze.denominator=X.args[1])):(De===1&&(X=ie(X,Ee)),le&&(ze.numerator=X,ze.denominator=null)),le?(ze.coefficients=Ee,ze.variables=he.variables,ze.expression=X,ze):X}return r(_z,{Node:H,"Node, boolean":(X,Z)=>H(X,{},Z),"Node, Object":H,"Node, Object, boolean":H});function V(X,Z,le,re){var he=[],De=y(X,re,Z,{exactFractions:!1});le=!!le;var ye="+-*"+(le?"/":"");Ne(De);var ce={};return ce.expression=De,ce.variables=he,ce;function Ne(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");Ne(Pe.args[0])}else{if(ye.indexOf(Pe.op)===-1)throw new Error("Operator "+Pe.op+" invalid in polynomial expression");for(var Oe=0;Oe1;if(re==="OperatorNode"&&X.isBinary()){var De=!1,ye;if(X.op==="^"&&(X.args[0].type==="ParenthesisNode"||X.args[0].type==="OperatorNode")&&X.args[1].type==="ConstantNode"&&(ye=parseFloat(X.args[1].value),De=ye>=2&&Nt(ye)),De){if(ye>2){var ce=X.args[0],Ne=new R("^","pow",[X.args[0].cloneDeep(),new I(ye-1)]);X=new R("*","multiply",[ce,Ne])}else X=new R("*","multiply",[X.args[0],X.args[0].cloneDeep()]);he&&(le==="content"?Z.content=X:Z.args[le]=X)}}if(re==="ParenthesisNode")ee(X.content,X,"content");else if(re!=="ConstantNode"&&re!=="SymbolNode")for(var Pe=0;Pe=0;ce--)if(Z[ce]!==0){var Ne=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?Ne=new R("-","unaryMinus",[Ce]):Math.abs(Z[ce])===1?Ne=Ce:Ne=new R("*","multiply",[Ne,Ce])}De?ye=Ne:Pe==="+"?ye=new R("+","add",[ye,Ne]):ye=new R("-","subtract",[ye,Ne]),De=!1}if(De)return new I(0);return ye;function He(Ee,ze,We){var Be=Ee.type;if(Be==="FunctionNode")throw new Error("There is an unsolved function call");if(Be==="OperatorNode"){if("+-*^".indexOf(Ee.op)===-1)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 "+Be+" is not allowed")}}});v();x();g();var Bz="zpk2tf",Jce=["typed","add","multiply","Complex","number"],Lz=K(Bz,Jce,e=>{var{typed:t,add:r,multiply:n,Complex:i,number:o}=e;return t(Bz,{"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(Pz,{"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:N}=l(f.valueOf(),p.valueOf(),h);return{w:u(y),h:u(N)}},"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:N}=l(f.valueOf(),p.valueOf(),y);return{h:u(N),w:u(y)}}});function l(s,f,p){for(var h=[],y=[],N=0;N{var{classes:t}=e;return function(n,i){var o=t[i&&i.mathjs];return o&&typeof o.fromJSON=="function"?o.fromJSON(i):i}});v();x();g();var tpe="replacer",rpe=[],zz=K(tpe,rpe,()=>function(t,r){return typeof r=="number"&&(!isFinite(r)||isNaN(r))?{mathjs:"number",value:String(r)}:r});v();x();g();v();x();g();var Uz="12.4.2";var Hz=K("true",[],()=>!0),$z=K("false",[],()=>!1),Wz=K("null",[],()=>null),Vz=va("Infinity",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1/0):1/0}),Gz=va("NaN",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(NaN):NaN}),Yz=va("pi",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?Ig(r):e_}),Zz=va("tau",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?_B(r):t_}),Xz=va("e",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?IB(r):r_}),Kz=va("phi",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?FB(r):n_}),Jz=va("LN2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(2).ln():Math.LN2}),Qz=va("LN10",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(10).ln():Math.LN10}),jz=va("LOG2E",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1).div(new r(2).ln()):Math.LOG2E}),eU=va("LOG10E",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1).div(new r(10).ln()):Math.LOG10E}),tU=va("SQRT1_2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r("0.5").sqrt():Math.SQRT1_2}),rU=va("SQRT2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(2).sqrt():Math.SQRT2}),nU=va("i",["Complex"],e=>{var{Complex:t}=e;return t.I}),iU=K("PI",["pi"],e=>{var{pi:t}=e;return t}),oU=K("E",["e"],e=>{var{e:t}=e;return t}),aU=K("version",[],()=>Uz);function va(e,t,r){return K(e,t,r,{recreateOnConfigChange:!0})}v();x();g();var sU=pr("speedOfLight","299792458","m s^-1"),uU=pr("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),lU=pr("planckConstant","6.62607015e-34","J s"),fU=pr("reducedPlanckConstant","1.0545718176461565e-34","J s"),cU=pr("magneticConstant","1.25663706212e-6","N A^-2"),pU=pr("electricConstant","8.8541878128e-12","F m^-1"),mU=pr("vacuumImpedance","376.730313667","ohm"),hU=pr("coulomb","8.987551792261171e9","N m^2 C^-2"),dU=pr("elementaryCharge","1.602176634e-19","C"),vU=pr("bohrMagneton","9.2740100783e-24","J T^-1"),gU=pr("conductanceQuantum","7.748091729863649e-5","S"),xU=pr("inverseConductanceQuantum","12906.403729652257","ohm"),yU=pr("magneticFluxQuantum","2.0678338484619295e-15","Wb"),wU=pr("nuclearMagneton","5.0507837461e-27","J T^-1"),bU=pr("klitzing","25812.807459304513","ohm");var DU=pr("bohrRadius","5.29177210903e-11","m"),NU=pr("classicalElectronRadius","2.8179403262e-15","m"),SU=pr("electronMass","9.1093837015e-31","kg"),EU=pr("fermiCoupling","1.1663787e-5","GeV^-2"),AU=Vw("fineStructure",.0072973525693),CU=pr("hartreeEnergy","4.3597447222071e-18","J"),MU=pr("protonMass","1.67262192369e-27","kg"),TU=pr("deuteronMass","3.3435830926e-27","kg"),OU=pr("neutronMass","1.6749271613e-27","kg"),IU=pr("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),FU=pr("rydberg","10973731.568160","m^-1"),_U=pr("thomsonCrossSection","6.6524587321e-29","m^2"),kU=Vw("weakMixingAngle",.2229),BU=Vw("efimovFactor",22.7),LU=pr("atomicMass","1.66053906660e-27","kg"),PU=pr("avogadro","6.02214076e23","mol^-1"),RU=pr("boltzmann","1.380649e-23","J K^-1"),qU=pr("faraday","96485.33212331001","C mol^-1"),zU=pr("firstRadiation","3.7417718521927573e-16","W m^2"),UU=pr("loschmidt","2.686780111798444e25","m^-3"),HU=pr("gasConstant","8.31446261815324","J K^-1 mol^-1"),$U=pr("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),WU=pr("molarVolume","0.022413969545014137","m^3 mol^-1"),VU=Vw("sackurTetrode",-1.16487052358),GU=pr("secondRadiation","0.014387768775039337","m K"),YU=pr("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),ZU=pr("wienDisplacement","2.897771955e-3","m K"),XU=pr("molarMass","0.99999999965e-3","kg mol^-1"),KU=pr("molarMassC12","11.9999999958e-3","kg mol^-1"),JU=pr("gravity","9.80665","m s^-2"),QU=pr("planckLength","1.616255e-35","m"),jU=pr("planckMass","2.176435e-8","kg"),eH=pr("planckTime","5.391245e-44","s"),tH=pr("planckCharge","1.87554603778e-18","C"),rH=pr("planckTemperature","1.416785e+32","K");function pr(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 Vw(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})}v();x();g();var npe="apply",ipe=["typed","isInteger"],nH=K(npe,ipe,e=>{var{typed:t,isInteger:r}=e,n=wh({typed:t,isInteger:r});return t("apply",{"...any":function(o){var u=o[1];Ut(u)?o[1]=u-1:_t(u)&&(o[1]=u.minus(1));try{return n.apply(null,o)}catch(l){throw Kr(l)}}})},{isTransformFunction:!0});v();x();g();var ope="column",ape=["typed","Index","matrix","range"],iH=K(ope,ape,e=>{var{typed:t,Index:r,matrix:n,range:i}=e,o=Xy({typed:t,Index:r,matrix:n,range:i});return t("column",{"...any":function(l){var a=l.length-1,s=l[a];Ut(s)&&(l[a]=s-1);try{return o.apply(null,l)}catch(f){throw Kr(f)}}})},{isTransformFunction:!0});v();x();g();v();x();g();function Oh(e,t,r){var n=e.filter(function(a){return Rr(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 hh(r,o,new Set([i])),l=e.compile();return function(s){return o.set(i,s),l.evaluate(u)}}var spe="filter",upe=["typed"],aH=K(spe,upe,e=>{var{typed:t}=e;function r(i,o,u){var l,a;return i[0]&&(l=i[0].compile().evaluate(u)),i[1]&&(Rr(i[1])||za(i[1])?a=i[1].compile().evaluate(u):a=Oh(i[1],o,u)),n(l,a)}r.rawArgs=!0;var n=t("filter",{"Array, function":oH,"Matrix, function":function(o,u){return o.create(oH(o.toArray(),u))},"Array, RegExp":ph,"Matrix, RegExp":function(o,u){return o.create(ph(o.toArray(),u))}});return r},{isTransformFunction:!0});function oH(e,t){return Ey(e,function(r,n,i){return Wa(t,r,[n+1],i,"filter")})}v();x();g();var lpe="forEach",fpe=["typed"],sH=K(lpe,fpe,e=>{var{typed:t}=e;function r(i,o,u){var l,a;return i[0]&&(l=i[0].compile().evaluate(u)),i[1]&&(Rr(i[1])||za(i[1])?a=i[1].compile().evaluate(u):a=Oh(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))Nf(s,function(p,h){a(p,f.concat(h+1))});else return Wa(u,s,f,o,"forEach")};l(o.valueOf(),[])}});return r},{isTransformFunction:!0});v();x();g();var cpe="index",ppe=["Index","getMatrixDataType"],uH=K(cpe,ppe,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(fr(l)||St(l))r(l)!=="boolean"&&(l=l.map(function(s){return s-1}));else if(Ut(l))l--;else if(_t(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});v();x();g();var mpe="map",hpe=["typed"],fH=K(mpe,hpe,e=>{var{typed:t}=e;function r(i,o,u){var l,a;return i[0]&&(l=i[0].compile().evaluate(u)),i[1]&&(Rr(i[1])||za(i[1])?a=i[1].compile().evaluate(u):a=Oh(i[1],o,u)),n(l,a)}r.rawArgs=!0;var n=t("map",{"Array, function":function(o,u){return lH(o,u,o)},"Matrix, function":function(o,u){return o.create(lH(o.valueOf(),u,o))}});return r},{isTransformFunction:!0});function lH(e,t,r){function n(i,o){return Array.isArray(i)?$o(i,function(u,l){return n(u,o.concat(l+1))}):Wa(t,i,o,r,"map")}return n(e,[])}v();x();g();v();x();g();function po(e){if(e.length===2&&xn(e[0])){e=e.slice();var t=e[1];Ut(t)?e[1]=t-1:_t(t)&&(e[1]=t.minus(1))}return e}var dpe="max",vpe=["typed","config","numeric","larger"],cH=K(dpe,vpe,e=>{var{typed:t,config:r,numeric:n,larger:i}=e,o=pw({typed:t,config:r,numeric:n,larger:i});return t("max",{"...any":function(l){l=po(l);try{return o.apply(null,l)}catch(a){throw Kr(a)}}})},{isTransformFunction:!0});v();x();g();var gpe="mean",xpe=["typed","add","divide"],pH=K(gpe,xpe,e=>{var{typed:t,add:r,divide:n}=e,i=zw({typed:t,add:r,divide:n});return t("mean",{"...any":function(u){u=po(u);try{return i.apply(null,u)}catch(l){throw Kr(l)}}})},{isTransformFunction:!0});v();x();g();var ype="min",wpe=["typed","config","numeric","smaller"],mH=K(ype,wpe,e=>{var{typed:t,config:r,numeric:n,smaller:i}=e,o=mw({typed:t,config:r,numeric:n,smaller:i});return t("min",{"...any":function(l){l=po(l);try{return o.apply(null,l)}catch(a){throw Kr(a)}}})},{isTransformFunction:!0});v();x();g();var bpe="range",Dpe=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],hH=K(bpe,Dpe,e=>{var{typed:t,config:r,matrix:n,bignumber:i,smaller:o,smallerEq:u,larger:l,largerEq:a,add:s,isPositive:f}=e,p=jy({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 N=y.length-1,w=y[N];return typeof w!="boolean"&&y.push(!0),p.apply(null,y)}})},{isTransformFunction:!0});v();x();g();var Npe="row",Spe=["typed","Index","matrix","range"],dH=K(Npe,Spe,e=>{var{typed:t,Index:r,matrix:n,range:i}=e,o=ew({typed:t,Index:r,matrix:n,range:i});return t("row",{"...any":function(l){var a=l.length-1,s=l[a];Ut(s)&&(l[a]=s-1);try{return o.apply(null,l)}catch(f){throw Kr(f)}}})},{isTransformFunction:!0});v();x();g();var Epe="subset",Ape=["typed","matrix","zeros","add"],vH=K(Epe,Ape,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e,o=tw({typed:t,matrix:r,zeros:n,add:i});return t("subset",{"...any":function(l){try{return o.apply(null,l)}catch(a){throw Kr(a)}}})},{isTransformFunction:!0});v();x();g();var Cpe="concat",Mpe=["typed","matrix","isInteger"],gH=K(Cpe,Mpe,e=>{var{typed:t,matrix:r,isInteger:n}=e,i=Zy({typed:t,matrix:r,isInteger:n});return t("concat",{"...any":function(u){var l=u.length-1,a=u[l];Ut(a)?u[l]=a-1:_t(a)&&(u[l]=a.minus(1));try{return i.apply(null,u)}catch(s){throw Kr(s)}}})},{isTransformFunction:!0});v();x();g();var xH="diff",Tpe=["typed","matrix","subtract","number","bignumber"],yH=K(xH,Tpe,e=>{var{typed:t,matrix:r,subtract:n,number:i,bignumber:o}=e,u=Ky({typed:t,matrix:r,subtract:n,number:i,bignumber:o});return t(xH,{"...any":function(a){a=po(a);try{return u.apply(null,a)}catch(s){throw Kr(s)}}})},{isTransformFunction:!0});v();x();g();var Ope="std",Ipe=["typed","map","sqrt","variance"],wH=K(Ope,Ipe,e=>{var{typed:t,map:r,sqrt:n,variance:i}=e,o=$w({typed:t,map:r,sqrt:n,variance:i});return t("std",{"...any":function(l){l=po(l);try{return o.apply(null,l)}catch(a){throw Kr(a)}}})},{isTransformFunction:!0});v();x();g();var bH="sum",Fpe=["typed","config","add","numeric"],DH=K(bH,Fpe,e=>{var{typed:t,config:r,add:n,numeric:i}=e,o=Pw({typed:t,config:r,add:n,numeric:i});return t(bH,{"...any":function(l){l=po(l);try{return o.apply(null,l)}catch(a){throw Kr(a)}}})},{isTransformFunction:!0});v();x();g();var _pe="quantileSeq",kpe=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],NH=K(_pe,kpe,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=Hw({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,D,b)=>y(w,D,N(b)),"Array | Matrix, number | BigNumber, boolean":y,"Array | Matrix, number | BigNumber, boolean, number":(w,D,b,O)=>y(w,D,b,N(O)),"Array | Matrix, Array | Matrix":y,"Array | Matrix, Array | Matrix, number":(w,D,b)=>y(w,D,N(b)),"Array | Matrix, Array | Matrix, boolean":y,"Array | Matrix, Array | Matrix, boolean, number":(w,D,b,O)=>y(w,D,b,N(O))});function N(w){return po([[],w])[1]}},{isTransformFunction:!0});v();x();g();var SH="cumsum",Bpe=["typed","add","unaryPlus"],EH=K(SH,Bpe,e=>{var{typed:t,add:r,unaryPlus:n}=e,i=qw({typed:t,add:r,unaryPlus:n});return t(SH,{"...any":function(u){if(u.length===2&&xn(u[0])){var l=u[1];Ut(l)?u[1]=l-1:_t(l)&&(u[1]=l.minus(1))}try{return i.apply(null,u)}catch(a){throw Kr(a)}}})},{isTransformFunction:!0});v();x();g();var AH="variance",Lpe=["typed","add","subtract","multiply","divide","apply","isNaN"],CH=K(AH,Lpe,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:o,apply:u,isNaN:l}=e,a=Uw({typed:t,add:r,subtract:n,multiply:i,divide:o,apply:u,isNaN:l});return t(AH,{"...any":function(f){f=po(f);try{return a.apply(null,f)}catch(p){throw Kr(p)}}})},{isTransformFunction:!0});v();x();g();var MH="print",Ppe=["typed","matrix","zeros","add"],TH=K(MH,Ppe,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e,o=nw({typed:t,matrix:r,zeros:n,add:i});return t(MH,{"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(rw,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});v();x();g();var Rpe="and",qpe=["typed","matrix","zeros","add","equalScalar","not","concat"],OH=K(Rpe,qpe,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:u}=e,l=iw({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});v();x();g();var zpe="or",Upe=["typed","matrix","equalScalar","DenseMatrix","concat"],IH=K(zpe,Upe,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,u=Yy({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});v();x();g();var Hpe="bitAnd",$pe=["typed","matrix","zeros","add","equalScalar","not","concat"],FH=K(Hpe,$pe,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:u}=e,l=Vy({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});v();x();g();var Wpe="bitOr",Vpe=["typed","matrix","equalScalar","DenseMatrix","concat"],_H=K(Wpe,Vpe,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,u=Gy({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});v();x();g();v();x();g();var VA=WA;v();x();g();var RH=jr(xy(),1);v();x();g();var BH=jr(kH(),1);function LH(e){var t=new BH.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}v();x();g();function PH(e,t,r,n){function i(D,b){var O=arguments.length;if(O!==1&&O!==2)throw new da("import",O,1,2);b||(b={});function M(P,R,q){if(Array.isArray(R))R.forEach(V=>M(P,V));else if(typeof R=="object")for(var z in R)Et(R,z)&&M(P,R[z],z);else if(op(R)||q!==void 0){var H=op(R)?N(R)?R.fn+".transform":R.fn:q;if(Et(P,H)&&P[H]!==R&&!b.silent)throw new Error('Cannot import "'+H+'" twice');P[H]=R}else if(!b.silent)throw new TypeError("Factory, Object, or Array expected")}var I={};M(I,D);for(var F in I)if(Et(I,F)){var C=I[F];if(op(C))s(C,b);else if(f(C))o(F,C,b);else if(!b.silent)throw new TypeError("Factory, Object, or Array expected")}}function o(D,b,O){if(O.wrap&&typeof b=="function"&&(b=a(b)),p(b)&&(b=e(D,{[b.signature]:b})),e.isTypedFunction(r[D])&&e.isTypedFunction(b)){O.override?b=e(D,b.signatures):b=e(r[D],b),r[D]=b,delete n[D],u(D,b),r.emit("import",D,function(){return b});return}if(r[D]===void 0||O.override){r[D]=b,delete n[D],u(D,b),r.emit("import",D,function(){return b});return}if(!O.silent)throw new Error('Cannot import "'+D+'": already exists')}function u(D,b){b&&typeof b.transform=="function"?(r.expression.transform[D]=b.transform,h(D)&&(r.expression.mathWithTransform[D]=b.transform)):(delete r.expression.transform[D],h(D)&&(r.expression.mathWithTransform[D]=b))}function l(D){delete r.expression.transform[D],h(D)?r.expression.mathWithTransform[D]=r[D]:delete r.expression.mathWithTransform[D]}function a(D){var b=function(){for(var M=[],I=0,F=arguments.length;I2&&arguments[2]!==void 0?arguments[2]:D.fn;if(oE(O,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(O));var M=N(D)?r.expression.transform:r,I=O in r.expression.transform,F=Et(M,O)?M[O]:void 0,C=function(){var R={};D.dependencies.map(uE).forEach(z=>{if(oE(z,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(z));z==="math"?R.math=r:z==="mathWithTransform"?R.mathWithTransform=r.expression.mathWithTransform:z==="classes"?R.classes=r:R[z]=r[z]});var q=D(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 exports.path="expression.transform"');if(F===void 0||b.override)return q;if(e.isTypedFunction(F)&&e.isTypedFunction(q))return e(F,q);if(b.silent)return F;throw new Error('Cannot import "'+O+'": already exists')};!D.meta||D.meta.lazy!==!1?(uh(M,O,C),F&&I?l(O):(N(D)||y(D))&&uh(r.expression.mathWithTransform,O,()=>M[O])):(M[O]=C(),F&&I?l(O):(N(D)||y(D))&&uh(r.expression.mathWithTransform,O,()=>M[O])),n[O]=D,r.emit("import",O,C)}function f(D){return typeof D=="function"||typeof D=="number"||typeof D=="string"||typeof D=="boolean"||D===null||oi(D)||wi(D)||_t(D)||pa(D)||St(D)||Array.isArray(D)}function p(D){return typeof D=="function"&&typeof D.signature=="string"}function h(D){return!Et(w,D)}function y(D){return D.fn.indexOf(".")===-1&&!Et(w,D.fn)&&(!D.meta||!D.meta.isClass)}function N(D){return D!==void 0&&D.meta!==void 0&&D.meta.isTransformFunction===!0||!1}var w={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return i}function Gw(e,t){var r=qn({},iy,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=LH({isNumber:Ut,isComplex:wi,isBigNumber:_t,isFraction:pa,isUnit:oi,isString:hn,isArray:fr,isMatrix:St,isCollection:xn,isDenseMatrix:al,isSparseMatrix:ma,isRange:Df,isIndex:du,isBoolean:oy,isResultSet:ay,isHelp:oh,isFunction:sy,isDate:uy,isRegExp:ly,isObject:vu,isNull:fy,isUndefined:cy,isAccessorNode:To,isArrayNode:bi,isAssignmentNode:py,isBlockNode:my,isConditionalNode:hy,isConstantNode:ir,isFunctionAssignmentNode:za,isFunctionNode:Ji,isIndexNode:Ho,isNode:lr,isObjectNode:gu,isOperatorNode:Zr,isParenthesisNode:Di,isRangeNode:dy,isRelationalNode:vy,isSymbolNode:Rr,isChain:ah});n.config=WI(r,n.emit),n.expression={transform:{},mathWithTransform:{config:n.config}};var i=[],o=[];function u(f){if(op(f))return f(n);var p=f[Object.keys(f)[0]];if(op(p))return p(n);if(!qI(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=Gw.bind(null,e),n.factory=K,n.import(Object.values(PI(e))),n.ArgumentsError=da,n.DimensionError=Xt,n.IndexError=Si,n}var qh={};La(qh,{ABS:()=>che,ACCRINT:()=>O0e,ACCRINTM:()=>I0e,ACOS:()=>phe,ACOSH:()=>mhe,ACOT:()=>hhe,ACOTH:()=>dhe,AGGREGATE:()=>vhe,AMORDEGRC:()=>F0e,AMORLINC:()=>_0e,AND:()=>C1e,ARABIC:()=>ghe,ASC:()=>Qde,ASIN:()=>xhe,ASINH:()=>yhe,ATAN:()=>whe,ATAN2:()=>bhe,ATANH:()=>Dhe,AVEDEV:()=>Ime,AVERAGE:()=>hp,AVERAGEA:()=>aC,AVERAGEIF:()=>Fme,AVERAGEIFS:()=>_me,BAHTTEXT:()=>jde,BASE:()=>Nhe,BESSELI:()=>Eve,BESSELJ:()=>Ave,BESSELK:()=>Cve,BESSELY:()=>Mve,BETA:()=>Rg,BETADIST:()=>cge,BETAINV:()=>pge,BIN2DEC:()=>Tve,BIN2HEX:()=>Ove,BIN2OCT:()=>Ive,BINOM:()=>Lh,BINOMDIST:()=>mge,BITAND:()=>Fve,BITLSHIFT:()=>_ve,BITOR:()=>kve,BITRSHIFT:()=>Bve,BITXOR:()=>Lve,CEILING:()=>dl,CEILINGMATH:()=>hge,CEILINGPRECISE:()=>dge,CELL:()=>ame,CHAR:()=>p$,CHIDIST:()=>vge,CHIDISTRT:()=>gge,CHIINV:()=>xge,CHIINVRT:()=>yge,CHISQ:()=>Fs,CHITEST:()=>wge,CHOOSE:()=>wme,CLEAN:()=>eve,CODE:()=>m$,COLUMN:()=>bme,COLUMNS:()=>Dme,COMBIN:()=>Ih,COMBINA:()=>She,COMPLEX:()=>vo,CONCAT:()=>tve,CONCATENATE:()=>h$,CONFIDENCE:()=>sC,CONVERT:()=>Pve,CORREL:()=>kme,COS:()=>Ehe,COSH:()=>Ahe,COT:()=>Che,COTH:()=>Mhe,COUNT:()=>Bg,COUNTA:()=>Lg,COUNTBLANK:()=>t$,COUNTIF:()=>Bme,COUNTIFS:()=>Lme,COUPDAYBS:()=>k0e,COUPDAYS:()=>B0e,COUPDAYSNC:()=>L0e,COUPNCD:()=>P0e,COUPNUM:()=>R0e,COUPPCD:()=>q0e,COVAR:()=>bge,COVARIANCE:()=>Ph,COVARIANCEP:()=>Dge,COVARIANCES:()=>Nge,CRITBINOM:()=>Sge,CSC:()=>The,CSCH:()=>Ohe,CUMIPMT:()=>z0e,CUMPRINC:()=>U0e,DATE:()=>Lde,DATEDIF:()=>kf,DATEVALUE:()=>Pde,DAVERAGE:()=>g0e,DAY:()=>Rde,DAYS:()=>mp,DAYS360:()=>Bf,DB:()=>H0e,DBCS:()=>rve,DCOUNT:()=>x0e,DCOUNTA:()=>y0e,DDB:()=>$0e,DEC2BIN:()=>Rve,DEC2HEX:()=>qve,DEC2OCT:()=>zve,DECIMAL:()=>Ihe,DEGREES:()=>Fhe,DELTA:()=>Uve,DEVSQ:()=>Pme,DGET:()=>w0e,DISC:()=>W0e,DMAX:()=>b0e,DMIN:()=>D0e,DOLLAR:()=>nve,DOLLARDE:()=>V0e,DOLLARFR:()=>G0e,DPRODUCT:()=>N0e,DSTDEV:()=>S0e,DSTDEVP:()=>E0e,DSUM:()=>A0e,DURATION:()=>Y0e,DVAR:()=>C0e,DVARP:()=>M0e,EDATE:()=>qde,EFFECT:()=>Z0e,EOMONTH:()=>zde,ERF:()=>yC,ERFC:()=>wC,ERFCPRECISE:()=>Ege,ERFPRECISE:()=>Age,ERROR:()=>KH,EVEN:()=>_he,EXACT:()=>ive,EXP:()=>khe,EXPON:()=>uC,EXPONDIST:()=>Cge,F:()=>_s,FACT:()=>hl,FACTDOUBLE:()=>l$,FALSE:()=>M1e,FDIST:()=>Mge,FDISTRT:()=>Tge,FIND:()=>ove,FINV:()=>Oge,FINVRT:()=>Ige,FISHER:()=>Rme,FISHERINV:()=>qme,FIXED:()=>d$,FLOOR:()=>gp,FLOORMATH:()=>Fge,FLOORPRECISE:()=>_ge,FORECAST:()=>r$,FREQUENCY:()=>zme,FTEST:()=>kge,FV:()=>xp,FVSCHEDULE:()=>X0e,GAMMA:()=>qg,GAMMADIST:()=>Bge,GAMMAINV:()=>Lge,GAMMALN:()=>lC,GAMMALNPRECISE:()=>Pge,GAUSS:()=>Ume,GCD:()=>Bhe,GEOMEAN:()=>Hme,GESTEP:()=>Hve,GROWTH:()=>$me,HARMEAN:()=>Wme,HEX2BIN:()=>$ve,HEX2DEC:()=>Wve,HEX2OCT:()=>Vve,HLOOKUP:()=>Nme,HOUR:()=>Ude,HYPGEOM:()=>fC,HYPGEOMDIST:()=>Rge,IF:()=>T1e,IFERROR:()=>I1e,IFNA:()=>F1e,IFS:()=>O1e,IMABS:()=>bC,IMAGINARY:()=>en,IMARGUMENT:()=>DC,IMCONJUGATE:()=>Gve,IMCOS:()=>fb,IMCOSH:()=>v$,IMCOT:()=>Yve,IMCSC:()=>nge,IMCSCH:()=>ige,IMDIV:()=>wp,IMEXP:()=>Zve,IMLN:()=>Xve,IMLOG10:()=>Kve,IMLOG2:()=>Jve,IMPOWER:()=>Qve,IMPRODUCT:()=>jve,IMREAL:()=>tn,IMSEC:()=>ege,IMSECH:()=>tge,IMSIN:()=>cb,IMSINH:()=>g$,IMSQRT:()=>rge,IMSUB:()=>oge,IMSUM:()=>age,IMTAN:()=>sge,INDEX:()=>Sme,INFO:()=>sme,INT:()=>Lhe,INTERCEPT:()=>Vme,INTRATE:()=>K0e,IPMT:()=>w$,IRR:()=>J0e,ISBLANK:()=>ume,ISERR:()=>JH,ISERROR:()=>ab,ISEVEN:()=>lme,ISFORMULA:()=>fme,ISLOGICAL:()=>QH,ISNA:()=>cme,ISNONTEXT:()=>pme,ISNUMBER:()=>sb,ISO:()=>Phe,ISODD:()=>mme,ISOWEEKNUM:()=>c$,ISPMT:()=>Q0e,ISREF:()=>hme,ISTEXT:()=>jH,KURT:()=>Gme,LARGE:()=>n$,LCM:()=>Rhe,LEFT:()=>ave,LEN:()=>sve,LINEST:()=>cC,LN:()=>qhe,LOG:()=>zhe,LOG10:()=>Uhe,LOGEST:()=>Yme,LOGINV:()=>qge,LOGNORM:()=>Rh,LOGNORMDIST:()=>zge,LOGNORMINV:()=>Uge,LOOKUP:()=>Eme,LOWER:()=>uve,MATCH:()=>Ame,MAX:()=>Jw,MAXA:()=>Zme,MAXIFS:()=>Xme,MDURATION:()=>j0e,MEDIAN:()=>i$,MID:()=>lve,MIN:()=>Qw,MINA:()=>Kme,MINIFS:()=>Jme,MINUTE:()=>Hde,MIRR:()=>e1e,MMULT:()=>Hhe,MOD:()=>$he,MODE:()=>dp,MODEMULT:()=>Hge,MODESNGL:()=>$ge,MONTH:()=>$de,MROUND:()=>Whe,MULTINOMIAL:()=>Vhe,MUNIT:()=>Ghe,N:()=>dme,NA:()=>vme,NEGBINOM:()=>pC,NEGBINOMDIST:()=>Wge,NETWORKDAYS:()=>ub,NETWORKDAYSINTL:()=>Vge,NOMINAL:()=>t1e,NORM:()=>ks,NORMDIST:()=>Gge,NORMINV:()=>Yge,NORMSDIST:()=>Zge,NORMSINV:()=>Xge,NOT:()=>_1e,NOW:()=>Wde,NPER:()=>r1e,NPV:()=>eC,NUMBERVALUE:()=>fve,OCT2BIN:()=>uge,OCT2DEC:()=>lge,OCT2HEX:()=>fge,ODD:()=>Yhe,ODDFPRICE:()=>n1e,ODDFYIELD:()=>i1e,ODDLPRICE:()=>o1e,ODDLYIELD:()=>a1e,OR:()=>k1e,PDURATION:()=>s1e,PEARSON:()=>o$,PERCENTILE:()=>ga,PERCENTILEEXC:()=>Kge,PERCENTILEINC:()=>Jge,PERCENTRANK:()=>zg,PERCENTRANKEXC:()=>Qge,PERCENTRANKINC:()=>jge,PERMUT:()=>Qme,PERMUTATIONA:()=>jme,PHI:()=>ehe,PI:()=>Zhe,PMT:()=>Hg,POISSON:()=>mC,POISSONDIST:()=>e0e,POWER:()=>f$,PPMT:()=>u1e,PRICE:()=>l1e,PRICEDISC:()=>f1e,PRICEMAT:()=>c1e,PROB:()=>the,PRODUCT:()=>jw,PRONETIC:()=>cve,PROPER:()=>pve,PV:()=>p1e,QUARTILE:()=>vp,QUARTILEEXC:()=>t0e,QUARTILEINC:()=>r0e,QUOTIENT:()=>Xhe,RADIANS:()=>Khe,RAND:()=>Jhe,RANDBETWEEN:()=>Qhe,RANK:()=>Ug,RANKAVG:()=>n0e,RANKEQ:()=>i0e,RATE:()=>m1e,RECEIVED:()=>h1e,REPLACE:()=>mve,REPT:()=>ya,RIGHT:()=>hve,ROMAN:()=>jhe,ROUND:()=>Du,ROUNDDOWN:()=>ede,ROUNDUP:()=>tde,ROW:()=>rhe,ROWS:()=>Cme,RRI:()=>d1e,RSQ:()=>nhe,SEARCH:()=>dve,SEC:()=>rde,SECH:()=>nde,SECOND:()=>Vde,SERIESSUM:()=>ide,SHEET:()=>gme,SHEETS:()=>xme,SIGN:()=>ode,SIN:()=>ade,SINH:()=>sde,SKEW:()=>hC,SKEWP:()=>o0e,SLN:()=>v1e,SLOPE:()=>ihe,SMALL:()=>a$,SORT:()=>Mme,SQRT:()=>ude,SQRTPI:()=>lde,STANDARDIZE:()=>ohe,STDEV:()=>Yo,STDEVA:()=>ahe,STDEVP:()=>a0e,STDEVPA:()=>she,STDEVS:()=>s0e,STEYX:()=>uhe,SUBSTITUTE:()=>vve,SUBTOTAL:()=>fde,SUM:()=>vl,SUMIF:()=>cde,SUMIFS:()=>pde,SUMPRODUCT:()=>mde,SUMSQ:()=>hde,SUMX2MY2:()=>dde,SUMX2PY2:()=>vde,SUMXMY2:()=>gde,SWITCH:()=>P1e,SYD:()=>g1e,T:()=>gve,TAN:()=>xde,TANH:()=>yde,TBILLEQ:()=>x1e,TBILLPRICE:()=>y1e,TBILLYIELD:()=>w1e,TDIST:()=>u0e,TDISTRT:()=>l0e,TEXT:()=>xve,TEXTJOIN:()=>yve,TIME:()=>Gde,TIMEVALUE:()=>Yde,TINV:()=>f0e,TODAY:()=>Zde,TRANSPOSE:()=>Tme,TREND:()=>lhe,TRIM:()=>wve,TRIMMEAN:()=>fhe,TRUE:()=>B1e,TRUNC:()=>wde,TTEST:()=>c0e,TYPE:()=>yme,UNICHAR:()=>bve,UNICODE:()=>Dve,UNIQUE:()=>oC,UPPER:()=>Nve,VALUE:()=>Sve,VAR:()=>Oo,VARA:()=>s$,VARP:()=>p0e,VARPA:()=>u$,VARS:()=>m0e,VDB:()=>b1e,VLOOKUP:()=>e$,WEEKDAY:()=>Xde,WEEKNUM:()=>Kde,WEIBULL:()=>dC,WEIBULLDIST:()=>h0e,WORKDAY:()=>lb,WORKDAYINTL:()=>d0e,XIRR:()=>D1e,XNPV:()=>N1e,XOR:()=>L1e,YEAR:()=>Jde,YEARFRAC:()=>gC,YIELD:()=>S1e,YIELDDISC:()=>E1e,YIELDMAT:()=>A1e,Z:()=>vC,ZTEST:()=>v0e,utils:()=>R1e});v();x();g();var Ct=jr(zH(),1),Pg=jr(HH(),1),tC=new Error("#NULL!"),ho=new Error("#DIV/0!"),qe=new Error("#VALUE!"),Fh=new Error("#REF!"),rb=new Error("#NAME?"),rt=new Error("#NUM!"),Jt=new Error("#N/A"),rC=new Error("#ERROR!"),WH=new Error("#GETTING_DATA"),Ype=Object.freeze({__proto__:null,data:WH,div0:ho,error:rC,na:Jt,name:rb,nil:tC,num:rt,ref:Fh,value:qe}),Zpe="=",Xpe=[">",">=","<","<=","=","<>"],VH="operator",GH="literal",Kpe=[VH,GH],Xw=VH,Lf=GH;function ml(e,t){if(Kpe.indexOf(t)===-1)throw new Error("Unsupported token type: "+t);return{value:e,type:t}}function Jpe(e){return typeof e!="string"||/^\d+(\.\d+)?$/.test(e)&&(e=e.indexOf(".")===-1?parseInt(e,10):parseFloat(e)),e}function Qpe(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 jpe(e){let t="",r=[];for(let n=0;n=0?r.push(ml(i,Xw)):t+=i}return t.length>0&&r.push(ml(Jpe(t),Lf)),r.length>0&&r[0].type!==Xw&&r.unshift(ml(Zpe,Xw)),r}function eme(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 _h(e){return jpe(Qpe(e))}var kh=eme;function nb(e){let t=[];return mo(e,r=>{t.push(r)}),t}function mo(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 vt(){let e;if(arguments.length===1){let t=arguments[0];e=nme(t)?nb.apply(null,arguments):[t]}else e=Array.from(arguments);for(;!ime(e);)e=jA(e);return e}function jA(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 rme(e,t){return t=t||1,!e||typeof e.slice!="function"?e:e.slice(0,e.length-t)}function nme(e){return e!=null&&typeof e.length=="number"&&typeof e!="string"}function ime(e){if(!e)return!1;for(let t=0;te.map(n=>n[r])):qe}function Ya(e,t){let r=null;return mo(e,(n,i)=>{if(n[0]===t)return r=i,!1}),r??qe}function gr(){for(let e=0;etypeof t=="number")}function ome(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 iC(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?rt:ome(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 XH(e){let t=e.length,r;for(;t--;){if(r=br(e[t]),r===qe)return r;e[t]=r}return e}function ge(e){return e instanceof Error?e:e==null?0:(typeof e=="boolean"&&(e=+e),!isNaN(e)&&e!==""?parseFloat(e):qe)}function It(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=ge(e[t]),r instanceof Error)return r;e[t]=r}return e}function Kn(e){return e instanceof Error?e:e==null?"":e.toString()}function ib(){let e=arguments.length;for(;e--;)if(typeof arguments[e]=="string")return!0;return!1}function ob(){let e=nb(arguments),t=It(vt(e.shift()));if(t instanceof Error)return t;let r=e,n=r.length/2;for(let o=0;o{switch(e){case tC:return 1;case ho:return 2;case qe:return 3;case Fh:return 4;case rb:return 5;case rt:return 6;case Jt:return 7;case WH:return 8}return Jt};function sme(){throw new Error("INFO is not implemented")}function ume(e){return e===null}function JH(e){return[qe,Fh,ho,rt,rb,tC].indexOf(e)>=0||typeof e=="number"&&(isNaN(e)||!isFinite(e))}function ab(e){return JH(e)||e===Jt}function lme(e){return!(Math.floor(Math.abs(e))&1)}function fme(){throw new Error("ISFORMULA is not implemented")}function QH(e){return e===!0||e===!1}function cme(e){return e===Jt}function pme(e){return typeof e!="string"}function sb(e){return typeof e=="number"&&!isNaN(e)&&isFinite(e)}function mme(e){return!!(Math.floor(Math.abs(e))&1)}function hme(){throw new Error("ISREF is not implemented")}function jH(e){return typeof e=="string"}function dme(e){return sb(e)?e:e instanceof Date?e.getTime():e===!0?1:e===!1?0:ab(e)?e:0}function vme(){return Jt}function gme(){throw new Error("SHEET is not implemented")}function xme(){throw new Error("SHEETS is not implemented")}function yme(e){if(sb(e))return 1;if(jH(e))return 2;if(QH(e))return 4;if(ab(e))return 16;if(Array.isArray(e))return 64}function wme(){if(arguments.length<2)return Jt;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]:Fh}function Eme(e,t,r){t=vt(t),r=r?vt(r):t;let n=typeof e=="number",i=Jt;for(let o=0;oe)return i}return i}function Ame(e,t,r){if(!e&&e!==0||!t||(arguments.length===2&&(r=1),t=vt(t),!(t instanceof Array))||r!==-1&&r!==0&&r!==1)return Jt;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=Kn(a[t-1]),s=Kn(s[t-1]),r===1?as?r:r*-1)),o=YH(e),u=n?Kw(o):o;return t>=1&&t<=u[0].length?n?Kw(i(u)):i(u):qe}function Tme(e){if(!e)return Jt;let t=YH(e);return Kw(t)}function oC(){let e=[];for(let t=0;te&&(o=!0)}return i}var Ome=2.5066282746310002;function Ime(){let t=vt(arguments).filter(Bh);if(t.length===0)return rt;let r=It(t);return r instanceof Error?r:Ct.default.sum((0,Ct.default)(r).subtract(Ct.default.mean(r)).abs()[0])/r.length}function hp(){let t=vt(arguments).filter(Bh);if(t.length===0)return ho;let r=gr.apply(void 0,t);if(r)return r;let n=yp(t),i=n.length,o=0,u=0,l;for(let a=0;an+i,0)/e.length;return isNaN(r)?0:r}var Rg={};Rg.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=ge(e),t=ge(t),r=ge(r),i=ge(i),o=ge(o),ft(e,t,r,i,o))?qe:(e=(e-i)/(o-i),n?Ct.default.beta.cdf(e,t,r):Ct.default.beta.pdf(e,t,r))};Rg.INV=(e,t,r,n,i)=>(n=n===void 0?0:n,i=i===void 0?1:i,e=ge(e),t=ge(t),r=ge(r),n=ge(n),i=ge(i),ft(e,t,r,n,i)?qe:Ct.default.beta.inv(e,t,r)*(i-n)+n);var Lh={};Lh.DIST=(e,t,r,n)=>(e=ge(e),t=ge(t),r=ge(r),n=ge(n),ft(e,t,r,n)?qe:n?Ct.default.binomial.cdf(e,t,r):Ct.default.binomial.pdf(e,t,r));Lh.DIST.RANGE=(e,t,r,n)=>{if(n=n===void 0?r:n,e=ge(e),t=ge(t),r=ge(r),n=ge(n),ft(e,t,r,n))return qe;let i=0;for(let o=r;o<=n;o++)i+=Ih(e,o)*Math.pow(t,o)*Math.pow(1-t,e-o);return i};Lh.INV=(e,t,r)=>{if(e=ge(e),t=ge(t),r=ge(r),ft(e,t,r))return qe;let n=0;for(;n<=e;){if(Ct.default.binomial.cdf(n,e,t)>=r)return n;n++}};var Fs={};Fs.DIST=(e,t,r)=>(e=ge(e),t=ge(t),ft(e,t)?qe:r?Ct.default.chisquare.cdf(e,t):Ct.default.chisquare.pdf(e,t));Fs.DIST.RT=(e,t)=>!e|!t?Jt:e<1||t>Math.pow(10,10)?rt:typeof e!="number"||typeof t!="number"?qe:1-Ct.default.chisquare.cdf(e,t);Fs.INV=(e,t)=>(e=ge(e),t=ge(t),ft(e,t)?qe:Ct.default.chisquare.inv(e,t));Fs.INV.RT=(e,t)=>!e|!t?Jt:e<0||e>1||t<1||t>Math.pow(10,10)?rt:typeof e!="number"||typeof t!="number"?qe:Ct.default.chisquare.inv(1-e,t);Fs.TEST=function(e,t){if(arguments.length!==2)return Jt;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/N,N=N-2;let w=y,D=h;for(;w>1e-10*y;)D=D+2,w=w*p/D,y=y+w;return 1-y}return Math.round(f(a,l)*1e6)/1e6};var sC={};sC.NORM=(e,t,r)=>(e=ge(e),t=ge(t),r=ge(r),ft(e,t,r)?qe:Ct.default.normalci(1,e,t,r)[1]-1);sC.T=(e,t,r)=>(e=ge(e),t=ge(t),r=ge(r),ft(e,t,r)?qe:Ct.default.tci(1,e,t,r)[1]-1);function kme(e,t){return e=It(vt(e)),t=It(vt(t)),ft(e,t)?qe:Ct.default.corrcoeff(e,t)}function Bg(){let e=vt(arguments);return yp(e).length}function Lg(){let e=vt(arguments);return e.length-t$(e)}function t$(){let e=vt(arguments),t=0,r;for(let n=0;n{if(e=It(vt(e)),t=It(vt(t)),ft(e,t))return qe;let r=Ct.default.mean(e),n=Ct.default.mean(t),i=0,o=e.length;for(let u=0;u(e=It(vt(e)),t=It(vt(t)),ft(e,t)?qe:Ct.default.covariance(e,t));function Pme(){let e=It(vt(arguments));if(e instanceof Error)return e;let t=Ct.default.mean(e),r=0;for(let n=0;n(e=ge(e),t=ge(t),ft(e,t)?qe:r?Ct.default.exponential.cdf(e,t):Ct.default.exponential.pdf(e,t));var _s={};_s.DIST=(e,t,r,n)=>(e=ge(e),t=ge(t),r=ge(r),ft(e,t,r)?qe:n?Ct.default.centralF.cdf(e,t,r):Ct.default.centralF.pdf(e,t,r));_s.DIST.RT=function(e,t,r){return arguments.length!==3?Jt:e<0||t<1||r<1?rt:typeof e!="number"||typeof t!="number"||typeof r!="number"?qe:1-Ct.default.centralF.cdf(e,t,r)};_s.INV=(e,t,r)=>(e=ge(e),t=ge(t),r=ge(r),ft(e,t,r)?qe:e<=0||e>1?rt:Ct.default.centralF.inv(e,t,r));_s.INV.RT=function(e,t,r){return arguments.length!==3?Jt:e<0||e>1||t<1||t>Math.pow(10,10)||r<1||r>Math.pow(10,10)?rt:typeof e!="number"||typeof t!="number"||typeof r!="number"?qe:Ct.default.centralF.inv(1-e,t,r)};_s.TEST=(e,t)=>{if(!e||!t||!(e instanceof Array)||!(t instanceof Array))return Jt;if(e.length<2||t.length<2)return ho;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 qg(e){return e=ge(e),e instanceof Error?e:e===0||parseInt(e,10)===e&&e<0?rt:Ct.default.gammafn(e)}qg.DIST=function(e,t,r,n){return arguments.length!==4?Jt:e<0||t<=0||r<=0||typeof e!="number"||typeof t!="number"||typeof r!="number"?qe:n?Ct.default.gamma.cdf(e,t,r,!0):Ct.default.gamma.pdf(e,t,r,!1)};qg.INV=function(e,t,r){return arguments.length!==3?Jt:e<0||e>1||t<=0||r<=0?rt:typeof e!="number"||typeof t!="number"||typeof r!="number"?qe:Ct.default.gamma.inv(e,t,r)};function lC(e){return e=ge(e),e instanceof Error?e:Ct.default.gammaln(e)}lC.PRECISE=function(e){return arguments.length!==1?Jt:e<=0?rt:typeof e!="number"?qe:Ct.default.gammaln(e)};function Ume(e){return e=ge(e),e instanceof Error?e:Ct.default.normal.cdf(e,0,1)-.5}function Hme(){let e=It(vt(arguments));return e instanceof Error?e:Ct.default.geomean(e)}function $me(e,t,r,n){if(e=It(vt(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=It(vt(t)),r=It(vt(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=ge(e),t=ge(t),r=ge(r),n=ge(n),ft(e,t,r,n))return qe;function o(l,a,s,f){return Ih(s,l)*Ih(f-s,a-l)/Ih(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 Vme(e,t){return e=It(e),t=It(t),ft(e,t)?qe:e.length!==t.length?Jt:r$(0,e,t)}function Gme(){let e=It(vt(arguments));if(e instanceof Error)return e;let t=Ct.default.mean(e),r=e.length,n=0;for(let i=0;ii-n)[t-1]))}function cC(e,t){if(e=It(vt(e)),t=It(vt(t)),ft(e,t))return qe;let r=Ct.default.mean(e),n=Ct.default.mean(t),i=t.length,o=0,u=0;for(let s=0;s(e=ge(e),t=ge(t),r=ge(r),ft(e,t,r)?qe:n?Ct.default.lognormal.cdf(e,t,r):Ct.default.lognormal.pdf(e,t,r));Rh.INV=(e,t,r)=>(e=ge(e),t=ge(t),r=ge(r),ft(e,t,r)?qe:Ct.default.lognormal.inv(e,t,r));function Jw(){let e=vt(arguments),t=gr.apply(void 0,e);if(t)return t;let r=yp(e);return r.length===0?0:Math.max.apply(Math,r)}function Zme(){let e=vt(arguments),t=gr.apply(void 0,e);if(t)return t;let r=nC(e);return r=r.map(n=>n??0),r.length===0?0:Math.max.apply(Math,r)}function Xme(){let e=ob(...arguments);return e.length===0?0:Math.max.apply(Math,e)}function i$(){let e=vt(arguments),t=gr.apply(void 0,e);if(t)return t;let r=nC(e),n=Ct.default.median(r);return isNaN(n)&&(n=rt),n}function Qw(){let e=vt(arguments),t=gr.apply(void 0,e);if(t)return t;let r=yp(e);return r.length===0?0:Math.min.apply(Math,r)}function Kme(){let e=vt(arguments),t=gr.apply(void 0,e);if(t)return t;let r=nC(e);return r=r.map(n=>n??0),r.length===0?0:Math.min.apply(Math,r)}function Jme(){let e=ob(...arguments);return e.length===0?0:Math.min.apply(Math,e)}var dp={};dp.MULT=function(){let e=It(vt(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};dp.SNGL=function(){let e=It(vt(arguments));return e instanceof Error?e:dp.MULT(e).sort((t,r)=>t-r)[0]};var pC={};pC.DIST=(e,t,r,n)=>(e=ge(e),t=ge(t),r=ge(r),ft(e,t,r)?qe:n?Ct.default.negbin.cdf(e,t,r):Ct.default.negbin.pdf(e,t,r));var ks={};ks.DIST=(e,t,r,n)=>(e=ge(e),t=ge(t),r=ge(r),ft(e,t,r)?qe:r<=0?rt:n?Ct.default.normal.cdf(e,t,r):Ct.default.normal.pdf(e,t,r));ks.INV=(e,t,r)=>(e=ge(e),t=ge(t),r=ge(r),ft(e,t,r)?qe:Ct.default.normal.inv(e,t,r));ks.S={};ks.S.DIST=(e,t)=>(e=ge(e),e instanceof Error?qe:t?Ct.default.normal.cdf(e,0,1):Ct.default.normal.pdf(e,0,1));ks.S.INV=e=>(e=ge(e),e instanceof Error?qe:Ct.default.normal.inv(e,0,1));function o$(e,t){if(t=It(vt(t)),e=It(vt(e)),ft(t,e))return qe;let r=Ct.default.mean(e),n=Ct.default.mean(t),i=e.length,o=0,u=0,l=0;for(let a=0;a{if(e=It(vt(e)),t=ge(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 rt;let n=t*(r+1)-1,i=Math.floor(n);return ZH(n===i?e[n]:e[i]+(n-i)*(e[i+1]-e[i]))};ga.INC=(e,t)=>{if(e=It(vt(e)),t=ge(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 ZH(n===i?e[n]:e[i]+(n-i)*(e[i+1]-e[i]))};var zg={};zg.EXC=(e,t,r)=>{if(r=r===void 0?3:r,e=It(vt(e)),t=ge(t),r=ge(r),ft(e,t,r))return qe;e=e.sort((f,p)=>f-p);let n=oC.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=It(vt(e)),t=ge(t),r=ge(r),ft(e,t,r))return qe;e=e.sort((f,p)=>f-p);let n=oC.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=ge(e),t=ge(t),ft(e,t)?qe:r?Ct.default.poisson.cdf(e,t):Ct.default.poisson.pdf(e,t));function the(e,t,r,n){if(r===void 0)return 0;if(n=n===void 0?r:n,e=It(vt(e)),t=It(vt(t)),r=ge(r),n=ge(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 vp={};vp.EXC=(e,t)=>{if(e=It(vt(e)),t=ge(t),ft(e,t))return qe;switch(t){case 1:return ga.EXC(e,.25);case 2:return ga.EXC(e,.5);case 3:return ga.EXC(e,.75);default:return rt}};vp.INC=(e,t)=>{if(e=It(vt(e)),t=ge(t),ft(e,t))return qe;switch(t){case 1:return ga.INC(e,.25);case 2:return ga.INC(e,.5);case 3:return ga.INC(e,.75);default:return rt}};var Ug={};Ug.AVG=(e,t,r)=>{if(e=ge(e),t=It(vt(t)),ft(e,t))return qe;t=vt(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};Ug.EQ=(e,t,r)=>{if(e=ge(e),t=It(vt(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 rhe(e,t){if(arguments.length!==2)return Jt;if(t<0)return rt;if(!(e instanceof Array)||typeof t!="number")return qe;if(e.length!==0)return Ct.default.row(e,t)}function nhe(e,t){return e=It(vt(e)),t=It(vt(t)),ft(e,t)?qe:Math.pow(o$(e,t),2)}function hC(){let e=It(vt(arguments));if(e instanceof Error)return e;let t=Ct.default.mean(e),r=e.length,n=0;for(let i=0;ir-n)[t-1]}function ohe(e,t,r){return e=ge(e),t=ge(t),r=ge(r),ft(e,t,r)?qe:(e-t)/r}var Yo={};Yo.P=function(){let e=Oo.P.apply(this,arguments),t=Math.sqrt(e);return isNaN(t)&&(t=rt),t};Yo.S=function(){let e=Oo.S.apply(this,arguments);return Math.sqrt(e)};function ahe(){let e=s$.apply(this,arguments);return Math.sqrt(e)}function she(){let e=u$.apply(this,arguments),t=Math.sqrt(e);return isNaN(t)&&(t=rt),t}function uhe(e,t){if(e=It(vt(e)),t=It(vt(t)),ft(e,t))return qe;let r=Ct.default.mean(t),n=Ct.default.mean(e),i=t.length,o=0,u=0,l=0;for(let a=0;ar!==1&&r!==2?rt:r===1?xa.DIST.RT(e,t):xa.DIST["2T"](e,t);xa.DIST["2T"]=function(e,t){return arguments.length!==2?Jt:e<0||t<1?rt:typeof e!="number"||typeof t!="number"?qe:(1-Ct.default.studentt.cdf(e,t))*2};xa.DIST.RT=function(e,t){return arguments.length!==2?Jt:e<0||t<1?rt:typeof e!="number"||typeof t!="number"?qe:1-Ct.default.studentt.cdf(e,t)};xa.INV=(e,t)=>(e=ge(e),t=ge(t),ft(e,t)?qe:Ct.default.studentt.inv(e,t));xa.INV["2T"]=(e,t)=>(e=ge(e),t=ge(t),e<=0||e>1||t<1?rt:ft(e,t)?qe:Math.abs(Ct.default.studentt.inv(e/2,t)));xa.TEST=(e,t)=>{if(e=It(vt(e)),t=It(vt(t)),ft(e,t))return qe;let r=Ct.default.mean(e),n=Ct.default.mean(t),i=0,o=0,u;for(u=0;u{u.push(i*l+o)}),u}function fhe(e,t){if(e=It(vt(e)),t=ge(t),ft(e,t))return qe;let r=gp(e.length*t,2)/2;return Ct.default.mean(rme(wn(e.sort((n,i)=>n-i),r),r))}var Oo={};Oo.P=function(){let e=yp(vt(arguments)),t=e.length,r=0,n=hp(e),i;for(let o=0;o(e=ge(e),t=ge(t),r=ge(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 vC={};vC.TEST=(e,t,r)=>{if(e=It(vt(e)),t=ge(t),ft(e,t))return qe;r=r||Yo.S(e);let n=e.length;return 1-ks.S.DIST((hp(e)-t)/(r/Math.sqrt(n)),!0)};function che(e){return e=ge(e),e instanceof Error?e:Math.abs(e)}function phe(e){if(e=ge(e),e instanceof Error)return e;let t=Math.acos(e);return isNaN(t)&&(t=rt),t}function mhe(e){if(e=ge(e),e instanceof Error)return e;let t=Math.log(e+Math.sqrt(e*e-1));return isNaN(t)&&(t=rt),t}function hhe(e){return e=ge(e),e instanceof Error?e:Math.atan(1/e)}function dhe(e){if(e=ge(e),e instanceof Error)return e;let t=.5*Math.log((e+1)/(e-1));return isNaN(t)&&(t=rt),t}function vhe(e,t,r,n){if(e=ge(e),t=ge(e),ft(e,t))return qe;switch(e){case 1:return hp(r);case 2:return Bg(r);case 3:return Lg(r);case 4:return Jw(r);case 5:return Qw(r);case 6:return jw(r);case 7:return Yo.S(r);case 8:return Yo.P(r);case 9:return vl(r);case 10:return Oo.S(r);case 11:return Oo.P(r);case 12:return i$(r);case 13:return dp.SNGL(r);case 14:return n$(r,n);case 15:return a$(r,n);case 16:return ga.INC(r,n);case 17:return vp.INC(r,n);case 18:return ga.EXC(r,n);case 19:return vp.EXC(r,n)}}function ghe(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 xhe(e){if(e=ge(e),e instanceof Error)return e;let t=Math.asin(e);return isNaN(t)&&(t=rt),t}function yhe(e){return e=ge(e),e instanceof Error?e:Math.log(e+Math.sqrt(e*e+1))}function whe(e){return e=ge(e),e instanceof Error?e:Math.atan(e)}function bhe(e,t){e=ge(e),t=ge(t);let r=gr(e,t);return r||Math.atan2(e,t)}function Dhe(e){if(e=ge(e),e instanceof Error)return e;let t=Math.log((1+e)/(1-e))/2;return isNaN(t)&&(t=rt),t}function Nhe(e,t,r){e=ge(e),t=ge(t),r=ge(r);let n=gr(e,t,r);if(n)return n;if(t===0)return rt;let i=e.toString(t);return new Array(Math.max(r+1-i.length,0)).join("0")+i}function dl(e,t,r){e=ge(e),t=ge(t),r=ge(r);let n=gr(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?Du(Math.ceil(e/t)*t,i):r===0?-Du(Math.floor(Math.abs(e)/t)*t,i):-Du(Math.ceil(Math.abs(e)/t)*t,i)}dl.MATH=dl;dl.PRECISE=dl;function Ih(e,t){e=ge(e),t=ge(t);let r=gr(e,t);return r||(e1?rC:(e=ge(e),e instanceof Error||(e=Math.exp(e)),e)}var Yw=[];function hl(e){if(e=ge(e),e instanceof Error)return e;let t=Math.floor(e);return t===0||t===1?1:(Yw[t]>0||(Yw[t]=hl(t-1)*t),Yw[t])}function l$(e){if(e=ge(e),e instanceof Error)return e;let t=Math.floor(e);return t<=0?1:t*l$(t-2)}function gp(e,t){e=ge(e),t=ge(t);let r=gr(e,t);if(r)return r;if(t===0)return 0;if(!(e>=0&&t>0)&&!(e<=0&&t<0))return rt;t=Math.abs(t);let n=-Math.floor(Math.log(t)/Math.log(10));return e>=0?Du(Math.floor(e/t)*t,n):-Du(Math.ceil(Math.abs(e)/t),n)}gp.MATH=(e,t,r)=>{if(t instanceof Error)return t;t=t===void 0?0:t,e=ge(e),t=ge(t),r=ge(r);let n=gr(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?Du(Math.floor(e/t)*t,i):r===0||r===void 0?-Du(Math.ceil(Math.abs(e)/t)*t,i):-Du(Math.floor(Math.abs(e)/t)*t,i)};gp.PRECISE=gp.MATH;function Bhe(){let e=It(vt(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 Lhe(e){return e=ge(e),e instanceof Error?e:Math.floor(e)}var Phe={CEILING:dl};function Rhe(){let e=It(vt(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 qhe(e){return e=ge(e),e instanceof Error?e:e===0?rt:Math.log(e)}function zhe(e,t){e=ge(e),t=ge(t);let r=gr(e,t);return r||(e===0||t===0?rt:Math.log(e)/Math.log(t))}function Uhe(e){return e=ge(e),e instanceof Error?e:e===0?rt:Math.log(e)/Math.log(10)}function Hhe(e,t){return!Array.isArray(e)||!Array.isArray(t)||e.some(n=>!n.length)||t.some(n=>!n.length)||jA(e).some(n=>typeof n!="number")||jA(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 $he(e,t){e=ge(e),t=ge(t);let r=gr(e,t);if(r)return r;if(t===0)return ho;let n=Math.abs(e%t);return n=e<0?t-n:n,t>0?n:-n}function Whe(e,t){e=ge(e),t=ge(t);let r=gr(e,t);return r||(e*t===0?0:e*t<0?rt:Math.round(e/t)*t)}function Vhe(){let e=It(vt(arguments));if(e instanceof Error)return e;let t=0,r=1;for(let n=0;n1?Jt:(e=parseInt(e),!e||e<=0?qe:Array(e).fill(0).map(()=>Array(e).fill(0)).map((t,r)=>(t[r]=1,t)))}function Yhe(e){if(e=ge(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 Zhe(){return Math.PI}function f$(e,t){e=ge(e),t=ge(t);let r=gr(e,t);if(r)return r;if(e===0&&t===0)return rt;let n=Math.pow(e,t);return isNaN(n)?rt:n}function jw(){let t=vt(arguments).filter(i=>i!=null);if(t.length===0)return 0;let r=It(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 tde(e,t){e=ge(e),t=ge(t);let r=gr(e,t);return r||(e>0?1:-1)*Math.ceil(Math.abs(e)*Math.pow(10,t))/Math.pow(10,t)}function rde(e){return e=ge(e),e instanceof Error?e:1/Math.cos(e)}function nde(e){return e=ge(e),e instanceof Error?e:2/(Math.exp(e)+Math.exp(-e))}function ide(e,t,r,n){if(e=ge(e),t=ge(t),r=ge(r),n=It(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=vl.apply(null,t);r instanceof Error?e=r:e+=r}}),e}function cde(e,t,r){if(e=vt(e),r=r?vt(r):e,e instanceof Error)return e;if(t==null||t instanceof Error)return 0;let n=0,i=t==="*",o=i?null:_h(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 Jt;e=ge(e),t=ge(t);let r=gr(e,t);return r||e+t}function Dde(e,t){if(arguments.length!==2)return Jt;e=ge(e),t=ge(t);let r=gr(e,t);return r||(t===0?ho:e/t)}function Nde(e,t){return arguments.length!==2?Jt:e instanceof Error?e:t instanceof Error?t:(e===null&&(e=void 0),t===null&&(t=void 0),e===t)}function Sde(e,t){if(arguments.length!==2)return Jt;if(e instanceof Error)return e;if(t instanceof Error)return t;ib(e,t)?(e=Kn(e),t=Kn(t)):(e=ge(e),t=ge(t));let r=gr(e,t);return r||e>t}function Ede(e,t){if(arguments.length!==2)return Jt;ib(e,t)?(e=Kn(e),t=Kn(t)):(e=ge(e),t=ge(t));let r=gr(e,t);return r||e>=t}function Ade(e,t){if(arguments.length!==2)return Jt;ib(e,t)?(e=Kn(e),t=Kn(t)):(e=ge(e),t=ge(t));let r=gr(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 zde(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 Ude(e){return e=br(e),e instanceof Error?e:e.getHours()}function c$(e){if(e=br(e),e instanceof Error)return e;e=tb(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 Hde(e){return e=br(e),e instanceof Error?e:e.getMinutes()}function $de(e){return e=br(e),e instanceof Error?e:e.getMonth()+1}function ub(e,t,r){return ub.INTL(e,t,1,r)}ub.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=eb[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 N=0;N{if(e=br(e),e instanceof Error)return e;if(t=ge(t),t instanceof Error)return t;if(r===void 0?r=eb[1]:r=eb[r],!(r instanceof Array))return qe;n===void 0?n=[]:n instanceof Array||(n=[n]);for(let u=0;u{let D=N.getFullYear(),b=new Date(D,2,1);if(KA(D)&&N=b)return!0;let O=w.getFullYear(),M=new Date(O,2,1);return KA(O)&&w>=M&&Nl||i===l&&n>=u))return(o===a&&KA(o)||s(e,t)||l===1&&u===29)&&(f=366),Zw(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 Zw(e,t)/y}case 2:return Zw(e,t)/360;case 3:return Zw(e,t)/365;case 4:return(u+l*30+a*360-(n+i*30+o*360))/360}}function $H(e){let t=e>-22038912e5?2:1;return Math.ceil((e-_de)/864e5)+t}function Qde(){throw new Error("ASC is not implemented")}function jde(){throw new Error("BAHTTEXT is not implemented")}function p$(e){return e=ge(e),e===0?qe:e instanceof Error?e:String.fromCharCode(e)}function eve(e){if(ft(e))return e;e=e||"";let t=/[\0-\x1F]/g;return e.replace(t,"")}function m$(e){if(ft(e))return e;e=e||"";let t=e.charCodeAt(0);return isNaN(t)&&(t=qe),t}function h$(){let e=vt(arguments),t=gr.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 tve=h$;function rve(){throw new Error("DBCS is not implemented")}function nve(e,t=2){if(e=ge(e),isNaN(e))return qe;e=Du(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 ive(e,t){if(arguments.length!==2)return Jt;let r=gr(e,t);return r||(e=Kn(e),t=Kn(t),e===t)}function ove(e,t,r){if(arguments.length<2)return Jt;e=Kn(e),t=Kn(t),r=r===void 0?0:r;let n=t.indexOf(e,r-1);return n===-1?qe:n+1}function d$(e,t=2,r=!1){if(e=ge(e),isNaN(e)||(t=ge(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 ave(e,t){let r=gr(e,t);return r||(e=Kn(e),t=t===void 0?1:t,t=ge(t),t instanceof Error||typeof e!="string"?qe:e.substring(0,t))}function sve(e){return arguments.length===0?rC:e instanceof Error?e:Array.isArray(e)?qe:Kn(e).length}function uve(e){return arguments.length!==1?qe:(e=Kn(e),ft(e)?e:e.toLowerCase())}function lve(e,t,r){if(t==null)return qe;if(t=ge(t),r=ge(r),ft(t,r)||typeof e!="string")return r;let n=t-1,i=n+r;return e.substring(n,i)}function fve(e,t,r){return e=Bh(e)?e:"",typeof e=="number"?e:typeof e!="string"?Jt:(t=typeof t>"u"?".":t,r=typeof r>"u"?",":r,Number(e.replace(t,".").replace(r,"")))}function cve(){throw new Error("PRONETIC is not implemented")}function pve(e){return ft(e)?e:isNaN(e)&&typeof e=="number"?qe:(e=Kn(e),e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()))}function mve(e,t,r,n){return t=ge(t),r=ge(r),ft(t,r)||typeof e!="string"||typeof n!="string"?qe:e.substr(0,t-1)+n+e.substr(t-1+r)}function ya(e,t){let r=gr(e,t);return r||(e=Kn(e),t=ge(t),t instanceof Error?t:new Array(t+1).join(e))}function hve(e,t){let r=gr(e,t);return r||(e=Kn(e),t=t===void 0?1:t,t=ge(t),t instanceof Error?t:e.substring(e.length-t))}function dve(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 vve(e,t,r,n){if(arguments.length<3)return Jt;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 gve(e){return e instanceof Error||typeof e=="string"?e:""}function xve(e,t){if(e===void 0||e instanceof Error||t instanceof Error)return Jt;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=d$(e,i,o),e.startsWith("-")?(e=e.replace("-",""),e="-"+r+e):e=r+e,n&&(e=e+"%"),e}function yve(e,t,...r){if(typeof t!="boolean"&&(t=iC(t)),arguments.length<3)return Jt;e=e??"";let n=vt(r),i=t?n.filter(o=>o):n;if(Array.isArray(e)){e=vt(e);let o=i.map(l=>[l]),u=0;for(let l=0;l=n.length?ya("0",t-n.length)+n:rt)}function Ive(e,t){if(!xC(e))return rt;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?rt:(t=Math.floor(t),t>=n.length?ya("0",t-n.length)+n:rt)}function Fve(e,t){return e=ge(e),t=ge(t),ft(e,t)?qe:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?rt:e&t}function _ve(e,t){return e=ge(e),t=ge(t),ft(e,t)?qe:e<0||Math.floor(e)!==e||e>0xffffffffffff||Math.abs(t)>53?rt:t>=0?e<>-t}function kve(e,t){return e=ge(e),t=ge(t),ft(e,t)?qe:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?rt:e|t}function Bve(e,t){return e=ge(e),t=ge(t),ft(e,t)?qe:e<0||Math.floor(e)!==e||e>0xffffffffffff||Math.abs(t)>53?rt:t>=0?e>>t:e<<-t}function Lve(e,t){return e=ge(e),t=ge(t),ft(e,t)?qe:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?rt:e^t}function vo(e,t,r){if(e=ge(e),t=ge(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 Pve(e,t,r){if(e=ge(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)],N=o[t.substring(0,1)];t.substring(0,2)==="da"&&(N=["dekao",10,"da"]),y?(f=y[2],a=t.substring(2)):N&&(f=N[1],a=t.substring(N[2].length));for(let w=0;w=0)&&(u=n[w])}if(l===null){let y=i[r.substring(0,2)],N=o[r.substring(0,1)];r.substring(0,2)==="da"&&(N=["dekao",10,"da"]),y?(p=y[2],s=r.substring(2)):N&&(p=N[1],s=r.substring(N[2].length));for(let w=0;w=0)&&(l=n[w])}return u===null||l===null||u[3]!==l[3]?Jt:e*u[6]*f/(l[6]*p)}function Rve(e,t){if(e=ge(e),e instanceof Error)return e;if(!/^-?[0-9]{1,3}$/.test(e)||e<-512||e>511)return rt;if(e<0)return"1"+ya("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?rt:(t=Math.floor(t),t>=r.length?ya("0",t-r.length)+r:rt)}function qve(e,t){if(e=ge(e),e instanceof Error)return e;if(!/^-?[0-9]{1,12}$/.test(e)||e<-549755813888||e>549755813887)return rt;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?rt:(t=Math.floor(t),t>=r.length?ya("0",t-r.length)+r:rt)}function zve(e,t){if(e=ge(e),e instanceof Error)return e;if(!/^-?[0-9]{1,9}$/.test(e)||e<-536870912||e>536870911)return rt;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?rt:(t=Math.floor(t),t>=r.length?ya("0",t-r.length)+r:rt)}function Uve(e,t){return t=t===void 0?0:t,e=ge(e),t=ge(t),ft(e,t)?qe:e===t?1:0}function yC(e,t){return t=t===void 0?0:t,e=ge(e),t=ge(t),ft(e,t)?qe:Ct.default.erf(e)}yC.PRECISE=()=>{throw new Error("ERF.PRECISE is not implemented")};function wC(e){return isNaN(e)?qe:Ct.default.erfc(e)}wC.PRECISE=()=>{throw new Error("ERFC.PRECISE is not implemented")};function Hve(e,t){return t=t||0,e=ge(e),ft(t,e)?e:e>=t?1:0}function $ve(e,t){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return rt;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 rt;if(r)return"1"+ya("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?rt:(t=Math.floor(t),t>=i.length?ya("0",t-i.length)+i:rt)}function Wve(e){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return rt;let t=parseInt(e,16);return t>=549755813888?t-1099511627776:t}function Vve(e,t){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return rt;let r=parseInt(e,16);if(r>536870911&&r<0xffe0000000)return rt;if(r>=0xffe0000000)return(r-0xffc0000000).toString(8);let n=r.toString(8);return t===void 0?n:isNaN(t)?qe:t<0?rt:(t=Math.floor(t),t>=n.length?ya("0",t-n.length)+n:rt)}function bC(e){let t=tn(e),r=en(e);return ft(t,r)?qe:Math.sqrt(Math.pow(t,2)+Math.pow(r,2))}function en(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))?rt:Number(e.substring(t+1,e.length-1)):isNaN(e.substring(0,r))||isNaN(e.substring(r+1,e.length-1))?rt:-Number(e.substring(r+1,e.length-1)):rt:i?isNaN(e.substring(0,e.length-1))?rt:e.substring(0,e.length-1):isNaN(e)?rt:0}function DC(e){let t=tn(e),r=en(e);return ft(t,r)?qe:t===0&&r===0?ho: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 Gve(e){let t=tn(e),r=en(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",r!==0?vo(t,-r,n):e}function fb(e){let t=tn(e),r=en(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",vo(Math.cos(t)*(Math.exp(r)+Math.exp(-r))/2,-Math.sin(t)*(Math.exp(r)-Math.exp(-r))/2,n)}function v$(e){let t=tn(e),r=en(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",vo(Math.cos(r)*(Math.exp(t)+Math.exp(-t))/2,Math.sin(r)*(Math.exp(t)-Math.exp(-t))/2,n)}function Yve(e){let t=tn(e),r=en(e);return ft(t,r)?qe:wp(fb(e),cb(e))}function wp(e,t){let r=tn(e),n=en(e),i=tn(t),o=en(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 rt;let s=i*i+o*o;return vo((r*i+n*o)/s,(n*i-r*o)/s,a)}function Zve(e){let t=tn(e),r=en(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 vo(i*Math.cos(r),i*Math.sin(r),n)}function Xve(e){let t=tn(e),r=en(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",vo(Math.log(Math.sqrt(t*t+r*r)),Math.atan(r/t),n)}function Kve(e){let t=tn(e),r=en(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",vo(Math.log(Math.sqrt(t*t+r*r))/Math.log(10),Math.atan(r/t)/Math.log(10),n)}function Jve(e){let t=tn(e),r=en(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",vo(Math.log(Math.sqrt(t*t+r*r))/Math.log(2),Math.atan(r/t)/Math.log(2),n)}function Qve(e,t){t=ge(t);let r=tn(e),n=en(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(bC(e),t),u=DC(e);return vo(o*Math.cos(t*u),o*Math.sin(t*u),i)}function jve(){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))?rt:Number(e.substring(0,t)):isNaN(e.substring(0,r))||isNaN(e.substring(r+1,e.length-1))?rt:Number(e.substring(0,r)):rt:i?isNaN(e.substring(0,e.length-1))?rt:0:isNaN(e)?rt:e}function ege(e){if(e===!0||e===!1)return qe;let t=tn(e),r=en(e);return ft(t,r)?qe:wp("1",fb(e))}function tge(e){let t=tn(e),r=en(e);return ft(t,r)?qe:wp("1",v$(e))}function cb(e){let t=tn(e),r=en(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",vo(Math.sin(t)*(Math.exp(r)+Math.exp(-r))/2,Math.cos(t)*(Math.exp(r)-Math.exp(-r))/2,n)}function g$(e){let t=tn(e),r=en(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",vo(Math.cos(r)*(Math.exp(t)-Math.exp(-t))/2,Math.sin(r)*(Math.exp(t)+Math.exp(-t))/2,n)}function rge(e){let t=tn(e),r=en(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(bC(e)),o=DC(e);return vo(i*Math.cos(o/2),i*Math.sin(o/2),n)}function nge(e){if(e===!0||e===!1)return qe;let t=tn(e),r=en(e);return ft(t,r)?rt:wp("1",cb(e))}function ige(e){if(e===!0||e===!1)return qe;let t=tn(e),r=en(e);return ft(t,r)?rt:wp("1",g$(e))}function oge(e,t){let r=tn(e),n=en(e),i=tn(t),o=en(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"),vo(r-i,n-o,a)}function age(){if(!arguments.length)return qe;let e=vt(arguments),t=e[0];for(let r=1;r511)return rt;if(r)return"1"+ya("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?rt:(t=Math.floor(t),t>=i.length?ya("0",t-i.length)+i:rt)}function lge(e){if(!/^[0-7]{1,10}$/.test(e))return rt;let t=parseInt(e,8);return t>=536870912?t-1073741824:t}function fge(e,t){if(!/^[0-7]{1,10}$/.test(e))return rt;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?rt:(t=Math.floor(t),t>=n.length?ya("0",t-n.length)+n:rt)}var cge=Rg.DIST,pge=Rg.INV,mge=Lh.DIST,hge=dl.MATH,dge=dl.PRECISE,vge=Fs.DIST,gge=Fs.DIST.RT,xge=Fs.INV,yge=Fs.INV.RT,wge=Fs.TEST,bge=Ph.P,Dge=Ph.P,Nge=Ph.S,Sge=Lh.INV,Ege=wC.PRECISE,Age=yC.PRECISE,Cge=uC.DIST,Mge=_s.DIST,Tge=_s.DIST.RT,Oge=_s.INV,Ige=_s.INV.RT,Fge=gp.MATH,_ge=gp.PRECISE,kge=_s.TEST,Bge=qg.DIST,Lge=qg.INV,Pge=lC.PRECISE,Rge=fC.DIST,qge=Rh.INV,zge=Rh.DIST,Uge=Rh.INV,Hge=dp.MULT,$ge=dp.SNGL,Wge=pC.DIST,Vge=ub.INTL,Gge=ks.DIST,Yge=ks.INV,Zge=ks.S.DIST,Xge=ks.S.INV,Kge=ga.EXC,Jge=ga.INC,Qge=zg.EXC,jge=zg.INC,e0e=mC.DIST,t0e=vp.EXC,r0e=vp.INC,n0e=Ug.AVG,i0e=Ug.EQ,o0e=hC.P,a0e=Yo.P,s0e=Yo.S,u0e=xa.DIST,l0e=xa.DIST.RT,f0e=xa.INV,c0e=xa.TEST,p0e=Oo.P,m0e=Oo.S,h0e=dC.DIST,d0e=lb.INTL,v0e=vC.TEST;function NC(e){let t=[];return mo(e,r=>{r&&t.push(r)}),t}function Za(e,t){let r={};for(let o=1;on&&(n=t[o].length);for(let o=1;o{o+=i[u]}),n.length===0?ho:o/n.length}function x0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Za(e,r),i=[];if(typeof t=="string"){let u=Ya(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return mo(n,u=>{o.push(i[u])}),Bg(o)}function y0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Za(e,r),i=[];if(typeof t=="string"){let u=Ya(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return mo(n,u=>{o.push(i[u])}),Lg(o)}function w0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Za(e,r),i=[];if(typeof t=="string"){let o=Ya(e,t);i=wn(e[o])}else i=wn(e[t]);return n.length===0?qe:n.length>1?rt:i[n[0]]}function b0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Za(e,r),i=[];if(typeof t=="string"){let u=Ya(e,t);i=wn(e[u])}else i=wn(e[t]);let o=i[n[0]];return mo(n,u=>{o{o>i[u]&&(o=i[u])}),o}function N0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Za(e,r),i=[];if(typeof t=="string"){let l=Ya(e,t);i=wn(e[l])}else i=wn(e[t]);let o=[];mo(n,l=>{o.push(i[l])}),o=NC(o);let u=1;return mo(o,l=>{u*=l}),u}function S0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Za(e,r),i=[];if(typeof t=="string"){let u=Ya(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return mo(n,u=>{o.push(i[u])}),o=NC(o),Yo.S(o)}function E0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Za(e,r),i=[];if(typeof t=="string"){let u=Ya(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return mo(n,u=>{o.push(i[u])}),o=NC(o),Yo.P(o)}function A0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Za(e,r),i=[];if(typeof t=="string"){let u=Ya(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return mo(n,u=>{o.push(i[u])}),vl(o)}function C0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Za(e,r),i=[];if(typeof t=="string"){let u=Ya(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return mo(n,u=>{o.push(i[u])}),Oo.S(o)}function M0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Za(e,r),i=[];if(typeof t=="string"){let u=Ya(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return mo(n,u=>{o.push(i[u])}),Oo.P(o)}function JA(e){return e&&e.getTime&&!isNaN(e.getTime())}function QA(e){return e instanceof Date?e:new Date(e)}function T0e(e,t,r){let n=br(t);for(n.setFullYear(e.getFullYear()),ne;)n.setMonth(n.getMonth()+-12/r);return n}function x$(e){return e=ge(e),[1,2,4].indexOf(e)===-1?rt:e}function y$(e){return e=ge(e),[0,1,2,3,4].indexOf(e)===-1?rt:e}function O0e(e,t,r,n,i,o,u){return e=QA(e),t=QA(t),r=QA(r),o=x$(o),u=y$(u),gr(o,u)?rt:!JA(e)||!JA(t)||!JA(r)?qe:n<=0||i<=0||r<=e?rt:(i=i||0,u=u||0,i*n*gC(e,r,u))}function I0e(){throw new Error("ACCRINTM is not implemented")}function F0e(){throw new Error("AMORDEGRC is not implemented")}function _0e(){throw new Error("AMORLINC is not implemented")}function k0e(){throw new Error("COUPDAYBS is not implemented")}function B0e(e,t,r,n){if(n=y$(n),r=x$(r),e=br(e),t=br(t),gr(e,t))return qe;if(gr(r,n)||e>=t)return rt;if(n===1){let o=T0e(e,t,r),u=br(o);return u.setMonth(u.getMonth()+12/r),kf(o,u,"D")}let i;switch(n){case 0:case 2:case 4:i=360;break;case 3:i=365;break;default:return rt}return i/r}function L0e(){throw new Error("COUPDAYSNC is not implemented")}function P0e(){throw new Error("COUPNCD is not implemented")}function R0e(){throw new Error("COUPNUM is not implemented")}function q0e(){throw new Error("COUPPCD is not implemented")}function z0e(e,t,r,n,i,o){if(e=ge(e),t=ge(t),r=ge(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 rt;let u=Hg(e,t,r,0,o),l=0;n===1&&(o===0&&(l=-r),n++);for(let a=n;a<=i;a++)l+=o===1?xp(e,a-2,u,r,1)-u:xp(e,a-1,u,r,0);return l*=e,l}function U0e(e,t,r,n,i,o){if(e=ge(e),t=ge(t),r=ge(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 rt;let u=Hg(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-(xp(e,a-2,u,r,1)-u)*e:u-xp(e,a-1,u,r,0)*e;return l}function H0e(e,t,r,n,i){if(i=i===void 0?12:i,e=ge(e),t=ge(t),r=ge(r),n=ge(n),i=ge(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 rt;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 $0e(e,t,r,n,i){if(i=i===void 0?2:i,e=ge(e),t=ge(t),r=ge(r),n=ge(n),i=ge(i),ft(e,t,r,n,i))return qe;if(e<0||t<0||r<0||n<0||i<=0||n>r)return rt;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 W0e(e,t,r,n,i){if(e=br(e),t=br(t),r=ge(r),n=ge(n),i=ge(i),i=i||0,ft(e,t,r,n,i))return qe;if(r<=0||n<=0)return rt;if(e>=t)return qe;let o,u;switch(i){case 0:o=360,u=Bf(e,t,!1);break;case 1:o=365,u=kf(e,t,"D");break;case 2:o=360,u=kf(e,t,"D");break;case 3:o=365,u=kf(e,t,"D");break;case 4:o=360,u=Bf(e,t,!0);break;default:return rt}return(n-r)/n*o/u}function V0e(e,t){if(e=ge(e),t=ge(t),ft(e,t))return qe;if(t<0)return rt;if(t>=0&&t<1)return ho;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 G0e(e,t){if(e=ge(e),t=ge(t),ft(e,t))return qe;if(t<0)return rt;if(t>=0&&t<1)return ho;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 Y0e(){throw new Error("DURATION is not implemented")}function Z0e(e,t){return e=ge(e),t=ge(t),ft(e,t)?qe:e<=0||t<1?rt:(t=parseInt(t,10),Math.pow(1+e/t,t)-1)}function xp(e,t,r,n,i){if(n=n||0,i=i||0,e=ge(e),t=ge(t),r=ge(r),n=ge(n),i=ge(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 X0e(e,t){if(e=ge(e),t=It(vt(t)),ft(e,t))return qe;let r=t.length,n=e;for(let i=0;i{let D=w+1,b=y[0];for(let O=1;O{let D=w+1,b=0;for(let O=1;O0&&(o=!0),e[y]<0&&(u=!0);if(!o||!u)return rt;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 Q0e(e,t,r,n){return e=ge(e),t=ge(t),r=ge(r),n=ge(n),ft(e,t,r,n)?qe:n*e*(t/r-1)}function j0e(){throw new Error("MDURATION is not implemented")}function e1e(e,t,r){if(e=It(vt(e)),t=ge(t),r=ge(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=Bf(e,t,!1);break;case 1:o=365,u=kf(e,t,"D");break;case 2:o=360,u=kf(e,t,"D");break;case 3:o=365,u=kf(e,t,"D");break;case 4:o=360,u=Bf(e,t,!0);break;default:return rt}return n-r*n*u/o}function c1e(){throw new Error("PRICEMAT is not implemented")}function p1e(e,t,r,n,i){return n=n||0,i=i||0,e=ge(e),t=ge(t),r=ge(r),n=ge(n),i=ge(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=ge(e),t=ge(t),r=ge(r),n=ge(n),i=ge(i),o=ge(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?rt:(n=parseInt(n,10),(e-t)*(r-n+1)*2/(r*(r+1)))}function x1e(e,t,r){return e=br(e),t=br(t),r=ge(r),ft(e,t,r)?qe:r<=0||e>t||t-e>365*24*60*60*1e3?rt:365*r/(360-r*Bf(e,t,!1))}function y1e(e,t,r){return e=br(e),t=br(t),r=ge(r),ft(e,t,r)?qe:r<=0||e>t||t-e>365*24*60*60*1e3?rt:100*(1-r*Bf(e,t,!1)/360)}function w1e(e,t,r){return e=br(e),t=br(t),r=ge(r),ft(e,t,r)?qe:r<=0||e>t||t-e>365*24*60*60*1e3?rt:(100-r)*360/(r*Bf(e,t,!1))}function b1e(){throw new Error("VDB is not implemented")}function D1e(e,t,r){if(e=It(vt(e)),t=XH(vt(t)),r=ge(r),ft(e,t,r))return qe;let n=(y,N,w)=>{let D=w+1,b=y[0];for(let O=1;O{let D=w+1,b=0;for(let O=1;O0&&(o=!0),e[y]<0&&(u=!0);if(!o||!u)return rt;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 N1e(e,t,r){if(e=ge(e),t=It(vt(t)),r=XH(vt(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 O1e(){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=qt.getLineNumber(u),a=l+1,s="",f=u.text.trim().split("//")[0].split("#")[0];if(qt.removeLineClass(u,"gutter","lineNoError"),Ge.settings.rulers?(qt.removeLineClass(u,"wrap","noRuler"),qt.addLineClass(u,"wrap","ruler")):(qt.removeLineClass(u,"wrap","ruler"),qt.addLineClass(u,"wrap","noRuler")),f)try{f=a>1&&f.charAt(0).match(/[+\-*/]/)&&qt.getLine(a-2).length>0&&Ge.settings.contPrevLine?Ge.mathScope.ans+f:f,Rx()&&(f=f.replace(/[,;]/g,p=>p===","?".":",")),Ge.mathScope.avg=_r.evaluate(r.length>0?"("+_r.mean(r)+")":"0"),Ge.mathScope.total=_r.evaluate(n.length>0?"("+n.join("+")+")":"0"),Ge.mathScope.subtotal=_r.evaluate(i.length>0?"("+i.join("+")+")":"0");try{s=_r.evaluate(f,Ge.mathScope)}catch{s=q1e(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=_r.format(s,{notation:Ge.settings.notation,lowerExp:+Ge.settings.expLower,upperExp:+Ge.settings.expUpper});let p=s;if(s=$g(s,!1),t=$g(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&&(qt.addLineClass(l,"gutter","lineNoError"),s=`Error`)}else i.length=0;e+=`
      {var{typed:t,mathWithTransform:r,Help:n}=e;return t(q7,{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(R7,l);if(!a){var s=typeof l=="function"?l.name:l;throw new Error('No documentation found on "'+s+'"')}return new n(a)}})});v();x();g();var U7="chain",Wfe=["typed","Chain"],H7=K(U7,Wfe,e=>{var{typed:t,Chain:r}=e;return t(U7,{"":function(){return new r},any:function(i){return new r(i)}})});v();x();g();var $7="det",Vfe=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],W7=K($7,Vfe,e=>{var{typed:t,matrix:r,subtractScalar:n,multiply:i,divideScalar:o,isZero:u,unaryMinus:l}=e;return t($7,{any:function(f){return Bt(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 Bt(f);case 1:if(p[0]===1)return Bt(f.valueOf()[0]);if(p[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+Zt(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: "+Zt(p)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Zt(p)+")")}}});function a(s,f,p){if(f===1)return Bt(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),N=0;N{var{typed:t,matrix:r,divideScalar:n,addScalar:i,multiply:o,unaryMinus:u,det:l,identity:a,abs:s}=e;return t(V7,{"Array | Matrix":function(h){var y=Et(h)?h.size():$t(h);switch(y.length){case 1:if(y[0]===1)return Et(h)?r([n(1,h.valueOf()[0])]):[n(1,h[0])];throw new RangeError("Matrix must be square (size: "+Zt(y)+")");case 2:{var N=y[0],w=y[1];if(N===w)return Et(h)?r(f(h.valueOf(),N,w),h.storage()):f(h,N,w);throw new RangeError("Matrix must be square (size: "+Zt(y)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Zt(y)+")")}},any:function(h){return n(1,h)}});function f(p,h,y){var N,w,D,b,O;if(h===1){if(b=p[0][0],b===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,b)]]}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(N=0;NP&&(P=s(I[N][C]),R=N),N++;if(P===0)throw Error("Cannot calculate inverse, determinant is zero");N=R,N!==C&&(O=I[C],I[C]=I[N],I[N]=O,O=F[C],F[C]=F[N],F[N]=O);var q=I[C],z=F[C];for(N=0;N{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(Y7,{"Array | Matrix":function(M){var I=Et(M)?M.size():$t(M);switch(I.length){case 1:return b(M)?a(M):I[0]===1?n(M):u(a(M),l(M,M));case 2:{if(b(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(y(M.valueOf(),F,C),M.storage()):y(M,F,C)}default:throw new RangeError("Matrix must be two dimensional (size: "+Zt(I)+")")}},any:function(M){return o(M,0)?Bt(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 N(O,M,I){for(var F=Bt(O),C=0,P=0;PR.filter((z,H)=>H!D(l(F[q],F[q])));return{C,F:P}}function D(O){return o(p(O,h(1,1)),p(0,h(1,1)))}function b(O){return i(p(O,h(1,1)),p(f(O,0),h(1,1)))}});v();x();g();v();x();g();function X7(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:N,usolve:w,usolveAll:D,equal:b,complex:O,larger:M,smaller:I,matrixFromColumns:F,dot:C}=e;function P(ye,ce,Ne,Pe){var Ce=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,Oe=R(ye,ce,Ne,Pe,Ce);q(ye,ce,Ne,Pe,Ce,Oe);var{values:He,C:Se}=z(ye,ce,Ne,Pe,Ce);if(Ce){var ze=H(ye,ce,Se,Oe,He,Ne,Pe);return{values:He,eigenvectors:ze}}return{values:He}}function R(ye,ce,Ne,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,Be=Oe?s(10):2,lt=o(Be,Be),ct;Ce&&(ct=Array(ce).fill(ze));for(var de=!1;!de;){de=!0;for(var be=0;be1&&(de=f(Array(Be-1).fill(Se)))),Be-=1,ze.pop();for(var ot=0;ot2&&(de=f(Array(Be-2).fill(Se)))),Be-=2,ze.pop(),ze.pop();for(var ut=0;ut+r(a(J),a(j))),be>100){var Lt=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+We.join(", "));throw Lt.values=We,Lt.vectors=[],Lt}var fe=Ce?i(ct,ie(lt,ce)):void 0;return{values:We,C:fe}}function H(ye,ce,Ne,Pe,Ce,Oe,He){var Se=y(Ne),ze=i(Se,ye,Ne),We=He==="BigNumber",Be=He==="Complex",lt=We?s(0):Be?O(0):0,ct=We?s(1):Be?O(1):1,de=[],be=[];for(var Ue of Ce){var ve=X(de,Ue,b);ve===-1?(de.push(Ue),be.push(1)):be[ve]+=1}for(var Re=[],ke=de.length,Je=Array(ce).fill(lt),ot=f(Array(ce).fill(ct)),et=function(){var fe=de[ut],J=r(ze,i(fe,ot)),j=D(J,Je);for(j.shift();j.lengthi(pe,we)),Re.push(...j.map(we=>({value:fe,vector:n(we)})))},ut=0;ut=5)return null;for(Se=0;;){var ze=w(ye,He);if(I(he(re(He,[ze])),Pe))break;if(++Se>=10)return null;He=De(ze)}return He}function le(ye,ce,Ne){var Pe=Ne==="BigNumber",Ce=Ne==="Complex",Oe=Array(ye).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,Ne)}function re(ye,ce){var Ne=p(ye);for(var Pe of ce)Pe=h(Pe,Ne),ye=r(ye,i(u(C(Pe,ye),C(Pe,Pe)),Pe));return ye}function he(ye){return a(l(C(ye,ye)))}function De(ye,ce){var Ne=ce==="BigNumber",Pe=ce==="Complex",Ce=Ne?s(1):Pe?O(1):1;return i(u(Ce,he(ye)),ye)}return P}v();x();g();function K7(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,z){var H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.epsilon,V=arguments.length>3?arguments[3]:void 0,W=arguments.length>4?arguments[4]:void 0;if(V==="number")return N(q,H,W);if(V==="BigNumber")return w(q,H,W);throw TypeError("Unsupported data type: "+V)}function N(q,z,H){var V=q.length,W=Math.abs(z/V),ee,ie;if(H){ie=new Array(V);for(var X=0;X=Math.abs(W);){var le=Y[0][0],re=Y[0][1];ee=D(q[le][le],q[re][re],q[le][re]),q=F(q,ee,le,re),H&&(ie=O(ie,ee,le,re)),Y=C(q)}for(var he=Array(V).fill(0),De=0;De=i(W);){var le=Y[0][0],re=Y[0][1];ee=b(q[le][le],q[re][re],q[le][re]),q=I(q,ee,le,re),H&&(ie=M(ie,ee,le,re)),Y=P(q)}for(var he=Array(V).fill(0),De=0;De({value:W[ce],vector:ye}));return{values:W,eigenvectors:De}}return y}var Zfe="eigs",Xfe=["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"],J7=K(Zfe,Xfe,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:N,multiply:w,add:D,larger:b,column:O,flatten:M,number:I,complex:F,sqrt:C,diag:P,size:R,reshape:q,qr:z,usolve:H,usolveAll:V,im:W,re:ee,smaller:ie,matrixFromColumns:X,dot:Y}=e,le=K7({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:N,complex:F,multiply:w,add:D}),re=X7({config:t,addScalar:i,subtract:o,multiply:w,multiplyScalar:p,flatten:M,divideScalar:h,sqrt:C,abs:l,bignumber:N,diag:P,size:R,reshape:q,qr:z,inv:y,usolve:H,usolveAll:V,equal:u,complex:F,larger:b,smaller:ie,matrixFromColumns:X,dot:Y});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 Un(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.epsilon,We=De(Ce,ze,Se);return He.matricize&&(We.values=n(We.values),Se&&(We.eigenvectors=We.eigenvectors.map(Be=>{var{value:lt,vector:ct}=Be;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(Zt(ze),")"));var We=ze[0];if(ce(Se,We,Oe)&&(Ne(Se,We),ye(Se,We,Oe))){var Be=Pe(Ce,Se,We);return le(Se,We,Oe,Be,He)}var lt=Pe(Ce,Se,We);return re(Se,We,Oe,lt,He)}function ye(Ce,Oe,He){for(var Se=0;Se{var{typed:t,abs:r,add:n,identity:i,inv:o,multiply:u}=e;return t(Q7,{Matrix:function(p){var h=p.size();if(h.length!==2||h[0]!==h[1])throw new RangeError("Matrix must be square (size: "+Zt(h)+")");for(var y=h[0],N=1e-15,w=l(p),D=a(w,N),b=D.q,O=D.j,M=u(p,Math.pow(2,-O)),I=i(y),F=i(y),C=1,P=M,R=-1,q=1;q<=b;q++)q>1&&(P=u(P,M),R=-R),C=C*(b-q+1)/((2*b-q+1)*q),I=n(I,u(C,P)),F=n(F,u(C*R,P));for(var z=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 N(w){var D,b=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))),D=f(r(l(O,I))),D>y&&++b>h)throw new Error("computing square root of matrix: iterative method could not converge")}while(D>y);return O}return t(eq,{"Array | Matrix":function(D){var b=Et(D)?D.size():$t(D);switch(b.length){case 1:if(b[0]===1)return o(D,u);throw new RangeError("Matrix must be square (size: "+Zt(b)+")");case 2:{var O=b[0],M=b[1];if(O===M)return N(D);throw new RangeError("Matrix must be square (size: "+Zt(b)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+Zt(b)+")")}}})});v();x();g();var rq="sylvester",Qfe=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],nq=K(rq,Qfe,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:N,abs:w}=e;return t(rq,{"Matrix, Matrix, Matrix":D,"Array, Matrix, Matrix":function(O,M,I){return D(i(O),M,I)},"Array, Array, Matrix":function(O,M,I){return D(i(O),i(M),I)},"Array, Matrix, Array":function(O,M,I){return D(i(O),M,i(I))},"Matrix, Array, Matrix":function(O,M,I){return D(O,i(M),I)},"Matrix, Array, Array":function(O,M,I){return D(O,i(M),i(I))},"Matrix, Matrix, Array":function(O,M,I){return D(O,M,i(I))},"Array, Array, Array":function(O,M,I){return D(i(O),i(M),i(I)).toArray()}});function D(b,O,M){for(var I=O.size()[0],F=b.size()[0],C=r(b),P=C.T,R=C.U,q=r(o(-1,O)),z=q.T,H=q.U,V=o(o(a(R),M),H),W=u(0,F),ee=[],ie=(Be,lt)=>l(Be,lt,1),X=(Be,lt)=>l(Be,lt,0),Y=0;Y1e-5){for(var le=X(f(V,s(W,Y)),f(V,s(W,Y+1))),re=0;re{var{typed:t,matrix:r,identity:n,multiply:i,qr:o,norm:u,subtract:l}=e;return t(iq,{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,N;do{N=p;var w=o(p),D=w.Q,b=w.R;if(p=i(b,D),h=i(h,D),y++>100)break}while(u(l(p,N))>1e-4);return{U:h,T:p}}});v();x();g();var aq="lyap",ece=["typed","matrix","sylvester","multiply","transpose"],sq=K(aq,ece,e=>{var{typed:t,matrix:r,sylvester:n,multiply:i,transpose:o}=e;return t(aq,{"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()}})});v();x();g();var tce="divide",rce=["typed","matrix","multiply","equalScalar","divideScalar","inv"],uq=K(tce,rce,e=>{var{typed:t,matrix:r,multiply:n,equalScalar:i,divideScalar:o,inv:u}=e,l=Lr({typed:t,equalScalar:i}),a=Yn({typed:t});return t("divide",wy({"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))});v();x();g();var lq="distance",nce=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],fq=K(lq,nce,e=>{var{typed:t,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:o,deepEqual:u,sqrt:l,abs:a}=e;return t(lq,{"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]),z=n(i(P[0],C[1]),i(C[0],P[1]));return D(F[0],F[1],R,q,z)}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(N(C),N(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),z=n(i(P.lineTwoPtX,C.lineOnePtY),i(C.lineOnePtX,P.lineTwoPtY));return D(F.pointX,F.pointY,R,q,z)}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 D(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 b(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 D(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 b(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"||_t(I)}function f(I){return I.constructor!==Array&&(I=N(I)),s(I[0])&&s(I[1])}function p(I){return I.constructor!==Array&&(I=N(I)),s(I[0])&&s(I[1])&&s(I[2])}function h(I){return Array.isArray(I)||(I=N(I)),I.every(s)}function y(I){return I.constructor!==Array&&(I=N(I)),s(I[0])&&s(I[1])&&s(I[2])&&s(I[3])&&s(I[4])&&s(I[5])}function N(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 D(I,F,C,P,R){var q=a(r(r(i(C,I),i(P,F)),R)),z=l(r(i(C,C),i(P,P)));return o(q,z)}function b(I,F,C,P,R,q,z,H,V){var W=[n(i(n(R,F),V),i(n(q,C),H)),n(i(n(q,C),z),i(n(P,I),V)),n(i(n(P,I),H),i(n(R,F),z))];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(z,z),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:N,isNumeric:w}=e;return t("intersect",{"Array, Array, Array":D,"Array, Array, Array, Array":b,"Matrix, Matrix, Matrix":function(H,V,W){var ee=D(H.valueOf(),V.valueOf(),W.valueOf());return ee===null?null:u(ee)},"Matrix, Matrix, Matrix, Matrix":function(H,V,W,ee){var ie=b(H.valueOf(),V.valueOf(),W.valueOf(),ee.valueOf());return ie===null?null:u(ie)}});function D(z,H,V){if(z=O(z),H=O(H),V=O(V),!I(z))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(z[0],z[1],z[2],H[0],H[1],H[2],V[0],V[1],V[2],V[3])}function b(z,H,V,W){if(z=O(z),H=O(H),V=O(V),W=O(W),z.length===2){if(!M(z))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(z,H,V,W)}else if(z.length===3){if(!I(z))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(z[0],z[1],z[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(z){return z.length===1?z[0]:z.length>1&&Array.isArray(z[0])&&z.every(H=>Array.isArray(H)&&H.length===1)?y(z):z}function M(z){return z.length===2&&w(z[0])&&w(z[1])}function I(z){return z.length===3&&w(z[0])&&w(z[1])&&w(z[2])}function F(z){return z.length===4&&w(z[0])&&w(z[1])&&w(z[2])&&w(z[3])}function C(z,H,V,W){var ee=z,ie=V,X=f(ee,H),Y=f(ie,W),le=f(a(X[0],Y[1]),a(Y[0],X[1]));if(N(le)||p(n(le),r.epsilon))return null;var re=a(Y[0],ee[1]),he=a(Y[1],ee[0]),De=a(Y[0],ie[1]),ye=a(Y[1],ie[0]),ce=s(o(f(f(re,he),De),ye),le);return i(l(X,ce),ee)}function P(z,H,V,W,ee,ie,X,Y,le,re,he,De){var ye=a(f(z,H),f(V,W)),ce=a(f(ee,ie),f(X,Y)),Ne=a(f(le,re),f(he,De));return o(o(ye,ce),Ne)}function R(z,H,V,W,ee,ie,X,Y,le,re,he,De){var ye=P(z,X,re,X,H,Y,he,Y,V,le,De,le),ce=P(re,X,W,z,he,Y,ee,H,De,le,ie,V),Ne=P(z,X,W,z,H,Y,ee,H,V,le,ie,V),Pe=P(re,X,re,X,he,Y,he,Y,De,le,De,le),Ce=P(W,z,W,z,ee,H,ee,H,ie,V,ie,V),Oe=f(a(ye,ce),a(Ne,Pe)),He=f(a(Ce,Pe),a(ce,ce));if(N(He))return null;var Se=s(Oe,He),ze=s(o(ye,a(Se,ce)),Pe),We=o(z,a(Se,f(W,z))),Be=o(H,a(Se,f(ee,H))),lt=o(V,a(Se,f(ie,V))),ct=o(X,a(ze,f(re,X))),de=o(Y,a(ze,f(he,Y))),be=o(le,a(ze,f(De,le)));return h(We,ct)&&h(Be,de)&&h(lt,be)?[We,Be,lt]:null}function q(z,H,V,W,ee,ie,X,Y,le,re){var he=a(z,X),De=a(W,X),ye=a(H,Y),ce=a(ee,Y),Ne=a(V,le),Pe=a(ie,le),Ce=f(f(f(re,he),ye),Ne),Oe=f(f(f(o(o(De,ce),Pe),he),ye),Ne),He=s(Ce,Oe),Se=o(z,a(He,f(W,z))),ze=o(H,a(He,f(ee,H))),We=o(V,a(He,f(ie,V)));return[Se,ze,We]}});v();x();g();var pq="sum",ace=["typed","config","add","numeric"],zw=K(pq,ace,e=>{var{typed:t,config:r,add:n,numeric:i}=e;return t(pq,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":u,"...":function(a){if(Ua(a))throw new TypeError("Scalar values expected in function sum");return o(a)}});function o(l){var a;return fo(l,function(s){try{a=a===void 0?s:n(a,s)}catch(f){throw Mn(f,"sum",s)}}),a===void 0&&(a=i(0,r.number)),typeof a=="string"&&(a=i(a,r.number)),a}function u(l,a){try{var s=Tf(l,a,n);return s}catch(f){throw Mn(f,"sum")}}});v();x();g();var Uw="cumsum",sce=["typed","add","unaryPlus"],Hw=K(Uw,sce,e=>{var{typed:t,add:r,unaryPlus:n}=e;return t(Uw,{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(Ua(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 Mn(s,Uw)}}function o(a){if(a.length===0)return[];for(var s=[n(a[0])],f=1;f=f.length)throw new bi(s,f.length);try{return l(a,s)}catch(p){throw Mn(p,Uw)}}function l(a,s){var f,p,h;if(s<=0){var y=a[0][0];if(Array.isArray(y)){for(h=qy(a),p=[],f=0;f{var{typed:t,add:r,divide:n}=e;return t(mq,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":i,"...":function(l){if(Ua(l))throw new TypeError("Scalar values expected in function mean");return o(l)}});function i(u,l){try{var a=Tf(u,l,r),s=Array.isArray(u)?$t(u):u.size();return n(a,s[l])}catch(f){throw Mn(f,"mean")}}function o(u){var l,a=0;if(fo(u,function(s){try{l=l===void 0?s:r(l,s),a++}catch(f){throw Mn(f,"mean",s)}}),a===0)throw new Error("Cannot calculate the mean of an empty array");return n(l,a)}});v();x();g();var hq="median",lce=["typed","add","divide","compare","partitionSelect"],dq=K(hq,lce,e=>{var{typed:t,add:r,divide:n,compare:i,partitionSelect:o}=e;function u(s){try{s=rr(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],N=0;N0&&(y=s[N]);return a(y,h)}else{var w=o(s,(f-1)/2);return l(w)}}catch(D){throw Mn(D,"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(hq,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(f,p){throw new Error("median(A, dim) is not yet supported")},"...":function(f){if(Ua(f))throw new TypeError("Scalar values expected in function median");return u(f)}})});v();x();g();var vq="mad",fce=["typed","abs","map","median","subtract"],gq=K(vq,fce,e=>{var{typed:t,abs:r,map:n,median:i,subtract:o}=e;return t(vq,{"Array | Matrix":u,"...":function(a){return u(a)}});function u(l){if(l=rr(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.indexOf("median")!==-1?new TypeError(s.message.replace("median","mad")):Mn(s,"mad")}}});v();x();g();var BA="unbiased",xq="variance",cce=["typed","add","subtract","multiply","divide","apply","isNaN"],Ww=K(xq,cce,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:o,apply:u,isNaN:l}=e;return t(xq,{"Array | Matrix":function(p){return a(p,BA)},"Array | Matrix, string":a,"Array | Matrix, number | BigNumber":function(p,h){return s(p,h,BA)},"Array | Matrix, number | BigNumber, string":s,"...":function(p){return a(p,BA)}});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(fo(f,function(D){try{h=h===void 0?D:r(h,D),y++}catch(b){throw Mn(b,"variance",D)}}),y===0)throw new Error("Cannot calculate variance of an empty array");var N=o(h,y);if(h=void 0,fo(f,function(D){var b=n(D,N);h=h===void 0?i(b,b):r(h,i(b,b))}),l(h))return h;switch(p){case"uncorrected":return o(h,y);case"biased":return o(h,y+1);case"unbiased":{var w=_t(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 Mn(y,"variance")}}});v();x();g();var yq="quantileSeq",pce=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],Vw=K(yq,pce,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=gh({typed:t,isInteger:s});return t(yq,{"Array | Matrix, number | BigNumber":(O,M)=>w(O,M,!1),"Array | Matrix, number | BigNumber, number":(O,M,I)=>N(O,M,!1,I,w),"Array | Matrix, number | BigNumber, boolean":w,"Array | Matrix, number | BigNumber, boolean, number":(O,M,I,F)=>N(O,M,I,F,w),"Array | Matrix, Array | Matrix":(O,M)=>D(O,M,!1),"Array | Matrix, Array | Matrix, number":(O,M,I)=>N(O,M,!1,I,D),"Array | Matrix, Array | Matrix, boolean":D,"Array | Matrix, Array | Matrix, boolean, number":(O,M,I,F)=>N(O,M,I,F,D)});function N(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 Ht(M)?b(C,M,I):r(b(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(b(C,q,I))}return Ht(M)?F:r(F)}}function D(O,M,I){for(var F=O.valueOf(),C=M.valueOf(),P=[],R=0;R0&&(z=F[V])}return n(u(z,i(1,q)),u(H,q))}});v();x();g();var wq="std",mce=["typed","map","sqrt","variance"],Gw=K(wq,mce,e=>{var{typed:t,map:r,sqrt:n,variance:i}=e;return t(wq,{"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.indexOf(" variance")!==-1?new TypeError(s.message.replace(" variance"," std")):s}}});v();x();g();var bq="corr",hce=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],Dq=K(bq,hce,e=>{var{typed:t,matrix:r,sqrt:n,sum:i,add:o,subtract:u,multiply:l,pow:a,divide:s}=e;return t(bq,{"Array, Array":function(y,N){return f(y,N)},"Matrix, Matrix":function(y,N){var w=f(y.toArray(),N.toArray());return Array.isArray(w)?r(w):w}});function f(h,y){var N=[];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(N,b),l(w,D)),F=n(l(u(l(N,O),a(w,2)),u(l(N,M),a(D,2))));return s(I,F)}});v();x();g();var Nq="combinations",dce=["typed"],Sq=K(Nq,dce,e=>{var{typed:t}=e;return t(Nq,{"number, number":GS,"BigNumber, BigNumber":function(n,i){var o=n.constructor,u,l,a=n.minus(i),s=new o(1);if(!Eq(n)||!Eq(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 Eq(e){return e.isInteger()&&e.gte(0)}v();x();g();var Aq="combinationsWithRep",vce=["typed"],Mq=K(Aq,vce,e=>{var{typed:t}=e;return t(Aq,{"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 Ng(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(cp[0],0),y=1;y2;)h-=2,N+=h,y=y.times(N);return new o(y.toPrecision(o.precision))}});v();x();g();var Iq="lgamma",xce=["Complex","typed"],Fq=K(Iq,xce,e=>{var{Complex:t,typed:r}=e,n=7,i=7,o=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return r(Iq,{number:Eg,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(Eg(s.re),0);if(s.re>=n||Math.abs(s.im)>=i)return l(s);if(s.re<=h){var y=rF(f,s.im)*Math.floor(.5*s.re+.25),N=s.mul(Math.PI).sin().log(),w=u(new t(1-s.re,-s.im));return new t(p,y).sub(N).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(jS),p=new t(1,0).div(s),h=p.div(s),y=o[0],N=o[1],w=2*h.re,D=h.re*h.re+h.im*h.im,b=2;b<8;b++){var O=N;N=-D*y+o[b],y=w*y+O}var M=p.mul(h.mul(y).add(N));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))}});v();x();g();var _q="factorial",yce=["typed","gamma"],kq=K(_q,yce,e=>{var{typed:t,gamma:r}=e;return t(_q,{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=>Ot(i,n))})});v();x();g();var Bq="kldivergence",wce=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],Lq=K(Bq,wce,e=>{var{typed:t,matrix:r,divide:n,sum:i,multiply:o,map:u,dotDivide:l,log:a,isNumeric:s}=e;return t(Bq,{"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,N=p.size().length;if(y>1)throw new Error("first object must be one dimensional");if(N>1)throw new Error("second object must be one dimensional");if(y!==N)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 D=i(h);if(D===0)throw new Error("Sum of elements in second object must be non zero");var b=n(p,i(p)),O=n(h,i(h)),M=i(o(b,u(l(b,O),I=>a(I))));return s(M)?M:Number.NaN}});v();x();g();var Pq="multinomial",bce=["typed","add","divide","multiply","factorial","isInteger","isPositive"],Rq=K(Pq,bce,e=>{var{typed:t,add:r,divide:n,multiply:i,factorial:o,isInteger:u,isPositive:l}=e;return t(Pq,{"Array | Matrix":function(s){var f=0,p=1;return fo(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)}})});v();x();g();var qq="permutations",Dce=["typed","factorial"],Uq=K(qq,Dce,e=>{var{typed:t,factorial:r}=e;return t(qq,{"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 ca(i-o+1,i)},"BigNumber, BigNumber":function(i,o){var u,l;if(!zq(i)||!zq(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 zq(e){return e.isInteger()&&e.gte(0)}v();x();g();v();x();g();var HA=en(oz(),1),Oce=(0,HA.default)(Date.now());function Nl(e){var t;function r(i){t=i===null?Oce:(0,HA.default)(String(i))}r(e);function n(){return t()}return n}var az="pickRandom",Ice=["typed","config","?on"],sz=K(az,Ice,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(az,{"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=rr(u),s=rr(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 N=0,w=s.length;N"u")O=u[Math.floor(i()*D)];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(uz,{"":()=>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=Tg(l.valueOf(),()=>u(a,s));return Et(l)?l.create(f):f}function u(l,a){return l+i()*(a-l)}});v();x();g();var fz="randomInt",_ce=["typed","config","?on"],cz=K(fz,_ce,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(fz,{"":()=>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=Tg(l.valueOf(),()=>u(a,s));return Et(l)?l.create(f):f}function u(l,a){return Math.floor(l+i()*(a-l))}});v();x();g();var pz="stirlingS2",kce=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],mz=K(pz,kce,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,N=[],w=[];return t(pz,{"number | BigNumber, number | BigNumber":function(b,O){if(!f(b)||s(b)||!f(O)||s(O))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(y(O,b))throw new TypeError("k must be less than or equal to n in function stirlingS2");var M=!(Ht(b)&&Ht(O)),I=M?w:N,F=M?h:p,C=p(b),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],z=I[R-1],H=q.length;H<=R&&H<=P;++H)H===R?q[H]=1:q[H]=r(i(F(H),z[H]),z[H-1]);return I[C][P]}})});v();x();g();var hz="bellNumbers",Bce=["typed","addScalar","isNegative","isInteger","stirlingS2"],dz=K(hz,Bce,e=>{var{typed:t,addScalar:r,isNegative:n,isInteger:i,stirlingS2:o}=e;return t(hz,{"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}})});v();x();g();var vz="catalan",Lce=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],gz=K(vz,Lce,e=>{var{typed:t,addScalar:r,divideScalar:n,multiplyScalar:i,combinations:o,isNegative:u,isInteger:l}=e;return t(vz,{"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))}})});v();x();g();var xz="composition",Pce=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],yz=K(xz,Pce,e=>{var{typed:t,addScalar:r,combinations:n,isPositive:i,isNegative:o,isInteger:u,larger:l}=e;return t(xz,{"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))}})});v();x();g();var wz="leafCount",Rce=["parse","typed"],bz=K(wz,Rce,e=>{var{parse:t,typed:r}=e;function n(i){var o=0;return i.forEach(u=>{o+=n(u)}),o||1}return r(wz,{Node:function(o){return n(o)}})});v();x();g();v();x();g();function $A(e){return ir(e)||Xr(e)&&e.isUnary()&&ir(e.args[0])}function Og(e){return!!(ir(e)||(Ki(e)||Xr(e))&&e.args.every(Og)||yi(e)&&Og(e.content))}v();x();g();function Dz(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 WA(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():Ki(M)?C=M.name:yi(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 y(M,I){var F=WA({},M);for(var C in I)St(M,C)?F[C]=WA(WA({},I[C]),M[C]):F[C]=I[C];return F}function N(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 b(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:N,allChildren:w,unflattenr:D,unflattenl:b,defaultContext:l,realContext:a,positiveContext:s}});var Uce="simplify",Hce=["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"],Nz=K(Uce,Hce,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:N,bignumber:w,mathWithTransform:D,matrix:b,AccessorNode:O,ArrayNode:M,ConstantNode:I,FunctionNode:F,IndexNode:C,ObjectNode:P,OperatorNode:R,ParenthesisNode:q,SymbolNode:z}=e,{hasProperty:H,isCommutative:V,isAssociative:W,mergeContext:ee,flatten:ie,unflattenr:X,unflattenl:Y,createMakeNodeFunction:le,defaultContext:re,realContext:he,positiveContext:De}=Ah({FunctionNode:F,OperatorNode:R,SymbolNode:z});r.addConversion({from:"Object",to:"Map",convert:yl});var ye=r("simplify",{Node:Se,"Node, Map":(ve,Re)=>Se(ve,!1,Re),"Node, Map, Object":(ve,Re,ke)=>Se(ve,!1,Re,ke),"Node, Array":Se,"Node, Array, Map":Se,"Node, Array, Map, Object":Se});r.removeConversion({from:"Object",to:"Map",convert:yl}),ye.defaultContext=re,ye.realContext=he,ye.positiveContext=De;function ce(ve){return ve.transform(function(Re,ke,Je){return yi(Re)?ce(Re.content):Re})}var Ne={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};ye.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(ve,Re){var ke={};if(ve.s){var Je=ve.s.split("->");if(Je.length===2)ke.l=Je[0],ke.r=Je[1];else throw SyntaxError("Could not parse rule: "+ve.s)}else ke.l=ve.l,ke.r=ve.r;ke.l=ce(n(ke.l)),ke.r=ce(n(ke.r));for(var ot of["imposeContext","repeat","assuming"])ot in ve&&(ke[ot]=ve[ot]);if(ve.evaluate&&(ke.evaluate=n(ve.evaluate)),W(ke.l,Re)){var et=!V(ke.l,Re),ut;et&&(ut=He());var Lt=le(ke.l),fe=He();ke.expanded={},ke.expanded.l=Lt([ke.l,fe]),ie(ke.expanded.l,Re),X(ke.expanded.l,Re),ke.expanded.r=Lt([ke.r,fe]),et&&(ke.expandedNC1={},ke.expandedNC1.l=Lt([ut,ke.l]),ke.expandedNC1.r=Lt([ut,ke.r]),ke.expandedNC2={},ke.expandedNC2.l=Lt([ut,ke.expanded.l]),ke.expandedNC2.r=Lt([ut,ke.expanded.r]))}return ke}function Ce(ve,Re){for(var ke=[],Je=0;Je2&&arguments[2]!==void 0?arguments[2]:Ef(),Je=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},ot=Je.consoleDebug;Re=Ce(Re||ye.rules,Je.context);var et=p(ve,ke);et=ce(et);for(var ut={},Lt=et.toString({parenthesis:"all"});!ut[Lt];){ut[Lt]=!0,Oe=0;var fe=Lt;ot&&console.log("Working on: ",Lt);for(var J=0;J ").concat(Re[J].r.toString()))),ot){var ne=et.toString({parenthesis:"all"});ne!==fe&&(console.log("Applying",j,"produced",ne),fe=ne)}Y(et,Je.context)}Lt=et.toString({parenthesis:"all"})}return et}function ze(ve,Re,ke){var Je=ve;if(ve)for(var ot=0;ot1&&(fe=et(ve.args.slice(0,Lt))),ot=ve.args.slice(Lt),Je=ot.length===1?ot[0]:et(ot),ke.push(et([fe,Je]))}return ke}function lt(ve,Re){var ke={placeholders:{}};if(!ve.placeholders&&!Re.placeholders)return ke;if(ve.placeholders){if(!Re.placeholders)return ve}else return Re;for(var Je in ve.placeholders)if(St(ve.placeholders,Je)&&(ke.placeholders[Je]=ve.placeholders[Je],St(Re.placeholders,Je)&&!Ue(ve.placeholders[Je],Re.placeholders[Je])))return null;for(var ot in Re.placeholders)St(Re.placeholders,ot)&&(ke.placeholders[ot]=Re.placeholders[ot]);return ke}function ct(ve,Re){var ke=[];if(ve.length===0||Re.length===0)return ke;for(var Je,ot=0;ot2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var fe=be(ve.args[0],Re.args[1],ke);if(fe.length===0)return[];var J=be(ve.args[1],Re.args[0],ke);if(J.length===0)return[];et=[fe,J]}ot=de(et)}else if(Re.args.length>=2&&ve.args.length===2){for(var j=Be(Re,ke),ne=[],pe=0;pe2)throw Error("Unexpected non-binary associative function: "+ve.toString());return[]}}else if(ve instanceof z){if(ve.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(Ne[ve.name]){if(ve.name!==Re.name)return[]}else switch(ve.name[1]>="a"&&ve.name[1]<="z"?ve.name.substring(0,2):ve.name[0]){case"n":case"_p":ot[0].placeholders[ve.name]=Re;break;case"c":case"cl":if(ir(Re))ot[0].placeholders[ve.name]=Re;else return[];break;case"v":if(!ir(Re))ot[0].placeholders[ve.name]=Re;else return[];break;case"vl":if(Rr(Re))ot[0].placeholders[ve.name]=Re;else return[];break;case"cd":if($A(Re))ot[0].placeholders[ve.name]=Re;else return[];break;case"vd":if(!$A(Re))ot[0].placeholders[ve.name]=Re;else return[];break;case"ce":if(Og(Re))ot[0].placeholders[ve.name]=Re;else return[];break;case"ve":if(!Og(Re))ot[0].placeholders[ve.name]=Re;else return[];break;default:throw new Error("Invalid symbol in rule: "+ve.name)}}else if(ve instanceof I){if(!f(ve.value,Re.value))return[]}else return[];return ot}function Ue(ve,Re){if(ve instanceof I&&Re instanceof I){if(!f(ve.value,Re.value))return!1}else if(ve instanceof z&&Re instanceof z){if(ve.name!==Re.name)return!1}else if(ve instanceof R&&Re instanceof R||ve instanceof F&&Re instanceof F){if(ve instanceof R){if(ve.op!==Re.op||ve.fn!==Re.fn)return!1}else if(ve instanceof F&&ve.name!==Re.name)return!1;if(ve.args.length!==Re.args.length)return!1;for(var ke=0;ke{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:N}=e,{isCommutative:w,isAssociative:D,allChildren:b,createMakeNodeFunction:O}=Ah({FunctionNode:f,OperatorNode:y,SymbolNode:N}),M=t("simplifyConstant",{Node:ie=>P(ee(ie,{})),"Node, Object":function(X,Y){return P(ee(X,Y))}});function I(ie){return la(ie)?ie.valueOf():ie instanceof Array?ie.map(I):Et(ie)?i(I(ie.valueOf())):ie}function F(ie,X,Y){try{return n[ie].apply(null,X)}catch{return X=X.map(I),q(n[ie].apply(null,X),Y)}}var C=t({Fraction:H,number:function(X){return X<0?z(new s(-X)):new s(X)},BigNumber:function(X){return X<0?z(new s(-X)):new s(X)},Complex:function(X){throw new Error("Cannot convert Complex number to Node")},string:function(X){return new s(X)},Matrix:function(X){return new a(X.valueOf().map(Y=>C(Y)))}});function P(ie){return lr(ie)?ie:C(ie)}function R(ie,X){var Y=X&&X.exactFractions!==!1;if(Y&&isFinite(ie)&&o){var le=o(ie),re=X&&typeof X.fractionsLimit=="number"?X.fractionsLimit:1/0;if(le.valueOf()===ie&&le.n0;)if(ir(le[0])&&typeof le[0].value!="string"){var re=q(le.shift().value,Y);xi(ie)?ie=ie.items[re-1]:(ie=ie.valueOf()[re-1],ie instanceof Array&&(ie=i(ie)))}else if(le.length>1&&ir(le[1])&&typeof le[1].value!="string"){var he=q(le[1].value,Y),De=[],ye=xi(ie)?ie.items:ie.valueOf();for(var ce of ye)if(xi(ce))De.push(ce.items[he-1]);else if(Et(ie))De.push(ce[he-1]);else break;if(De.length===ye.length)xi(ie)?ie=new a(De):ie=i(De),le.splice(1,1);else break}else break;return le.length===X.dimensions.length?new l(P(ie),X):le.length>0?(X=new p(le),new l(P(ie),X)):ie}if(Nu(ie)&&X.dimensions.length===1&&ir(X.dimensions[0])){var Ne=X.dimensions[0].value;return Ne in ie.properties?ie.properties[Ne]:new s}return new l(P(ie),X)}function W(ie,X,Y,le){var re=X.shift(),he=X.reduce((De,ye)=>{if(!lr(ye)){var ce=De.pop();if(lr(ce))return[ce,ye];try{return De.push(F(ie,[ce,ye],le)),De}catch{De.push(ce)}}De.push(P(De.pop()));var Ne=De.length===1?De[0]:Y(De);return[Y([Ne,P(ye)])]},[re]);return he.length===1?he[0]:Y([he[0],C(he[1])])}function ee(ie,X){switch(ie.type){case"SymbolNode":return ie;case"ConstantNode":switch(typeof ie.value){case"number":return q(ie.value,X);case"string":return ie.value;default:if(!isNaN(ie.value))return q(ie.value,X)}return ie;case"FunctionNode":if(n[ie.name]&&n[ie.name].rawArgs)return ie;{var Y=["add","multiply"];if(Y.indexOf(ie.name)===-1){var le=ie.args.map(We=>ee(We,X));if(!le.some(lr))try{return F(ie.name,le,X)}catch{}if(ie.name==="size"&&le.length===1&&xi(le[0])){for(var re=[],he=le[0];xi(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(),ye,ce,Ne=O(ie);if(Xr(ie)&&ie.isUnary())ye=[ee(ie.args[0],X)],lr(ye[0])?ce=Ne(ye):ce=F(De,ye,X);else if(D(ie,X.context))if(ye=b(ie,X.context),ye=ye.map(We=>ee(We,X)),w(De,X.context)){for(var Pe=[],Ce=[],Oe=0;Oe1?(ce=W(De,Pe,Ne,X),Ce.unshift(ce),ce=W(De,Ce,Ne,X)):ce=W(De,ye,Ne,X)}else ce=W(De,ye,Ne,X);else ye=ie.args.map(We=>ee(We,X)),ce=W(De,ye,Ne,X);return ce}case"ParenthesisNode":return ee(ie.content,X);case"AccessorNode":return V(ee(ie.object,X),ee(ie.index,X),X);case"ArrayNode":{var He=ie.items.map(We=>ee(We,X));return He.some(lr)?new a(He.map(P)):i(He)}case"IndexNode":return new p(ie.dimensions.map(We=>M(We,X)));case"ObjectNode":{var Se={};for(var ze in ie.properties)Se[ze]=M(ie.properties[ze],X);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});v();x();g();var Sz="simplifyCore",Vce=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],Az=K(Sz,Vce,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:N,ObjectNode:w,OperatorNode:D,ParenthesisNode:b,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}=Ah({FunctionNode:y,OperatorNode:D,SymbolNode:O});function z(H){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W=V?V.context:void 0;if(R(H,"trivial",W)){if(Ki(H)&&H.args.length===1)return z(H.args[0],V);var ee=!1,ie=0;if(H.forEach(Ce=>{++ie,ie===1&&(ee=z(Ce,V))}),ie===1)return ee}var X=H;if(Ki(X)){var Y=d6(X.name);if(Y){if(X.args.length>2&&R(X,"associative",W))for(;X.args.length>2;){var le=X.args.pop(),re=X.args.pop();X.args.push(new D(Y,X.name,[le,re]))}X=new D(Y,X.name,X.args)}else return new y(z(X.fn),X.args.map(Ce=>z(Ce,V)))}if(Xr(X)&&X.isUnary()){var he=z(X.args[0],V);if(X.op==="~"&&Xr(he)&&he.isUnary()&&he.op==="~"||X.op==="not"&&Xr(he)&&he.isUnary()&&he.op==="not"&&P(he.args[0]))return he.args[0];var De=!0;if(X.op==="-"&&Xr(he)&&(he.isBinary()&&he.fn==="subtract"&&(X=new D("-","subtract",[he.args[1],he.args[0]]),De=!1),he.isUnary()&&he.op==="-"))return he.args[0];if(De)return new D(X.op,X.fn,[he])}if(Xr(X)&&X.isBinary()){var ye=z(X.args[0],V),ce=z(X.args[1],V);if(X.op==="+"){if(ir(ye)&&i(ye.value))return ce;if(ir(ce)&&i(ce.value))return ye;Xr(ce)&&ce.isUnary()&&ce.op==="-"&&(ce=ce.args[0],X=new D("-","subtract",[ye,ce]))}if(X.op==="-")return Xr(ce)&&ce.isUnary()&&ce.op==="-"?z(new D("+","add",[ye,ce.args[0]]),V):ir(ye)&&i(ye.value)?z(new D("-","unaryMinus",[ce])):ir(ce)&&i(ce.value)?ye:new D(X.op,X.fn,[ye,ce]);if(X.op==="*"){if(ir(ye)){if(i(ye.value))return M;if(n(ye.value,1))return ce}if(ir(ce)){if(i(ce.value))return M;if(n(ce.value,1))return ye;if(q(X,W))return new D(X.op,X.fn,[ce,ye],X.implicit)}return new D(X.op,X.fn,[ye,ce],X.implicit)}if(X.op==="/")return ir(ye)&&i(ye.value)?M:ir(ce)&&n(ce.value,1)?ye:new D(X.op,X.fn,[ye,ce]);if(X.op==="^"&&ir(ce)){if(i(ce.value))return I;if(n(ce.value,1))return ye}if(X.op==="and"){if(ir(ye))if(ye.value){if(P(ce))return ce;if(ir(ce))return ce.value?F:C}else return C;if(ir(ce))if(ce.value){if(P(ye))return ye}else return C}if(X.op==="or"){if(ir(ye)){if(ye.value)return F;if(P(ce))return ce}if(ir(ce)){if(ce.value)return F;if(P(ye))return ye}}return new D(X.op,X.fn,[ye,ce])}if(Xr(X))return new D(X.op,X.fn,X.args.map(Ce=>z(Ce,V)));if(xi(X))return new p(X.items.map(Ce=>z(Ce,V)));if(To(X))return new f(z(X.object,V),z(X.index,V));if(qo(X))return new N(X.dimensions.map(Ce=>z(Ce,V)));if(Nu(X)){var Ne={};for(var Pe in X.properties)Ne[Pe]=z(X.properties[Pe],V);return new w(Ne)}return X}return t(Sz,{Node:z,"Node,Object":z})});v();x();g();var Gce="resolve",Yce=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],Cz=K(Gce,Yce,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(Rr(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(lr(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 N=a.args.map(function(D){return l(D,s,f)});return new o(a.op,a.fn,N,a.implicit)}else{if(yi(a))return new u(l(a.content,s,f));if(Ki(a)){var w=a.args.map(function(D){return l(D,s,f)});return new i(a.name,w)}}return a.map(D=>l(D,s,f))}return t("resolve",{Node:l,"Node, Map | null | undefined":l,"Node, Object":(a,s)=>l(a,yl(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,yl(f))),"Matrix, Object":t.referTo("Matrix,Map",a=>(s,f)=>a(s,yl(f))),"Array | Matrix, Map":t.referToSelf(a=>(s,f)=>s.map(p=>a(p,f)))})});v();x();g();var Mz="symbolicEqual",Zce=["parse","simplify","typed","OperatorNode"],Tz=K(Mz,Zce,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 ir(f)&&!f.value}return n(Mz,{"Node, Node":o,"Node, Node, Object":o})});v();x();g();var Oz="derivative",Xce=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],Iz=K(Oz,Xce,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={};D(C,M,I.name);var P=b(M,C);return F.simplify?i(P):P}t.addConversion({from:"identifier",to:"SymbolNode",convert:n});var N=t(Oz,{"Node, SymbolNode":y,"Node, SymbolNode, Object":y});t.removeConversion({from:"identifier",to:"SymbolNode",convert:n}),N._simplify=!0,N.toTex=function(M){return w.apply(null,M.args)};var w=t("_derivTex",{"Node, SymbolNode":function(I,F){return ir(I)&&hr(I.value)==="string"?w(n(I.value).toString(),F.toString(),1):w(I.toTex(),F.toString(),1)},"Node, ConstantNode":function(I,F){if(hr(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]")}}),D=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 D(I,F.content,C)},"Object, FunctionAssignmentNode, string":function(I,F,C){return F.params.indexOf(C)===-1?(I[F]=!0,!0):D(I,F.expr,C)},"Object, FunctionNode | OperatorNode, string":function(I,F,C){if(F.args.length>0){for(var P=D(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(b(R,F));return new f("*","multiply",q)}return new f("+","add",I.args.map(function(ie){return new f("*","multiply",I.args.map(function(X){return X===ie?b(X,F):X.clone()}))}))}if(I.op==="/"&&I.isBinary()){var z=I.args[0],H=I.args[1];return F[H]!==void 0?new f("/","divide",[b(z,F),H]):F[z]!==void 0?new f("*","multiply",[new f("-","unaryMinus",[z]),new f("/","divide",[b(H,F),new f("^","pow",[H.clone(),O(2)])])]):new f("/","divide",[new f("-","subtract",[new f("*","multiply",[b(z,F),H.clone()]),new f("*","multiply",[z.clone(),b(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 ir(V)&&(u(V.value)||o(V.value,1))?O(0):new f("*","multiply",[I,new f("*","multiply",[new s("log",[V.clone()]),b(W.clone(),F)])]);if(F[W]!==void 0){if(ir(W)){if(u(W.value))return O(0);if(o(W.value,1))return b(V,F)}var ee=new f("^","pow",[V.clone(),new f("-","subtract",[W,O(1)])]);return new f("*","multiply",[W.clone(),new f("*","multiply",[b(V,F),ee])])}return new f("*","multiply",[new f("^","pow",[V.clone(),W.clone()]),new f("+","add",[new f("*","multiply",[b(V,F),new f("/","divide",[W.clone(),V.clone()])]),new f("*","multiply",[b(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||r.number))}return N});v();x();g();var Fz="rationalize",Kce=["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"],_z=K(Fz,Kce,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:N,bignumber:w,mathWithTransform:D,matrix:b,AccessorNode:O,ArrayNode:M,ConstantNode:I,FunctionNode:F,IndexNode:C,ObjectNode:P,OperatorNode:R,SymbolNode:q,ParenthesisNode:z}=e;function H(X){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,re=W(),he=V(X,Y,!0,re.firstRules),De=he.variables.length,ye={exactFractions:!1},ce={exactFractions:!0};if(X=he.expression,De>=1){X=ee(X);var Ne,Pe,Ce=!0,Oe=!1;X=y(X,re.firstRules,{},ye);for(var He;Pe=Ce?re.distrDivRules:re.sucDivRules,X=y(X,Pe,{},ce),Ce=!Ce,He=X.toString(),He!==Ne;)Oe=!0,Ne=He;Oe&&(X=y(X,re.firstRulesAgain,{},ye)),X=y(X,re.finalRules,{},ye)}var Se=[],ze={};return X.type==="OperatorNode"&&X.isBinary()&&X.op==="/"?(De===1&&(X.args[0]=ie(X.args[0],Se),X.args[1]=ie(X.args[1])),le&&(ze.numerator=X.args[0],ze.denominator=X.args[1])):(De===1&&(X=ie(X,Se)),le&&(ze.numerator=X,ze.denominator=null)),le?(ze.coefficients=Se,ze.variables=he.variables,ze.expression=X,ze):X}return r(Fz,{Node:H,"Node, boolean":(X,Y)=>H(X,{},Y),"Node, Object":H,"Node, Object, boolean":H});function V(X,Y,le,re){var he=[],De=y(X,re,Y,{exactFractions:!1});le=!!le;var ye="+-*"+(le?"/":"");Ne(De);var ce={};return ce.expression=De,ce.variables=he,ce;function Ne(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");Ne(Pe.args[0])}else{if(ye.indexOf(Pe.op)===-1)throw new Error("Operator "+Pe.op+" invalid in polynomial expression");for(var Oe=0;Oe1;if(re==="OperatorNode"&&X.isBinary()){var De=!1,ye;if(X.op==="^"&&(X.args[0].type==="ParenthesisNode"||X.args[0].type==="OperatorNode")&&X.args[1].type==="ConstantNode"&&(ye=parseFloat(X.args[1].value),De=ye>=2&&Nt(ye)),De){if(ye>2){var ce=X.args[0],Ne=new R("^","pow",[X.args[0].cloneDeep(),new I(ye-1)]);X=new R("*","multiply",[ce,Ne])}else X=new R("*","multiply",[X.args[0],X.args[0].cloneDeep()]);he&&(le==="content"?Y.content=X:Y.args[le]=X)}}if(re==="ParenthesisNode")ee(X.content,X,"content");else if(re!=="ConstantNode"&&re!=="SymbolNode")for(var Pe=0;Pe=0;ce--)if(Y[ce]!==0){var Ne=new I(De?Y[ce]:Math.abs(Y[ce])),Pe=Y[ce]<0?"-":"+";if(ce>0){var Ce=new q(he);if(ce>1){var Oe=new I(ce);Ce=new R("^","pow",[Ce,Oe])}Y[ce]===-1&&De?Ne=new R("-","unaryMinus",[Ce]):Math.abs(Y[ce])===1?Ne=Ce:Ne=new R("*","multiply",[Ne,Ce])}De?ye=Ne:Pe==="+"?ye=new R("+","add",[ye,Ne]):ye=new R("-","subtract",[ye,Ne]),De=!1}if(De)return new I(0);return ye;function He(Se,ze,We){var Be=Se.type;if(Be==="FunctionNode")throw new Error("There is an unsolved function call");if(Be==="OperatorNode"){if("+-*^".indexOf(Se.op)===-1)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&&(Y[ct]=0),Y[ct]+=We.cte*(We.oper==="+"?1:-1),re=Math.max(ct,re);return}We.cte=ct,We.fire===""&&(Y[0]+=We.cte*(We.oper==="+"?1:-1))}else throw new Error("Type "+Be+" is not allowed")}}});v();x();g();var kz="zpk2tf",Jce=["typed","add","multiply","Complex","number"],Bz=K(kz,Jce,e=>{var{typed:t,add:r,multiply:n,Complex:i,number:o}=e;return t(kz,{"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(Lz,{"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:N}=l(f.valueOf(),p.valueOf(),h);return{w:u(y),h:u(N)}},"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:N}=l(f.valueOf(),p.valueOf(),y);return{h:u(N),w:u(y)}}});function l(s,f,p){for(var h=[],y=[],N=0;N{var{classes:t}=e;return function(n,i){var o=t[i&&i.mathjs];return o&&typeof o.fromJSON=="function"?o.fromJSON(i):i}});v();x();g();var tpe="replacer",rpe=[],qz=K(tpe,rpe,()=>function(t,r){return typeof r=="number"&&(!isFinite(r)||isNaN(r))?{mathjs:"number",value:String(r)}:r});v();x();g();v();x();g();var zz="12.4.2";var Uz=K("true",[],()=>!0),Hz=K("false",[],()=>!1),$z=K("null",[],()=>null),Wz=ma("Infinity",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1/0):1/0}),Vz=ma("NaN",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(NaN):NaN}),Gz=ma("pi",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?Cg(r):jF}),Yz=ma("tau",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?FB(r):e_}),Zz=ma("e",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?OB(r):t_}),Xz=ma("phi",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?IB(r):r_}),Kz=ma("LN2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(2).ln():Math.LN2}),Jz=ma("LN10",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(10).ln():Math.LN10}),Qz=ma("LOG2E",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1).div(new r(2).ln()):Math.LOG2E}),jz=ma("LOG10E",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1).div(new r(10).ln()):Math.LOG10E}),eU=ma("SQRT1_2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r("0.5").sqrt():Math.SQRT1_2}),tU=ma("SQRT2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(2).sqrt():Math.SQRT2}),rU=ma("i",["Complex"],e=>{var{Complex:t}=e;return t.I}),nU=K("PI",["pi"],e=>{var{pi:t}=e;return t}),iU=K("E",["e"],e=>{var{e:t}=e;return t}),oU=K("version",[],()=>zz);function ma(e,t,r){return K(e,t,r,{recreateOnConfigChange:!0})}v();x();g();var aU=pr("speedOfLight","299792458","m s^-1"),sU=pr("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),uU=pr("planckConstant","6.62607015e-34","J s"),lU=pr("reducedPlanckConstant","1.0545718176461565e-34","J s"),fU=pr("magneticConstant","1.25663706212e-6","N A^-2"),cU=pr("electricConstant","8.8541878128e-12","F m^-1"),pU=pr("vacuumImpedance","376.730313667","ohm"),mU=pr("coulomb","8.987551792261171e9","N m^2 C^-2"),hU=pr("elementaryCharge","1.602176634e-19","C"),dU=pr("bohrMagneton","9.2740100783e-24","J T^-1"),vU=pr("conductanceQuantum","7.748091729863649e-5","S"),gU=pr("inverseConductanceQuantum","12906.403729652257","ohm"),xU=pr("magneticFluxQuantum","2.0678338484619295e-15","Wb"),yU=pr("nuclearMagneton","5.0507837461e-27","J T^-1"),wU=pr("klitzing","25812.807459304513","ohm");var bU=pr("bohrRadius","5.29177210903e-11","m"),DU=pr("classicalElectronRadius","2.8179403262e-15","m"),NU=pr("electronMass","9.1093837015e-31","kg"),EU=pr("fermiCoupling","1.1663787e-5","GeV^-2"),SU=Zw("fineStructure",.0072973525693),AU=pr("hartreeEnergy","4.3597447222071e-18","J"),CU=pr("protonMass","1.67262192369e-27","kg"),MU=pr("deuteronMass","3.3435830926e-27","kg"),TU=pr("neutronMass","1.6749271613e-27","kg"),OU=pr("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),IU=pr("rydberg","10973731.568160","m^-1"),FU=pr("thomsonCrossSection","6.6524587321e-29","m^2"),_U=Zw("weakMixingAngle",.2229),kU=Zw("efimovFactor",22.7),BU=pr("atomicMass","1.66053906660e-27","kg"),LU=pr("avogadro","6.02214076e23","mol^-1"),PU=pr("boltzmann","1.380649e-23","J K^-1"),RU=pr("faraday","96485.33212331001","C mol^-1"),qU=pr("firstRadiation","3.7417718521927573e-16","W m^2"),zU=pr("loschmidt","2.686780111798444e25","m^-3"),UU=pr("gasConstant","8.31446261815324","J K^-1 mol^-1"),HU=pr("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),$U=pr("molarVolume","0.022413969545014137","m^3 mol^-1"),WU=Zw("sackurTetrode",-1.16487052358),VU=pr("secondRadiation","0.014387768775039337","m K"),GU=pr("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),YU=pr("wienDisplacement","2.897771955e-3","m K"),ZU=pr("molarMass","0.99999999965e-3","kg mol^-1"),XU=pr("molarMassC12","11.9999999958e-3","kg mol^-1"),KU=pr("gravity","9.80665","m s^-2"),JU=pr("planckLength","1.616255e-35","m"),QU=pr("planckMass","2.176435e-8","kg"),jU=pr("planckTime","5.391245e-44","s"),eH=pr("planckCharge","1.87554603778e-18","C"),tH=pr("planckTemperature","1.416785e+32","K");function pr(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 Zw(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})}v();x();g();var npe="apply",ipe=["typed","isInteger"],rH=K(npe,ipe,e=>{var{typed:t,isInteger:r}=e,n=gh({typed:t,isInteger:r});return t("apply",{"...any":function(o){var u=o[1];Ht(u)?o[1]=u-1:_t(u)&&(o[1]=u.minus(1));try{return n.apply(null,o)}catch(l){throw Jr(l)}}})},{isTransformFunction:!0});v();x();g();var ope="column",ape=["typed","Index","matrix","range"],nH=K(ope,ape,e=>{var{typed:t,Index:r,matrix:n,range:i}=e,o=Qy({typed:t,Index:r,matrix:n,range:i});return t("column",{"...any":function(l){var a=l.length-1,s=l[a];Ht(s)&&(l[a]=s-1);try{return o.apply(null,l)}catch(f){throw Jr(f)}}})},{isTransformFunction:!0});v();x();g();v();x();g();function Ch(e,t,r){var n=e.filter(function(a){return Rr(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 ch(r,o,new Set([i])),l=e.compile();return function(s){return o.set(i,s),l.evaluate(u)}}var spe="filter",upe=["typed"],oH=K(spe,upe,e=>{var{typed:t}=e;function r(i,o,u){var l,a;return i[0]&&(l=i[0].compile().evaluate(u)),i[1]&&(Rr(i[1])||qa(i[1])?a=i[1].compile().evaluate(u):a=Ch(i[1],o,u)),n(l,a)}r.rawArgs=!0;var n=t("filter",{"Array, function":iH,"Matrix, function":function(o,u){return o.create(iH(o.toArray(),u))},"Array, RegExp":lh,"Matrix, RegExp":function(o,u){return o.create(lh(o.toArray(),u))}});return r},{isTransformFunction:!0});function iH(e,t){return My(e,function(r,n,i){return $a(t,r,[n+1],i,"filter")})}v();x();g();var lpe="forEach",fpe=["typed"],aH=K(lpe,fpe,e=>{var{typed:t}=e;function r(i,o,u){var l,a;return i[0]&&(l=i[0].compile().evaluate(u)),i[1]&&(Rr(i[1])||qa(i[1])?a=i[1].compile().evaluate(u):a=Ch(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))Df(s,function(p,h){a(p,f.concat(h+1))});else return $a(u,s,f,o,"forEach")};l(o.valueOf(),[])}});return r},{isTransformFunction:!0});v();x();g();var cpe="index",ppe=["Index","getMatrixDataType"],sH=K(cpe,ppe,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(fr(l)||Et(l))r(l)!=="boolean"&&(l=l.map(function(s){return s-1}));else if(Ht(l))l--;else if(_t(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});v();x();g();var mpe="map",hpe=["typed"],lH=K(mpe,hpe,e=>{var{typed:t}=e;function r(i,o,u){var l,a;return i[0]&&(l=i[0].compile().evaluate(u)),i[1]&&(Rr(i[1])||qa(i[1])?a=i[1].compile().evaluate(u):a=Ch(i[1],o,u)),n(l,a)}r.rawArgs=!0;var n=t("map",{"Array, function":function(o,u){return uH(o,u,o)},"Matrix, function":function(o,u){return o.create(uH(o.valueOf(),u,o))}});return r},{isTransformFunction:!0});function uH(e,t,r){function n(i,o){return Array.isArray(i)?zo(i,function(u,l){return n(u,o.concat(l+1))}):$a(t,i,o,r,"map")}return n(e,[])}v();x();g();v();x();g();function po(e){if(e.length===2&&xn(e[0])){e=e.slice();var t=e[1];Ht(t)?e[1]=t-1:_t(t)&&(e[1]=t.minus(1))}return e}var dpe="max",vpe=["typed","config","numeric","larger"],fH=K(dpe,vpe,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=po(l);try{return o.apply(null,l)}catch(a){throw Jr(a)}}})},{isTransformFunction:!0});v();x();g();var gpe="mean",xpe=["typed","add","divide"],cH=K(gpe,xpe,e=>{var{typed:t,add:r,divide:n}=e,i=$w({typed:t,add:r,divide:n});return t("mean",{"...any":function(u){u=po(u);try{return i.apply(null,u)}catch(l){throw Jr(l)}}})},{isTransformFunction:!0});v();x();g();var ype="min",wpe=["typed","config","numeric","smaller"],pH=K(ype,wpe,e=>{var{typed:t,config:r,numeric:n,smaller:i}=e,o=vw({typed:t,config:r,numeric:n,smaller:i});return t("min",{"...any":function(l){l=po(l);try{return o.apply(null,l)}catch(a){throw Jr(a)}}})},{isTransformFunction:!0});v();x();g();var bpe="range",Dpe=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],mH=K(bpe,Dpe,e=>{var{typed:t,config:r,matrix:n,bignumber:i,smaller:o,smallerEq:u,larger:l,largerEq:a,add:s,isPositive:f}=e,p=rw({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 N=y.length-1,w=y[N];return typeof w!="boolean"&&y.push(!0),p.apply(null,y)}})},{isTransformFunction:!0});v();x();g();var Npe="row",Epe=["typed","Index","matrix","range"],hH=K(Npe,Epe,e=>{var{typed:t,Index:r,matrix:n,range:i}=e,o=nw({typed:t,Index:r,matrix:n,range:i});return t("row",{"...any":function(l){var a=l.length-1,s=l[a];Ht(s)&&(l[a]=s-1);try{return o.apply(null,l)}catch(f){throw Jr(f)}}})},{isTransformFunction:!0});v();x();g();var Spe="subset",Ape=["typed","matrix","zeros","add"],dH=K(Spe,Ape,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e,o=iw({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});v();x();g();var Cpe="concat",Mpe=["typed","matrix","isInteger"],vH=K(Cpe,Mpe,e=>{var{typed:t,matrix:r,isInteger:n}=e,i=Jy({typed:t,matrix:r,isInteger:n});return t("concat",{"...any":function(u){var l=u.length-1,a=u[l];Ht(a)?u[l]=a-1:_t(a)&&(u[l]=a.minus(1));try{return i.apply(null,u)}catch(s){throw Jr(s)}}})},{isTransformFunction:!0});v();x();g();var gH="diff",Tpe=["typed","matrix","subtract","number","bignumber"],xH=K(gH,Tpe,e=>{var{typed:t,matrix:r,subtract:n,number:i,bignumber:o}=e,u=jy({typed:t,matrix:r,subtract:n,number:i,bignumber:o});return t(gH,{"...any":function(a){a=po(a);try{return u.apply(null,a)}catch(s){throw Jr(s)}}})},{isTransformFunction:!0});v();x();g();var Ope="std",Ipe=["typed","map","sqrt","variance"],yH=K(Ope,Ipe,e=>{var{typed:t,map:r,sqrt:n,variance:i}=e,o=Gw({typed:t,map:r,sqrt:n,variance:i});return t("std",{"...any":function(l){l=po(l);try{return o.apply(null,l)}catch(a){throw Jr(a)}}})},{isTransformFunction:!0});v();x();g();var wH="sum",Fpe=["typed","config","add","numeric"],bH=K(wH,Fpe,e=>{var{typed:t,config:r,add:n,numeric:i}=e,o=zw({typed:t,config:r,add:n,numeric:i});return t(wH,{"...any":function(l){l=po(l);try{return o.apply(null,l)}catch(a){throw Jr(a)}}})},{isTransformFunction:!0});v();x();g();var _pe="quantileSeq",kpe=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],DH=K(_pe,kpe,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=Vw({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,D,b)=>y(w,D,N(b)),"Array | Matrix, number | BigNumber, boolean":y,"Array | Matrix, number | BigNumber, boolean, number":(w,D,b,O)=>y(w,D,b,N(O)),"Array | Matrix, Array | Matrix":y,"Array | Matrix, Array | Matrix, number":(w,D,b)=>y(w,D,N(b)),"Array | Matrix, Array | Matrix, boolean":y,"Array | Matrix, Array | Matrix, boolean, number":(w,D,b,O)=>y(w,D,b,N(O))});function N(w){return po([[],w])[1]}},{isTransformFunction:!0});v();x();g();var NH="cumsum",Bpe=["typed","add","unaryPlus"],EH=K(NH,Bpe,e=>{var{typed:t,add:r,unaryPlus:n}=e,i=Hw({typed:t,add:r,unaryPlus:n});return t(NH,{"...any":function(u){if(u.length===2&&xn(u[0])){var l=u[1];Ht(l)?u[1]=l-1:_t(l)&&(u[1]=l.minus(1))}try{return i.apply(null,u)}catch(a){throw Jr(a)}}})},{isTransformFunction:!0});v();x();g();var SH="variance",Lpe=["typed","add","subtract","multiply","divide","apply","isNaN"],AH=K(SH,Lpe,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:o,apply:u,isNaN:l}=e,a=Ww({typed:t,add:r,subtract:n,multiply:i,divide:o,apply:u,isNaN:l});return t(SH,{"...any":function(f){f=po(f);try{return a.apply(null,f)}catch(p){throw Jr(p)}}})},{isTransformFunction:!0});v();x();g();var CH="print",Ppe=["typed","matrix","zeros","add"],MH=K(CH,Ppe,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e,o=aw({typed:t,matrix:r,zeros:n,add:i});return t(CH,{"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(ow,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});v();x();g();var Rpe="and",qpe=["typed","matrix","zeros","add","equalScalar","not","concat"],TH=K(Rpe,qpe,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:u}=e,l=sw({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});v();x();g();var zpe="or",Upe=["typed","matrix","equalScalar","DenseMatrix","concat"],OH=K(zpe,Upe,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,u=Ky({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});v();x();g();var Hpe="bitAnd",$pe=["typed","matrix","zeros","add","equalScalar","not","concat"],IH=K(Hpe,$pe,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:u}=e,l=Zy({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});v();x();g();var Wpe="bitOr",Vpe=["typed","matrix","equalScalar","DenseMatrix","concat"],FH=K(Wpe,Vpe,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,u=Xy({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});v();x();g();v();x();g();var GA=VA;v();x();g();var PH=en(by(),1);v();x();g();var kH=en(_H(),1);function BH(e){var t=new kH.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}v();x();g();function LH(e,t,r,n){function i(D,b){var O=arguments.length;if(O!==1&&O!==2)throw new pa("import",O,1,2);b||(b={});function M(P,R,q){if(Array.isArray(R))R.forEach(V=>M(P,V));else if(typeof R=="object")for(var z in R)St(R,z)&&M(P,R[z],z);else if(sp(R)||q!==void 0){var H=sp(R)?N(R)?R.fn+".transform":R.fn:q;if(St(P,H)&&P[H]!==R&&!b.silent)throw new Error('Cannot import "'+H+'" twice');P[H]=R}else if(!b.silent)throw new TypeError("Factory, Object, or Array expected")}var I={};M(I,D);for(var F in I)if(St(I,F)){var C=I[F];if(sp(C))s(C,b);else if(f(C))o(F,C,b);else if(!b.silent)throw new TypeError("Factory, Object, or Array expected")}}function o(D,b,O){if(O.wrap&&typeof b=="function"&&(b=a(b)),p(b)&&(b=e(D,{[b.signature]:b})),e.isTypedFunction(r[D])&&e.isTypedFunction(b)){O.override?b=e(D,b.signatures):b=e(r[D],b),r[D]=b,delete n[D],u(D,b),r.emit("import",D,function(){return b});return}if(r[D]===void 0||O.override){r[D]=b,delete n[D],u(D,b),r.emit("import",D,function(){return b});return}if(!O.silent)throw new Error('Cannot import "'+D+'": already exists')}function u(D,b){b&&typeof b.transform=="function"?(r.expression.transform[D]=b.transform,h(D)&&(r.expression.mathWithTransform[D]=b.transform)):(delete r.expression.transform[D],h(D)&&(r.expression.mathWithTransform[D]=b))}function l(D){delete r.expression.transform[D],h(D)?r.expression.mathWithTransform[D]=r[D]:delete r.expression.mathWithTransform[D]}function a(D){var b=function(){for(var M=[],I=0,F=arguments.length;I2&&arguments[2]!==void 0?arguments[2]:D.fn;if(aS(O,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(O));var M=N(D)?r.expression.transform:r,I=O in r.expression.transform,F=St(M,O)?M[O]:void 0,C=function(){var R={};D.dependencies.map(lS).forEach(z=>{if(aS(z,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(z));z==="math"?R.math=r:z==="mathWithTransform"?R.mathWithTransform=r.expression.mathWithTransform:z==="classes"?R.classes=r:R[z]=r[z]});var q=D(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 exports.path="expression.transform"');if(F===void 0||b.override)return q;if(e.isTypedFunction(F)&&e.isTypedFunction(q))return e(F,q);if(b.silent)return F;throw new Error('Cannot import "'+O+'": already exists')};!D.meta||D.meta.lazy!==!1?(oh(M,O,C),F&&I?l(O):(N(D)||y(D))&&oh(r.expression.mathWithTransform,O,()=>M[O])):(M[O]=C(),F&&I?l(O):(N(D)||y(D))&&oh(r.expression.mathWithTransform,O,()=>M[O])),n[O]=D,r.emit("import",O,C)}function f(D){return typeof D=="function"||typeof D=="number"||typeof D=="string"||typeof D=="boolean"||D===null||ri(D)||gi(D)||_t(D)||la(D)||Et(D)||Array.isArray(D)}function p(D){return typeof D=="function"&&typeof D.signature=="string"}function h(D){return!St(w,D)}function y(D){return D.fn.indexOf(".")===-1&&!St(w,D.fn)&&(!D.meta||!D.meta.isClass)}function N(D){return D!==void 0&&D.meta!==void 0&&D.meta.isTransformFunction===!0||!1}var w={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return i}function Xw(e,t){var r=Un({},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=BH({isNumber:Ht,isComplex:gi,isBigNumber:_t,isFraction:la,isUnit:ri,isString:dn,isArray:fr,isMatrix:Et,isCollection:xn,isDenseMatrix:gl,isSparseMatrix:fa,isRange:bf,isIndex:bu,isBoolean:uy,isResultSet:ly,isHelp:rh,isFunction:fy,isDate:cy,isRegExp:py,isObject:Du,isNull:my,isUndefined:hy,isAccessorNode:To,isArrayNode:xi,isAssignmentNode:dy,isBlockNode:vy,isConditionalNode:gy,isConstantNode:ir,isFunctionAssignmentNode:qa,isFunctionNode:Ki,isIndexNode:qo,isNode:lr,isObjectNode:Nu,isOperatorNode:Xr,isParenthesisNode:yi,isRangeNode:xy,isRelationalNode:yy,isSymbolNode:Rr,isChain:nh});n.config=$I(r,n.emit),n.expression={transform:{},mathWithTransform:{config:n.config}};var i=[],o=[];function u(f){if(sp(f))return f(n);var p=f[Object.keys(f)[0]];if(sp(p))return p(n);if(!RI(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=Xw.bind(null,e),n.factory=K,n.import(Object.values(LI(e))),n.ArgumentsError=pa,n.DimensionError=Kt,n.IndexError=bi,n}var Lh={};Ba(Lh,{ABS:()=>che,ACCRINT:()=>O0e,ACCRINTM:()=>I0e,ACOS:()=>phe,ACOSH:()=>mhe,ACOT:()=>hhe,ACOTH:()=>dhe,AGGREGATE:()=>vhe,AMORDEGRC:()=>F0e,AMORLINC:()=>_0e,AND:()=>C1e,ARABIC:()=>ghe,ASC:()=>Qde,ASIN:()=>xhe,ASINH:()=>yhe,ATAN:()=>whe,ATAN2:()=>bhe,ATANH:()=>Dhe,AVEDEV:()=>Ime,AVERAGE:()=>vp,AVERAGEA:()=>sC,AVERAGEIF:()=>Fme,AVERAGEIFS:()=>_me,BAHTTEXT:()=>jde,BASE:()=>Nhe,BESSELI:()=>Sve,BESSELJ:()=>Ave,BESSELK:()=>Cve,BESSELY:()=>Mve,BETA:()=>kg,BETADIST:()=>cge,BETAINV:()=>pge,BIN2DEC:()=>Tve,BIN2HEX:()=>Ove,BIN2OCT:()=>Ive,BINOM:()=>_h,BINOMDIST:()=>mge,BITAND:()=>Fve,BITLSHIFT:()=>_ve,BITOR:()=>kve,BITRSHIFT:()=>Bve,BITXOR:()=>Lve,CEILING:()=>Al,CEILINGMATH:()=>hge,CEILINGPRECISE:()=>dge,CELL:()=>ame,CHAR:()=>c$,CHIDIST:()=>vge,CHIDISTRT:()=>gge,CHIINV:()=>xge,CHIINVRT:()=>yge,CHISQ:()=>_s,CHITEST:()=>wge,CHOOSE:()=>wme,CLEAN:()=>eve,CODE:()=>p$,COLUMN:()=>bme,COLUMNS:()=>Dme,COMBIN:()=>Mh,COMBINA:()=>Ehe,COMPLEX:()=>vo,CONCAT:()=>tve,CONCATENATE:()=>m$,CONFIDENCE:()=>uC,CONVERT:()=>Pve,CORREL:()=>kme,COS:()=>She,COSH:()=>Ahe,COT:()=>Che,COTH:()=>Mhe,COUNT:()=>Ig,COUNTA:()=>Fg,COUNTBLANK:()=>e$,COUNTIF:()=>Bme,COUNTIFS:()=>Lme,COUPDAYBS:()=>k0e,COUPDAYS:()=>B0e,COUPDAYSNC:()=>L0e,COUPNCD:()=>P0e,COUPNUM:()=>R0e,COUPPCD:()=>q0e,COVAR:()=>bge,COVARIANCE:()=>kh,COVARIANCEP:()=>Dge,COVARIANCES:()=>Nge,CRITBINOM:()=>Ege,CSC:()=>The,CSCH:()=>Ohe,CUMIPMT:()=>z0e,CUMPRINC:()=>U0e,DATE:()=>Lde,DATEDIF:()=>_f,DATEVALUE:()=>Pde,DAVERAGE:()=>g0e,DAY:()=>Rde,DAYS:()=>dp,DAYS360:()=>kf,DB:()=>H0e,DBCS:()=>rve,DCOUNT:()=>x0e,DCOUNTA:()=>y0e,DDB:()=>$0e,DEC2BIN:()=>Rve,DEC2HEX:()=>qve,DEC2OCT:()=>zve,DECIMAL:()=>Ihe,DEGREES:()=>Fhe,DELTA:()=>Uve,DEVSQ:()=>Pme,DGET:()=>w0e,DISC:()=>W0e,DMAX:()=>b0e,DMIN:()=>D0e,DOLLAR:()=>nve,DOLLARDE:()=>V0e,DOLLARFR:()=>G0e,DPRODUCT:()=>N0e,DSTDEV:()=>E0e,DSTDEVP:()=>S0e,DSUM:()=>A0e,DURATION:()=>Y0e,DVAR:()=>C0e,DVARP:()=>M0e,EDATE:()=>qde,EFFECT:()=>Z0e,EOMONTH:()=>zde,ERF:()=>wC,ERFC:()=>bC,ERFCPRECISE:()=>Sge,ERFPRECISE:()=>Age,ERROR:()=>XH,EVEN:()=>_he,EXACT:()=>ive,EXP:()=>khe,EXPON:()=>lC,EXPONDIST:()=>Cge,F:()=>ks,FACT:()=>Sl,FACTDOUBLE:()=>u$,FALSE:()=>M1e,FDIST:()=>Mge,FDISTRT:()=>Tge,FIND:()=>ove,FINV:()=>Oge,FINVRT:()=>Ige,FISHER:()=>Rme,FISHERINV:()=>qme,FIXED:()=>h$,FLOOR:()=>yp,FLOORMATH:()=>Fge,FLOORPRECISE:()=>_ge,FORECAST:()=>t$,FREQUENCY:()=>zme,FTEST:()=>kge,FV:()=>wp,FVSCHEDULE:()=>X0e,GAMMA:()=>Bg,GAMMADIST:()=>Bge,GAMMAINV:()=>Lge,GAMMALN:()=>fC,GAMMALNPRECISE:()=>Pge,GAUSS:()=>Ume,GCD:()=>Bhe,GEOMEAN:()=>Hme,GESTEP:()=>Hve,GROWTH:()=>$me,HARMEAN:()=>Wme,HEX2BIN:()=>$ve,HEX2DEC:()=>Wve,HEX2OCT:()=>Vve,HLOOKUP:()=>Nme,HOUR:()=>Ude,HYPGEOM:()=>cC,HYPGEOMDIST:()=>Rge,IF:()=>T1e,IFERROR:()=>I1e,IFNA:()=>F1e,IFS:()=>O1e,IMABS:()=>DC,IMAGINARY:()=>rn,IMARGUMENT:()=>NC,IMCONJUGATE:()=>Gve,IMCOS:()=>mb,IMCOSH:()=>d$,IMCOT:()=>Yve,IMCSC:()=>nge,IMCSCH:()=>ige,IMDIV:()=>Dp,IMEXP:()=>Zve,IMLN:()=>Xve,IMLOG10:()=>Kve,IMLOG2:()=>Jve,IMPOWER:()=>Qve,IMPRODUCT:()=>jve,IMREAL:()=>nn,IMSEC:()=>ege,IMSECH:()=>tge,IMSIN:()=>hb,IMSINH:()=>v$,IMSQRT:()=>rge,IMSUB:()=>oge,IMSUM:()=>age,IMTAN:()=>sge,INDEX:()=>Eme,INFO:()=>sme,INT:()=>Lhe,INTERCEPT:()=>Vme,INTRATE:()=>K0e,IPMT:()=>y$,IRR:()=>J0e,ISBLANK:()=>ume,ISERR:()=>KH,ISERROR:()=>lb,ISEVEN:()=>lme,ISFORMULA:()=>fme,ISLOGICAL:()=>JH,ISNA:()=>cme,ISNONTEXT:()=>pme,ISNUMBER:()=>fb,ISO:()=>Phe,ISODD:()=>mme,ISOWEEKNUM:()=>f$,ISPMT:()=>Q0e,ISREF:()=>hme,ISTEXT:()=>QH,KURT:()=>Gme,LARGE:()=>r$,LCM:()=>Rhe,LEFT:()=>ave,LEN:()=>sve,LINEST:()=>pC,LN:()=>qhe,LOG:()=>zhe,LOG10:()=>Uhe,LOGEST:()=>Yme,LOGINV:()=>qge,LOGNORM:()=>Bh,LOGNORMDIST:()=>zge,LOGNORMINV:()=>Uge,LOOKUP:()=>Sme,LOWER:()=>uve,MATCH:()=>Ame,MAX:()=>eb,MAXA:()=>Zme,MAXIFS:()=>Xme,MDURATION:()=>j0e,MEDIAN:()=>n$,MID:()=>lve,MIN:()=>tb,MINA:()=>Kme,MINIFS:()=>Jme,MINUTE:()=>Hde,MIRR:()=>e1e,MMULT:()=>Hhe,MOD:()=>$he,MODE:()=>gp,MODEMULT:()=>Hge,MODESNGL:()=>$ge,MONTH:()=>$de,MROUND:()=>Whe,MULTINOMIAL:()=>Vhe,MUNIT:()=>Ghe,N:()=>dme,NA:()=>vme,NEGBINOM:()=>mC,NEGBINOMDIST:()=>Wge,NETWORKDAYS:()=>cb,NETWORKDAYSINTL:()=>Vge,NOMINAL:()=>t1e,NORM:()=>Bs,NORMDIST:()=>Gge,NORMINV:()=>Yge,NORMSDIST:()=>Zge,NORMSINV:()=>Xge,NOT:()=>_1e,NOW:()=>Wde,NPER:()=>r1e,NPV:()=>tC,NUMBERVALUE:()=>fve,OCT2BIN:()=>uge,OCT2DEC:()=>lge,OCT2HEX:()=>fge,ODD:()=>Yhe,ODDFPRICE:()=>n1e,ODDFYIELD:()=>i1e,ODDLPRICE:()=>o1e,ODDLYIELD:()=>a1e,OR:()=>k1e,PDURATION:()=>s1e,PEARSON:()=>i$,PERCENTILE:()=>ha,PERCENTILEEXC:()=>Kge,PERCENTILEINC:()=>Jge,PERCENTRANK:()=>Lg,PERCENTRANKEXC:()=>Qge,PERCENTRANKINC:()=>jge,PERMUT:()=>Qme,PERMUTATIONA:()=>jme,PHI:()=>ehe,PI:()=>Zhe,PMT:()=>Rg,POISSON:()=>hC,POISSONDIST:()=>e0e,POWER:()=>l$,PPMT:()=>u1e,PRICE:()=>l1e,PRICEDISC:()=>f1e,PRICEMAT:()=>c1e,PROB:()=>the,PRODUCT:()=>rb,PRONETIC:()=>cve,PROPER:()=>pve,PV:()=>p1e,QUARTILE:()=>xp,QUARTILEEXC:()=>t0e,QUARTILEINC:()=>r0e,QUOTIENT:()=>Xhe,RADIANS:()=>Khe,RAND:()=>Jhe,RANDBETWEEN:()=>Qhe,RANK:()=>Pg,RANKAVG:()=>n0e,RANKEQ:()=>i0e,RATE:()=>m1e,RECEIVED:()=>h1e,REPLACE:()=>mve,REPT:()=>va,RIGHT:()=>hve,ROMAN:()=>jhe,ROUND:()=>Mu,ROUNDDOWN:()=>ede,ROUNDUP:()=>tde,ROW:()=>rhe,ROWS:()=>Cme,RRI:()=>d1e,RSQ:()=>nhe,SEARCH:()=>dve,SEC:()=>rde,SECH:()=>nde,SECOND:()=>Vde,SERIESSUM:()=>ide,SHEET:()=>gme,SHEETS:()=>xme,SIGN:()=>ode,SIN:()=>ade,SINH:()=>sde,SKEW:()=>dC,SKEWP:()=>o0e,SLN:()=>v1e,SLOPE:()=>ihe,SMALL:()=>o$,SORT:()=>Mme,SQRT:()=>ude,SQRTPI:()=>lde,STANDARDIZE:()=>ohe,STDEV:()=>Wo,STDEVA:()=>ahe,STDEVP:()=>a0e,STDEVPA:()=>she,STDEVS:()=>s0e,STEYX:()=>uhe,SUBSTITUTE:()=>vve,SUBTOTAL:()=>fde,SUM:()=>Cl,SUMIF:()=>cde,SUMIFS:()=>pde,SUMPRODUCT:()=>mde,SUMSQ:()=>hde,SUMX2MY2:()=>dde,SUMX2PY2:()=>vde,SUMXMY2:()=>gde,SWITCH:()=>P1e,SYD:()=>g1e,T:()=>gve,TAN:()=>xde,TANH:()=>yde,TBILLEQ:()=>x1e,TBILLPRICE:()=>y1e,TBILLYIELD:()=>w1e,TDIST:()=>u0e,TDISTRT:()=>l0e,TEXT:()=>xve,TEXTJOIN:()=>yve,TIME:()=>Gde,TIMEVALUE:()=>Yde,TINV:()=>f0e,TODAY:()=>Zde,TRANSPOSE:()=>Tme,TREND:()=>lhe,TRIM:()=>wve,TRIMMEAN:()=>fhe,TRUE:()=>B1e,TRUNC:()=>wde,TTEST:()=>c0e,TYPE:()=>yme,UNICHAR:()=>bve,UNICODE:()=>Dve,UNIQUE:()=>aC,UPPER:()=>Nve,VALUE:()=>Eve,VAR:()=>Oo,VARA:()=>a$,VARP:()=>p0e,VARPA:()=>s$,VARS:()=>m0e,VDB:()=>b1e,VLOOKUP:()=>jH,WEEKDAY:()=>Xde,WEEKNUM:()=>Kde,WEIBULL:()=>vC,WEIBULLDIST:()=>h0e,WORKDAY:()=>pb,WORKDAYINTL:()=>d0e,XIRR:()=>D1e,XNPV:()=>N1e,XOR:()=>L1e,YEAR:()=>Jde,YEARFRAC:()=>xC,YIELD:()=>E1e,YIELDDISC:()=>S1e,YIELDMAT:()=>A1e,Z:()=>gC,ZTEST:()=>v0e,utils:()=>R1e});v();x();g();var Ct=en(qH(),1),_g=en(UH(),1),rC=new Error("#NULL!"),ho=new Error("#DIV/0!"),qe=new Error("#VALUE!"),Th=new Error("#REF!"),ob=new Error("#NAME?"),rt=new Error("#NUM!"),Jt=new Error("#N/A"),nC=new Error("#ERROR!"),$H=new Error("#GETTING_DATA"),Ype=Object.freeze({__proto__:null,data:$H,div0:ho,error:nC,na:Jt,name:ob,nil:rC,num:rt,ref:Th,value:qe}),Zpe="=",Xpe=[">",">=","<","<=","=","<>"],WH="operator",VH="literal",Kpe=[WH,VH],Qw=WH,Bf=VH;function El(e,t){if(Kpe.indexOf(t)===-1)throw new Error("Unsupported token type: "+t);return{value:e,type:t}}function Jpe(e){return typeof e!="string"||/^\d+(\.\d+)?$/.test(e)&&(e=e.indexOf(".")===-1?parseInt(e,10):parseFloat(e)),e}function Qpe(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 jpe(e){let t="",r=[];for(let n=0;n=0?r.push(El(i,Qw)):t+=i}return t.length>0&&r.push(El(Jpe(t),Bf)),r.length>0&&r[0].type!==Qw&&r.unshift(El(Zpe,Qw)),r}function eme(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 Oh(e){return jpe(Qpe(e))}var Ih=eme;function ab(e){let t=[];return mo(e,r=>{t.push(r)}),t}function mo(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 vt(){let e;if(arguments.length===1){let t=arguments[0];e=nme(t)?ab.apply(null,arguments):[t]}else e=Array.from(arguments);for(;!ime(e);)e=eC(e);return e}function eC(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 rme(e,t){return t=t||1,!e||typeof e.slice!="function"?e:e.slice(0,e.length-t)}function nme(e){return e!=null&&typeof e.length=="number"&&typeof e!="string"}function ime(e){if(!e)return!1;for(let t=0;te.map(n=>n[r])):qe}function Ga(e,t){let r=null;return mo(e,(n,i)=>{if(n[0]===t)return r=i,!1}),r??qe}function vr(){for(let e=0;etypeof t=="number")}function ome(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 oC(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?rt:ome(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 ZH(e){let t=e.length,r;for(;t--;){if(r=br(e[t]),r===qe)return r;e[t]=r}return e}function ge(e){return e instanceof Error?e:e==null?0:(typeof e=="boolean"&&(e=+e),!isNaN(e)&&e!==""?parseFloat(e):qe)}function It(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=ge(e[t]),r instanceof Error)return r;e[t]=r}return e}function Xn(e){return e instanceof Error?e:e==null?"":e.toString()}function sb(){let e=arguments.length;for(;e--;)if(typeof arguments[e]=="string")return!0;return!1}function ub(){let e=ab(arguments),t=It(vt(e.shift()));if(t instanceof Error)return t;let r=e,n=r.length/2;for(let o=0;o{switch(e){case rC:return 1;case ho:return 2;case qe:return 3;case Th:return 4;case ob:return 5;case rt:return 6;case Jt:return 7;case $H:return 8}return Jt};function sme(){throw new Error("INFO is not implemented")}function ume(e){return e===null}function KH(e){return[qe,Th,ho,rt,ob,rC].indexOf(e)>=0||typeof e=="number"&&(isNaN(e)||!isFinite(e))}function lb(e){return KH(e)||e===Jt}function lme(e){return!(Math.floor(Math.abs(e))&1)}function fme(){throw new Error("ISFORMULA is not implemented")}function JH(e){return e===!0||e===!1}function cme(e){return e===Jt}function pme(e){return typeof e!="string"}function fb(e){return typeof e=="number"&&!isNaN(e)&&isFinite(e)}function mme(e){return!!(Math.floor(Math.abs(e))&1)}function hme(){throw new Error("ISREF is not implemented")}function QH(e){return typeof e=="string"}function dme(e){return fb(e)?e:e instanceof Date?e.getTime():e===!0?1:e===!1?0:lb(e)?e:0}function vme(){return Jt}function gme(){throw new Error("SHEET is not implemented")}function xme(){throw new Error("SHEETS is not implemented")}function yme(e){if(fb(e))return 1;if(QH(e))return 2;if(JH(e))return 4;if(lb(e))return 16;if(Array.isArray(e))return 64}function wme(){if(arguments.length<2)return Jt;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]:Th}function Sme(e,t,r){t=vt(t),r=r?vt(r):t;let n=typeof e=="number",i=Jt;for(let o=0;oe)return i}return i}function Ame(e,t,r){if(!e&&e!==0||!t||(arguments.length===2&&(r=1),t=vt(t),!(t instanceof Array))||r!==-1&&r!==0&&r!==1)return Jt;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=Xn(a[t-1]),s=Xn(s[t-1]),r===1?as?r:r*-1)),o=GH(e),u=n?jw(o):o;return t>=1&&t<=u[0].length?n?jw(i(u)):i(u):qe}function Tme(e){if(!e)return Jt;let t=GH(e);return jw(t)}function aC(){let e=[];for(let t=0;te&&(o=!0)}return i}var Ome=2.5066282746310002;function Ime(){let t=vt(arguments).filter(Fh);if(t.length===0)return rt;let r=It(t);return r instanceof Error?r:Ct.default.sum((0,Ct.default)(r).subtract(Ct.default.mean(r)).abs()[0])/r.length}function vp(){let t=vt(arguments).filter(Fh);if(t.length===0)return ho;let r=vr.apply(void 0,t);if(r)return r;let n=bp(t),i=n.length,o=0,u=0,l;for(let a=0;an+i,0)/e.length;return isNaN(r)?0:r}var kg={};kg.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=ge(e),t=ge(t),r=ge(r),i=ge(i),o=ge(o),ft(e,t,r,i,o))?qe:(e=(e-i)/(o-i),n?Ct.default.beta.cdf(e,t,r):Ct.default.beta.pdf(e,t,r))};kg.INV=(e,t,r,n,i)=>(n=n===void 0?0:n,i=i===void 0?1:i,e=ge(e),t=ge(t),r=ge(r),n=ge(n),i=ge(i),ft(e,t,r,n,i)?qe:Ct.default.beta.inv(e,t,r)*(i-n)+n);var _h={};_h.DIST=(e,t,r,n)=>(e=ge(e),t=ge(t),r=ge(r),n=ge(n),ft(e,t,r,n)?qe:n?Ct.default.binomial.cdf(e,t,r):Ct.default.binomial.pdf(e,t,r));_h.DIST.RANGE=(e,t,r,n)=>{if(n=n===void 0?r:n,e=ge(e),t=ge(t),r=ge(r),n=ge(n),ft(e,t,r,n))return qe;let i=0;for(let o=r;o<=n;o++)i+=Mh(e,o)*Math.pow(t,o)*Math.pow(1-t,e-o);return i};_h.INV=(e,t,r)=>{if(e=ge(e),t=ge(t),r=ge(r),ft(e,t,r))return qe;let n=0;for(;n<=e;){if(Ct.default.binomial.cdf(n,e,t)>=r)return n;n++}};var _s={};_s.DIST=(e,t,r)=>(e=ge(e),t=ge(t),ft(e,t)?qe:r?Ct.default.chisquare.cdf(e,t):Ct.default.chisquare.pdf(e,t));_s.DIST.RT=(e,t)=>!e|!t?Jt:e<1||t>Math.pow(10,10)?rt:typeof e!="number"||typeof t!="number"?qe:1-Ct.default.chisquare.cdf(e,t);_s.INV=(e,t)=>(e=ge(e),t=ge(t),ft(e,t)?qe:Ct.default.chisquare.inv(e,t));_s.INV.RT=(e,t)=>!e|!t?Jt:e<0||e>1||t<1||t>Math.pow(10,10)?rt:typeof e!="number"||typeof t!="number"?qe:Ct.default.chisquare.inv(1-e,t);_s.TEST=function(e,t){if(arguments.length!==2)return Jt;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/N,N=N-2;let w=y,D=h;for(;w>1e-10*y;)D=D+2,w=w*p/D,y=y+w;return 1-y}return Math.round(f(a,l)*1e6)/1e6};var uC={};uC.NORM=(e,t,r)=>(e=ge(e),t=ge(t),r=ge(r),ft(e,t,r)?qe:Ct.default.normalci(1,e,t,r)[1]-1);uC.T=(e,t,r)=>(e=ge(e),t=ge(t),r=ge(r),ft(e,t,r)?qe:Ct.default.tci(1,e,t,r)[1]-1);function kme(e,t){return e=It(vt(e)),t=It(vt(t)),ft(e,t)?qe:Ct.default.corrcoeff(e,t)}function Ig(){let e=vt(arguments);return bp(e).length}function Fg(){let e=vt(arguments);return e.length-e$(e)}function e$(){let e=vt(arguments),t=0,r;for(let n=0;n{if(e=It(vt(e)),t=It(vt(t)),ft(e,t))return qe;let r=Ct.default.mean(e),n=Ct.default.mean(t),i=0,o=e.length;for(let u=0;u(e=It(vt(e)),t=It(vt(t)),ft(e,t)?qe:Ct.default.covariance(e,t));function Pme(){let e=It(vt(arguments));if(e instanceof Error)return e;let t=Ct.default.mean(e),r=0;for(let n=0;n(e=ge(e),t=ge(t),ft(e,t)?qe:r?Ct.default.exponential.cdf(e,t):Ct.default.exponential.pdf(e,t));var ks={};ks.DIST=(e,t,r,n)=>(e=ge(e),t=ge(t),r=ge(r),ft(e,t,r)?qe:n?Ct.default.centralF.cdf(e,t,r):Ct.default.centralF.pdf(e,t,r));ks.DIST.RT=function(e,t,r){return arguments.length!==3?Jt:e<0||t<1||r<1?rt:typeof e!="number"||typeof t!="number"||typeof r!="number"?qe:1-Ct.default.centralF.cdf(e,t,r)};ks.INV=(e,t,r)=>(e=ge(e),t=ge(t),r=ge(r),ft(e,t,r)?qe:e<=0||e>1?rt:Ct.default.centralF.inv(e,t,r));ks.INV.RT=function(e,t,r){return arguments.length!==3?Jt:e<0||e>1||t<1||t>Math.pow(10,10)||r<1||r>Math.pow(10,10)?rt:typeof e!="number"||typeof t!="number"||typeof r!="number"?qe:Ct.default.centralF.inv(1-e,t,r)};ks.TEST=(e,t)=>{if(!e||!t||!(e instanceof Array)||!(t instanceof Array))return Jt;if(e.length<2||t.length<2)return ho;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 Bg(e){return e=ge(e),e instanceof Error?e:e===0||parseInt(e,10)===e&&e<0?rt:Ct.default.gammafn(e)}Bg.DIST=function(e,t,r,n){return arguments.length!==4?Jt:e<0||t<=0||r<=0||typeof e!="number"||typeof t!="number"||typeof r!="number"?qe:n?Ct.default.gamma.cdf(e,t,r,!0):Ct.default.gamma.pdf(e,t,r,!1)};Bg.INV=function(e,t,r){return arguments.length!==3?Jt:e<0||e>1||t<=0||r<=0?rt:typeof e!="number"||typeof t!="number"||typeof r!="number"?qe:Ct.default.gamma.inv(e,t,r)};function fC(e){return e=ge(e),e instanceof Error?e:Ct.default.gammaln(e)}fC.PRECISE=function(e){return arguments.length!==1?Jt:e<=0?rt:typeof e!="number"?qe:Ct.default.gammaln(e)};function Ume(e){return e=ge(e),e instanceof Error?e:Ct.default.normal.cdf(e,0,1)-.5}function Hme(){let e=It(vt(arguments));return e instanceof Error?e:Ct.default.geomean(e)}function $me(e,t,r,n){if(e=It(vt(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=It(vt(t)),r=It(vt(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=ge(e),t=ge(t),r=ge(r),n=ge(n),ft(e,t,r,n))return qe;function o(l,a,s,f){return Mh(s,l)*Mh(f-s,a-l)/Mh(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 Vme(e,t){return e=It(e),t=It(t),ft(e,t)?qe:e.length!==t.length?Jt:t$(0,e,t)}function Gme(){let e=It(vt(arguments));if(e instanceof Error)return e;let t=Ct.default.mean(e),r=e.length,n=0;for(let i=0;ii-n)[t-1]))}function pC(e,t){if(e=It(vt(e)),t=It(vt(t)),ft(e,t))return qe;let r=Ct.default.mean(e),n=Ct.default.mean(t),i=t.length,o=0,u=0;for(let s=0;s(e=ge(e),t=ge(t),r=ge(r),ft(e,t,r)?qe:n?Ct.default.lognormal.cdf(e,t,r):Ct.default.lognormal.pdf(e,t,r));Bh.INV=(e,t,r)=>(e=ge(e),t=ge(t),r=ge(r),ft(e,t,r)?qe:Ct.default.lognormal.inv(e,t,r));function eb(){let e=vt(arguments),t=vr.apply(void 0,e);if(t)return t;let r=bp(e);return r.length===0?0:Math.max.apply(Math,r)}function Zme(){let e=vt(arguments),t=vr.apply(void 0,e);if(t)return t;let r=iC(e);return r=r.map(n=>n??0),r.length===0?0:Math.max.apply(Math,r)}function Xme(){let e=ub(...arguments);return e.length===0?0:Math.max.apply(Math,e)}function n$(){let e=vt(arguments),t=vr.apply(void 0,e);if(t)return t;let r=iC(e),n=Ct.default.median(r);return isNaN(n)&&(n=rt),n}function tb(){let e=vt(arguments),t=vr.apply(void 0,e);if(t)return t;let r=bp(e);return r.length===0?0:Math.min.apply(Math,r)}function Kme(){let e=vt(arguments),t=vr.apply(void 0,e);if(t)return t;let r=iC(e);return r=r.map(n=>n??0),r.length===0?0:Math.min.apply(Math,r)}function Jme(){let e=ub(...arguments);return e.length===0?0:Math.min.apply(Math,e)}var gp={};gp.MULT=function(){let e=It(vt(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};gp.SNGL=function(){let e=It(vt(arguments));return e instanceof Error?e:gp.MULT(e).sort((t,r)=>t-r)[0]};var mC={};mC.DIST=(e,t,r,n)=>(e=ge(e),t=ge(t),r=ge(r),ft(e,t,r)?qe:n?Ct.default.negbin.cdf(e,t,r):Ct.default.negbin.pdf(e,t,r));var Bs={};Bs.DIST=(e,t,r,n)=>(e=ge(e),t=ge(t),r=ge(r),ft(e,t,r)?qe:r<=0?rt:n?Ct.default.normal.cdf(e,t,r):Ct.default.normal.pdf(e,t,r));Bs.INV=(e,t,r)=>(e=ge(e),t=ge(t),r=ge(r),ft(e,t,r)?qe:Ct.default.normal.inv(e,t,r));Bs.S={};Bs.S.DIST=(e,t)=>(e=ge(e),e instanceof Error?qe:t?Ct.default.normal.cdf(e,0,1):Ct.default.normal.pdf(e,0,1));Bs.S.INV=e=>(e=ge(e),e instanceof Error?qe:Ct.default.normal.inv(e,0,1));function i$(e,t){if(t=It(vt(t)),e=It(vt(e)),ft(t,e))return qe;let r=Ct.default.mean(e),n=Ct.default.mean(t),i=e.length,o=0,u=0,l=0;for(let a=0;a{if(e=It(vt(e)),t=ge(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 rt;let n=t*(r+1)-1,i=Math.floor(n);return YH(n===i?e[n]:e[i]+(n-i)*(e[i+1]-e[i]))};ha.INC=(e,t)=>{if(e=It(vt(e)),t=ge(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 YH(n===i?e[n]:e[i]+(n-i)*(e[i+1]-e[i]))};var Lg={};Lg.EXC=(e,t,r)=>{if(r=r===void 0?3:r,e=It(vt(e)),t=ge(t),r=ge(r),ft(e,t,r))return qe;e=e.sort((f,p)=>f-p);let n=aC.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=It(vt(e)),t=ge(t),r=ge(r),ft(e,t,r))return qe;e=e.sort((f,p)=>f-p);let n=aC.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=ge(e),t=ge(t),ft(e,t)?qe:r?Ct.default.poisson.cdf(e,t):Ct.default.poisson.pdf(e,t));function the(e,t,r,n){if(r===void 0)return 0;if(n=n===void 0?r:n,e=It(vt(e)),t=It(vt(t)),r=ge(r),n=ge(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 xp={};xp.EXC=(e,t)=>{if(e=It(vt(e)),t=ge(t),ft(e,t))return qe;switch(t){case 1:return ha.EXC(e,.25);case 2:return ha.EXC(e,.5);case 3:return ha.EXC(e,.75);default:return rt}};xp.INC=(e,t)=>{if(e=It(vt(e)),t=ge(t),ft(e,t))return qe;switch(t){case 1:return ha.INC(e,.25);case 2:return ha.INC(e,.5);case 3:return ha.INC(e,.75);default:return rt}};var Pg={};Pg.AVG=(e,t,r)=>{if(e=ge(e),t=It(vt(t)),ft(e,t))return qe;t=vt(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};Pg.EQ=(e,t,r)=>{if(e=ge(e),t=It(vt(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 rhe(e,t){if(arguments.length!==2)return Jt;if(t<0)return rt;if(!(e instanceof Array)||typeof t!="number")return qe;if(e.length!==0)return Ct.default.row(e,t)}function nhe(e,t){return e=It(vt(e)),t=It(vt(t)),ft(e,t)?qe:Math.pow(i$(e,t),2)}function dC(){let e=It(vt(arguments));if(e instanceof Error)return e;let t=Ct.default.mean(e),r=e.length,n=0;for(let i=0;ir-n)[t-1]}function ohe(e,t,r){return e=ge(e),t=ge(t),r=ge(r),ft(e,t,r)?qe:(e-t)/r}var Wo={};Wo.P=function(){let e=Oo.P.apply(this,arguments),t=Math.sqrt(e);return isNaN(t)&&(t=rt),t};Wo.S=function(){let e=Oo.S.apply(this,arguments);return Math.sqrt(e)};function ahe(){let e=a$.apply(this,arguments);return Math.sqrt(e)}function she(){let e=s$.apply(this,arguments),t=Math.sqrt(e);return isNaN(t)&&(t=rt),t}function uhe(e,t){if(e=It(vt(e)),t=It(vt(t)),ft(e,t))return qe;let r=Ct.default.mean(t),n=Ct.default.mean(e),i=t.length,o=0,u=0,l=0;for(let a=0;ar!==1&&r!==2?rt:r===1?da.DIST.RT(e,t):da.DIST["2T"](e,t);da.DIST["2T"]=function(e,t){return arguments.length!==2?Jt:e<0||t<1?rt:typeof e!="number"||typeof t!="number"?qe:(1-Ct.default.studentt.cdf(e,t))*2};da.DIST.RT=function(e,t){return arguments.length!==2?Jt:e<0||t<1?rt:typeof e!="number"||typeof t!="number"?qe:1-Ct.default.studentt.cdf(e,t)};da.INV=(e,t)=>(e=ge(e),t=ge(t),ft(e,t)?qe:Ct.default.studentt.inv(e,t));da.INV["2T"]=(e,t)=>(e=ge(e),t=ge(t),e<=0||e>1||t<1?rt:ft(e,t)?qe:Math.abs(Ct.default.studentt.inv(e/2,t)));da.TEST=(e,t)=>{if(e=It(vt(e)),t=It(vt(t)),ft(e,t))return qe;let r=Ct.default.mean(e),n=Ct.default.mean(t),i=0,o=0,u;for(u=0;u{u.push(i*l+o)}),u}function fhe(e,t){if(e=It(vt(e)),t=ge(t),ft(e,t))return qe;let r=yp(e.length*t,2)/2;return Ct.default.mean(rme(wn(e.sort((n,i)=>n-i),r),r))}var Oo={};Oo.P=function(){let e=bp(vt(arguments)),t=e.length,r=0,n=vp(e),i;for(let o=0;o(e=ge(e),t=ge(t),r=ge(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 gC={};gC.TEST=(e,t,r)=>{if(e=It(vt(e)),t=ge(t),ft(e,t))return qe;r=r||Wo.S(e);let n=e.length;return 1-Bs.S.DIST((vp(e)-t)/(r/Math.sqrt(n)),!0)};function che(e){return e=ge(e),e instanceof Error?e:Math.abs(e)}function phe(e){if(e=ge(e),e instanceof Error)return e;let t=Math.acos(e);return isNaN(t)&&(t=rt),t}function mhe(e){if(e=ge(e),e instanceof Error)return e;let t=Math.log(e+Math.sqrt(e*e-1));return isNaN(t)&&(t=rt),t}function hhe(e){return e=ge(e),e instanceof Error?e:Math.atan(1/e)}function dhe(e){if(e=ge(e),e instanceof Error)return e;let t=.5*Math.log((e+1)/(e-1));return isNaN(t)&&(t=rt),t}function vhe(e,t,r,n){if(e=ge(e),t=ge(e),ft(e,t))return qe;switch(e){case 1:return vp(r);case 2:return Ig(r);case 3:return Fg(r);case 4:return eb(r);case 5:return tb(r);case 6:return rb(r);case 7:return Wo.S(r);case 8:return Wo.P(r);case 9:return Cl(r);case 10:return Oo.S(r);case 11:return Oo.P(r);case 12:return n$(r);case 13:return gp.SNGL(r);case 14:return r$(r,n);case 15:return o$(r,n);case 16:return ha.INC(r,n);case 17:return xp.INC(r,n);case 18:return ha.EXC(r,n);case 19:return xp.EXC(r,n)}}function ghe(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 xhe(e){if(e=ge(e),e instanceof Error)return e;let t=Math.asin(e);return isNaN(t)&&(t=rt),t}function yhe(e){return e=ge(e),e instanceof Error?e:Math.log(e+Math.sqrt(e*e+1))}function whe(e){return e=ge(e),e instanceof Error?e:Math.atan(e)}function bhe(e,t){e=ge(e),t=ge(t);let r=vr(e,t);return r||Math.atan2(e,t)}function Dhe(e){if(e=ge(e),e instanceof Error)return e;let t=Math.log((1+e)/(1-e))/2;return isNaN(t)&&(t=rt),t}function Nhe(e,t,r){e=ge(e),t=ge(t),r=ge(r);let n=vr(e,t,r);if(n)return n;if(t===0)return rt;let i=e.toString(t);return new Array(Math.max(r+1-i.length,0)).join("0")+i}function Al(e,t,r){e=ge(e),t=ge(t),r=ge(r);let n=vr(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 Mh(e,t){e=ge(e),t=ge(t);let r=vr(e,t);return r||(e1?nC:(e=ge(e),e instanceof Error||(e=Math.exp(e)),e)}var Kw=[];function Sl(e){if(e=ge(e),e instanceof Error)return e;let t=Math.floor(e);return t===0||t===1?1:(Kw[t]>0||(Kw[t]=Sl(t-1)*t),Kw[t])}function u$(e){if(e=ge(e),e instanceof Error)return e;let t=Math.floor(e);return t<=0?1:t*u$(t-2)}function yp(e,t){e=ge(e),t=ge(t);let r=vr(e,t);if(r)return r;if(t===0)return 0;if(!(e>=0&&t>0)&&!(e<=0&&t<0))return rt;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)}yp.MATH=(e,t,r)=>{if(t instanceof Error)return t;t=t===void 0?0:t,e=ge(e),t=ge(t),r=ge(r);let n=vr(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)};yp.PRECISE=yp.MATH;function Bhe(){let e=It(vt(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 Lhe(e){return e=ge(e),e instanceof Error?e:Math.floor(e)}var Phe={CEILING:Al};function Rhe(){let e=It(vt(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 qhe(e){return e=ge(e),e instanceof Error?e:e===0?rt:Math.log(e)}function zhe(e,t){e=ge(e),t=ge(t);let r=vr(e,t);return r||(e===0||t===0?rt:Math.log(e)/Math.log(t))}function Uhe(e){return e=ge(e),e instanceof Error?e:e===0?rt:Math.log(e)/Math.log(10)}function Hhe(e,t){return!Array.isArray(e)||!Array.isArray(t)||e.some(n=>!n.length)||t.some(n=>!n.length)||eC(e).some(n=>typeof n!="number")||eC(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 $he(e,t){e=ge(e),t=ge(t);let r=vr(e,t);if(r)return r;if(t===0)return ho;let n=Math.abs(e%t);return n=e<0?t-n:n,t>0?n:-n}function Whe(e,t){e=ge(e),t=ge(t);let r=vr(e,t);return r||(e*t===0?0:e*t<0?rt:Math.round(e/t)*t)}function Vhe(){let e=It(vt(arguments));if(e instanceof Error)return e;let t=0,r=1;for(let n=0;n1?Jt:(e=parseInt(e),!e||e<=0?qe:Array(e).fill(0).map(()=>Array(e).fill(0)).map((t,r)=>(t[r]=1,t)))}function Yhe(e){if(e=ge(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 Zhe(){return Math.PI}function l$(e,t){e=ge(e),t=ge(t);let r=vr(e,t);if(r)return r;if(e===0&&t===0)return rt;let n=Math.pow(e,t);return isNaN(n)?rt:n}function rb(){let t=vt(arguments).filter(i=>i!=null);if(t.length===0)return 0;let r=It(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 tde(e,t){e=ge(e),t=ge(t);let r=vr(e,t);return r||(e>0?1:-1)*Math.ceil(Math.abs(e)*Math.pow(10,t))/Math.pow(10,t)}function rde(e){return e=ge(e),e instanceof Error?e:1/Math.cos(e)}function nde(e){return e=ge(e),e instanceof Error?e:2/(Math.exp(e)+Math.exp(-e))}function ide(e,t,r,n){if(e=ge(e),t=ge(t),r=ge(r),n=It(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 cde(e,t,r){if(e=vt(e),r=r?vt(r):e,e instanceof Error)return e;if(t==null||t instanceof Error)return 0;let n=0,i=t==="*",o=i?null:Oh(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 Jt;e=ge(e),t=ge(t);let r=vr(e,t);return r||e+t}function Dde(e,t){if(arguments.length!==2)return Jt;e=ge(e),t=ge(t);let r=vr(e,t);return r||(t===0?ho:e/t)}function Nde(e,t){return arguments.length!==2?Jt:e instanceof Error?e:t instanceof Error?t:(e===null&&(e=void 0),t===null&&(t=void 0),e===t)}function Ede(e,t){if(arguments.length!==2)return Jt;if(e instanceof Error)return e;if(t instanceof Error)return t;sb(e,t)?(e=Xn(e),t=Xn(t)):(e=ge(e),t=ge(t));let r=vr(e,t);return r||e>t}function Sde(e,t){if(arguments.length!==2)return Jt;sb(e,t)?(e=Xn(e),t=Xn(t)):(e=ge(e),t=ge(t));let r=vr(e,t);return r||e>=t}function Ade(e,t){if(arguments.length!==2)return Jt;sb(e,t)?(e=Xn(e),t=Xn(t)):(e=ge(e),t=ge(t));let r=vr(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 zde(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 Ude(e){return e=br(e),e instanceof Error?e:e.getHours()}function f$(e){if(e=br(e),e instanceof Error)return e;e=ib(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 Hde(e){return e=br(e),e instanceof Error?e:e.getMinutes()}function $de(e){return e=br(e),e instanceof Error?e:e.getMonth()+1}function cb(e,t,r){return cb.INTL(e,t,1,r)}cb.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=nb[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 N=0;N{if(e=br(e),e instanceof Error)return e;if(t=ge(t),t instanceof Error)return t;if(r===void 0?r=nb[1]:r=nb[r],!(r instanceof Array))return qe;n===void 0?n=[]:n instanceof Array||(n=[n]);for(let u=0;u{let D=N.getFullYear(),b=new Date(D,2,1);if(JA(D)&&N=b)return!0;let O=w.getFullYear(),M=new Date(O,2,1);return JA(O)&&w>=M&&Nl||i===l&&n>=u))return(o===a&&JA(o)||s(e,t)||l===1&&u===29)&&(f=366),Jw(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 Jw(e,t)/y}case 2:return Jw(e,t)/360;case 3:return Jw(e,t)/365;case 4:return(u+l*30+a*360-(n+i*30+o*360))/360}}function HH(e){let t=e>-22038912e5?2:1;return Math.ceil((e-_de)/864e5)+t}function Qde(){throw new Error("ASC is not implemented")}function jde(){throw new Error("BAHTTEXT is not implemented")}function c$(e){return e=ge(e),e===0?qe:e instanceof Error?e:String.fromCharCode(e)}function eve(e){if(ft(e))return e;e=e||"";let t=/[\0-\x1F]/g;return e.replace(t,"")}function p$(e){if(ft(e))return e;e=e||"";let t=e.charCodeAt(0);return isNaN(t)&&(t=qe),t}function m$(){let e=vt(arguments),t=vr.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 tve=m$;function rve(){throw new Error("DBCS is not implemented")}function nve(e,t=2){if(e=ge(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 ive(e,t){if(arguments.length!==2)return Jt;let r=vr(e,t);return r||(e=Xn(e),t=Xn(t),e===t)}function ove(e,t,r){if(arguments.length<2)return Jt;e=Xn(e),t=Xn(t),r=r===void 0?0:r;let n=t.indexOf(e,r-1);return n===-1?qe:n+1}function h$(e,t=2,r=!1){if(e=ge(e),isNaN(e)||(t=ge(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 ave(e,t){let r=vr(e,t);return r||(e=Xn(e),t=t===void 0?1:t,t=ge(t),t instanceof Error||typeof e!="string"?qe:e.substring(0,t))}function sve(e){return arguments.length===0?nC:e instanceof Error?e:Array.isArray(e)?qe:Xn(e).length}function uve(e){return arguments.length!==1?qe:(e=Xn(e),ft(e)?e:e.toLowerCase())}function lve(e,t,r){if(t==null)return qe;if(t=ge(t),r=ge(r),ft(t,r)||typeof e!="string")return r;let n=t-1,i=n+r;return e.substring(n,i)}function fve(e,t,r){return e=Fh(e)?e:"",typeof e=="number"?e:typeof e!="string"?Jt:(t=typeof t>"u"?".":t,r=typeof r>"u"?",":r,Number(e.replace(t,".").replace(r,"")))}function cve(){throw new Error("PRONETIC is not implemented")}function pve(e){return ft(e)?e:isNaN(e)&&typeof e=="number"?qe:(e=Xn(e),e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()))}function mve(e,t,r,n){return t=ge(t),r=ge(r),ft(t,r)||typeof e!="string"||typeof n!="string"?qe:e.substr(0,t-1)+n+e.substr(t-1+r)}function va(e,t){let r=vr(e,t);return r||(e=Xn(e),t=ge(t),t instanceof Error?t:new Array(t+1).join(e))}function hve(e,t){let r=vr(e,t);return r||(e=Xn(e),t=t===void 0?1:t,t=ge(t),t instanceof Error?t:e.substring(e.length-t))}function dve(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 vve(e,t,r,n){if(arguments.length<3)return Jt;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 gve(e){return e instanceof Error||typeof e=="string"?e:""}function xve(e,t){if(e===void 0||e instanceof Error||t instanceof Error)return Jt;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=h$(e,i,o),e.startsWith("-")?(e=e.replace("-",""),e="-"+r+e):e=r+e,n&&(e=e+"%"),e}function yve(e,t,...r){if(typeof t!="boolean"&&(t=oC(t)),arguments.length<3)return Jt;e=e??"";let n=vt(r),i=t?n.filter(o=>o):n;if(Array.isArray(e)){e=vt(e);let o=i.map(l=>[l]),u=0;for(let l=0;l=n.length?va("0",t-n.length)+n:rt)}function Ive(e,t){if(!yC(e))return rt;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?rt:(t=Math.floor(t),t>=n.length?va("0",t-n.length)+n:rt)}function Fve(e,t){return e=ge(e),t=ge(t),ft(e,t)?qe:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?rt:e&t}function _ve(e,t){return e=ge(e),t=ge(t),ft(e,t)?qe:e<0||Math.floor(e)!==e||e>0xffffffffffff||Math.abs(t)>53?rt:t>=0?e<>-t}function kve(e,t){return e=ge(e),t=ge(t),ft(e,t)?qe:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?rt:e|t}function Bve(e,t){return e=ge(e),t=ge(t),ft(e,t)?qe:e<0||Math.floor(e)!==e||e>0xffffffffffff||Math.abs(t)>53?rt:t>=0?e>>t:e<<-t}function Lve(e,t){return e=ge(e),t=ge(t),ft(e,t)?qe:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?rt:e^t}function vo(e,t,r){if(e=ge(e),t=ge(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 Pve(e,t,r){if(e=ge(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)],N=o[t.substring(0,1)];t.substring(0,2)==="da"&&(N=["dekao",10,"da"]),y?(f=y[2],a=t.substring(2)):N&&(f=N[1],a=t.substring(N[2].length));for(let w=0;w=0)&&(u=n[w])}if(l===null){let y=i[r.substring(0,2)],N=o[r.substring(0,1)];r.substring(0,2)==="da"&&(N=["dekao",10,"da"]),y?(p=y[2],s=r.substring(2)):N&&(p=N[1],s=r.substring(N[2].length));for(let w=0;w=0)&&(l=n[w])}return u===null||l===null||u[3]!==l[3]?Jt:e*u[6]*f/(l[6]*p)}function Rve(e,t){if(e=ge(e),e instanceof Error)return e;if(!/^-?[0-9]{1,3}$/.test(e)||e<-512||e>511)return rt;if(e<0)return"1"+va("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?rt:(t=Math.floor(t),t>=r.length?va("0",t-r.length)+r:rt)}function qve(e,t){if(e=ge(e),e instanceof Error)return e;if(!/^-?[0-9]{1,12}$/.test(e)||e<-549755813888||e>549755813887)return rt;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?rt:(t=Math.floor(t),t>=r.length?va("0",t-r.length)+r:rt)}function zve(e,t){if(e=ge(e),e instanceof Error)return e;if(!/^-?[0-9]{1,9}$/.test(e)||e<-536870912||e>536870911)return rt;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?rt:(t=Math.floor(t),t>=r.length?va("0",t-r.length)+r:rt)}function Uve(e,t){return t=t===void 0?0:t,e=ge(e),t=ge(t),ft(e,t)?qe:e===t?1:0}function wC(e,t){return t=t===void 0?0:t,e=ge(e),t=ge(t),ft(e,t)?qe:Ct.default.erf(e)}wC.PRECISE=()=>{throw new Error("ERF.PRECISE is not implemented")};function bC(e){return isNaN(e)?qe:Ct.default.erfc(e)}bC.PRECISE=()=>{throw new Error("ERFC.PRECISE is not implemented")};function Hve(e,t){return t=t||0,e=ge(e),ft(t,e)?e:e>=t?1:0}function $ve(e,t){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return rt;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 rt;if(r)return"1"+va("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?rt:(t=Math.floor(t),t>=i.length?va("0",t-i.length)+i:rt)}function Wve(e){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return rt;let t=parseInt(e,16);return t>=549755813888?t-1099511627776:t}function Vve(e,t){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return rt;let r=parseInt(e,16);if(r>536870911&&r<0xffe0000000)return rt;if(r>=0xffe0000000)return(r-0xffc0000000).toString(8);let n=r.toString(8);return t===void 0?n:isNaN(t)?qe:t<0?rt:(t=Math.floor(t),t>=n.length?va("0",t-n.length)+n:rt)}function DC(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))?rt:Number(e.substring(t+1,e.length-1)):isNaN(e.substring(0,r))||isNaN(e.substring(r+1,e.length-1))?rt:-Number(e.substring(r+1,e.length-1)):rt:i?isNaN(e.substring(0,e.length-1))?rt:e.substring(0,e.length-1):isNaN(e)?rt:0}function NC(e){let t=nn(e),r=rn(e);return ft(t,r)?qe:t===0&&r===0?ho: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 Gve(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?vo(t,-r,n):e}function mb(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",vo(Math.cos(t)*(Math.exp(r)+Math.exp(-r))/2,-Math.sin(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",vo(Math.cos(r)*(Math.exp(t)+Math.exp(-t))/2,Math.sin(r)*(Math.exp(t)-Math.exp(-t))/2,n)}function Yve(e){let t=nn(e),r=rn(e);return ft(t,r)?qe:Dp(mb(e),hb(e))}function Dp(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 rt;let s=i*i+o*o;return vo((r*i+n*o)/s,(n*i-r*o)/s,a)}function Zve(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 vo(i*Math.cos(r),i*Math.sin(r),n)}function Xve(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",vo(Math.log(Math.sqrt(t*t+r*r)),Math.atan(r/t),n)}function Kve(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",vo(Math.log(Math.sqrt(t*t+r*r))/Math.log(10),Math.atan(r/t)/Math.log(10),n)}function Jve(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",vo(Math.log(Math.sqrt(t*t+r*r))/Math.log(2),Math.atan(r/t)/Math.log(2),n)}function Qve(e,t){t=ge(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(DC(e),t),u=NC(e);return vo(o*Math.cos(t*u),o*Math.sin(t*u),i)}function jve(){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))?rt:Number(e.substring(0,t)):isNaN(e.substring(0,r))||isNaN(e.substring(r+1,e.length-1))?rt:Number(e.substring(0,r)):rt:i?isNaN(e.substring(0,e.length-1))?rt:0:isNaN(e)?rt:e}function ege(e){if(e===!0||e===!1)return qe;let t=nn(e),r=rn(e);return ft(t,r)?qe:Dp("1",mb(e))}function tge(e){let t=nn(e),r=rn(e);return ft(t,r)?qe:Dp("1",d$(e))}function hb(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",vo(Math.sin(t)*(Math.exp(r)+Math.exp(-r))/2,Math.cos(t)*(Math.exp(r)-Math.exp(-r))/2,n)}function v$(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",vo(Math.cos(r)*(Math.exp(t)-Math.exp(-t))/2,Math.sin(r)*(Math.exp(t)+Math.exp(-t))/2,n)}function rge(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(DC(e)),o=NC(e);return vo(i*Math.cos(o/2),i*Math.sin(o/2),n)}function nge(e){if(e===!0||e===!1)return qe;let t=nn(e),r=rn(e);return ft(t,r)?rt:Dp("1",hb(e))}function ige(e){if(e===!0||e===!1)return qe;let t=nn(e),r=rn(e);return ft(t,r)?rt:Dp("1",v$(e))}function oge(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"),vo(r-i,n-o,a)}function age(){if(!arguments.length)return qe;let e=vt(arguments),t=e[0];for(let r=1;r511)return rt;if(r)return"1"+va("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?rt:(t=Math.floor(t),t>=i.length?va("0",t-i.length)+i:rt)}function lge(e){if(!/^[0-7]{1,10}$/.test(e))return rt;let t=parseInt(e,8);return t>=536870912?t-1073741824:t}function fge(e,t){if(!/^[0-7]{1,10}$/.test(e))return rt;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?rt:(t=Math.floor(t),t>=n.length?va("0",t-n.length)+n:rt)}var cge=kg.DIST,pge=kg.INV,mge=_h.DIST,hge=Al.MATH,dge=Al.PRECISE,vge=_s.DIST,gge=_s.DIST.RT,xge=_s.INV,yge=_s.INV.RT,wge=_s.TEST,bge=kh.P,Dge=kh.P,Nge=kh.S,Ege=_h.INV,Sge=bC.PRECISE,Age=wC.PRECISE,Cge=lC.DIST,Mge=ks.DIST,Tge=ks.DIST.RT,Oge=ks.INV,Ige=ks.INV.RT,Fge=yp.MATH,_ge=yp.PRECISE,kge=ks.TEST,Bge=Bg.DIST,Lge=Bg.INV,Pge=fC.PRECISE,Rge=cC.DIST,qge=Bh.INV,zge=Bh.DIST,Uge=Bh.INV,Hge=gp.MULT,$ge=gp.SNGL,Wge=mC.DIST,Vge=cb.INTL,Gge=Bs.DIST,Yge=Bs.INV,Zge=Bs.S.DIST,Xge=Bs.S.INV,Kge=ha.EXC,Jge=ha.INC,Qge=Lg.EXC,jge=Lg.INC,e0e=hC.DIST,t0e=xp.EXC,r0e=xp.INC,n0e=Pg.AVG,i0e=Pg.EQ,o0e=dC.P,a0e=Wo.P,s0e=Wo.S,u0e=da.DIST,l0e=da.DIST.RT,f0e=da.INV,c0e=da.TEST,p0e=Oo.P,m0e=Oo.S,h0e=vC.DIST,d0e=pb.INTL,v0e=gC.TEST;function EC(e){let t=[];return mo(e,r=>{r&&t.push(r)}),t}function Ya(e,t){let r={};for(let o=1;on&&(n=t[o].length);for(let o=1;o{o+=i[u]}),n.length===0?ho:o/n.length}function x0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ya(e,r),i=[];if(typeof t=="string"){let u=Ga(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return mo(n,u=>{o.push(i[u])}),Ig(o)}function y0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ya(e,r),i=[];if(typeof t=="string"){let u=Ga(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return mo(n,u=>{o.push(i[u])}),Fg(o)}function w0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ya(e,r),i=[];if(typeof t=="string"){let o=Ga(e,t);i=wn(e[o])}else i=wn(e[t]);return n.length===0?qe:n.length>1?rt:i[n[0]]}function b0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ya(e,r),i=[];if(typeof t=="string"){let u=Ga(e,t);i=wn(e[u])}else i=wn(e[t]);let o=i[n[0]];return mo(n,u=>{o{o>i[u]&&(o=i[u])}),o}function N0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ya(e,r),i=[];if(typeof t=="string"){let l=Ga(e,t);i=wn(e[l])}else i=wn(e[t]);let o=[];mo(n,l=>{o.push(i[l])}),o=EC(o);let u=1;return mo(o,l=>{u*=l}),u}function E0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ya(e,r),i=[];if(typeof t=="string"){let u=Ga(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return mo(n,u=>{o.push(i[u])}),o=EC(o),Wo.S(o)}function S0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ya(e,r),i=[];if(typeof t=="string"){let u=Ga(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return mo(n,u=>{o.push(i[u])}),o=EC(o),Wo.P(o)}function A0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ya(e,r),i=[];if(typeof t=="string"){let u=Ga(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return mo(n,u=>{o.push(i[u])}),Cl(o)}function C0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ya(e,r),i=[];if(typeof t=="string"){let u=Ga(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return mo(n,u=>{o.push(i[u])}),Oo.S(o)}function M0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ya(e,r),i=[];if(typeof t=="string"){let u=Ga(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return mo(n,u=>{o.push(i[u])}),Oo.P(o)}function QA(e){return e&&e.getTime&&!isNaN(e.getTime())}function jA(e){return e instanceof Date?e:new Date(e)}function T0e(e,t,r){let n=br(t);for(n.setFullYear(e.getFullYear()),ne;)n.setMonth(n.getMonth()+-12/r);return n}function g$(e){return e=ge(e),[1,2,4].indexOf(e)===-1?rt:e}function x$(e){return e=ge(e),[0,1,2,3,4].indexOf(e)===-1?rt:e}function O0e(e,t,r,n,i,o,u){return e=jA(e),t=jA(t),r=jA(r),o=g$(o),u=x$(u),vr(o,u)?rt:!QA(e)||!QA(t)||!QA(r)?qe:n<=0||i<=0||r<=e?rt:(i=i||0,u=u||0,i*n*xC(e,r,u))}function I0e(){throw new Error("ACCRINTM is not implemented")}function F0e(){throw new Error("AMORDEGRC is not implemented")}function _0e(){throw new Error("AMORLINC is not implemented")}function k0e(){throw new Error("COUPDAYBS is not implemented")}function B0e(e,t,r,n){if(n=x$(n),r=g$(r),e=br(e),t=br(t),vr(e,t))return qe;if(vr(r,n)||e>=t)return rt;if(n===1){let o=T0e(e,t,r),u=br(o);return u.setMonth(u.getMonth()+12/r),_f(o,u,"D")}let i;switch(n){case 0:case 2:case 4:i=360;break;case 3:i=365;break;default:return rt}return i/r}function L0e(){throw new Error("COUPDAYSNC is not implemented")}function P0e(){throw new Error("COUPNCD is not implemented")}function R0e(){throw new Error("COUPNUM is not implemented")}function q0e(){throw new Error("COUPPCD is not implemented")}function z0e(e,t,r,n,i,o){if(e=ge(e),t=ge(t),r=ge(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 rt;let u=Rg(e,t,r,0,o),l=0;n===1&&(o===0&&(l=-r),n++);for(let a=n;a<=i;a++)l+=o===1?wp(e,a-2,u,r,1)-u:wp(e,a-1,u,r,0);return l*=e,l}function U0e(e,t,r,n,i,o){if(e=ge(e),t=ge(t),r=ge(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 rt;let u=Rg(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-(wp(e,a-2,u,r,1)-u)*e:u-wp(e,a-1,u,r,0)*e;return l}function H0e(e,t,r,n,i){if(i=i===void 0?12:i,e=ge(e),t=ge(t),r=ge(r),n=ge(n),i=ge(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 rt;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 $0e(e,t,r,n,i){if(i=i===void 0?2:i,e=ge(e),t=ge(t),r=ge(r),n=ge(n),i=ge(i),ft(e,t,r,n,i))return qe;if(e<0||t<0||r<0||n<0||i<=0||n>r)return rt;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 W0e(e,t,r,n,i){if(e=br(e),t=br(t),r=ge(r),n=ge(n),i=ge(i),i=i||0,ft(e,t,r,n,i))return qe;if(r<=0||n<=0)return rt;if(e>=t)return qe;let o,u;switch(i){case 0:o=360,u=kf(e,t,!1);break;case 1:o=365,u=_f(e,t,"D");break;case 2:o=360,u=_f(e,t,"D");break;case 3:o=365,u=_f(e,t,"D");break;case 4:o=360,u=kf(e,t,!0);break;default:return rt}return(n-r)/n*o/u}function V0e(e,t){if(e=ge(e),t=ge(t),ft(e,t))return qe;if(t<0)return rt;if(t>=0&&t<1)return ho;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 G0e(e,t){if(e=ge(e),t=ge(t),ft(e,t))return qe;if(t<0)return rt;if(t>=0&&t<1)return ho;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 Y0e(){throw new Error("DURATION is not implemented")}function Z0e(e,t){return e=ge(e),t=ge(t),ft(e,t)?qe:e<=0||t<1?rt:(t=parseInt(t,10),Math.pow(1+e/t,t)-1)}function wp(e,t,r,n,i){if(n=n||0,i=i||0,e=ge(e),t=ge(t),r=ge(r),n=ge(n),i=ge(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 X0e(e,t){if(e=ge(e),t=It(vt(t)),ft(e,t))return qe;let r=t.length,n=e;for(let i=0;i{let D=w+1,b=y[0];for(let O=1;O{let D=w+1,b=0;for(let O=1;O0&&(o=!0),e[y]<0&&(u=!0);if(!o||!u)return rt;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 Q0e(e,t,r,n){return e=ge(e),t=ge(t),r=ge(r),n=ge(n),ft(e,t,r,n)?qe:n*e*(t/r-1)}function j0e(){throw new Error("MDURATION is not implemented")}function e1e(e,t,r){if(e=It(vt(e)),t=ge(t),r=ge(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=kf(e,t,!1);break;case 1:o=365,u=_f(e,t,"D");break;case 2:o=360,u=_f(e,t,"D");break;case 3:o=365,u=_f(e,t,"D");break;case 4:o=360,u=kf(e,t,!0);break;default:return rt}return n-r*n*u/o}function c1e(){throw new Error("PRICEMAT is not implemented")}function p1e(e,t,r,n,i){return n=n||0,i=i||0,e=ge(e),t=ge(t),r=ge(r),n=ge(n),i=ge(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=ge(e),t=ge(t),r=ge(r),n=ge(n),i=ge(i),o=ge(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?rt:(n=parseInt(n,10),(e-t)*(r-n+1)*2/(r*(r+1)))}function x1e(e,t,r){return e=br(e),t=br(t),r=ge(r),ft(e,t,r)?qe:r<=0||e>t||t-e>365*24*60*60*1e3?rt:365*r/(360-r*kf(e,t,!1))}function y1e(e,t,r){return e=br(e),t=br(t),r=ge(r),ft(e,t,r)?qe:r<=0||e>t||t-e>365*24*60*60*1e3?rt:100*(1-r*kf(e,t,!1)/360)}function w1e(e,t,r){return e=br(e),t=br(t),r=ge(r),ft(e,t,r)?qe:r<=0||e>t||t-e>365*24*60*60*1e3?rt:(100-r)*360/(r*kf(e,t,!1))}function b1e(){throw new Error("VDB is not implemented")}function D1e(e,t,r){if(e=It(vt(e)),t=ZH(vt(t)),r=ge(r),ft(e,t,r))return qe;let n=(y,N,w)=>{let D=w+1,b=y[0];for(let O=1;O{let D=w+1,b=0;for(let O=1;O0&&(o=!0),e[y]<0&&(u=!0);if(!o||!u)return rt;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 N1e(e,t,r){if(e=ge(e),t=It(vt(t)),r=ZH(vt(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 O1e(){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=qt.getLineNumber(u),a=l+1,s="",f=u.text.trim().split("//")[0].split("#")[0];if(qt.removeLineClass(u,"gutter","lineNoError"),Ge.settings.rulers?(qt.removeLineClass(u,"wrap","noRuler"),qt.addLineClass(u,"wrap","ruler")):(qt.removeLineClass(u,"wrap","ruler"),qt.addLineClass(u,"wrap","noRuler")),f)try{f=a>1&&f.charAt(0).match(/[+\-*/]/)&&qt.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=q1e(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=qg(s,!1),t=qg(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&&(qt.addLineClass(l,"gutter","lineNoError"),s=`Error`)}else i.length=0;e+=`
      ${s} -
      `}),Ve("#output").innerHTML=e,Ge.activePage){let u=Gt.get("pages"),l=u.find(a=>a.id===Ge.activePage);l.data=qt.getValue(),l.history=qt.getHistory(),Gt.set("pages",u)}}function q1e(e){if(e.match(/:/))try{_r.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=Dr.fromFormat(i,Ge.settings.dateDay?EC:SC,u),a=Dr.fromFormat(i,Ge.settings.dateDay?CC:AC,u),s=l.isValid?l:a.isValid?a:!1,f=String(_r.evaluate(o+" to hours",Ge.mathScope)),p=Number(f.split(" ")[0]);if(s)e=`"${s.plus({hours:p}).toFormat(l.isValid?Ge.settings.dateDay?EC:SC:Ge.settings.dateDay?CC:AC)}"`;else return"Invalid Date"}let r=/%[ ]*of[ ]*/g,n=/[\w.]*%[ ]*of[ ]*/g;return e.match(n)&&(e=e.replaceAll(r,"/100*")),_r.evaluate(e,Ge.mathScope)}function b$(e){let t=e.length;return e.charAt(0)==='"'&&(e=e.substring(1,t--)),e.charAt(--t)==='"'&&(e=e.substring(0,t)),e}function $g(e,t){if(e=String(e),["bin","hex","oct"].includes(Ge.settings.notation))return b$(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]:b$(e)}var wa=jr(Hm(),1),ba=jr(Bs(),1),e7t=jr(S$(),1),t7t=jr(pb(),1),r7t=jr(T$(),1),n7t=jr(F$(),1),i7t=jr(B$(),1),o7t=jr(R$(),1),a7t=jr(U$(),1),s7t=jr(G$(),1),u7t=jr(OC(),1),qt=ba.default.fromTextArea(Ve("#inputArea"),{autofocus:!0,extraKeys:{"Ctrl-Space":"autocomplete",Tab:()=>{}},inputStyle:"textarea",mode:"numara",singleCursorHeightPerLine:!1,smartIndent:!1,theme:"numara",viewportMargin:1/0}),Y$={autoCloseBrackets:!0,mode:"javascript",tabSize:2},Pf=ba.default.fromTextArea(Ve("#udfInput"),Y$),Rf=ba.default.fromTextArea(Ve("#uduInput"),Y$);ba.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 _r[t]=="function"&&Object.getOwnPropertyNames(_r[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 qh[t]=="function")return"excel";try{let r=_r.evaluate(t),n=_r.parse(t);if(r.units&&r)return"unit";if(n.isSymbolNode&&r)return"constant"}catch{}try{_r.evaluate(t)}catch{return"variable"}return e.next(),"space"}}));ba.default.defineMode("plain",()=>({token:e=>(e.next(),"text")}));var mb=[],Z$=[{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."}];Z$.forEach(e=>{e.className="cm-scope",mb.push(e)});Object.getOwnPropertyNames(_r).forEach(e=>{typeof _r[e]=="function"&&Object.getOwnPropertyNames(_r[e]).includes("signatures")&&mb.push({text:e,className:"cm-function"})});Object.keys(qh).forEach(e=>{mb.push({text:e,className:"cm-excel"})});ba.default.commands.autocomplete=e=>{ba.default.showHint(e,ba.default.hint.numaraHints,{completeSingle:!1,extraKeys:{Enter:"newline"}})};ba.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:ba.default.Pos(t.line,n),to:ba.default.Pos(t.line,i)}});qt.on("changes",Xa);qt.on("inputRead",e=>{Ge.settings.autocomplete&&ba.default.commands.autocomplete(e)});qt.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 Ka=e=>e.nodeName.toLowerCase()==="li"?"right":"top-left";qt.on("update",()=>{let e=Yn(".cm-function");if(e.length>0&&Ge.settings.keywordTips)for(let f of e)try{let p=JSON.parse(JSON.stringify(_r.help(f.innerText).toJSON()));wa.default.tooltip(f,{pos:Ka(f),title:p.description})}catch{wa.default.tooltip(f,{pos:Ka(f),title:"Description not available"})}let t=Yn(".cm-udf");if(t.length>0&&Ge.settings.keywordTips)for(let f of t)wa.default.tooltip(f,{pos:Ka(f),title:"User defined function"});let r=Yn(".cm-udu");if(r.length>0&&Ge.settings.keywordTips)for(let f of r)wa.default.tooltip(f,{pos:Ka(f),title:"User defined unit"});let n=Yn(".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;wa.default.tooltip(f,{pos:Ka(f),title:h})}catch{wa.default.tooltip(f,{pos:Ka(f),title:"Description not available"})}let i=Yn(".cm-unit");if(i.length>0&&Ge.settings.keywordTips)for(let f of i)wa.default.tooltip(f,{pos:Ka(f),title:`Unit '${f.innerText}'`});let o=Yn(".cm-constant");if(o.length>0&&Ge.settings.keywordTips)for(let f of o)try{wa.default.tooltip(f,{pos:Ka(f),title:_r.help(f.innerText).doc.description+" (Constant)"})}catch{}let u=Yn(".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=$g(_r.evaluate(f.innerText,Ge.mathScope))}catch{p="Undefined"}wa.default.tooltip(f,{pos:Ka(f),title:p})}}let l=Yn(".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":$g(_r.evaluate(f.innerText,Ge.mathScope))}catch{p="Undefined"}wa.default.tooltip(f,{pos:Ka(f),title:p})}let a=Yn(".cm-scope");if(a.length>0&&Ge.settings.keywordTips)for(let f of a)wa.default.tooltip(f,{pos:Ka(f),title:Z$.filter(p=>f.innerText===p.text)[0].desc});let s=Yn(".cm-excel");if(s.length>0&&Ge.settings.keywordTips)for(let f of s)wa.default.tooltip(f,{pos:Ka(f),title:"Excel function"})});qt.on("cursorActivity",e=>{let t=Gt.get("pages"),r=t.find(n=>n.id==Ge.activePage);r.cursor=e.getCursor(),Gt.set("pages",t)});function z1e(){setTimeout(()=>{let e=qt.getCursor().line,t=qt.getLine(e),r=Ve("#output").children[e].innerText,n=qt.getValue()==="",i=t.length>0,o=qt.somethingSelected(),u=qt.listSelections().length>1||qt.listSelections()[0].anchor.line!==qt.listSelections()[0].head.line,l=r!==""&&r!=="Error"&&r!=="Plot";numara.inputContextMenu(e,n,i,o,u,l)},20)}function U1e(e){let t=e.srcElement.innerText,r=e.srcElement.dataset.line||e.srcElement.parentElement.dataset.line||qt.lastLine(),n=r!==null&&t!==""&&t!=="Error"&&t!=="Plot",i=qt.getValue()==="";numara.outputContextMenu(r,i,n)}function IC(){setTimeout(()=>{numara.textboxContextMenu()},20)}function H1e(e,t){t=+t;let r=qt.getLine(t).trim();navigator.clipboard.writeText(r).then(Ln(`Copied Line ${t+1} to clipboard.`))}function X$(e,t,r){t=+t;let n=qt.getLine(t).trim(),i=Ve("#output").children[t].children[0].dataset.copy,o=r?`${n} = ${i}`:`${i}`;navigator.clipboard.writeText(o).then(Ln(r?`Copied Line ${t+1} with answer to clipboard.`:`Copied '${i}' to clipboard.`))}function $1e(){qt.getValue()===""?Ln("Nothing to copy."):navigator.clipboard.writeText(qt.getValue()).then(Ln("Copied all lines to clipboard."))}function W1e(){if(qt.getValue()==="")Ln("Nothing to copy.");else{let e="";qt.eachLine(t=>{let r=qt.getLineNumber(t);e+=`${Ve("#output").children[r].innerText} -`}),navigator.clipboard.writeText(e).then(Ln("Copied all answers to clipboard."))}}function FC(){if(qt.getValue()==="")Ln("Nothing to copy.");else{let e="";qt.eachLine(t=>{let r=qt.getLineNumber(t);t=t.text.trim(),e+=t?t.match(/^(#|\/\/)/)?`${t} +
      `}),Ve("#output").innerHTML=e,Ge.activePage){let u=Yt.get("pages"),l=u.find(a=>a.id===Ge.activePage);l.data=qt.getValue(),l.history=qt.getHistory(),Yt.set("pages",u)}}function q1e(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=Dr.fromFormat(i,Ge.settings.dateDay?AC:SC,u),a=Dr.fromFormat(i,Ge.settings.dateDay?MC:CC,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?AC:SC:Ge.settings.dateDay?MC:CC)}"`;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 w$(e){let t=e.length;return e.charAt(0)==='"'&&(e=e.substring(1,t--)),e.charAt(--t)==='"'&&(e=e.substring(0,t)),e}function qg(e,t){if(e=String(e),["bin","hex","oct"].includes(Ge.settings.notation))return w$(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]:w$(e)}var ga=en(qm(),1),xa=en(Ls(),1),e7t=en(N$(),1),t7t=en(db(),1),r7t=en(M$(),1),n7t=en(I$(),1),i7t=en(k$(),1),o7t=en(P$(),1),a7t=en(z$(),1),s7t=en(V$(),1),u7t=en(IC(),1),qt=xa.default.fromTextArea(Ve("#inputArea"),{autofocus:!0,extraKeys:{"Ctrl-Space":"autocomplete",Tab:()=>{}},mode:"numara",singleCursorHeightPerLine:!1,smartIndent:!1,theme:"numara",viewportMargin:1/0}),G$={autofocus:!0,autoCloseBrackets:!0,mode:"javascript",singleCursorHeightPerLine:!1,tabSize:2},Lf=xa.default.fromTextArea(Ve("#udfInput"),G$),Pf=xa.default.fromTextArea(Ve("#uduInput"),G$);xa.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 Lh[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"}}));xa.default.defineMode("plain",()=>({token:e=>(e.next(),"text")}));var vb=[],Y$=[{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."}];Y$.forEach(e=>{e.className="cm-scope",vb.push(e)});Object.getOwnPropertyNames(kr).forEach(e=>{typeof kr[e]=="function"&&Object.getOwnPropertyNames(kr[e]).includes("signatures")&&vb.push({text:e,className:"cm-function"})});Object.keys(Lh).forEach(e=>{vb.push({text:e,className:"cm-excel"})});xa.default.commands.autocomplete=e=>{xa.default.showHint(e,xa.default.hint.numaraHints,{completeSingle:!1,extraKeys:{Enter:"newline"}})};xa.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:xa.default.Pos(t.line,n),to:xa.default.Pos(t.line,i)}});qt.on("changes",Za);qt.on("inputRead",e=>{Ge.settings.autocomplete&&xa.default.commands.autocomplete(e)});qt.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 Xa=e=>e.nodeName.toLowerCase()==="li"?"right":"top-left";qt.on("update",()=>{let e=Gn(".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()));ga.default.tooltip(f,{pos:Xa(f),title:p.description})}catch{ga.default.tooltip(f,{pos:Xa(f),title:"Description not available"})}let t=Gn(".cm-udf");if(t.length>0&&Ge.settings.keywordTips)for(let f of t)ga.default.tooltip(f,{pos:Xa(f),title:"User defined function"});let r=Gn(".cm-udu");if(r.length>0&&Ge.settings.keywordTips)for(let f of r)ga.default.tooltip(f,{pos:Xa(f),title:"User defined unit"});let n=Gn(".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;ga.default.tooltip(f,{pos:Xa(f),title:h})}catch{ga.default.tooltip(f,{pos:Xa(f),title:"Description not available"})}let i=Gn(".cm-unit");if(i.length>0&&Ge.settings.keywordTips)for(let f of i)ga.default.tooltip(f,{pos:Xa(f),title:`Unit '${f.innerText}'`});let o=Gn(".cm-constant");if(o.length>0&&Ge.settings.keywordTips)for(let f of o)try{ga.default.tooltip(f,{pos:Xa(f),title:kr.help(f.innerText).doc.description+" (Constant)"})}catch{}let u=Gn(".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=qg(kr.evaluate(f.innerText,Ge.mathScope))}catch{p="Undefined"}ga.default.tooltip(f,{pos:Xa(f),title:p})}}let l=Gn(".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":qg(kr.evaluate(f.innerText,Ge.mathScope))}catch{p="Undefined"}ga.default.tooltip(f,{pos:Xa(f),title:p})}let a=Gn(".cm-scope");if(a.length>0&&Ge.settings.keywordTips)for(let f of a)ga.default.tooltip(f,{pos:Xa(f),title:Y$.filter(p=>f.innerText===p.text)[0].desc});let s=Gn(".cm-excel");if(s.length>0&&Ge.settings.keywordTips)for(let f of s)ga.default.tooltip(f,{pos:Xa(f),title:"Excel function"})});qt.on("cursorActivity",e=>{let t=Yt.get("pages"),r=t.find(n=>n.id==Ge.activePage);r.cursor=e.getCursor(),Yt.set("pages",t)});function z1e(){setTimeout(()=>{let e=qt.getCursor().line,t=qt.getLine(e),r=Ve("#output").children[e].innerText,n=qt.getValue()==="",i=t.length>0,o=qt.somethingSelected(),u=qt.listSelections().length>1||qt.listSelections()[0].anchor.line!==qt.listSelections()[0].head.line,l=r!==""&&r!=="Error"&&r!=="Plot";numara.inputContextMenu(e,n,i,o,u,l)},20)}function U1e(e){let t=e.srcElement.innerText,r=e.srcElement.dataset.line||e.srcElement.parentElement.dataset.line||qt.lastLine(),n=r!==null&&t!==""&&t!=="Error"&&t!=="Plot",i=qt.getValue()==="";numara.outputContextMenu(r,i,n)}function FC(){setTimeout(()=>{numara.textboxContextMenu()},20)}function H1e(e,t){t=+t;let r=qt.getLine(t).trim();navigator.clipboard.writeText(r).then(Rn(`Copied Line ${t+1} to clipboard.`))}function Z$(e,t,r){t=+t;let n=qt.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 $1e(){qt.getValue()===""?Rn("Nothing to copy."):navigator.clipboard.writeText(qt.getValue()).then(Rn("Copied all lines to clipboard."))}function W1e(){if(qt.getValue()==="")Rn("Nothing to copy.");else{let e="";qt.eachLine(t=>{let r=qt.getLineNumber(t);e+=`${Ve("#output").children[r].innerText} +`}),navigator.clipboard.writeText(e).then(Rn("Copied all answers to clipboard."))}}function _C(){if(qt.getValue()==="")Rn("Nothing to copy.");else{let e="";qt.eachLine(t=>{let r=qt.getLineNumber(t);t=t.text.trim(),e+=t?t.match(/^(#|\/\/)/)?`${t} `:`${t} = ${Ve("#output").children[r].innerText} `:` -`}),navigator.clipboard.writeText(e).then(Ln("Copied page to clipboard."))}}_i&&(qt.on("contextmenu",z1e),Pf.on("contextmenu",IC),Rf.on("contextmenu",IC),Ve("#output").addEventListener("contextmenu",U1e),Yn(".textBox").forEach(e=>{e.addEventListener("contextmenu",IC)}),numara.copyLine(H1e),numara.copyAnswer(X$),numara.copyLineWithAnswer(X$),numara.copyAllLines($1e),numara.copyAllAnswers(W1e),numara.copyAll(FC));v();x();g();_r.createUnit("USD",{aliases:["usd"]});function hb(){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=>{_r.createUnit(t[n].code,{aliases:[r.includes(t[n].code.toLowerCase())?"":t[n].code.toLowerCase()],definition:_r.unit(t[n].inverseRate+"USD")},{override:!0}),Gt.set("rateDate",t[n].date)}),Ve("#lastUpdated").innerHTML=Gt.get("rateDate"),qt.setOption("mode",Ge.settings.syntax?"numara":"plain"),Xa()}).catch(t=>{Ve("#lastUpdated").innerHTML="n/a",Ln("Failed to get exchange rates ("+t+")","warning")})):(Ve("#lastUpdated").innerHTML="No internet connection.",Ln("No internet connection. Could not update exchange rates.","warning"))}v();x();g();v();x();g();v();x();g();v();x();g();var K$=(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=K$(...i);n.appendChild(o)}),n},J$=([e,t,r])=>K$(e,t,r);var V1e=e=>Array.from(e.attributes).reduce((t,r)=>(t[r.name]=r.value,t),{}),G1e=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:"",Y1e=e=>e.flatMap(G1e).map(r=>r.trim()).filter(Boolean).filter((r,n,i)=>i.indexOf(r)===n).join(" "),Z1e=e=>e.replace(/(\w)(\w*)(_|-|\s*)/g,(t,r,n)=>r.toUpperCase()+n.toLowerCase()),_C=(e,{nameAttr:t,icons:r,attrs:n})=>{let i=e.getAttribute(t);if(i==null)return;let o=Z1e(i),u=r[o];if(!u)return console.warn(`${e.outerHTML} icon name was not found in the provided icons object.`);let l=V1e(e),[a,s,f]=u,p={...s,"data-lucide":i,...n,...l},h=Y1e(["lucide",`lucide-${i}`,l,n]);h&&Object.assign(p,{class:h});let y=J$([a,p,f]);return e.parentNode?.replaceChild(y,e)};v();x();g();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"};v();x();g();var kC=["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"}]]];v();x();g();var db=["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"}]]];v();x();g();var vb=["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"}]]];v();x();g();var BC=["svg",yr,[["circle",{cx:"12",cy:"12",r:"10"}]]];v();x();g();var LC=["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"}]]];v();x();g();var PC=["svg",yr,[["polyline",{points:"15 10 20 15 15 20"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12"}]]];v();x();g();var RC=["svg",yr,[["circle",{cx:"12.1",cy:"12.1",r:"1"}]]];v();x();g();var qC=["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"}]]];v();x();g();var gb=["svg",yr,[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"12",cy:"5",r:"1"}],["circle",{cx:"12",cy:"19",r:"1"}]]];v();x();g();var zC=["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"}]]];v();x();g();var UC=["svg",yr,[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4"}],["path",{d:"M12 8h.01"}]]];v();x();g();var HC=["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"}]]];v();x();g();var xb=["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"}]]];v();x();g();var yb=["svg",yr,[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}]]];v();x();g();var $C=["svg",yr,[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]]];v();x();g();var WC=["svg",yr,[["polyline",{points:"6 9 6 2 18 2 18 9"}],["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"}],["rect",{width:"12",height:"8",x:"6",y:"14"}]]];v();x();g();var VC=["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"}]]];v();x();g();var GC=["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"}]]];v();x();g();var YC=["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"}]]];v();x();g();var ZC=["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"}]]];v();x();g();var XC=["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 Q$=({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."))}}Mi&&(qt.on("contextmenu",z1e),Lf.on("contextmenu",FC),Pf.on("contextmenu",FC),Ve("#output").addEventListener("contextmenu",U1e),Gn(".textBox").forEach(e=>{e.addEventListener("contextmenu",FC)}),numara.copyLine(H1e),numara.copyAnswer(Z$),numara.copyLineWithAnswer(Z$),numara.copyAllLines($1e),numara.copyAllAnswers(W1e),numara.copyAll(_C));v();x();g();kr.createUnit("USD",{aliases:["usd"]});function gb(){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}),Yt.set("rateDate",t[n].date)}),Ve("#lastUpdated").innerHTML=Yt.get("rateDate"),qt.setOption("mode",Ge.settings.syntax?"numara":"plain"),Za()}).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"))}v();x();g();v();x();g();v();x();g();v();x();g();var X$=(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=X$(...i);n.appendChild(o)}),n},K$=([e,t,r])=>X$(e,t,r);var V1e=e=>Array.from(e.attributes).reduce((t,r)=>(t[r.name]=r.value,t),{}),G1e=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:"",Y1e=e=>e.flatMap(G1e).map(r=>r.trim()).filter(Boolean).filter((r,n,i)=>i.indexOf(r)===n).join(" "),Z1e=e=>e.replace(/(\w)(\w*)(_|-|\s*)/g,(t,r,n)=>r.toUpperCase()+n.toLowerCase()),kC=(e,{nameAttr:t,icons:r,attrs:n})=>{let i=e.getAttribute(t);if(i==null)return;let o=Z1e(i),u=r[o];if(!u)return console.warn(`${e.outerHTML} icon name was not found in the provided icons object.`);let l=V1e(e),[a,s,f]=u,p={...s,"data-lucide":i,...n,...l},h=Y1e(["lucide",`lucide-${i}`,l,n]);h&&Object.assign(p,{class:h});let y=K$([a,p,f]);return e.parentNode?.replaceChild(y,e)};v();x();g();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"};v();x();g();var BC=["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"}]]];v();x();g();var xb=["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"}]]];v();x();g();var yb=["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"}]]];v();x();g();var LC=["svg",yr,[["circle",{cx:"12",cy:"12",r:"10"}]]];v();x();g();var PC=["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"}]]];v();x();g();var RC=["svg",yr,[["polyline",{points:"15 10 20 15 15 20"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12"}]]];v();x();g();var qC=["svg",yr,[["circle",{cx:"12.1",cy:"12.1",r:"1"}]]];v();x();g();var zC=["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"}]]];v();x();g();var wb=["svg",yr,[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"12",cy:"5",r:"1"}],["circle",{cx:"12",cy:"19",r:"1"}]]];v();x();g();var UC=["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"}]]];v();x();g();var HC=["svg",yr,[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4"}],["path",{d:"M12 8h.01"}]]];v();x();g();var $C=["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"}]]];v();x();g();var bb=["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"}]]];v();x();g();var Db=["svg",yr,[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}]]];v();x();g();var WC=["svg",yr,[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]]];v();x();g();var VC=["svg",yr,[["polyline",{points:"6 9 6 2 18 2 18 9"}],["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"}],["rect",{width:"12",height:"8",x:"6",y:"14"}]]];v();x();g();var GC=["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"}]]];v();x();g();var YC=["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"}]]];v();x();g();var ZC=["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"}]]];v();x();g();var XC=["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"}]]];v();x();g();var KC=["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 J$=({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=>_C(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=>_C(o,{nameAttr:"icon-name",icons:e,attrs:r})))}};var X1e={AlertCircle:vb,ArrowUpDown:kC,Braces:db,Circle:BC,Copy:LC,CornerDownRight:PC,Dot:RC,Download:qC,EllipsisVertical:gb,Eraser:zC,Info:UC,ListRestart:HC,PanelLeft:yb,PanelLeftClose:xb,Plus:$C,Printer:WC,Scaling:VC,Settings:GC,Trash:YC,UndoDot:ZC,Upload:XC},zh=()=>{Q$({icons:X1e})};v();x();g();var wb="numara",j$="Numara",eW="Numara Calculator",KC="5.1.0",JC={name:"Timur Atalay",email:"mail@numara.io",url:"https://numara.io"};var bb="https://github.com/bornova/numara-calculator";var Kee=jr(Xee(),1);function oc(){Ve("#plotTitle").innerHTML=Ge.plotFunction;let e=_r.simplify(Ge.plotFunction.split("=")[1],Ge.mathScope).toString(),t=_r.abs(_r.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=Kee.default.default({data:[{derivative:Ge.settings.plotDerivative?{fn:_r.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,Gt.set("settings",Ge.settings),oc()});Ve("#plotDerivativeModal").addEventListener("click",()=>{Ge.settings.plotDerivative=Ve("#plotDerivativeModal").checked,Gt.set("settings",Ge.settings),oc()});Ve("#plotGridModal").addEventListener("click",()=>{Ge.settings.plotGrid=Ve("#plotGridModal").checked,Gt.set("settings",Ge.settings),oc()});Ve("#exportPlot").addEventListener("click",()=>{Ve(".function-plot").setAttribute("xmlns","http://www.w3.org/2000/svg");let e=j$+" 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,oc()});v();x();g();var rN=jr(Qee(),1);function jee(){Ve("#defaultSettingsButton").style.display=rN.default.diff(Ge.settings,pn.defaults)?"inline":"none"}function ete(){Ve("#bigNumWarn").style.display=Ge.settings.numericOutput==="BigNumber"?"inline-block":"none"}function tte(){Ve("#localeWarn").style.display=Rx()?"inline-block":"none"}function rte(e){Ve("#"+e+"Mod").style.display=Ge.settings[e]!==pn.defaults[e]?"inline-block":"none"}function cEe(){rN.default.observableDiff(Ge.settings,pn.defaults,e=>{e.kind!=="E"&&(rN.default.applyChange(Ge.settings,pn.defaults,e),Gt.set("settings",Ge.settings))})}var pn={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=Gt.get("settings"),Ge.settings?cEe():(Ge.settings=Ge.settings=JSON.parse(JSON.stringify(pn.defaults)),Gt.set("settings",pn.defaults)),pn.apply(),Yn(".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]=pn.defaults[n],pn.prep(),pn.save(),pn.apply()}),e.getAttribute("type")==="checkbox"?e.parentElement.before(t):e.before(t),zh()})},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?Gt.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],rte(i))}),qx(),jee(),tte(),ete(),pn.toggleSubs()},apply:()=>{let e=Ge.settings.theme==="system"?_i&&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"?_i&&numara.isDark()?"material-darker":"default":Ge.settings.theme==="light"?"default":"material-darker";Pf.setOption("theme",t),Rf.setOption("theme",t),_i&&(numara.setTheme(Ge.settings.theme),numara.setOnTop(Ge.settings.alwaysOnTop));let r=Yn(".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:pn.defaults.inputWidth)+"%",Ve("#panelDivider").style.display=Ge.settings.divider?"block":"none",Ve("#output").style.textAlign=Ge.settings.divider?"left":"right",qt.setOption("mode",Ge.settings.syntax?"numara":"plain"),qt.setOption("lineNumbers",Ge.settings.lineNumbers),qt.setOption("lineWrapping",Ge.settings.lineWrap),qt.setOption("matchBrackets",Ge.settings.syntax&&Ge.settings.matchBrackets?{maxScanLines:1}:!1),qt.setOption("autoCloseBrackets",Ge.settings.closeBrackets),_r.config({matrix:Ge.settings.matrixType,number:Ge.settings.numericOutput,predictable:Ge.settings.predictable}),setTimeout(Xa,10)},save:()=>{Object.keys(Ge.settings).forEach(e=>{let t=Ve("#"+e);t&&(Ge.settings[e]=t.getAttribute("type")==="checkbox"?t.checked:t.value,rte(e))}),Ve("#currency").checked||(localStorage.removeItem("rateDate"),Ge.currencyRates={}),Ve("#currencyUpdate").style.visibility=Ve("#currency").checked?"visible":"hidden",!Gt.get("rateDate")&&Ge.settings.currency&&hb(),jee(),tte(),ete(),pn.toggleSubs(),Gt.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",()=>{Wm("All settings will revert back to defaults.",()=>{Ge.settings=JSON.parse(JSON.stringify(pn.defaults)),Gt.set("settings",Ge.settings),pn.prep(),pn.save(),pn.apply()})});Ve("#dialog-settings-reset").addEventListener("click",()=>{Wm("All user settings and data will be lost.",()=>{_i?numara.resetApp():(localStorage.clear(),location.reload())})});_i&&Ve("#resetSizeButton").addEventListener("click",numara.resetSize);Ve("#localeWarn").addEventListener("click",()=>{hf("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",()=>{hf("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=>kC(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=>kC(o,{nameAttr:"icon-name",icons:e,attrs:r})))}};var X1e={AlertCircle:yb,ArrowUpDown:BC,Braces:xb,Circle:LC,Copy:PC,CornerDownRight:RC,Dot:qC,Download:zC,EllipsisVertical:wb,Eraser:UC,Info:HC,ListRestart:$C,PanelLeft:Db,PanelLeftClose:bb,Plus:WC,Printer:VC,Scaling:GC,Settings:YC,Trash:ZC,UndoDot:XC,Upload:KC},Ph=()=>{J$({icons:X1e})};v();x();g();var Nb="numara",Q$="Numara",j$="Numara Calculator",JC="5.1.1",QC={name:"Timur Atalay",email:"mail@numara.io",url:"https://numara.io"};var Eb="https://github.com/bornova/numara-calculator";var Xee=en(Zee(),1);function ic(){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=Xee.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,Yt.set("settings",Ge.settings),ic()});Ve("#plotDerivativeModal").addEventListener("click",()=>{Ge.settings.plotDerivative=Ve("#plotDerivativeModal").checked,Yt.set("settings",Ge.settings),ic()});Ve("#plotGridModal").addEventListener("click",()=>{Ge.settings.plotGrid=Ve("#plotGridModal").checked,Yt.set("settings",Ge.settings),ic()});Ve("#exportPlot").addEventListener("click",()=>{Ve(".function-plot").setAttribute("xmlns","http://www.w3.org/2000/svg");let e=Q$+" 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,ic()});v();x();g();var oN=en(Jee(),1);function Qee(){Ve("#defaultSettingsButton").style.display=oN.default.diff(Ge.settings,hn.defaults)?"inline":"none"}function jee(){Ve("#bigNumWarn").style.display=Ge.settings.numericOutput==="BigNumber"?"inline-block":"none"}function ete(){Ve("#localeWarn").style.display=Ux()?"inline-block":"none"}function tte(e){Ve("#"+e+"Mod").style.display=Ge.settings[e]!==hn.defaults[e]?"inline-block":"none"}function cSe(){oN.default.observableDiff(Ge.settings,hn.defaults,e=>{e.kind!=="E"&&(oN.default.applyChange(Ge.settings,hn.defaults,e),Yt.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=Yt.get("settings"),Ge.settings?cSe():(Ge.settings=Ge.settings=JSON.parse(JSON.stringify(hn.defaults)),Yt.set("settings",hn.defaults)),hn.apply(),Gn(".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),Ph()})},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?Yt.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],tte(i))}),Hx(),Qee(),ete(),jee(),hn.toggleSubs()},apply:()=>{let e=Ge.settings.theme==="system"?Mi&&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"?Mi&&numara.isDark()?"material-darker":"default":Ge.settings.theme==="light"?"default":"material-darker";Lf.setOption("theme",t),Pf.setOption("theme",t),Mi&&(numara.setTheme(Ge.settings.theme),numara.setOnTop(Ge.settings.alwaysOnTop));let r=Gn(".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",qt.setOption("mode",Ge.settings.syntax?"numara":"plain"),qt.setOption("lineNumbers",Ge.settings.lineNumbers),qt.setOption("lineWrapping",Ge.settings.lineWrap),qt.setOption("matchBrackets",Ge.settings.syntax&&Ge.settings.matchBrackets?{maxScanLines:1}:!1),qt.setOption("autoCloseBrackets",Ge.settings.closeBrackets),kr.config({matrix:Ge.settings.matrixType,number:Ge.settings.numericOutput,predictable:Ge.settings.predictable}),setTimeout(Za,10)},save:()=>{Object.keys(Ge.settings).forEach(e=>{let t=Ve("#"+e);t&&(Ge.settings[e]=t.getAttribute("type")==="checkbox"?t.checked:t.value,tte(e))}),Ve("#currency").checked||(localStorage.removeItem("rateDate"),Ge.currencyRates={}),Ve("#currencyUpdate").style.visibility=Ve("#currency").checked?"visible":"hidden",!Yt.get("rateDate")&&Ge.settings.currency&&gb(),Qee(),ete(),jee(),hn.toggleSubs(),Yt.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",()=>{Um("All settings will revert back to defaults.",()=>{Ge.settings=JSON.parse(JSON.stringify(hn.defaults)),Yt.set("settings",Ge.settings),hn.prep(),hn.save(),hn.apply()})});Ve("#dialog-settings-reset").addEventListener("click",()=>{Um("All user settings and data will be lost.",()=>{Mi?numara.resetApp():(localStorage.clear(),location.reload())})});Mi&&Ve("#resetSizeButton").addEventListener("click",numara.resetSize);Ve("#localeWarn").addEventListener("click",()=>{mf("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",()=>{mf("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});Yn(".settingItem").forEach(e=>{e.addEventListener("change",()=>{pn.save(),pn.apply()})});v();x();g();var ac=jr(Hm(),1);function nte(){let e=Gt.get("saved"),t=Gt.get("pages");e&&(Object.entries(e).forEach(([r,n])=>{t.push({id:r,name:n[0],data:n[1]})}),Gt.set("pages",t),localStorage.removeItem("saved"))}function v1(){let e=Gt.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;oGt.get("lastPage");function Ol(){let e=Gt.get("pages");(!e||e.length===0)&&g1(),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});Gn(".settingItem").forEach(e=>{e.addEventListener("change",()=>{hn.save(),hn.apply()})});v();x();g();var oc=en(qm(),1);function rte(){let e=Yt.get("saved"),t=Yt.get("pages");e&&(Object.entries(e).forEach(([r,n])=>{t.push({id:r,name:n[0],data:n[1]})}),Yt.set("pages",t),localStorage.removeItem("saved"))}function p1(){let e=Yt.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;oYt.get("lastPage");function Ul(){let e=Yt.get("pages");(!e||e.length===0)&&m1(),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}
      ${Dr.fromFormat(t.id,"yyyyMMddHHmmssSSS").toFormat("FF")}
      @@ -121,13 +121,13 @@ lucide.createIcons({icons});\``);if(typeof document>"u")throw new Error("`create
      Delete
      - `,r.addEventListener("click",n=>{switch(n.target.parentNode.dataset.action==="load"&&(zd(t.id),ac.default.offcanvas("#sidePanel").hide()),n.target.dataset.action){case"rename":ac.default.dropdown(n.target.parentNode).hide(0),mEe(t.id);break;case"delete":pEe(t.id);break;case"duplicate":hEe(t.id);break}}),Ve("#pageList").appendChild(r)}),zh()}function zd(e){let t=Gt.get("pages").find(n=>n.id===e),r=t.cursor;Ge.activePage=e,Gt.set("lastPage",e),Ve("#pageName").innerHTML=t.name,Ve("#pageName").title=t.name,qt.setValue(t.data),t.history&&qt.setHistory(t.history),qt.execCommand("goLineEnd"),r&&(qt.setCursor(r),qt.scrollIntoView(r)),Ol()}function g1(){let e=Dr.local().toFormat("yyyyMMddHHmmssSSS"),t=v1();Gt.set("pages",[{id:e,name:t,data:Gt.get("input")||""}]),localStorage.removeItem("input"),zd(e)}function ite(e){let t=Dr.local().toFormat("yyyyMMddHHmmssSSS"),r=Gt.get("pages"),n=Ve("#newPageTitleInput").value.replace(/<|>/g,"").trim()||(e?"Imported page":v1());if(r.map(o=>o.name).includes(n)){Ln(`"${n}" already exists. Please choose a different page name.`,"danger");return}Ge.activePage=t,r.push({id:t,name:n,data:""}),Gt.set("pages",r),Gt.set("lastPage",t),qt.setValue(""),Ol(),Ve("#pageName").innerHTML=n,ac.default.modal("#dialog-newPage").hide()}function pEe(e){let t=Gt.get("pages");Wm('"'+t.find(r=>r.id===e).name+'" will be deleted.',()=>{t=t.filter(r=>r.id!==e),Gt.set("pages",t),t.length===0?g1():e===Ge.activePage&&zd(t.pop().id),Ol()})}function mEe(e){let t=Gt.get("pages"),r=t.find(i=>i.id===e);Ve("#renamePageTitleInput").value=r.name,mu("#dialog-renamePage");function n(){r.name=Ve("#renamePageTitleInput").value.replace(/<|>/g,"").trim()||v1(),Gt.set("pages",t),Ol(),Ve("#pageName").innerHTML=r.name,ac.default.modal("#dialog-renamePage").hide(),Ve("#dialog-renamePage-save").removeEventListener("click",n)}Ve("#dialog-renamePage-save").addEventListener("click",n)}function hEe(e){let t=Dr.local().toFormat("yyyyMMddHHmmssSSS"),r=Gt.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}),Gt.set("pages",r),zd(t)}function nN(e){let t=Gt.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}Gt.set("pages",r),Ol(),ac.default.dropdown("#sortDropdown").hide(0)}function ote(){let e=Gt.get("pages"),r=[...Yn("#pageList > div")].map(n=>e.find(i=>i.id===n.getAttribute("id")));Gt.set("pages",r)}function dEe(){Wm("All pages will be deleted permanently.",()=>{Gt.set("pages",[]),g1(),Ol()})}function ate(){Ve("#newPageTitleInput").value="",Ve("#newPageTitleInput").focus(),mu("#dialog-newPage")}Ve("#newPageButton").addEventListener("click",ate);Ve("#newPageButtonSP").addEventListener("click",ate);Ve("#dialog-newPage-save").addEventListener("click",()=>{ite(!1)});Ve("#newPageTitleInput").addEventListener("keyup",e=>{(e.key==="Enter"||e.keyCode===13)&&Ve("#dialog-newPage-save").click()});Ve("#deleteAllPagesButton").addEventListener("click",dEe);Ve("#renamePageTitleInput").addEventListener("keyup",e=>{(e.key==="Enter"||e.keyCode===13)&&Ve("#dialog-renamePage-save").click()});Ve("#sortOldNew").addEventListener("click",()=>{nN("oldnew")});Ve("#sortNewOld").addEventListener("click",()=>{nN("newold")});Ve("#sortAZ").addEventListener("click",()=>{nN("az")});Ve("#sortZA").addEventListener("click",()=>{nN("za")});Ve("#closeSidePanelButton").addEventListener("click",()=>{ac.default.offcanvas("#sidePanel").hide()});Ve("#printButton").addEventListener("click",()=>{window.print()});_i?(Ve("#importButton").addEventListener("click",numara.import),numara.importData((e,t,r)=>{ite(!0),qt.setValue(t),Ln(r,"success")}),numara.importDataError((e,t)=>{Ln(t,"danger")}),numara.main.import(numara.import),Ve("#exportButton").addEventListener("click",()=>{let t=Gt.get("pages").find(r=>r.id===Ge.activePage).name;numara.export(t,qt.getValue())}),numara.exportData((e,t)=>{Ln(t,"success")}),numara.exportDataError((e,t)=>{Ln(t,"danger")}),numara.main.export(()=>{numara.export(Ve("#newPageTitleInput").value,qt.getValue())}),numara.main.print(()=>{ac.default.offcanvas("#sidePanel").hide(),window.print()})):Yn("#exportButton, #importButton, #spDivider").forEach(e=>e.remove());v();x();g();var ste=jr(Hm(),1);function x1(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);Gt.set(t==="func"?"udf":"udu",e),Xa(),ste.default.modal("#dialog-udfu").hide()}catch(r){hf(r.name,r.message)}}Ve("#dialog-udfu-save-f").addEventListener("click",()=>{x1(Pf.getValue().trim(),"func")});Ve("#dialog-udfu-save-u").addEventListener("click",()=>{x1(Rf.getValue().trim(),"unit")});var Ma=jr(Hm(),1),pte=jr(ute(),1);v();x();g();(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"&&(Pd(t.id),oc.default.offcanvas("#sidePanel").hide()),n.target.dataset.action){case"rename":oc.default.dropdown(n.target.parentNode).hide(0),mSe(t.id);break;case"delete":pSe(t.id);break;case"duplicate":hSe(t.id);break}}),Ve("#pageList").appendChild(r)}),Ph()}function Pd(e){let t=Yt.get("pages").find(n=>n.id===e),r=t.cursor;Ge.activePage=e,Yt.set("lastPage",e),Ve("#pageName").innerHTML=t.name,Ve("#pageName").title=t.name,qt.setValue(t.data),t.history&&qt.setHistory(t.history),qt.execCommand("goLineEnd"),r&&(qt.setCursor(r),qt.scrollIntoView(r)),Ul()}function m1(){let e=Dr.local().toFormat("yyyyMMddHHmmssSSS"),t=p1();Yt.set("pages",[{id:e,name:t,data:Yt.get("input")||""}]),localStorage.removeItem("input"),Pd(e)}function nte(e){let t=Dr.local().toFormat("yyyyMMddHHmmssSSS"),r=Yt.get("pages"),n=Ve("#newPageTitleInput").value.replace(/<|>/g,"").trim()||(e?"Imported page":p1());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:""}),Yt.set("pages",r),Yt.set("lastPage",t),qt.setValue(""),Ul(),Ve("#pageName").innerHTML=n,oc.default.modal("#dialog-newPage").hide()}function pSe(e){let t=Yt.get("pages");Um('"'+t.find(r=>r.id===e).name+'" will be deleted.',()=>{t=t.filter(r=>r.id!==e),Yt.set("pages",t),t.length===0?m1():e===Ge.activePage&&Pd(t.pop().id),Ul()})}function mSe(e){let t=Yt.get("pages"),r=t.find(i=>i.id===e);Ve("#renamePageTitleInput").value=r.name,yu("#dialog-renamePage");function n(){r.name=Ve("#renamePageTitleInput").value.replace(/<|>/g,"").trim()||p1(),Yt.set("pages",t),Ul(),Ve("#pageName").innerHTML=r.name,oc.default.modal("#dialog-renamePage").hide(),Ve("#dialog-renamePage-save").removeEventListener("click",n)}Ve("#dialog-renamePage-save").addEventListener("click",n)}function hSe(e){let t=Dr.local().toFormat("yyyyMMddHHmmssSSS"),r=Yt.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}),Yt.set("pages",r),Pd(t)}function aN(e){let t=Yt.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}Yt.set("pages",r),Ul(),oc.default.dropdown("#sortDropdown").hide(0)}function ite(){let e=Yt.get("pages"),r=[...Gn("#pageList > div")].map(n=>e.find(i=>i.id===n.getAttribute("id")));Yt.set("pages",r)}function dSe(){Um("All pages will be deleted permanently.",()=>{Yt.set("pages",[]),m1(),Ul()})}function ote(){Ve("#newPageTitleInput").value="",Ve("#newPageTitleInput").focus(),yu("#dialog-newPage")}Ve("#newPageButton").addEventListener("click",ote);Ve("#newPageButtonSP").addEventListener("click",ote);Ve("#dialog-newPage-save").addEventListener("click",()=>{nte(!1)});Ve("#newPageTitleInput").addEventListener("keyup",e=>{(e.key==="Enter"||e.keyCode===13)&&Ve("#dialog-newPage-save").click()});Ve("#deleteAllPagesButton").addEventListener("click",dSe);Ve("#renamePageTitleInput").addEventListener("keyup",e=>{(e.key==="Enter"||e.keyCode===13)&&Ve("#dialog-renamePage-save").click()});Ve("#sortOldNew").addEventListener("click",()=>{aN("oldnew")});Ve("#sortNewOld").addEventListener("click",()=>{aN("newold")});Ve("#sortAZ").addEventListener("click",()=>{aN("az")});Ve("#sortZA").addEventListener("click",()=>{aN("za")});Ve("#closeSidePanelButton").addEventListener("click",()=>{oc.default.offcanvas("#sidePanel").hide()});Ve("#printButton").addEventListener("click",()=>{window.print()});Mi?(Ve("#importButton").addEventListener("click",numara.import),numara.importData((e,t,r)=>{nte(!0),qt.setValue(t),Rn(r,"success")}),numara.importDataError((e,t)=>{Rn(t,"danger")}),numara.main.import(numara.import),Ve("#exportButton").addEventListener("click",()=>{let t=Yt.get("pages").find(r=>r.id===Ge.activePage).name;numara.export(t,qt.getValue())}),numara.exportData((e,t)=>{Rn(t,"success")}),numara.exportDataError((e,t)=>{Rn(t,"danger")}),numara.main.export(()=>{numara.export(Ve("#newPageTitleInput").value,qt.getValue())}),numara.main.print(()=>{oc.default.offcanvas("#sidePanel").hide(),window.print()})):Gn("#exportButton, #importButton, #spDivider").forEach(e=>e.remove());v();x();g();var ate=en(qm(),1);function h1(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);Yt.set(t==="func"?"udf":"udu",e),Za(),ate.default.modal("#dialog-udfu").hide()}catch(r){mf(r.name,r.message)}}Ve("#dialog-udfu-save-f").addEventListener("click",()=>{h1(Lf.getValue().trim(),"func")});Ve("#dialog-udfu-save-u").addEventListener("click",()=>{h1(Pf.getValue().trim(),"unit")});var Sa=en(qm(),1),cte=en(ste(),1);v();x();g();(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",bb);Ve("#webLink").setAttribute("href",JC.url);Ve("#licenseLink").setAttribute("href",bb+"/blob/master/LICENSE");Ve("#helpLink").setAttribute("href",bb+"/wiki");_i?(numara.themeUpdate(pn.apply),numara.fullscreen()):"serviceWorker"in navigator&&navigator.serviceWorker.register("./sw.js").catch(()=>{console.log("Service worker registration failed.")});_i&&!AO?(Ve("#header-mac").remove(),Ve("#header-win").style.display="block",Ve("#header-win-title").innerHTML=wb,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",fS)):(Ve("#header-win").remove(),Ve("#header-mac").style.display="block",Ve("#header-mac-title").innerHTML=wb,_i&&Ve("#header-mac").addEventListener("dblclick",fS));zh();pn.initialize();Ge.settings.currency&&hb();Gt.get("pages")?(Ge.activePage=iO(),zd(iO())):g1();nte();Gt.get("udf")||Gt.set("udf","");Gt.get("udu")||Gt.set("udu","");x1(Gt.get("udf"),"func");x1(Gt.get("udu"),"unit");Ol();Ve("#clearButton").addEventListener("click",()=>{qt.getValue()!==""&&(qt.setValue(""),qt.focus(),Xa())});Ve("#copyButton").addEventListener("click",()=>{FC()});Ve("#udfuButton").addEventListener("click",()=>{mu("#dialog-udfu")});Ve("#settingsButton").addEventListener("click",()=>{mu("#dialog-settings")});Ve("#aboutButton").addEventListener("click",()=>{mu("#dialog-about")});Ve("#output").addEventListener("click",e=>{switch(e.target.className){case"answer":navigator.clipboard.writeText(e.target.dataset.copy),Ln(`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,oc(),mu("#dialog-plot")}catch(r){hf("Error",r)}break}case"lineError":hf("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 lte,sO=!1,fte=Ve("#panel"),oN=Ve("#panelDivider"),mte=()=>{oN.title=Ve("#input").style.width===pn.defaults.inputWidth+"%"?"Drag to resize":"Double click to reset position"};oN.addEventListener("dblclick",()=>{Ge.settings.inputWidth=pn.defaults.inputWidth,Gt.set("settings",Ge.settings),pn.apply(),mte()});oN.addEventListener("mousedown",e=>{sO=e.target===oN});Ve("#panel").addEventListener("mouseup",()=>{sO=!1});Ve("#panel").addEventListener("mousemove",e=>{if(sO){let t=Ge.settings.lineNumbers?12:27,n=(e.clientX-fte.offsetLeft-t)/fte.clientWidth*100,i=n<0?0:n>100?100:n;Ve("#input").style.width=i+"%",Ge.settings.inputWidth=i,Gt.set("settings",Ge.settings),clearTimeout(lte),lte=setTimeout(Xa,10)}mte()});Ma.default.mixin({data:{offset:5}},"tooltip");Ma.default.util.on("#dialog-settings","beforeshow",pn.prep);Ma.default.util.on("#setswitch","beforeshow",e=>{e.stopPropagation()});Ma.default.util.on("#dialog-udfu","shown",()=>{let e=Gt.get("udf").trim(),t=Gt.get("udu").trim();Pf.setValue(e),Rf.setValue(t)});Ma.default.util.on(".uk-switcher","show",()=>{qt.getInputField().blur()});Ma.default.util.on(".modal","hidden",()=>{setTimeout(()=>{qt.focus()},100)});Ma.default.util.on("#dialog-plot","shown",oc);Ma.default.util.on("#dialog-plot","hide",()=>{Ge.activePlot=!1});Ma.default.util.on("#pageList","moved",()=>{ote(),Ol()});Ma.default.util.on("#dialog-newPage","shown",()=>{Ve("#newPageTitleInput").setAttribute("placeholder",v1()),Ve("#newPageTitleInput").focus()});Ma.default.util.on("#dialog-renamePage","shown",()=>{setTimeout(()=>{Ve("#renamePageTitleInput").focus(),Ve("#renamePageTitleInput").select()},20)});Ma.default.util.on("#sidePanel","hidden",()=>{setTimeout(()=>{qt.focus()},20)});document.addEventListener("keydown",e=>{Ge.refreshCM=!e.repeat});document.addEventListener("keyup",()=>{Ge.refreshCM=!0});var cte;window.addEventListener("resize",()=>{Ge.activePlot&&Ve("#dialog-plot").classList.contains("uk-open")&&oc(),clearTimeout(cte),cte=setTimeout(Xa,10),qx()});var oO=!1,aO=!1,aN=Ve(".CodeMirror-scroll"),y1=Ve("#output");aN.addEventListener("scroll",()=>{oO||(aO=!0,y1.scrollTop=aN.scrollTop),oO=!1});y1.addEventListener("scroll",()=>{aO||(oO=!0,aN.scrollTop=y1.scrollTop),aO=!1,Ve("#scrollTop").style.display=y1.scrollTop>50?"block":"none"});Ve("#scrollTop").addEventListener("click",()=>{aN.scrollTop=0,y1.scrollTop=0});var vEe={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(vEe))pte.default.bindGlobal(t,r=>{r.preventDefault(),Yn(".uk-open").length===0?Ve("#"+e).click():Ve("#sidePanel").classList.contains("uk-open")&&!Ve("#dialog-newPage").classList.contains("uk-open")&&Ve("#closeSidePanelButton").click()});CO();Ve("#restartButton").addEventListener("click",()=>{numara.updateApp()});_i&&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=` -
      ${wb}
      + `;Ve("#gitLink").setAttribute("href",Eb);Ve("#webLink").setAttribute("href",QC.url);Ve("#licenseLink").setAttribute("href",Eb+"/blob/master/LICENSE");Ve("#helpLink").setAttribute("href",Eb+"/wiki");Mi?(numara.themeUpdate(hn.apply),numara.fullscreen()):"serviceWorker"in navigator&&navigator.serviceWorker.register("./sw.js").catch(()=>{console.log("Service worker registration failed.")});Mi&&!SO?(Ve("#header-mac").remove(),Ve("#header-win").style.display="block",Ve("#header-win-title").innerHTML=Nb,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",cE)):(Ve("#header-win").remove(),Ve("#header-mac").style.display="block",Ve("#header-mac-title").innerHTML=Nb,Mi&&Ve("#header-mac").addEventListener("dblclick",cE));Ph();hn.initialize();Ge.settings.currency&&gb();Yt.get("pages")?(Ge.activePage=oO(),Pd(oO())):m1();rte();Yt.get("udf")||Yt.set("udf","");Yt.get("udu")||Yt.set("udu","");h1(Yt.get("udf"),"func");h1(Yt.get("udu"),"unit");Ul();Ve("#clearButton").addEventListener("click",()=>{qt.getValue()!==""&&(qt.setValue(""),qt.focus(),Za())});Ve("#copyButton").addEventListener("click",()=>{_C()});Ve("#udfuButton").addEventListener("click",()=>{yu("#dialog-udfu")});Ve("#settingsButton").addEventListener("click",()=>{yu("#dialog-settings")});Ve("#aboutButton").addEventListener("click",()=>{yu("#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,ic(),yu("#dialog-plot")}catch(r){mf("Error",r)}break}case"lineError":mf("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 ute,uO=!1,lte=Ve("#panel"),uN=Ve("#panelDivider"),pte=()=>{uN.title=Ve("#input").style.width===hn.defaults.inputWidth+"%"?"Drag to resize":"Double click to reset position"};uN.addEventListener("dblclick",()=>{Ge.settings.inputWidth=hn.defaults.inputWidth,Yt.set("settings",Ge.settings),hn.apply(),pte()});uN.addEventListener("mousedown",e=>{uO=e.target===uN});Ve("#panel").addEventListener("mouseup",()=>{uO=!1});Ve("#panel").addEventListener("mousemove",e=>{if(uO){let t=Ge.settings.lineNumbers?12:27,n=(e.clientX-lte.offsetLeft-t)/lte.clientWidth*100,i=n<0?0:n>100?100:n;Ve("#input").style.width=i+"%",Ge.settings.inputWidth=i,Yt.set("settings",Ge.settings),clearTimeout(ute),ute=setTimeout(Za,10)}pte()});Sa.default.mixin({data:{offset:5}},"tooltip");Sa.default.util.on("#dialog-settings","beforeshow",hn.prep);Sa.default.util.on("#setswitch","beforeshow",e=>{e.stopPropagation()});Sa.default.util.on("#dialog-udfu","shown",e=>{if(e.target.id==="dialog-udfu"){let t=Yt.get("udf").trim(),r=Yt.get("udu").trim();Lf.setValue(t),Pf.setValue(r)}});Sa.default.util.on("#udfuSwitcher","shown",()=>{qt.getInputField().blur()});Sa.default.util.on(".modal","hidden",()=>{setTimeout(()=>{qt.focus()},100)});Sa.default.util.on("#dialog-plot","shown",ic);Sa.default.util.on("#dialog-plot","hide",()=>{Ge.activePlot=!1});Sa.default.util.on("#pageList","moved",()=>{ite(),Ul()});Sa.default.util.on("#dialog-newPage","shown",()=>{Ve("#newPageTitleInput").setAttribute("placeholder",p1()),Ve("#newPageTitleInput").focus()});Sa.default.util.on("#dialog-renamePage","shown",()=>{setTimeout(()=>{Ve("#renamePageTitleInput").focus(),Ve("#renamePageTitleInput").select()},20)});Sa.default.util.on("#sidePanel","hidden",()=>{setTimeout(()=>{qt.focus()},20)});document.addEventListener("keydown",e=>{Ge.refreshCM=!e.repeat});document.addEventListener("keyup",()=>{Ge.refreshCM=!0});var fte;window.addEventListener("resize",()=>{Ge.activePlot&&Ve("#dialog-plot").classList.contains("uk-open")&&ic(),clearTimeout(fte),fte=setTimeout(Za,10),Hx()});var aO=!1,sO=!1,lN=Ve(".CodeMirror-scroll"),d1=Ve("#output");lN.addEventListener("scroll",()=>{aO||(sO=!0,d1.scrollTop=lN.scrollTop),aO=!1});d1.addEventListener("scroll",()=>{sO||(aO=!0,lN.scrollTop=d1.scrollTop),sO=!1,Ve("#scrollTop").style.display=d1.scrollTop>50?"block":"none"});Ve("#scrollTop").addEventListener("click",()=>{lN.scrollTop=0,d1.scrollTop=0});var vSe={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(vSe))cte.default.bindGlobal(t,r=>{r.preventDefault(),Gn(".uk-open").length===0?Ve("#"+e).click():Ve("#sidePanel").classList.contains("uk-open")&&!Ve("#dialog-newPage").classList.contains("uk-open")&&Ve("#closeSidePanelButton").click()});AO();Ve("#restartButton").addEventListener("click",()=>{numara.updateApp()});Mi&&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=` +
      ${Nb}
      *) uikit/dist/js/uikit.js: - (*! UIkit 3.20.10 | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License *) + (*! UIkit 3.21.1 | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License *) complex.js/complex.js: (** diff --git a/build/js/numara.js.map b/build/js/numara.js.map index 6f8685f..f242c04 100644 --- a/build/js/numara.js.map +++ b/build/js/numara.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../../node_modules/esbuild-plugin-polyfill-node/polyfills/__dirname.js", "../../node_modules/@jspm/core/nodelibs/browser/process.js", "../../node_modules/esbuild-plugin-polyfill-node/polyfills/process.js", "../../node_modules/@jspm/core/nodelibs/browser/buffer.js", "../../node_modules/esbuild-plugin-polyfill-node/polyfills/buffer.js", "../../node_modules/uikit/dist/js/uikit.js", "../../node_modules/typed-function/lib/esm/typed-function.mjs", "../../node_modules/complex.js/complex.js", "../../node_modules/fraction.js/fraction.js", "../../node_modules/javascript-natural-sort/naturalSort.js", "../../node_modules/escape-latex/dist/index.js", "../../node_modules/seedrandom/lib/alea.js", "../../node_modules/seedrandom/lib/xor128.js", "../../node_modules/seedrandom/lib/xorwow.js", "../../node_modules/seedrandom/lib/xorshift7.js", "../../node_modules/seedrandom/lib/xor4096.js", "../../node_modules/seedrandom/lib/tychei.js", "../../node_modules/esbuild-plugin-polyfill-node/polyfills/empty.js", "../../node_modules/seedrandom/seedrandom.js", "../../node_modules/seedrandom/index.js", "../../node_modules/tiny-emitter/index.js", "../../node_modules/jstat/dist/jstat.js", "../../node_modules/bessel/bessel.js", "../../node_modules/codemirror/lib/codemirror.js", "../../node_modules/codemirror/mode/javascript/javascript.js", "../../node_modules/codemirror/addon/dialog/dialog.js", "../../node_modules/codemirror/addon/display/placeholder.js", "../../node_modules/codemirror/addon/edit/closebrackets.js", "../../node_modules/codemirror/addon/edit/matchbrackets.js", "../../node_modules/codemirror/addon/hint/show-hint.js", "../../node_modules/codemirror/addon/search/jump-to-line.js", "../../node_modules/codemirror/addon/search/searchcursor.js", "../../node_modules/codemirror/addon/search/search.js", "../../node_modules/function-plot/src/polyfills.ts", "../../node_modules/d3-shape/src/constant.js", "../../node_modules/d3-shape/src/math.js", "../../node_modules/d3-path/src/path.js", "../../node_modules/d3-path/src/index.js", "../../node_modules/d3-shape/src/path.js", "../../node_modules/d3-shape/src/arc.js", "../../node_modules/d3-shape/src/array.js", "../../node_modules/d3-shape/src/curve/linear.js", "../../node_modules/d3-shape/src/point.js", "../../node_modules/d3-shape/src/line.js", "../../node_modules/d3-shape/src/area.js", "../../node_modules/d3-shape/src/descending.js", "../../node_modules/d3-shape/src/identity.js", "../../node_modules/d3-shape/src/pie.js", "../../node_modules/d3-shape/src/curve/radial.js", "../../node_modules/d3-shape/src/lineRadial.js", "../../node_modules/d3-shape/src/areaRadial.js", "../../node_modules/d3-shape/src/pointRadial.js", "../../node_modules/d3-shape/src/curve/bump.js", "../../node_modules/d3-shape/src/link.js", "../../node_modules/d3-shape/src/symbol/asterisk.js", "../../node_modules/d3-shape/src/symbol/circle.js", "../../node_modules/d3-shape/src/symbol/cross.js", "../../node_modules/d3-shape/src/symbol/diamond.js", "../../node_modules/d3-shape/src/symbol/diamond2.js", "../../node_modules/d3-shape/src/symbol/plus.js", "../../node_modules/d3-shape/src/symbol/square.js", "../../node_modules/d3-shape/src/symbol/square2.js", "../../node_modules/d3-shape/src/symbol/star.js", "../../node_modules/d3-shape/src/symbol/triangle.js", "../../node_modules/d3-shape/src/symbol/triangle2.js", "../../node_modules/d3-shape/src/symbol/wye.js", "../../node_modules/d3-shape/src/symbol/times.js", "../../node_modules/d3-shape/src/symbol.js", "../../node_modules/d3-shape/src/noop.js", "../../node_modules/d3-shape/src/curve/basis.js", "../../node_modules/d3-shape/src/curve/basisClosed.js", "../../node_modules/d3-shape/src/curve/basisOpen.js", "../../node_modules/d3-shape/src/curve/bundle.js", "../../node_modules/d3-shape/src/curve/cardinal.js", "../../node_modules/d3-shape/src/curve/cardinalClosed.js", "../../node_modules/d3-shape/src/curve/cardinalOpen.js", "../../node_modules/d3-shape/src/curve/catmullRom.js", "../../node_modules/d3-shape/src/curve/catmullRomClosed.js", "../../node_modules/d3-shape/src/curve/catmullRomOpen.js", "../../node_modules/d3-shape/src/curve/linearClosed.js", "../../node_modules/d3-shape/src/curve/monotone.js", "../../node_modules/d3-shape/src/curve/natural.js", "../../node_modules/d3-shape/src/curve/step.js", "../../node_modules/d3-shape/src/offset/none.js", "../../node_modules/d3-shape/src/order/none.js", "../../node_modules/d3-shape/src/stack.js", "../../node_modules/d3-shape/src/offset/expand.js", "../../node_modules/d3-shape/src/offset/diverging.js", "../../node_modules/d3-shape/src/offset/silhouette.js", "../../node_modules/d3-shape/src/offset/wiggle.js", "../../node_modules/d3-shape/src/order/appearance.js", "../../node_modules/d3-shape/src/order/ascending.js", "../../node_modules/d3-shape/src/order/descending.js", "../../node_modules/d3-shape/src/order/insideOut.js", "../../node_modules/d3-shape/src/order/reverse.js", "../../node_modules/d3-shape/src/index.js", "../../node_modules/d3-format/src/formatDecimal.js", "../../node_modules/d3-format/src/exponent.js", "../../node_modules/d3-format/src/formatGroup.js", "../../node_modules/d3-format/src/formatNumerals.js", "../../node_modules/d3-format/src/formatSpecifier.js", "../../node_modules/d3-format/src/formatTrim.js", "../../node_modules/d3-format/src/formatPrefixAuto.js", "../../node_modules/d3-format/src/formatRounded.js", "../../node_modules/d3-format/src/formatTypes.js", "../../node_modules/d3-format/src/identity.js", "../../node_modules/d3-format/src/locale.js", "../../node_modules/d3-format/src/defaultLocale.js", "../../node_modules/d3-format/src/precisionFixed.js", "../../node_modules/d3-format/src/precisionPrefix.js", "../../node_modules/d3-format/src/precisionRound.js", "../../node_modules/d3-format/src/index.js", "../../node_modules/d3-array/src/ascending.js", "../../node_modules/d3-array/src/descending.js", "../../node_modules/d3-array/src/bisector.js", "../../node_modules/d3-array/src/number.js", "../../node_modules/d3-array/src/bisect.js", "../../node_modules/internmap/src/index.js", "../../node_modules/d3-array/src/sort.js", "../../node_modules/d3-array/src/ticks.js", "../../node_modules/d3-array/src/max.js", "../../node_modules/d3-array/src/min.js", "../../node_modules/d3-array/src/quickselect.js", "../../node_modules/d3-array/src/quantile.js", "../../node_modules/d3-array/src/range.js", "../../node_modules/d3-array/src/index.js", "../../node_modules/d3-scale/src/init.js", "../../node_modules/d3-scale/src/ordinal.js", "../../node_modules/d3-scale/src/band.js", "../../node_modules/d3-color/src/define.js", "../../node_modules/d3-color/src/color.js", "../../node_modules/d3-color/src/math.js", "../../node_modules/d3-color/src/lab.js", "../../node_modules/d3-color/src/cubehelix.js", "../../node_modules/d3-color/src/index.js", "../../node_modules/d3-interpolate/src/basis.js", "../../node_modules/d3-interpolate/src/basisClosed.js", "../../node_modules/d3-interpolate/src/constant.js", "../../node_modules/d3-interpolate/src/color.js", "../../node_modules/d3-interpolate/src/rgb.js", "../../node_modules/d3-interpolate/src/numberArray.js", "../../node_modules/d3-interpolate/src/array.js", "../../node_modules/d3-interpolate/src/date.js", "../../node_modules/d3-interpolate/src/number.js", "../../node_modules/d3-interpolate/src/object.js", "../../node_modules/d3-interpolate/src/string.js", "../../node_modules/d3-interpolate/src/value.js", "../../node_modules/d3-interpolate/src/discrete.js", "../../node_modules/d3-interpolate/src/hue.js", "../../node_modules/d3-interpolate/src/round.js", "../../node_modules/d3-interpolate/src/transform/decompose.js", "../../node_modules/d3-interpolate/src/transform/parse.js", "../../node_modules/d3-interpolate/src/transform/index.js", "../../node_modules/d3-interpolate/src/zoom.js", "../../node_modules/d3-interpolate/src/hsl.js", "../../node_modules/d3-interpolate/src/lab.js", "../../node_modules/d3-interpolate/src/hcl.js", "../../node_modules/d3-interpolate/src/cubehelix.js", "../../node_modules/d3-interpolate/src/piecewise.js", "../../node_modules/d3-interpolate/src/quantize.js", "../../node_modules/d3-interpolate/src/index.js", "../../node_modules/d3-scale/src/constant.js", "../../node_modules/d3-scale/src/number.js", "../../node_modules/d3-scale/src/continuous.js", "../../node_modules/d3-scale/src/tickFormat.js", "../../node_modules/d3-scale/src/linear.js", "../../node_modules/d3-scale/src/identity.js", "../../node_modules/d3-scale/src/nice.js", "../../node_modules/d3-scale/src/log.js", "../../node_modules/d3-scale/src/symlog.js", "../../node_modules/d3-scale/src/pow.js", "../../node_modules/d3-scale/src/radial.js", "../../node_modules/d3-scale/src/quantile.js", "../../node_modules/d3-scale/src/quantize.js", "../../node_modules/d3-scale/src/threshold.js", "../../node_modules/d3-time/src/interval.js", "../../node_modules/d3-time/src/millisecond.js", "../../node_modules/d3-time/src/second.js", "../../node_modules/d3-time/src/minute.js", "../../node_modules/d3-time/src/hour.js", "../../node_modules/d3-time/src/day.js", "../../node_modules/d3-time/src/week.js", "../../node_modules/d3-time/src/month.js", "../../node_modules/d3-time/src/year.js", "../../node_modules/d3-time/src/ticks.js", "../../node_modules/d3-time/src/index.js", "../../node_modules/d3-time-format/src/locale.js", "../../node_modules/d3-time-format/src/defaultLocale.js", "../../node_modules/d3-time-format/src/index.js", "../../node_modules/d3-scale/src/time.js", "../../node_modules/d3-scale/src/utcTime.js", "../../node_modules/d3-scale/src/sequential.js", "../../node_modules/d3-scale/src/sequentialQuantile.js", "../../node_modules/d3-scale/src/diverging.js", "../../node_modules/d3-scale/src/index.js", "../../node_modules/d3-axis/src/identity.js", "../../node_modules/d3-axis/src/axis.js", "../../node_modules/d3-axis/src/index.js", "../../node_modules/d3-dispatch/src/dispatch.js", "../../node_modules/d3-dispatch/src/index.js", "../../node_modules/d3-selection/src/namespaces.js", "../../node_modules/d3-selection/src/namespace.js", "../../node_modules/d3-selection/src/creator.js", "../../node_modules/d3-selection/src/selector.js", "../../node_modules/d3-selection/src/selection/select.js", "../../node_modules/d3-selection/src/array.js", "../../node_modules/d3-selection/src/selectorAll.js", "../../node_modules/d3-selection/src/selection/selectAll.js", "../../node_modules/d3-selection/src/matcher.js", "../../node_modules/d3-selection/src/selection/selectChild.js", "../../node_modules/d3-selection/src/selection/selectChildren.js", "../../node_modules/d3-selection/src/selection/filter.js", "../../node_modules/d3-selection/src/selection/sparse.js", "../../node_modules/d3-selection/src/selection/enter.js", "../../node_modules/d3-selection/src/constant.js", "../../node_modules/d3-selection/src/selection/data.js", "../../node_modules/d3-selection/src/selection/exit.js", "../../node_modules/d3-selection/src/selection/join.js", "../../node_modules/d3-selection/src/selection/merge.js", "../../node_modules/d3-selection/src/selection/order.js", "../../node_modules/d3-selection/src/selection/sort.js", "../../node_modules/d3-selection/src/selection/call.js", "../../node_modules/d3-selection/src/selection/nodes.js", "../../node_modules/d3-selection/src/selection/node.js", "../../node_modules/d3-selection/src/selection/size.js", "../../node_modules/d3-selection/src/selection/empty.js", "../../node_modules/d3-selection/src/selection/each.js", "../../node_modules/d3-selection/src/selection/attr.js", "../../node_modules/d3-selection/src/window.js", "../../node_modules/d3-selection/src/selection/style.js", "../../node_modules/d3-selection/src/selection/property.js", "../../node_modules/d3-selection/src/selection/classed.js", "../../node_modules/d3-selection/src/selection/text.js", "../../node_modules/d3-selection/src/selection/html.js", "../../node_modules/d3-selection/src/selection/raise.js", "../../node_modules/d3-selection/src/selection/lower.js", "../../node_modules/d3-selection/src/selection/append.js", "../../node_modules/d3-selection/src/selection/insert.js", "../../node_modules/d3-selection/src/selection/remove.js", "../../node_modules/d3-selection/src/selection/clone.js", "../../node_modules/d3-selection/src/selection/datum.js", "../../node_modules/d3-selection/src/selection/on.js", "../../node_modules/d3-selection/src/selection/dispatch.js", "../../node_modules/d3-selection/src/selection/iterator.js", "../../node_modules/d3-selection/src/selection/index.js", "../../node_modules/d3-selection/src/select.js", "../../node_modules/d3-selection/src/create.js", "../../node_modules/d3-selection/src/local.js", "../../node_modules/d3-selection/src/sourceEvent.js", "../../node_modules/d3-selection/src/pointer.js", "../../node_modules/d3-selection/src/pointers.js", "../../node_modules/d3-selection/src/selectAll.js", "../../node_modules/d3-selection/src/index.js", "../../node_modules/d3-drag/src/noevent.js", "../../node_modules/d3-drag/src/nodrag.js", "../../node_modules/d3-drag/src/index.js", "../../node_modules/d3-timer/src/timer.js", "../../node_modules/d3-timer/src/timeout.js", "../../node_modules/d3-timer/src/index.js", "../../node_modules/d3-transition/src/transition/schedule.js", "../../node_modules/d3-transition/src/interrupt.js", "../../node_modules/d3-transition/src/selection/interrupt.js", "../../node_modules/d3-transition/src/transition/tween.js", "../../node_modules/d3-transition/src/transition/interpolate.js", "../../node_modules/d3-transition/src/transition/attr.js", "../../node_modules/d3-transition/src/transition/attrTween.js", "../../node_modules/d3-transition/src/transition/delay.js", "../../node_modules/d3-transition/src/transition/duration.js", "../../node_modules/d3-transition/src/transition/ease.js", "../../node_modules/d3-transition/src/transition/easeVarying.js", "../../node_modules/d3-transition/src/transition/filter.js", "../../node_modules/d3-transition/src/transition/merge.js", "../../node_modules/d3-transition/src/transition/on.js", "../../node_modules/d3-transition/src/transition/remove.js", "../../node_modules/d3-transition/src/transition/select.js", "../../node_modules/d3-transition/src/transition/selectAll.js", "../../node_modules/d3-transition/src/transition/selection.js", "../../node_modules/d3-transition/src/transition/style.js", "../../node_modules/d3-transition/src/transition/styleTween.js", "../../node_modules/d3-transition/src/transition/text.js", "../../node_modules/d3-transition/src/transition/textTween.js", "../../node_modules/d3-transition/src/transition/transition.js", "../../node_modules/d3-transition/src/transition/end.js", "../../node_modules/d3-transition/src/transition/index.js", "../../node_modules/d3-ease/src/cubic.js", "../../node_modules/d3-ease/src/index.js", "../../node_modules/d3-transition/src/selection/transition.js", "../../node_modules/d3-transition/src/selection/index.js", "../../node_modules/d3-transition/src/index.js", "../../node_modules/d3-zoom/src/constant.js", "../../node_modules/d3-zoom/src/event.js", "../../node_modules/d3-zoom/src/transform.js", "../../node_modules/d3-zoom/src/noevent.js", "../../node_modules/d3-zoom/src/zoom.js", "../../node_modules/d3-zoom/src/index.js", "../../node_modules/@jspm/core/nodelibs/browser/chunk-4bd36a8f.js", "../../node_modules/@jspm/core/nodelibs/browser/events.js", "../../node_modules/function-plot/src/helpers/annotations.ts", "../../node_modules/function-plot/src/globals.ts", "../../node_modules/function-plot/src/utils.ts", "../../node_modules/mr-parser/lib/token-type.js", "../../node_modules/mr-parser/lib/Lexer.js", "../../node_modules/mr-parser/lib/node/Node.js", "../../node_modules/mr-parser/lib/node/ConstantNode.js", "../../node_modules/mr-parser/lib/node/OperatorNode.js", "../../node_modules/mr-parser/lib/node/UnaryNode.js", "../../node_modules/mr-parser/lib/node/SymbolNode.js", "../../node_modules/mr-parser/lib/node/FunctionNode.js", "../../node_modules/mr-parser/lib/node/ArrayNode.js", "../../node_modules/mr-parser/lib/node/ConditionalNode.js", "../../node_modules/mr-parser/lib/node/AssignmentNode.js", "../../node_modules/mr-parser/lib/node/BlockNode.js", "../../node_modules/mr-parser/lib/Parser.js", "../../node_modules/mr-parser/lib/node/index.js", "../../node_modules/mr-parser/index.js", "../../node_modules/extend/index.js", "../../node_modules/math-codegen/lib/node/ArrayNode.js", "../../node_modules/math-codegen/lib/node/AssignmentNode.js", "../../node_modules/math-codegen/lib/node/ConditionalNode.js", "../../node_modules/math-codegen/lib/node/ConstantNode.js", "../../node_modules/math-codegen/lib/node/FunctionNode.js", "../../node_modules/math-codegen/lib/misc/Operators.js", "../../node_modules/math-codegen/lib/node/OperatorNode.js", "../../node_modules/math-codegen/lib/node/SymbolNode.js", "../../node_modules/math-codegen/lib/misc/UnaryOperators.js", "../../node_modules/math-codegen/lib/node/UnaryNode.js", "../../node_modules/math-codegen/lib/Interpreter.js", "../../node_modules/math-codegen/lib/CodeGenerator.js", "../../node_modules/math-codegen/index.js", "../../node_modules/built-in-math-eval/lib/adapter.js", "../../node_modules/built-in-math-eval/lib/eval.js", "../../node_modules/built-in-math-eval/index.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/node/ArrayNode.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/node/AssignmentNode.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/node/ConditionalNode.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/node/ConstantNode.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/node/FunctionNode.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/misc/Operators.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/node/OperatorNode.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/node/SymbolNode.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/misc/UnaryOperators.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/node/UnaryNode.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/Interpreter.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/lib/CodeGenerator.js", "../../node_modules/interval-arithmetic-eval/node_modules/math-codegen/index.js", "../../node_modules/interval-arithmetic/src/operations/utils.ts", "../../node_modules/double-bits/double.js", "../../node_modules/nextafter/nextafter.js", "../../node_modules/interval-arithmetic/src/round.ts", "../../node_modules/interval-arithmetic/src/interval.ts", "../../node_modules/interval-arithmetic/src/constants.ts", "../../node_modules/interval-arithmetic/src/operations/relational.ts", "../../node_modules/interval-arithmetic/src/operations/division.ts", "../../node_modules/interval-arithmetic/src/operations/arithmetic.ts", "../../node_modules/interval-arithmetic/src/operations/algebra.ts", "../../node_modules/interval-arithmetic/src/operations/misc.ts", "../../node_modules/interval-arithmetic/src/operations/trigonometric.ts", "../../node_modules/interval-arithmetic/src/index.ts", "../../node_modules/interval-arithmetic-eval/lib/adapter.js", "../../node_modules/interval-arithmetic-eval/lib/policies.js", "../../node_modules/interval-arithmetic-eval/lib/eval.js", "../../node_modules/interval-arithmetic-eval/index.js", "../../node_modules/function-plot/src/helpers/eval.ts", "../../node_modules/function-plot/src/tip.ts", "../../node_modules/function-plot/src/samplers/interval.ts", "../../node_modules/function-plot/src/samplers/builtIn.ts", "../../node_modules/function-plot/src/evaluate.ts", "../../node_modules/function-plot/src/graph-types/polyline.ts", "../../node_modules/function-plot/src/graph-types/interval.ts", "../../node_modules/function-plot/src/graph-types/scatter.ts", "../../node_modules/function-plot/src/graph-types/text.ts", "../../node_modules/function-plot/src/graph-types/index.ts", "../../node_modules/function-plot/src/datum-defaults.ts", "../../node_modules/function-plot/src/helpers/derivative.ts", "../../node_modules/function-plot/src/helpers/secant.ts", "../../node_modules/function-plot/src/helpers/index.ts", "../../node_modules/function-plot/src/chart.ts", "../../node_modules/function-plot/dist/types.js", "../../node_modules/function-plot/src/index.ts", "../../node_modules/deep-diff/index.js", "../../node_modules/mousetrap/mousetrap.js", "../../src/js/app.js", "../../src/js/common.js", "../../src/js/context.js", "../../src/js/editor.js", "../../src/js/eval.js", "../../src/js/utils.js", "../../src/js/modal.js", "../../node_modules/luxon/src/luxon.js", "../../node_modules/luxon/src/datetime.js", "../../node_modules/luxon/src/duration.js", "../../node_modules/luxon/src/errors.js", "../../node_modules/luxon/src/impl/formatter.js", "../../node_modules/luxon/src/impl/english.js", "../../node_modules/luxon/src/impl/formats.js", "../../node_modules/luxon/src/impl/util.js", "../../node_modules/luxon/src/settings.js", "../../node_modules/luxon/src/zones/systemZone.js", "../../node_modules/luxon/src/zone.js", "../../node_modules/luxon/src/zones/IANAZone.js", "../../node_modules/luxon/src/impl/locale.js", "../../node_modules/luxon/src/impl/zoneUtil.js", "../../node_modules/luxon/src/zones/fixedOffsetZone.js", "../../node_modules/luxon/src/zones/invalidZone.js", "../../node_modules/luxon/src/impl/conversions.js", "../../node_modules/luxon/src/impl/invalid.js", "../../node_modules/luxon/src/impl/regexParser.js", "../../node_modules/luxon/src/interval.js", "../../node_modules/luxon/src/info.js", "../../node_modules/luxon/src/impl/diff.js", "../../node_modules/luxon/src/impl/tokenParser.js", "../../node_modules/luxon/src/impl/digits.js", "../../node_modules/mathjs/lib/esm/entry/mainAny.js", "../../node_modules/@babel/runtime/helpers/esm/extends.js", "../../node_modules/mathjs/lib/esm/core/config.js", "../../node_modules/mathjs/lib/esm/core/function/config.js", "../../node_modules/mathjs/lib/esm/utils/object.js", "../../node_modules/mathjs/lib/esm/utils/is.js", "../../node_modules/mathjs/lib/esm/factoriesAny.js", "../../node_modules/mathjs/lib/esm/core/function/typed.js", "../../node_modules/mathjs/lib/esm/utils/number.js", "../../node_modules/mathjs/lib/esm/utils/factory.js", "../../node_modules/mathjs/lib/esm/utils/array.js", "../../node_modules/mathjs/lib/esm/utils/string.js", "../../node_modules/mathjs/lib/esm/utils/bignumber/formatter.js", "../../node_modules/mathjs/lib/esm/error/DimensionError.js", "../../node_modules/mathjs/lib/esm/error/IndexError.js", "../../node_modules/mathjs/lib/esm/utils/map.js", "../../node_modules/mathjs/lib/esm/utils/customs.js", "../../node_modules/mathjs/lib/esm/type/resultset/ResultSet.js", "../../node_modules/mathjs/lib/esm/type/bignumber/BigNumber.js", "../../node_modules/decimal.js/decimal.mjs", "../../node_modules/mathjs/lib/esm/type/complex/Complex.js", "../../node_modules/mathjs/lib/esm/type/fraction/Fraction.js", "../../node_modules/mathjs/lib/esm/type/matrix/Range.js", "../../node_modules/mathjs/lib/esm/type/matrix/Matrix.js", "../../node_modules/mathjs/lib/esm/type/matrix/DenseMatrix.js", "../../node_modules/mathjs/lib/esm/utils/function.js", "../../node_modules/mathjs/lib/esm/utils/lruQueue.js", "../../node_modules/mathjs/lib/esm/function/utils/clone.js", "../../node_modules/mathjs/lib/esm/function/utils/isInteger.js", "../../node_modules/mathjs/lib/esm/utils/collection.js", "../../node_modules/mathjs/lib/esm/utils/switch.js", "../../node_modules/mathjs/lib/esm/function/utils/isNegative.js", "../../node_modules/mathjs/lib/esm/plain/number/arithmetic.js", "../../node_modules/mathjs/lib/esm/plain/number/bitwise.js", "../../node_modules/mathjs/lib/esm/plain/number/combinations.js", "../../node_modules/mathjs/lib/esm/utils/product.js", "../../node_modules/mathjs/lib/esm/plain/number/constants.js", "../../node_modules/mathjs/lib/esm/plain/number/logical.js", "../../node_modules/mathjs/lib/esm/plain/number/probability.js", "../../node_modules/mathjs/lib/esm/plain/number/trigonometry.js", "../../node_modules/mathjs/lib/esm/plain/number/utils.js", "../../node_modules/mathjs/lib/esm/function/utils/isNumeric.js", "../../node_modules/mathjs/lib/esm/function/utils/hasNumericValue.js", "../../node_modules/mathjs/lib/esm/function/utils/isPositive.js", "../../node_modules/mathjs/lib/esm/function/utils/isZero.js", "../../node_modules/mathjs/lib/esm/function/utils/isNaN.js", "../../node_modules/mathjs/lib/esm/function/utils/typeOf.js", "../../node_modules/mathjs/lib/esm/function/relational/equalScalar.js", "../../node_modules/mathjs/lib/esm/utils/bignumber/nearlyEqual.js", "../../node_modules/mathjs/lib/esm/utils/complex.js", "../../node_modules/mathjs/lib/esm/function/relational/compareUnits.js", "../../node_modules/mathjs/lib/esm/type/matrix/SparseMatrix.js", "../../node_modules/mathjs/lib/esm/type/number.js", "../../node_modules/mathjs/lib/esm/type/string.js", "../../node_modules/mathjs/lib/esm/type/boolean.js", "../../node_modules/mathjs/lib/esm/type/bignumber/function/bignumber.js", "../../node_modules/mathjs/lib/esm/type/complex/function/complex.js", "../../node_modules/mathjs/lib/esm/type/fraction/function/fraction.js", "../../node_modules/mathjs/lib/esm/type/matrix/function/matrix.js", "../../node_modules/mathjs/lib/esm/function/matrix/matrixFromFunction.js", "../../node_modules/mathjs/lib/esm/function/matrix/matrixFromRows.js", "../../node_modules/mathjs/lib/esm/function/matrix/matrixFromColumns.js", "../../node_modules/mathjs/lib/esm/type/unit/function/splitUnit.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/unaryMinus.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/unaryPlus.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/abs.js", "../../node_modules/mathjs/lib/esm/function/matrix/apply.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/addScalar.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/subtractScalar.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/cbrt.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/ceil.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo11xS0s.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo12xSfs.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo14xDs.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/cube.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/exp.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/expm1.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/fix.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/floor.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/gcd.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/mod.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo02xDS0.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo03xDSf.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo05xSfSf.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matrixAlgorithmSuite.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo13xDD.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/broadcast.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo01xDSid.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo04xSidSid.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo10xSids.js", "../../node_modules/mathjs/lib/esm/error/ArgumentsError.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/lcm.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo06xS0S0.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/log10.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/log2.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/multiplyScalar.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/multiply.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/nthRoot.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/sign.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/sqrt.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/square.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/subtract.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/xgcd.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/invmod.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/dotMultiply.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo09xS0Sf.js", "../../node_modules/mathjs/lib/esm/function/bitwise/bitAnd.js", "../../node_modules/mathjs/lib/esm/utils/bignumber/bitwise.js", "../../node_modules/mathjs/lib/esm/function/bitwise/bitNot.js", "../../node_modules/mathjs/lib/esm/function/bitwise/bitOr.js", "../../node_modules/mathjs/lib/esm/function/bitwise/bitXor.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo07xSSf.js", "../../node_modules/mathjs/lib/esm/function/complex/arg.js", "../../node_modules/mathjs/lib/esm/function/complex/conj.js", "../../node_modules/mathjs/lib/esm/function/complex/im.js", "../../node_modules/mathjs/lib/esm/function/complex/re.js", "../../node_modules/mathjs/lib/esm/function/logical/not.js", "../../node_modules/mathjs/lib/esm/function/logical/or.js", "../../node_modules/mathjs/lib/esm/function/logical/xor.js", "../../node_modules/mathjs/lib/esm/function/matrix/concat.js", "../../node_modules/mathjs/lib/esm/function/matrix/column.js", "../../node_modules/mathjs/lib/esm/function/matrix/count.js", "../../node_modules/mathjs/lib/esm/function/matrix/cross.js", "../../node_modules/mathjs/lib/esm/function/matrix/diag.js", "../../node_modules/mathjs/lib/esm/function/matrix/filter.js", "../../node_modules/mathjs/lib/esm/utils/applyCallback.js", "../../node_modules/mathjs/lib/esm/function/matrix/flatten.js", "../../node_modules/mathjs/lib/esm/function/matrix/forEach.js", "../../node_modules/mathjs/lib/esm/function/matrix/getMatrixDataType.js", "../../node_modules/mathjs/lib/esm/function/matrix/identity.js", "../../node_modules/mathjs/lib/esm/function/matrix/kron.js", "../../node_modules/mathjs/lib/esm/function/matrix/map.js", "../../node_modules/mathjs/lib/esm/function/matrix/diff.js", "../../node_modules/mathjs/lib/esm/function/matrix/ones.js", "../../node_modules/mathjs/lib/esm/function/matrix/range.js", "../../node_modules/mathjs/lib/esm/utils/noop.js", "../../node_modules/mathjs/lib/esm/function/matrix/reshape.js", "../../node_modules/mathjs/lib/esm/function/matrix/resize.js", "../../node_modules/mathjs/lib/esm/function/matrix/rotate.js", "../../node_modules/mathjs/lib/esm/function/matrix/rotationMatrix.js", "../../node_modules/mathjs/lib/esm/function/matrix/row.js", "../../node_modules/mathjs/lib/esm/function/matrix/size.js", "../../node_modules/mathjs/lib/esm/function/matrix/squeeze.js", "../../node_modules/mathjs/lib/esm/function/matrix/subset.js", "../../node_modules/mathjs/lib/esm/function/matrix/transpose.js", "../../node_modules/mathjs/lib/esm/function/matrix/ctranspose.js", "../../node_modules/mathjs/lib/esm/function/matrix/zeros.js", "../../node_modules/mathjs/lib/esm/function/matrix/fft.js", "../../node_modules/mathjs/lib/esm/function/matrix/ifft.js", "../../node_modules/mathjs/lib/esm/function/numeric/solveODE.js", "../../node_modules/@babel/runtime/helpers/esm/defineProperty.js", "../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js", "../../node_modules/@babel/runtime/helpers/esm/typeof.js", "../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js", "../../node_modules/mathjs/lib/esm/function/special/erf.js", "../../node_modules/mathjs/lib/esm/function/special/zeta.js", "../../node_modules/mathjs/lib/esm/function/statistics/mode.js", "../../node_modules/mathjs/lib/esm/function/statistics/prod.js", "../../node_modules/mathjs/lib/esm/function/statistics/utils/improveErrorMessage.js", "../../node_modules/mathjs/lib/esm/function/string/format.js", "../../node_modules/mathjs/lib/esm/function/string/bin.js", "../../node_modules/mathjs/lib/esm/function/string/oct.js", "../../node_modules/mathjs/lib/esm/function/string/hex.js", "../../node_modules/mathjs/lib/esm/function/string/print.js", "../../node_modules/mathjs/lib/esm/utils/print.js", "../../node_modules/mathjs/lib/esm/function/unit/to.js", "../../node_modules/mathjs/lib/esm/function/utils/isPrime.js", "../../node_modules/mathjs/lib/esm/function/utils/numeric.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/divideScalar.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/pow.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/round.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/log.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/log1p.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/nthRoots.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/dotPow.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/dotDivide.js", "../../node_modules/mathjs/lib/esm/function/algebra/solver/lsolve.js", "../../node_modules/mathjs/lib/esm/function/algebra/solver/utils/solveValidation.js", "../../node_modules/mathjs/lib/esm/function/algebra/solver/usolve.js", "../../node_modules/mathjs/lib/esm/function/algebra/solver/lsolveAll.js", "../../node_modules/mathjs/lib/esm/function/algebra/solver/usolveAll.js", "../../node_modules/mathjs/lib/esm/function/bitwise/leftShift.js", "../../node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo08xS0Sid.js", "../../node_modules/mathjs/lib/esm/function/bitwise/useMatrixForArrayScalar.js", "../../node_modules/mathjs/lib/esm/function/bitwise/rightArithShift.js", "../../node_modules/mathjs/lib/esm/function/bitwise/rightLogShift.js", "../../node_modules/mathjs/lib/esm/function/logical/and.js", "../../node_modules/mathjs/lib/esm/function/relational/compare.js", "../../node_modules/mathjs/lib/esm/function/relational/compareNatural.js", "../../node_modules/mathjs/lib/esm/function/relational/compareText.js", "../../node_modules/mathjs/lib/esm/function/relational/equal.js", "../../node_modules/mathjs/lib/esm/function/relational/equalText.js", "../../node_modules/mathjs/lib/esm/function/relational/smaller.js", "../../node_modules/mathjs/lib/esm/function/relational/smallerEq.js", "../../node_modules/mathjs/lib/esm/function/relational/larger.js", "../../node_modules/mathjs/lib/esm/function/relational/largerEq.js", "../../node_modules/mathjs/lib/esm/function/relational/deepEqual.js", "../../node_modules/mathjs/lib/esm/function/relational/unequal.js", "../../node_modules/mathjs/lib/esm/function/matrix/partitionSelect.js", "../../node_modules/mathjs/lib/esm/function/matrix/sort.js", "../../node_modules/mathjs/lib/esm/function/statistics/max.js", "../../node_modules/mathjs/lib/esm/function/statistics/min.js", "../../node_modules/mathjs/lib/esm/type/matrix/ImmutableDenseMatrix.js", "../../node_modules/mathjs/lib/esm/type/matrix/MatrixIndex.js", "../../node_modules/mathjs/lib/esm/type/matrix/FibonacciHeap.js", "../../node_modules/mathjs/lib/esm/type/matrix/Spa.js", "../../node_modules/mathjs/lib/esm/type/unit/Unit.js", "../../node_modules/mathjs/lib/esm/utils/bignumber/constants.js", "../../node_modules/mathjs/lib/esm/type/unit/function/unit.js", "../../node_modules/mathjs/lib/esm/type/matrix/function/sparse.js", "../../node_modules/mathjs/lib/esm/type/unit/function/createUnit.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/acos.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/acosh.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/acot.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/acoth.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/acsc.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/acsch.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/asec.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/asech.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/asin.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/asinh.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/atan.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/atan2.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/atanh.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/cos.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/trigUnit.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/cosh.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/cot.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/coth.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/csc.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/csch.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/sec.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/sech.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/sin.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/sinh.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/tan.js", "../../node_modules/mathjs/lib/esm/function/trigonometry/tanh.js", "../../node_modules/mathjs/lib/esm/function/set/setCartesian.js", "../../node_modules/mathjs/lib/esm/function/set/setDifference.js", "../../node_modules/mathjs/lib/esm/function/set/setDistinct.js", "../../node_modules/mathjs/lib/esm/function/set/setIntersect.js", "../../node_modules/mathjs/lib/esm/function/set/setIsSubset.js", "../../node_modules/mathjs/lib/esm/function/set/setMultiplicity.js", "../../node_modules/mathjs/lib/esm/function/set/setPowerset.js", "../../node_modules/mathjs/lib/esm/function/set/setSize.js", "../../node_modules/mathjs/lib/esm/function/set/setSymDifference.js", "../../node_modules/mathjs/lib/esm/function/set/setUnion.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/add.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/hypot.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/norm.js", "../../node_modules/mathjs/lib/esm/function/matrix/dot.js", "../../node_modules/mathjs/lib/esm/function/matrix/trace.js", "../../node_modules/mathjs/lib/esm/type/matrix/function/index.js", "../../node_modules/mathjs/lib/esm/expression/node/Node.js", "../../node_modules/mathjs/lib/esm/expression/keywords.js", "../../node_modules/mathjs/lib/esm/expression/node/AccessorNode.js", "../../node_modules/mathjs/lib/esm/expression/node/utils/access.js", "../../node_modules/mathjs/lib/esm/expression/transform/utils/errorTransform.js", "../../node_modules/mathjs/lib/esm/expression/node/ArrayNode.js", "../../node_modules/mathjs/lib/esm/expression/node/AssignmentNode.js", "../../node_modules/mathjs/lib/esm/expression/node/utils/assign.js", "../../node_modules/mathjs/lib/esm/expression/operators.js", "../../node_modules/mathjs/lib/esm/expression/node/BlockNode.js", "../../node_modules/mathjs/lib/esm/expression/node/ConditionalNode.js", "../../node_modules/mathjs/lib/esm/expression/node/ConstantNode.js", "../../node_modules/mathjs/lib/esm/utils/latex.js", "../../node_modules/mathjs/lib/esm/expression/node/FunctionAssignmentNode.js", "../../node_modules/mathjs/lib/esm/expression/node/IndexNode.js", "../../node_modules/mathjs/lib/esm/expression/node/ObjectNode.js", "../../node_modules/mathjs/lib/esm/expression/node/OperatorNode.js", "../../node_modules/mathjs/lib/esm/utils/scope.js", "../../node_modules/mathjs/lib/esm/expression/node/ParenthesisNode.js", "../../node_modules/mathjs/lib/esm/expression/node/RangeNode.js", "../../node_modules/mathjs/lib/esm/expression/node/RelationalNode.js", "../../node_modules/mathjs/lib/esm/expression/node/SymbolNode.js", "../../node_modules/mathjs/lib/esm/expression/node/FunctionNode.js", "../../node_modules/mathjs/lib/esm/expression/parse.js", "../../node_modules/mathjs/lib/esm/expression/function/compile.js", "../../node_modules/mathjs/lib/esm/expression/function/evaluate.js", "../../node_modules/mathjs/lib/esm/expression/Parser.js", "../../node_modules/mathjs/lib/esm/expression/function/parser.js", "../../node_modules/mathjs/lib/esm/function/algebra/decomposition/lup.js", "../../node_modules/mathjs/lib/esm/function/algebra/decomposition/qr.js", "../../node_modules/mathjs/lib/esm/function/algebra/decomposition/slu.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csSqr.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csPermute.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csPost.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csTdfs.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csEtree.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csAmd.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csFkeep.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csFlip.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csCounts.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csLeaf.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csLu.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csSpsolve.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csReach.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csMarked.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csMark.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csDfs.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csUnflip.js", "../../node_modules/mathjs/lib/esm/function/algebra/solver/lusolve.js", "../../node_modules/mathjs/lib/esm/function/algebra/sparse/csIpvec.js", "../../node_modules/mathjs/lib/esm/function/algebra/polynomialRoot.js", "../../node_modules/mathjs/lib/esm/expression/Help.js", "../../node_modules/mathjs/lib/esm/type/chain/Chain.js", "../../node_modules/mathjs/lib/esm/expression/function/help.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/embeddedDocs.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/e.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/false.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/i.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/Infinity.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LN10.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LN2.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LOG10E.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LOG2E.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/NaN.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/null.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/phi.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/pi.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/SQRT1_2.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/SQRT2.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/tau.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/true.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/version.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/bignumber.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/boolean.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/complex.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/createUnit.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/fraction.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/index.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/matrix.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/number.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/sparse.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/splitUnit.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/string.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/unit.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/core/config.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/core/import.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/core/typed.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/derivative.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/leafCount.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lsolve.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lsolveAll.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lup.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lusolve.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/polynomialRoot.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/qr.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/rationalize.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/resolve.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplify.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplifyConstant.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplifyCore.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/slu.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/symbolicEqual.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/usolve.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/usolveAll.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/abs.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/add.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/cbrt.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/ceil.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/cube.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/divide.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotDivide.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotMultiply.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotPow.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/exp.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/expm.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/expm1.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/fix.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/floor.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/gcd.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/hypot.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/invmod.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/lcm.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log10.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log1p.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log2.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/mod.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/multiply.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/norm.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/nthRoot.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/nthRoots.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/pow.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/round.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sign.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sqrt.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sqrtm.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/sylvester.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/schur.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lyap.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/square.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/subtract.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/unaryMinus.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/unaryPlus.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/xgcd.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitAnd.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitNot.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitOr.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitXor.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/leftShift.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/rightArithShift.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/rightLogShift.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/bellNumbers.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/catalan.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/composition.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/stirlingS2.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/arg.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/conj.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/im.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/re.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/evaluate.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/help.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/geometry/distance.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/geometry/intersect.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/and.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/not.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/or.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/xor.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/column.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/concat.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/count.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/cross.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ctranspose.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/det.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/diag.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/diff.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/dot.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/eigs.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/filter.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/flatten.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/forEach.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/getMatrixDataType.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/identity.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/inv.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/pinv.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/kron.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/map.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromColumns.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromFunction.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromRows.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ones.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/partitionSelect.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/range.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/reshape.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/resize.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/rotate.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/rotationMatrix.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/row.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/size.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/sort.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/squeeze.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/subset.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/trace.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/transpose.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/zeros.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/fft.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ifft.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/combinations.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/combinationsWithRep.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/factorial.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/gamma.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/lgamma.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/kldivergence.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/multinomial.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/permutations.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/pickRandom.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/random.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/randomInt.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compare.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compareNatural.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compareText.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/deepEqual.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/equal.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/equalText.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/larger.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/largerEq.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/smaller.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/smallerEq.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/unequal.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setCartesian.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setDifference.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setDistinct.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setIntersect.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setIsSubset.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setMultiplicity.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setPowerset.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setSize.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setSymDifference.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setUnion.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/signal/zpk2tf.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/signal/freqz.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/special/erf.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/special/zeta.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mad.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/max.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mean.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/median.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/min.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mode.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/prod.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/quantileSeq.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/std.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/cumsum.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/sum.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/variance.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/corr.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acos.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acosh.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acot.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acoth.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acsc.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acsch.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asec.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asech.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asin.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asinh.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atan.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atan2.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atanh.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cos.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cosh.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cot.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/coth.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/csc.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/csch.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sec.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sech.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sin.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sinh.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/tan.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/tanh.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/units/to.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/bin.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/clone.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/format.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/hasNumericValue.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/hex.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isInteger.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNaN.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNegative.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNumeric.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isPositive.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isPrime.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isZero.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/numeric.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/oct.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/print.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/typeOf.js", "../../node_modules/mathjs/lib/esm/expression/embeddedDocs/function/numeric/solveODE.js", "../../node_modules/mathjs/lib/esm/type/chain/function/chain.js", "../../node_modules/mathjs/lib/esm/function/matrix/det.js", "../../node_modules/mathjs/lib/esm/function/matrix/inv.js", "../../node_modules/mathjs/lib/esm/function/matrix/pinv.js", "../../node_modules/mathjs/lib/esm/function/matrix/eigs.js", "../../node_modules/mathjs/lib/esm/function/matrix/eigs/complexEigs.js", "../../node_modules/mathjs/lib/esm/function/matrix/eigs/realSymmetric.js", "../../node_modules/mathjs/lib/esm/function/matrix/expm.js", "../../node_modules/mathjs/lib/esm/function/matrix/sqrtm.js", "../../node_modules/mathjs/lib/esm/function/algebra/sylvester.js", "../../node_modules/mathjs/lib/esm/function/algebra/decomposition/schur.js", "../../node_modules/mathjs/lib/esm/function/algebra/lyap.js", "../../node_modules/mathjs/lib/esm/function/arithmetic/divide.js", "../../node_modules/mathjs/lib/esm/function/geometry/distance.js", "../../node_modules/mathjs/lib/esm/function/geometry/intersect.js", "../../node_modules/mathjs/lib/esm/function/statistics/sum.js", "../../node_modules/mathjs/lib/esm/function/statistics/cumsum.js", "../../node_modules/mathjs/lib/esm/function/statistics/mean.js", "../../node_modules/mathjs/lib/esm/function/statistics/median.js", "../../node_modules/mathjs/lib/esm/function/statistics/mad.js", "../../node_modules/mathjs/lib/esm/function/statistics/variance.js", "../../node_modules/mathjs/lib/esm/function/statistics/quantileSeq.js", "../../node_modules/mathjs/lib/esm/function/statistics/std.js", "../../node_modules/mathjs/lib/esm/function/statistics/corr.js", "../../node_modules/mathjs/lib/esm/function/probability/combinations.js", "../../node_modules/mathjs/lib/esm/function/probability/combinationsWithRep.js", "../../node_modules/mathjs/lib/esm/function/probability/gamma.js", "../../node_modules/mathjs/lib/esm/function/probability/lgamma.js", "../../node_modules/mathjs/lib/esm/function/probability/factorial.js", "../../node_modules/mathjs/lib/esm/function/probability/kldivergence.js", "../../node_modules/mathjs/lib/esm/function/probability/multinomial.js", "../../node_modules/mathjs/lib/esm/function/probability/permutations.js", "../../node_modules/mathjs/lib/esm/function/probability/pickRandom.js", "../../node_modules/mathjs/lib/esm/function/probability/util/seededRNG.js", "../../node_modules/mathjs/lib/esm/function/probability/random.js", "../../node_modules/mathjs/lib/esm/function/probability/util/randomMatrix.js", "../../node_modules/mathjs/lib/esm/function/probability/randomInt.js", "../../node_modules/mathjs/lib/esm/function/combinatorics/stirlingS2.js", "../../node_modules/mathjs/lib/esm/function/combinatorics/bellNumbers.js", "../../node_modules/mathjs/lib/esm/function/combinatorics/catalan.js", "../../node_modules/mathjs/lib/esm/function/combinatorics/composition.js", "../../node_modules/mathjs/lib/esm/function/algebra/leafCount.js", "../../node_modules/mathjs/lib/esm/function/algebra/simplify.js", "../../node_modules/mathjs/lib/esm/function/algebra/simplify/wildcards.js", "../../node_modules/mathjs/lib/esm/function/algebra/simplify/util.js", "../../node_modules/mathjs/lib/esm/function/algebra/simplifyConstant.js", "../../node_modules/mathjs/lib/esm/function/algebra/simplifyCore.js", "../../node_modules/mathjs/lib/esm/function/algebra/resolve.js", "../../node_modules/mathjs/lib/esm/function/algebra/symbolicEqual.js", "../../node_modules/mathjs/lib/esm/function/algebra/derivative.js", "../../node_modules/mathjs/lib/esm/function/algebra/rationalize.js", "../../node_modules/mathjs/lib/esm/function/signal/zpk2tf.js", "../../node_modules/mathjs/lib/esm/function/signal/freqz.js", "../../node_modules/mathjs/lib/esm/json/reviver.js", "../../node_modules/mathjs/lib/esm/json/replacer.js", "../../node_modules/mathjs/lib/esm/constants.js", "../../node_modules/mathjs/lib/esm/version.js", "../../node_modules/mathjs/lib/esm/type/unit/physicalConstants.js", "../../node_modules/mathjs/lib/esm/expression/transform/apply.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/column.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/filter.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/utils/compileInlineExpression.js", "../../node_modules/mathjs/lib/esm/expression/transform/forEach.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/index.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/map.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/max.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/utils/lastDimToZeroBase.js", "../../node_modules/mathjs/lib/esm/expression/transform/mean.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/min.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/range.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/row.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/subset.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/concat.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/diff.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/std.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/sum.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/quantileSeq.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/cumsum.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/variance.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/print.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/and.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/or.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/bitAnd.transform.js", "../../node_modules/mathjs/lib/esm/expression/transform/bitOr.transform.js", "../../node_modules/mathjs/lib/esm/entry/dependenciesAny.generated.js", "../../node_modules/mathjs/lib/esm/entry/allFactoriesAny.js", "../../node_modules/mathjs/lib/esm/core/create.js", "../../node_modules/mathjs/lib/esm/utils/emitter.js", "../../node_modules/mathjs/lib/esm/core/function/import.js", "../../node_modules/@formulajs/formulajs/lib/esm/index.mjs", "../../src/js/forex.js", "../../src/js/icons.js", "../../node_modules/lucide/src/createElement.ts", "../../node_modules/lucide/src/replaceElement.ts", "../../node_modules/lucide/src/defaultAttributes.ts", "../../node_modules/lucide/src/icons/arrow-up-down.ts", "../../node_modules/lucide/src/icons/braces.ts", "../../node_modules/lucide/src/icons/circle-alert.ts", "../../node_modules/lucide/src/icons/circle.ts", "../../node_modules/lucide/src/icons/copy.ts", "../../node_modules/lucide/src/icons/corner-down-right.ts", "../../node_modules/lucide/src/icons/dot.ts", "../../node_modules/lucide/src/icons/download.ts", "../../node_modules/lucide/src/icons/ellipsis-vertical.ts", "../../node_modules/lucide/src/icons/eraser.ts", "../../node_modules/lucide/src/icons/info.ts", "../../node_modules/lucide/src/icons/list-restart.ts", "../../node_modules/lucide/src/icons/panel-left-close.ts", "../../node_modules/lucide/src/icons/panel-left.ts", "../../node_modules/lucide/src/icons/plus.ts", "../../node_modules/lucide/src/icons/printer.ts", "../../node_modules/lucide/src/icons/scaling.ts", "../../node_modules/lucide/src/icons/settings.ts", "../../node_modules/lucide/src/icons/trash.ts", "../../node_modules/lucide/src/icons/undo-dot.ts", "../../node_modules/lucide/src/icons/upload.ts", "../../node_modules/lucide/src/lucide.ts", "../../src/js/plot.js", "../../package.json", "../../src/js/settings.js", "../../src/js/pages.js", "../../src/js/userDefined.js", "../../node_modules/mousetrap-global-bind/mousetrap-global-bind.js"], - "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.20.10 | 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 el = toNode(el);\n const id = decodeURIComponent(el.hash).substring(1);\n return document.getElementById(id) || document.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.substr(1).trim();\n const index2 = selector.indexOf(\" \");\n return ~index2 ? [selector.substring(0, index2), selector.substring(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;\n const coverEl = getCoveringElement(targetEl);\n diff -= coverEl ? offset(coverEl).height : 0;\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 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))) {\n return el;\n }\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 delete instance._data;\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 delete instance._queued;\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 } = offset(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 = getSelector(state);\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 getSelector({ filter }) {\n let selector = \"\";\n each(filter, (value) => selector += value || \"\");\n return selector;\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(el, \"touchstart\", (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 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(css(el, \"transform\").split(\",\")[4] / 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 let resolve;\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$1(next, \"itemin\", { percent: percent2, duration, timing, dir });\n triggerUpdate$1(prev, \"itemout\", { percent: 1 - percent2, duration, timing, dir });\n return new Promise((res) => {\n resolve || (resolve = res);\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 });\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 if (percent2 === this.percent()) {\n return;\n }\n this.reset();\n const props2 = translate(percent2, dir);\n css(next, props2[1]);\n css(prev, props2[0]);\n triggerUpdate$1(next, \"itemtranslatein\", { percent: percent2, dir });\n triggerUpdate$1(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$1(el, type, data) {\n trigger(el, createEvent(type, false, false, data));\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, () => target.call(instance, instance));\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.20.10\";\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 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 },\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 },\n length(length) {\n const navLength = this.navChildren.length;\n if (this.nav && length !== navLength) {\n empty(this.nav);\n for (let i = 0; i < length; i++) {\n append(this.nav, `
    • `);\n }\n }\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 }\n };\n\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 ? \"cubic-bezier(0.25, 0.46, 0.45, 0.94)\" : \"cubic-bezier(0.165, 0.84, 0.44, 1)\" : 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 computed: {\n caption: ({ selCaption }, $el) => $(selCaption, $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.caption, 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.substr(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.substr(-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.substr(-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 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, this.prevIndex, this.index);\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 let resolve;\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 return new Promise((res) => {\n resolve || (resolve = res);\n Transition.start(\n list,\n { transform: translate(-to * (isRtl ? -1 : 1), \"px\") },\n duration,\n timing\n ).then(resolve, noop);\n });\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 (css(list, \"transform\").split(\",\")[4] * (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 function triggerUpdate(el, type, data) {\n trigger(el, createEvent(type, false, false, data));\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 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) {\n this.$emit(\"move\");\n } else if (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 }),\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 requestAnimationFrame(() => {\n throttled = false;\n fn.call(this, ...args);\n });\n }\n };\n }\n\n var Position = {\n props: {\n pos: String,\n offset: null,\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, {\n width: coverWidth + (coverWidth % 2 ? 1 : 0),\n height: coverHeight + (coverHeight % 2 ? 1 : 0)\n });\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 this.isDelaying = getPositionedElements(this.$el).some(\n (el) => this.tracker.movesTo(el)\n );\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 this.isDelaying = false;\n },\n isActive() {\n return active === this;\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 getPositionedElements(el) {\n const result = [];\n apply(el, (el2) => css(el2, \"position\") !== \"static\" && result.push(el2));\n return result;\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 } = e;\n if (!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 = offsetPosition(offsetTopEl)[0] - offsetPosition(scrollElement)[0];\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 searchNavbar = \"\";\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 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-large\": searchLarge,\n \"search-navbar\": searchNavbar,\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-navbar\") ? \"search-navbar\" : 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] = $((icons[applyRtl(icon)] || icons[icon]).trim());\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 overflow: Boolean,\n offset: Number\n },\n data: {\n cls: \"uk-active\",\n closest: false,\n scroll: false,\n overflow: true,\n offset: 0\n },\n computed: {\n links: (_, $el) => $$('a[href*=\"#\"]', $el).filter((el) => el.hash && isSameSiteAnchor(el)),\n elements({ closest: selector }) {\n return this.links.map((el) => el.closest(selector || \"*\"));\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(getTargetedElement).filter(Boolean);\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 + offset(getCoveringElement()).height;\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 if (active === false && this.overflow) {\n active = 0;\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);\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 } = offset(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 = offset(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 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\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}\n\nfunction notOk() {\n return false;\n}\n\nfunction undef() {\n return undefined;\n}\n\nconst NOT_TYPED_FUNCTION = 'Argument is not a typed-function.';\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 */\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\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 }; // 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\n let typeMap; // primary store of all types\n\n let typeList; // Array of just type names, for the sake of ordering\n // And similar data structures for the type conversions:\n\n let nConversions = 0; // the actual conversions are stored on a property of the destination types\n // This is a temporary object, will be replaced with a function at the end\n\n let typed = {\n createCount: 0\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\n function findType(typeName) {\n const type = typeMap.get(typeName);\n\n if (type) {\n return type;\n } // Remainder is error handling\n\n\n let message = 'Unknown type \"' + typeName + '\"';\n const name = typeName.toLowerCase();\n let otherName;\n\n for (otherName of typeList) {\n if (otherName.toLowerCase() === name) {\n message += '. Did you mean \"' + otherName + '\" ?';\n break;\n }\n }\n\n throw new TypeError(message);\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\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\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\n const typeName = types[i].name;\n\n if (typeMap.has(typeName)) {\n throw new TypeError('Duplicate type name \"' + typeName + '\"');\n }\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\n\n const affectedTypes = typeList.slice(beforeIndex);\n typeList = typeList.slice(0, beforeIndex).concat(newTypes).concat(affectedTypes); // Fix the indices\n\n for (let i = beforeIndex + newTypes.length; i < typeList.length; ++i) {\n typeMap.get(typeList[i]).index = i;\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\n\n function clear() {\n typeMap = new Map();\n typeList = [];\n nConversions = 0;\n addTypes([anyType], false);\n } // initialize the types to the default list\n\n\n clear();\n addTypes(_types);\n /**\n * Removes all conversions, leaving the types alone.\n */\n\n function clearConversions() {\n let typeName;\n\n for (typeName of typeList) {\n typeMap.get(typeName).conversionsTo = [];\n }\n\n nConversions = 0;\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\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\n if (matches.length) {\n return matches;\n }\n\n return ['any'];\n }\n /**\n * Check if an entity is a typed function created by any instance\n * @param {any} entity\n * @returns {boolean}\n */\n\n\n function isTypedFunction(entity) {\n return entity && typeof entity === 'function' && '_typedFunctionData' in entity;\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\n\n function findSignature(fn, signature, options) {\n if (!isTypedFunction(fn)) {\n throw new TypeError(NOT_TYPED_FUNCTION);\n } // Canonicalize input\n\n\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); // First hope we get lucky and exactly match a signature\n\n if (!exact || canonicalSignature in fn.signatures) {\n // OK, we can check the internal signatures\n const match = fn._typedFunctionData.signatureMap.get(canonicalSignature);\n\n if (match) {\n return match;\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\n\n const nParams = params.length;\n let remainingSignatures;\n\n if (exact) {\n remainingSignatures = [];\n let name;\n\n for (name in fn.signatures) {\n remainingSignatures.push(fn._typedFunctionData.signatureMap.get(name));\n }\n } else {\n remainingSignatures = fn._typedFunctionData.signatures;\n }\n\n for (let i = 0; i < nParams; ++i) {\n const want = params[i];\n const filteredSignatures = [];\n let possibility;\n\n for (possibility of remainingSignatures) {\n const have = getParamAtIndex(possibility.params, i);\n\n if (!have || want.restParam && !have.restParam) {\n continue;\n }\n\n if (!have.hasAny) {\n // have to check all of the wanted types are available\n const haveTypes = paramTypeSet(have);\n\n if (want.types.some(wtype => !haveTypes.has(wtype.name))) {\n continue;\n }\n } // OK, this looks good\n\n\n filteredSignatures.push(possibility);\n }\n\n remainingSignatures = filteredSignatures;\n if (remainingSignatures.length === 0) break;\n } // Return the first remaining signature that was totally matched:\n\n\n let candidate;\n\n for (candidate of remainingSignatures) {\n if (candidate.params.length <= nParams) {\n return candidate;\n }\n }\n\n throw new TypeError('Signature not found (signature: ' + (fn.name || 'unnamed') + '(' + stringifyParams(params, ', ') + '))');\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\n\n function find(fn, signature, options) {\n return findSignature(fn, signature, options).implementation;\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\n\n function convert(value, typeName) {\n // check conversion is needed\n const type = findType(typeName);\n\n if (type.test(value)) {\n return value;\n }\n\n const conversions = type.conversionsTo;\n\n if (conversions.length === 0) {\n throw new Error('There are no conversions to ' + typeName + ' defined.');\n }\n\n for (let i = 0; i < conversions.length; i++) {\n const fromType = findType(conversions[i].from);\n\n if (fromType.test(value)) {\n return conversions[i].convert(value);\n }\n }\n\n throw new Error('Cannot convert ' + value + ' to ' + typeName);\n }\n /**\n * Stringify parameters in a normalized way\n * @param {Param[]} params\n * @param {string} [','] separator\n * @return {string}\n */\n\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 * Parse a parameter, like \"...number | boolean\"\n * @param {string} param\n * @return {Param} param\n */\n\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 * Expands a parsed parameter with the types available from currently\n * defined conversions.\n * @param {Param} param\n * @return {Param} param\n */\n\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 * 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\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\n return param.typeSet;\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\n\n function parseSignature(rawSignature) {\n const params = [];\n\n if (typeof rawSignature !== 'string') {\n throw new TypeError('Signatures must be strings');\n }\n\n const signature = rawSignature.trim();\n\n if (signature === '') {\n return params;\n }\n\n const rawParams = signature.split(',');\n\n for (let i = 0; i < rawParams.length; ++i) {\n const parsedParam = parseParam(rawParams[i].trim());\n\n if (parsedParam.restParam && i !== rawParams.length - 1) {\n throw new SyntaxError('Unexpected rest parameter \"' + rawParams[i] + '\": ' + 'only allowed for the last parameter');\n } // if invalid, short-circuit (all the types may have been filtered)\n\n\n if (parsedParam.types.length === 0) {\n return null;\n }\n\n params.push(parsedParam);\n }\n\n return params;\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\n\n function hasRestParam(params) {\n const param = last(params);\n return param ? param.restParam : false;\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\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\n return false;\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\n\n function compileTests(params) {\n let tests, test0, test1;\n\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\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\n return true;\n };\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\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\n return args.length === tests.length;\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\n\n function getParamAtIndex(params, index) {\n return index < params.length ? params[index] : hasRestParam(params) ? last(params) : null;\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\n\n function getTypeSetAtIndex(params, index) {\n const param = getParamAtIndex(params, index);\n\n if (!param) {\n return new Set();\n }\n\n return paramTypeSet(param);\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\n\n function isExactType(type) {\n return type.conversion === null || type.conversion === undefined;\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\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\n for (name of paramSet) {\n typeSet.add(name);\n }\n });\n return typeSet.has('any') ? ['any'] : Array.from(typeSet);\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\n\n function createError(name, args, signatures) {\n let err, expected;\n\n const _name = name || 'unnamed'; // test for wrong type at some index\n\n\n let matchingSignatures = signatures;\n let index;\n\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\n if ((index < signature.params.length || hasRestParam(signature.params)) && test(args[index])) {\n nextMatchingDefs.push(signature);\n }\n });\n\n if (nextMatchingDefs.length === 0) {\n // no matching signatures anymore, throw error \"wrong type\"\n expected = mergeExpectedParams(matchingSignatures, index);\n\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 } // test for too few arguments\n\n\n const lengths = matchingSignatures.map(function (signature) {\n return hasRestParam(signature.params) ? Infinity : signature.params.length;\n });\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 } // test for too many arguments\n\n\n const maxLength = Math.max.apply(null, lengths);\n\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 } // Generic error\n\n\n const argTypes = [];\n\n for (let i = 0; i < args.length; ++i) {\n argTypes.push(findTypeNames(args[i]).join('|'));\n }\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 * 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\n\n function getLowestTypeIndex(param) {\n let min = typeList.length + 1;\n\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\n return min;\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\n\n function getLowestConversionIndex(param) {\n let min = nConversions + 1;\n\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\n return min;\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\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 } // 2) Prefer non-rest to rest parameters\n\n\n if (param1.restParam) {\n if (!param2.restParam) {\n return 1;\n }\n } else if (param2.restParam) {\n return -1;\n } // 3) Prefer exact type match to conversions\n\n\n if (param1.hasConversion) {\n if (!param2.hasConversion) {\n return 1;\n }\n } else if (param2.hasConversion) {\n return -1;\n } // 4) Prefer lower type index:\n\n\n const typeDiff = getLowestTypeIndex(param1) - getLowestTypeIndex(param2);\n\n if (typeDiff < 0) {\n return -1;\n }\n\n if (typeDiff > 0) {\n return 1;\n } // 5) Prefer lower conversion index\n\n\n const convDiff = getLowestConversionIndex(param1) - getLowestConversionIndex(param2);\n\n if (convDiff < 0) {\n return -1;\n }\n\n if (convDiff > 0) {\n return 1;\n } // Don't have a basis for preference\n\n\n return 0;\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\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); // We compare a number of metrics on signatures in turn:\n // 1) An \"any rest param\" is least preferred\n\n if (hasRest1 && last1.hasAny) {\n if (!hasRest2 || !last2.hasAny) {\n return 1;\n }\n } else if (hasRest2 && last2.hasAny) {\n return -1;\n } // 2) Minimize the number of 'any' parameters\n\n\n let any1 = 0;\n let conv1 = 0;\n let par;\n\n for (par of pars1) {\n if (par.hasAny) ++any1;\n if (par.hasConversion) ++conv1;\n }\n\n let any2 = 0;\n let conv2 = 0;\n\n for (par of pars2) {\n if (par.hasAny) ++any2;\n if (par.hasConversion) ++conv2;\n }\n\n if (any1 !== any2) {\n return any1 - any2;\n } // 3) A conversion rest param is less preferred\n\n\n if (hasRest1 && last1.hasConversion) {\n if (!hasRest2 || !last2.hasConversion) {\n return 1;\n }\n } else if (hasRest2 && last2.hasConversion) {\n return -1;\n } // 4) Minimize the number of conversions\n\n\n if (conv1 !== conv2) {\n return conv1 - conv2;\n } // 5) Prefer no rest param\n\n\n if (hasRest1) {\n if (!hasRest2) {\n return 1;\n }\n } else if (hasRest2) {\n return -1;\n } // 6) Prefer shorter with rest param, longer without\n\n\n const lengthCriterion = (pars1.length - pars2.length) * (hasRest1 ? -1 : 1);\n\n if (lengthCriterion !== 0) {\n return lengthCriterion;\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\n\n const comparisons = [];\n let tc = 0;\n\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\n if (tc !== 0) {\n return tc;\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\n\n let c;\n\n for (c of comparisons) {\n if (c !== 0) {\n return c;\n }\n } // It's a tossup:\n\n\n return 0;\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\n\n function availableConversions(typeNames) {\n if (typeNames.length === 0) {\n return [];\n }\n\n const types = typeNames.map(findType);\n\n if (typeNames.length > 1) {\n types.sort((t1, t2) => t1.index - t2.index);\n }\n\n let matches = types[0].conversionsTo;\n\n if (typeNames.length === 1) {\n return matches;\n }\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\n const knownTypes = new Set(typeNames);\n\n for (let i = 1; i < types.length; ++i) {\n let newMatch;\n\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\n return matches;\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\n\n function compileArgsPreprocessing(params, fn) {\n let fnConvert = fn; // 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\n fnConvert = function convertArgs() {\n const args = [];\n const last = restParam ? arguments.length - 1 : arguments.length;\n\n for (let i = 0; i < last; i++) {\n args[i] = compiledConversions[i](arguments[i]);\n }\n\n if (restParam) {\n args[last] = arguments[last].map(compiledConversions[last]);\n }\n\n return fn.apply(this, args);\n };\n }\n\n let fnPreprocess = fnConvert;\n\n if (hasRestParam(params)) {\n const offset = params.length - 1;\n\n fnPreprocess = function preprocessRestParams() {\n return fnConvert.apply(this, slice(arguments, 0, offset).concat([slice(arguments, offset)]));\n };\n }\n\n return fnPreprocess;\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\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 }); // create optimized conversion functions depending on the number of conversions\n\n switch (conversions.length) {\n case 0:\n return function convertArg(arg) {\n return arg;\n };\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\n return arg;\n };\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\n if (test1(arg)) {\n return conversion1(arg);\n }\n\n return arg;\n };\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\n return arg;\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\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\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\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\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 } // recurse over the groups with types\n\n\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\n return _splitParams(params, 0, []);\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\n\n function conflicting(params1, params2) {\n const ii = Math.max(params1.length, params2.length);\n\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\n for (name of typeSet2) {\n if (typeSet1.has(name)) {\n overlap = true;\n break;\n }\n }\n\n if (!overlap) {\n return false;\n }\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 * 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\n\n function clearResolutions(functionList) {\n return functionList.map(fn => {\n if (isReferToSelf(fn)) {\n return referToSelf(fn.referToSelf.callback);\n }\n\n if (isReferTo(fn)) {\n return makeReferTo(fn.referTo.references, fn.referTo.callback);\n }\n\n return fn;\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\n\n function collectResolutions(references, functionList, signatureMap) {\n const resolvedReferences = [];\n let reference;\n\n for (reference of references) {\n let resolution = signatureMap[reference];\n\n if (typeof resolution !== 'number') {\n throw new TypeError('No definition for referenced signature \"' + reference + '\"');\n }\n\n resolution = functionList[resolution];\n\n if (typeof resolution !== 'function') {\n return false;\n }\n\n resolvedReferences.push(resolution);\n }\n\n return resolvedReferences;\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\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\n while (leftUnresolved) {\n leftUnresolved = false;\n let nothingResolved = true;\n\n for (let i = 0; i < resolvedFunctions.length; ++i) {\n if (isResolved[i]) continue;\n const fn = resolvedFunctions[i];\n\n if (isReferToSelf(fn)) {\n resolvedFunctions[i] = fn.referToSelf.callback(self); // Preserve reference in case signature is reused someday:\n\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\n if (resolvedReferences) {\n resolvedFunctions[i] = fn.referTo.callback.apply(this, resolvedReferences); // Preserve reference in case signature is reused someday:\n\n resolvedFunctions[i].referTo = fn.referTo;\n isResolved[i] = true;\n nothingResolved = false;\n } else {\n leftUnresolved = true;\n }\n }\n }\n\n if (nothingResolved && leftUnresolved) {\n throw new SyntaxError('Circular reference detected in resolving typed.referTo');\n }\n }\n\n return resolvedFunctions;\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\n\n function validateDeprecatedThis(signaturesMap) {\n // TODO: remove this deprecation warning logic some day (it's introduced in v3)\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\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 * 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\n\n function createTypedFunction(name, rawSignaturesMap) {\n typed.createCount++;\n\n if (Object.keys(rawSignaturesMap).length === 0) {\n throw new SyntaxError('No signatures provided');\n }\n\n if (typed.warnAgainstDeprecatedThis) {\n validateDeprecatedThis(rawSignaturesMap);\n } // Main processing loop for signatures\n\n\n const parsedParams = [];\n const originalFunctions = [];\n const signaturesMap = {};\n const preliminarySignatures = []; // may have duplicates from conversions\n\n let signature;\n\n for (signature in rawSignaturesMap) {\n // A) Protect against polluted Object prototype:\n if (!Object.prototype.hasOwnProperty.call(rawSignaturesMap, signature)) {\n continue;\n } // B) Parse the signature\n\n\n const params = parseSignature(signature);\n if (!params) continue; // C) Check for conflicts\n\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); // D) Store the provided function and add conversions\n\n const functionIndex = originalFunctions.length;\n originalFunctions.push(rawSignaturesMap[signature]);\n const conversionParams = params.map(expandParam); // E) Split the signatures and collect them up\n\n let sp;\n\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\n if (sp.every(p => !p.hasConversion)) {\n signaturesMap[spName] = functionIndex;\n }\n }\n }\n\n preliminarySignatures.sort(compareSignatures); // Note the forward reference to theTypedFn\n\n const resolvedFunctions = resolveReferences(originalFunctions, signaturesMap, theTypedFn); // Fill in the proper function for each signature\n\n let s;\n\n for (s in signaturesMap) {\n if (Object.prototype.hasOwnProperty.call(signaturesMap, s)) {\n signaturesMap[s] = resolvedFunctions[signaturesMap[s]];\n }\n }\n\n const signatures = [];\n const internalSignatureMap = new Map(); // benchmarks faster than object\n\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 } // we create a highly optimized checks for the first couple of signatures with max 2 arguments\n\n\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; // compile the tests\n\n for (let i = 0; i < signatures.length; ++i) {\n signatures[i].test = compileTests(signatures[i].params);\n }\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; // compile the functions\n\n for (let i = 0; i < signatures.length; ++i) {\n signatures[i].implementation = compileArgsPreprocessing(signatures[i].params, signatures[i].fn);\n }\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; // simple and generic, but also slow\n\n const iStart = allOk ? 6 : 0;\n const iEnd = signatures.length; // de-reference ahead for execution speed:\n\n const tests = signatures.map(s => s.test);\n const fns = signatures.map(s => s.implementation);\n\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\n return typed.onMismatch(name, arguments, signatures);\n }; // create the typed function\n // fast, specialized version. Falls back to the slower, generic one if needed\n\n\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\n if (arguments.length === len1 && test10(arg0) && test11(arg1)) {\n return fn1.apply(this, arguments);\n }\n\n if (arguments.length === len2 && test20(arg0) && test21(arg1)) {\n return fn2.apply(this, arguments);\n }\n\n if (arguments.length === len3 && test30(arg0) && test31(arg1)) {\n return fn3.apply(this, arguments);\n }\n\n if (arguments.length === len4 && test40(arg0) && test41(arg1)) {\n return fn4.apply(this, arguments);\n }\n\n if (arguments.length === len5 && test50(arg0) && test51(arg1)) {\n return fn5.apply(this, arguments);\n }\n\n return generic.apply(this, arguments);\n } // attach name the typed function\n\n\n try {\n Object.defineProperty(theTypedFn, 'name', {\n value: name\n });\n } catch (err) {// 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 } // 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\n\n theTypedFn.signatures = signaturesMap; // Store internal data for functions like resolve, find, etc.\n // Also serves as the flag that this is a typed-function\n\n theTypedFn._typedFunctionData = {\n signatures,\n signatureMap: internalSignatureMap\n };\n return theTypedFn;\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\n\n function _onMismatch(name, args, signatures) {\n throw createError(name, args, signatures);\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\n\n function initial(arr) {\n return slice(arr, 0, arr.length - 1);\n }\n /**\n * return the last item of an array or function Arguments\n * @param {Array | Arguments} arr\n * @return {*}\n */\n\n\n function last(arr) {\n return arr[arr.length - 1];\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\n\n function slice(arr, start, end) {\n return Array.prototype.slice.call(arr, start, end);\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\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\n return undefined;\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\n\n function flatMap(arr, callback) {\n return Array.prototype.concat.apply([], arr.map(callback));\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\n\n function referTo() {\n const references = initial(arguments).map(s => stringifyParams(parseSignature(s)));\n const callback = last(arguments);\n\n if (typeof callback !== 'function') {\n throw new TypeError('Callback function expected as last argument');\n }\n\n return makeReferTo(references, callback);\n }\n\n function makeReferTo(references, callback) {\n return {\n referTo: {\n references,\n callback\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\n\n function referToSelf(callback) {\n if (typeof callback !== 'function') {\n throw new TypeError('Callback function expected as first argument');\n }\n\n return {\n referToSelf: {\n callback\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\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 * 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\n\n function isReferToSelf(objectOrFn) {\n return objectOrFn && typeof objectOrFn.referToSelf === 'object' && typeof objectOrFn.referToSelf.callback === 'function';\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\n\n function checkName(nameSoFar, newName) {\n if (!nameSoFar) {\n return newName;\n }\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\n return nameSoFar;\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\n\n function getObjectName(obj) {\n let name;\n\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\n return name;\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\n\n function mergeSignatures(dest, source) {\n let key;\n\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 } // else: both signatures point to the same function, that's fine\n\n }\n\n dest[key] = source[key];\n }\n }\n }\n\n const saveTyped = typed;\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\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\n for (let i = start; i < arguments.length; ++i) {\n const item = arguments[i];\n let theseSignatures = {};\n let thisName;\n\n if (typeof item === 'function') {\n thisName = item.name;\n\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\n if (!named) {\n thisName = getObjectName(item);\n }\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\n if (!named) {\n name = checkName(name, thisName);\n }\n\n mergeSignatures(allSignatures, theseSignatures);\n }\n\n return createTypedFunction(name || '', allSignatures);\n };\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\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 * 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\n typed.addType = function (type, beforeObjectTest) {\n let before = 'any';\n\n if (beforeObjectTest !== false && typeMap.has('Object')) {\n before = 'Object';\n }\n\n typed.addTypes([type], before);\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\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\n if (conversion.to === conversion.from) {\n throw new SyntaxError('Illegal to define conversion from \"' + conversion.from + '\" to itself.');\n }\n }\n /**\n * Add a conversion\n *\n * @param {ConversionDef} conversion\n * @returns {void}\n * @throws {TypeError}\n */\n\n\n typed.addConversion = function (conversion) {\n _validateConversion(conversion);\n\n const to = findType(conversion.to);\n\n if (to.conversionsTo.every(function (other) {\n return other.from !== conversion.from;\n })) {\n to.conversionsTo.push({\n from: conversion.from,\n convert: conversion.convert,\n index: nConversions++\n });\n } else {\n throw new Error('There is already a conversion from \"' + conversion.from + '\" to \"' + to.name + '\"');\n }\n };\n /**\n * Convenience wrapper to call addConversion on each conversion in a list.\n *\n @param {ConversionDef[]} conversions\n @returns {void}\n @throws {TypeError}\n */\n\n\n typed.addConversions = function (conversions) {\n conversions.forEach(typed.addConversion);\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\n\n typed.removeConversion = function (conversion) {\n _validateConversion(conversion);\n\n const to = findType(conversion.to);\n const existingConversion = findInArray(to.conversionsTo, c => c.from === conversion.from);\n\n if (!existingConversion) {\n throw new Error('Attempt to remove nonexistent conversion from ' + conversion.from + ' to ' + conversion.to);\n }\n\n if (existingConversion.convert !== conversion.convert) {\n throw new Error('Conversion to remove does not match existing conversion');\n }\n\n const index = to.conversionsTo.indexOf(existingConversion);\n to.conversionsTo.splice(index, 1);\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\n\n typed.resolve = function (tf, argList) {\n if (!isTypedFunction(tf)) {\n throw new TypeError(NOT_TYPED_FUNCTION);\n }\n\n const sigs = tf._typedFunctionData.signatures;\n\n for (let i = 0; i < sigs.length; ++i) {\n if (sigs[i].test(argList)) {\n return sigs[i];\n }\n }\n\n return null;\n };\n\n return typed;\n}\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", "/**\n * @license Fraction.js v4.3.0 20/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(function(root) {\n\n \"use strict\";\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\n var MAX_CYCLE_LEN = 2000;\n\n // Parsed data to avoid calling \"new\" all the time\n var P = {\n \"s\": 1,\n \"n\": 0,\n \"d\": 1\n };\n\n function 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\n function 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\n function 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\n var 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\n function 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\n function 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\n function 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\n function 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 */\n 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\n var DivisionByZero = function() { return new Error(\"Division by Zero\"); };\n var InvalidParameter = function() { return new Error(\"Invalid argument\"); };\n var NonIntegerParameter = function() { return new Error(\"Parameters must be integer\"); };\n\n Fraction.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 numbers\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 * 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\n if (typeof exports === \"object\") {\n Object.defineProperty(Fraction, \"__esModule\", { 'value': true });\n Fraction['default'] = Fraction;\n Fraction['Fraction'] = Fraction;\n module['exports'] = Fraction;\n } else {\n root['Fraction'] = Fraction;\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', () => {\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// Blur input when user defined switcher is shown\nUIkit.util.on('.uk-switcher', 'show', () => {\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 inputStyle: 'textarea',\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 autoCloseBrackets: true,\n mode: 'javascript',\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';", "export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}", "export var DEFAULT_CONFIG = {\n // minimum relative difference between two compared values,\n // used by all comparison functions\n epsilon: 1e-12,\n // type of default matrix output. Choose 'matrix' (default) or 'array'\n matrix: 'Matrix',\n // type of default number output. Choose 'number' (default) 'BigNumber', or 'Fraction\n number: '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, mapObject, 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} epsilon\n * Minimum relative 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 * {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 var prev = mapObject(config, clone);\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 = mapObject(config, clone);\n var changes = mapObject(options, clone);\n\n // emit 'config' event\n emit('config', curr, prev, changes);\n return curr;\n } else {\n return mapObject(config, clone);\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 * Test whether an Array contains a specific item.\n * @param {Array.} array\n * @param {string} item\n * @return {boolean}\n */\nfunction contains(array, item) {\n return array.indexOf(item) !== -1;\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 && !contains(values, 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 === '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.indexOf('.') !== -1;\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 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 { 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 } 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: '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\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-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\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-\\uD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\\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\\uF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DC00-\\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-\\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00-\\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: '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: '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: '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 * 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} x First value to compare\n * @param {number} y Second value to compare\n * @param {number} [epsilon] The maximum relative difference between x and y\n * If epsilon is undefined or null, the function will\n * test whether x and y are exactly equal.\n * @return {boolean} whether the two numbers are nearly equal\n*/\nexport function nearlyEqual(x, y, epsilon) {\n // if epsilon is null or undefined, test whether x and y are exactly equal\n if (epsilon === null || epsilon === undefined) {\n return x === y;\n }\n if (x === y) {\n return true;\n }\n\n // NaN\n if (isNaN(x) || isNaN(y)) {\n return false;\n }\n\n // at this point x and y should be finite\n if (isFinite(x) && isFinite(y)) {\n // check numbers are very close, needed when comparing numbers near zero\n var diff = Math.abs(x - y);\n if (diff <= DBL_EPSILON) {\n return true;\n } else {\n // use relative error\n return diff <= Math.max(Math.abs(x), Math.abs(y)) * epsilon;\n }\n }\n\n // Infinite and Number or negative Infinite and positive Infinite cases\n return false;\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 { contains } from './array.js';\nimport { 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 (contains(factory.dependencies, 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 _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 * Test whether an array or string contains an item\n * @param {Array | string} array\n * @param {*} item\n * @return {boolean}\n */\nexport function contains(array, item) {\n return array.indexOf(item) !== -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.indexOf('e') !== -1) {\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;", "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});", "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});", "// 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 | 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 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';\nvar name = 'isNegative';\nvar dependencies = ['typed'];\nexport var createIsNegative = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\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 | 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: isNegativeNumber,\n BigNumber: function BigNumber(x) {\n return x.isNeg() && !x.isZero() && !x.isNaN();\n },\n Fraction: function Fraction(x) {\n return x.s < 0; // 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;", "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(500)) // 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 | 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.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';\nvar name = 'isPositive';\nvar dependencies = ['typed'];\nexport var createIsPositive = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\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 | 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: isPositiveNumber,\n BigNumber: function BigNumber(x) {\n return !x.isNeg() && !x.isZero() && !x.isNaN();\n },\n Fraction: function Fraction(x) {\n return x.s > 0 && x.n > 0;\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 { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { isZeroNumber } from '../../plain/number/index.js';\nvar name = 'isZero';\nvar dependencies = ['typed'];\nexport var createIsZero = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\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 | 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: isZeroNumber,\n BigNumber: function BigNumber(x) {\n return x.isZero();\n },\n Complex: function Complex(x) {\n return x.re === 0 && x.im === 0;\n },\n Fraction: function Fraction(x) {\n return x.d === 1 && x.n === 0;\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 { 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 | 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 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(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 | Fraction | boolean | Complex | Unit} x First value to compare\n * @param {number | BigNumber | 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.epsilon);\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return x.eq(y) || bigNearlyEqual(x, y, config.epsilon);\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.epsilon);\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.epsilon);\n }\n });\n});", "/**\n * Compares two BigNumbers.\n * @param {BigNumber} x First value to compare\n * @param {BigNumber} y Second value to compare\n * @param {number} [epsilon] The maximum relative difference between x and y\n * If epsilon is undefined or null, the function will\n * test whether x and y are exactly equal.\n * @return {boolean} whether the two numbers are nearly equal\n */\nexport function nearlyEqual(x, y, epsilon) {\n // if epsilon is null or undefined, test whether x and y are exactly equal\n if (epsilon === null || epsilon === undefined) {\n return x.eq(y);\n }\n\n // use \"==\" operator, handles infinities\n if (x.eq(y)) {\n return true;\n }\n\n // NaN\n if (x.isNaN() || y.isNaN()) {\n return false;\n }\n\n // at this point x and y should be finite\n if (x.isFinite() && y.isFinite()) {\n // check numbers are very close, needed when comparing numbers near zero\n var diff = x.minus(y).abs();\n if (diff.isZero()) {\n return true;\n } else {\n // use relative error\n var max = x.constructor.max(x.abs(), y.abs());\n return diff.lte(max.times(epsilon));\n }\n }\n\n // Infinite and Number or negative Infinite and positive Infinite cases\n return false;\n}", "import { nearlyEqual } from './number.js';\n\n/**\n * Test whether two complex values are equal provided a given epsilon.\n * Does not use or change the global Complex.EPSILON setting\n * @param {Complex} x\n * @param {Complex} y\n * @param {number} epsilon\n * @returns {boolean}\n */\nexport function complexEquals(x, y, epsilon) {\n return nearlyEqual(x.re, y.re, epsilon) && nearlyEqual(x.im, y.im, epsilon);\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, boolean, 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 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';\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 * boolean, complex, index, matrix, string, unit\n *\n * @param {number | string | Fraction | BigNumber | 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 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 | 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 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 | Fraction | Complex | Unit | Array | Matrix} x Number to be inverted.\n * @return {number | BigNumber | 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 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';\nvar name = 'unaryPlus';\nvar dependencies = ['typed', 'config', 'BigNumber'];\nexport var createUnaryPlus = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n BigNumber\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 | Fraction | string | Complex | Unit | Array | Matrix} x\n * Input value\n * @return {number | BigNumber | 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 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 | string': function booleanString(x) {\n // convert to a number or bignumber\n return config.number === 'BigNumber' ? new BigNumber(+x) : +x;\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 | Fraction | Complex | Array | Matrix | Unit} x\n * A number or matrix for which to get the absolute value\n * @return {number | BigNumber | 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 // 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 | Fraction | Complex | Unit} x First value to add\n * @param {number | BigNumber | Fraction | Complex} y Second value to add\n * @return {number | BigNumber | 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 '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 | Fraction | Complex | Unit} x First value\n * @param {number | BigNumber | Fraction | Complex} y Second value to be subtracted from `x`\n * @return {number | BigNumber | 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 '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.epsilon)) {\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.epsilon)) {\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.epsilon)) {\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.epsilon)) {\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 | Fraction | Complex | Unit} x Number for which to calculate the cube\n * @return {number | BigNumber | 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 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.epsilon)) {\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.epsilon)) {\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.epsilon)) {\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.epsilon)) {\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 | Fraction | Array | Matrix} x Dividend\n * @param {number | BigNumber | Fraction | Array | Matrix} y Divisor\n * @return {number | BigNumber | 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 '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 | Fraction | Complex | Unit} x First value to multiply\n * @param {number | BigNumber | Fraction | Complex} y Second value to multiply\n * @return {number | BigNumber | 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 '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 | Fraction | Complex | Unit | Array | Matrix} x First value to multiply\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Second value to multiply\n * @return {number | BigNumber | 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 | Fraction | Complex | Array | Matrix | Unit} x\n * The number for which to determine the sign\n * @return {number | BigNumber | 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 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 | Fraction | Complex | Unit} x\n * Number for which to calculate the square\n * @return {number | BigNumber | 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 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 | Fraction | Complex | Unit | Array | Matrix} x Initial value\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Value to subtract from `x`\n * @return {number | BigNumber | 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 | Array | Matrix} x First value to and\n * @param {number | BigNumber | Array | Matrix} y Second value to and\n * @return {number | BigNumber | Array | Matrix} AND of `x` and `y`\n */\n return typed(name, {\n 'number, number': bitAndNumber,\n 'BigNumber, BigNumber': bitAndBigNumber\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 | Array | Matrix} x Value to not\n * @return {number | BigNumber | Array | Matrix} NOT of `x`\n */\n return typed(name, {\n number: bitNotNumber,\n BigNumber: bitNotBigNumber,\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 | Array | Matrix} x First value to or\n * @param {number | BigNumber | Array | Matrix} y Second value to or\n * @return {number | BigNumber | Array | Matrix} OR of `x` and `y`\n */\n return typed(name, {\n 'number, number': bitOrNumber,\n 'BigNumber, BigNumber': bitOrBigNumber\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 | Array | Matrix} x First value to xor\n * @param {number | BigNumber | Array | Matrix} y Second value to xor\n * @return {number | BigNumber | Array | Matrix} XOR of `x` and `y`\n */\n return typed(name, {\n 'number, number': bitXorNumber,\n 'BigNumber, BigNumber': bigBitXor\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 | 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 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 | Complex | Unit | Array | Matrix} x First value to check\n * @param {number | BigNumber | 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 '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 | Complex | Unit | Array | Matrix} x First value to check\n * @param {number | BigNumber | 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 '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\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}", "import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}", "export 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}", "import _typeof from \"./typeof.js\";\nexport default function 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}", "/* 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 // epsilon is for example 1e-12. Extract the positive exponent 12 from that\n return Math.abs(Math.log10(config.epsilon));\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 { 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, config.number);\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).indexOf('Unexpected type') !== -1) {\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).indexOf('complex numbers') !== -1) {\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 | 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 * 0 !== 0) {\n return false;\n }\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 BigNumber: function BigNumber(n) {\n if (n.toNumber() * 0 !== 0) {\n return false;\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 Fraction: fraction ? x => fraction(x) : noFraction\n };\n\n /**\n * Convert a numeric input to a specific numeric type: number, BigNumber, 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', '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, string, format\n *\n * @param {string | number | BigNumber | 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 | 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 | Fraction | Complex | Unit} x Numerator\n * @param {number | BigNumber | Fraction | Complex} y Denominator\n * @return {number | BigNumber | 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 '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 | Complex | Unit | Array | Matrix} x The base\n * @param {number | BigNumber | Complex} y The exponent\n * @return {number | BigNumber | 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 '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 epsilon precision\n var xEpsilon = roundNumber(x, toExponent(config.epsilon));\n var xSelected = nearlyEqual(x, xEpsilon, config.epsilon) ? xEpsilon : x;\n return roundNumber(xSelected);\n },\n 'number, number': function numberNumber(x, n) {\n // Same as number: unless user specifies more decimals than epsilon\n var epsilonExponent = toExponent(config.epsilon);\n if (n >= epsilonExponent) {\n return roundNumber(x, n);\n }\n var xEpsilon = roundNumber(x, epsilonExponent);\n var xSelected = nearlyEqual(x, xEpsilon, config.epsilon) ? 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 epsilon precision\n var xEpsilon = new _BigNumber(x).toDecimalPlaces(toExponent(config.epsilon));\n var xSelected = bigNearlyEqual(x, xEpsilon, config.epsilon) ? 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 epsilon\n var epsilonExponent = toExponent(config.epsilon);\n if (n >= epsilonExponent) {\n return x.toDecimalPlaces(n.toNumber());\n }\n var xEpsilon = x.toDecimalPlaces(epsilonExponent);\n var xSelected = bigNearlyEqual(x, xEpsilon, config.epsilon) ? 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 | Array | Matrix} x Value to be shifted\n * @param {number | BigNumber} y Amount of shifts\n * @return {number | BigNumber | Array | Matrix} `x` shifted left `y` times\n */\n return typed(name, {\n 'number, number': leftShiftNumber,\n 'BigNumber, BigNumber': leftShiftBigNumber,\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 | Array | Matrix} x Value to be shifted\n * @param {number | BigNumber} y Amount of shifts\n * @return {number | BigNumber | Array | Matrix} `x` zero-filled shifted right `y` times\n */\n return typed(name, {\n 'number, number': rightArithShiftNumber,\n 'BigNumber, BigNumber': rightArithShiftBigNumber,\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 | Complex | Unit | Array | Matrix} x First value to check\n * @param {number | BigNumber | 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 '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 epsilon. 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 | Fraction | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | Fraction | Unit | string | Array | Matrix} y Second value to compare\n * @return {number | BigNumber | 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.epsilon) ? new BigNumber(0) : new BigNumber(x.cmp(y));\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.epsilon) ? 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 epsilon.\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 epsilon. 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 | boolean | Complex | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | 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 epsilon. 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 | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | 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.epsilon);\n },\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.epsilon);\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 epsilon. 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 | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | 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.epsilon);\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 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.epsilon);\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 epsilon. 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 | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | 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.epsilon);\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 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.epsilon);\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 epsilon. 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 | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | 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.epsilon);\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.epsilon);\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 epsilon. 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 { 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, config.number);\n }\n return res;\n }\n});", "import { containsCollections, deepForEach, reduce } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.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, config.number);\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.formatUnits(),\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 unit = new Unit(json.value, json.unit);\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 | Fraction | Complex | Unit | Array | Matrix} x First value to add\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Second value to add\n * @return {number | BigNumber | 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, 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 '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 '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 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 { 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, modulus\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 = parsePercentage(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 = parsePercentage(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 * percentage or mod\n * @return {Node} node\n * @private\n */\n function parsePercentage(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.indexOf(name) !== -1) {\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.indexOf(state.token) !== -1)) {\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 return new ConstantNode(numeric(numberStr, config.number));\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 { 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 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', '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', '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, or Fraction.',\n examples: ['numeric(\"4\")', 'numeric(\"4\", \"number\")', 'numeric(\"4\", \"BigNumber\")', 'numeric(\"4\", \"Fraction\")', 'numeric(4, \"Fraction\")', 'numeric(fraction(2, 5), \"number\")'],\n seealso: ['number', '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.epsilon, 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.epsilon;\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.epsilon;\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.epsilon) {\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.epsilon) {\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 | Fraction | Complex | Unit | Array | Matrix} x Numerator\n * @param {number | BigNumber | Fraction | Complex | Array | Matrix} y Denominator\n * @return {number | BigNumber | 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.epsilon)) {\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 { 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, config.number);\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.indexOf('median') !== -1) {\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.indexOf(' variance') !== -1) {\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 { 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 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 if (config.number === 'BigNumber') {\n if (bignumber === undefined) {\n noBignumber();\n }\n return bignumber(s);\n } else if (config.number === '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 '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 '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.indexOf(node.name) === -1) {\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';\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.indexOf(varName) === -1) {\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 || config.number));\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.indexOf(node.op) === -1) {\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 ('+-*^'.indexOf(node.op) === -1) 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 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 = '12.4.2';\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 { 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 } 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} epsilon\n * Minimum relative 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 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 { contains } from '../../utils/array.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 (contains(name, '.')) {\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 (contains(dependency, '.')) {\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 exports.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.indexOf('.') === -1 &&\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,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cG9seWxpbmUgcG9pbnRzPSI2IDkgNiAyIDE4IDIgMTggOSIgLz4KICA8cGF0aCBkPSJNNiAxOEg0YTIgMiAwIDAgMS0yLTJ2LTVhMiAyIDAgMCAxIDItMmgxNmEyIDIgMCAwIDEgMiAydjVhMiAyIDAgMCAxLTIgMmgtMiIgLz4KICA8cmVjdCB3aWR0aD0iMTIiIGhlaWdodD0iOCIgeD0iNiIgeT0iMTQiIC8+Cjwvc3ZnPgo=) - 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 ['polyline', { points: '6 9 6 2 18 2 18 9' }],\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 ['rect', { width: '12', height: '8', x: '6', y: '14' }],\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.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\": \"^30.0.4\",\n \"electron-builder\": \"^24.13.3\",\n \"esbuild\": \"^0.21.2\",\n \"esbuild-plugin-polyfill-node\": \"^0.3.0\",\n \"eslint\": \"^9.2.0\",\n \"fs-extra\": \"^11.2.0\",\n \"function-plot\": \"^1.24.4\",\n \"lucide\": \"^0.372.0\",\n \"luxon\": \"^3.4.4\",\n \"mathjs\": \"^12.4.2\",\n \"mousetrap\": \"^1.6.5\",\n \"mousetrap-global-bind\": \"^1.1.0\",\n \"prettier\": \"^3.2.5\",\n \"uikit\": \"^3.20.10\"\n },\n \"dependencies\": {\n \"electron-log\": \"^5.1.4\",\n \"electron-store\": \"^9.0.0\",\n \"electron-updater\": \"^6.1.8\"\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,KAAK,KAAK,CACjC,EAKIW,IAAM,CACR,KAAM,WACN,KAAM,UAAU,SAAW,SAC3B,IAAK,IACL,KAAM,QACN,IAAK,MACP,EA6EIL,GAAe,CACjB,IAAK,OAAO,YAAgB,IAAc,YAAY,IAAI,KAAK,WAAW,EAAI,OAC9E,OAAQ,OAAO,YAAgB,IAAc,YAAY,OAAS,MACpE,EACIA,GAAa,MAAQ,SACnBM,GAAY,KAAK,IAAI,EAErBN,GAAa,QAAUA,GAAa,OAAO,kBAC7CM,GAAYN,GAAa,OAAO,iBAElCA,GAAa,IAAM,IAAM,KAAK,IAA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,CACd,KAAM,SACN,KAAMC,EACR,EAAG,CACD,KAAM,UACN,KAAMC,EACR,EAAG,CACD,KAAM,YACN,KAAMC,EACR,EAAG,CACD,KAAM,WACN,KAAMC,EACR,EAAG,CACD,KAAM,OACN,KAAMC,EACR,EAKA,CACE,KAAM,aACN,KAAMC,GAAKC,IAAY,upfAAupf,KAAKD,CAAC,CACtrf,EAAG,CACD,KAAM,SACN,KAAMC,EACR,EAAG,CACD,KAAM,QACN,KAAMC,EACR,EAAG,CACD,KAAM,QACN,KAAMC,EACR,EAAG,CACD,KAAM,SACN,KAAMC,EACR,EAAG,CACD,KAAM,cACN,KAAMC,EACR,EAAG,CACD,KAAM,eACN,KAAMC,EACR,EAAG,CACD,KAAM,QACN,KAAMC,EACR,EAAG,CACD,KAAM,QACN,KAAMC,EACR,EAAG,CACD,KAAM,UACN,KAAMC,EACR,EAAG,CACD,KAAM,YACN,KAAMC,EACR,EAAG,CACD,KAAM,OACN,KAAMC,EACR,EAAG,CACD,KAAM,WACN,KAAMC,EACR,EAAG,CACD,KAAM,OACN,KAAMC,EACR,EAAG,CACD,KAAM,SACN,KAAMC,EACR,EAAG,CACD,KAAM,OACN,KAAMC,EACR,EAAG,CACD,KAAM,YACN,KAAMC,EACR,EAAG,CACD,KAAM,eACN,KAAMC,EACR,EAAG,CACD,KAAM,YACN,KAAMC,EACR,EAAG,CACD,KAAM,iBACN,KAAMC,EACR,EAAG,CACD,KAAM,YACN,KAAMC,EACR,EAAG,CACD,KAAM,kBACN,KAAMC,EACR,EAAG,CACD,KAAM,eACN,KAAMC,EACR,EAAG,CACD,KAAM,eACN,KAAMC,EACR,EAAG,CACD,KAAM,yBACN,KAAMC,EACR,EAAG,CACD,KAAM,YACN,KAAMC,EACR,EAAG,CACD,KAAM,OACN,KAAMC,EACR,EAAG,CACD,KAAM,aACN,KAAMC,EACR,EAAG,CACD,KAAM,eACN,KAAMC,EACR,EAAG,CACD,KAAM,kBACN,KAAMC,EACR,EAAG,CACD,KAAM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AE,KAAK,EAE7C,OAAIvH,EAAMsH,GAAS,KAAK,KAAK,IAC3BzG,GAAE,MAAQ,GAEZqE,GAAI,KAAKrE,EAAC,EACHqE,EACT,EACA,IAAIsC,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,IAAI,KAAM,CAAC,EACvB,WAAY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,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,EAAG,iBACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,EACA,cAAe,CACb,SAAU,CACR,YAAa,EACf,CACF,CACF,EAGA,CACE,EAAG,QACH,EAAG,MACL,EAEA,CACE,EAAG,UACH,EAAG,QACL,EAAG,CACD,EAAG,oBAEH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,sBACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,cACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,MACH,EAAG,GACL,EAEA,CACE,EAAG,yBAEH,SAAU,CACR,SAAU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UACvCG,EAAM;AAAA;AAAA,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", "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", "coverEl", "getCoveringElement", "dist", "k", "scrolledOver", "startOffset", "endOffset", "scrollParent", "viewportHeight", "elementOffsetTop", "end", "scrollable", "scrollEl", "ancestors", "fixedIndex", "window", "viewportElement", "scale", "subpixel", "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", "ownerDocument", "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", "getSelector", "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", "hash", "modal", "handlers", "preventBackgroundFocus", "listenForBackgroundClose$1", "listenForEscClose$1", "animate$1", "transitionElement", "toMs", "time", "newTarget", "Animations$2", "translate", "translated", "scale3d", "Transitioner$1", "easing", "percent2", "linear", "triggerUpdate$1", "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", "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", "navLength", "selNavItem", "parallax", "keyCode", "active", "Slider", "speedUp", "stack", "queueIndex", "reset", "getDirection", "transitioner", "Slideshow", "Animations2", "Animations$1", "LightboxPanel", "close", "closeLabel", "selCaption", "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", "triggerUpdate", "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", "getPositionedElements", "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", "searchNavbar", "slidenavNextLarge", "slidenavNext", "slidenavPreviousLarge", "slidenavPrevious", "spinner", "totop", "Svg", "svg", "insertSVG", "applyWidthAndHeight", "root", "equals", "viewBox", "icons", "Icon", "install$1", "icon", "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", "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", "applyAttributes", "applyAnimation", "parseSVG", "loadSVG", "parseSymbols", "symbolRe", "symbols", "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", "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_fraction", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "root", "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", "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", "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", "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", "target", "i", "source", "key", "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", "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", "prev", "mapObject", "clone", "validateOption", "deepExtend", "curr", "changes", "DEFAULT_CONFIG", "key", "contains", "array", "item", "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", "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", "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", "str", "splitValue", "p", "pp", "first", "lowerExp", "_toNumberOrDefault", "upperExp", "removed", "length", "arr", "DBL_EPSILON", "nearlyEqual", "y", "epsilon", "diff", "acosh", "asinh", "atanh", "cosh", "sinh", "tanh", "copysign", "signx", "signy", "onError", "defaultValue", "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", "contains", "array", "item", "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", "Asize", "arraySize", "deepStrictEqual", "broadcastedSize", "paddedSize", "clone", "reshape", "stretch", "stretch", "arrayToStretch", "sizeToStretch", "dimToStretch", "concat", "clone", "array", "_extends", "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", "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", "import_fraction", "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", "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", "name", "dependencies", "createIsNegative", "factory", "_ref", "typed", "isNegativeNumber", "x", "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", "isPositiveNumber", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIsZero", "factory", "_ref", "typed", "isZeroNumber", "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", "nearlyEqual", "x", "y", "epsilon", "diff", "max", "init_dirname", "init_buffer", "init_process", "complexEquals", "x", "y", "epsilon", "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", "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", "BigNumber", "unaryPlusNumber", "x", "self", "deepMap", "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", "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", "b", "args", "res", "i", "lcmNumber", "_lcmBigNumber", "x", "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", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createBitNot", "factory", "_ref", "typed", "bitNotNumber", "bitNotBigNumber", "self", "x", "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", "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", "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", "obj", "key", "value", "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", "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", "self", "x", "y", "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", "self", "x", "y", "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", "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", "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", "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", "parsePercentage", "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", "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", "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", "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", "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", "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", "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", "contains", "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", "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.1 | 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;\n const coverEl = getCoveringElement(targetEl);\n diff -= coverEl ? offset(coverEl).height : 0;\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 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))) {\n return el;\n }\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 delete instance._data;\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 delete instance._queued;\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 } = offset(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(el, \"touchstart\", (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 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(css(el, \"transform\").split(\",\")[4] / 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 let resolve;\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$1(next, \"itemin\", { percent: percent2, duration, timing, dir });\n triggerUpdate$1(prev, \"itemout\", { percent: 1 - percent2, duration, timing, dir });\n return new Promise((res) => {\n resolve || (resolve = res);\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 });\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 if (percent2 === this.percent()) {\n return;\n }\n this.reset();\n const props2 = translate(percent2, dir);\n css(next, props2[1]);\n css(prev, props2[0]);\n triggerUpdate$1(next, \"itemtranslatein\", { percent: percent2, dir });\n triggerUpdate$1(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$1(el, type, data) {\n trigger(el, createEvent(type, false, false, data));\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.1\";\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 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 },\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 },\n length(length) {\n const navLength = this.navChildren.length;\n if (this.nav && length !== navLength) {\n empty(this.nav);\n for (let i = 0; i < length; i++) {\n append(this.nav, `
      • `);\n }\n }\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 }\n };\n\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 ? \"cubic-bezier(0.25, 0.46, 0.45, 0.94)\" : \"cubic-bezier(0.165, 0.84, 0.44, 1)\" : 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 computed: {\n caption: ({ selCaption }, $el) => $(selCaption, $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.caption, 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, this.prevIndex, this.index);\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 let resolve;\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 return new Promise((res) => {\n resolve || (resolve = res);\n Transition.start(\n list,\n { transform: translate(-to * (isRtl ? -1 : 1), \"px\") },\n duration,\n timing\n ).then(resolve, noop);\n });\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 (css(list, \"transform\").split(\",\")[4] * (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 function triggerUpdate(el, type, data) {\n trigger(el, createEvent(type, false, false, data));\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 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: null,\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, {\n width: coverWidth + (coverWidth % 2 ? 1 : 0),\n height: coverHeight + (coverHeight % 2 ? 1 : 0)\n });\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 this.isDelaying = getPositionedElements(this.$el).some(\n (el) => this.tracker.movesTo(el)\n );\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 this.isDelaying = false;\n },\n isActive() {\n return active === this;\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 getPositionedElements(el) {\n const result = [];\n apply(el, (el2) => css(el2, \"position\") !== \"static\" && result.push(el2));\n return result;\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 } = e;\n if (!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 = offsetPosition(offsetTopEl)[0] - offsetPosition(scrollElement)[0];\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 searchMedium = \"\";\n\n var searchLarge = \"\";\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 overflow: Boolean,\n offset: Number\n },\n data: {\n cls: \"uk-active\",\n closest: false,\n scroll: false,\n overflow: true,\n offset: 0\n },\n computed: {\n links: (_, $el) => $$('a[href*=\"#\"]', $el).filter((el) => el.hash && isSameSiteAnchor(el)),\n elements({ closest: selector }) {\n return this.links.map((el) => el.closest(selector || \"*\"));\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(getTargetedElement).filter(Boolean);\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 + offset(getCoveringElement()).height;\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 if (active === false && this.overflow) {\n active = 0;\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);\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 } = offset(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 = offset(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}\n\nfunction notOk() {\n return false;\n}\n\nfunction undef() {\n return undefined;\n}\n\nconst NOT_TYPED_FUNCTION = 'Argument is not a typed-function.';\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 */\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\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 }; // 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\n let typeMap; // primary store of all types\n\n let typeList; // Array of just type names, for the sake of ordering\n // And similar data structures for the type conversions:\n\n let nConversions = 0; // the actual conversions are stored on a property of the destination types\n // This is a temporary object, will be replaced with a function at the end\n\n let typed = {\n createCount: 0\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\n function findType(typeName) {\n const type = typeMap.get(typeName);\n\n if (type) {\n return type;\n } // Remainder is error handling\n\n\n let message = 'Unknown type \"' + typeName + '\"';\n const name = typeName.toLowerCase();\n let otherName;\n\n for (otherName of typeList) {\n if (otherName.toLowerCase() === name) {\n message += '. Did you mean \"' + otherName + '\" ?';\n break;\n }\n }\n\n throw new TypeError(message);\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\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\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\n const typeName = types[i].name;\n\n if (typeMap.has(typeName)) {\n throw new TypeError('Duplicate type name \"' + typeName + '\"');\n }\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\n\n const affectedTypes = typeList.slice(beforeIndex);\n typeList = typeList.slice(0, beforeIndex).concat(newTypes).concat(affectedTypes); // Fix the indices\n\n for (let i = beforeIndex + newTypes.length; i < typeList.length; ++i) {\n typeMap.get(typeList[i]).index = i;\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\n\n function clear() {\n typeMap = new Map();\n typeList = [];\n nConversions = 0;\n addTypes([anyType], false);\n } // initialize the types to the default list\n\n\n clear();\n addTypes(_types);\n /**\n * Removes all conversions, leaving the types alone.\n */\n\n function clearConversions() {\n let typeName;\n\n for (typeName of typeList) {\n typeMap.get(typeName).conversionsTo = [];\n }\n\n nConversions = 0;\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\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\n if (matches.length) {\n return matches;\n }\n\n return ['any'];\n }\n /**\n * Check if an entity is a typed function created by any instance\n * @param {any} entity\n * @returns {boolean}\n */\n\n\n function isTypedFunction(entity) {\n return entity && typeof entity === 'function' && '_typedFunctionData' in entity;\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\n\n function findSignature(fn, signature, options) {\n if (!isTypedFunction(fn)) {\n throw new TypeError(NOT_TYPED_FUNCTION);\n } // Canonicalize input\n\n\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); // First hope we get lucky and exactly match a signature\n\n if (!exact || canonicalSignature in fn.signatures) {\n // OK, we can check the internal signatures\n const match = fn._typedFunctionData.signatureMap.get(canonicalSignature);\n\n if (match) {\n return match;\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\n\n const nParams = params.length;\n let remainingSignatures;\n\n if (exact) {\n remainingSignatures = [];\n let name;\n\n for (name in fn.signatures) {\n remainingSignatures.push(fn._typedFunctionData.signatureMap.get(name));\n }\n } else {\n remainingSignatures = fn._typedFunctionData.signatures;\n }\n\n for (let i = 0; i < nParams; ++i) {\n const want = params[i];\n const filteredSignatures = [];\n let possibility;\n\n for (possibility of remainingSignatures) {\n const have = getParamAtIndex(possibility.params, i);\n\n if (!have || want.restParam && !have.restParam) {\n continue;\n }\n\n if (!have.hasAny) {\n // have to check all of the wanted types are available\n const haveTypes = paramTypeSet(have);\n\n if (want.types.some(wtype => !haveTypes.has(wtype.name))) {\n continue;\n }\n } // OK, this looks good\n\n\n filteredSignatures.push(possibility);\n }\n\n remainingSignatures = filteredSignatures;\n if (remainingSignatures.length === 0) break;\n } // Return the first remaining signature that was totally matched:\n\n\n let candidate;\n\n for (candidate of remainingSignatures) {\n if (candidate.params.length <= nParams) {\n return candidate;\n }\n }\n\n throw new TypeError('Signature not found (signature: ' + (fn.name || 'unnamed') + '(' + stringifyParams(params, ', ') + '))');\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\n\n function find(fn, signature, options) {\n return findSignature(fn, signature, options).implementation;\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\n\n function convert(value, typeName) {\n // check conversion is needed\n const type = findType(typeName);\n\n if (type.test(value)) {\n return value;\n }\n\n const conversions = type.conversionsTo;\n\n if (conversions.length === 0) {\n throw new Error('There are no conversions to ' + typeName + ' defined.');\n }\n\n for (let i = 0; i < conversions.length; i++) {\n const fromType = findType(conversions[i].from);\n\n if (fromType.test(value)) {\n return conversions[i].convert(value);\n }\n }\n\n throw new Error('Cannot convert ' + value + ' to ' + typeName);\n }\n /**\n * Stringify parameters in a normalized way\n * @param {Param[]} params\n * @param {string} [','] separator\n * @return {string}\n */\n\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 * Parse a parameter, like \"...number | boolean\"\n * @param {string} param\n * @return {Param} param\n */\n\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 * Expands a parsed parameter with the types available from currently\n * defined conversions.\n * @param {Param} param\n * @return {Param} param\n */\n\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 * 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\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\n return param.typeSet;\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\n\n function parseSignature(rawSignature) {\n const params = [];\n\n if (typeof rawSignature !== 'string') {\n throw new TypeError('Signatures must be strings');\n }\n\n const signature = rawSignature.trim();\n\n if (signature === '') {\n return params;\n }\n\n const rawParams = signature.split(',');\n\n for (let i = 0; i < rawParams.length; ++i) {\n const parsedParam = parseParam(rawParams[i].trim());\n\n if (parsedParam.restParam && i !== rawParams.length - 1) {\n throw new SyntaxError('Unexpected rest parameter \"' + rawParams[i] + '\": ' + 'only allowed for the last parameter');\n } // if invalid, short-circuit (all the types may have been filtered)\n\n\n if (parsedParam.types.length === 0) {\n return null;\n }\n\n params.push(parsedParam);\n }\n\n return params;\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\n\n function hasRestParam(params) {\n const param = last(params);\n return param ? param.restParam : false;\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\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\n return false;\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\n\n function compileTests(params) {\n let tests, test0, test1;\n\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\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\n return true;\n };\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\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\n return args.length === tests.length;\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\n\n function getParamAtIndex(params, index) {\n return index < params.length ? params[index] : hasRestParam(params) ? last(params) : null;\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\n\n function getTypeSetAtIndex(params, index) {\n const param = getParamAtIndex(params, index);\n\n if (!param) {\n return new Set();\n }\n\n return paramTypeSet(param);\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\n\n function isExactType(type) {\n return type.conversion === null || type.conversion === undefined;\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\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\n for (name of paramSet) {\n typeSet.add(name);\n }\n });\n return typeSet.has('any') ? ['any'] : Array.from(typeSet);\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\n\n function createError(name, args, signatures) {\n let err, expected;\n\n const _name = name || 'unnamed'; // test for wrong type at some index\n\n\n let matchingSignatures = signatures;\n let index;\n\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\n if ((index < signature.params.length || hasRestParam(signature.params)) && test(args[index])) {\n nextMatchingDefs.push(signature);\n }\n });\n\n if (nextMatchingDefs.length === 0) {\n // no matching signatures anymore, throw error \"wrong type\"\n expected = mergeExpectedParams(matchingSignatures, index);\n\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 } // test for too few arguments\n\n\n const lengths = matchingSignatures.map(function (signature) {\n return hasRestParam(signature.params) ? Infinity : signature.params.length;\n });\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 } // test for too many arguments\n\n\n const maxLength = Math.max.apply(null, lengths);\n\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 } // Generic error\n\n\n const argTypes = [];\n\n for (let i = 0; i < args.length; ++i) {\n argTypes.push(findTypeNames(args[i]).join('|'));\n }\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 * 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\n\n function getLowestTypeIndex(param) {\n let min = typeList.length + 1;\n\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\n return min;\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\n\n function getLowestConversionIndex(param) {\n let min = nConversions + 1;\n\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\n return min;\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\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 } // 2) Prefer non-rest to rest parameters\n\n\n if (param1.restParam) {\n if (!param2.restParam) {\n return 1;\n }\n } else if (param2.restParam) {\n return -1;\n } // 3) Prefer exact type match to conversions\n\n\n if (param1.hasConversion) {\n if (!param2.hasConversion) {\n return 1;\n }\n } else if (param2.hasConversion) {\n return -1;\n } // 4) Prefer lower type index:\n\n\n const typeDiff = getLowestTypeIndex(param1) - getLowestTypeIndex(param2);\n\n if (typeDiff < 0) {\n return -1;\n }\n\n if (typeDiff > 0) {\n return 1;\n } // 5) Prefer lower conversion index\n\n\n const convDiff = getLowestConversionIndex(param1) - getLowestConversionIndex(param2);\n\n if (convDiff < 0) {\n return -1;\n }\n\n if (convDiff > 0) {\n return 1;\n } // Don't have a basis for preference\n\n\n return 0;\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\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); // We compare a number of metrics on signatures in turn:\n // 1) An \"any rest param\" is least preferred\n\n if (hasRest1 && last1.hasAny) {\n if (!hasRest2 || !last2.hasAny) {\n return 1;\n }\n } else if (hasRest2 && last2.hasAny) {\n return -1;\n } // 2) Minimize the number of 'any' parameters\n\n\n let any1 = 0;\n let conv1 = 0;\n let par;\n\n for (par of pars1) {\n if (par.hasAny) ++any1;\n if (par.hasConversion) ++conv1;\n }\n\n let any2 = 0;\n let conv2 = 0;\n\n for (par of pars2) {\n if (par.hasAny) ++any2;\n if (par.hasConversion) ++conv2;\n }\n\n if (any1 !== any2) {\n return any1 - any2;\n } // 3) A conversion rest param is less preferred\n\n\n if (hasRest1 && last1.hasConversion) {\n if (!hasRest2 || !last2.hasConversion) {\n return 1;\n }\n } else if (hasRest2 && last2.hasConversion) {\n return -1;\n } // 4) Minimize the number of conversions\n\n\n if (conv1 !== conv2) {\n return conv1 - conv2;\n } // 5) Prefer no rest param\n\n\n if (hasRest1) {\n if (!hasRest2) {\n return 1;\n }\n } else if (hasRest2) {\n return -1;\n } // 6) Prefer shorter with rest param, longer without\n\n\n const lengthCriterion = (pars1.length - pars2.length) * (hasRest1 ? -1 : 1);\n\n if (lengthCriterion !== 0) {\n return lengthCriterion;\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\n\n const comparisons = [];\n let tc = 0;\n\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\n if (tc !== 0) {\n return tc;\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\n\n let c;\n\n for (c of comparisons) {\n if (c !== 0) {\n return c;\n }\n } // It's a tossup:\n\n\n return 0;\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\n\n function availableConversions(typeNames) {\n if (typeNames.length === 0) {\n return [];\n }\n\n const types = typeNames.map(findType);\n\n if (typeNames.length > 1) {\n types.sort((t1, t2) => t1.index - t2.index);\n }\n\n let matches = types[0].conversionsTo;\n\n if (typeNames.length === 1) {\n return matches;\n }\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\n const knownTypes = new Set(typeNames);\n\n for (let i = 1; i < types.length; ++i) {\n let newMatch;\n\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\n return matches;\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\n\n function compileArgsPreprocessing(params, fn) {\n let fnConvert = fn; // 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\n fnConvert = function convertArgs() {\n const args = [];\n const last = restParam ? arguments.length - 1 : arguments.length;\n\n for (let i = 0; i < last; i++) {\n args[i] = compiledConversions[i](arguments[i]);\n }\n\n if (restParam) {\n args[last] = arguments[last].map(compiledConversions[last]);\n }\n\n return fn.apply(this, args);\n };\n }\n\n let fnPreprocess = fnConvert;\n\n if (hasRestParam(params)) {\n const offset = params.length - 1;\n\n fnPreprocess = function preprocessRestParams() {\n return fnConvert.apply(this, slice(arguments, 0, offset).concat([slice(arguments, offset)]));\n };\n }\n\n return fnPreprocess;\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\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 }); // create optimized conversion functions depending on the number of conversions\n\n switch (conversions.length) {\n case 0:\n return function convertArg(arg) {\n return arg;\n };\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\n return arg;\n };\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\n if (test1(arg)) {\n return conversion1(arg);\n }\n\n return arg;\n };\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\n return arg;\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\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\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\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\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 } // recurse over the groups with types\n\n\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\n return _splitParams(params, 0, []);\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\n\n function conflicting(params1, params2) {\n const ii = Math.max(params1.length, params2.length);\n\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\n for (name of typeSet2) {\n if (typeSet1.has(name)) {\n overlap = true;\n break;\n }\n }\n\n if (!overlap) {\n return false;\n }\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 * 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\n\n function clearResolutions(functionList) {\n return functionList.map(fn => {\n if (isReferToSelf(fn)) {\n return referToSelf(fn.referToSelf.callback);\n }\n\n if (isReferTo(fn)) {\n return makeReferTo(fn.referTo.references, fn.referTo.callback);\n }\n\n return fn;\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\n\n function collectResolutions(references, functionList, signatureMap) {\n const resolvedReferences = [];\n let reference;\n\n for (reference of references) {\n let resolution = signatureMap[reference];\n\n if (typeof resolution !== 'number') {\n throw new TypeError('No definition for referenced signature \"' + reference + '\"');\n }\n\n resolution = functionList[resolution];\n\n if (typeof resolution !== 'function') {\n return false;\n }\n\n resolvedReferences.push(resolution);\n }\n\n return resolvedReferences;\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\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\n while (leftUnresolved) {\n leftUnresolved = false;\n let nothingResolved = true;\n\n for (let i = 0; i < resolvedFunctions.length; ++i) {\n if (isResolved[i]) continue;\n const fn = resolvedFunctions[i];\n\n if (isReferToSelf(fn)) {\n resolvedFunctions[i] = fn.referToSelf.callback(self); // Preserve reference in case signature is reused someday:\n\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\n if (resolvedReferences) {\n resolvedFunctions[i] = fn.referTo.callback.apply(this, resolvedReferences); // Preserve reference in case signature is reused someday:\n\n resolvedFunctions[i].referTo = fn.referTo;\n isResolved[i] = true;\n nothingResolved = false;\n } else {\n leftUnresolved = true;\n }\n }\n }\n\n if (nothingResolved && leftUnresolved) {\n throw new SyntaxError('Circular reference detected in resolving typed.referTo');\n }\n }\n\n return resolvedFunctions;\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\n\n function validateDeprecatedThis(signaturesMap) {\n // TODO: remove this deprecation warning logic some day (it's introduced in v3)\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\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 * 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\n\n function createTypedFunction(name, rawSignaturesMap) {\n typed.createCount++;\n\n if (Object.keys(rawSignaturesMap).length === 0) {\n throw new SyntaxError('No signatures provided');\n }\n\n if (typed.warnAgainstDeprecatedThis) {\n validateDeprecatedThis(rawSignaturesMap);\n } // Main processing loop for signatures\n\n\n const parsedParams = [];\n const originalFunctions = [];\n const signaturesMap = {};\n const preliminarySignatures = []; // may have duplicates from conversions\n\n let signature;\n\n for (signature in rawSignaturesMap) {\n // A) Protect against polluted Object prototype:\n if (!Object.prototype.hasOwnProperty.call(rawSignaturesMap, signature)) {\n continue;\n } // B) Parse the signature\n\n\n const params = parseSignature(signature);\n if (!params) continue; // C) Check for conflicts\n\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); // D) Store the provided function and add conversions\n\n const functionIndex = originalFunctions.length;\n originalFunctions.push(rawSignaturesMap[signature]);\n const conversionParams = params.map(expandParam); // E) Split the signatures and collect them up\n\n let sp;\n\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\n if (sp.every(p => !p.hasConversion)) {\n signaturesMap[spName] = functionIndex;\n }\n }\n }\n\n preliminarySignatures.sort(compareSignatures); // Note the forward reference to theTypedFn\n\n const resolvedFunctions = resolveReferences(originalFunctions, signaturesMap, theTypedFn); // Fill in the proper function for each signature\n\n let s;\n\n for (s in signaturesMap) {\n if (Object.prototype.hasOwnProperty.call(signaturesMap, s)) {\n signaturesMap[s] = resolvedFunctions[signaturesMap[s]];\n }\n }\n\n const signatures = [];\n const internalSignatureMap = new Map(); // benchmarks faster than object\n\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 } // we create a highly optimized checks for the first couple of signatures with max 2 arguments\n\n\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; // compile the tests\n\n for (let i = 0; i < signatures.length; ++i) {\n signatures[i].test = compileTests(signatures[i].params);\n }\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; // compile the functions\n\n for (let i = 0; i < signatures.length; ++i) {\n signatures[i].implementation = compileArgsPreprocessing(signatures[i].params, signatures[i].fn);\n }\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; // simple and generic, but also slow\n\n const iStart = allOk ? 6 : 0;\n const iEnd = signatures.length; // de-reference ahead for execution speed:\n\n const tests = signatures.map(s => s.test);\n const fns = signatures.map(s => s.implementation);\n\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\n return typed.onMismatch(name, arguments, signatures);\n }; // create the typed function\n // fast, specialized version. Falls back to the slower, generic one if needed\n\n\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\n if (arguments.length === len1 && test10(arg0) && test11(arg1)) {\n return fn1.apply(this, arguments);\n }\n\n if (arguments.length === len2 && test20(arg0) && test21(arg1)) {\n return fn2.apply(this, arguments);\n }\n\n if (arguments.length === len3 && test30(arg0) && test31(arg1)) {\n return fn3.apply(this, arguments);\n }\n\n if (arguments.length === len4 && test40(arg0) && test41(arg1)) {\n return fn4.apply(this, arguments);\n }\n\n if (arguments.length === len5 && test50(arg0) && test51(arg1)) {\n return fn5.apply(this, arguments);\n }\n\n return generic.apply(this, arguments);\n } // attach name the typed function\n\n\n try {\n Object.defineProperty(theTypedFn, 'name', {\n value: name\n });\n } catch (err) {// 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 } // 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\n\n theTypedFn.signatures = signaturesMap; // Store internal data for functions like resolve, find, etc.\n // Also serves as the flag that this is a typed-function\n\n theTypedFn._typedFunctionData = {\n signatures,\n signatureMap: internalSignatureMap\n };\n return theTypedFn;\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\n\n function _onMismatch(name, args, signatures) {\n throw createError(name, args, signatures);\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\n\n function initial(arr) {\n return slice(arr, 0, arr.length - 1);\n }\n /**\n * return the last item of an array or function Arguments\n * @param {Array | Arguments} arr\n * @return {*}\n */\n\n\n function last(arr) {\n return arr[arr.length - 1];\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\n\n function slice(arr, start, end) {\n return Array.prototype.slice.call(arr, start, end);\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\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\n return undefined;\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\n\n function flatMap(arr, callback) {\n return Array.prototype.concat.apply([], arr.map(callback));\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\n\n function referTo() {\n const references = initial(arguments).map(s => stringifyParams(parseSignature(s)));\n const callback = last(arguments);\n\n if (typeof callback !== 'function') {\n throw new TypeError('Callback function expected as last argument');\n }\n\n return makeReferTo(references, callback);\n }\n\n function makeReferTo(references, callback) {\n return {\n referTo: {\n references,\n callback\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\n\n function referToSelf(callback) {\n if (typeof callback !== 'function') {\n throw new TypeError('Callback function expected as first argument');\n }\n\n return {\n referToSelf: {\n callback\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\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 * 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\n\n function isReferToSelf(objectOrFn) {\n return objectOrFn && typeof objectOrFn.referToSelf === 'object' && typeof objectOrFn.referToSelf.callback === 'function';\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\n\n function checkName(nameSoFar, newName) {\n if (!nameSoFar) {\n return newName;\n }\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\n return nameSoFar;\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\n\n function getObjectName(obj) {\n let name;\n\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\n return name;\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\n\n function mergeSignatures(dest, source) {\n let key;\n\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 } // else: both signatures point to the same function, that's fine\n\n }\n\n dest[key] = source[key];\n }\n }\n }\n\n const saveTyped = typed;\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\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\n for (let i = start; i < arguments.length; ++i) {\n const item = arguments[i];\n let theseSignatures = {};\n let thisName;\n\n if (typeof item === 'function') {\n thisName = item.name;\n\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\n if (!named) {\n thisName = getObjectName(item);\n }\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\n if (!named) {\n name = checkName(name, thisName);\n }\n\n mergeSignatures(allSignatures, theseSignatures);\n }\n\n return createTypedFunction(name || '', allSignatures);\n };\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\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 * 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\n typed.addType = function (type, beforeObjectTest) {\n let before = 'any';\n\n if (beforeObjectTest !== false && typeMap.has('Object')) {\n before = 'Object';\n }\n\n typed.addTypes([type], before);\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\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\n if (conversion.to === conversion.from) {\n throw new SyntaxError('Illegal to define conversion from \"' + conversion.from + '\" to itself.');\n }\n }\n /**\n * Add a conversion\n *\n * @param {ConversionDef} conversion\n * @returns {void}\n * @throws {TypeError}\n */\n\n\n typed.addConversion = function (conversion) {\n _validateConversion(conversion);\n\n const to = findType(conversion.to);\n\n if (to.conversionsTo.every(function (other) {\n return other.from !== conversion.from;\n })) {\n to.conversionsTo.push({\n from: conversion.from,\n convert: conversion.convert,\n index: nConversions++\n });\n } else {\n throw new Error('There is already a conversion from \"' + conversion.from + '\" to \"' + to.name + '\"');\n }\n };\n /**\n * Convenience wrapper to call addConversion on each conversion in a list.\n *\n @param {ConversionDef[]} conversions\n @returns {void}\n @throws {TypeError}\n */\n\n\n typed.addConversions = function (conversions) {\n conversions.forEach(typed.addConversion);\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\n\n typed.removeConversion = function (conversion) {\n _validateConversion(conversion);\n\n const to = findType(conversion.to);\n const existingConversion = findInArray(to.conversionsTo, c => c.from === conversion.from);\n\n if (!existingConversion) {\n throw new Error('Attempt to remove nonexistent conversion from ' + conversion.from + ' to ' + conversion.to);\n }\n\n if (existingConversion.convert !== conversion.convert) {\n throw new Error('Conversion to remove does not match existing conversion');\n }\n\n const index = to.conversionsTo.indexOf(existingConversion);\n to.conversionsTo.splice(index, 1);\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\n\n typed.resolve = function (tf, argList) {\n if (!isTypedFunction(tf)) {\n throw new TypeError(NOT_TYPED_FUNCTION);\n }\n\n const sigs = tf._typedFunctionData.signatures;\n\n for (let i = 0; i < sigs.length; ++i) {\n if (sigs[i].test(argList)) {\n return sigs[i];\n }\n }\n\n return null;\n };\n\n return typed;\n}\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", "/**\n * @license Fraction.js v4.3.0 20/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(function(root) {\n\n \"use strict\";\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\n var MAX_CYCLE_LEN = 2000;\n\n // Parsed data to avoid calling \"new\" all the time\n var P = {\n \"s\": 1,\n \"n\": 0,\n \"d\": 1\n };\n\n function 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\n function 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\n function 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\n var 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\n function 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\n function 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\n function 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\n function 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 */\n 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\n var DivisionByZero = function() { return new Error(\"Division by Zero\"); };\n var InvalidParameter = function() { return new Error(\"Invalid argument\"); };\n var NonIntegerParameter = function() { return new Error(\"Parameters must be integer\"); };\n\n Fraction.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 numbers\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 * 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\n if (typeof exports === \"object\") {\n Object.defineProperty(Fraction, \"__esModule\", { 'value': true });\n Fraction['default'] = Fraction;\n Fraction['Fraction'] = Fraction;\n module['exports'] = Fraction;\n } else {\n root['Fraction'] = Fraction;\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';", "export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}", "export var DEFAULT_CONFIG = {\n // minimum relative difference between two compared values,\n // used by all comparison functions\n epsilon: 1e-12,\n // type of default matrix output. Choose 'matrix' (default) or 'array'\n matrix: 'Matrix',\n // type of default number output. Choose 'number' (default) 'BigNumber', or 'Fraction\n number: '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, mapObject, 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} epsilon\n * Minimum relative 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 * {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 var prev = mapObject(config, clone);\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 = mapObject(config, clone);\n var changes = mapObject(options, clone);\n\n // emit 'config' event\n emit('config', curr, prev, changes);\n return curr;\n } else {\n return mapObject(config, clone);\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 * Test whether an Array contains a specific item.\n * @param {Array.} array\n * @param {string} item\n * @return {boolean}\n */\nfunction contains(array, item) {\n return array.indexOf(item) !== -1;\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 && !contains(values, 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 === '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.indexOf('.') !== -1;\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 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 { 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 } 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: '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\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47\\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\\uA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AF\\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-\\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DE5B\\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]|\\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\\u09B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\\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-\\u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DF39\\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\\u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\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]|\\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: '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: '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: '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 * 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} x First value to compare\n * @param {number} y Second value to compare\n * @param {number} [epsilon] The maximum relative difference between x and y\n * If epsilon is undefined or null, the function will\n * test whether x and y are exactly equal.\n * @return {boolean} whether the two numbers are nearly equal\n*/\nexport function nearlyEqual(x, y, epsilon) {\n // if epsilon is null or undefined, test whether x and y are exactly equal\n if (epsilon === null || epsilon === undefined) {\n return x === y;\n }\n if (x === y) {\n return true;\n }\n\n // NaN\n if (isNaN(x) || isNaN(y)) {\n return false;\n }\n\n // at this point x and y should be finite\n if (isFinite(x) && isFinite(y)) {\n // check numbers are very close, needed when comparing numbers near zero\n var diff = Math.abs(x - y);\n if (diff <= DBL_EPSILON) {\n return true;\n } else {\n // use relative error\n return diff <= Math.max(Math.abs(x), Math.abs(y)) * epsilon;\n }\n }\n\n // Infinite and Number or negative Infinite and positive Infinite cases\n return false;\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 { contains } from './array.js';\nimport { 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 (contains(factory.dependencies, 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 _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 * Test whether an array or string contains an item\n * @param {Array | string} array\n * @param {*} item\n * @return {boolean}\n */\nexport function contains(array, item) {\n return array.indexOf(item) !== -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.indexOf('e') !== -1) {\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;", "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});", "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});", "// 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 | 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 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';\nvar name = 'isNegative';\nvar dependencies = ['typed'];\nexport var createIsNegative = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\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 | 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: isNegativeNumber,\n BigNumber: function BigNumber(x) {\n return x.isNeg() && !x.isZero() && !x.isNaN();\n },\n Fraction: function Fraction(x) {\n return x.s < 0; // 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;", "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(500)) // 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 | 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.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';\nvar name = 'isPositive';\nvar dependencies = ['typed'];\nexport var createIsPositive = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\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 | 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: isPositiveNumber,\n BigNumber: function BigNumber(x) {\n return !x.isNeg() && !x.isZero() && !x.isNaN();\n },\n Fraction: function Fraction(x) {\n return x.s > 0 && x.n > 0;\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 { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { isZeroNumber } from '../../plain/number/index.js';\nvar name = 'isZero';\nvar dependencies = ['typed'];\nexport var createIsZero = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\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 | 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: isZeroNumber,\n BigNumber: function BigNumber(x) {\n return x.isZero();\n },\n Complex: function Complex(x) {\n return x.re === 0 && x.im === 0;\n },\n Fraction: function Fraction(x) {\n return x.d === 1 && x.n === 0;\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 { 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 | 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 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(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 | Fraction | boolean | Complex | Unit} x First value to compare\n * @param {number | BigNumber | 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.epsilon);\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return x.eq(y) || bigNearlyEqual(x, y, config.epsilon);\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.epsilon);\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.epsilon);\n }\n });\n});", "/**\n * Compares two BigNumbers.\n * @param {BigNumber} x First value to compare\n * @param {BigNumber} y Second value to compare\n * @param {number} [epsilon] The maximum relative difference between x and y\n * If epsilon is undefined or null, the function will\n * test whether x and y are exactly equal.\n * @return {boolean} whether the two numbers are nearly equal\n */\nexport function nearlyEqual(x, y, epsilon) {\n // if epsilon is null or undefined, test whether x and y are exactly equal\n if (epsilon === null || epsilon === undefined) {\n return x.eq(y);\n }\n\n // use \"==\" operator, handles infinities\n if (x.eq(y)) {\n return true;\n }\n\n // NaN\n if (x.isNaN() || y.isNaN()) {\n return false;\n }\n\n // at this point x and y should be finite\n if (x.isFinite() && y.isFinite()) {\n // check numbers are very close, needed when comparing numbers near zero\n var diff = x.minus(y).abs();\n if (diff.isZero()) {\n return true;\n } else {\n // use relative error\n var max = x.constructor.max(x.abs(), y.abs());\n return diff.lte(max.times(epsilon));\n }\n }\n\n // Infinite and Number or negative Infinite and positive Infinite cases\n return false;\n}", "import { nearlyEqual } from './number.js';\n\n/**\n * Test whether two complex values are equal provided a given epsilon.\n * Does not use or change the global Complex.EPSILON setting\n * @param {Complex} x\n * @param {Complex} y\n * @param {number} epsilon\n * @returns {boolean}\n */\nexport function complexEquals(x, y, epsilon) {\n return nearlyEqual(x.re, y.re, epsilon) && nearlyEqual(x.im, y.im, epsilon);\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, boolean, 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 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';\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 * boolean, complex, index, matrix, string, unit\n *\n * @param {number | string | Fraction | BigNumber | 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 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 | 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 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 | Fraction | Complex | Unit | Array | Matrix} x Number to be inverted.\n * @return {number | BigNumber | 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 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';\nvar name = 'unaryPlus';\nvar dependencies = ['typed', 'config', 'BigNumber'];\nexport var createUnaryPlus = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n BigNumber\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 | Fraction | string | Complex | Unit | Array | Matrix} x\n * Input value\n * @return {number | BigNumber | 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 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 | string': function booleanString(x) {\n // convert to a number or bignumber\n return config.number === 'BigNumber' ? new BigNumber(+x) : +x;\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 | Fraction | Complex | Array | Matrix | Unit} x\n * A number or matrix for which to get the absolute value\n * @return {number | BigNumber | 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 // 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 | Fraction | Complex | Unit} x First value to add\n * @param {number | BigNumber | Fraction | Complex} y Second value to add\n * @return {number | BigNumber | 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 '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 | Fraction | Complex | Unit} x First value\n * @param {number | BigNumber | Fraction | Complex} y Second value to be subtracted from `x`\n * @return {number | BigNumber | 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 '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.epsilon)) {\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.epsilon)) {\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.epsilon)) {\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.epsilon)) {\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 | Fraction | Complex | Unit} x Number for which to calculate the cube\n * @return {number | BigNumber | 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 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.epsilon)) {\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.epsilon)) {\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.epsilon)) {\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.epsilon)) {\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 | Fraction | Array | Matrix} x Dividend\n * @param {number | BigNumber | Fraction | Array | Matrix} y Divisor\n * @return {number | BigNumber | 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 '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 | Fraction | Complex | Unit} x First value to multiply\n * @param {number | BigNumber | Fraction | Complex} y Second value to multiply\n * @return {number | BigNumber | 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 '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 | Fraction | Complex | Unit | Array | Matrix} x First value to multiply\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Second value to multiply\n * @return {number | BigNumber | 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 | Fraction | Complex | Array | Matrix | Unit} x\n * The number for which to determine the sign\n * @return {number | BigNumber | 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 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 | Fraction | Complex | Unit} x\n * Number for which to calculate the square\n * @return {number | BigNumber | 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 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 | Fraction | Complex | Unit | Array | Matrix} x Initial value\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Value to subtract from `x`\n * @return {number | BigNumber | 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 | Array | Matrix} x First value to and\n * @param {number | BigNumber | Array | Matrix} y Second value to and\n * @return {number | BigNumber | Array | Matrix} AND of `x` and `y`\n */\n return typed(name, {\n 'number, number': bitAndNumber,\n 'BigNumber, BigNumber': bitAndBigNumber\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 | Array | Matrix} x Value to not\n * @return {number | BigNumber | Array | Matrix} NOT of `x`\n */\n return typed(name, {\n number: bitNotNumber,\n BigNumber: bitNotBigNumber,\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 | Array | Matrix} x First value to or\n * @param {number | BigNumber | Array | Matrix} y Second value to or\n * @return {number | BigNumber | Array | Matrix} OR of `x` and `y`\n */\n return typed(name, {\n 'number, number': bitOrNumber,\n 'BigNumber, BigNumber': bitOrBigNumber\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 | Array | Matrix} x First value to xor\n * @param {number | BigNumber | Array | Matrix} y Second value to xor\n * @return {number | BigNumber | Array | Matrix} XOR of `x` and `y`\n */\n return typed(name, {\n 'number, number': bitXorNumber,\n 'BigNumber, BigNumber': bigBitXor\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 | 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 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 | Complex | Unit | Array | Matrix} x First value to check\n * @param {number | BigNumber | 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 '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 | Complex | Unit | Array | Matrix} x First value to check\n * @param {number | BigNumber | 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 '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\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}", "import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}", "export 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}", "import _typeof from \"./typeof.js\";\nexport default function 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}", "/* 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 // epsilon is for example 1e-12. Extract the positive exponent 12 from that\n return Math.abs(Math.log10(config.epsilon));\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 { 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, config.number);\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).indexOf('Unexpected type') !== -1) {\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).indexOf('complex numbers') !== -1) {\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 | 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 * 0 !== 0) {\n return false;\n }\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 BigNumber: function BigNumber(n) {\n if (n.toNumber() * 0 !== 0) {\n return false;\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 Fraction: fraction ? x => fraction(x) : noFraction\n };\n\n /**\n * Convert a numeric input to a specific numeric type: number, BigNumber, 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', '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, string, format\n *\n * @param {string | number | BigNumber | 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 | 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 | Fraction | Complex | Unit} x Numerator\n * @param {number | BigNumber | Fraction | Complex} y Denominator\n * @return {number | BigNumber | 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 '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 | Complex | Unit | Array | Matrix} x The base\n * @param {number | BigNumber | Complex} y The exponent\n * @return {number | BigNumber | 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 '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 epsilon precision\n var xEpsilon = roundNumber(x, toExponent(config.epsilon));\n var xSelected = nearlyEqual(x, xEpsilon, config.epsilon) ? xEpsilon : x;\n return roundNumber(xSelected);\n },\n 'number, number': function numberNumber(x, n) {\n // Same as number: unless user specifies more decimals than epsilon\n var epsilonExponent = toExponent(config.epsilon);\n if (n >= epsilonExponent) {\n return roundNumber(x, n);\n }\n var xEpsilon = roundNumber(x, epsilonExponent);\n var xSelected = nearlyEqual(x, xEpsilon, config.epsilon) ? 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 epsilon precision\n var xEpsilon = new _BigNumber(x).toDecimalPlaces(toExponent(config.epsilon));\n var xSelected = bigNearlyEqual(x, xEpsilon, config.epsilon) ? 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 epsilon\n var epsilonExponent = toExponent(config.epsilon);\n if (n >= epsilonExponent) {\n return x.toDecimalPlaces(n.toNumber());\n }\n var xEpsilon = x.toDecimalPlaces(epsilonExponent);\n var xSelected = bigNearlyEqual(x, xEpsilon, config.epsilon) ? 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 | Array | Matrix} x Value to be shifted\n * @param {number | BigNumber} y Amount of shifts\n * @return {number | BigNumber | Array | Matrix} `x` shifted left `y` times\n */\n return typed(name, {\n 'number, number': leftShiftNumber,\n 'BigNumber, BigNumber': leftShiftBigNumber,\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 | Array | Matrix} x Value to be shifted\n * @param {number | BigNumber} y Amount of shifts\n * @return {number | BigNumber | Array | Matrix} `x` zero-filled shifted right `y` times\n */\n return typed(name, {\n 'number, number': rightArithShiftNumber,\n 'BigNumber, BigNumber': rightArithShiftBigNumber,\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 | Complex | Unit | Array | Matrix} x First value to check\n * @param {number | BigNumber | 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 '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 epsilon. 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 | Fraction | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | Fraction | Unit | string | Array | Matrix} y Second value to compare\n * @return {number | BigNumber | 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.epsilon) ? new BigNumber(0) : new BigNumber(x.cmp(y));\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.epsilon) ? 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 epsilon.\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 epsilon. 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 | boolean | Complex | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | 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 epsilon. 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 | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | 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.epsilon);\n },\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.epsilon);\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 epsilon. 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 | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | 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.epsilon);\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 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.epsilon);\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 epsilon. 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 | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | 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.epsilon);\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 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.epsilon);\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 epsilon. 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 | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | 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.epsilon);\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.epsilon);\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 epsilon. 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 { 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, config.number);\n }\n return res;\n }\n});", "import { containsCollections, deepForEach, reduce } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.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, config.number);\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.formatUnits(),\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 unit = new Unit(json.value, json.unit);\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 | Fraction | Complex | Unit | Array | Matrix} x First value to add\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Second value to add\n * @return {number | BigNumber | 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, 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 '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 '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 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 { 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, modulus\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 = parsePercentage(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 = parsePercentage(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 * percentage or mod\n * @return {Node} node\n * @private\n */\n function parsePercentage(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.indexOf(name) !== -1) {\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.indexOf(state.token) !== -1)) {\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 return new ConstantNode(numeric(numberStr, config.number));\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 { 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 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', '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', '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, or Fraction.',\n examples: ['numeric(\"4\")', 'numeric(\"4\", \"number\")', 'numeric(\"4\", \"BigNumber\")', 'numeric(\"4\", \"Fraction\")', 'numeric(4, \"Fraction\")', 'numeric(fraction(2, 5), \"number\")'],\n seealso: ['number', '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.epsilon, 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.epsilon;\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.epsilon;\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.epsilon) {\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.epsilon) {\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 | Fraction | Complex | Unit | Array | Matrix} x Numerator\n * @param {number | BigNumber | Fraction | Complex | Array | Matrix} y Denominator\n * @return {number | BigNumber | 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.epsilon)) {\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 { 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, config.number);\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.indexOf('median') !== -1) {\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.indexOf(' variance') !== -1) {\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 { 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 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 if (config.number === 'BigNumber') {\n if (bignumber === undefined) {\n noBignumber();\n }\n return bignumber(s);\n } else if (config.number === '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 '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 '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.indexOf(node.name) === -1) {\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';\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.indexOf(varName) === -1) {\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 || config.number));\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.indexOf(node.op) === -1) {\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 ('+-*^'.indexOf(node.op) === -1) 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 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 = '12.4.2';\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 { 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 } 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} epsilon\n * Minimum relative 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 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 { contains } from '../../utils/array.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 (contains(name, '.')) {\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 (contains(dependency, '.')) {\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 exports.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.indexOf('.') === -1 &&\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,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cG9seWxpbmUgcG9pbnRzPSI2IDkgNiAyIDE4IDIgMTggOSIgLz4KICA8cGF0aCBkPSJNNiAxOEg0YTIgMiAwIDAgMS0yLTJ2LTVhMiAyIDAgMCAxIDItMmgxNmEyIDIgMCAwIDEgMiAydjVhMiAyIDAgMCAxLTIgMmgtMiIgLz4KICA8cmVjdCB3aWR0aD0iMTIiIGhlaWdodD0iOCIgeD0iNiIgeT0iMTQiIC8+Cjwvc3ZnPgo=) - 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 ['polyline', { points: '6 9 6 2 18 2 18 9' }],\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 ['rect', { width: '12', height: '8', x: '6', y: '14' }],\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.1\",\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.0.6\",\n \"electron-builder\": \"^24.13.3\",\n \"esbuild\": \"^0.21.3\",\n \"esbuild-plugin-polyfill-node\": \"^0.3.0\",\n \"eslint\": \"^9.3.0\",\n \"fs-extra\": \"^11.2.0\",\n \"function-plot\": \"^1.24.4\",\n \"lucide\": \"^0.372.0\",\n \"luxon\": \"^3.4.4\",\n \"mathjs\": \"^12.4.2\",\n \"mousetrap\": \"^1.6.5\",\n \"mousetrap-global-bind\": \"^1.1.0\",\n \"prettier\": \"^3.2.5\",\n \"uikit\": \"^3.21.1\"\n },\n \"dependencies\": {\n \"electron-log\": \"^5.1.4\",\n \"electron-store\": \"^9.0.0\",\n \"electron-updater\": \"^6.1.8\"\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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d,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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ACH,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,YAAa,EACf,CACF,EACA,cAAe,CACb,IAAK,CACH,YAAa,EACf,CAC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cAAe,IAAM,CAC3C,IAAMkD,EAAY,SAAS,cAAc,KAAK,EAE9CA,EAAU,aAAa,KAAM,WAAW,EACxCA,EAAU,UAAY,YACtBA,EAAU,UAAY;AAAA,8CACsBnD,EAAI;AAAA;AAAA,2BAEvBK,GAAI,SAAS,OAAS,cAAgB,EAAE;AAAA;AAAA,qBAE9CA,GAAI,SAAS,QAAQ;AAAA,uBACnBA,GAAI,SAAS,UAAU;AAAA,uBACvBA,GAAI,SAAS,UAAU;AAAA,OAG5C,SAAS,KAAK,YAAY8C,CAAS,EAEnCrC,GAAG,SAAUsC,GAAS,CACpB,IAAMC,EAASvC,GAAG,cAAcsC,CAAI,EAC9BE,EAAQxC,GAAG,QAAQuC,CAAM,EACzBE,EAAS/D,GAAE,SAAS,EAAE,SAAS6D,CAAM,EAAE,UACvCG,EAAM;AAAA;AAAA,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", "coverEl", "getCoveringElement", "dist", "k", "scrolledOver", "startOffset", "endOffset", "scrollParent", "viewportHeight", "elementOffsetTop", "end", "scrollable", "scrollEl", "ancestors", "fixedIndex", "window", "viewportElement", "scale", "subpixel", "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", "percent2", "linear", "triggerUpdate$1", "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", "navLength", "selNavItem", "parallax", "keyCode", "active", "Slider", "speedUp", "stack", "queueIndex", "reset", "getDirection", "transitioner", "Slideshow", "Animations2", "Animations$1", "LightboxPanel", "close", "closeLabel", "selCaption", "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", "triggerUpdate", "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", "getPositionedElements", "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", "searchMedium", "searchLarge", "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", "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", "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_fraction", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "root", "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", "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", "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", "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", "target", "i", "source", "key", "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", "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", "prev", "mapObject", "clone", "validateOption", "deepExtend", "curr", "changes", "DEFAULT_CONFIG", "key", "contains", "array", "item", "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", "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", "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", "str", "splitValue", "p", "pp", "first", "lowerExp", "_toNumberOrDefault", "upperExp", "removed", "length", "arr", "DBL_EPSILON", "nearlyEqual", "y", "epsilon", "diff", "acosh", "asinh", "atanh", "cosh", "sinh", "tanh", "copysign", "signx", "signy", "onError", "defaultValue", "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", "contains", "array", "item", "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", "Asize", "arraySize", "deepStrictEqual", "broadcastedSize", "paddedSize", "clone", "reshape", "stretch", "stretch", "arrayToStretch", "sizeToStretch", "dimToStretch", "concat", "clone", "array", "_extends", "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", "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", "import_fraction", "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", "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", "name", "dependencies", "createIsNegative", "factory", "_ref", "typed", "isNegativeNumber", "x", "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", "isPositiveNumber", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIsZero", "factory", "_ref", "typed", "isZeroNumber", "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", "nearlyEqual", "x", "y", "epsilon", "diff", "max", "init_dirname", "init_buffer", "init_process", "complexEquals", "x", "y", "epsilon", "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", "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", "BigNumber", "unaryPlusNumber", "x", "self", "deepMap", "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", "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", "b", "args", "res", "i", "lcmNumber", "_lcmBigNumber", "x", "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", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createBitNot", "factory", "_ref", "typed", "bitNotNumber", "bitNotBigNumber", "self", "x", "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", "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", "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", "obj", "key", "value", "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", "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", "self", "x", "y", "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", "self", "x", "y", "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", "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", "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", "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", "parsePercentage", "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", "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", "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", "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", "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", "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", "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", "contains", "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", "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"] } diff --git a/package-lock.json b/package-lock.json index 9150c80..af0732a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "numara", - "version": "5.1.0", + "version": "5.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "numara", - "version": "5.1.0", + "version": "5.1.1", "license": "MIT", "dependencies": { "electron-log": "^5.1.4", @@ -18,11 +18,11 @@ "@formulajs/formulajs": "^4.4.4", "codemirror": "^5.65.16", "deep-diff": "^1.0.2", - "electron": "^30.0.4", + "electron": "^30.0.6", "electron-builder": "^24.13.3", - "esbuild": "^0.21.2", + "esbuild": "^0.21.3", "esbuild-plugin-polyfill-node": "^0.3.0", - "eslint": "^9.2.0", + "eslint": "^9.3.0", "fs-extra": "^11.2.0", "function-plot": "^1.24.4", "lucide": "^0.372.0", @@ -31,7 +31,7 @@ "mousetrap": "^1.6.5", "mousetrap-global-bind": "^1.1.0", "prettier": "^3.2.5", - "uikit": "^3.20.10" + "uikit": "^3.21.1" } }, "node_modules/@babel/runtime": { @@ -39,6 +39,7 @@ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.5.tgz", "integrity": "sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==", "dev": true, + "license": "MIT", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -51,6 +52,7 @@ "resolved": "https://registry.npmjs.org/@develar/schema-utils/-/schema-utils-2.6.5.tgz", "integrity": "sha512-0cp4PsWQ/9avqTVMCtZ+GirikIA36ikvjtHweU4/j8yLtgObI0+JUPhYFScgwlteveGB1rt3Cm8UhN04XayDig==", "dev": true, + "license": "MIT", "dependencies": { "ajv": "^6.12.0", "ajv-keywords": "^3.4.1" @@ -68,6 +70,7 @@ "resolved": "https://registry.npmjs.org/@electron/asar/-/asar-3.2.10.tgz", "integrity": "sha512-mvBSwIBUeiRscrCeJE1LwctAriBj65eUDm0Pc11iE5gRwzkmsdbS7FnZ1XUWjpSeQWL1L5g12Fc/SchPM9DUOw==", "dev": true, + "license": "MIT", "dependencies": { "commander": "^5.0.0", "glob": "^7.1.6", @@ -85,6 +88,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -95,6 +99,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -107,6 +112,7 @@ "resolved": "https://registry.npmjs.org/@electron/get/-/get-2.0.3.tgz", "integrity": "sha512-Qkzpg2s9GnVV2I2BjRksUi43U5e6+zaQMcjoJy0C+C5oxaKl+fmckGDQFtRpZpZV0NQekuZZ+tGz7EA9TVnQtQ==", "dev": true, + "license": "MIT", "dependencies": { "debug": "^4.1.1", "env-paths": "^2.2.0", @@ -128,6 +134,7 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", @@ -142,6 +149,7 @@ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", "dev": true, + "license": "MIT", "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -151,6 +159,7 @@ "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4.0.0" } @@ -160,6 +169,7 @@ "resolved": "https://registry.npmjs.org/@electron/notarize/-/notarize-2.2.1.tgz", "integrity": "sha512-aL+bFMIkpR0cmmj5Zgy0LMKEpgy43/hw5zadEArgmAMWWlKc5buwFvFT9G/o/YJkvXAJm5q3iuTuLaiaXW39sg==", "dev": true, + "license": "MIT", "dependencies": { "debug": "^4.1.1", "fs-extra": "^9.0.1", @@ -174,6 +184,7 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", "dev": true, + "license": "MIT", "dependencies": { "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", @@ -189,6 +200,7 @@ "resolved": "https://registry.npmjs.org/@electron/osx-sign/-/osx-sign-1.0.5.tgz", "integrity": "sha512-k9ZzUQtamSoweGQDV2jILiRIHUu7lYlJ3c6IEmjv1hC17rclE+eb9U+f6UFlOOETo0JzY1HNlXy4YOlCvl+Lww==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "compare-version": "^0.1.2", "debug": "^4.3.4", @@ -210,6 +222,7 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -224,6 +237,7 @@ "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz", "integrity": "sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8.0.0" }, @@ -236,6 +250,7 @@ "resolved": "https://registry.npmjs.org/@electron/universal/-/universal-1.5.1.tgz", "integrity": "sha512-kbgXxyEauPJiQQUNG2VgUeyfQNFk6hBF11ISN2PNI6agUgPl55pv4eQmaqHzTAzchBvqZ2tQuRVaPStGf0mxGw==", "dev": true, + "license": "MIT", "dependencies": { "@electron/asar": "^3.2.1", "@malept/cross-spawn-promise": "^1.1.0", @@ -254,6 +269,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -264,6 +280,7 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", "dev": true, + "license": "MIT", "dependencies": { "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", @@ -279,6 +296,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -287,13 +305,14 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.2.tgz", - "integrity": "sha512-/c7hocx0pm14bHQlqUVKmxwdT/e5/KkyoY1W8F9lk/8CkE037STDDz8PXUP/LE6faj2HqchvDs9GcShxFhI78Q==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.3.tgz", + "integrity": "sha512-yTgnwQpFVYfvvo4SvRFB0SwrW8YjOxEoT7wfMT7Ol5v7v5LDNvSGo67aExmxOb87nQNeWPVvaGBNfQ7BXcrZ9w==", "cpu": [ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "aix" @@ -303,13 +322,14 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.2.tgz", - "integrity": "sha512-G1ve3b4FeyJeyCjB4MX1CiWyTaIJwT9wAYE+8+IRA53YoN/reC/Bf2GDRXAzDTnh69Fpl+1uIKg76DiB3U6vwQ==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.3.tgz", + "integrity": "sha512-bviJOLMgurLJtF1/mAoJLxDZDL6oU5/ztMHnJQRejbJrSc9FFu0QoUoFhvi6qSKJEw9y5oGyvr9fuDtzJ30rNQ==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -319,13 +339,14 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.2.tgz", - "integrity": "sha512-SGZKngoTWVUriO5bDjI4WDGsNx2VKZoXcds+ita/kVYB+8IkSCKDRDaK+5yu0b5S0eq6B3S7fpiEvpsa2ammlQ==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.3.tgz", + "integrity": "sha512-c+ty9necz3zB1Y+d/N+mC6KVVkGUUOcm4ZmT5i/Fk5arOaY3i6CA3P5wo/7+XzV8cb4GrI/Zjp8NuOQ9Lfsosw==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -335,13 +356,14 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.2.tgz", - "integrity": "sha512-1wzzNoj2QtNkAYwIcWJ66UTRA80+RTQ/kuPMtEuP0X6dp5Ar23Dn566q3aV61h4EYrrgGlOgl/HdcqN/2S/2vg==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.3.tgz", + "integrity": "sha512-JReHfYCRK3FVX4Ra+y5EBH1b9e16TV2OxrPAvzMsGeES0X2Ndm9ImQRI4Ket757vhc5XBOuGperw63upesclRw==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -351,13 +373,14 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.2.tgz", - "integrity": "sha512-ZyMkPWc5eTROcLOA10lEqdDSTc6ds6nuh3DeHgKip/XJrYjZDfnkCVSty8svWdy+SC1f77ULtVeIqymTzaB6/Q==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.3.tgz", + "integrity": "sha512-U3fuQ0xNiAkXOmQ6w5dKpEvXQRSpHOnbw7gEfHCRXPeTKW9sBzVck6C5Yneb8LfJm0l6le4NQfkNPnWMSlTFUQ==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -367,13 +390,14 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.2.tgz", - "integrity": "sha512-K4ZdVq1zP9v51h/cKVna7im7G0zGTKKB6bP2yJiSmHjjOykbd8DdhrSi8V978sF69rkwrn8zCyL2t6I3ei6j9A==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.3.tgz", + "integrity": "sha512-3m1CEB7F07s19wmaMNI2KANLcnaqryJxO1fXHUV5j1rWn+wMxdUYoPyO2TnAbfRZdi7ADRwJClmOwgT13qlP3Q==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -383,13 +407,14 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.2.tgz", - "integrity": "sha512-4kbOGdpA61CXqadD+Gb/Pw3YXamQGiz9mal/h93rFVSjr5cgMnmJd/gbfPRm+3BMifvnaOfS1gNWaIDxkE2A3A==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.3.tgz", + "integrity": "sha512-fsNAAl5pU6wmKHq91cHWQT0Fz0vtyE1JauMzKotrwqIKAswwP5cpHUCxZNSTuA/JlqtScq20/5KZ+TxQdovU/g==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -399,13 +424,14 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.2.tgz", - "integrity": "sha512-ShS+R09nuHzDBfPeMUliKZX27Wrmr8UFp93aFf/S8p+++x5BZ+D344CLKXxmY6qzgTL3mILSImPCNJOzD6+RRg==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.3.tgz", + "integrity": "sha512-tci+UJ4zP5EGF4rp8XlZIdq1q1a/1h9XuronfxTMCNBslpCtmk97Q/5qqy1Mu4zIc0yswN/yP/BLX+NTUC1bXA==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -415,13 +441,14 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.2.tgz", - "integrity": "sha512-nnGXjOAv+7cM3LYRx4tJsYdgy8dGDGkAzF06oIDGppWbUkUKN9SmgQA8H0KukpU0Pjrj9XmgbWqMVSX/U7eeTA==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.3.tgz", + "integrity": "sha512-f6kz2QpSuyHHg01cDawj0vkyMwuIvN62UAguQfnNVzbge2uWLhA7TCXOn83DT0ZvyJmBI943MItgTovUob36SQ==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -431,13 +458,14 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.2.tgz", - "integrity": "sha512-Hdu8BL+AmO+eCDvvT6kz/fPQhvuHL8YK4ExKZfANWsNe1kFGOHw7VJvS/FKSLFqheXmB3rTF3xFQIgUWPYsGnA==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.3.tgz", + "integrity": "sha512-vvG6R5g5ieB4eCJBQevyDMb31LMHthLpXTc2IGkFnPWS/GzIFDnaYFp558O+XybTmYrVjxnryru7QRleJvmZ6Q==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -447,13 +475,14 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.2.tgz", - "integrity": "sha512-m73BOCW2V9lcj7RtEMi+gBfHC6n3+VHpwQXP5offtQMPLDkpVolYn1YGXxOZ9hp4h3UPRKuezL7WkBsw+3EB3Q==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.3.tgz", + "integrity": "sha512-HjCWhH7K96Na+66TacDLJmOI9R8iDWDDiqe17C7znGvvE4sW1ECt9ly0AJ3dJH62jHyVqW9xpxZEU1jKdt+29A==", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -463,13 +492,14 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.2.tgz", - "integrity": "sha512-84eYHwwWHq3myIY/6ikALMcnwkf6Qo7NIq++xH0x+cJuUNpdwh8mlpUtRY+JiGUc60yu7ElWBbVHGWTABTclGw==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.3.tgz", + "integrity": "sha512-BGpimEccmHBZRcAhdlRIxMp7x9PyJxUtj7apL2IuoG9VxvU/l/v1z015nFs7Si7tXUwEsvjc1rOJdZCn4QTU+Q==", "cpu": [ "loong64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -479,13 +509,14 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.2.tgz", - "integrity": "sha512-9siSZngT0/ZKG+AH+/agwKF29LdCxw4ODi/PiE0F52B2rtLozlDP92umf8G2GPoVV611LN4pZ+nSTckebOscUA==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.3.tgz", + "integrity": "sha512-5rMOWkp7FQGtAH3QJddP4w3s47iT20hwftqdm7b+loe95o8JU8ro3qZbhgMRy0VuFU0DizymF1pBKkn3YHWtsw==", "cpu": [ "mips64el" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -495,13 +526,14 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.2.tgz", - "integrity": "sha512-y0T4aV2CA+ic04ULya1A/8M2RDpDSK2ckgTj6jzHKFJvCq0jQg8afQQIn4EM0G8u2neyOiNHgSF9YKPfuqKOVw==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.3.tgz", + "integrity": "sha512-h0zj1ldel89V5sjPLo5H1SyMzp4VrgN1tPkN29TmjvO1/r0MuMRwJxL8QY05SmfsZRs6TF0c/IDH3u7XYYmbAg==", "cpu": [ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -511,13 +543,14 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.2.tgz", - "integrity": "sha512-x5ssCdXmZC86L2Li1qQPF/VaC4VP20u/Zm8jlAu9IiVOVi79YsSz6cpPDYZl1rfKSHYCJW9XBfFCo66S5gVPSA==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.3.tgz", + "integrity": "sha512-dkAKcTsTJ+CRX6bnO17qDJbLoW37npd5gSNtSzjYQr0svghLJYGYB0NF1SNcU1vDcjXLYS5pO4qOW4YbFama4A==", "cpu": [ "riscv64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -527,13 +560,14 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.2.tgz", - "integrity": "sha512-NP7fTpGSFWdXyvp8iAFU04uFh9ARoplFVM/m+8lTRpaYG+2ytHPZWyscSsMM6cvObSIK2KoPHXiZD4l99WaxbQ==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.3.tgz", + "integrity": "sha512-vnD1YUkovEdnZWEuMmy2X2JmzsHQqPpZElXx6dxENcIwTu+Cu5ERax6+Ke1QsE814Zf3c6rxCfwQdCTQ7tPuXA==", "cpu": [ "s390x" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -543,13 +577,14 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.2.tgz", - "integrity": "sha512-giZ/uOxWDKda44ZuyfKbykeXznfuVNkTgXOUOPJIjbayJV6FRpQ4zxUy9JMBPLaK9IJcdWtaoeQrYBMh3Rr4vQ==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.3.tgz", + "integrity": "sha512-IOXOIm9WaK7plL2gMhsWJd+l2bfrhfilv0uPTptoRoSb2p09RghhQQp9YY6ZJhk/kqmeRt6siRdMSLLwzuT0KQ==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -559,13 +594,14 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.2.tgz", - "integrity": "sha512-IeFMfGFSQfIj1d4XU+6lkbFzMR+mFELUUVYrZ+jvWzG4NGvs6o53ReEHLHpYkjRbdEjJy2W3lTekTxrFHW7YJg==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.3.tgz", + "integrity": "sha512-uTgCwsvQ5+vCQnqM//EfDSuomo2LhdWhFPS8VL8xKf+PKTCrcT/2kPPoWMTs22aB63MLdGMJiE3f1PHvCDmUOw==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "netbsd" @@ -575,13 +611,14 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.2.tgz", - "integrity": "sha512-48QhWD6WxcebNNaE4FCwgvQVUnAycuTd+BdvA/oZu+/MmbpU8pY2dMEYlYzj5uNHWIG5jvdDmFXu0naQeOWUoA==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.3.tgz", + "integrity": "sha512-vNAkR17Ub2MgEud2Wag/OE4HTSI6zlb291UYzHez/psiKarp0J8PKGDnAhMBcHFoOHMXHfExzmjMojJNbAStrQ==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "openbsd" @@ -591,13 +628,14 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.2.tgz", - "integrity": "sha512-90r3nTBLgdIgD4FCVV9+cR6Hq2Dzs319icVsln+NTmTVwffWcCqXGml8rAoocHuJ85kZK36DCteii96ba/PX8g==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.3.tgz", + "integrity": "sha512-W8H9jlGiSBomkgmouaRoTXo49j4w4Kfbl6I1bIdO/vT0+0u4f20ko3ELzV3hPI6XV6JNBVX+8BC+ajHkvffIJA==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "sunos" @@ -607,13 +645,14 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.2.tgz", - "integrity": "sha512-sNndlsBT8OeE/MZDSGpRDJlWuhjuUz/dn80nH0EP4ZzDUYvMDVa7G87DVpweBrn4xdJYyXS/y4CQNrf7R2ODXg==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.3.tgz", + "integrity": "sha512-EjEomwyLSCg8Ag3LDILIqYCZAq/y3diJ04PnqGRgq8/4O3VNlXyMd54j/saShaN4h5o5mivOjAzmU6C3X4v0xw==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -623,13 +662,14 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.2.tgz", - "integrity": "sha512-Ti2QChGNFzWhUNNVuU4w21YkYTErsNh3h+CzvlEhzgRbwsJ7TrWQqRzW3bllLKKvTppuF3DJ3XP1GEg11AfrEQ==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.3.tgz", + "integrity": "sha512-WGiE/GgbsEwR33++5rzjiYsKyHywE8QSZPF7Rfx9EBfK3Qn3xyR6IjyCr5Uk38Kg8fG4/2phN7sXp4NPWd3fcw==", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -639,13 +679,14 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.2.tgz", - "integrity": "sha512-VEfTCZicoZnZ6sGkjFPGRFFJuL2fZn2bLhsekZl1CJslflp2cJS/VoKs1jMk+3pDfsGW6CfQVUckP707HwbXeQ==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.3.tgz", + "integrity": "sha512-xRxC0jaJWDLYvcUvjQmHCJSfMrgmUuvsoXgDeU/wTorQ1ngDdUBuFtgY3W1Pc5sprGAvZBtWdJX7RPg/iZZUqA==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -659,6 +700,7 @@ "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", "dev": true, + "license": "MIT", "dependencies": { "eslint-visitor-keys": "^3.3.0" }, @@ -674,6 +716,7 @@ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, + "license": "Apache-2.0", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -686,15 +729,17 @@ "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", "dev": true, + "license": "MIT", "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/eslintrc": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.0.2.tgz", - "integrity": "sha512-wV19ZEGEMAC1eHgrS7UQPqsdEiCIbTKTasEfcXAigzoXICcqZSjBZEHlZwNVvKg6UBCjSlos84XiLqsRJnIcIg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", + "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", "dev": true, + "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -718,6 +763,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -728,6 +774,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -736,10 +783,11 @@ } }, "node_modules/@eslint/js": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.2.0.tgz", - "integrity": "sha512-ESiIudvhoYni+MdsI8oD7skpprZ89qKocwRM2KEvhhBJ9nl5MRh7BXU5GTod7Mdygq+AUl+QzId6iWJKR/wABA==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.3.0.tgz", + "integrity": "sha512-niBqk8iwv96+yuTwjM6bWg8ovzAPF9qkICsGtcoa5/dmqcEMfdwNAX7+/OHcJHc7wj7XqPxH98oAHytFYlw6Sw==", "dev": true, + "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } @@ -749,6 +797,7 @@ "resolved": "https://registry.npmjs.org/@formulajs/formulajs/-/formulajs-4.4.4.tgz", "integrity": "sha512-0ArlwYhQt9EjK/y5Rs3Y+B/+Nc5dTYauA+3aLFA7cjvATCQ3Qko/rkVlPQ+4GOJ+mJxonA8fSYcVlQ3QM/7neA==", "dev": true, + "license": "MIT", "dependencies": { "bessel": "^1.0.2", "jstat": "^1.9.6" @@ -762,6 +811,7 @@ "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", "dev": true, + "license": "Apache-2.0", "dependencies": { "@humanwhocodes/object-schema": "^2.0.3", "debug": "^4.3.1", @@ -776,6 +826,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -786,6 +837,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -798,6 +850,7 @@ "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=12.22" }, @@ -810,13 +863,15 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/@humanwhocodes/retry": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.2.4.tgz", - "integrity": "sha512-Ttl/jHpxfS3st5sxwICYfk4pOH0WrLI1SpW283GgQL7sCWU7EHIOhX4b4fkIxr3tkfzwg8+FNojtzsIEE7Ecgg==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.0.tgz", + "integrity": "sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=18.18" }, @@ -830,6 +885,7 @@ "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", "dev": true, + "license": "ISC", "dependencies": { "string-width": "^5.1.2", "string-width-cjs": "npm:string-width@^4.2.0", @@ -847,6 +903,7 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" }, @@ -859,6 +916,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" }, @@ -870,13 +928,15 @@ "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@isaacs/cliui/node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, + "license": "MIT", "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -894,6 +954,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^6.0.1" }, @@ -909,6 +970,7 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", @@ -942,6 +1004,7 @@ "url": "https://tidelift.com/subscription/pkg/npm-.malept-cross-spawn-promise?utm_medium=referral&utm_source=npm_fund" } ], + "license": "Apache-2.0", "dependencies": { "cross-spawn": "^7.0.1" }, @@ -954,6 +1017,7 @@ "resolved": "https://registry.npmjs.org/@malept/flatpak-bundler/-/flatpak-bundler-0.4.0.tgz", "integrity": "sha512-9QOtNffcOF/c1seMCDnjckb3R9WHcG34tky+FHpNKKCW0wc/scYLwMtO+ptyGUfMW0/b/n4qRiALlaFHc9Oj7Q==", "dev": true, + "license": "MIT", "dependencies": { "debug": "^4.1.1", "fs-extra": "^9.0.0", @@ -969,6 +1033,7 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", "dev": true, + "license": "MIT", "dependencies": { "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", @@ -984,6 +1049,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -997,6 +1063,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } @@ -1006,6 +1073,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -1019,6 +1087,7 @@ "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", "dev": true, + "license": "MIT", "optional": true, "engines": { "node": ">=14" @@ -1029,6 +1098,7 @@ "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -1041,6 +1111,7 @@ "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", "dev": true, + "license": "MIT", "dependencies": { "defer-to-connect": "^2.0.0" }, @@ -1053,6 +1124,7 @@ "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "dev": true, + "license": "MIT", "engines": { "node": ">= 10" } @@ -1062,6 +1134,7 @@ "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz", "integrity": "sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==", "dev": true, + "license": "MIT", "dependencies": { "@types/http-cache-semantics": "*", "@types/keyv": "^3.1.4", @@ -1074,6 +1147,7 @@ "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", "dev": true, + "license": "MIT", "dependencies": { "@types/ms": "*" } @@ -1083,6 +1157,7 @@ "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.13.tgz", "integrity": "sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } @@ -1091,13 +1166,15 @@ "version": "4.0.4", "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/keyv": { "version": "3.1.4", "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } @@ -1106,13 +1183,15 @@ "version": "0.7.34", "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/node": { - "version": "20.12.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.11.tgz", - "integrity": "sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw==", + "version": "20.12.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.12.tgz", + "integrity": "sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==", "dev": true, + "license": "MIT", "dependencies": { "undici-types": "~5.26.4" } @@ -1122,6 +1201,7 @@ "resolved": "https://registry.npmjs.org/@types/plist/-/plist-3.0.5.tgz", "integrity": "sha512-E6OCaRmAe4WDmWNsL/9RMqdkkzDCY1etutkflWk4c+AcjDU07Pcz1fQwTX0TQz+Pxqn9i4L1TU3UFpjnrcDgxA==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "@types/node": "*", @@ -1133,6 +1213,7 @@ "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz", "integrity": "sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } @@ -1142,6 +1223,7 @@ "resolved": "https://registry.npmjs.org/@types/verror/-/verror-1.10.10.tgz", "integrity": "sha512-l4MM0Jppn18hb9xmM6wwD1uTdShpf9Pn80aXTStnK1C94gtPvJcV2FrDmbOQUAQfJ1cKZHktkQUDwEqaAKXMMg==", "dev": true, + "license": "MIT", "optional": true }, "node_modules/@types/yauzl": { @@ -1149,6 +1231,7 @@ "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "@types/node": "*" @@ -1159,6 +1242,7 @@ "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.10.tgz", "integrity": "sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==", "dev": true, + "license": "MIT", "engines": { "node": ">=10.0.0" } @@ -1167,13 +1251,15 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/7zip-bin/-/7zip-bin-5.2.0.tgz", "integrity": "sha512-ukTPVhqG4jNzMro2qA9HSCSSVJN3aN7tlb+hfqYCt3ER0yWroeA2VR38MNrOHLQ/cVj+DaIMad0kFCtWWowh/A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/acorn": { "version": "8.11.3", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -1186,6 +1272,7 @@ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, + "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -1195,6 +1282,7 @@ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "dev": true, + "license": "MIT", "dependencies": { "debug": "4" }, @@ -1207,6 +1295,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -1222,6 +1311,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "license": "MIT", "dependencies": { "ajv": "^8.0.0" }, @@ -1238,6 +1328,7 @@ "version": "8.13.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz", "integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==", + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", "json-schema-traverse": "^1.0.0", @@ -1252,13 +1343,15 @@ "node_modules/ajv-formats/node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" }, "node_modules/ajv-keywords": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", "dev": true, + "license": "MIT", "peerDependencies": { "ajv": "^6.9.1" } @@ -1268,6 +1361,7 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -1277,6 +1371,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -1291,13 +1386,15 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/app-builder-bin/-/app-builder-bin-4.0.0.tgz", "integrity": "sha512-xwdG0FJPQMe0M0UA4Tz0zEB8rBJTRA5a476ZawAqiBkMv16GRK5xpXThOjMaEOFnZ6zabejjG4J3da0SXG63KA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/app-builder-lib": { "version": "24.13.3", "resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-24.13.3.tgz", "integrity": "sha512-FAzX6IBit2POXYGnTCT8YHFO/lr5AapAII6zzhQO3Rw4cEDOgK+t1xhLc5tNcKlicTHlo9zxIwnYCX9X2DLkig==", "dev": true, + "license": "MIT", "dependencies": { "@develar/schema-utils": "~2.6.5", "@electron/notarize": "2.2.1", @@ -1340,6 +1437,7 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -1354,6 +1452,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -1366,6 +1465,7 @@ "resolved": "https://registry.npmjs.org/archiver/-/archiver-5.3.2.tgz", "integrity": "sha512-+25nxyyznAXF7Nef3y0EbBeqmGZgeN/BxHX29Rs39djAfaFalmQ89SE6CWyDCHzGL0yt/ycBtNOmGTW0FyGWNw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "archiver-utils": "^2.1.0", @@ -1385,6 +1485,7 @@ "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-2.1.0.tgz", "integrity": "sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "glob": "^7.1.4", @@ -1407,6 +1508,7 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "core-util-is": "~1.0.0", @@ -1423,6 +1525,7 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/archiver-utils/node_modules/string_decoder": { @@ -1430,6 +1533,7 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "safe-buffer": "~5.1.0" @@ -1438,13 +1542,15 @@ "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "license": "Python-2.0" }, "node_modules/assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", "dev": true, + "license": "MIT", "optional": true, "engines": { "node": ">=0.8" @@ -1455,6 +1561,7 @@ "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true, + "license": "MIT", "optional": true, "engines": { "node": ">=8" @@ -1464,13 +1571,15 @@ "version": "3.2.5", "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/async-exit-hook": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/async-exit-hook/-/async-exit-hook-2.0.1.tgz", "integrity": "sha512-NW2cX8m1Q7KPA7a5M2ULQeZ2wR5qI5PAbw5L0UOMxdioVk9PMZ0h1TmyZEkPYrCvYjDlFICusOu1dlEKAAeXBw==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -1479,13 +1588,15 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/at-least-node": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", "dev": true, + "license": "ISC", "engines": { "node": ">= 4.0.0" } @@ -1503,7 +1614,8 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/base64-js": { "version": "1.5.1", @@ -1523,13 +1635,15 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/bessel": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bessel/-/bessel-1.0.2.tgz", "integrity": "sha512-Al3nHGQGqDYqqinXhQzmwmcRToe/3WyBv4N8aZc5Pef8xw2neZlR9VPi84Sa23JtgWcucu18HxVZrnI0fn2etw==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=0.8" } @@ -1539,6 +1653,7 @@ "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "buffer": "^5.5.0", @@ -1550,13 +1665,15 @@ "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/bluebird-lst": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/bluebird-lst/-/bluebird-lst-1.0.9.tgz", "integrity": "sha512-7B1Rtx82hjnSD4PGLAjVWeYH3tHAcVUmChh85a3lltKQm6FresXh9ErQo6oAv6CqxttczC3/kEg8SY5NluPuUw==", "dev": true, + "license": "MIT", "dependencies": { "bluebird": "^3.5.5" } @@ -1566,6 +1683,7 @@ "resolved": "https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz", "integrity": "sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==", "dev": true, + "license": "MIT", "optional": true }, "node_modules/brace-expansion": { @@ -1573,6 +1691,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -1596,6 +1715,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -1606,6 +1726,7 @@ "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", "dev": true, + "license": "MIT", "engines": { "node": "*" } @@ -1615,6 +1736,7 @@ "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.1.tgz", "integrity": "sha512-QoV3ptgEaQpvVwbXdSO39iqPQTCxSF7A5U99AxbHYqUdCizL/lH2Z0A2y6nbZucxMEOtNyZfG2s6gsVugGpKkg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.4" }, @@ -1626,13 +1748,15 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/builder-util": { "version": "24.13.1", "resolved": "https://registry.npmjs.org/builder-util/-/builder-util-24.13.1.tgz", "integrity": "sha512-NhbCSIntruNDTOVI9fdXz0dihaqX2YuE1D6zZMrwiErzH4ELZHE6mdiB40wEgZNprDia+FghRFgKoAqMZRRjSA==", "dev": true, + "license": "MIT", "dependencies": { "@types/debug": "^4.1.6", "7zip-bin": "~5.2.0", @@ -1657,6 +1781,7 @@ "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-9.2.4.tgz", "integrity": "sha512-upp+biKpN/XZMLim7aguUyW8s0FUpDvOtK6sbanMFDAMBzpHDqdhgVYm6zc9HJ6nWo7u2Lxk60i2M6Jd3aiNrA==", "dev": true, + "license": "MIT", "dependencies": { "debug": "^4.3.4", "sax": "^1.2.4" @@ -1670,6 +1795,7 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -1684,6 +1810,7 @@ "resolved": "https://registry.npmjs.org/built-in-math-eval/-/built-in-math-eval-0.3.0.tgz", "integrity": "sha512-5XD5cujru60ooKJ4sGZqoH5v2Xvgw7ezV54gJX/OnPkgDKoH3BnlMEi8xW6hl8xaEjxKHebgrsawroeZnGwIMA==", "dev": true, + "license": "MIT", "dependencies": { "math-codegen": "^0.3.5" } @@ -1693,6 +1820,7 @@ "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==", "dev": true, + "license": "MIT", "engines": { "node": ">=10.6.0" } @@ -1702,6 +1830,7 @@ "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.4.tgz", "integrity": "sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==", "dev": true, + "license": "MIT", "dependencies": { "clone-response": "^1.0.2", "get-stream": "^5.1.0", @@ -1720,6 +1849,7 @@ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -1729,6 +1859,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -1745,6 +1876,7 @@ "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", "dev": true, + "license": "ISC", "engines": { "node": ">=10" } @@ -1753,7 +1885,8 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/chromium-pickle-js/-/chromium-pickle-js-0.2.0.tgz", "integrity": "sha512-1R5Fho+jBq0DDydt+/vHWj5KJNJCKdARKOCwZUen84I5BreWoLqRLANH1U87eJy1tiASPtMnGqJJq0ZsLoRPOw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/ci-info": { "version": "3.9.0", @@ -1766,6 +1899,7 @@ "url": "https://github.com/sponsors/sibiraj-s" } ], + "license": "MIT", "engines": { "node": ">=8" } @@ -1775,6 +1909,7 @@ "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "slice-ansi": "^3.0.0", @@ -1792,6 +1927,7 @@ "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, + "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", @@ -1806,6 +1942,7 @@ "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==", "dev": true, + "license": "MIT", "dependencies": { "mimic-response": "^1.0.0" }, @@ -1817,13 +1954,15 @@ "version": "5.65.16", "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.65.16.tgz", "integrity": "sha512-br21LjYmSlVL0vFCPWPfhzUCT34FM/pAdK7rRIZwa0rrtrIdotvP4Oh4GUHsu2E3IrQMCfRkL/fN3ytMNxVQvg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -1835,13 +1974,15 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, + "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -1854,6 +1995,7 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 6" } @@ -1863,6 +2005,7 @@ "resolved": "https://registry.npmjs.org/compare-version/-/compare-version-0.1.2.tgz", "integrity": "sha512-pJDh5/4wrEnXX/VWRZvruAGHkzKdr46z11OlTPN+VrATlWWhSKewNCJ1futCO5C7eJB3nPMFZA1LeYtcFboZ2A==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -1872,6 +2015,7 @@ "resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.1.1.tgz", "integrity": "sha512-8njCHOTtFFLtegk6zQo0kkVX1rngygb/KQI6z1qZxlFI3scluC+LVTCFbrkWjBv4vvLlbQ9t88IPMC6k95VTTg==", "dev": true, + "license": "MIT", "engines": { "node": "*" }, @@ -1885,6 +2029,7 @@ "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-4.1.2.tgz", "integrity": "sha512-D3uMHtGc/fcO1Gt1/L7i1e33VOvD4A9hfQLP+6ewd+BvG/gQ84Yh4oftEhAdjSMgBgwGL+jsppT7JYNpo6MHHg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "buffer-crc32": "^0.2.13", @@ -1900,12 +2045,14 @@ "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/conf": { "version": "12.0.0", "resolved": "https://registry.npmjs.org/conf/-/conf-12.0.0.tgz", "integrity": "sha512-fIWyWUXrJ45cHCIQX+Ck1hrZDIf/9DR0P0Zewn3uNht28hbt5OfGUq8rRWsxi96pZWPyBEd0eY9ama01JTaknA==", + "license": "MIT", "dependencies": { "ajv": "^8.12.0", "ajv-formats": "^2.1.1", @@ -1928,6 +2075,7 @@ "version": "8.13.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz", "integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==", + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", "json-schema-traverse": "^1.0.0", @@ -1943,6 +2091,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz", "integrity": "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==", + "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -1953,12 +2102,14 @@ "node_modules/conf/node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" }, "node_modules/conf/node_modules/semver": { "version": "7.6.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -1971,19 +2122,21 @@ "resolved": "https://registry.npmjs.org/config-file-ts/-/config-file-ts-0.2.6.tgz", "integrity": "sha512-6boGVaglwblBgJqGyxm4+xCmEGcWgnWHSWHY5jad58awQhB6gftq0G8HbzU39YqCIYHMLAiL1yjwiZ36m/CL8w==", "dev": true, + "license": "MIT", "dependencies": { "glob": "^10.3.10", "typescript": "^5.3.3" } }, "node_modules/config-file-ts/node_modules/glob": { - "version": "10.3.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.15.tgz", - "integrity": "sha512-0c6RlJt1TICLyvJYIApxb8GsXoai0KUP7AxKKAtsYXdgJR1mGEUa7DgwShbdk1nly0PYoZj01xd4hzbq3fsjpw==", + "version": "10.3.16", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.16.tgz", + "integrity": "sha512-JDKXl1DiuuHJ6fVS2FXjownaavciiHNUU4mOvV/B793RLh05vZL1rcPnCSaOgv1hDT6RDlY7AB7ZUvFYAtPgAw==", "dev": true, + "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.3.6", + "jackspeak": "^3.1.2", "minimatch": "^9.0.1", "minipass": "^7.0.4", "path-scurry": "^1.11.0" @@ -2003,6 +2156,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -2018,6 +2172,7 @@ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.1.tgz", "integrity": "sha512-UZ7eQ+h8ywIRAW1hIEl2AqdwzJucU/Kp59+8kkZeSvafXhZjul247BvIJjEVFVeON6d7lM46XX1HXCduKAS8VA==", "dev": true, + "license": "ISC", "engines": { "node": ">=16 || 14 >=14.17" } @@ -2026,13 +2181,15 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/crc": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/crc/-/crc-3.8.0.tgz", "integrity": "sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "buffer": "^5.1.0" @@ -2043,6 +2200,7 @@ "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", "dev": true, + "license": "Apache-2.0", "peer": true, "bin": { "crc32": "bin/crc32.njs" @@ -2056,6 +2214,7 @@ "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-4.0.3.tgz", "integrity": "sha512-NT7w2JVU7DFroFdYkeq8cywxrgjPHWkdX1wjpRQXPX5Asews3tA+Ght6lddQO5Mkumffp3X7GEqku3epj2toIw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "crc-32": "^1.2.0", @@ -2070,6 +2229,7 @@ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -2084,6 +2244,7 @@ "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==", "dev": true, + "license": "ISC", "dependencies": { "internmap": "1 - 2" }, @@ -2096,6 +2257,7 @@ "resolved": "https://registry.npmjs.org/d3-axis/-/d3-axis-3.0.0.tgz", "integrity": "sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw==", "dev": true, + "license": "ISC", "engines": { "node": ">=12" } @@ -2105,6 +2267,7 @@ "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", "dev": true, + "license": "ISC", "engines": { "node": ">=12" } @@ -2114,6 +2277,7 @@ "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz", "integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==", "dev": true, + "license": "ISC", "engines": { "node": ">=12" } @@ -2123,6 +2287,7 @@ "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz", "integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==", "dev": true, + "license": "ISC", "dependencies": { "d3-dispatch": "1 - 3", "d3-selection": "3" @@ -2136,6 +2301,7 @@ "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=12" } @@ -2145,6 +2311,7 @@ "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.0.tgz", "integrity": "sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA==", "dev": true, + "license": "ISC", "engines": { "node": ">=12" } @@ -2154,6 +2321,7 @@ "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", "dev": true, + "license": "ISC", "dependencies": { "d3-color": "1 - 3" }, @@ -2166,6 +2334,7 @@ "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz", "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==", "dev": true, + "license": "ISC", "engines": { "node": ">=12" } @@ -2175,6 +2344,7 @@ "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", "dev": true, + "license": "ISC", "dependencies": { "d3-array": "2.10.0 - 3", "d3-format": "1 - 3", @@ -2191,6 +2361,7 @@ "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", "dev": true, + "license": "ISC", "engines": { "node": ">=12" } @@ -2200,6 +2371,7 @@ "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz", "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==", "dev": true, + "license": "ISC", "dependencies": { "d3-path": "^3.1.0" }, @@ -2212,6 +2384,7 @@ "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz", "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==", "dev": true, + "license": "ISC", "dependencies": { "d3-array": "2 - 3" }, @@ -2224,6 +2397,7 @@ "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz", "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==", "dev": true, + "license": "ISC", "dependencies": { "d3-time": "1 - 3" }, @@ -2236,6 +2410,7 @@ "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz", "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==", "dev": true, + "license": "ISC", "engines": { "node": ">=12" } @@ -2245,6 +2420,7 @@ "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.1.tgz", "integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==", "dev": true, + "license": "ISC", "dependencies": { "d3-color": "1 - 3", "d3-dispatch": "1 - 3", @@ -2264,6 +2440,7 @@ "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz", "integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==", "dev": true, + "license": "ISC", "dependencies": { "d3-dispatch": "1 - 3", "d3-drag": "2 - 3", @@ -2279,6 +2456,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/debounce-fn/-/debounce-fn-5.1.2.tgz", "integrity": "sha512-Sr4SdOZ4vw6eQDvPYNxHogvrxmCIld/VenC5JbNrFwMiwd7lY/Z18ZFfo+EWNG4DD9nFlAujWAo/wGuOPHmy5A==", + "license": "MIT", "dependencies": { "mimic-fn": "^4.0.0" }, @@ -2293,6 +2471,7 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "license": "MIT", "dependencies": { "ms": "2.1.2" }, @@ -2309,13 +2488,15 @@ "version": "10.4.3", "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/decompress-response": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", "dev": true, + "license": "MIT", "dependencies": { "mimic-response": "^3.1.0" }, @@ -2331,6 +2512,7 @@ "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -2342,19 +2524,22 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/deep-diff/-/deep-diff-1.0.2.tgz", "integrity": "sha512-aWS3UIVH+NPGCD1kki+DCU9Dua032iSsO43LqQpcs4R3+dVv7tX0qBGjiVHJHjplsoUM2XRO/KB92glqc68awg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/defer-to-connect": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" } @@ -2364,6 +2549,7 @@ "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "es-define-property": "^1.0.0", @@ -2382,6 +2568,7 @@ "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "define-data-property": "^1.0.1", @@ -2400,6 +2587,7 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.4.0" } @@ -2409,6 +2597,7 @@ "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", "dev": true, + "license": "MIT", "optional": true }, "node_modules/dir-compare": { @@ -2416,6 +2605,7 @@ "resolved": "https://registry.npmjs.org/dir-compare/-/dir-compare-3.3.0.tgz", "integrity": "sha512-J7/et3WlGUCxjdnD3HAAzQ6nsnc0WL6DD7WcwJb7c39iH1+AWfg+9OqzJNaI6PkBwBvm1mhZNL9iY/nRiZXlPg==", "dev": true, + "license": "MIT", "dependencies": { "buffer-equal": "^1.0.0", "minimatch": "^3.0.4" @@ -2426,6 +2616,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2436,6 +2627,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -2448,6 +2640,7 @@ "resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-24.13.3.tgz", "integrity": "sha512-rcJUkMfnJpfCboZoOOPf4L29TRtEieHNOeAbYPWPxlaBw/Z1RKrRA86dOI9rwaI4tQSc/RD82zTNHprfUHXsoQ==", "dev": true, + "license": "MIT", "dependencies": { "app-builder-lib": "24.13.3", "builder-util": "24.13.1", @@ -2465,6 +2658,7 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -2479,6 +2673,7 @@ "resolved": "https://registry.npmjs.org/dmg-license/-/dmg-license-1.0.11.tgz", "integrity": "sha512-ZdzmqwKmECOWJpqefloC5OJy1+WZBBse5+MR88z9g9Zn4VY+WYUkAyojmhzJckH5YbbZGcYIuGAkY5/Ys5OM2Q==", "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -2504,6 +2699,7 @@ "version": "8.0.2", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-8.0.2.tgz", "integrity": "sha512-xaBe6ZT4DHPkg0k4Ytbvn5xoxgpG0jOS1dYxSOwAHPuNLjP3/OzN0gH55SrLqpx8cBfSaVt91lXYkApjb+nYdQ==", + "license": "MIT", "dependencies": { "type-fest": "^3.8.0" }, @@ -2518,6 +2714,7 @@ "version": "3.13.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=14.16" }, @@ -2530,6 +2727,7 @@ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-9.0.2.tgz", "integrity": "sha512-I9OvvrHp4pIARv4+x9iuewrWycX6CcZtoAu1XrzPxc5UygMJXJZYmBsynku8IkrJwgypE5DGNjDPmPRhDCptUg==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=10" } @@ -2538,25 +2736,29 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-5.1.0.tgz", "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==", - "dev": true + "dev": true, + "license": "BSD-2-Clause" }, "node_modules/double-bits": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/double-bits/-/double-bits-1.1.1.tgz", "integrity": "sha512-BCLEIBq0O/DWoA7BsCu/R+RP0ZXiowP8BhtJT3qeuuQEBpnS8LK/Wo6UTJQv6v8mK1fj8n90YziHLwGdM5whSg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/ejs": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "dev": true, + "license": "Apache-2.0", "dependencies": { "jake": "^10.8.5" }, @@ -2568,11 +2770,12 @@ } }, "node_modules/electron": { - "version": "30.0.4", - "resolved": "https://registry.npmjs.org/electron/-/electron-30.0.4.tgz", - "integrity": "sha512-z8tGQeiVM6CHj0t8PKWVhAB4FZTRNN0vSrd1jA4edX1aOjBztddk4d0Gyw91pQb4arIVf2RGPu0hYbHG2+vDcA==", + "version": "30.0.6", + "resolved": "https://registry.npmjs.org/electron/-/electron-30.0.6.tgz", + "integrity": "sha512-PkhEPFdpYcTzjAO3gMHZ+map7g2+xCrMDedo/L1i0ir2BRXvAB93IkTJX497U6Srb/09r2cFt+k20VPNVCdw3Q==", "dev": true, "hasInstallScript": true, + "license": "MIT", "dependencies": { "@electron/get": "^2.0.0", "@types/node": "^20.9.0", @@ -2590,6 +2793,7 @@ "resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-24.13.3.tgz", "integrity": "sha512-yZSgVHft5dNVlo31qmJAe4BVKQfFdwpRw7sFp1iQglDRCDD6r22zfRJuZlhtB5gp9FHUxCMEoWGq10SkCnMAIg==", "dev": true, + "license": "MIT", "dependencies": { "app-builder-lib": "24.13.3", "builder-util": "24.13.1", @@ -2616,6 +2820,7 @@ "resolved": "https://registry.npmjs.org/electron-builder-squirrel-windows/-/electron-builder-squirrel-windows-24.13.3.tgz", "integrity": "sha512-oHkV0iogWfyK+ah9ZIvMDpei1m9ZRpdXcvde1wTpra2U8AFDNNpqJdnin5z+PM1GbQ5BoaKCWas2HSjtR0HwMg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "app-builder-lib": "24.13.3", @@ -2629,6 +2834,7 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "graceful-fs": "^4.2.0", @@ -2644,6 +2850,7 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -2657,6 +2864,7 @@ "version": "5.1.4", "resolved": "https://registry.npmjs.org/electron-log/-/electron-log-5.1.4.tgz", "integrity": "sha512-P0RSXnwT3z+e89Z5uAcZDeN85/QjIgv764a93kqCi+wh2Jm22CCbc3AGDt4S8rsxAHWHB4Q0PGsQl3fw1AN0kQ==", + "license": "MIT", "engines": { "node": ">= 14" } @@ -2666,6 +2874,7 @@ "resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-24.13.1.tgz", "integrity": "sha512-2ZgdEqJ8e9D17Hwp5LEq5mLQPjqU3lv/IALvgp+4W8VeNhryfGhYEQC/PgDPMrnWUp+l60Ou5SJLsu+k4mhQ8A==", "dev": true, + "license": "MIT", "dependencies": { "@types/fs-extra": "^9.0.11", "builder-util": "24.13.1", @@ -2681,6 +2890,7 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -2694,6 +2904,7 @@ "version": "9.0.0", "resolved": "https://registry.npmjs.org/electron-store/-/electron-store-9.0.0.tgz", "integrity": "sha512-7LZ2dR3N3bF93G2c4x+1NZ/8fpsKv6bKrMxeOQWLqdRbxvopxVqy9QXQy9axSV2O3P1kVGTj1q2wq5/W4isiOg==", + "license": "MIT", "dependencies": { "conf": "^12.0.0", "type-fest": "^4.18.1" @@ -2709,6 +2920,7 @@ "version": "6.1.8", "resolved": "https://registry.npmjs.org/electron-updater/-/electron-updater-6.1.8.tgz", "integrity": "sha512-hhOTfaFAd6wRHAfUaBhnAOYc+ymSGCWJLtFkw4xJqOvtpHmIdNHnXDV9m1MHC+A6q08Abx4Ykgyz/R5DGKNAMQ==", + "license": "MIT", "dependencies": { "builder-util-runtime": "9.2.3", "fs-extra": "^10.1.0", @@ -2724,6 +2936,7 @@ "version": "9.2.3", "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-9.2.3.tgz", "integrity": "sha512-FGhkqXdFFZ5dNC4C+yuQB9ak311rpGAw+/ASz8ZdxwODCv1GGMWgLDeofRkdi0F3VCHQEWy/aXcJQozx2nOPiw==", + "license": "MIT", "dependencies": { "debug": "^4.3.4", "sax": "^1.2.4" @@ -2736,6 +2949,7 @@ "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -2749,6 +2963,7 @@ "version": "7.6.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -2760,13 +2975,15 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "dev": true, + "license": "MIT", "dependencies": { "once": "^1.4.0" } @@ -2776,6 +2993,7 @@ "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -2784,13 +3002,15 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/es-define-property": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "get-intrinsic": "^1.2.4" @@ -2804,6 +3024,7 @@ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", "dev": true, + "license": "MIT", "optional": true, "engines": { "node": ">= 0.4" @@ -2814,14 +3035,16 @@ "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true, + "license": "MIT", "optional": true }, "node_modules/esbuild": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.2.tgz", - "integrity": "sha512-LmHPAa5h4tSxz+g/D8IHY6wCjtIiFx8I7/Q0Aq+NmvtoYvyMnJU0KQJcqB6QH30X9x/W4CemgUtPgQDZFca5SA==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.3.tgz", + "integrity": "sha512-Kgq0/ZsAPzKrbOjCQcjoSmPoWhlcVnGAUo7jvaLHoxW1Drto0KGkR1xBNg2Cp43b9ImvxmPEJZ9xkfcnqPsfBw==", "dev": true, "hasInstallScript": true, + "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, @@ -2829,29 +3052,29 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.21.2", - "@esbuild/android-arm": "0.21.2", - "@esbuild/android-arm64": "0.21.2", - "@esbuild/android-x64": "0.21.2", - "@esbuild/darwin-arm64": "0.21.2", - "@esbuild/darwin-x64": "0.21.2", - "@esbuild/freebsd-arm64": "0.21.2", - "@esbuild/freebsd-x64": "0.21.2", - "@esbuild/linux-arm": "0.21.2", - "@esbuild/linux-arm64": "0.21.2", - "@esbuild/linux-ia32": "0.21.2", - "@esbuild/linux-loong64": "0.21.2", - "@esbuild/linux-mips64el": "0.21.2", - "@esbuild/linux-ppc64": "0.21.2", - "@esbuild/linux-riscv64": "0.21.2", - "@esbuild/linux-s390x": "0.21.2", - "@esbuild/linux-x64": "0.21.2", - "@esbuild/netbsd-x64": "0.21.2", - "@esbuild/openbsd-x64": "0.21.2", - "@esbuild/sunos-x64": "0.21.2", - "@esbuild/win32-arm64": "0.21.2", - "@esbuild/win32-ia32": "0.21.2", - "@esbuild/win32-x64": "0.21.2" + "@esbuild/aix-ppc64": "0.21.3", + "@esbuild/android-arm": "0.21.3", + "@esbuild/android-arm64": "0.21.3", + "@esbuild/android-x64": "0.21.3", + "@esbuild/darwin-arm64": "0.21.3", + "@esbuild/darwin-x64": "0.21.3", + "@esbuild/freebsd-arm64": "0.21.3", + "@esbuild/freebsd-x64": "0.21.3", + "@esbuild/linux-arm": "0.21.3", + "@esbuild/linux-arm64": "0.21.3", + "@esbuild/linux-ia32": "0.21.3", + "@esbuild/linux-loong64": "0.21.3", + "@esbuild/linux-mips64el": "0.21.3", + "@esbuild/linux-ppc64": "0.21.3", + "@esbuild/linux-riscv64": "0.21.3", + "@esbuild/linux-s390x": "0.21.3", + "@esbuild/linux-x64": "0.21.3", + "@esbuild/netbsd-x64": "0.21.3", + "@esbuild/openbsd-x64": "0.21.3", + "@esbuild/sunos-x64": "0.21.3", + "@esbuild/win32-arm64": "0.21.3", + "@esbuild/win32-ia32": "0.21.3", + "@esbuild/win32-x64": "0.21.3" } }, "node_modules/esbuild-plugin-polyfill-node": { @@ -2859,6 +3082,7 @@ "resolved": "https://registry.npmjs.org/esbuild-plugin-polyfill-node/-/esbuild-plugin-polyfill-node-0.3.0.tgz", "integrity": "sha512-SHG6CKUfWfYyYXGpW143NEZtcVVn8S/WHcEOxk62LuDXnY4Zpmc+WmxJKN6GMTgTClXJXhEM5KQlxKY6YjbucQ==", "dev": true, + "license": "MIT", "dependencies": { "@jspm/core": "^2.0.1", "import-meta-resolve": "^3.0.0" @@ -2872,6 +3096,7 @@ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -2880,13 +3105,15 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/escape-latex/-/escape-latex-1.2.0.tgz", "integrity": "sha512-nV5aVWW1K0wEiUIEdZ4erkGGH8mDxGyxSeqPzRNtWP7ataw+/olFObw7hujFWlVjNsaDFw5VZ5NzVSIqRgfTiw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -2895,18 +3122,19 @@ } }, "node_modules/eslint": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.2.0.tgz", - "integrity": "sha512-0n/I88vZpCOzO+PQpt0lbsqmn9AsnsJAQseIqhZFI8ibQT0U1AkEKRxA3EVMos0BoHSXDQvCXY25TUjB5tr8Og==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.3.0.tgz", + "integrity": "sha512-5Iv4CsZW030lpUqHBapdPo3MJetAPtejVW8B84GIcIIv8+ohFaddXsrn1Gn8uD9ijDb+kcYKFUVmC8qG8B2ORQ==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^3.0.2", - "@eslint/js": "9.2.0", + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "9.3.0", "@humanwhocodes/config-array": "^0.13.0", "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.2.3", + "@humanwhocodes/retry": "^0.3.0", "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.12.4", "chalk": "^4.0.0", @@ -2950,6 +3178,7 @@ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.1.tgz", "integrity": "sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -2966,6 +3195,7 @@ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", "dev": true, + "license": "Apache-2.0", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -2978,6 +3208,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2988,6 +3219,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -3000,6 +3232,7 @@ "resolved": "https://registry.npmjs.org/espree/-/espree-10.0.1.tgz", "integrity": "sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "acorn": "^8.11.3", "acorn-jsx": "^5.3.2", @@ -3017,6 +3250,7 @@ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "estraverse": "^5.1.0" }, @@ -3029,6 +3263,7 @@ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "estraverse": "^5.2.0" }, @@ -3041,6 +3276,7 @@ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } @@ -3050,6 +3286,7 @@ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=0.10.0" } @@ -3059,6 +3296,7 @@ "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.x" } @@ -3067,13 +3305,15 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/extract-zip": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "debug": "^4.1.1", "get-stream": "^5.1.0", @@ -3097,30 +3337,35 @@ "engines": [ "node >=0.6.0" ], + "license": "MIT", "optional": true }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fastq": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dev": true, + "license": "ISC", "dependencies": { "reusify": "^1.0.4" } @@ -3130,6 +3375,7 @@ "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", "dev": true, + "license": "MIT", "dependencies": { "pend": "~1.2.0" } @@ -3139,6 +3385,7 @@ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, + "license": "MIT", "dependencies": { "flat-cache": "^4.0.0" }, @@ -3151,6 +3398,7 @@ "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", "dev": true, + "license": "Apache-2.0", "dependencies": { "minimatch": "^5.0.1" } @@ -3160,6 +3408,7 @@ "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, + "license": "MIT", "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -3176,6 +3425,7 @@ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, + "license": "MIT", "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.4" @@ -3188,13 +3438,15 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/foreground-child": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", "dev": true, + "license": "ISC", "dependencies": { "cross-spawn": "^7.0.0", "signal-exit": "^4.0.1" @@ -3211,6 +3463,7 @@ "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", "dev": true, + "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -3225,6 +3478,7 @@ "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.4.tgz", "integrity": "sha512-pwiTgt0Q7t+GHZA4yaLjObx4vXmmdcS0iSJ19o8d/goUGgItX9UZWKWNnLHehxviD8wU2IWRsnR8cD5+yOJP2Q==", "dev": true, + "license": "MIT", "engines": { "node": "*" }, @@ -3238,6 +3492,7 @@ "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/fs-extra": { @@ -3245,6 +3500,7 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -3259,6 +3515,7 @@ "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", "dev": true, + "license": "ISC", "dependencies": { "minipass": "^3.0.0" }, @@ -3271,6 +3528,7 @@ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "dev": true, + "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -3282,13 +3540,15 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, + "license": "MIT", "optional": true, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -3299,6 +3559,7 @@ "resolved": "https://registry.npmjs.org/function-plot/-/function-plot-1.24.4.tgz", "integrity": "sha512-qlAfK6AENICh0HWiwx6h0aIAq/l/4YYNxConi89Bs7w4W+Jj5t548U6bPRbNR667N0hBLCSYOyYE2VsmRrflGg==", "dev": true, + "license": "MIT", "dependencies": { "built-in-math-eval": "^0.3.0", "d3-axis": "^3.0.0", @@ -3318,6 +3579,7 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, + "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -3327,6 +3589,7 @@ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "es-errors": "^1.3.0", @@ -3347,6 +3610,7 @@ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", "dev": true, + "license": "MIT", "dependencies": { "pump": "^3.0.0" }, @@ -3362,6 +3626,7 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, + "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -3382,6 +3647,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.3" }, @@ -3394,6 +3660,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3404,6 +3671,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -3416,6 +3684,7 @@ "resolved": "https://registry.npmjs.org/global-agent/-/global-agent-3.0.0.tgz", "integrity": "sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==", "dev": true, + "license": "BSD-3-Clause", "optional": true, "dependencies": { "boolean": "^3.0.1", @@ -3434,6 +3703,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, + "license": "ISC", "optional": true, "bin": { "semver": "bin/semver.js" @@ -3447,6 +3717,7 @@ "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -3459,6 +3730,7 @@ "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "define-properties": "^1.2.1", @@ -3476,6 +3748,7 @@ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "get-intrinsic": "^1.1.3" @@ -3489,6 +3762,7 @@ "resolved": "https://registry.npmjs.org/got/-/got-11.8.6.tgz", "integrity": "sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==", "dev": true, + "license": "MIT", "dependencies": { "@sindresorhus/is": "^4.0.0", "@szmarczak/http-timer": "^4.0.5", @@ -3512,13 +3786,15 @@ "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -3528,6 +3804,7 @@ "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "es-define-property": "^1.0.0" @@ -3541,6 +3818,7 @@ "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", "dev": true, + "license": "MIT", "optional": true, "engines": { "node": ">= 0.4" @@ -3554,6 +3832,7 @@ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true, + "license": "MIT", "optional": true, "engines": { "node": ">= 0.4" @@ -3567,6 +3846,7 @@ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "function-bind": "^1.1.2" @@ -3580,6 +3860,7 @@ "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", "dev": true, + "license": "ISC", "dependencies": { "lru-cache": "^6.0.0" }, @@ -3591,13 +3872,15 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", - "dev": true + "dev": true, + "license": "BSD-2-Clause" }, "node_modules/http-proxy-agent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", "dev": true, + "license": "MIT", "dependencies": { "@tootallnate/once": "2", "agent-base": "6", @@ -3612,6 +3895,7 @@ "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==", "dev": true, + "license": "MIT", "dependencies": { "quick-lru": "^5.1.1", "resolve-alpn": "^1.0.0" @@ -3625,6 +3909,7 @@ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "dev": true, + "license": "MIT", "dependencies": { "agent-base": "6", "debug": "4" @@ -3638,6 +3923,7 @@ "resolved": "https://registry.npmjs.org/iconv-corefoundation/-/iconv-corefoundation-1.1.7.tgz", "integrity": "sha512-T10qvkw0zz4wnm560lOEg0PovVqUXuOFhhHAkixw8/sycy7TJt7v/RrkEKEQnAw2viPSJu6iAkErxnzR0g8PpQ==", "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -3655,6 +3941,7 @@ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "dev": true, + "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, @@ -3680,13 +3967,15 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "BSD-3-Clause" }, "node_modules/ignore": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } @@ -3696,6 +3985,7 @@ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, + "license": "MIT", "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -3712,6 +4002,7 @@ "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-3.1.1.tgz", "integrity": "sha512-qeywsE/KC3w9Fd2ORrRDUw6nS/nLwZpXgfrOc2IILvZYnCaEMd+D56Vfg9k4G29gIeVi3XKql1RQatME8iYsiw==", "dev": true, + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -3722,6 +4013,7 @@ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.19" } @@ -3731,6 +4023,7 @@ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, + "license": "ISC", "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -3740,13 +4033,15 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/internmap": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz", "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==", "dev": true, + "license": "ISC", "engines": { "node": ">=12" } @@ -3756,6 +4051,7 @@ "resolved": "https://registry.npmjs.org/interval-arithmetic/-/interval-arithmetic-1.1.2.tgz", "integrity": "sha512-FmonKqVk5HVc4G79d16rQmCb6zOwv0o4LidhJKtdGTwpc3Kk9UZ5t6UE1AQHFF5RdQaSIQs0AYe5rySFT8C1Ww==", "dev": true, + "license": "BSL-1.0", "dependencies": { "nextafter": "^1.0.0" } @@ -3765,6 +4061,7 @@ "resolved": "https://registry.npmjs.org/interval-arithmetic-eval/-/interval-arithmetic-eval-0.5.1.tgz", "integrity": "sha512-yzc3WdMtplWSHam53p9QcHqB96QoSU412n9UNI3Va+wB3ZWEISVCF2fmmmiqjkEaNIbD/am37wsBAXss4KvRwg==", "dev": true, + "license": "MIT", "dependencies": { "interval-arithmetic": "^1.1.2", "math-codegen": "^0.4.1" @@ -3775,6 +4072,7 @@ "resolved": "https://registry.npmjs.org/math-codegen/-/math-codegen-0.4.1.tgz", "integrity": "sha512-Nb/gZIGfexUlCYfzWC9W9SkoShvOlRTrFLajLQjSNoAvLhiZQH4TzTKRh/3lZdezFcPfCl+SHEcsrYf3bJQTNg==", "dev": true, + "license": "MIT", "dependencies": { "extend": "^3.0.2", "mr-parser": "^0.2.1" @@ -3785,6 +4083,7 @@ "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", "dev": true, + "license": "MIT", "dependencies": { "ci-info": "^3.2.0" }, @@ -3797,6 +4096,7 @@ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -3806,6 +4106,7 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -3815,6 +4116,7 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, + "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" }, @@ -3827,6 +4129,7 @@ "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -3836,6 +4139,7 @@ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/isbinaryfile": { @@ -3843,6 +4147,7 @@ "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-5.0.2.tgz", "integrity": "sha512-GvcjojwonMjWbTkfMpnVHVqXW/wKMYDfEpY94/8zy8HFMOqb/VL6oeONq9v87q4ttVlaTLnGXnJD4B5B1OTGIg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 18.0.0" }, @@ -3854,13 +4159,15 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/jackspeak": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", - "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.1.2.tgz", + "integrity": "sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -3879,6 +4186,7 @@ "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.1.tgz", "integrity": "sha512-61btcOHNnLnsOdtLgA5efqQWjnSi/vow5HbI7HMdKKWqvrKR1bLK3BPlJn9gcSaP2ewuamUSMB5XEy76KUIS2w==", "dev": true, + "license": "Apache-2.0", "dependencies": { "async": "^3.2.3", "chalk": "^4.0.2", @@ -3897,6 +4205,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3907,6 +4216,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -3918,12 +4228,14 @@ "version": "0.7.1", "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -3935,30 +4247,35 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json-schema-typed": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-8.0.1.tgz", - "integrity": "sha512-XQmWYj2Sm4kn4WeTYvmpKEbyPsL7nBsb647c7pMe6l02/yx2+Jfc4dT6UZkEXnIUb5LhD55r2HPsJ1milQ4rDg==" + "integrity": "sha512-XQmWYj2Sm4kn4WeTYvmpKEbyPsL7nBsb647c7pMe6l02/yx2+Jfc4dT6UZkEXnIUb5LhD55r2HPsJ1milQ4rDg==", + "license": "BSD-2-Clause" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", "dev": true, + "license": "ISC", "optional": true }, "node_modules/json5": { @@ -3966,6 +4283,7 @@ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, + "license": "MIT", "bin": { "json5": "lib/cli.js" }, @@ -3977,6 +4295,7 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "license": "MIT", "dependencies": { "universalify": "^2.0.0" }, @@ -3995,6 +4314,7 @@ "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, + "license": "MIT", "dependencies": { "json-buffer": "3.0.1" } @@ -4002,13 +4322,15 @@ "node_modules/lazy-val": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/lazy-val/-/lazy-val-1.0.5.tgz", - "integrity": "sha512-0/BnGCCfyUMkBpeDgWihanIAF9JmZhHBgUhEqzvf+adhNGLoP6TaiI5oF8oyb3I45P+PcnrqihSf01M0l0G5+Q==" + "integrity": "sha512-0/BnGCCfyUMkBpeDgWihanIAF9JmZhHBgUhEqzvf+adhNGLoP6TaiI5oF8oyb3I45P+PcnrqihSf01M0l0G5+Q==", + "license": "MIT" }, "node_modules/lazystream": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "readable-stream": "^2.0.5" @@ -4022,6 +4344,7 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "core-util-is": "~1.0.0", @@ -4038,6 +4361,7 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/lazystream/node_modules/string_decoder": { @@ -4045,6 +4369,7 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "safe-buffer": "~5.1.0" @@ -4055,6 +4380,7 @@ "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, + "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -4068,6 +4394,7 @@ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, + "license": "MIT", "dependencies": { "p-locate": "^5.0.0" }, @@ -4082,13 +4409,15 @@ "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.defaults": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/lodash.difference": { @@ -4096,43 +4425,50 @@ "resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz", "integrity": "sha512-dS2j+W26TQ7taQBGN8Lbbq04ssV3emRw4NY58WErlTO29pIqS0HmoT5aJ9+TUQ1N3G+JOZSji4eugsWwGp9yPA==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/lodash.escaperegexp": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", - "integrity": "sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==" + "integrity": "sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==", + "license": "MIT" }, "node_modules/lodash.flatten": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", "integrity": "sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/lodash.isequal": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", + "license": "MIT" }, "node_modules/lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.union": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz", "integrity": "sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/lowercase-keys": { @@ -4140,6 +4476,7 @@ "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -4149,6 +4486,7 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, + "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -4160,13 +4498,15 @@ "version": "0.372.0", "resolved": "https://registry.npmjs.org/lucide/-/lucide-0.372.0.tgz", "integrity": "sha512-7C8kaVOfnulHgDO/vK9SpGxAioDQ4nc4E4qv3/RICS3RGwCHfB2CTUMYZqpo7FcP8Yx3waouRZbZKGsvvLlV6A==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/luxon": { "version": "3.4.4", "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.4.4.tgz", "integrity": "sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" } @@ -4176,6 +4516,7 @@ "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", "integrity": "sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "escape-string-regexp": "^4.0.0" @@ -4189,6 +4530,7 @@ "resolved": "https://registry.npmjs.org/math-codegen/-/math-codegen-0.3.5.tgz", "integrity": "sha512-SsFYMv33FxMKYxI1PBiaZT+8AeDITK+k/PKhbHNlOPHIz5FIPF4wy78yWqanN6luXdsXENUZgCIC6xH6bfUq1g==", "dev": true, + "license": "MIT", "dependencies": { "extend": "^3.0.0", "mr-parser": "^0.2.1" @@ -4199,6 +4541,7 @@ "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-12.4.2.tgz", "integrity": "sha512-lW14EzwAFgbNN7AZikxplmhs7wiXDhMphBOGCA3KS6T29ECEkHJsBtbEW5cnCz7sXtl4nDyvTdR+DqVsZyiiEw==", "dev": true, + "license": "Apache-2.0", "dependencies": { "@babel/runtime": "^7.24.4", "complex.js": "^2.1.1", @@ -4222,6 +4565,7 @@ "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", "dev": true, + "license": "MIT", "bin": { "mime": "cli.js" }, @@ -4234,6 +4578,7 @@ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -4243,6 +4588,7 @@ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, + "license": "MIT", "dependencies": { "mime-db": "1.52.0" }, @@ -4254,6 +4600,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "license": "MIT", "engines": { "node": ">=12" }, @@ -4266,6 +4613,7 @@ "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -4275,6 +4623,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -4287,6 +4636,7 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -4296,6 +4646,7 @@ "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", "dev": true, + "license": "ISC", "engines": { "node": ">=8" } @@ -4305,6 +4656,7 @@ "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", "dev": true, + "license": "MIT", "dependencies": { "minipass": "^3.0.0", "yallist": "^4.0.0" @@ -4318,6 +4670,7 @@ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "dev": true, + "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -4330,6 +4683,7 @@ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", "dev": true, + "license": "MIT", "bin": { "mkdirp": "bin/cmd.js" }, @@ -4341,13 +4695,15 @@ "version": "1.6.5", "resolved": "https://registry.npmjs.org/mousetrap/-/mousetrap-1.6.5.tgz", "integrity": "sha512-QNo4kEepaIBwiT8CDhP98umTetp+JNfQYBWvC1pc6/OAibuXtRcxZ58Qz8skvEHYvURne/7R8T5VoOI7rDsEUA==", - "dev": true + "dev": true, + "license": "Apache-2.0 WITH LLVM-exception" }, "node_modules/mousetrap-global-bind": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/mousetrap-global-bind/-/mousetrap-global-bind-1.1.0.tgz", "integrity": "sha512-AfxKB0OYc/wU66E2n2HXcZmKHrd5O/6mEdtSrZAt3tsMqcpcpYAolQdj602L0SgrP38ncm/6iOpxr9SIGgxOpQ==", "dev": true, + "license": "Apache-2.0", "peerDependencies": { "mousetrap": "^1.6.0" } @@ -4356,24 +4712,28 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/mr-parser/-/mr-parser-0.2.1.tgz", "integrity": "sha512-hug+mpbSSKnH13rFqy3zm+XiG+QTStiDAgMTHK355TIstQE0qBkBtSJsa5YHP94AuarVX9b/4dcebdTRZ9YiEw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT" }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/nextafter": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/nextafter/-/nextafter-1.0.0.tgz", "integrity": "sha512-7PO+A89Tll2rSEfyrjtqO0MaI37+nnxBdnQcPypfbEYYuGaJxWGCqaOwQX4a3GHNTS08l1kazuiLEWZniZjMUQ==", "dev": true, + "license": "MIT", "dependencies": { "double-bits": "^1.1.0" } @@ -4383,6 +4743,7 @@ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-1.7.2.tgz", "integrity": "sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==", "dev": true, + "license": "MIT", "optional": true }, "node_modules/normalize-path": { @@ -4390,6 +4751,7 @@ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">=0.10.0" @@ -4400,6 +4762,7 @@ "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -4412,6 +4775,7 @@ "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true, + "license": "MIT", "optional": true, "engines": { "node": ">= 0.4" @@ -4422,6 +4786,7 @@ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, + "license": "ISC", "dependencies": { "wrappy": "1" } @@ -4431,6 +4796,7 @@ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, + "license": "MIT", "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", @@ -4448,6 +4814,7 @@ "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -4457,6 +4824,7 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, + "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" }, @@ -4472,6 +4840,7 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, + "license": "MIT", "dependencies": { "p-limit": "^3.0.2" }, @@ -4487,6 +4856,7 @@ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, + "license": "MIT", "dependencies": { "callsites": "^3.0.0" }, @@ -4499,6 +4869,7 @@ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -4508,6 +4879,7 @@ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -4517,6 +4889,7 @@ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -4526,6 +4899,7 @@ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" @@ -4542,6 +4916,7 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", "dev": true, + "license": "ISC", "engines": { "node": "14 || >=16.14" } @@ -4550,13 +4925,15 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/plist": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/plist/-/plist-3.1.0.tgz", "integrity": "sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ==", "dev": true, + "license": "MIT", "dependencies": { "@xmldom/xmldom": "^0.8.8", "base64-js": "^1.5.1", @@ -4571,6 +4948,7 @@ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8.0" } @@ -4580,6 +4958,7 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", "dev": true, + "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, @@ -4595,6 +4974,7 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/progress": { @@ -4602,6 +4982,7 @@ "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.4.0" } @@ -4611,6 +4992,7 @@ "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", "dev": true, + "license": "MIT", "dependencies": { "err-code": "^2.0.2", "retry": "^0.12.0" @@ -4624,6 +5006,7 @@ "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "dev": true, + "license": "MIT", "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -4633,6 +5016,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "license": "MIT", "engines": { "node": ">=6" } @@ -4655,13 +5039,15 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/quick-lru": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -4674,6 +5060,7 @@ "resolved": "https://registry.npmjs.org/read-config-file/-/read-config-file-6.3.2.tgz", "integrity": "sha512-M80lpCjnE6Wt6zb98DoW8WHR09nzMSpu8XHtPkiTHrJ5Az9CybfeQhTJ8D7saeBHpGhLPIVyA8lcL6ZmdKwY6Q==", "dev": true, + "license": "MIT", "dependencies": { "config-file-ts": "^0.2.4", "dotenv": "^9.0.2", @@ -4691,6 +5078,7 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "inherits": "^2.0.3", @@ -4706,6 +5094,7 @@ "resolved": "https://registry.npmjs.org/readdir-glob/-/readdir-glob-1.1.3.tgz", "integrity": "sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA==", "dev": true, + "license": "Apache-2.0", "peer": true, "dependencies": { "minimatch": "^5.1.0" @@ -4715,13 +5104,15 @@ "version": "0.14.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -4730,6 +5121,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -4738,13 +5130,15 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -4754,6 +5148,7 @@ "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", "integrity": "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==", "dev": true, + "license": "MIT", "dependencies": { "lowercase-keys": "^2.0.0" }, @@ -4766,6 +5161,7 @@ "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } @@ -4775,6 +5171,7 @@ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true, + "license": "MIT", "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -4785,6 +5182,7 @@ "resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz", "integrity": "sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==", "dev": true, + "license": "BSD-3-Clause", "optional": true, "dependencies": { "boolean": "^3.0.1", @@ -4817,6 +5215,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "queue-microtask": "^1.2.2" } @@ -4840,19 +5239,22 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "peer": true }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/sanitize-filename": { "version": "1.6.3", "resolved": "https://registry.npmjs.org/sanitize-filename/-/sanitize-filename-1.6.3.tgz", "integrity": "sha512-y/52Mcy7aw3gRm7IrcGDFx/bCk4AhRh2eI9luHOQM86nZsqwiRkkq2GekHXBBD+SmPidc8i2PqtYZl+pWJ8Oeg==", "dev": true, + "license": "WTFPL OR ISC", "dependencies": { "truncate-utf8-bytes": "^1.0.0" } @@ -4860,19 +5262,22 @@ "node_modules/sax": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz", - "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==" + "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==", + "license": "ISC" }, "node_modules/seedrandom": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz", "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -4882,6 +5287,7 @@ "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", "dev": true, + "license": "MIT", "optional": true }, "node_modules/serialize-error": { @@ -4889,6 +5295,7 @@ "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-7.0.1.tgz", "integrity": "sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "type-fest": "^0.13.1" @@ -4905,6 +5312,7 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", "dev": true, + "license": "(MIT OR CC0-1.0)", "optional": true, "engines": { "node": ">=10" @@ -4918,6 +5326,7 @@ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, + "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -4930,6 +5339,7 @@ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -4939,6 +5349,7 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, + "license": "ISC", "engines": { "node": ">=14" }, @@ -4951,6 +5362,7 @@ "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", "dev": true, + "license": "MIT", "dependencies": { "semver": "^7.5.3" }, @@ -4963,6 +5375,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -4975,6 +5388,7 @@ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "ansi-styles": "^4.0.0", @@ -4990,6 +5404,7 @@ "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", "dev": true, + "license": "MIT", "optional": true, "engines": { "node": ">= 6.0.0", @@ -5001,6 +5416,7 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -5010,6 +5426,7 @@ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, + "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -5020,6 +5437,7 @@ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", "dev": true, + "license": "BSD-3-Clause", "optional": true }, "node_modules/stat-mode": { @@ -5027,6 +5445,7 @@ "resolved": "https://registry.npmjs.org/stat-mode/-/stat-mode-1.0.0.tgz", "integrity": "sha512-jH9EhtKIjuXZ2cWxmXS8ZP80XyC3iasQxMDV8jzhNJpfDb7VbQLVW4Wvsxz9QZvzV+G4YoSfBUVKDOyxLzi/sg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 6" } @@ -5036,6 +5455,7 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "safe-buffer": "~5.2.0" @@ -5046,6 +5466,7 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -5061,6 +5482,7 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -5075,6 +5497,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -5088,6 +5511,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -5100,6 +5524,7 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" }, @@ -5117,6 +5542,7 @@ "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-3.0.1.tgz", "integrity": "sha512-MvjXzkz/BOfyVDkG0oFOtBxHX2u3gKbMHIF/dXblZsgD3BWOFLmHovIpZY7BykJdAjcqRCBi1WYBNdEC9yI7vg==", "dev": true, + "license": "Apache-2.0", "dependencies": { "debug": "^4.1.0" }, @@ -5129,6 +5555,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -5141,6 +5568,7 @@ "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", "dev": true, + "license": "ISC", "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", @@ -5158,6 +5586,7 @@ "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "bl": "^4.0.3", @@ -5175,6 +5604,7 @@ "resolved": "https://registry.npmjs.org/temp-file/-/temp-file-3.4.0.tgz", "integrity": "sha512-C5tjlC/HCtVUOi3KWVokd4vHVViOmGjtLwIh4MuzPo/nMYTV/p1urt3RnMz2IWXDdKEGJH3k5+KPxtqRsUYGtg==", "dev": true, + "license": "MIT", "dependencies": { "async-exit-hook": "^2.0.1", "fs-extra": "^10.0.0" @@ -5185,6 +5615,7 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -5198,24 +5629,28 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/tiny-emitter": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/tiny-typed-emitter": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/tiny-typed-emitter/-/tiny-typed-emitter-2.1.0.tgz", - "integrity": "sha512-qVtvMxeXbVej0cQWKqVSSAHmKZEHAvxdF8HEUBFWts8h+xEo5m/lEiPakuyZ3BnCBjOD8i24kzNOiOLLgsSxhA==" + "integrity": "sha512-qVtvMxeXbVej0cQWKqVSSAHmKZEHAvxdF8HEUBFWts8h+xEo5m/lEiPakuyZ3BnCBjOD8i24kzNOiOLLgsSxhA==", + "license": "MIT" }, "node_modules/tmp": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", "dev": true, + "license": "MIT", "engines": { "node": ">=14.14" } @@ -5225,6 +5660,7 @@ "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-3.0.3.tgz", "integrity": "sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==", "dev": true, + "license": "MIT", "dependencies": { "tmp": "^0.2.0" } @@ -5234,6 +5670,7 @@ "resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz", "integrity": "sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==", "dev": true, + "license": "WTFPL", "dependencies": { "utf8-byte-length": "^1.0.1" } @@ -5243,6 +5680,7 @@ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, + "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1" }, @@ -5254,6 +5692,7 @@ "version": "4.18.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.18.2.tgz", "integrity": "sha512-+suCYpfJLAe4OXS6+PPXjW3urOS4IoP9waSiLuXfLgqZODKw/aWwASvzqE886wA0kQgGy0mIWyhd87VpqIy6Xg==", + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=16" }, @@ -5266,6 +5705,7 @@ "resolved": "https://registry.npmjs.org/typed-function/-/typed-function-4.1.1.tgz", "integrity": "sha512-Pq1DVubcvibmm8bYcMowjVnnMwPVMeh0DIdA8ad8NZY2sJgapANJmiigSUwlt+EgXxpfIv8MWrQXTIzkfYZLYQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 14" } @@ -5275,6 +5715,7 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -5284,15 +5725,17 @@ } }, "node_modules/uikit": { - "version": "3.20.10", - "resolved": "https://registry.npmjs.org/uikit/-/uikit-3.20.10.tgz", - "integrity": "sha512-V1wnsW2R1vLHVIfFlb93wdtJsG9B3fUJiUVijW1pi1vrD8Dhskcx+CknPrKmFGvKpYD2gdnVsTusR1DwwVIjIg==", - "dev": true + "version": "3.21.1", + "resolved": "https://registry.npmjs.org/uikit/-/uikit-3.21.1.tgz", + "integrity": "sha512-hdIH6GZZgXRR9kCMYfMLFAyA9WbmRNl34hmunhrWPPm97BZKRA3/VFeaYkmaATGU1UHp91CZ5PewszL365ehyA==", + "dev": true, + "license": "MIT" }, "node_modules/uint8array-extras": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-0.3.0.tgz", "integrity": "sha512-erJsJwQ0tKdwuqI0359U8ijkFmfiTcq25JvvzRVc1VP+2son1NJRXhxcAKJmAW3ajM8JSGAfsAXye8g4s+znxA==", + "license": "MIT", "engines": { "node": ">=18" }, @@ -5304,12 +5747,14 @@ "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "license": "MIT", "engines": { "node": ">= 10.0.0" } @@ -5318,21 +5763,24 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" } }, "node_modules/utf8-byte-length": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz", - "integrity": "sha512-4+wkEYLBbWxqTahEsWrhxepcoVOJ+1z5PGIjPZxRkytcdSUaNjIjBM7Xn8E+pdSuV7SzvWovBFA54FO0JSoqhA==", - "dev": true + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.5.tgz", + "integrity": "sha512-Xn0w3MtiQ6zoz2vFyUVruaCL53O/DwUvkEeOvj+uulMm0BkUGYWmBYVyElqZaSLhY6ZD0ulfU3aBra2aVT4xfA==", + "dev": true, + "license": "(WTFPL OR MIT)" }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/verror": { @@ -5340,6 +5788,7 @@ "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.1.tgz", "integrity": "sha512-veufcmxri4e3XSrT0xwfUR7kguIkaxBeosDg00yDWhk49wdwkSUrvvsm7nc75e1PUyvIeZj6nS8VQRYz2/S4Xg==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "assert-plus": "^1.0.0", @@ -5360,6 +5809,7 @@ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -5375,6 +5825,7 @@ "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -5384,6 +5835,7 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -5402,6 +5854,7 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -5418,13 +5871,15 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/xmlbuilder": { "version": "15.1.1", "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz", "integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8.0" } @@ -5434,6 +5889,7 @@ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, + "license": "ISC", "engines": { "node": ">=10" } @@ -5442,13 +5898,15 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, + "license": "MIT", "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", @@ -5467,6 +5925,7 @@ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, + "license": "ISC", "engines": { "node": ">=12" } @@ -5476,6 +5935,7 @@ "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", "dev": true, + "license": "MIT", "dependencies": { "buffer-crc32": "~0.2.3", "fd-slicer": "~1.1.0" @@ -5486,6 +5946,7 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -5498,6 +5959,7 @@ "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-4.1.1.tgz", "integrity": "sha512-9qv4rlDiopXg4E69k+vMHjNN63YFMe9sZMrdlvKnCjlCRWeCBswPPMPUfx+ipsAWq1LXHe70RcbaHdJJpS6hyQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "archiver-utils": "^3.0.4", @@ -5513,6 +5975,7 @@ "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-3.0.4.tgz", "integrity": "sha512-KVgf4XQVrTjhyWmx6cte4RxonPLR9onExufI1jhvw/MQ4BB6IsZD5gT8Lq+u/+pRkWna/6JoHpiQioaqFP5Rzw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "glob": "^7.2.3", diff --git a/package.json b/package.json index 36a9b08..7070e0d 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "numara", "productName": "Numara", "description": "Numara Calculator", - "version": "5.1.0", + "version": "5.1.1", "author": { "name": "Timur Atalay", "email": "mail@numara.io", @@ -29,11 +29,11 @@ "@formulajs/formulajs": "^4.4.4", "codemirror": "^5.65.16", "deep-diff": "^1.0.2", - "electron": "^30.0.4", + "electron": "^30.0.6", "electron-builder": "^24.13.3", - "esbuild": "^0.21.2", + "esbuild": "^0.21.3", "esbuild-plugin-polyfill-node": "^0.3.0", - "eslint": "^9.2.0", + "eslint": "^9.3.0", "fs-extra": "^11.2.0", "function-plot": "^1.24.4", "lucide": "^0.372.0", @@ -42,7 +42,7 @@ "mousetrap": "^1.6.5", "mousetrap-global-bind": "^1.1.0", "prettier": "^3.2.5", - "uikit": "^3.20.10" + "uikit": "^3.21.1" }, "dependencies": { "electron-log": "^5.1.4", diff --git a/src/index.html b/src/index.html index 6c199f6..042497e 100644 --- a/src/index.html +++ b/src/index.html @@ -155,12 +155,12 @@

          Rename page

        • -
        • +
        • diff --git a/src/js/app.js b/src/js/app.js index cc90ada..c49bbfb 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -251,16 +251,18 @@ UIkit.util.on('#setswitch', 'beforeshow', (event) => { }) // Prepare user defined dialog inputs -UIkit.util.on('#dialog-udfu', 'shown', () => { - const udf = store.get('udf').trim() - const udu = store.get('udu').trim() +UIkit.util.on('#dialog-udfu', 'shown', (event) => { + if (event.target.id === 'dialog-udfu') { + const udf = store.get('udf').trim() + const udu = store.get('udu').trim() - udfInput.setValue(udf) - uduInput.setValue(udu) + udfInput.setValue(udf) + uduInput.setValue(udu) + } }) // Blur input when user defined switcher is shown -UIkit.util.on('.uk-switcher', 'show', () => { +UIkit.util.on('#udfuSwitcher', 'shown', () => { cm.getInputField().blur() }) diff --git a/src/js/editor.js b/src/js/editor.js index 40978fa..0f22698 100644 --- a/src/js/editor.js +++ b/src/js/editor.js @@ -21,7 +21,6 @@ import 'codemirror/addon/search/searchcursor' export const cm = CodeMirror.fromTextArea($('#inputArea'), { autofocus: true, extraKeys: { 'Ctrl-Space': 'autocomplete', Tab: () => {} }, - inputStyle: 'textarea', mode: 'numara', singleCursorHeightPerLine: false, smartIndent: false, @@ -31,8 +30,10 @@ export const cm = CodeMirror.fromTextArea($('#inputArea'), { // User defined functions and units editors const udOptions = { + autofocus: true, autoCloseBrackets: true, mode: 'javascript', + singleCursorHeightPerLine: false, tabSize: 2 }