// source --> https://www.lebens-retter.org/wp-content/plugins/convertkit/resources/frontend/js/dist/frontend.min.js?ver=3.3.1 
(()=>{var t={184(){document.addEventListener("DOMContentLoaded",function(){document.addEventListener("click",function(t){if(t.target.matches("ul.convertkit-broadcasts-pagination a")){t.preventDefault();const e=t.target.closest("div.convertkit-broadcasts");!function(t,e){convertkit_broadcasts.debug&&(console.log("convertKitBroadcastsRender()"),console.log(e)),t.classList.add("convertkit-broadcasts-loading");const n=new URLSearchParams(e),o=`${convertkit_broadcasts.ajax_url}?${n.toString()}`;fetch(o).then(function(t){return convertkit_broadcasts.debug&&console.log(t),t.json()}).then(function(e){convertkit_broadcasts.debug&&console.log(e),t.classList.remove("convertkit-broadcasts-loading"),t.innerHTML=e}).catch(function(e){convertkit.debug&&console.error(e),t.classList.remove("convertkit-broadcasts-loading")})}(e,{display_date:e.dataset.displayDate,date_format:e.dataset.dateFormat,display_image:e.dataset.displayImage,display_description:e.dataset.displayDescription,display_read_more:e.dataset.displayReadMore,read_more_label:e.dataset.readMoreLabel,limit:e.dataset.limit,paginate:e.dataset.paginate,paginate_label_prev:e.dataset.paginateLabelPrev,paginate_label_next:e.dataset.paginateLabelNext,link_color:e.dataset.linkColor,page:t.target.dataset.page})}})})},509(){function t(t,e){const n=new CustomEvent(t,{detail:e});document.dispatchEvent(n)}window.convertKitRecaptchaFormSubmit=function(t){document.querySelector('[type="submit"][data-callback="convertKitRecaptchaFormSubmit"]').closest("form").submit()},"undefined"!=typeof convertkit&&document.addEventListener("DOMContentLoaded",function(){!function(e){const n=new URL(e),o=n.searchParams.get("ck_subscriber_id");if(null===o)return;n.searchParams.delete("ck_subscriber_id");const r=document.getElementsByTagName("title")[0].innerHTML;let c=n.searchParams.toString();c.length>0&&(c="?"+c),window.history.replaceState(null,r,n.pathname+c+n.hash),t("kit_subscriber_id_removed_from_url",{id:o})}(window.location.href),document.addEventListener("click",function(e){if(!(e.target.matches(".formkit-submit")||e.target.parentElement&&e.target.parentElement.matches(".formkit-submit")))return void(convertkit.debug&&console.log("not a ck form"));const n=document.querySelector('input[name="email_address"]').value;n.length?/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n.toLowerCase())?(function(){const t=(new Date).getTime();for(let e=0;e<1e7&&!((new Date).getTime()-t>2e3);e++);}(),function(e){convertkit.debug&&(console.log("convertStoreSubscriberEmailAsIDInCookie"),console.log(e)),fetch(convertkit.ajaxurl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-WP-Nonce":convertkit.nonce},body:new URLSearchParams({email:e})}).then(function(t){return convertkit.debug&&console.log(t),t.json()}).then(function(n){convertkit.debug&&console.log(n),t("convertkit_user_subscribed",{id:n.id,email:e})}).catch(function(t){convertkit.debug&&console.error(t)})}(n)):convertkit.debug&&console.log("email not an email address"):convertkit.debug&&console.log("email empty")}),document.querySelectorAll('script[data-kit-limit-per-session="1"]').length>0&&(document.cookie="ck_non_inline_form_displayed=1; path=/",convertkit.debug&&console.log("Set `ck_non_inline_form_displayed` cookie for non-inline form limit"))})},688(){function t(){const t=document.querySelector("#convertkit-subscriber-code");null!==t&&t.addEventListener("input",function(){t.style.setProperty("--_otp-digit",t.value.length),6===t.value.length&&(t.setSelectionRange(0,0),t.blur(),document.querySelector("#convertkit-restrict-content-form").requestSubmit())})}document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".convertkit-restrict-content-modal-open").forEach(function(t){t.addEventListener("click",function(t){t.preventDefault(),document.querySelector("#convertkit-restrict-content-modal-background").style.display="block",document.querySelector("#convertkit-restrict-content-modal").style.display="block"})}),document.addEventListener("submit",function(e){e.target.matches("form#convertkit-restrict-content-form")&&(e.preventDefault(),function(e){if(document.querySelectorAll('input[type="text"], input[type="email"], input[type="submit"]').forEach(function(t){t.setAttribute("disabled","disabled")}),document.querySelector("#convertkit-restrict-content-modal-loading").style.display="block",null!==document.querySelector("input#convertkit-subscriber-code"))return n=convertkit_restrict_content.nonce,o=e.target.querySelector('input[name="subscriber_code"]').value,r=e.target.querySelector('input[name="token"]').value,c=e.target.querySelector('input[name="convertkit_post_id"]').value,fetch(convertkit_restrict_content.subscriber_verification_url,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":n},body:JSON.stringify({subscriber_code:o,token:r,convertkit_post_id:c})}).then(function(t){return convertkit_restrict_content.debug&&console.log(t),t.json()}).then(function(e){if(convertkit_restrict_content.debug&&console.log(e),!e.success)return document.querySelector("#convertkit-restrict-content-modal-content").innerHTML=e.data,document.querySelector("#convertkit-restrict-content-modal-loading").style.display="none",void t();window.location=e.url}).catch(function(t){convertkit_restrict_content.debug&&console.error(t)}),!1;var n,o,r,c;!function(e,n,o,r,c){fetch(convertkit_restrict_content.subscriber_authentication_url,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":e},body:JSON.stringify({convertkit_email:n,convertkit_resource_type:o,convertkit_resource_id:r,convertkit_post_id:c})}).then(function(t){return convertkit_restrict_content.debug&&console.log(t),t.json()}).then(function(e){convertkit_restrict_content.debug&&console.log(e),void 0!==e.code?document.querySelector("#convertkit-restrict-content-modal-content").innerHTML=e.message:document.querySelector("#convertkit-restrict-content-modal-content").innerHTML=e.data,document.querySelector("#convertkit-restrict-content-modal-loading").style.display="none",t()}).catch(function(t){convertkit_restrict_content.debug&&console.error(t)})}(convertkit_restrict_content.nonce,e.target.querySelector('input[name="convertkit_email"]').value,e.target.querySelector('input[name="convertkit_resource_type"]').value,e.target.querySelector('input[name="convertkit_resource_id"]').value,e.target.querySelector('input[name="convertkit_post_id"]').value)}(e))});const e=document.querySelector("#convertkit-restrict-content-modal-close");null!==e&&e.addEventListener("click",function(t){t.preventDefault(),document.querySelector("#convertkit-restrict-content-modal-background").style.display="none",document.querySelector("#convertkit-restrict-content-modal-loading").style.display="none",document.querySelector("#convertkit-restrict-content-modal").style.display="none"})})}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var c=e[o]={exports:{}};return t[o](c,c.exports,n),c.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";n(184),n(509),n(688)})()})();
// source --> https://www.lebens-retter.org/wp-content/plugins/delicious-recipes//assets/build/infiniteScroll.js?ver=9151875b11a2a71dccd1d329b604302c 
!function(){var t={7158:function(t){var e,i;e="undefined"!=typeof window?window:this,i=function(){function t(){}let e=t.prototype;return e.on=function(t,e){if(!t||!e)return this;let i=this._events=this._events||{},n=i[t]=i[t]||[];return n.includes(e)||n.push(e),this},e.once=function(t,e){if(!t||!e)return this;this.on(t,e);let i=this._onceEvents=this._onceEvents||{};return(i[t]=i[t]||{})[e]=!0,this},e.off=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;let n=i.indexOf(e);return-1!=n&&i.splice(n,1),this},e.emitEvent=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;i=i.slice(0),e=e||[];let n=this._onceEvents&&this._onceEvents[t];for(let o of i)n&&n[o]&&(this.off(t,o),delete n[o]),o.apply(this,e);return this},e.allOff=function(){return delete this._events,delete this._onceEvents,this},t},t.exports?t.exports=i():e.EvEmitter=i()},9047:function(t){var e,i;e=this,i=function(t){let e={extend:function(t,e){return Object.assign(t,e)},modulo:function(t,e){return(t%e+e)%e},makeArray:function(t){return Array.isArray(t)?t:null==t?[]:"object"==typeof t&&"number"==typeof t.length?[...t]:[t]},removeFrom:function(t,e){let i=t.indexOf(e);-1!=i&&t.splice(i,1)},getParent:function(t,e){for(;t.parentNode&&t!=document.body;)if((t=t.parentNode).matches(e))return t},getQueryElement:function(t){return"string"==typeof t?document.querySelector(t):t},handleEvent:function(t){let e="on"+t.type;this[e]&&this[e](t)},filterFindElements:function(t,i){return(t=e.makeArray(t)).filter((t=>t instanceof HTMLElement)).reduce(((t,e)=>{if(!i)return t.push(e),t;e.matches(i)&&t.push(e);let n=e.querySelectorAll(i);return t.concat(...n)}),[])},debounceMethod:function(t,e,i){i=i||100;let n=t.prototype[e],o=e+"Timeout";t.prototype[e]=function(){clearTimeout(this[o]);let t=arguments;this[o]=setTimeout((()=>{n.apply(this,t),delete this[o]}),i)}},docReady:function(t){let e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},toDashed:function(t){return t.replace(/(.)([A-Z])/g,(function(t,e,i){return e+"-"+i})).toLowerCase()}},i=t.console;return e.htmlInit=function(n,o){e.docReady((function(){let s="data-"+e.toDashed(o),r=document.querySelectorAll(`[${s}]`),l=t.jQuery;[...r].forEach((t=>{let e,r=t.getAttribute(s);try{e=r&&JSON.parse(r)}catch(e){return void(i&&i.error(`Error parsing ${s} on ${t.className}: ${e}`))}let a=new n(t,e);l&&l.data(t,o,a)}))}))},e},t.exports?t.exports=i(e):e.fizzyUIUtils=i(e)},8163:function(t,e,i){!function(e,n){t.exports?t.exports=n(0,i(6717),i(9047)):n(0,e.InfiniteScroll,e.fizzyUIUtils)}(window,(function(t,e,i){class n{constructor(t,e){this.element=t,this.infScroll=e,this.clickHandler=this.onClick.bind(this),this.element.addEventListener("click",this.clickHandler),e.on("request",this.disable.bind(this)),e.on("load",this.enable.bind(this)),e.on("error",this.hide.bind(this)),e.on("last",this.hide.bind(this))}onClick(t){t.preventDefault(),this.infScroll.loadNextPage()}enable(){this.element.removeAttribute("disabled")}disable(){this.element.disabled="disabled"}hide(){this.element.style.display="none"}destroy(){this.element.removeEventListener("click",this.clickHandler)}}return e.create.button=function(){let t=i.getQueryElement(this.options.button);t&&(this.button=new n(t,this))},e.destroy.button=function(){this.button&&this.button.destroy()},e.Button=n,e}))},6717:function(t,e,i){!function(e,n){t.exports?t.exports=n(e,i(7158),i(9047)):e.InfiniteScroll=n(e,e.EvEmitter,e.fizzyUIUtils)}(window,(function(t,e,i){let n=t.jQuery,o={};function s(t,e){let r=i.getQueryElement(t);if(r){if((t=r).infiniteScrollGUID){let i=o[t.infiniteScrollGUID];return i.option(e),i}this.element=t,this.options={...s.defaults},this.option(e),n&&(this.$element=n(this.element)),this.create()}else console.error("Bad element for InfiniteScroll: "+(r||t))}s.defaults={},s.create={},s.destroy={};let r=s.prototype;Object.assign(r,e.prototype);let l=0;r.create=function(){let t=this.guid=++l;if(this.element.infiniteScrollGUID=t,o[t]=this,this.pageIndex=1,this.loadCount=0,this.updateGetPath(),this.getPath&&this.getPath()){this.updateGetAbsolutePath(),this.log("initialized",[this.element.className]),this.callOnInit();for(let t in s.create)s.create[t].call(this)}else console.error("Disabling InfiniteScroll")},r.option=function(t){Object.assign(this.options,t)},r.callOnInit=function(){let t=this.options.onInit;t&&t.call(this,this)},r.dispatchEvent=function(t,e,i){this.log(t,i);let o=e?[e].concat(i):i;if(this.emitEvent(t,o),!n||!this.$element)return;let s=t+=".infiniteScroll";if(e){let i=n.Event(e);i.type=t,s=i}this.$element.trigger(s,i)};let a={initialized:t=>`on ${t}`,request:t=>`URL: ${t}`,load:(t,e)=>`${t.title||""}. URL: ${e}`,error:(t,e)=>`${t}. URL: ${e}`,append:(t,e,i)=>`${i.length} items. URL: ${e}`,last:(t,e)=>`URL: ${e}`,history:(t,e)=>`URL: ${e}`,pageIndex:function(t,e){return`current page determined to be: ${t} from ${e}`}};r.log=function(t,e){if(!this.options.debug)return;let i=`[InfiniteScroll] ${t}`,n=a[t];n&&(i+=". "+n.apply(this,e)),console.log(i)},r.updateMeasurements=function(){this.windowHeight=t.innerHeight;let e=this.element.getBoundingClientRect();this.top=e.top+t.scrollY},r.updateScroller=function(){let e=this.options.elementScroll;if(e){if(this.scroller=!0===e?this.element:i.getQueryElement(e),!this.scroller)throw new Error(`Unable to find elementScroll: ${e}`)}else this.scroller=t},r.updateGetPath=function(){let t=this.options.path;if(!t)return void console.error(`InfiniteScroll path option required. Set as: ${t}`);let e=typeof t;"function"!=e?"string"==e&&t.match("{{#}}")?this.updateGetPathTemplate(t):this.updateGetPathSelector(t):this.getPath=t},r.updateGetPathTemplate=function(t){this.getPath=()=>{let e=this.pageIndex+1;return t.replace("{{#}}",e)};let e=t.replace(/(\\\?|\?)/,"\\?").replace("{{#}}","(\\d\\d?\\d?)"),i=new RegExp(e),n=location.href.match(i);n&&(this.pageIndex=parseInt(n[1],10),this.log("pageIndex",[this.pageIndex,"template string"]))};let h=[/^(.*?\/?page\/?)(\d\d?\d?)(.*?$)/,/^(.*?\/?\?page=)(\d\d?\d?)(.*?$)/,/(.*?)(\d\d?\d?)(?!.*\d)(.*?$)/],c=s.getPathParts=function(t){if(t)for(let e of h){let i=t.match(e);if(i){let[,t,e,n]=i;return{begin:t,index:e,end:n}}}};r.updateGetPathSelector=function(t){let e=document.querySelector(t);if(!e)return void console.error(`Bad InfiniteScroll path option. Next link not found: ${t}`);let i=e.getAttribute("href"),n=c(i);if(!n)return void console.error(`InfiniteScroll unable to parse next link href: ${i}`);let{begin:o,index:s,end:r}=n;this.isPathSelector=!0,this.getPath=()=>o+(this.pageIndex+1)+r,this.pageIndex=parseInt(s,10)-1,this.log("pageIndex",[this.pageIndex,"next link"])},r.updateGetAbsolutePath=function(){let t=this.getPath();if(t.match(/^http/)||t.match(/^\//))return void(this.getAbsolutePath=this.getPath);let{pathname:e}=location,i=t.match(/^\?/),n=e.substring(0,e.lastIndexOf("/")),o=i?e:n+"/";this.getAbsolutePath=()=>o+this.getPath()},s.create.hideNav=function(){let t=i.getQueryElement(this.options.hideNav);t&&(t.style.display="none",this.nav=t)},s.destroy.hideNav=function(){this.nav&&(this.nav.style.display="")},r.destroy=function(){this.allOff();for(let t in s.destroy)s.destroy[t].call(this);delete this.element.infiniteScrollGUID,delete o[this.guid],n&&this.$element&&n.removeData(this.element,"infiniteScroll")},s.throttle=function(t,e){let i,n;return e=e||200,function(){let o=+new Date,s=arguments,r=()=>{i=o,t.apply(this,s)};i&&o<i+e?(clearTimeout(n),n=setTimeout(r,e)):r()}},s.data=function(t){let e=(t=i.getQueryElement(t))&&t.infiniteScrollGUID;return e&&o[e]},s.setJQuery=function(t){n=t},i.htmlInit(s,"infinite-scroll"),r._init=function(){};let{jQueryBridget:u}=t;return n&&u&&u("infiniteScroll",s,n),s}))},9774:function(t,e,i){!function(e,n){t.exports?t.exports=n(e,i(6717),i(9047)):n(e,e.InfiniteScroll,e.fizzyUIUtils)}(window,(function(t,e,i){let n=e.prototype;Object.assign(e.defaults,{history:"replace"});let o=document.createElement("a");return e.create.history=function(){this.options.history&&(o.href=this.getAbsolutePath(),(o.origin||o.protocol+"//"+o.host)==location.origin?this.options.append?this.createHistoryAppend():this.createHistoryPageLoad():console.error(`[InfiniteScroll] cannot set history with different origin: ${o.origin} on ${location.origin} . History behavior disabled.`))},n.createHistoryAppend=function(){this.updateMeasurements(),this.updateScroller(),this.scrollPages=[{top:0,path:location.href,title:document.title}],this.scrollPage=this.scrollPages[0],this.scrollHistoryHandler=this.onScrollHistory.bind(this),this.unloadHandler=this.onUnload.bind(this),this.scroller.addEventListener("scroll",this.scrollHistoryHandler),this.on("append",this.onAppendHistory),this.bindHistoryAppendEvents(!0)},n.bindHistoryAppendEvents=function(e){let i=e?"addEventListener":"removeEventListener";this.scroller[i]("scroll",this.scrollHistoryHandler),t[i]("unload",this.unloadHandler)},n.createHistoryPageLoad=function(){this.on("load",this.onPageLoadHistory)},e.destroy.history=n.destroyHistory=function(){this.options.history&&this.options.append&&this.bindHistoryAppendEvents(!1)},n.onAppendHistory=function(t,e,i){if(!i||!i.length)return;let n=i[0],s=this.getElementScrollY(n);o.href=e,this.scrollPages.push({top:s,path:o.href,title:t.title})},n.getElementScrollY=function(e){return this.options.elementScroll?e.offsetTop-this.top:e.getBoundingClientRect().top+t.scrollY},n.onScrollHistory=function(){let t=this.getClosestScrollPage();t!=this.scrollPage&&(this.scrollPage=t,this.setHistory(t.title,t.path))},i.debounceMethod(e,"onScrollHistory",150),n.getClosestScrollPage=function(){let e,i;e=this.options.elementScroll?this.scroller.scrollTop+this.scroller.clientHeight/2:t.scrollY+this.windowHeight/2;for(let t of this.scrollPages){if(t.top>=e)break;i=t}return i},n.setHistory=function(t,e){let i=this.options.history;i&&history[i+"State"]&&(history[i+"State"](null,t,e),this.options.historyTitle&&(document.title=t),this.dispatchEvent("history",null,[t,e]))},n.onUnload=function(){if(0===this.scrollPage.top)return;let e=t.scrollY-this.scrollPage.top+this.top;this.destroyHistory(),scrollTo(0,e)},n.onPageLoadHistory=function(t,e){this.setHistory(t.title,e)},e}))},48:function(t,e,i){var n;window,t.exports&&(t.exports=(n=i(6717),i(2484),i(3610),i(9774),i(8163),i(7792),n))},2484:function(t,e,i){!function(e,n){t.exports?t.exports=n(e,i(6717)):n(e,e.InfiniteScroll)}(window,(function(t,e){let i=e.prototype;Object.assign(e.defaults,{loadOnScroll:!0,checkLastPage:!0,responseBody:"text",domParseResponse:!0}),e.create.pageLoad=function(){this.canLoad=!0,this.on("scrollThreshold",this.onScrollThresholdLoad),this.on("load",this.checkLastPage),this.options.outlayer&&this.on("append",this.onAppendOutlayer)},i.onScrollThresholdLoad=function(){this.options.loadOnScroll&&this.loadNextPage()};let n=new DOMParser;function o(t){let e=document.createDocumentFragment();return t&&e.append(...t),e}return i.loadNextPage=function(){if(this.isLoading||!this.canLoad)return;let{responseBody:t,domParseResponse:e,fetchOptions:i}=this.options,o=this.getAbsolutePath();this.isLoading=!0,"function"==typeof i&&(i=i());let s=fetch(o,i).then((i=>{if(!i.ok){let t=new Error(i.statusText);return this.onPageError(t,o,i),{response:i}}return i[t]().then((s=>("text"==t&&e&&(s=n.parseFromString(s,"text/html")),204==i.status?(this.lastPageReached(s,o),{body:s,response:i}):this.onPageLoad(s,o,i))))})).catch((t=>{this.onPageError(t,o)}));return this.dispatchEvent("request",null,[o,s]),s},i.onPageLoad=function(t,e,i){return this.options.append||(this.isLoading=!1),this.pageIndex++,this.loadCount++,this.dispatchEvent("load",null,[t,e,i]),this.appendNextPage(t,e,i)},i.appendNextPage=function(t,e,i){let{append:n,responseBody:s,domParseResponse:r}=this.options;if("text"!=s||!r||!n)return{body:t,response:i};let l=t.querySelectorAll(n),a={body:t,response:i,items:l};if(!l||!l.length)return this.lastPageReached(t,e),a;let h=o(l),c=()=>(this.appendItems(l,h),this.isLoading=!1,this.dispatchEvent("append",null,[t,e,l,i]),a);return this.options.outlayer?this.appendOutlayerItems(h,c):c()},i.appendItems=function(t,e){t&&t.length&&(function(t){let e=t.querySelectorAll("script");for(let t of e){let e=document.createElement("script"),i=t.attributes;for(let t of i)e.setAttribute(t.name,t.value);e.innerHTML=t.innerHTML,t.parentNode.replaceChild(e,t)}}(e=e||o(t)),this.element.appendChild(e))},i.appendOutlayerItems=function(i,n){let o=e.imagesLoaded||t.imagesLoaded;return o?new Promise((function(t){o(i,(function(){let e=n();t(e)}))})):(console.error("[InfiniteScroll] imagesLoaded required for outlayer option"),void(this.isLoading=!1))},i.onAppendOutlayer=function(t,e,i){this.options.outlayer.appended(i)},i.checkLastPage=function(t,e){let i,{checkLastPage:n,path:o}=this.options;if(n){if("function"==typeof o&&!this.getPath())return void this.lastPageReached(t,e);"string"==typeof n?i=n:this.isPathSelector&&(i=o),i&&t.querySelector&&(t.querySelector(i)||this.lastPageReached(t,e))}},i.lastPageReached=function(t,e){this.canLoad=!1,this.dispatchEvent("last",null,[t,e])},i.onPageError=function(t,e,i){return this.isLoading=!1,this.canLoad=!1,this.dispatchEvent("error",null,[t,e,i]),t},e.create.prefill=function(){if(!this.options.prefill)return;let t=this.options.append;t?(this.updateMeasurements(),this.updateScroller(),this.isPrefilling=!0,this.on("append",this.prefill),this.once("error",this.stopPrefill),this.once("last",this.stopPrefill),this.prefill()):console.error(`append option required for prefill. Set as :${t}`)},i.prefill=function(){let t=this.getPrefillDistance();this.isPrefilling=t>=0,this.isPrefilling?(this.log("prefill"),this.loadNextPage()):this.stopPrefill()},i.getPrefillDistance=function(){return this.options.elementScroll?this.scroller.clientHeight-this.scroller.scrollHeight:this.windowHeight-this.element.clientHeight},i.stopPrefill=function(){this.log("stopPrefill"),this.off("append",this.prefill)},e}))},3610:function(t,e,i){!function(e,n){t.exports?t.exports=n(e,i(6717),i(9047)):n(e,e.InfiniteScroll,e.fizzyUIUtils)}(window,(function(t,e,i){let n=e.prototype;return Object.assign(e.defaults,{scrollThreshold:400}),e.create.scrollWatch=function(){this.pageScrollHandler=this.onPageScroll.bind(this),this.resizeHandler=this.onResize.bind(this);let t=this.options.scrollThreshold;(t||0===t)&&this.enableScrollWatch()},e.destroy.scrollWatch=function(){this.disableScrollWatch()},n.enableScrollWatch=function(){this.isScrollWatching||(this.isScrollWatching=!0,this.updateMeasurements(),this.updateScroller(),this.on("last",this.disableScrollWatch),this.bindScrollWatchEvents(!0))},n.disableScrollWatch=function(){this.isScrollWatching&&(this.bindScrollWatchEvents(!1),delete this.isScrollWatching)},n.bindScrollWatchEvents=function(e){let i=e?"addEventListener":"removeEventListener";this.scroller[i]("scroll",this.pageScrollHandler),t[i]("resize",this.resizeHandler)},n.onPageScroll=e.throttle((function(){this.getBottomDistance()<=this.options.scrollThreshold&&this.dispatchEvent("scrollThreshold")})),n.getBottomDistance=function(){let e,i;return this.options.elementScroll?(e=this.scroller.scrollHeight,i=this.scroller.scrollTop+this.scroller.clientHeight):(e=this.top+this.element.clientHeight,i=t.scrollY+this.windowHeight),e-i},n.onResize=function(){this.updateMeasurements()},i.debounceMethod(e,"onResize",150),e}))},7792:function(t,e,i){!function(e,n){t.exports?t.exports=n(0,i(6717),i(9047)):n(0,e.InfiniteScroll,e.fizzyUIUtils)}(window,(function(t,e,i){let n=e.prototype;function o(t){r(t,"none")}function s(t){r(t,"block")}function r(t,e){t&&(t.style.display=e)}return e.create.status=function(){let t=i.getQueryElement(this.options.status);t&&(this.statusElement=t,this.statusEventElements={request:t.querySelector(".infinite-scroll-request"),error:t.querySelector(".infinite-scroll-error"),last:t.querySelector(".infinite-scroll-last")},this.on("request",this.showRequestStatus),this.on("error",this.showErrorStatus),this.on("last",this.showLastStatus),this.bindHideStatus("on"))},n.bindHideStatus=function(t){let e=this.options.append?"append":"load";this[t](e,this.hideAllStatus)},n.showRequestStatus=function(){this.showStatus("request")},n.showErrorStatus=function(){this.showStatus("error")},n.showLastStatus=function(){this.showStatus("last"),this.bindHideStatus("off")},n.showStatus=function(t){s(this.statusElement),this.hideStatusEventElements(),s(this.statusEventElements[t])},n.hideAllStatus=function(){o(this.statusElement),this.hideStatusEventElements()},n.hideStatusEventElements=function(){for(let t in this.statusEventElements)o(this.statusEventElements[t])},e}))}},e={};function i(n){var o=e[n];if(void 0!==o)return o.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,i),s.exports}i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,{a:e}),e},i.d=function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";var t=i(48),e=i.n(t);document.addEventListener("DOMContentLoaded",(function(){!function(){var t=document.querySelector("nav.dr__pagination");if(t){var i=t.dataset.pagination;if(!(i.indexOf("simple")>-1)&&!(i.indexOf("next_prev")>-1)&&t.querySelector(".next")){var n=t.parentNode.previousElementSibling,o=n.querySelector(".dr-archive-single")?".dr-archive-single":".recipe-post";new(e())(n,{checkLastPage:".next",path:".next",append:o,hideNav:t.querySelector("nav"),button:"load_more"===i?t.querySelector(".dr-load-more"):null,scrollThreshold:"infinite_scroll"===i&&400,onInit:function(){this.on("load",(function(e){t.querySelector(".dr__load-more-helper").classList.remove("dr-loading"),setTimeout((function(){}),100)})),this.on("append",(function(){})),this.on("request",(function(){t.querySelector(".dr__load-more-helper").classList.add("dr-loading")})),this.on("last",(function(){t.classList.add(t.querySelector(".dr__last-page-text")?"dr__last-page":"dr__last-page-no-info")}))}})}}}()}))}()}();
// source --> https://www.lebens-retter.org/wp-content/plugins/delicious-recipes//assets/lib/jquery-rateyo/jquery.rateyo.min.js?ver=2.3.2 
/*rateYo V2.3.2, A simple and flexible star rating plugin
prashanth pamidi (https://github.com/prrashi)*/
!(function (a) {
	"use strict";
	function b() {
		var a = !1;
		return (
			(function (b) {
				(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(
					b
				) ||
					/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(
						b.substr(0, 4)
					)) &&
					(a = !0);
			})(navigator.userAgent || navigator.vendor || window.opera),
			a
		);
	}
	function c(a, b, c) {
		return a === b ? (a = b) : a === c && (a = c), a;
	}
	function d(a, b, c) {
		if (!(a >= b && a <= c))
			throw Error(
				"Invalid Rating, expected value between " + b + " and " + c
			);
		return a;
	}
	function e(a) {
		return void 0 !== a;
	}
	function f(a, b, c) {
		var d = (c / 100) * (b - a);
		return (
			(d = Math.round(a + d).toString(16)),
			1 === d.length && (d = "0" + d),
			d
		);
	}
	function g(a, b, c) {
		if (!a || !b) return null;
		(c = e(c) ? c : 0), (a = q(a)), (b = q(b));
		var d = f(a.r, b.r, c),
			g = f(a.b, b.b, c);
		return "#" + d + f(a.g, b.g, c) + g;
	}
	function h(f, i) {
		function k(a) {
			e(a) || (a = i.rating), (Z = a);
			var b = a / P,
				c = b * R;
			b > 1 && (c += (Math.ceil(b) - 1) * T),
				r(i.ratedFill),
				(c = i.rtl ? 100 - c : c),
				c < 0 ? (c = 0) : c > 100 && (c = 100),
				X.css("width", c + "%");
		}
		function l() {
			(U = Q * i.numStars + S * (i.numStars - 1)),
				(R = (Q / U) * 100),
				(T = (S / U) * 100),
				f.width(U),
				k();
		}
		function n(a) {
			var b = (i.starWidth = a);
			return (
				(Q = window.parseFloat(i.starWidth.replace("px", ""))),
				W.find("svg").attr({ width: i.starWidth, height: b }),
				X.find("svg").attr({ width: i.starWidth, height: b }),
				l(),
				f
			);
		}
		function p(a) {
			return (
				(i.spacing = a),
				(S = parseFloat(i.spacing.replace("px", ""))),
				W.find("svg:not(:first-child)").css({ "margin-left": a }),
				X.find("svg:not(:first-child)").css({ "margin-left": a }),
				l(),
				f
			);
		}
		function q(a) {
			return (
				(i.normalFill = a),
				(i.rtl ? X : W).find("svg").attr({ fill: i.normalFill }),
				f
			);
		}
		function r(a) {
			if (i.multiColor) {
				var b = Z - Y,
					c = (b / i.maxValue) * 100,
					d = i.multiColor || {};
				a = g(
					d.startColor || o.startColor,
					d.endColor || o.endColor,
					c
				);
			} else _ = a;
			return (
				(i.ratedFill = a),
				(i.rtl ? W : X).find("svg").attr({ fill: i.ratedFill }),
				f
			);
		}
		function s(a) {
			(a = !!a), (i.rtl = a), q(i.normalFill), k();
		}
		function t(a) {
			(i.multiColor = a), r(a ? a : _);
		}
		function u(b) {
			(i.numStars = b),
				(P = i.maxValue / i.numStars),
				W.empty(),
				X.empty();
			for (var c = 0; c < i.numStars; c++)
				W.append(a(i.starSvg || m)), X.append(a(i.starSvg || m));
			return n(i.starWidth), q(i.normalFill), p(i.spacing), k(), f;
		}
		function v(a) {
			return (
				(i.maxValue = a),
				(P = i.maxValue / i.numStars),
				i.rating > a && C(a),
				k(),
				f
			);
		}
		function w(a) {
			return (i.precision = a), C(i.rating), f;
		}
		function x(a) {
			return (i.halfStar = a), f;
		}
		function y(a) {
			return (i.fullStar = a), f;
		}
		function z(a) {
			var b = a % P,
				c = P / 2,
				d = i.halfStar,
				e = i.fullStar;
			return e || d
				? (e || (d && b > c)
						? (a += P - b)
						: ((a -= b), b > 0 && (a += c)),
				  a)
				: a;
		}
		function A(a) {
			var b = W.offset(),
				c = b.left,
				d = c + W.width(),
				e = i.maxValue,
				f = a.pageX,
				g = 0;
			if (f < c) g = Y;
			else if (f > d) g = e;
			else {
				var h = (f - c) / (d - c);
				if (S > 0) {
					h *= 100;
					for (var j = h; j > 0; )
						j > R
							? ((g += P), (j -= R + T))
							: ((g += (j / R) * P), (j = 0));
				} else g = h * i.maxValue;
				g = z(g);
			}
			return i.rtl && (g = e - g), parseFloat(g);
		}
		function B(a) {
			return (
				(i.readOnly = a),
				f.attr("readonly", !0),
				N(),
				a || (f.removeAttr("readonly"), M()),
				f
			);
		}
		function C(a) {
			var b = a,
				e = i.maxValue;
			return (
				"string" == typeof b &&
					("%" === b[b.length - 1] &&
						((b = b.substr(0, b.length - 1)), (e = 100), v(e)),
					(b = parseFloat(b))),
				d(b, Y, e),
				(b = parseFloat(b.toFixed(i.precision))),
				c(parseFloat(b), Y, e),
				(i.rating = b),
				k(),
				$ && f.trigger("rateyo.set", { rating: b }),
				f
			);
		}
		function D(a) {
			return (i.onInit = a), f;
		}
		function E(a) {
			return (i.onSet = a), f;
		}
		function F(a) {
			return (i.onChange = a), f;
		}
		function G(a) {
			var b = A(a).toFixed(i.precision),
				d = i.maxValue;
			(b = c(parseFloat(b), Y, d)),
				k(b),
				f.trigger("rateyo.change", { rating: b });
		}
		function H() {
			b() || (k(), f.trigger("rateyo.change", { rating: i.rating }));
		}
		function I(a) {
			var b = A(a).toFixed(i.precision);
			(b = parseFloat(b)), O.rating(b);
		}
		function J(a, b) {
			i.onInit &&
				"function" == typeof i.onInit &&
				i.onInit.apply(this, [b.rating, O]);
		}
		function K(a, b) {
			i.onChange &&
				"function" == typeof i.onChange &&
				i.onChange.apply(this, [b.rating, O]);
		}
		function L(a, b) {
			i.onSet &&
				"function" == typeof i.onSet &&
				i.onSet.apply(this, [b.rating, O]);
		}
		function M() {
			f.on("mousemove", G)
				.on("mouseenter", G)
				.on("mouseleave", H)
				.on("click", I)
				.on("rateyo.init", J)
				.on("rateyo.change", K)
				.on("rateyo.set", L);
		}
		function N() {
			f.off("mousemove", G)
				.off("mouseenter", G)
				.off("mouseleave", H)
				.off("click", I)
				.off("rateyo.init", J)
				.off("rateyo.change", K)
				.off("rateyo.set", L);
		}
		this.node = f.get(0);
		var O = this;
		f.empty().addClass("jq-ry-container");
		var P,
			Q,
			R,
			S,
			T,
			U,
			V = a("<div/>").addClass("jq-ry-group-wrapper").appendTo(f),
			W = a("<div/>")
				.addClass("jq-ry-normal-group")
				.addClass("jq-ry-group")
				.appendTo(V),
			X = a("<div/>")
				.addClass("jq-ry-rated-group")
				.addClass("jq-ry-group")
				.appendTo(V),
			Y = 0,
			Z = i.rating,
			$ = !1,
			_ = i.ratedFill;
		(this.rating = function (a) {
			return e(a) ? (C(a), f) : i.rating;
		}),
			(this.destroy = function () {
				return (
					i.readOnly || N(),
					(h.prototype.collection = j(f.get(0), this.collection)),
					f.removeClass("jq-ry-container").children().remove(),
					f
				);
			}),
			(this.method = function (a) {
				if (!a) throw Error("Method name not specified!");
				if (!e(this[a])) throw Error("Method " + a + " doesn't exist!");
				var b = Array.prototype.slice.apply(arguments, []),
					c = b.slice(1);
				return this[a].apply(this, c);
			}),
			(this.option = function (a, b) {
				if (!e(a)) return i;
				var c;
				switch (a) {
					case "starWidth":
						c = n;
						break;
					case "numStars":
						c = u;
						break;
					case "normalFill":
						c = q;
						break;
					case "ratedFill":
						c = r;
						break;
					case "multiColor":
						c = t;
						break;
					case "maxValue":
						c = v;
						break;
					case "precision":
						c = w;
						break;
					case "rating":
						c = C;
						break;
					case "halfStar":
						c = x;
						break;
					case "fullStar":
						c = y;
						break;
					case "readOnly":
						c = B;
						break;
					case "spacing":
						c = p;
						break;
					case "rtl":
						c = s;
						break;
					case "onInit":
						c = D;
						break;
					case "onSet":
						c = E;
						break;
					case "onChange":
						c = F;
						break;
					default:
						throw Error("No such option as " + a);
				}
				return e(b) ? c(b) : i[a];
			}),
			u(i.numStars),
			B(i.readOnly),
			i.rtl && s(i.rtl),
			this.collection.push(this),
			this.rating(i.rating, !0),
			($ = !0),
			f.trigger("rateyo.init", { rating: i.rating });
	}
	function i(b, c) {
		var d;
		return (
			a.each(c, function () {
				if (b === this.node) return (d = this), !1;
			}),
			d
		);
	}
	function j(b, c) {
		return (
			a.each(c, function (a) {
				if (b === this.node) {
					var d = c.slice(0, a),
						e = c.slice(a + 1, c.length);
					return (c = d.concat(e)), !1;
				}
			}),
			c
		);
	}
	function k(b) {
		var c = h.prototype.collection,
			d = a(this);
		if (0 === d.length) return d;
		var e = Array.prototype.slice.apply(arguments, []);
		if (0 === e.length) b = e[0] = {};
		else {
			if (1 !== e.length || "object" != typeof e[0]) {
				if (e.length >= 1 && "string" == typeof e[0]) {
					var f = e[0],
						g = e.slice(1),
						j = [];
					return (
						a.each(d, function (a, b) {
							var d = i(b, c);
							if (!d)
								throw Error(
									"Trying to set options before even initialization"
								);
							var e = d[f];
							if (!e)
								throw Error("Method " + f + " does not exist!");
							var h = e.apply(d, g);
							j.push(h);
						}),
						(j = 1 === j.length ? j[0] : j)
					);
				}
				throw Error("Invalid Arguments");
			}
			b = e[0];
		}
		return (
			(b = a.extend({}, n, b)),
			a.each(d, function () {
				var d = i(this, c);
				if (d) return d;
				var e = a(this),
					f = {},
					g = a.extend({}, b);
				return (
					a.each(e.data(), function (a, b) {
						if (0 === a.indexOf("rateyo")) {
							var c = a.replace(/^rateyo/, "");
							(c = c[0].toLowerCase() + c.slice(1)),
								(f[c] = b),
								delete g[c];
						}
					}),
					new h(a(this), a.extend({}, f, g))
				);
			})
		);
	}
	function l() {
		return k.apply(this, Array.prototype.slice.apply(arguments, []));
	}
	var m =
			'<?xml version="1.0" encoding="utf-8"?><svg version="1.1"xmlns="http://www.w3.org/2000/svg"viewBox="0 12.705 512 486.59"x="0px" y="0px"xml:space="preserve"><polygon points="256.814,12.705 317.205,198.566 512.631,198.566 354.529,313.435 414.918,499.295 256.814,384.427 98.713,499.295 159.102,313.435 1,198.566 196.426,198.566 "/></svg>',
		n = {
			starWidth: "32px",
			normalFill: "gray",
			ratedFill: "#f39c12",
			numStars: 5,
			maxValue: 5,
			precision: 1,
			rating: 0,
			fullStar: !1,
			halfStar: !1,
			readOnly: !1,
			spacing: "0px",
			rtl: !1,
			multiColor: null,
			onInit: null,
			onChange: null,
			onSet: null,
			starSvg: null,
		},
		o = { startColor: "#c0392b", endColor: "#f1c40f" },
		p = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,
		q = function (a) {
			if (!p.test(a)) return null;
			var b = p.exec(a);
			return {
				r: parseInt(b[1], 16),
				g: parseInt(b[2], 16),
				b: parseInt(b[3], 16),
			};
		};
	(h.prototype.collection = []), (window.RateYo = h), (a.fn.rateYo = l);
})(window.jQuery);
// source --> https://www.lebens-retter.org/wp-content/plugins/delicious-recipes//assets/lib/owl-carousel/owl.carousel.min.js?ver=2.3.4 
/**
 * Owl Carousel v2.3.4
 * Copyright 2013-2018 David Deutsch
 * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
 */
!function(a,b,c,d){function e(b,c){this.settings=null,this.options=a.extend({},e.Defaults,c),this.$element=a(b),this._handlers={},this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this._states={current:{},tags:{initializing:["busy"],animating:["busy"],dragging:["interacting"]}},a.each(["onResize","onThrottledResize"],a.proxy(function(b,c){this._handlers[c]=a.proxy(this[c],this)},this)),a.each(e.Plugins,a.proxy(function(a,b){this._plugins[a.charAt(0).toLowerCase()+a.slice(1)]=new b(this)},this)),a.each(e.Workers,a.proxy(function(b,c){this._pipe.push({filter:c.filter,run:a.proxy(c.run,this)})},this)),this.setup(),this.initialize()}e.Defaults={items:3,loop:!1,center:!1,rewind:!1,checkVisibility:!0,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:b,fallbackEasing:"swing",slideTransition:"",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",refreshClass:"owl-refresh",loadedClass:"owl-loaded",loadingClass:"owl-loading",rtlClass:"owl-rtl",responsiveClass:"owl-responsive",dragClass:"owl-drag",itemClass:"owl-item",stageClass:"owl-stage",stageOuterClass:"owl-stage-outer",grabClass:"owl-grab"},e.Width={Default:"default",Inner:"inner",Outer:"outer"},e.Type={Event:"event",State:"state"},e.Plugins={},e.Workers=[{filter:["width","settings"],run:function(){this._width=this.$element.width()}},{filter:["width","items","settings"],run:function(a){a.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){this.$stage.children(".cloned").remove()}},{filter:["width","items","settings"],run:function(a){var b=this.settings.margin||"",c=!this.settings.autoWidth,d=this.settings.rtl,e={width:"auto","margin-left":d?b:"","margin-right":d?"":b};!c&&this.$stage.children().css(e),a.css=e}},{filter:["width","items","settings"],run:function(a){var b=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,c=null,d=this._items.length,e=!this.settings.autoWidth,f=[];for(a.items={merge:!1,width:b};d--;)c=this._mergers[d],c=this.settings.mergeFit&&Math.min(c,this.settings.items)||c,a.items.merge=c>1||a.items.merge,f[d]=e?b*c:this._items[d].width();this._widths=f}},{filter:["items","settings"],run:function(){var b=[],c=this._items,d=this.settings,e=Math.max(2*d.items,4),f=2*Math.ceil(c.length/2),g=d.loop&&c.length?d.rewind?e:Math.max(e,f):0,h="",i="";for(g/=2;g>0;)b.push(this.normalize(b.length/2,!0)),h+=c[b[b.length-1]][0].outerHTML,b.push(this.normalize(c.length-1-(b.length-1)/2,!0)),i=c[b[b.length-1]][0].outerHTML+i,g-=1;this._clones=b,a(h).addClass("cloned").appendTo(this.$stage),a(i).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var a=this.settings.rtl?1:-1,b=this._clones.length+this._items.length,c=-1,d=0,e=0,f=[];++c<b;)d=f[c-1]||0,e=this._widths[this.relative(c)]+this.settings.margin,f.push(d+e*a);this._coordinates=f}},{filter:["width","items","settings"],run:function(){var a=this.settings.stagePadding,b=this._coordinates,c={width:Math.ceil(Math.abs(b[b.length-1]))+2*a,"padding-left":a||"","padding-right":a||""};this.$stage.css(c)}},{filter:["width","items","settings"],run:function(a){var b=this._coordinates.length,c=!this.settings.autoWidth,d=this.$stage.children();if(c&&a.items.merge)for(;b--;)a.css.width=this._widths[this.relative(b)],d.eq(b).css(a.css);else c&&(a.css.width=a.items.width,d.css(a.css))}},{filter:["items"],run:function(){this._coordinates.length<1&&this.$stage.removeAttr("style")}},{filter:["width","items","settings"],run:function(a){a.current=a.current?this.$stage.children().index(a.current):0,a.current=Math.max(this.minimum(),Math.min(this.maximum(),a.current)),this.reset(a.current)}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var a,b,c,d,e=this.settings.rtl?1:-1,f=2*this.settings.stagePadding,g=this.coordinates(this.current())+f,h=g+this.width()*e,i=[];for(c=0,d=this._coordinates.length;c<d;c++)a=this._coordinates[c-1]||0,b=Math.abs(this._coordinates[c])+f*e,(this.op(a,"<=",g)&&this.op(a,">",h)||this.op(b,"<",g)&&this.op(b,">",h))&&i.push(c);this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+i.join("), :eq(")+")").addClass("active"),this.$stage.children(".center").removeClass("center"),this.settings.center&&this.$stage.children().eq(this.current()).addClass("center")}}],e.prototype.initializeStage=function(){this.$stage=this.$element.find("."+this.settings.stageClass),this.$stage.length||(this.$element.addClass(this.options.loadingClass),this.$stage=a("<"+this.settings.stageElement+">",{class:this.settings.stageClass}).wrap(a("<div/>",{class:this.settings.stageOuterClass})),this.$element.append(this.$stage.parent()))},e.prototype.initializeItems=function(){var b=this.$element.find(".owl-item");if(b.length)return this._items=b.get().map(function(b){return a(b)}),this._mergers=this._items.map(function(){return 1}),void this.refresh();this.replace(this.$element.children().not(this.$stage.parent())),this.isVisible()?this.refresh():this.invalidate("width"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass)},e.prototype.initialize=function(){if(this.enter("initializing"),this.trigger("initialize"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.autoWidth&&!this.is("pre-loading")){var a,b,c;a=this.$element.find("img"),b=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:d,c=this.$element.children(b).width(),a.length&&c<=0&&this.preloadAutoWidthImages(a)}this.initializeStage(),this.initializeItems(),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized")},e.prototype.isVisible=function(){return!this.settings.checkVisibility||this.$element.is(":visible")},e.prototype.setup=function(){var b=this.viewport(),c=this.options.responsive,d=-1,e=null;c?(a.each(c,function(a){a<=b&&a>d&&(d=Number(a))}),e=a.extend({},this.options,c[d]),"function"==typeof e.stagePadding&&(e.stagePadding=e.stagePadding()),delete e.responsive,e.responsiveClass&&this.$element.attr("class",this.$element.attr("class").replace(new RegExp("("+this.options.responsiveClass+"-)\\S+\\s","g"),"$1"+d))):e=a.extend({},this.options),this.trigger("change",{property:{name:"settings",value:e}}),this._breakpoint=d,this.settings=e,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}})},e.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},e.prototype.prepare=function(b){var c=this.trigger("prepare",{content:b});return c.data||(c.data=a("<"+this.settings.itemElement+"/>").addClass(this.options.itemClass).append(b)),this.trigger("prepared",{content:c.data}),c.data},e.prototype.update=function(){for(var b=0,c=this._pipe.length,d=a.proxy(function(a){return this[a]},this._invalidated),e={};b<c;)(this._invalidated.all||a.grep(this._pipe[b].filter,d).length>0)&&this._pipe[b].run(e),b++;this._invalidated={},!this.is("valid")&&this.enter("valid")},e.prototype.width=function(a){switch(a=a||e.Width.Default){case e.Width.Inner:case e.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},e.prototype.refresh=function(){this.enter("refreshing"),this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$element.addClass(this.options.refreshClass),this.update(),this.$element.removeClass(this.options.refreshClass),this.leave("refreshing"),this.trigger("refreshed")},e.prototype.onThrottledResize=function(){b.clearTimeout(this.resizeTimer),this.resizeTimer=b.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},e.prototype.onResize=function(){return!!this._items.length&&(this._width!==this.$element.width()&&(!!this.isVisible()&&(this.enter("resizing"),this.trigger("resize").isDefaultPrevented()?(this.leave("resizing"),!1):(this.invalidate("width"),this.refresh(),this.leave("resizing"),void this.trigger("resized")))))},e.prototype.registerEventHandlers=function(){a.support.transition&&this.$stage.on(a.support.transition.end+".owl.core",a.proxy(this.onTransitionEnd,this)),!1!==this.settings.responsive&&this.on(b,"resize",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on("mousedown.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("dragstart.owl.core selectstart.owl.core",function(){return!1})),this.settings.touchDrag&&(this.$stage.on("touchstart.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("touchcancel.owl.core",a.proxy(this.onDragEnd,this)))},e.prototype.onDragStart=function(b){var d=null;3!==b.which&&(a.support.transform?(d=this.$stage.css("transform").replace(/.*\(|\)| /g,"").split(","),d={x:d[16===d.length?12:4],y:d[16===d.length?13:5]}):(d=this.$stage.position(),d={x:this.settings.rtl?d.left+this.$stage.width()-this.width()+this.settings.margin:d.left,y:d.top}),this.is("animating")&&(a.support.transform?this.animate(d.x):this.$stage.stop(),this.invalidate("position")),this.$element.toggleClass(this.options.grabClass,"mousedown"===b.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=a(b.target),this._drag.stage.start=d,this._drag.stage.current=d,this._drag.pointer=this.pointer(b),a(c).on("mouseup.owl.core touchend.owl.core",a.proxy(this.onDragEnd,this)),a(c).one("mousemove.owl.core touchmove.owl.core",a.proxy(function(b){var d=this.difference(this._drag.pointer,this.pointer(b));a(c).on("mousemove.owl.core touchmove.owl.core",a.proxy(this.onDragMove,this)),Math.abs(d.x)<Math.abs(d.y)&&this.is("valid")||(b.preventDefault(),this.enter("dragging"),this.trigger("drag"))},this)))},e.prototype.onDragMove=function(a){var b=null,c=null,d=null,e=this.difference(this._drag.pointer,this.pointer(a)),f=this.difference(this._drag.stage.start,e);this.is("dragging")&&(a.preventDefault(),this.settings.loop?(b=this.coordinates(this.minimum()),c=this.coordinates(this.maximum()+1)-b,f.x=((f.x-b)%c+c)%c+b):(b=this.settings.rtl?this.coordinates(this.maximum()):this.coordinates(this.minimum()),c=this.settings.rtl?this.coordinates(this.minimum()):this.coordinates(this.maximum()),d=this.settings.pullDrag?-1*e.x/5:0,f.x=Math.max(Math.min(f.x,b+d),c+d)),this._drag.stage.current=f,this.animate(f.x))},e.prototype.onDragEnd=function(b){var d=this.difference(this._drag.pointer,this.pointer(b)),e=this._drag.stage.current,f=d.x>0^this.settings.rtl?"left":"right";a(c).off(".owl.core"),this.$element.removeClass(this.options.grabClass),(0!==d.x&&this.is("dragging")||!this.is("valid"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(e.x,0!==d.x?f:this._drag.direction)),this.invalidate("position"),this.update(),this._drag.direction=f,(Math.abs(d.x)>3||(new Date).getTime()-this._drag.time>300)&&this._drag.target.one("click.owl.core",function(){return!1})),this.is("dragging")&&(this.leave("dragging"),this.trigger("dragged"))},e.prototype.closest=function(b,c){var e=-1,f=30,g=this.width(),h=this.coordinates();return this.settings.freeDrag||a.each(h,a.proxy(function(a,i){return"left"===c&&b>i-f&&b<i+f?e=a:"right"===c&&b>i-g-f&&b<i-g+f?e=a+1:this.op(b,"<",i)&&this.op(b,">",h[a+1]!==d?h[a+1]:i-g)&&(e="left"===c?a+1:a),-1===e},this)),this.settings.loop||(this.op(b,">",h[this.minimum()])?e=b=this.minimum():this.op(b,"<",h[this.maximum()])&&(e=b=this.maximum())),e},e.prototype.animate=function(b){var c=this.speed()>0;this.is("animating")&&this.onTransitionEnd(),c&&(this.enter("animating"),this.trigger("translate")),a.support.transform3d&&a.support.transition?this.$stage.css({transform:"translate3d("+b+"px,0px,0px)",transition:this.speed()/1e3+"s"+(this.settings.slideTransition?" "+this.settings.slideTransition:"")}):c?this.$stage.animate({left:b+"px"},this.speed(),this.settings.fallbackEasing,a.proxy(this.onTransitionEnd,this)):this.$stage.css({left:b+"px"})},e.prototype.is=function(a){return this._states.current[a]&&this._states.current[a]>0},e.prototype.current=function(a){if(a===d)return this._current;if(0===this._items.length)return d;if(a=this.normalize(a),this._current!==a){var b=this.trigger("change",{property:{name:"position",value:a}});b.data!==d&&(a=this.normalize(b.data)),this._current=a,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current},e.prototype.invalidate=function(b){return"string"===a.type(b)&&(this._invalidated[b]=!0,this.is("valid")&&this.leave("valid")),a.map(this._invalidated,function(a,b){return b})},e.prototype.reset=function(a){(a=this.normalize(a))!==d&&(this._speed=0,this._current=a,this.suppress(["translate","translated"]),this.animate(this.coordinates(a)),this.release(["translate","translated"]))},e.prototype.normalize=function(a,b){var c=this._items.length,e=b?0:this._clones.length;return!this.isNumeric(a)||c<1?a=d:(a<0||a>=c+e)&&(a=((a-e/2)%c+c)%c+e/2),a},e.prototype.relative=function(a){return a-=this._clones.length/2,this.normalize(a,!0)},e.prototype.maximum=function(a){var b,c,d,e=this.settings,f=this._coordinates.length;if(e.loop)f=this._clones.length/2+this._items.length-1;else if(e.autoWidth||e.merge){if(b=this._items.length)for(c=this._items[--b].width(),d=this.$element.width();b--&&!((c+=this._items[b].width()+this.settings.margin)>d););f=b+1}else f=e.center?this._items.length-1:this._items.length-e.items;return a&&(f-=this._clones.length/2),Math.max(f,0)},e.prototype.minimum=function(a){return a?0:this._clones.length/2},e.prototype.items=function(a){return a===d?this._items.slice():(a=this.normalize(a,!0),this._items[a])},e.prototype.mergers=function(a){return a===d?this._mergers.slice():(a=this.normalize(a,!0),this._mergers[a])},e.prototype.clones=function(b){var c=this._clones.length/2,e=c+this._items.length,f=function(a){return a%2==0?e+a/2:c-(a+1)/2};return b===d?a.map(this._clones,function(a,b){return f(b)}):a.map(this._clones,function(a,c){return a===b?f(c):null})},e.prototype.speed=function(a){return a!==d&&(this._speed=a),this._speed},e.prototype.coordinates=function(b){var c,e=1,f=b-1;return b===d?a.map(this._coordinates,a.proxy(function(a,b){return this.coordinates(b)},this)):(this.settings.center?(this.settings.rtl&&(e=-1,f=b+1),c=this._coordinates[b],c+=(this.width()-c+(this._coordinates[f]||0))/2*e):c=this._coordinates[f]||0,c=Math.ceil(c))},e.prototype.duration=function(a,b,c){return 0===c?0:Math.min(Math.max(Math.abs(b-a),1),6)*Math.abs(c||this.settings.smartSpeed)},e.prototype.to=function(a,b){var c=this.current(),d=null,e=a-this.relative(c),f=(e>0)-(e<0),g=this._items.length,h=this.minimum(),i=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(e)>g/2&&(e+=-1*f*g),a=c+e,(d=((a-h)%g+g)%g+h)!==a&&d-e<=i&&d-e>0&&(c=d-e,a=d,this.reset(c))):this.settings.rewind?(i+=1,a=(a%i+i)%i):a=Math.max(h,Math.min(i,a)),this.speed(this.duration(c,a,b)),this.current(a),this.isVisible()&&this.update()},e.prototype.next=function(a){a=a||!1,this.to(this.relative(this.current())+1,a)},e.prototype.prev=function(a){a=a||!1,this.to(this.relative(this.current())-1,a)},e.prototype.onTransitionEnd=function(a){if(a!==d&&(a.stopPropagation(),(a.target||a.srcElement||a.originalTarget)!==this.$stage.get(0)))return!1;this.leave("animating"),this.trigger("translated")},e.prototype.viewport=function(){var d;return this.options.responsiveBaseElement!==b?d=a(this.options.responsiveBaseElement).width():b.innerWidth?d=b.innerWidth:c.documentElement&&c.documentElement.clientWidth?d=c.documentElement.clientWidth:console.warn("Can not detect viewport width."),d},e.prototype.replace=function(b){this.$stage.empty(),this._items=[],b&&(b=b instanceof jQuery?b:a(b)),this.settings.nestedItemSelector&&(b=b.find("."+this.settings.nestedItemSelector)),b.filter(function(){return 1===this.nodeType}).each(a.proxy(function(a,b){b=this.prepare(b),this.$stage.append(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)},this)),this.reset(this.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},e.prototype.add=function(b,c){var e=this.relative(this._current);c=c===d?this._items.length:this.normalize(c,!0),b=b instanceof jQuery?b:a(b),this.trigger("add",{content:b,position:c}),b=this.prepare(b),0===this._items.length||c===this._items.length?(0===this._items.length&&this.$stage.append(b),0!==this._items.length&&this._items[c-1].after(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)):(this._items[c].before(b),this._items.splice(c,0,b),this._mergers.splice(c,0,1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)),this._items[e]&&this.reset(this._items[e].index()),this.invalidate("items"),this.trigger("added",{content:b,position:c})},e.prototype.remove=function(a){(a=this.normalize(a,!0))!==d&&(this.trigger("remove",{content:this._items[a],position:a}),this._items[a].remove(),this._items.splice(a,1),this._mergers.splice(a,1),this.invalidate("items"),this.trigger("removed",{content:null,position:a}))},e.prototype.preloadAutoWidthImages=function(b){b.each(a.proxy(function(b,c){this.enter("pre-loading"),c=a(c),a(new Image).one("load",a.proxy(function(a){c.attr("src",a.target.src),c.css("opacity",1),this.leave("pre-loading"),!this.is("pre-loading")&&!this.is("initializing")&&this.refresh()},this)).attr("src",c.attr("src")||c.attr("data-src")||c.attr("data-src-retina"))},this))},e.prototype.destroy=function(){this.$element.off(".owl.core"),this.$stage.off(".owl.core"),a(c).off(".owl.core"),!1!==this.settings.responsive&&(b.clearTimeout(this.resizeTimer),this.off(b,"resize",this._handlers.onThrottledResize));for(var d in this._plugins)this._plugins[d].destroy();this.$stage.children(".cloned").remove(),this.$stage.unwrap(),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.remove(),this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class",this.$element.attr("class").replace(new RegExp(this.options.responsiveClass+"-\\S+\\s","g"),"")).removeData("owl.carousel")},e.prototype.op=function(a,b,c){var d=this.settings.rtl;switch(b){case"<":return d?a>c:a<c;case">":return d?a<c:a>c;case">=":return d?a<=c:a>=c;case"<=":return d?a>=c:a<=c}},e.prototype.on=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d):a.attachEvent&&a.attachEvent("on"+b,c)},e.prototype.off=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d):a.detachEvent&&a.detachEvent("on"+b,c)},e.prototype.trigger=function(b,c,d,f,g){var h={item:{count:this._items.length,index:this.current()}},i=a.camelCase(a.grep(["on",b,d],function(a){return a}).join("-").toLowerCase()),j=a.Event([b,"owl",d||"carousel"].join(".").toLowerCase(),a.extend({relatedTarget:this},h,c));return this._supress[b]||(a.each(this._plugins,function(a,b){b.onTrigger&&b.onTrigger(j)}),this.register({type:e.Type.Event,name:b}),this.$element.trigger(j),this.settings&&"function"==typeof this.settings[i]&&this.settings[i].call(this,j)),j},e.prototype.enter=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]===d&&(this._states.current[b]=0),this._states.current[b]++},this))},e.prototype.leave=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]--},this))},e.prototype.register=function(b){if(b.type===e.Type.Event){if(a.event.special[b.name]||(a.event.special[b.name]={}),!a.event.special[b.name].owl){var c=a.event.special[b.name]._default;a.event.special[b.name]._default=function(a){return!c||!c.apply||a.namespace&&-1!==a.namespace.indexOf("owl")?a.namespace&&a.namespace.indexOf("owl")>-1:c.apply(this,arguments)},a.event.special[b.name].owl=!0}}else b.type===e.Type.State&&(this._states.tags[b.name]?this._states.tags[b.name]=this._states.tags[b.name].concat(b.tags):this._states.tags[b.name]=b.tags,this._states.tags[b.name]=a.grep(this._states.tags[b.name],a.proxy(function(c,d){return a.inArray(c,this._states.tags[b.name])===d},this)))},e.prototype.suppress=function(b){a.each(b,a.proxy(function(a,b){this._supress[b]=!0},this))},e.prototype.release=function(b){a.each(b,a.proxy(function(a,b){delete this._supress[b]},this))},e.prototype.pointer=function(a){var c={x:null,y:null};return a=a.originalEvent||a||b.event,a=a.touches&&a.touches.length?a.touches[0]:a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:a,a.pageX?(c.x=a.pageX,c.y=a.pageY):(c.x=a.clientX,c.y=a.clientY),c},e.prototype.isNumeric=function(a){return!isNaN(parseFloat(a))},e.prototype.difference=function(a,b){return{x:a.x-b.x,y:a.y-b.y}},a.fn.owlCarousel=function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){var d=a(this),f=d.data("owl.carousel");f||(f=new e(this,"object"==typeof b&&b),d.data("owl.carousel",f),a.each(["next","prev","to","destroy","refresh","replace","add","remove"],function(b,c){f.register({type:e.Type.Event,name:c}),f.$element.on(c+".owl.carousel.core",a.proxy(function(a){a.namespace&&a.relatedTarget!==this&&(this.suppress([c]),f[c].apply(this,[].slice.call(arguments,1)),this.release([c]))},f))})),"string"==typeof b&&"_"!==b.charAt(0)&&f[b].apply(f,c)})},a.fn.owlCarousel.Constructor=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._interval=null,this._visible=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoRefresh&&this.watch()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={autoRefresh:!0,autoRefreshInterval:500},e.prototype.watch=function(){this._interval||(this._visible=this._core.isVisible(),this._interval=b.setInterval(a.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},e.prototype.refresh=function(){this._core.isVisible()!==this._visible&&(this._visible=!this._visible,this._core.$element.toggleClass("owl-hidden",!this._visible),this._visible&&this._core.invalidate("width")&&this._core.refresh())},e.prototype.destroy=function(){var a,c;b.clearInterval(this._interval);for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoRefresh=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel resized.owl.carousel":a.proxy(function(b){if(b.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(b.property&&"position"==b.property.name||"initialized"==b.type)){var c=this._core.settings,e=c.center&&Math.ceil(c.items/2)||c.items,f=c.center&&-1*e||0,g=(b.property&&b.property.value!==d?b.property.value:this._core.current())+f,h=this._core.clones().length,i=a.proxy(function(a,b){this.load(b)},this);for(c.lazyLoadEager>0&&(e+=c.lazyLoadEager,c.loop&&(g-=c.lazyLoadEager,e++));f++<e;)this.load(h/2+this._core.relative(g)),h&&a.each(this._core.clones(this._core.relative(g)),i),g++}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={lazyLoad:!1,lazyLoadEager:0},e.prototype.load=function(c){var d=this._core.$stage.children().eq(c),e=d&&d.find(".owl-lazy");!e||a.inArray(d.get(0),this._loaded)>-1||(e.each(a.proxy(function(c,d){var e,f=a(d),g=b.devicePixelRatio>1&&f.attr("data-src-retina")||f.attr("data-src")||f.attr("data-srcset");this._core.trigger("load",{element:f,url:g},"lazy"),f.is("img")?f.one("load.owl.lazy",a.proxy(function(){f.css("opacity",1),this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("src",g):f.is("source")?f.one("load.owl.lazy",a.proxy(function(){this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("srcset",g):(e=new Image,e.onload=a.proxy(function(){f.css({"background-image":'url("'+g+'")',opacity:"1"}),this._core.trigger("loaded",{element:f,url:g},"lazy")},this),e.src=g)},this)),this._loaded.push(d.get(0)))},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this._core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Lazy=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(c){this._core=c,this._previousHeight=null,this._handlers={"initialized.owl.carousel refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&"position"===a.property.name&&this.update()},this),"loaded.owl.lazy":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&a.element.closest("."+this._core.settings.itemClass).index()===this._core.current()&&this.update()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._intervalId=null;var d=this;a(b).on("load",function(){d._core.settings.autoHeight&&d.update()}),a(b).resize(function(){d._core.settings.autoHeight&&(null!=d._intervalId&&clearTimeout(d._intervalId),d._intervalId=setTimeout(function(){d.update()},250))})};e.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},e.prototype.update=function(){var b=this._core._current,c=b+this._core.settings.items,d=this._core.settings.lazyLoad,e=this._core.$stage.children().toArray().slice(b,c),f=[],g=0;a.each(e,function(b,c){f.push(a(c).height())}),g=Math.max.apply(null,f),g<=1&&d&&this._previousHeight&&(g=this._previousHeight),this._previousHeight=g,this._core.$stage.parent().height(g).addClass(this._core.settings.autoHeightClass)},e.prototype.destroy=function(){var a,b;for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoHeight=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._videos={},this._playing=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.register({type:"state",name:"playing",tags:["interacting"]})},this),"resize.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.video&&this.isInFullScreen()&&a.preventDefault()},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.is("resizing")&&this._core.$stage.find(".cloned .owl-video-frame").remove()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"===a.property.name&&this._playing&&this.stop()},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find(".owl-video");c.length&&(c.css("display","none"),this.fetch(c,a(b.content)))}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",a.proxy(function(a){this.play(a)},this))};e.Defaults={video:!1,videoHeight:!1,videoWidth:!1},e.prototype.fetch=function(a,b){var c=function(){return a.attr("data-vimeo-id")?"vimeo":a.attr("data-vzaar-id")?"vzaar":"youtube"}(),d=a.attr("data-vimeo-id")||a.attr("data-youtube-id")||a.attr("data-vzaar-id"),e=a.attr("data-width")||this._core.settings.videoWidth,f=a.attr("data-height")||this._core.settings.videoHeight,g=a.attr("href");if(!g)throw new Error("Missing video URL.");if(d=g.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/),d[3].indexOf("youtu")>-1)c="youtube";else if(d[3].indexOf("vimeo")>-1)c="vimeo";else{if(!(d[3].indexOf("vzaar")>-1))throw new Error("Video URL not supported.");c="vzaar"}d=d[6],this._videos[g]={type:c,id:d,width:e,height:f},b.attr("data-video",g),this.thumbnail(a,this._videos[g])},e.prototype.thumbnail=function(b,c){var d,e,f,g=c.width&&c.height?"width:"+c.width+"px;height:"+c.height+"px;":"",h=b.find("img"),i="src",j="",k=this._core.settings,l=function(c){e='<div class="owl-video-play-icon"></div>',d=k.lazyLoad?a("<div/>",{class:"owl-video-tn "+j,srcType:c}):a("<div/>",{class:"owl-video-tn",style:"opacity:1;background-image:url("+c+")"}),b.after(d),b.after(e)};if(b.wrap(a("<div/>",{class:"owl-video-wrapper",style:g})),this._core.settings.lazyLoad&&(i="data-src",j="owl-lazy"),h.length)return l(h.attr(i)),h.remove(),!1;"youtube"===c.type?(f="//img.youtube.com/vi/"+c.id+"/hqdefault.jpg",l(f)):"vimeo"===c.type?a.ajax({type:"GET",url:"//vimeo.com/api/v2/video/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a[0].thumbnail_large,l(f)}}):"vzaar"===c.type&&a.ajax({type:"GET",url:"//vzaar.com/api/videos/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a.framegrab_url,l(f)}})},e.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null,this._core.leave("playing"),this._core.trigger("stopped",null,"video")},e.prototype.play=function(b){var c,d=a(b.target),e=d.closest("."+this._core.settings.itemClass),f=this._videos[e.attr("data-video")],g=f.width||"100%",h=f.height||this._core.$stage.height();this._playing||(this._core.enter("playing"),this._core.trigger("play",null,"video"),e=this._core.items(this._core.relative(e.index())),this._core.reset(e.index()),c=a('<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>'),c.attr("height",h),c.attr("width",g),"youtube"===f.type?c.attr("src","//www.youtube.com/embed/"+f.id+"?autoplay=1&rel=0&v="+f.id):"vimeo"===f.type?c.attr("src","//player.vimeo.com/video/"+f.id+"?autoplay=1"):"vzaar"===f.type&&c.attr("src","//view.vzaar.com/"+f.id+"/player?autoplay=true"),a(c).wrap('<div class="owl-video-frame" />').insertAfter(e.find(".owl-video")),this._playing=e.addClass("owl-video-playing"))},e.prototype.isInFullScreen=function(){var b=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return b&&a(b).parent().hasClass("owl-video-frame")},e.prototype.destroy=function(){var a,b;this._core.$element.off("click.owl.video");for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Video=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this.core=b,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={"change.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&(this.previous=this.core.current(),this.next=a.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":a.proxy(function(a){a.namespace&&(this.swapping="translated"==a.type)},this),"translate.owl.carousel":a.proxy(function(a){a.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1,
animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&a.support.animation&&a.support.transition){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.one(a.support.animation.end,c).css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g)),f&&e.one(a.support.animation.end,c).addClass("animated owl-animated-in").addClass(f))}},e.prototype.clear=function(b){a(b.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._call=null,this._time=0,this._timeout=0,this._paused=!0,this._handlers={"changed.owl.carousel":a.proxy(function(a){a.namespace&&"settings"===a.property.name?this._core.settings.autoplay?this.play():this.stop():a.namespace&&"position"===a.property.name&&this._paused&&(this._time=0)},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoplay&&this.play()},this),"play.owl.autoplay":a.proxy(function(a,b,c){a.namespace&&this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(a){a.namespace&&this.stop()},this),"mouseover.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()},this),"touchstart.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"touchend.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=a.extend({},e.Defaults,this._core.options)};e.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},e.prototype._next=function(d){this._call=b.setTimeout(a.proxy(this._next,this,d),this._timeout*(Math.round(this.read()/this._timeout)+1)-this.read()),this._core.is("interacting")||c.hidden||this._core.next(d||this._core.settings.autoplaySpeed)},e.prototype.read=function(){return(new Date).getTime()-this._time},e.prototype.play=function(c,d){var e;this._core.is("rotating")||this._core.enter("rotating"),c=c||this._core.settings.autoplayTimeout,e=Math.min(this._time%(this._timeout||c),c),this._paused?(this._time=this.read(),this._paused=!1):b.clearTimeout(this._call),this._time+=this.read()%c-e,this._timeout=c,this._call=b.setTimeout(a.proxy(this._next,this,d),c-e)},e.prototype.stop=function(){this._core.is("rotating")&&(this._time=0,this._paused=!0,b.clearTimeout(this._call),this._core.leave("rotating"))},e.prototype.pause=function(){this._core.is("rotating")&&!this._paused&&(this._time=this.read(),this._paused=!0,b.clearTimeout(this._call))},e.prototype.destroy=function(){var a,b;this.stop();for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(b){this._core=b,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":a.proxy(function(b){b.namespace&&this._core.settings.dotsData&&this._templates.push('<div class="'+this._core.settings.dotClass+'">'+a(b.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot")+"</div>")},this),"added.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,0,this._templates.pop())},this),"remove.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&this.draw()},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers)};e.Defaults={nav:!1,navText:['<span aria-label="Previous">&#x2039;</span>','<span aria-label="Next">&#x203a;</span>'],navSpeed:!1,navElement:'button type="button" role="presentation"',navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},e.prototype.initialize=function(){var b,c=this._core.settings;this._controls.$relative=(c.navContainer?a(c.navContainer):a("<div>").addClass(c.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=a("<"+c.navElement+">").addClass(c.navClass[0]).html(c.navText[0]).prependTo(this._controls.$relative).on("click",a.proxy(function(a){this.prev(c.navSpeed)},this)),this._controls.$next=a("<"+c.navElement+">").addClass(c.navClass[1]).html(c.navText[1]).appendTo(this._controls.$relative).on("click",a.proxy(function(a){this.next(c.navSpeed)},this)),c.dotsData||(this._templates=[a('<button role="button">').addClass(c.dotClass).append(a("<span>")).prop("outerHTML")]),this._controls.$absolute=(c.dotsContainer?a(c.dotsContainer):a("<div>").addClass(c.dotsClass).appendTo(this.$element)).addClass("disabled"),this._controls.$absolute.on("click","button",a.proxy(function(b){var d=a(b.target).parent().is(this._controls.$absolute)?a(b.target).index():a(b.target).parent().index();b.preventDefault(),this.to(d,c.dotsSpeed)},this));for(b in this._overrides)this._core[b]=a.proxy(this[b],this)},e.prototype.destroy=function(){var a,b,c,d,e;e=this._core.settings;for(a in this._handlers)this.$element.off(a,this._handlers[a]);for(b in this._controls)"$relative"===b&&e.navContainer?this._controls[b].html(""):this._controls[b].remove();for(d in this.overides)this._core[d]=this._overrides[d];for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},e.prototype.update=function(){var a,b,c,d=this._core.clones().length/2,e=d+this._core.items().length,f=this._core.maximum(!0),g=this._core.settings,h=g.center||g.autoWidth||g.dotsData?1:g.dotsEach||g.items;if("page"!==g.slideBy&&(g.slideBy=Math.min(g.slideBy,g.items)),g.dots||"page"==g.slideBy)for(this._pages=[],a=d,b=0,c=0;a<e;a++){if(b>=h||0===b){if(this._pages.push({start:Math.min(f,a-d),end:a-d+h-1}),Math.min(f,a-d)===f)break;b=0,++c}b+=this._core.mergers(this._core.relative(a))}},e.prototype.draw=function(){var b,c=this._core.settings,d=this._core.items().length<=c.items,e=this._core.relative(this._core.current()),f=c.loop||c.rewind;this._controls.$relative.toggleClass("disabled",!c.nav||d),c.nav&&(this._controls.$previous.toggleClass("disabled",!f&&e<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!f&&e>=this._core.maximum(!0))),this._controls.$absolute.toggleClass("disabled",!c.dots||d),c.dots&&(b=this._pages.length-this._controls.$absolute.children().length,c.dotsData&&0!==b?this._controls.$absolute.html(this._templates.join("")):b>0?this._controls.$absolute.append(new Array(b+1).join(this._templates[0])):b<0&&this._controls.$absolute.children().slice(b).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(a.inArray(this.current(),this._pages)).addClass("active"))},e.prototype.onTrigger=function(b){var c=this._core.settings;b.page={index:a.inArray(this.current(),this._pages),count:this._pages.length,size:c&&(c.center||c.autoWidth||c.dotsData?1:c.dotsEach||c.items)}},e.prototype.current=function(){var b=this._core.relative(this._core.current());return a.grep(this._pages,a.proxy(function(a,c){return a.start<=b&&a.end>=b},this)).pop()},e.prototype.getPosition=function(b){var c,d,e=this._core.settings;return"page"==e.slideBy?(c=a.inArray(this.current(),this._pages),d=this._pages.length,b?++c:--c,c=this._pages[(c%d+d)%d].start):(c=this._core.relative(this._core.current()),d=this._core.items().length,b?c+=e.slideBy:c-=e.slideBy),c},e.prototype.next=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!0),b)},e.prototype.prev=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!1),b)},e.prototype.to=function(b,c,d){var e;!d&&this._pages.length?(e=this._pages.length,a.proxy(this._overrides.to,this._core)(this._pages[(b%e+e)%e].start,c)):a.proxy(this._overrides.to,this._core)(b,c)},a.fn.owlCarousel.Constructor.Plugins.Navigation=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(c){this._core=c,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":a.proxy(function(c){c.namespace&&"URLHash"===this._core.settings.startPosition&&a(b).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find("[data-hash]").addBack("[data-hash]").attr("data-hash");if(!c)return;this._hashes[c]=b.content}},this),"changed.owl.carousel":a.proxy(function(c){if(c.namespace&&"position"===c.property.name){var d=this._core.items(this._core.relative(this._core.current())),e=a.map(this._hashes,function(a,b){return a===d?b:null}).join();if(!e||b.location.hash.slice(1)===e)return;b.location.hash=e}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers),a(b).on("hashchange.owl.navigation",a.proxy(function(a){var c=b.location.hash.substring(1),e=this._core.$stage.children(),f=this._hashes[c]&&e.index(this._hashes[c]);f!==d&&f!==this._core.current()&&this._core.to(this._core.relative(f),!1,!0)},this))};e.Defaults={URLhashListener:!1},e.prototype.destroy=function(){var c,d;a(b).off("hashchange.owl.navigation");for(c in this._handlers)this._core.$element.off(c,this._handlers[c]);for(d in Object.getOwnPropertyNames(this))"function"!=typeof this[d]&&(this[d]=null)},a.fn.owlCarousel.Constructor.Plugins.Hash=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){function e(b,c){var e=!1,f=b.charAt(0).toUpperCase()+b.slice(1);return a.each((b+" "+h.join(f+" ")+f).split(" "),function(a,b){if(g[b]!==d)return e=!c||b,!1}),e}function f(a){return e(a,!0)}var g=a("<support>").get(0).style,h="Webkit Moz O ms".split(" "),i={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},j={csstransforms:function(){return!!e("transform")},csstransforms3d:function(){return!!e("perspective")},csstransitions:function(){return!!e("transition")},cssanimations:function(){return!!e("animation")}};j.csstransitions()&&(a.support.transition=new String(f("transition")),a.support.transition.end=i.transition.end[a.support.transition]),j.cssanimations()&&(a.support.animation=new String(f("animation")),a.support.animation.end=i.animation.end[a.support.animation]),j.csstransforms()&&(a.support.transform=new String(f("transform")),a.support.transform3d=j.csstransforms3d())}(window.Zepto||window.jQuery,window,document);
// source --> https://www.lebens-retter.org/wp-content/plugins/delicious-recipes//assets/lib/lightGallery/lightgallery.min.js?ver=2.0.1 
/**
 * lightgallery | 2.0.1 | May 17th 2021
 * http://www.lightgalleryjs.com/
 * Copyright (c) 2020 Sachin Neravath;
 * @license GPLv3
 */

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lightGallery=e()}(this,function(){"use strict";var i=function(){return(i=Object.assign||function(t){for(var e,i=1,s=arguments.length;i<s;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(t,e){e=e||{bubbles:!1,cancelable:!1,detail:null};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),i}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r=(s.generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})},s.prototype._getSelector=function(t,e){return void 0===e&&(e=document),"string"!=typeof t?t:(e=e||document,"#"===t.substring(0,1)?e.querySelector(t):e.querySelectorAll(t))},s.prototype._each=function(t){return this.selector&&(void 0!==this.selector.length?[].forEach.call(this.selector,t):t(this.selector,0)),this},s.prototype._setCssVendorPrefix=function(t,e,i){e=e.replace(/-([a-z])/gi,function(t,e){return e.toUpperCase()});-1!==this.cssVenderPrefixes.indexOf(e)?(t.style[e.charAt(0).toLowerCase()+e.slice(1)]=i,t.style["webkit"+e]=i,t.style["moz"+e]=i,t.style["ms"+e]=i,t.style["o"+e]=i):t.style[e]=i},s.prototype._getFirstEl=function(){return this.selector&&void 0!==this.selector.length?this.selector[0]:this.selector},s.prototype.isEventMatched=function(t,e){var i=e.split(".");return t.split(".").filter(function(t){return t}).every(function(t){return-1!==i.indexOf(t)})},s.prototype.attr=function(e,i){return void 0===i?this.firstElement?this.firstElement.getAttribute(e):"":(this._each(function(t){t.setAttribute(e,i)}),this)},s.prototype.find=function(t){return C(this._getSelector(t,this.selector))},s.prototype.first=function(){return this.selector&&void 0!==this.selector.length?C(this.selector[0]):C(this.selector)},s.prototype.eq=function(t){return C(this.selector[t])},s.prototype.parent=function(){return C(this.selector.parentElement)},s.prototype.get=function(){return this._getFirstEl()},s.prototype.removeAttr=function(t){var i=t.split(" ");return this._each(function(e){i.forEach(function(t){return e.removeAttribute(t)})}),this},s.prototype.wrap=function(t){if(!this.firstElement)return this;var e=document.createElement("div");return e.className=t,this.firstElement.parentNode.insertBefore(e,this.firstElement),this.firstElement.parentNode.removeChild(this.firstElement),e.appendChild(this.firstElement),this},s.prototype.addClass=function(t){return void 0===t&&(t=""),this._each(function(e){t.split(" ").forEach(function(t){e.classList.add(t)})}),this},s.prototype.removeClass=function(t){return this._each(function(e){t.split(" ").forEach(function(t){e.classList.remove(t)})}),this},s.prototype.hasClass=function(t){return!!this.firstElement&&this.firstElement.classList.contains(t)},s.prototype.hasAttribute=function(t){return!!this.firstElement&&this.firstElement.hasAttribute(t)},s.prototype.toggleClass=function(t){return this.firstElement&&(this.hasClass(t)?this.removeClass(t):this.addClass(t)),this},s.prototype.css=function(e,i){var s=this;return this._each(function(t){s._setCssVendorPrefix(t,e,i)}),this},s.prototype.on=function(t,e){var i=this;return this.selector&&t.split(" ").forEach(function(t){Array.isArray(s.eventListeners[t])||(s.eventListeners[t]=[]),s.eventListeners[t].push(e),i.selector.addEventListener(t.split(".")[0],e)}),this},s.prototype.once=function(t,e){var i=this;return this.on(t,function(){i.off(t),e(t)}),this},s.prototype.off=function(t){var i=this;return this.selector&&Object.keys(s.eventListeners).forEach(function(e){i.isEventMatched(t,e)&&(s.eventListeners[e].forEach(function(t){i.selector.removeEventListener(e.split(".")[0],t)}),s.eventListeners[e]=[])}),this},s.prototype.trigger=function(t,e){if(!this.firstElement)return this;e=new CustomEvent(t.split(".")[0],{detail:e||null});return this.firstElement.dispatchEvent(e),this},s.prototype.load=function(t){var e=this;return fetch(t).then(function(t){e.selector.innerHTML=t}),this},s.prototype.html=function(e){return void 0===e?this.firstElement?this.firstElement.innerHTML:"":(this._each(function(t){t.innerHTML=e}),this)},s.prototype.append=function(e){return this._each(function(t){"string"==typeof e?t.insertAdjacentHTML("beforeend",e):t.appendChild(e)}),this},s.prototype.prepend=function(e){return this._each(function(t){t.insertAdjacentHTML("afterbegin",e)}),this},s.prototype.remove=function(){return this._each(function(t){t.parentNode.removeChild(t)}),this},s.prototype.empty=function(){return this._each(function(t){t.innerHTML=""}),this},s.prototype.scrollTop=function(t){return void 0!==t?(document.body.scrollTop=t,document.documentElement.scrollTop=t,this):window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},s.prototype.scrollLeft=function(t){return void 0!==t?(document.body.scrollLeft=t,document.documentElement.scrollLeft=t,this):window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},s.prototype.offset=function(){if(!this.firstElement)return{left:0,top:0};var t=this.firstElement.getBoundingClientRect(),e=C("body").style().marginLeft;return{left:t.left-parseFloat(e)+this.scrollLeft(),top:t.top+this.scrollTop()}},s.prototype.style=function(){return this.firstElement?this.firstElement.currentStyle||window.getComputedStyle(this.firstElement):{}},s.prototype.width=function(){var t=this.style();return this.firstElement.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)},s.prototype.height=function(){var t=this.style();return this.firstElement.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)},s.eventListeners={},s);function s(t){return this.cssVenderPrefixes=["TransitionDuration","TransitionTimingFunction","Transform","Transition"],this.selector=this._getSelector(t),this.firstElement=this._getFirstEl(),this}function C(t){return new r(t)}var n=["src","sources","subHtml","subHtmlUrl","html","video","poster","slideName","responsive","srcset","sizes","iframe","downloadUrl","width","facebookShareUrl","tweetText","iframeTitle","twitterShareUrl","pinterestShareUrl","pinterestText","fbHtml","disqusIdentifier","disqusUrl"];var I=function(t,e,i,s){void 0===i&&(i=0);var n=C(t).attr("data-lg-size")||s;if(n){var o=n.split(",");if(o[1])for(var r=window.innerWidth,l=0;l<o.length;l++){var a=o[l];if(r<parseInt(a.split("-")[2],10)){n=a;break}l===o.length-1&&(n=a)}var g=n.split("-"),t=parseInt(g[0],10),s=parseInt(g[1],10),g=e.width(),i=e.height()-i,g=Math.min(g,t),i=Math.min(i,s),i=Math.min(g/t,i/s);return{width:t*i,height:s*i}}},l=function(t,e,i,s,n){if(n){var o=C(t).find("img").first();if(o.get()){var r=e.get().getBoundingClientRect(),l=r.width,a=e.height()-(i+s),t=o.width(),e=o.height(),s=o.style(),r=(l-t)/2-o.offset().left+(parseFloat(s.paddingLeft)||0)+(parseFloat(s.borderLeft)||0)+C(window).scrollLeft()+r.left,i=(a-e)/2-o.offset().top+(parseFloat(s.paddingTop)||0)+(parseFloat(s.borderTop)||0)+C(window).scrollTop()+i;return"translate3d("+(r*=-1)+"px, "+(i*=-1)+"px, 0) scale3d("+t/n.width+", "+e/n.height+", 1)"}}},x=function(t,e,i,s){return'<div class="lg-video-cont lg-has-iframe" style="width:'+e+"; height: "+i+'">\n                    <iframe class="lg-object" frameborder="0" '+(s?'title="'+s+'"':"")+' src="'+t+'"  allowfullscreen="true"></iframe>\n                </div>'},w=function(t,e,i,s,n,o){t="<img "+i+" "+(s?"srcset="+s:"")+"  "+(n?"sizes="+n:"")+' class="lg-object lg-image" data-index="'+t+'" src="'+e+'" />',e="";return o&&(e=("string"==typeof o?JSON.parse(o):o).map(function(e){var i="";return Object.keys(e).forEach(function(t){i+=" "+t+'="'+e[t]+'"'}),"<source "+i+"></source>"})),e+t},T=function(t){for(var e=[],i=[],s="",n=0;n<t.length;n++){var o=t[n].split(" ");""===o[0]&&o.splice(0,1),i.push(o[0]),e.push(o[1])}for(var r=window.innerWidth,l=0;l<e.length;l++)if(parseInt(e[l],10)>r){s=i[l];break}return s},S=function(t){return!!t&&(!!t.complete&&0!==t.naturalWidth)},E=function(t,e,i,s){return'<div class="lg-video-cont '+(s&&s.youtube?"lg-has-youtube":s&&s.vimeo?"lg-has-vimeo":"lg-has-html5")+'" style="'+i+'">\n                <div class="lg-video-play-button">\n                <svg\n                    viewBox="0 0 20 20"\n                    preserveAspectRatio="xMidYMid"\n                    focusable="false"\n                    aria-labelledby="Play video"\n                    role="img"\n                    class="lg-video-play-icon"\n                >\n                    <title>Play video</title>\n                    <polygon class="lg-video-play-icon-inner" points="1,0 20,10 1,20"></polygon>\n                </svg>\n                <svg class="lg-video-play-icon-bg" viewBox="0 0 50 50" focusable="false">\n                    <circle cx="50%" cy="50%" r="20"></circle></svg>\n                <svg class="lg-video-play-icon-circle" viewBox="0 0 50 50" focusable="false">\n                    <circle cx="50%" cy="50%" r="20"></circle>\n                </svg>\n            </div>\n            '+(e||"")+'\n            <img class="lg-object lg-video-poster" src="'+t+'" />\n        </div>'},e=function(t,e,g,d){var h=[],u=function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;for(var s=Array(t),n=0,e=0;e<i;e++)for(var o=arguments[e],r=0,l=o.length;r<l;r++,n++)s[n]=o[r];return s}(n,e);return[].forEach.call(t,function(t){for(var e={},i=0;i<t.attributes.length;i++){var s,n,o=t.attributes[i];o.specified&&(s="href"===(n=o.name)?"src":n=(n=(n=n.replace("data-","")).charAt(0).toLowerCase()+n.slice(1)).replace(/-([a-z])/g,function(t){return t[1].toUpperCase()}),n="",-1<u.indexOf(s)&&(n=s),n&&(e[n]=o.value))}var r=C(t),l=r.find("img").first().attr("alt"),a=r.attr("title"),r=d?r.attr(d):r.find("img").first().attr("src");e.thumb=r,g&&!e.subHtml&&(e.subHtml=a||l||""),e.alt=l||a||"",h.push(e)}),h},o=function(){return/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)},a={mode:"lg-slide",easing:"ease",speed:400,licenseKey:"3388AFB9-D9954E6A-A850E3ED-C8915FA8",height:"100%",width:"100%",addClass:"",startClass:"lg-start-zoom",backdropDuration:300,container:document.body,startAnimationDuration:400,zoomFromOrigin:!0,hideBarsDelay:0,showBarsAfter:1e4,slideDelay:0,supportLegacyBrowser:!0,allowMediaOverlap:!1,videoMaxSize:"1280-720",defaultCaptionHeight:0,ariaLabelledby:"",ariaDescribedby:"",closable:!0,swipeToClose:!0,closeOnTap:!0,showCloseIcon:!0,showMaximizeIcon:!1,loop:!0,escKey:!0,keyPress:!0,controls:!0,slideEndAnimation:!0,hideControlOnEnd:!1,mousewheel:!1,getCaptionFromTitleOrAlt:!0,appendSubHtmlTo:".lg-sub-html",subHtmlSelectorRelative:!1,preload:2,numberOfSlideItemsInDom:10,showAfterLoad:!0,selector:"",selectWithin:"",nextHtml:"",prevHtml:"",index:0,iframeWidth:"100%",iframeHeight:"100%",download:!0,counter:!0,appendCounterTo:".lg-toolbar",swipeThreshold:50,enableSwipe:!0,enableDrag:!0,dynamic:!1,dynamicEl:[],extraProps:[],exThumbImage:"",isMobile:void 0,mobileSettings:{controls:!1,showCloseIcon:!1,download:!1},plugins:[]},O="lgAfterAppendSlide",g="lgInit",L="lgHasVideo",d="lgContainerResize",h="lgUpdateSlides",u="lgAfterAppendSubHtml",c="lgBeforeOpen",m="lgAfterOpen",p="lgSlideItemLoad",f="lgBeforeSlide",y="lgAfterSlide",v="lgPosterClick",b="lgDragStart",D="lgDragMove",z="lgDragEnd",M="lgBeforeNextSlide",G="lgBeforePrevSlide",A="lgBeforeClose",B="lgAfterClose",k=0,P=(t.prototype.init=function(){var n=this;if(this.addSlideVideoInfo(this.galleryItems),this.timeToLoadModules=this.buildStructure(),this.LGel.trigger(g,{instance:this}),this.settings.keyPress&&this.keyPress(),setTimeout(function(){n.enableDrag(),n.enableSwipe()},50),1<this.galleryItems.length&&(this.arrow(),this.settings.mousewheel&&this.mousewheel()),!this.settings.dynamic)for(var o=this,t=0;t<this.items.length;t++)!function(e){var i=o.items[e],t=C(i),s=r.generateUUID();t.attr("data-lg-id",s).on("click.lgcustom-item-"+s,function(t){t.preventDefault();t=n.settings.index||e;n.openGallery(t,i)})}(t)},t.prototype.buildModules=function(){var i=this,s=0;return this.settings.plugins.length?(this.settings.plugins.forEach(function(t,e){s++,setTimeout(function(){i.plugins.push(new t(i,C)),e===i.settings.plugins.length-1&&(i.modulesLoaded=!0)},10*s)}),10*s):(this.modulesLoaded=!0,0)},t.prototype.validateLicense=function(){this.settings.licenseKey?"0000-0000-000-0000"===this.settings.licenseKey&&console.warn("lightGallery: "+this.settings.licenseKey+" license key is not valid for production use"):console.error("Please provide a valid license key")},t.prototype.getSlideItem=function(t){return C(this.getSlideItemId(t))},t.prototype.getSlideItemId=function(t){return"#lg-item-"+this.lgId+"-"+t},t.prototype.getIdName=function(t){return t+"-"+this.lgId},t.prototype.getElementById=function(t){return C("#"+this.getIdName(t))},t.prototype.buildStructure=function(){var t=this;if(this.$container&&this.$container.get())return 0;var e="",i="";this.settings.controls&&1<this.galleryItems.length&&(e='<button type="button" id="'+this.getIdName("lg-prev")+'" aria-label="Previous slide" class="lg-prev lg-icon"> '+this.settings.prevHtml+' </button>\n                <button type="button" id="'+this.getIdName("lg-next")+'" aria-label="Next slide" class="lg-next lg-icon"> '+this.settings.nextHtml+" </button>"),".lg-sub-html"===this.settings.appendSubHtmlTo&&(i='<div class="lg-sub-html" role="status" aria-live="polite"></div>');var s="";this.settings.allowMediaOverlap&&(s+="lg-media-overlap ");var n=this.settings.ariaLabelledby?'aria-labelledby="'+this.settings.ariaLabelledby+'"':"",o=this.settings.ariaDescribedby?'aria-describedby="'+this.settings.ariaDescribedby+'"':"",r="lg-container "+this.settings.addClass+" "+(document.body!==this.settings.container?"lg-inline":""),l=this.settings.closable&&this.settings.showCloseIcon?'<button type="button" aria-label="Close gallery" id="'+this.getIdName("lg-close")+'" class="lg-close lg-icon"></button>':"",a=this.settings.showMaximizeIcon?'<button type="button" aria-label="Toggle maximize" id="'+this.getIdName("lg-maximize")+'" class="lg-maximize lg-icon"></button>':"",i='\n        <div class="'+r+'" id="'+this.getIdName("lg-container")+'" tabindex="-1" aria-modal="true" '+n+" "+o+' role="dialog"\n        >\n            <div id="'+this.getIdName("lg-backdrop")+'" class="lg-backdrop"></div>\n\n            <div id="'+this.getIdName("lg-outer")+'" class="lg-outer lg-hide-items '+s+' ">\n                    <div id="'+this.getIdName("lg-content")+'" class="lg" style="width: '+this.settings.width+"; height:"+this.settings.height+'">\n                        <div id="'+this.getIdName("lg-inner")+'" class="lg-inner"></div>\n                        <div id="'+this.getIdName("lg-toolbar")+'" class="lg-toolbar lg-group">\n                        '+a+"\n                        "+l+"\n                    </div>\n                    "+e+'\n                    <div id="'+this.getIdName("lg-components")+'" class="lg-components">\n                        '+i+"\n                    </div>\n                </div> \n            </div>\n        </div>\n        ";return C(this.settings.container).css("position","relative").append(i),this.outer=this.getElementById("lg-outer"),this.$lgContent=this.getElementById("lg-content"),this.$lgComponents=this.getElementById("lg-components"),this.$backdrop=this.getElementById("lg-backdrop"),this.$container=this.getElementById("lg-container"),this.$inner=this.getElementById("lg-inner"),this.$toolbar=this.getElementById("lg-toolbar"),this.$backdrop.css("transition-duration",this.settings.backdropDuration+"ms"),this.outer.addClass("lg-use-css3"),this.outer.addClass("lg-css3"),this.outer.addClass(this.settings.mode),this.settings.enableDrag&&1<this.galleryItems.length&&this.outer.addClass("lg-grab"),this.settings.showAfterLoad&&this.outer.addClass("lg-show-after-load"),this.$inner.css("transition-timing-function",this.settings.easing),this.$inner.css("transition-duration",this.settings.speed+"ms"),this.settings.download&&this.$toolbar.append('<a id="'+this.getIdName("lg-download")+'" target="_blank" aria-label="Download" download class="lg-download lg-icon"></a>'),this.counter(),C(window).on("resize.lg.global"+this.lgId+" orientationchange.lg.global"+this.lgId,function(){t.refreshOnResize()}),this.hideBars(),this.manageCloseGallery(),this.toggleMaximize(),this.buildModules()},t.prototype.refreshOnResize=function(){var t,e,i;this.lgOpened&&(i=this.galleryItems[this.index].__slideVideoInfo,t=(e=this.getMediaContainerPosition()).top,e=e.bottom,this.currentImageSize=I(this.items[this.index],this.$lgContent,t+e,i&&this.settings.videoMaxSize),i&&this.resizeVideoSlide(this.index,this.currentImageSize),this.zoomFromOrigin&&!this.isDummyImageRemoved&&(i=this.getDummyImgStyles(this.currentImageSize),this.outer.find(".lg-current .lg-dummy-img").first().attr("style",i)),this.LGel.trigger(d))},t.prototype.resizeVideoSlide=function(t,e){e=this.getVideoContStyle(e);this.getSlideItem(t).find(".lg-video-cont").attr("style",e)},t.prototype.updateSlides=function(t,e){var i,s;this.index>t.length-1&&(this.index=t.length-1),1===t.length&&(this.index=0),t.length?(i=this.galleryItems[e].src,this.addSlideVideoInfo(t),this.galleryItems=t,this.$inner.empty(),this.currentItemsInDom=[],s=0,this.galleryItems.some(function(t,e){return t.src===i&&(s=e,!0)}),this.currentItemsInDom=this.organizeSlideItems(s,-1),this.loadContent(s,!0),this.getSlideItem(s).addClass("lg-current"),this.index=s,this.updateCurrentCounter(s),this.updateCounterTotal(),this.LGel.trigger(h)):this.closeGallery()},t.prototype.getItems=function(){return this.items=[],this.settings.dynamic?this.settings.dynamicEl||[]:("this"===this.settings.selector?this.items.push(this.el):this.settings.selector?"string"==typeof this.settings.selector?this.settings.selectWithin?(t=C(this.settings.selectWithin),this.items=t.find(this.settings.selector).get()):this.items=this.el.querySelectorAll(this.settings.selector):this.items=this.settings.selector:this.items=this.el.children,e(this.items,this.settings.extraProps,this.settings.getCaptionFromTitleOrAlt,this.settings.exThumbImage));var t},t.prototype.openGallery=function(e,t){var i,s,n,o,r=this;void 0===e&&(e=this.settings.index),this.lgOpened||(this.modulesLoaded?(this.lgOpened=!0,this.outer.get().focus(),this.outer.removeClass("lg-hide-items"),this.$container.addClass("lg-show"),n=this.getItemsToBeInsertedToDom(e,e),this.currentItemsInDom=n,i="",n.forEach(function(t){i=i+'<div id="'+t+'" class="lg-item"></div>'}),this.$inner.append(i),this.addHtml(e),s="",this.mediaContainerPosition=this.getMediaContainerPosition(),n=(o=this.mediaContainerPosition).top,o=o.bottom,this.settings.allowMediaOverlap||this.setMediaContainerPosition(n,o),this.zoomFromOrigin&&t&&(this.currentImageSize=I(t,this.$lgContent,n+o,this.galleryItems[this.index].__slideVideoInfo&&this.settings.videoMaxSize),s=l(t,this.$lgContent,n,o,this.currentImageSize)),this.zoomFromOrigin&&s||(this.outer.addClass(this.settings.startClass),this.getSlideItem(e).removeClass("lg-complete")),o=this.settings.zoomFromOrigin?100:this.settings.backdropDuration,setTimeout(function(){r.outer.addClass("lg-components-open")},o),this.LGel.trigger(c),this.getSlideItem(e).addClass("lg-current"),this.lGalleryOn=!1,this.index=e,this.prevScrollTop=C(window).scrollTop(),setTimeout(function(){var t;r.zoomFromOrigin&&s&&((t=r.getSlideItem(e)).css("transform",s),setTimeout(function(){t.addClass("lg-start-progress lg-start-end-progress").css("transition-duration",r.settings.startAnimationDuration+"ms"),r.outer.addClass("lg-zoom-from-image")}),setTimeout(function(){t.css("transform","translate3d(0, 0, 0)")},100)),setTimeout(function(){r.$backdrop.addClass("in"),r.$container.addClass("lg-show-in")},10),r.zoomFromOrigin&&s||setTimeout(function(){r.outer.addClass("lg-visible")},r.settings.backdropDuration),r.slide(e,!1,!1,!1),r.LGel.trigger(m)}),document.body===this.settings.container&&C("html").addClass("lg-on")):setTimeout(function(){r.openGallery(e,t)},this.timeToLoadModules))},t.prototype.getMediaContainerPosition=function(){if(this.settings.allowMediaOverlap)return{top:0,bottom:0};var t=this.$toolbar.get().clientHeight||0,e=this.settings.defaultCaptionHeight||this.outer.find(".lg-sub-html").get().clientHeight,i=this.outer.find(".lg-thumb-outer").get();return{top:t,bottom:(i?i.clientHeight:0)+e}},t.prototype.setMediaContainerPosition=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.$inner.css("top",t+"px").css("bottom",e+"px")},t.prototype.hideBars=function(){var t=this;setTimeout(function(){t.outer.removeClass("lg-hide-items"),0<t.settings.hideBarsDelay&&(t.outer.on("mousemove.lg click.lg touchstart.lg",function(){t.outer.removeClass("lg-hide-items"),clearTimeout(t.hideBarTimeout),t.hideBarTimeout=setTimeout(function(){t.outer.addClass("lg-hide-items")},t.settings.hideBarsDelay)}),t.outer.trigger("mousemove.lg"))},this.settings.showBarsAfter)},t.prototype.initPictureFill=function(t){if(this.settings.supportLegacyBrowser)try{picturefill({elements:[t.get()]})}catch(t){console.warn("lightGallery :- If you want srcset or picture tag to be supported for older browser please include picturefil javascript library in your document.")}},t.prototype.counter=function(){var t;this.settings.counter&&(t='<div class="lg-counter" role="status" aria-live="polite">\n                <span id="'+this.getIdName("lg-counter-current")+'" class="lg-counter-current">'+(this.index+1)+' </span> / \n                <span id="'+this.getIdName("lg-counter-all")+'" class="lg-counter-all">'+this.galleryItems.length+" </span></div>",this.outer.find(this.settings.appendCounterTo).append(t))},t.prototype.addHtml=function(t){var e,i,s;this.galleryItems[t].subHtmlUrl?i=this.galleryItems[t].subHtmlUrl:e=this.galleryItems[t].subHtml,i||(e?"."!==(s=e.substring(0,1))&&"#"!==s||(e=(this.settings.subHtmlSelectorRelative&&!this.settings.dynamic?C(this.items).eq(t).find(e):C(e)).first().html()):e=""),".lg-sub-html"===this.settings.appendSubHtmlTo?i?this.outer.find(".lg-sub-html").load(i):this.outer.find(".lg-sub-html").html(e):(s=C(this.getSlideItemId(t)),i?s.load(i):s.append('<div class="lg-sub-html">'+e+"</div>")),null!=e&&(""===e?this.outer.find(this.settings.appendSubHtmlTo).addClass("lg-empty-html"):this.outer.find(this.settings.appendSubHtmlTo).removeClass("lg-empty-html")),this.LGel.trigger(u,{index:t})},t.prototype.preload=function(t){for(var e=1;e<=this.settings.preload&&!(e>=this.galleryItems.length-t);e++)this.loadContent(t+e,!1);for(var i=1;i<=this.settings.preload&&!(t-i<0);i++)this.loadContent(t-i,!1)},t.prototype.getDummyImgStyles=function(t){return t?"width:"+t.width+"px; \n                margin-left: -"+t.width/2+"px;\n                margin-top: -"+t.height/2+"px; \n                height:"+t.height+"px":""},t.prototype.getVideoContStyle=function(t){return t?"width:"+t.width+"px; \n                height:"+t.height+"px":""},t.prototype.getDummyImageContent=function(t,e,i){var s;if(this.settings.dynamic||(s=C(this.items).eq(e)),s){e=void 0;if(!(e=this.settings.exThumbImage?s.attr(this.settings.exThumbImage):s.find("img").first().attr("src")))return"";e="<img "+i+' style="'+this.getDummyImgStyles(this.currentImageSize)+'" class="lg-dummy-img" src="'+e+'" />';return t.addClass("lg-first-slide"),this.outer.addClass("lg-first-slide-loading"),e}return""},t.prototype.setImgMarkup=function(t,e,i){var s=this.galleryItems[i],n=s.alt,o=s.srcset,r=s.sizes,s=s.sources,n=n?'alt="'+n+'"':"",s='<picture class="lg-img-wrap"> '+(!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize?this.getDummyImageContent(e,i,n):w(i,t,n,o,r,s))+"</picture>";e.prepend(s)},t.prototype.onLgObjectLoad=function(t,e,i,s,n){var o=this;n&&this.LGel.trigger(p,{index:e,delay:i||0}),t.find(".lg-object").first().on("load.lg",function(){o.handleLgObjectLoad(t,e,i,s,n)}),setTimeout(function(){t.find(".lg-object").first().on("error.lg",function(){t.addClass("lg-complete lg-complete_"),t.html('<span class="lg-error-msg">Oops... Failed to load content...</span>')})},s)},t.prototype.handleLgObjectLoad=function(t,e,i,s,n){var o=this;setTimeout(function(){t.addClass("lg-complete lg-complete_"),n||o.LGel.trigger(p,{index:e,delay:i||0})},s)},t.prototype.isVideo=function(t,e){if(!t)return this.galleryItems[e].video?{html5:!0}:void console.error("lightGallery :- data-src is not provided on slide item "+(e+1)+". Please make sure the selector property is properly configured. More info - https://www.lightgalleryjs.com/demos/html-markup/");var i=t.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com|be-nocookie\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i),e=t.match(/\/\/(?:www\.)?(?:player\.)?vimeo.com\/(?:video\/)?([0-9a-z\-_]+)/i),t=t.match(/https?:\/\/(.+)?(wistia\.com|wi\.st)\/(medias|embed)\/([0-9a-z\-_]+)(.*)/);return i?{youtube:i}:e?{vimeo:e}:t?{wistia:t}:void 0},t.prototype.addSlideVideoInfo=function(t){var i=this;t.forEach(function(t,e){t.__slideVideoInfo=i.isVideo(t.src,e)})},t.prototype.loadContent=function(e,t){var i=this,s=this.galleryItems[e],n=C(this.getSlideItemId(e)),o=s.poster,r=s.srcset,l=s.sizes,a=s.sources,g=s.src,d=s.video,h=d&&"string"==typeof d?JSON.parse(d):d;s.responsive&&(u=s.responsive.split(","),g=T(u)||g);var u,c,m,p,f=s.__slideVideoInfo,y="",d=!!s.iframe;n.hasClass("lg-loaded")||(f&&(u=(c=this.mediaContainerPosition).top,c=c.bottom,c=I(this.items[e],this.$lgContent,u+c,f&&this.settings.videoMaxSize),y=this.getVideoContStyle(c)),d?(p=x(g,this.settings.iframeWidth,this.settings.iframeHeight,s.iframeTitle),n.prepend(p)):o?(c="",m=!this.lGalleryOn,(d=!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize)&&(c=this.getDummyImageContent(n,e,"")),p=E(o,c||"",y,f),n.prepend(p),d=(d?this.settings.startAnimationDuration:this.settings.backdropDuration)+100,setTimeout(function(){i.LGel.trigger(L,{index:e,src:g,html5Video:h,hasPoster:!0,isFirstSlide:m})},d)):f?(p='<div class="lg-video-cont " style="'+y+'"></div>',n.prepend(p),this.LGel.trigger(L,{index:e,src:g,html5Video:h,hasPoster:!1})):(this.setImgMarkup(g,n,e),(r||a)&&(p=n.find(".lg-object"),this.initPictureFill(p))),this.LGel.trigger(O,{index:e}),this.lGalleryOn&&".lg-sub-html"!==this.settings.appendSubHtmlTo&&this.addHtml(e));var v=0,b=0;this.lGalleryOn||(b=this.zoomFromOrigin&&this.currentImageSize?this.settings.startAnimationDuration+10:this.settings.backdropDuration+10),b&&!C(document.body).hasClass("lg-from-hash")&&(v=b),!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize&&(setTimeout(function(){n.removeClass("lg-start-end-progress lg-start-progress").removeAttr("style")},this.settings.startAnimationDuration+100),n.hasClass("lg-loaded")||setTimeout(function(){n.find(".lg-img-wrap").append(w(e,g,"",r,l,s.sources)),(r||a)&&(t=n.find(".lg-object"),i.initPictureFill(t)),i.onLgObjectLoad(n,e,b,v,!0);var t=n.find(".lg-object").first();S(t.get())?i.loadContentOnLoad(e,n,v):t.on("load.lg error.lg",function(){i.loadContentOnLoad(e,n,v)})},this.settings.startAnimationDuration+100)),n.addClass("lg-loaded"),this.onLgObjectLoad(n,e,b,v,!1),f&&f.html5&&!o&&n.addClass("lg-complete lg-complete_"),this.zoomFromOrigin&&this.currentImageSize||!n.hasClass("lg-complete_")||this.lGalleryOn||setTimeout(function(){n.addClass("lg-complete")},this.settings.backdropDuration),(this.lGalleryOn=!0)===t&&(n.hasClass("lg-complete_")?this.preload(e):n.find(".lg-object").first().on("load.lg error.lg",function(){i.preload(e)}))},t.prototype.loadContentOnLoad=function(t,e,i){var s=this;setTimeout(function(){e.find(".lg-dummy-img").remove(),e.removeClass("lg-first-slide"),s.outer.removeClass("lg-first-slide-loading"),s.isDummyImageRemoved=!0,s.preload(t)},i+300)},t.prototype.getItemsToBeInsertedToDom=function(t,e,i){var s=this;void 0===i&&(i=0);var n=[],o=Math.max(i,3),o=Math.min(o,this.galleryItems.length),i="lg-item-"+this.lgId+"-"+e;if(this.galleryItems.length<=3)return this.galleryItems.forEach(function(t,e){n.push("lg-item-"+s.lgId+"-"+e)}),n;if(t<(this.galleryItems.length-1)/2){for(var r=t;t-o/2<r&&0<=r;r--)n.push("lg-item-"+this.lgId+"-"+r);for(var l=n.length,r=0;r<o-l;r++)n.push("lg-item-"+this.lgId+"-"+(t+r+1))}else{for(r=t;r<=this.galleryItems.length-1&&r<t+o/2;r++)n.push("lg-item-"+this.lgId+"-"+r);for(l=n.length,r=0;r<o-l;r++)n.push("lg-item-"+this.lgId+"-"+(t-r-1))}return this.settings.loop&&(t===this.galleryItems.length-1?n.push("lg-item-"+this.lgId+"-0"):0===t&&n.push("lg-item-"+this.lgId+"-"+(this.galleryItems.length-1))),-1===n.indexOf(i)&&n.push("lg-item-"+this.lgId+"-"+e),n},t.prototype.organizeSlideItems=function(t,e){var i=this,s=this.getItemsToBeInsertedToDom(t,e,this.settings.numberOfSlideItemsInDom);return s.forEach(function(t){-1===i.currentItemsInDom.indexOf(t)&&i.$inner.append('<div id="'+t+'" class="lg-item"></div>')}),this.currentItemsInDom.forEach(function(t){-1===s.indexOf(t)&&C("#"+t).remove()}),s},t.prototype.getPreviousSlideIndex=function(){var e=0;try{var t=this.outer.find(".lg-current").first().attr("id"),e=parseInt(t.split("-")[3])||0}catch(t){e=0}return e},t.prototype.setDownloadValue=function(t){var e;!this.settings.download||(t=!1!==(e=this.galleryItems[t]).downloadUrl&&(e.downloadUrl||e.src))&&!e.iframe&&this.getElementById("lg-download").attr("href",t)},t.prototype.makeSlideAnimation=function(t,e,i){var s=this;this.lGalleryOn&&i.addClass("lg-slide-progress"),setTimeout(function(){s.outer.addClass("lg-no-trans"),s.outer.find(".lg-item").removeClass("lg-prev-slide lg-next-slide"),"prev"===t?(e.addClass("lg-prev-slide"),i.addClass("lg-next-slide")):(e.addClass("lg-next-slide"),i.addClass("lg-prev-slide")),setTimeout(function(){s.outer.find(".lg-item").removeClass("lg-current"),e.addClass("lg-current"),s.outer.removeClass("lg-no-trans")},50)},this.lGalleryOn?this.settings.slideDelay:0)},t.prototype.slide=function(t,e,i,s){var n,o,r,l,a,g,d=this,h=this.getPreviousSlideIndex();this.currentItemsInDom=this.organizeSlideItems(t,h),this.lGalleryOn&&h===t||(n=this.galleryItems.length,this.lgBusy||(this.settings.counter&&this.updateCurrentCounter(t),o=this.getSlideItem(t),r=this.getSlideItem(h),a=(l=this.galleryItems[t]).__slideVideoInfo,this.outer.attr("data-lg-slide-type",this.getSlideType(l)),this.setDownloadValue(t),a&&(l=(g=this.mediaContainerPosition).top,g=g.bottom,g=I(this.items[t],this.$lgContent,l+g,a&&this.settings.videoMaxSize),this.resizeVideoSlide(t,g)),this.LGel.trigger(f,{prevIndex:h,index:t,fromTouch:!!e,fromThumb:!!i}),this.lgBusy=!0,clearTimeout(this.hideBarTimeout),this.arrowDisable(t),s||(t<h?s="prev":h<t&&(s="next")),e?(this.outer.find(".lg-item").removeClass("lg-prev-slide lg-current lg-next-slide"),g=a=void 0,2<n?(a=t-1,g=t+1,(0===t&&h===n-1||t===n-1&&0===h)&&(g=0,a=n-1)):(a=0,g=1),"prev"===s?this.getSlideItem(g).addClass("lg-next-slide"):this.getSlideItem(a).addClass("lg-prev-slide"),o.addClass("lg-current")):this.makeSlideAnimation(s,o,r),this.lGalleryOn||this.loadContent(t,!0),setTimeout(function(){d.lGalleryOn&&d.loadContent(t,!0),".lg-sub-html"===d.settings.appendSubHtmlTo&&d.addHtml(t)},(this.lGalleryOn?this.settings.speed+50:50)+(e?0:this.settings.slideDelay)),setTimeout(function(){d.lgBusy=!1,r.removeClass("lg-slide-progress"),d.LGel.trigger(y,{prevIndex:h,index:t,fromTouch:e,fromThumb:i})},(this.lGalleryOn?this.settings.speed+100:100)+(e?0:this.settings.slideDelay))),this.index=t)},t.prototype.updateCurrentCounter=function(t){this.getElementById("lg-counter-current").html(t+1+"")},t.prototype.updateCounterTotal=function(){this.getElementById("lg-counter-all").html(this.galleryItems.length+"")},t.prototype.getSlideType=function(t){return t.__slideVideoInfo?"video":t.iframe?"iframe":"image"},t.prototype.touchMove=function(t,e){var i,s=e.pageX-t.pageX,n=e.pageY-t.pageY,e=!1;this.swipeDirection?e=!0:15<Math.abs(s)?(this.swipeDirection="horizontal",e=!0):15<Math.abs(n)&&(this.swipeDirection="vertical",e=!0),e&&(t=this.getSlideItem(this.index),"horizontal"===this.swipeDirection?(this.outer.addClass("lg-dragging"),this.setTranslate(t,s,0),i=15*(e=t.get().offsetWidth)/100-Math.abs(10*s/100),this.setTranslate(this.outer.find(".lg-prev-slide").first(),s-e-i,0),this.setTranslate(this.outer.find(".lg-next-slide").first(),e+s+i,0)):"vertical"===this.swipeDirection&&this.settings.swipeToClose&&(this.$container.addClass("lg-dragging-vertical"),i=1-Math.abs(n)/window.innerHeight,this.$backdrop.css("opacity",i),i=1-Math.abs(n)/(2*window.innerWidth),this.setTranslate(t,0,n,i,i),100<Math.abs(n)&&this.outer.addClass("lg-hide-items").removeClass("lg-components-open")))},t.prototype.touchEnd=function(i,s,n){var o,r=this;"lg-slide"!==this.settings.mode&&this.outer.addClass("lg-slide"),setTimeout(function(){r.$container.removeClass("lg-dragging-vertical"),r.outer.removeClass("lg-dragging lg-hide-items").addClass("lg-components-open");var t=!0;if("horizontal"===r.swipeDirection){o=i.pageX-s.pageX;var e=Math.abs(i.pageX-s.pageX);o<0&&e>r.settings.swipeThreshold?(r.goToNextSlide(!0),t=!1):0<o&&e>r.settings.swipeThreshold&&(r.goToPrevSlide(!0),t=!1)}else if("vertical"===r.swipeDirection){if(o=Math.abs(i.pageY-s.pageY),r.settings.closable&&r.settings.swipeToClose&&100<o)return void r.closeGallery();r.$backdrop.css("opacity",1)}r.outer.find(".lg-item").removeAttr("style"),t&&Math.abs(i.pageX-s.pageX)<5&&(t=C(n.target),r.isPosterElement(t)&&r.LGel.trigger(v)),r.swipeDirection=void 0}),setTimeout(function(){r.outer.hasClass("lg-dragging")||"lg-slide"===r.settings.mode||r.outer.removeClass("lg-slide")},this.settings.speed+100)},t.prototype.enableSwipe=function(){var i=this,s={},e={},n=!1,o=!1;this.settings.enableSwipe&&(this.$inner.on("touchstart.lg",function(t){t.preventDefault();var e=i.getSlideItem(i.index);!C(t.target).hasClass("lg-item")&&!e.get().contains(t.target)||i.outer.hasClass("lg-zoomed")||i.lgBusy||1!==t.targetTouches.length||(o=!0,i.touchAction="swipe",i.manageSwipeClass(),s={pageX:t.targetTouches[0].pageX,pageY:t.targetTouches[0].pageY})}),this.$inner.on("touchmove.lg",function(t){t.preventDefault(),o&&"swipe"===i.touchAction&&1===t.targetTouches.length&&(e={pageX:t.targetTouches[0].pageX,pageY:t.targetTouches[0].pageY},i.touchMove(s,e),n=!0)}),this.$inner.on("touchend.lg",function(t){"swipe"===i.touchAction&&(n?(n=!1,i.touchEnd(e,s,t)):o&&(t=C(t.target),i.isPosterElement(t)&&i.LGel.trigger(v)),i.touchAction=void 0,o=!1)}))},t.prototype.enableDrag=function(){var i=this,s={},n={},o=!1,r=!1;this.settings.enableDrag&&(this.outer.on("mousedown.lg",function(t){var e=i.getSlideItem(i.index);(C(t.target).hasClass("lg-item")||e.get().contains(t.target))&&(i.outer.hasClass("lg-zoomed")||i.lgBusy||(t.preventDefault(),i.lgBusy||(i.manageSwipeClass(),s={pageX:t.pageX,pageY:t.pageY},o=!0,i.outer.get().scrollLeft+=1,--i.outer.get().scrollLeft,i.outer.removeClass("lg-grab").addClass("lg-grabbing"),i.LGel.trigger(b))))}),C(window).on("mousemove.lg.global"+this.lgId,function(t){o&&i.lgOpened&&(r=!0,n={pageX:t.pageX,pageY:t.pageY},i.touchMove(s,n),i.LGel.trigger(D))}),C(window).on("mouseup.lg.global"+this.lgId,function(t){var e;i.lgOpened&&(e=C(t.target),r?(r=!1,i.touchEnd(n,s,t),i.LGel.trigger(z)):i.isPosterElement(e)&&i.LGel.trigger(v),o&&(o=!1,i.outer.removeClass("lg-grabbing").addClass("lg-grab")))}))},t.prototype.manageSwipeClass=function(){var t=this.index+1,e=this.index-1;this.settings.loop&&2<this.galleryItems.length&&(0===this.index?e=this.galleryItems.length-1:this.index===this.galleryItems.length-1&&(t=0)),this.outer.find(".lg-item").removeClass("lg-next-slide lg-prev-slide"),-1<e&&this.getSlideItem(e).addClass("lg-prev-slide"),this.getSlideItem(t).addClass("lg-next-slide")},t.prototype.goToNextSlide=function(t){var e=this,i=this.settings.loop;t&&this.galleryItems.length<3&&(i=!1),this.lgBusy||(this.index+1<this.galleryItems.length?(this.index++,this.LGel.trigger(M,{index:this.index}),this.slide(this.index,!!t,!1,"next")):i?(this.index=0,this.LGel.trigger(M,{index:this.index}),this.slide(this.index,!!t,!1,"next")):this.settings.slideEndAnimation&&!t&&(this.outer.addClass("lg-right-end"),setTimeout(function(){e.outer.removeClass("lg-right-end")},400)))},t.prototype.goToPrevSlide=function(t){var e=this,i=this.settings.loop;t&&this.galleryItems.length<3&&(i=!1),this.lgBusy||(0<this.index?(this.index--,this.LGel.trigger(G,{index:this.index,fromTouch:t}),this.slide(this.index,!!t,!1,"prev")):i?(this.index=this.galleryItems.length-1,this.LGel.trigger(G,{index:this.index,fromTouch:t}),this.slide(this.index,!!t,!1,"prev")):this.settings.slideEndAnimation&&!t&&(this.outer.addClass("lg-left-end"),setTimeout(function(){e.outer.removeClass("lg-left-end")},400)))},t.prototype.keyPress=function(){var e=this;C(window).on("keydown.lg.global"+this.lgId,function(t){e.lgOpened&&!0===e.settings.escKey&&27===t.keyCode&&(t.preventDefault(),e.settings.allowMediaOverlap&&e.outer.hasClass("lg-can-toggle")&&e.outer.hasClass("lg-components-open")?e.outer.removeClass("lg-components-open"):e.closeGallery()),e.lgOpened&&1<e.galleryItems.length&&(37===t.keyCode&&(t.preventDefault(),e.goToPrevSlide()),39===t.keyCode&&(t.preventDefault(),e.goToNextSlide()))})},t.prototype.arrow=function(){var t=this;this.getElementById("lg-prev").on("click.lg",function(){t.goToPrevSlide()}),this.getElementById("lg-next").on("click.lg",function(){t.goToNextSlide()})},t.prototype.arrowDisable=function(t){var e,i;!this.settings.loop&&this.settings.hideControlOnEnd&&(e=this.getElementById("lg-prev"),i=this.getElementById("lg-next"),t+1<this.galleryItems.length?e.removeAttr("disabled").removeClass("disabled"):e.attr("disabled","disabled").addClass("disabled"),0<t?i.removeAttr("disabled").removeClass("disabled"):i.attr("disabled","disabled").addClass("disabled"))},t.prototype.setTranslate=function(t,e,i,s,n){void 0===s&&(s=1),void 0===n&&(n=1),t.css("transform","translate3d("+e+"px, "+i+"px, 0px) scale3d("+s+", "+n+", 1)")},t.prototype.mousewheel=function(){var e=this;this.outer.on("mousewheel.lg",function(t){t.deltaY&&(0<t.deltaY?e.goToPrevSlide():e.goToNextSlide(),t.preventDefault())})},t.prototype.isSlideElement=function(t){return t.hasClass("lg-outer")||t.hasClass("lg-item")||t.hasClass("lg-img-wrap")},t.prototype.isPosterElement=function(t){var e=this.getSlideItem(this.index).find(".lg-video-play-button").get();return t.hasClass("lg-video-poster")||t.hasClass("lg-video-play-button")||e&&e.contains(t.get())},t.prototype.toggleMaximize=function(){var t=this;this.getElementById("lg-maximize").on("click.lg",function(){t.$container.toggleClass("lg-inline"),t.refreshOnResize()})},t.prototype.manageCloseGallery=function(){var e,i=this;this.settings.closable&&(e=!1,this.getElementById("lg-close").on("click.lg",function(){i.closeGallery()}),this.settings.closeOnTap&&(this.outer.on("mousedown.lg",function(t){t=C(t.target);e=!!i.isSlideElement(t)}),this.outer.on("mousemove.lg",function(){e=!1}),this.outer.on("mouseup.lg",function(t){t=C(t.target);i.isSlideElement(t)&&e&&(i.outer.hasClass("lg-dragging")||i.closeGallery())})))},t.prototype.closeGallery=function(t){var e=this;if(!this.lgOpened||!this.settings.closable&&!t)return 0;this.LGel.trigger(A),C(window).scrollTop(this.prevScrollTop);var i,s,n=this.items[this.index];this.zoomFromOrigin&&n&&(i=(o=this.mediaContainerPosition).top,t=o.bottom,o=I(n,this.$lgContent,i+t,this.galleryItems[this.index].__slideVideoInfo&&this.settings.videoMaxSize),s=l(n,this.$lgContent,i,t,o)),this.zoomFromOrigin&&s?(this.outer.addClass("lg-closing lg-zoom-from-image"),this.getSlideItem(this.index).addClass("lg-start-end-progress").css("transition-duration",this.settings.startAnimationDuration+"ms").css("transform",s)):(this.outer.addClass("lg-hide-items"),this.outer.removeClass("lg-zoom-from-image")),this.destroyModules(),this.lGalleryOn=!1,this.isDummyImageRemoved=!1,this.zoomFromOrigin=this.settings.zoomFromOrigin,clearTimeout(this.hideBarTimeout),this.hideBarTimeout=!1,C("html").removeClass("lg-on"),this.outer.removeClass("lg-visible lg-components-open"),this.$backdrop.removeClass("in").css("opacity",0);var o=this.zoomFromOrigin&&s?Math.max(this.settings.startAnimationDuration,this.settings.backdropDuration):this.settings.backdropDuration;return this.$container.removeClass("lg-show-in"),setTimeout(function(){e.zoomFromOrigin&&s&&e.outer.removeClass("lg-zoom-from-image"),e.$container.removeClass("lg-show"),e.$backdrop.removeAttr("style").css("transition-duration",e.settings.backdropDuration+"ms"),e.outer.removeClass("lg-closing "+e.settings.startClass),e.getSlideItem(e.index).removeClass("lg-start-end-progress"),e.$inner.empty(),e.lgOpened&&e.LGel.trigger(B,{instance:e}),e.LGel.get().focus(),e.lgOpened=!1},o+100),o+100},t.prototype.destroyModules=function(e){this.plugins.forEach(function(t){try{e?t.destroy():t.closeGallery&&t.closeGallery()}catch(t){console.warn("lightGallery:- make sure lightGallery module is properly destroyed")}})},t.prototype.destroy=function(){var i=this,t=this.closeGallery(!0);setTimeout(function(){if(i.destroyModules(!0),!i.settings.dynamic)for(var t=0;t<i.items.length;t++){var e=C(i.items[t]);e.off("click.lgcustom-item-"+e.attr("data-lg-id"))}C(window).off(".lg.global"+i.lgId),i.LGel.off(".lg"),i.$container.remove()},t)},t);function t(t,e){if(this.lgOpened=!1,this.index=0,this.plugins=[],this.lGalleryOn=!1,this.lgBusy=!1,this.currentItemsInDom=[],this.prevScrollTop=0,this.isDummyImageRemoved=!1,this.modulesLoaded=!1,this.mediaContainerPosition={top:0,bottom:0},this.timeToLoadModules=0,!t)return this;if(k++,this.lgId=k,this.el=t,this.LGel=C(t),this.settings=i(i({},a),e),(this.settings.isMobile&&"function"==typeof this.settings.isMobile?this.settings.isMobile():o())&&(e=i(i({},this.settings.mobileSettings),this.settings.mobileSettings),this.settings=i(i({},this.settings),e)),this.settings.dynamic&&void 0!==this.settings.dynamicEl&&!Array.isArray(this.settings.dynamicEl))throw"When using dynamic mode, you must also define dynamicEl as an Array.";return this.settings.slideEndAnimation&&(this.settings.hideControlOnEnd=!1),this.settings.closable||(this.settings.swipeToClose=!1),this.zoomFromOrigin=this.settings.zoomFromOrigin,this.galleryItems=this.getItems(),this.settings.dynamic&&(this.zoomFromOrigin=!1),this.settings.preload=Math.min(this.settings.preload,this.galleryItems.length),this.init(),this.validateLicense(),this}return function(t,e){return new P(t,e)}});
// source --> https://www.lebens-retter.org/wp-content/plugins/delicious-recipes//assets/public/js/math.min.js?ver=10.6.1 
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.math=t():e.math=t()}(this,function(){return r=[function(e,t,r){var n=r(115),i=r(35),r=r(201);n||i(Object.prototype,"toString",r,{unsafe:!0})},function(r,e,t){!function(e){function t(e){return e&&e.Math==Math&&e}r.exports=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof e&&e)||function(){return this}()||Function("return this")()}.call(this,t(196))},,function(e,t,r){var c=r(1),f=r(59).f,l=r(55),p=r(35),m=r(111),h=r(144),d=r(84);e.exports=function(e,t){var r,n,i,a,o=e.target,s=e.global,u=e.stat;if(r=s?c:u?c[o]||m(o,{}):(c[o]||{}).prototype)for(n in t){if(i=t[n],a=e.dontCallGetSet?(a=f(r,n))&&a.value:r[n],!d(s?n:o+(u?".":"#")+n,e.forced)&&void 0!==a){if(typeof i==typeof a)continue;h(i,a)}(e.sham||a&&a.sham)&&l(i,"sham",!0),p(r,n,i,e)}}},function(e,t,r){"use strict";var n=r(3),i=r(85).map;n({target:"Array",proto:!0,forced:!r(86)("map")},{map:function(e){return i(this,e,1<arguments.length?arguments[1]:void 0)}})},function(t,e){function r(e){return t.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(e,t,r){function n(t){if(t&&t.forEach!==u)try{c(t,"forEach",u)}catch(e){t.forEach=u}}var i,a=r(1),o=r(147),s=r(148),u=r(202),c=r(55);for(i in o)o[i]&&n(a[i]&&a[i].prototype);n(s)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,r){"use strict";var n=r(81).PROPER,i=r(35),a=r(23),o=r(28),s=r(7),u=r(153),c=RegExp.prototype.toString,r=s(function(){return"/a/b"!=c.call({source:"a",flags:"b"})}),s=n&&"toString"!=c.name;(r||s)&&i(RegExp.prototype,"toString",function(){var e=a(this);return"/"+o(e.source)+"/"+o(u(e))},{unsafe:!0})},function(e,t,r){var r=r(94),n=Function.prototype,i=n.bind,a=n.call,o=r&&i.bind(a,a);e.exports=r?function(e){return e&&o(e)}:function(e){return e&&function(){return a.apply(e,arguments)}}},function(e,t,r){"use strict";var n=r(3),r=r(105);n({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})},function(e,t,r){r(241),r(249),r(250),r(251),r(252),r(253)},function(e,t){e.exports=function(e){return"function"==typeof e}},function(e,t,r){var n=r(19),i=r(81).EXISTS,a=r(9),r=r(25).f,o=Function.prototype,s=a(o.toString),u=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,c=a(u.exec);n&&!i&&r(o,"name",{configurable:!0,get:function(){try{return c(u,s(this))[1]}catch(e){return""}}})},function(e,t,r){"use strict";var n=r(3),i=r(17);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return i(URL.prototype.toString,this)}})},function(e,t,r){var n=r(1),i=r(68),a=r(22),o=r(96),s=r(66),u=r(140),c=i("wks"),f=n.Symbol,l=f&&f.for,p=u?f:f&&f.withoutSetter||o;e.exports=function(e){var t;return a(c,e)&&(s||"string"==typeof c[e])||(t="Symbol."+e,s&&a(f,e)?c[e]=f[e]:c[e]=(u&&l?l:p)(t)),c[e]}},function(e,t,r){"use strict";var n=r(3),i=r(9),a=r(109),o=r(39),r=r(117),s=i([].join),i=a!=Object,a=r("join",",");n({target:"Array",proto:!0,forced:i||!a},{join:function(e){return s(o(this),void 0===e?",":e)}})},function(e,t,r){var r=r(94),n=Function.prototype.call;e.exports=r?n.bind(n):function(){return n.apply(n,arguments)}},function(e,t,r){"use strict";var n=r(3),i=r(1),c=r(102),f=r(103),l=r(24),p=r(83),m=r(47),h=r(39),d=r(72),a=r(15),o=r(86),y=r(123),r=o("slice"),g=a("species"),v=i.Array,x=Math.max;n({target:"Array",proto:!0,forced:!r},{slice:function(e,t){var r,n,i,a=h(this),o=m(a),s=p(e,o),u=p(void 0===t?o:t,o);if(c(a)&&(r=a.constructor,(r=f(r)&&(r===v||c(r.prototype))||l(r)&&null===(r=r[g])?void 0:r)===v||void 0===r))return y(a,s,u);for(n=new(void 0===r?v:r)(x(u-s,0)),i=0;s<u;s++,i++)s in a&&d(n,i,a[s]);return n.length=i,n}})},function(e,t,r){r=r(7);e.exports=!r(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},function(e,t,r){"use strict";var n=r(3),i=r(1),a=r(7),c=r(102),f=r(24),l=r(37),p=r(47),m=r(72),h=r(116),o=r(86),s=r(15),r=r(79),d=s("isConcatSpreadable"),y=i.TypeError,s=51<=r||!a(function(){var e=[];return e[d]=!1,e.concat()[0]!==e}),i=o("concat");n({target:"Array",proto:!0,arity:1,forced:!s||!i},{concat:function(e){for(var t,r,n,i=l(this),a=h(i,0),o=0,s=-1,u=arguments.length;s<u;s++)if(function(e){if(!f(e))return!1;var t=e[d];return void 0!==t?!!t:c(e)}(n=-1===s?i:arguments[s])){if(9007199254740991<o+(r=p(n)))throw y("Maximum allowed index exceeded");for(t=0;t<r;t++,o++)t in n&&m(a,o,n[t])}else{if(9007199254740991<=o)throw y("Maximum allowed index exceeded");m(a,o++,n)}return a.length=o,a}})},function(e,t,r){var n=r(261),i=r(262),a=r(187),o=r(263);e.exports=function(e){return n(e)||i(e)||a(e)||o()},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(9),i=r(37),a=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return a(i(e),t)}},function(e,t,r){var n=r(1),i=r(24),a=n.String,o=n.TypeError;e.exports=function(e){if(i(e))return e;throw o(a(e)+" is not an object")}},function(e,t,r){var n=r(12);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},function(e,t,r){var n=r(1),i=r(19),a=r(141),o=r(142),s=r(23),u=r(95),c=n.TypeError,f=Object.defineProperty,l=Object.getOwnPropertyDescriptor;t.f=i?o?function(e,t,r){var n;return s(e),t=u(t),s(r),"function"==typeof e&&"prototype"===t&&"value"in r&&"writable"in r&&!r.writable&&(n=l(e,t))&&n.writable&&(e[t]=r.value,r={configurable:("configurable"in r?r:n).configurable,enumerable:("enumerable"in r?r:n).enumerable,writable:!1}),f(e,t,r)}:f:function(e,t,r){if(s(e),t=u(t),s(r),a)try{return f(e,t,r)}catch(e){}if("get"in r||"set"in r)throw c("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},function(e,t,r){"use strict";var n=r(3),i=r(85).find,r=r(128),a=!0;"find"in[]&&Array(1).find(function(){a=!1}),n({target:"Array",proto:!0,forced:a},{find:function(e){return i(this,e,1<arguments.length?arguments[1]:void 0)}}),r("find")},function(e,t,r){"use strict";var n=r(39),i=r(128),a=r(89),o=r(46),s=r(25).f,u=r(129),c=r(50),r=r(19),f=o.set,l=o.getterFor("Array Iterator"),o=(e.exports=u(Array,"Array",function(e,t){f(this,{type:"Array Iterator",target:n(e),index:0,kind:t})},function(){var e=l(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?{value:e.target=void 0,done:!0}:"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values"),a.Arguments=a.Array);if(i("keys"),i("values"),i("entries"),!c&&r&&"values"!==o.name)try{s(o,"name",{value:"values"})}catch(e){}},function(e,t,r){var n=r(1),i=r(101),a=n.String;e.exports=function(e){if("Symbol"===i(e))throw TypeError("Cannot convert a Symbol value to a string");return a(e)}},function(e,t,r){"use strict";var n=r(3),i=r(1),l=r(83),p=r(61),m=r(47),h=r(37),d=r(116),y=r(72),r=r(86)("splice"),g=i.TypeError,v=Math.max,x=Math.min;n({target:"Array",proto:!0,forced:!r},{splice:function(e,t){var r,n,i,a,o,s,u=h(this),c=m(u),f=l(e,c),e=arguments.length;if(0===e?r=n=0:n=1===e?(r=0,c-f):(r=e-2,x(v(p(t),0),c-f)),9007199254740991<c+r-n)throw g("Maximum allowed length exceeded");for(i=d(u,n),a=0;a<n;a++)(o=f+a)in u&&y(i,a,u[o]);if(r<(i.length=n)){for(a=f;a<c-n;a++)s=a+r,(o=a+n)in u?u[s]=u[o]:delete u[s];for(a=c;c-n+r<a;a--)delete u[a-1]}else if(n<r)for(a=c-n;f<a;a--)s=a+r-1,(o=a+n-1)in u?u[s]=u[o]:delete u[s];for(a=0;a<r;a++)u[a+f]=arguments[a+2];return u.length=c-n+r,i}})},function(e,t,r){"use strict";var n=r(19),i=r(1),a=r(9),o=r(84),s=r(35),u=r(22),c=r(119),f=r(53),l=r(78),p=r(139),m=r(7),h=r(69).f,d=r(59).f,y=r(25).f,g=r(166),v=r(167).trim,x=i.Number,b=x.prototype,w=i.TypeError,N=a("".slice),M=a("".charCodeAt),E=function(e){var t,r,n,i,a,o,s,u=p(e,"number");if(l(u))throw w("Cannot convert a Symbol value to a number");if("string"==typeof u&&2<u.length)if(u=v(u),43===(e=M(u,0))||45===e){if(88===(t=M(u,2))||120===t)return NaN}else if(48===e){switch(M(u,1)){case 66:case 98:r=2,n=49;break;case 79:case 111:r=8,n=55;break;default:return+u}for(a=(i=N(u,2)).length,o=0;o<a;o++)if((s=M(i,o))<48||n<s)return NaN;return parseInt(i,r)}return+u};if(o("Number",!x(" 0o1")||!x("0b1")||x("+0x1"))){for(var S,A=function(e){var e=arguments.length<1?0:x(function(e){e=p(e,"number");return"bigint"==typeof e?e:E(e)}(e)),t=this;return f(b,t)&&m(function(){g(t)})?c(Object(e),t,A):e},O=n?h(x):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),C=0;O.length>C;C++)u(x,S=O[C])&&!u(A,S)&&y(A,S,d(x,S));s(i,"Number",(A.prototype=b).constructor=A,{constructor:!0})}},function(e,t,r){function n(e,t){if(e){if(e[f]!==p)try{c(e,f,p)}catch(t){e[f]=p}if(e[l]||c(e,l,t),o[t])for(var r in u)if(e[r]!==u[r])try{c(e,r,u[r])}catch(t){e[r]=u[r]}}}var i,a=r(1),o=r(147),s=r(148),u=r(27),c=r(55),r=r(15),f=r("iterator"),l=r("toStringTag"),p=u.values;for(i in o)n(a[i]&&a[i].prototype,i);n(s,"DOMTokenList")},function(e,t){function r(){return e.exports=r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r,n=arguments[t];for(r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,r.apply(this,arguments)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var a;!function(){"use strict";function u(){throw SyntaxError("Invalid Param")}var n=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:.5*(Math.exp(e)+Math.exp(-e))},i=Math.sinh||function(e){return Math.abs(e)<1e-9?e:.5*(Math.exp(e)-Math.exp(-e))};function o(e,t){var r=Math.abs(e),n=Math.abs(t);return 0===e?Math.log(n):0===t?Math.log(r):r<3e3&&n<3e3?.5*Math.log(e*e+t*t):(e/=2,t/=2,.5*Math.log(e*e+t*t)+Math.LN2)}function c(e,t){if(!(this instanceof c))return new c(e,t);e=function(e,t){var r={re:0,im:0};if(null==e)r.re=r.im=0;else if(void 0!==t)r.re=e,r.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)r.re=e.re,r.im=e.im;else if("abs"in e&&"arg"in e){if(!Number.isFinite(e.abs)&&Number.isFinite(e.arg))return c.INFINITY;r.re=e.abs*Math.cos(e.arg),r.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!Number.isFinite(e.r)&&Number.isFinite(e.phi))return c.INFINITY;r.re=e.r*Math.cos(e.phi),r.im=e.r*Math.sin(e.phi)}else 2===e.length?(r.re=e[0],r.im=e[1]):u();break;case"string":r.im=r.re=0;var n=e.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),i=1,a=0;null===n&&u();for(var o=0;o<n.length;o++){var s=n[o];" "!==s&&"\t"!==s&&"\n"!==s&&("+"===s?i++:"-"===s?a++:i=a=("i"===s||"I"===s?(i+a===0&&u()," "===n[o+1]||isNaN(n[o+1])?r.im+=parseFloat((a%2?"-":"")+"1"):(r.im+=parseFloat((a%2?"-":"")+n[o+1]),o++)):(i+a!==0&&!isNaN(s)||u(),"i"===n[o+1]||"I"===n[o+1]?(r.im+=parseFloat((a%2?"-":"")+s),o++):r.re+=parseFloat((a%2?"-":"")+s)),0))}0<i+a&&u();break;case"number":r.im=0,r.re=e;break;default:u()}return isNaN(r.re)||isNaN(r.im),r}(e,t);this.re=e.re,this.im=e.im}c.prototype={re:0,im:0,sign:function(){var e=this.abs();return new c(this.re/e,this.im/e)},add:function(e,t){e=new c(e,t);return this.isInfinite()&&e.isInfinite()?c.NAN:this.isInfinite()||e.isInfinite()?c.INFINITY:new c(this.re+e.re,this.im+e.im)},sub:function(e,t){e=new c(e,t);return this.isInfinite()&&e.isInfinite()?c.NAN:this.isInfinite()||e.isInfinite()?c.INFINITY:new c(this.re-e.re,this.im-e.im)},mul:function(e,t){e=new c(e,t);return this.isInfinite()&&e.isZero()||this.isZero()&&e.isInfinite()?c.NAN:this.isInfinite()||e.isInfinite()?c.INFINITY:0===e.im&&0===this.im?new c(this.re*e.re,0):new c(this.re*e.re-this.im*e.im,this.re*e.im+this.im*e.re)},div:function(e,t){var r=new c(e,t);if(this.isZero()&&r.isZero()||this.isInfinite()&&r.isInfinite())return c.NAN;if(this.isInfinite()||r.isZero())return c.INFINITY;if(this.isZero()||r.isInfinite())return c.ZERO;e=this.re,t=this.im;var n,i,a=r.re,r=r.im;return 0===r?new c(e/a,t/a):Math.abs(a)<Math.abs(r)?new c((e*(i=a/r)+t)/(n=a*i+r),(t*i-e)/n):new c((e+t*(i=r/a))/(n=r*i+a),(t-e*i)/n)},pow:function(e,t){var r=new c(e,t);if(e=this.re,t=this.im,r.isZero())return c.ONE;if(0===r.im){if(0===t&&0<e)return new c(Math.pow(e,r.re),0);if(0===e)switch((r.re%4+4)%4){case 0:return new c(Math.pow(t,r.re),0);case 1:return new c(0,Math.pow(t,r.re));case 2:return new c(-Math.pow(t,r.re),0);case 3:return new c(0,-Math.pow(t,r.re))}}if(0===e&&0===t&&0<r.re&&0<=r.im)return c.ZERO;var n=Math.atan2(t,e),i=o(e,t);return e=Math.exp(r.re*i-r.im*n),t=r.im*i+r.re*n,new c(e*Math.cos(t),e*Math.sin(t))},sqrt:function(){var e,t=this.re,r=this.im,n=this.abs();if(0<=t){if(0===r)return new c(Math.sqrt(t),0);e=.5*Math.sqrt(2*(n+t))}else e=Math.abs(r)/Math.sqrt(2*(n-t));return n=t<=0?.5*Math.sqrt(2*(n-t)):Math.abs(r)/Math.sqrt(2*(n+t)),new c(e,r<0?-n:n)},exp:function(){var e=Math.exp(this.re);return this.im,new c(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){var e=this.re,t=this.im;return new c(Math.expm1(e)*Math.cos(t)+function(e){var t=Math.PI/4;if(e<-t||t<e)return Math.cos(e)-1;t=e*e;return t*(t*(t*(t*(t*(t*(t*(t/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-.5)}(t),Math.exp(e)*Math.sin(t))},log:function(){var e=this.re,t=this.im;return new c(o(e,t),Math.atan2(t,e))},abs:function(){return e=this.re,t=this.im,r=Math.abs(e),n=Math.abs(t),r<3e3&&n<3e3?Math.sqrt(r*r+n*n):(n=r<n?(r=n,e/t):t/e,r*Math.sqrt(1+n*n));var e,t,r,n},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var e=this.re,t=this.im;return new c(Math.sin(e)*n(t),Math.cos(e)*i(t))},cos:function(){var e=this.re,t=this.im;return new c(Math.cos(e)*n(t),-Math.sin(e)*i(t))},tan:function(){var e=2*this.re,t=2*this.im,r=Math.cos(e)+n(t);return new c(Math.sin(e)/r,i(t)/r)},cot:function(){var e=2*this.re,t=2*this.im,r=Math.cos(e)-n(t);return new c(-Math.sin(e)/r,i(t)/r)},sec:function(){var e=this.re,t=this.im,r=.5*n(2*t)+.5*Math.cos(2*e);return new c(Math.cos(e)*n(t)/r,Math.sin(e)*i(t)/r)},csc:function(){var e=this.re,t=this.im,r=.5*n(2*t)-.5*Math.cos(2*e);return new c(Math.sin(e)*n(t)/r,-Math.cos(e)*i(t)/r)},asin:function(){var e=this.re,t=this.im,r=new c(t*t-e*e+1,-2*e*t).sqrt(),t=new c(r.re-t,r.im+e).log();return new c(t.im,-t.re)},acos:function(){var e=this.re,t=this.im,r=new c(t*t-e*e+1,-2*e*t).sqrt(),t=new c(r.re-t,r.im+e).log();return new c(Math.PI/2-t.im,t.re)},atan:function(){var e=this.re,t=this.im;if(0===e){if(1===t)return new c(0,1/0);if(-1===t)return new c(0,-1/0)}var r=e*e+(1-t)*(1-t),t=new c((1-t*t-e*e)/r,-2*e/r).log();return new c(-.5*t.im,.5*t.re)},acot:function(){var e=this.re,t=this.im;if(0===t)return new c(Math.atan2(1,e),0);var r=e*e+t*t;return(0!=r?new c(e/r,-t/r):new c(0!==e?e/0:0,0!==t?-t/0:0)).atan()},asec:function(){var e=this.re,t=this.im;if(0===e&&0===t)return new c(0,1/0);var r=e*e+t*t;return(0!=r?new c(e/r,-t/r):new c(0!==e?e/0:0,0!==t?-t/0:0)).acos()},acsc:function(){var e=this.re,t=this.im;if(0===e&&0===t)return new c(Math.PI/2,1/0);var r=e*e+t*t;return(0!=r?new c(e/r,-t/r):new c(0!==e?e/0:0,0!==t?-t/0:0)).asin()},sinh:function(){var e=this.re,t=this.im;return new c(i(e)*Math.cos(t),n(e)*Math.sin(t))},cosh:function(){var e=this.re,t=this.im;return new c(n(e)*Math.cos(t),i(e)*Math.sin(t))},tanh:function(){var e=2*this.re,t=2*this.im,r=n(e)+Math.cos(t);return new c(i(e)/r,Math.sin(t)/r)},coth:function(){var e=2*this.re,t=2*this.im,r=n(e)-Math.cos(t);return new c(i(e)/r,-Math.sin(t)/r)},csch:function(){var e=this.re,t=this.im,r=Math.cos(2*t)-n(2*e);return new c(-2*i(e)*Math.cos(t)/r,2*n(e)*Math.sin(t)/r)},sech:function(){var e=this.re,t=this.im,r=Math.cos(2*t)+n(2*e);return new c(2*n(e)*Math.cos(t)/r,-2*i(e)*Math.sin(t)/r)},asinh:function(){var e=this.im,t=(this.im=-this.re,this.re=e,this.asin());return this.re=-this.im,this.im=e,e=t.re,t.re=-t.im,t.im=e,t},acosh:function(){var e,t=this.acos();return t.im<=0?(e=t.re,t.re=-t.im,t.im=e):(e=t.im,t.im=-t.re,t.re=e),t},atanh:function(){var e=this.re,t=this.im,r=1<e&&0===t,n=1-e,i=1+e,a=n*n+t*t,n=0!=a?new c((i*n-t*t)/a,(t*n+i*t)/a):new c(-1!==e?e/0:0,0!==t?t/0:0),i=n.re;return n.re=o(n.re,n.im)/2,n.im=Math.atan2(n.im,i)/2,r&&(n.im=-n.im),n},acoth:function(){var e=this.re,t=this.im;if(0===e&&0===t)return new c(0,Math.PI/2);var r=e*e+t*t;return(0!=r?new c(e/r,-t/r):new c(0!==e?e/0:0,0!==t?-t/0:0)).atanh()},acsch:function(){var e=this.re,t=this.im;if(0===t)return new c(0!==e?Math.log(e+Math.sqrt(e*e+1)):1/0,0);var r=e*e+t*t;return(0!=r?new c(e/r,-t/r):new c(0!==e?e/0:0,0!==t?-t/0:0)).asinh()},asech:function(){var e=this.re,t=this.im;if(this.isZero())return c.INFINITY;var r=e*e+t*t;return(0!=r?new c(e/r,-t/r):new c(0!==e?e/0:0,0!==t?-t/0:0)).acosh()},inverse:function(){if(this.isZero())return c.INFINITY;if(this.isInfinite())return c.ZERO;var e=this.re,t=this.im,r=e*e+t*t;return new c(e/r,-t/r)},conjugate:function(){return new c(this.re,-this.im)},neg:function(){return new c(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new c(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new c(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new c(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){e=new c(e,t);return Math.abs(e.re-this.re)<=c.EPSILON&&Math.abs(e.im-this.im)<=c.EPSILON},clone:function(){return new c(this.re,this.im)},toString:function(){var e=this.re,t=this.im,r="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)<c.EPSILON&&(e=0),0===(t=Math.abs(t)<c.EPSILON?0:t)?r+e:(0!==e?(r=r+e+" ",t<0?(t=-t,r+="-"):r+="+",r+=" "):t<0&&(t=-t,r+="-"),1!==t&&(r+=t),r+"i"))},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return 0===this.im&&0===this.re},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!(this.isNaN()||this.isFinite())}},c.ZERO=new c(0,0),c.ONE=new c(1,0),c.I=new c(0,1),c.PI=new c(Math.PI,0),c.E=new c(Math.E,0),c.INFINITY=new c(1/0,1/0),c.NAN=new c(NaN,NaN),c.EPSILON=1e-15,void 0!==(a=function(){return c}.apply(t,[]))&&(e.exports=a)}()},function(e,t,r){var n=r(3),i=r(37),a=r(114);n({target:"Object",stat:!0,forced:r(7)(function(){a(1)})},{keys:function(e){return a(i(e))}})},function(e,t,r){var o=r(12),s=r(55),u=r(143),c=r(111);e.exports=function(e,t,r,n){var i=(n=n||{}).enumerable,a=void 0!==n.name?n.name:t;return o(r)&&u(r,a,n),n.global?i?e[t]=r:c(t,r):(n.unsafe?e[t]&&(i=!0):delete e[t],i?e[t]=r:s(e,t,r)),e}},function(e,t,r){"use strict";var n=r(3),i=r(85).filter;n({target:"Array",proto:!0,forced:!r(86)("filter")},{filter:function(e){return i(this,e,1<arguments.length?arguments[1]:void 0)}})},function(e,t,r){var n=r(1),i=r(49),a=n.Object;e.exports=function(e){return a(i(e))}},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t,r){var n=r(109),i=r(49);e.exports=function(e){return n(i(e))}},function(e,t,r){var n=r(1),i=r(12);e.exports=function(e,t){return arguments.length<2?(r=n[e],i(r)?r:void 0):n[e]&&n[e][t];var r}},function(e,t,r){function i(e,t){var r=d(arguments),n=t;if((m(t)||void 0!==e)&&!h(e))return l(t)||(t=function(e,t){if(p(n)&&(t=u(n,this,e,t)),!h(t))return t}),r[1]=t,s(y,null,r)}function a(e,t,r){var n=v(r,t-1),r=v(r,t+1);return g(M,e)&&!g(E,r)||g(E,e)&&!g(M,n)?"\\u"+w(x(e,0),16):e}var n=r(3),o=r(40),s=r(106),u=r(17),c=r(9),f=r(7),l=r(102),p=r(12),m=r(24),h=r(78),d=r(123),r=r(66),y=o("JSON","stringify"),g=c(/./.exec),v=c("".charAt),x=c("".charCodeAt),b=c("".replace),w=c(1..toString),N=/[\uD800-\uDFFF]/g,M=/^[\uD800-\uDBFF]$/,E=/^[\uDC00-\uDFFF]$/,S=!r||f(function(){var e=o("Symbol")();return"[null]"!=y([e])||"{}"!=y({a:e})||"{}"!=y(Object(e))}),A=f(function(){return'"\\udf06\\ud834"'!==y("\udf06\ud834")||'"\\udead"'!==y("\udead")});y&&n({target:"JSON",stat:!0,arity:3,forced:S||A},{stringify:function(e,t,r){var n=d(arguments),n=s(S?i:y,null,n);return A&&"string"==typeof n?b(n,N,a):n}})},function(e,t,r){"use strict";var n=r(3),i=r(9),s=r(54),u=r(37),c=r(47),f=r(28),a=r(7),l=r(207),o=r(117),p=r(208),m=r(209),h=r(79),d=r(210),y=[],g=i(y.sort),v=i(y.push),r=a(function(){y.sort(void 0)}),i=a(function(){y.sort(null)}),o=o("sort"),x=!a(function(){if(h)return h<70;if(!(p&&3<p)){if(m)return!0;if(d)return d<603;for(var e,t,r,n="",i=65;i<76;i++){switch(e=String.fromCharCode(i),i){case 66:case 69:case 70:case 72:t=3;break;case 68:case 71:t=4;break;default:t=2}for(r=0;r<47;r++)y.push({k:e+r,v:t})}for(y.sort(function(e,t){return t.v-e.v}),r=0;r<y.length;r++)e=y[r].k.charAt(0),n.charAt(n.length-1)!==e&&(n+=e);return"DGBEFHACIJK"!==n}});n({target:"Array",proto:!0,forced:r||!i||!o||!x},{sort:function(e){void 0!==e&&s(e);var t=u(this);if(x)return void 0===e?g(t):g(t,e);for(var r,n,i=[],a=c(t),o=0;o<a;o++)o in t&&v(i,t[o]);for(l(i,(n=e,function(e,t){return void 0===t?-1:void 0===e?1:void 0!==n?+n(e,t)||0:f(e)>f(t)?1:-1})),r=i.length,o=0;o<r;)t[o]=i[o++];for(;o<a;)delete t[o++];return t}})},function(e,t,r){"use strict";var n=r(162).charAt,i=r(28),a=r(46),r=r(129),o=a.set,s=a.getterFor("String Iterator");r(String,"String",function(e){o(this,{type:"String Iterator",string:i(e),index:0})},function(){var e=s(this),t=e.string,r=e.index;return r>=t.length?{value:void 0,done:!0}:(t=n(t,r),e.index+=t.length,{value:t,done:!1})})},function(e,t,r){r(235),r(238),r(239),r(41),r(240)},function(e,t,r){var r=r(9),n=r({}.toString),i=r("".slice);e.exports=function(e){return i(n(e),8,-1)}},function(e,t,r){var n,i,a,o,s,u,c,f,l=r(198),p=r(1),m=r(9),h=r(24),d=r(55),y=r(22),g=r(110),v=r(99),r=r(82),x=p.TypeError,p=p.WeakMap;c=l||g.state?(n=g.state||(g.state=new p),i=m(n.get),a=m(n.has),o=m(n.set),s=function(e,t){if(a(n,e))throw new x("Object already initialized");return t.facade=e,o(n,e,t),t},u=function(e){return i(n,e)||{}},function(e){return a(n,e)}):(r[f=v("state")]=!0,s=function(e,t){if(y(e,f))throw new x("Object already initialized");return t.facade=e,d(e,f,t),t},u=function(e){return y(e,f)?e[f]:{}},function(e){return y(e,f)}),e.exports={set:s,get:u,has:c,enforce:function(e){return c(e)?u(e):s(e,{})},getterFor:function(t){return function(e){if(h(e)&&(e=u(e)).type===t)return e;throw x("Incompatible receiver, "+t+" required")}}}},function(e,t,r){var n=r(100);e.exports=function(e){return n(e.length)}},function(e,t,r){"use strict";r(10);var n,i=r(3),a=r(1),o=r(17),s=r(9),u=r(12),c=r(24),r=(n=!1,(r=/[ac]/).exec=function(){return n=!0,/./.exec.apply(this,arguments)},!0===r.test("abc")&&n),f=a.Error,l=s(/./.test);i({target:"RegExp",proto:!0,forced:!r},{test:function(e){var t=this.exec;if(!u(t))return l(this,e);t=o(t,this,e);if(null===t||c(t))return!!t;throw new f("RegExp exec method returned something other than an Object or null")}})},function(e,t,r){var n=r(1).TypeError;e.exports=function(e){if(null==e)throw n("Can't call method on "+e);return e}},function(e,t){e.exports=!1},function(e,t,r){"use strict";var f=r(106),l=r(17),n=r(9),i=r(124),p=r(152),g=r(23),m=r(49),v=r(161),x=r(125),b=r(100),w=r(28),a=r(67),N=r(126),M=r(127),E=r(105),o=r(104),r=r(7),S=o.UNSUPPORTED_Y,A=Math.min,O=[].push,C=n(/./.exec),T=n(O),_=n("".slice);i("split",function(i,h,d){var y="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||1<".".split(/()()/).length||"".split(/.?/).length?function(e,t){var r=w(m(this)),n=void 0===t?4294967295:t>>>0;if(0==n)return[];if(void 0===e)return[r];if(!p(e))return l(h,r,e,n);for(var i,a,o,s=[],t=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,c=new RegExp(e.source,t+"g");(i=l(E,c,r))&&!((a=c.lastIndex)>u&&(T(s,_(r,u,i.index)),1<i.length&&i.index<r.length&&f(O,s,N(i,1)),o=i[0].length,u=a,n<=s.length));)c.lastIndex===i.index&&c.lastIndex++;return u===r.length?!o&&C(c,"")||T(s,""):T(s,_(r,u)),n<s.length?N(s,0,n):s}:"0".split(void 0,0).length?function(e,t){return void 0===e&&0===t?[]:l(h,this,e,t)}:h;return[function(e,t){var r=m(this),n=null==e?void 0:a(e,i);return n?l(n,e,r,t):l(y,w(r),e,t)},function(e,t){var r=g(this),n=w(e),e=d(y,r,n,t,y!==h);if(e.done)return e.value;var e=v(r,RegExp),i=r.unicode,a=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(S?"g":"y"),o=new e(S?"^(?:"+r.source+")":r,a),s=void 0===t?4294967295:t>>>0;if(0==s)return[];if(0===n.length)return null===M(o,n)?[n]:[];for(var u=0,c=0,f=[];c<n.length;){o.lastIndex=S?0:c;var l,p=M(o,S?_(n,c):n);if(null===p||(l=A(b(o.lastIndex+(S?c:0)),n.length))===u)c=x(n,c,i);else{if(T(f,_(n,u,c)),f.length===s)return f;for(var m=1;m<=p.length-1;m++)if(T(f,p[m]),f.length===s)return f;c=u=l}}return T(f,_(n,u)),f}]},!!r(function(){var e=/(?:)/,t=e.exec,e=(e.exec=function(){return t.apply(this,arguments)},"ab".split(e));return 2!==e.length||"a"!==e[0]||"b"!==e[1]}),S)},function(e,t,r){"use strict";var n,i,a,o,s,u,c,f=r(3),l=r(19),p=r(1),m=r(9),h=r(22),d=r(12),y=r(53),g=r(28),v=r(25).f,r=r(144),x=p.Symbol,b=x&&x.prototype;!l||!d(x)||"description"in b&&void 0===x().description||(n={},r(p=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:g(arguments[0]),t=y(b,this)?new x(e):void 0===e?x():x(e);return""===e&&(n[t]=!0),t},x),(p.prototype=b).constructor=p,i="Symbol(test)"==String(x("test")),a=m(b.toString),o=m(b.valueOf),s=/^Symbol\((.*)\)[^)]+$/,u=m("".replace),c=m("".slice),v(b,"description",{configurable:!0,get:function(){var e=o(this),t=a(e);if(h(n,e))return"";e=i?c(t,7,-1):u(t,s,"$1");return""===e?void 0:e}}),f({global:!0,constructor:!0,forced:!0},{Symbol:p}))},function(e,t,r){r=r(9);e.exports=r({}.isPrototypeOf)},function(e,t,r){var n=r(1),i=r(12),a=r(80),o=n.TypeError;e.exports=function(e){if(i(e))return e;throw o(a(e)+" is not a function")}},function(e,t,r){var n=r(19),i=r(25),a=r(77);e.exports=n?function(e,t,r){return i.f(e,t,a(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){r(181)("iterator")},function(e,t,r){var n=r(258),i=r(259),a=r(187),o=r(260);e.exports=function(e,t){return n(e)||i(e,t)||a(e,t)||o()},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){r=r(255)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},function(e,t,r){var n=r(19),i=r(17),a=r(138),o=r(77),s=r(39),u=r(95),c=r(22),f=r(141),l=Object.getOwnPropertyDescriptor;t.f=n?l:function(e,t){if(e=s(e),t=u(t),f)try{return l(e,t)}catch(e){}if(c(e,t))return o(!i(a.f,e,t),e[t])}},function(e,t,r){r=r(40);e.exports=r("navigator","userAgent")||""},function(e,t,r){var n=r(200);e.exports=function(e){e=+e;return e!=e||0==e?0:n(e)}},function(e,t,r){var n=r(3),i=r(233);n({target:"Array",stat:!0,forced:!r(132)(function(e){Array.from(e)})},{from:i})},function(Re,qe,Be){var De;!function(){"use strict";var f,T,a,o=9e15,h="0123456789abcdef",n="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",i="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",s={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-o,maxE:o,crypto:!1},x=!0,d="[DecimalError] Invalid argument: ",t="[object Decimal]",_=Math.floor,y=Math.pow,D=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,j=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,P=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,F=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,I=1e7,U=n.length-1,m=i.length-1,u={toStringTag:t};function b(e){var t,r,n,i=e.length-1,a="",o=e[0];if(0<i){for(a+=o,t=1;t<i;t++)(r=7-(n=e[t]+"").length)&&(a+=c(r)),a+=n;(r=7-(n=(o=e[t])+"").length)&&(a+=c(r))}else if(0===o)return"0";for(;o%10==0;)o/=10;return a+o}function g(e,t,r){if(e!==~~e||e<t||r<e)throw Error(d+e)}function w(e,t,r,n){for(var i,a,o=e[0];10<=o;o/=10)--t;return--t<0?(t+=7,i=0):(i=Math.ceil((t+1)/7),t%=7),o=y(10,7-t),a=e[i]%o|0,null==n?t<3?(0==t?a=a/100|0:1==t&&(a=a/10|0),r<4&&99999==a||3<r&&49999==a||5e4==a||0==a):(r<4&&a+1==o||3<r&&a+1==o/2)&&(e[i+1]/o/100|0)==y(10,t-2)-1||(a==o/2||0==a)&&0==(e[i+1]/o/100|0):t<4?(0==t?a=a/1e3|0:1==t?a=a/100|0:2==t&&(a=a/10|0),(n||r<4)&&9999==a||!n&&3<r&&4999==a):((n||r<4)&&a+1==o||!n&&3<r&&a+1==o/2)&&(e[i+1]/o/1e3|0)==y(10,t-3)-1}function v(e,t,r){for(var n,i,a=[0],o=0,s=e.length;o<s;){for(i=a.length;i--;)a[i]*=t;for(a[0]+=h.indexOf(e.charAt(o++)),n=0;n<a.length;n++)a[n]>r-1&&(void 0===a[n+1]&&(a[n+1]=0),a[n+1]+=a[n]/r|0,a[n]%=r)}return a.reverse()}u.absoluteValue=u.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),q(e)},u.ceil=function(){return q(new this.constructor(this),this.e+1,2)},u.clampedTo=u.clamp=function(e,t){var r=this.constructor;if(e=new r(e),t=new r(t),!e.s||!t.s)return new r(NaN);if(e.gt(t))throw Error(d+t);return this.cmp(e)<0?e:0<this.cmp(t)?t:new r(this)},u.comparedTo=u.cmp=function(e){var t,r,n=this,i=n.d,a=(e=new n.constructor(e)).d,o=n.s,s=e.s;if(!i||!a)return o&&s?o!==s?o:i===a?0:!i^o<0?1:-1:NaN;if(!i[0]||!a[0])return i[0]?o:a[0]?-s:0;if(o!==s)return o;if(n.e!==e.e)return n.e>e.e^o<0?1:-1;for(t=0,r=(s=i.length)<(n=a.length)?s:n;t<r;++t)if(i[t]!==a[t])return i[t]>a[t]^o<0?1:-1;return s===n?0:n<s^o<0?1:-1},u.cosine=u.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())+7,n.rounding=1,r=function(e,t){var r,n;if(t.isZero())return t;n=(n=t.d.length)<32?(1/B(4,r=Math.ceil(n/3))).toString():(r=16,"2.3283064365386962890625e-10"),e.precision+=r,t=C(e,1,t.times(n),new e(1));for(var i=r;i--;){var a=t.times(t);t=a.times(a).minus(a).times(8).plus(1)}return e.precision-=r,t}(n,V(n,r)),n.precision=e,n.rounding=t,q(2==a||3==a?r.neg():r,e,t,!0)):new n(1):new n(NaN)},u.cubeRoot=u.cbrt=function(){var e,t,r,n,i,a,o,s,u,c,f=this,l=f.constructor;if(!f.isFinite()||f.isZero())return new l(f);for(x=!1,(a=f.s*y(f.s*f,1/3))&&Math.abs(a)!=1/0?n=new l(a.toString()):(r=b(f.d),(a=((e=f.e)-r.length+1)%3)&&(r+=1==a||-2==a?"0":"00"),a=y(r,1/3),e=_((e+1)/3)-(e%3==(e<0?-1:2)),(n=new l(r=a==1/0?"5e"+e:(r=a.toExponential()).slice(0,r.indexOf("e")+1)+e)).s=f.s),o=(e=l.precision)+3;;)if(c=(u=(s=n).times(s).times(s)).plus(f),n=N(c.plus(f).times(s),c.plus(u),o+2,1),b(s.d).slice(0,o)===(r=b(n.d)).slice(0,o)){if("9999"!=(r=r.slice(o-3,o+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(q(n,e+1,1),t=!n.times(n).times(n).eq(f));break}if(!i&&(q(s,e+1,0),s.times(s).times(s).eq(f))){n=s;break}o+=4,i=1}return x=!0,q(n,e,l.rounding,t)},u.decimalPlaces=u.dp=function(){var e,t=this.d,r=NaN;if(t){if(r=7*((e=t.length-1)-_(this.e/7)),e=t[e])for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r},u.dividedBy=u.div=function(e){return N(this,new this.constructor(e))},u.dividedToIntegerBy=u.divToInt=function(e){var t=this.constructor;return q(N(this,new t(e),0,1,1),t.precision,t.rounding)},u.equals=u.eq=function(e){return 0===this.cmp(e)},u.floor=function(){return q(new this.constructor(this),this.e+1,3)},u.greaterThan=u.gt=function(e){return 0<this.cmp(e)},u.greaterThanOrEqualTo=u.gte=function(e){e=this.cmp(e);return 1==e||0===e},u.hyperbolicCosine=u.cosh=function(){var e,t,r,n=(s=this).constructor,i=new n(1);if(!s.isFinite())return new n(s.s?1/0:NaN);if(s.isZero())return i;t=n.precision,r=n.rounding,n.precision=t+Math.max(s.e,s.sd())+4,n.rounding=1;for(var a,o=(o=s.d.length)<32?(1/B(4,e=Math.ceil(o/3))).toString():(e=16,"2.3283064365386962890625e-10"),s=C(n,1,s.times(o),new n(1),!0),u=e,c=new n(8);u--;)a=s.times(s),s=i.minus(a.times(c.minus(a.times(c))));return q(s,n.precision=t,n.rounding=r,!0)},u.hyperbolicSine=u.sinh=function(){var e,t,r,n=(o=this).constructor;if(!o.isFinite()||o.isZero())return new n(o);if(e=n.precision,t=n.rounding,n.precision=e+Math.max(o.e,o.sd())+4,n.rounding=1,(r=o.d.length)<3)o=C(n,2,o,o,!0);else for(var i,a=16<(a=1.4*Math.sqrt(r))?16:0|a,o=C(n,2,o=o.times(1/B(5,a)),o,!0),s=new n(5),u=new n(16),c=new n(20);a--;)i=o.times(o),o=o.times(s.plus(i.times(u.times(i).plus(c))));return q(o,n.precision=e,n.rounding=t,!0)},u.hyperbolicTangent=u.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,N(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)},u.inverseCosine=u.acos=function(){var e=this,t=e.constructor,r=e.abs().cmp(1),n=t.precision,i=t.rounding;return-1!==r?0===r?e.isNeg()?A(t,n,i):new t(0):new t(NaN):e.isZero()?A(t,n+4,i).times(.5):(t.precision=n+6,t.rounding=1,e=e.asin(),r=A(t,n+4,i).times(.5),t.precision=n,t.rounding=i,r.minus(e))},u.inverseHyperbolicCosine=u.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,x=!1,r=r.times(r).minus(1).sqrt().plus(r),x=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)},u.inverseHyperbolicSine=u.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,x=!1,r=r.times(r).plus(1).sqrt().plus(r),x=!0,n.precision=e,n.rounding=t,r.ln())},u.inverseHyperbolicTangent=u.atanh=function(){var e,t,r,n=this,i=n.constructor;return n.isFinite()?0<=n.e?new i(n.abs().eq(1)?n.s/0:n.isZero()?n:NaN):(e=i.precision,t=i.rounding,r=n.sd(),Math.max(r,e)<2*-n.e-1?q(new i(n),e,t,!0):(i.precision=r=r-n.e,n=N(n.plus(1),new i(1).minus(n),r+e,1),i.precision=e+4,i.rounding=1,n=n.ln(),i.precision=e,i.rounding=t,n.times(.5))):new i(NaN)},u.inverseSine=u.asin=function(){var e,t,r,n=this,i=n.constructor;return n.isZero()?new i(n):(e=n.abs().cmp(1),t=i.precision,r=i.rounding,-1!==e?0===e?((e=A(i,t+4,r).times(.5)).s=n.s,e):new i(NaN):(i.precision=t+6,i.rounding=1,n=n.div(new i(1).minus(n.times(n)).sqrt().plus(1)).atan(),i.precision=t,i.rounding=r,n.times(2)))},u.inverseTangent=u.atan=function(){var e,t,r,n,i,a,o,s,u,c=this,f=c.constructor,l=f.precision,p=f.rounding;if(c.isFinite()){if(c.isZero())return new f(c);if(c.abs().eq(1)&&l+4<=m)return(o=A(f,l+4,p).times(.25)).s=c.s,o}else{if(!c.s)return new f(NaN);if(l+4<=m)return(o=A(f,l+4,p).times(.5)).s=c.s,o}for(f.precision=s=l+10,f.rounding=1,e=r=Math.min(28,s/7+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(x=!1,t=Math.ceil(s/7),n=1,u=c.times(c),o=new f(c),i=c;-1!==e;)if(i=i.times(u),a=o.minus(i.div(n+=2)),i=i.times(u),void 0!==(o=a.plus(i.div(n+=2))).d[t])for(e=t;o.d[e]===a.d[e]&&e--;);return r&&(o=o.times(2<<r-1)),x=!0,q(o,f.precision=l,f.rounding=p,!0)},u.isFinite=function(){return!!this.d},u.isInteger=u.isInt=function(){return!!this.d&&_(this.e/7)>this.d.length-2},u.isNaN=function(){return!this.s},u.isNegative=u.isNeg=function(){return this.s<0},u.isPositive=u.isPos=function(){return 0<this.s},u.isZero=function(){return!!this.d&&0===this.d[0]},u.lessThan=u.lt=function(e){return this.cmp(e)<0},u.lessThanOrEqualTo=u.lte=function(e){return this.cmp(e)<1},u.logarithm=u.log=function(e){var t,r,n,i,a,o,s,u,c=this.constructor,f=c.precision,l=c.rounding;if(null==e)e=new c(10),t=!0;else{if(r=(e=new c(e)).d,e.s<0||!r||!r[0]||e.eq(1))return new c(NaN);t=e.eq(10)}if(r=this.d,this.s<0||!r||!r[0]||this.eq(1))return new c(r&&!r[0]?-1/0:1!=this.s?NaN:r?0:1/0);if(t)if(1<r.length)a=!0;else{for(i=r[0];i%10==0;)i/=10;a=1!==i}if(x=!1,o=O(this,s=f+5),n=t?S(c,s+10):O(e,s),w((u=N(o,n,s,1)).d,i=f,l))do{if(o=O(this,s+=10),n=t?S(c,s+10):O(e,s),u=N(o,n,s,1),!a){+b(u.d).slice(i+1,i+15)+1==1e14&&(u=q(u,f+1,0));break}}while(w(u.d,i+=10,l));return x=!0,q(u,f,l)},u.minus=u.sub=function(e){var t,r,n,i,a,o,s,u,c,f,l,p=this,m=p.constructor;if(e=new m(e),!p.d||!e.d)return p.s&&e.s?p.d?e.s=-e.s:e=new m(e.d||p.s!==e.s?p:NaN):e=new m(NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(c=p.d,l=e.d,s=m.precision,u=m.rounding,!c[0]||!l[0]){if(l[0])e.s=-e.s;else{if(!c[0])return new m(3===u?-0:0);e=new m(p)}return x?q(e,s,u):e}if(r=_(e.e/7),p=_(p.e/7),c=c.slice(),a=p-r){for(o=(f=a<0)?(t=c,a=-a,l.length):(t=l,r=p,c.length),a>(n=Math.max(Math.ceil(s/7),o)+2)&&(a=n,t.length=1),t.reverse(),n=a;n--;)t.push(0);t.reverse()}else{for((f=(n=c.length)<(o=l.length))&&(o=n),n=0;n<o;n++)if(c[n]!=l[n]){f=c[n]<l[n];break}a=0}for(f&&(t=c,c=l,l=t,e.s=-e.s),o=c.length,n=l.length-o;0<n;--n)c[o++]=0;for(n=l.length;a<n;){if(c[--n]<l[n]){for(i=n;i&&0===c[--i];)c[i]=I-1;--c[i],c[n]+=I}c[n]-=l[n]}for(;0===c[--o];)c.pop();for(;0===c[0];c.shift())--r;return c[0]?(e.d=c,e.e=E(c,r),x?q(e,s,u):e):new m(3===u?-0:0)},u.modulo=u.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?q(new n(r),n.precision,n.rounding):(x=!1,9==n.modulo?(t=N(r,e.abs(),0,3,1)).s*=e.s:t=N(r,e,0,n.modulo,1),t=t.times(e),x=!0,r.minus(t))},u.naturalExponential=u.exp=function(){return l(this)},u.naturalLogarithm=u.ln=function(){return O(this)},u.negated=u.neg=function(){var e=new this.constructor(this);return e.s=-e.s,q(e)},u.plus=u.add=function(e){var t,r,n,i,a,o,s,u,c=this,f=c.constructor;if(e=new f(e),!c.d||!e.d)return c.s&&e.s?c.d||(e=new f(e.d||c.s===e.s?c:NaN)):e=new f(NaN),e;if(c.s!=e.s)return e.s=-e.s,c.minus(e);if(s=c.d,u=e.d,a=f.precision,o=f.rounding,!s[0]||!u[0])return u[0]||(e=new f(c)),x?q(e,a,o):e;if(f=_(c.e/7),c=_(e.e/7),s=s.slice(),n=f-c){for(i=n<0?(r=s,n=-n,u.length):(r=u,c=f,s.length),n>(i=(f=Math.ceil(a/7))>i?f+1:i+1)&&(n=i,r.length=1),r.reverse();n--;)r.push(0);r.reverse()}for((i=s.length)-(n=u.length)<0&&(n=i,r=u,u=s,s=r),t=0;n;)t=(s[--n]=s[n]+u[n]+t)/I|0,s[n]%=I;for(t&&(s.unshift(t),++c),i=s.length;0==s[--i];)s.pop();return e.d=s,e.e=E(s,c),x?q(e,a,o):e},u.precision=u.sd=function(e){var t;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(d+e);return this.d?(t=L(this.d),e&&this.e+1>t&&(t=this.e+1)):t=NaN,t},u.round=function(){var e=this.constructor;return q(new e(this),this.e+1,e.rounding)},u.sine=u.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:C(e,2,t,t);r=16<(r=1.4*Math.sqrt(n))?16:0|r,t=C(e,2,t=t.times(1/B(5,r)),t);for(var i,a=new e(5),o=new e(16),s=new e(20);r--;)i=t.times(t),t=t.times(a.plus(i.times(o.times(i).minus(s))));return t}(n,V(n,r)),n.precision=e,n.rounding=t,q(2<a?r.neg():r,e,t,!0)):new n(NaN)},u.squareRoot=u.sqrt=function(){var e,t,r,n,i,a,o=this,s=o.d,u=o.e,c=o.s,f=o.constructor;if(1!==c||!s||!s[0])return new f(!c||c<0&&(!s||s[0])?NaN:s?o:1/0);for(x=!1,n=0==(c=Math.sqrt(+o))||c==1/0?(((t=b(s)).length+u)%2==0&&(t+="0"),c=Math.sqrt(t),u=_((u+1)/2)-(u<0||u%2),new f(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):new f(c.toString()),r=(u=f.precision)+3;;)if(n=(a=n).plus(N(o,a,r+2,1)).times(.5),b(a.d).slice(0,r)===(t=b(n.d)).slice(0,r)){if("9999"!=(t=t.slice(r-3,r+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(q(n,u+1,1),e=!n.times(n).eq(o));break}if(!i&&(q(a,u+1,0),a.times(a).eq(o))){n=a;break}r+=4,i=1}return x=!0,q(n,u,f.rounding,e)},u.tangent=u.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()).s=1,r=N(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,q(2==a||4==a?r.neg():r,e,t,!0)):new n(NaN)},u.times=u.mul=function(e){var t,r,n,i,a,o,s,u,c,f=this.constructor,l=this.d,p=(e=new f(e)).d;if(e.s*=this.s,!(l&&l[0]&&p&&p[0]))return new f(!e.s||l&&!l[0]&&!p||p&&!p[0]&&!l?NaN:l&&p?0*e.s:e.s/0);for(r=_(this.e/7)+_(e.e/7),(u=l.length)<(c=p.length)&&(a=l,l=p,p=a,o=u,u=c,c=o),a=[],n=o=u+c;n--;)a.push(0);for(n=c;0<=--n;){for(t=0,i=u+n;n<i;)s=a[i]+p[n]*l[i-n-1]+t,a[i--]=s%I|0,t=s/I|0;a[i]=(a[i]+t)%I|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=E(a,r),x?q(e,f.precision,f.rounding):e},u.toBinary=function(e,t){return r(this,2,e,t)},u.toDecimalPlaces=u.toDP=function(e,t){var r=this.constructor,n=new r(this);return void 0===e?n:(g(e,0,1e9),void 0===t?t=r.rounding:g(t,0,8),q(n,e+n.e+1,t))},u.toExponential=function(e,t){var r=this,n=r.constructor,n=void 0===e?M(r,!0):(g(e,0,1e9),void 0===t?t=n.rounding:g(t,0,8),M(r=q(new n(r),e+1,t),!0,e+1));return r.isNeg()&&!r.isZero()?"-"+n:n},u.toFixed=function(e,t){var r=this,n=r.constructor,t=void 0===e?M(r):(g(e,0,1e9),void 0===t?t=n.rounding:g(t,0,8),M(n=q(new n(r),e+r.e+1,t),!1,e+n.e+1));return r.isNeg()&&!r.isZero()?"-"+t:t},u.toFraction=function(e){var t,r,n,i,a,o,s,u,c,f,l=this,p=l.d,m=l.constructor;if(!p)return new m(l);if(u=r=new m(1),n=s=new m(0),c=(a=(t=new m(n)).e=L(p)-l.e-1)%7,t.d[0]=y(10,c<0?7+c:c),null==e)e=0<a?t:u;else{if(!(o=new m(e)).isInt()||o.lt(u))throw Error(d+o);e=o.gt(t)?0<a?t:u:o}for(x=!1,o=new m(b(p)),c=m.precision,m.precision=a=7*p.length*2;f=N(o,t,0,1,1),1!=(i=r.plus(f.times(n))).cmp(e);)r=n,n=i,i=u,u=s.plus(f.times(i)),s=i,i=t,t=o.minus(f.times(i)),o=i;return i=N(e.minus(r),n,0,1,1),s=s.plus(i.times(u)),r=r.plus(i.times(n)),s.s=u.s=l.s,p=N(u,n,a,1).minus(l).abs().cmp(N(s,r,a,1).minus(l).abs())<1?[u,n]:[s,r],m.precision=c,x=!0,p},u.toHexadecimal=u.toHex=function(e,t){return r(this,16,e,t)},u.toNearest=function(e,t){var r=(n=this).constructor,n=new r(n);if(null==e){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),void 0===t?t=r.rounding:g(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(x=!1,n=N(n,e,0,t,1).times(e),x=!0,q(n)):(e.s=n.s,n=e),n},u.toNumber=function(){return+this},u.toOctal=function(e,t){return r(this,8,e,t)},u.toPower=u.pow=function(e){var t,r,n,i,a,o,s=this,u=s.constructor,c=+(e=new u(e));if(!(s.d&&e.d&&s.d[0]&&e.d[0]))return new u(y(+s,c));if((s=new u(s)).eq(1))return s;if(n=u.precision,a=u.rounding,e.eq(1))return q(s,n,a);if((t=_(e.e/7))>=e.d.length-1&&(r=c<0?-c:c)<=9007199254740991)return i=$(u,s,r,n),e.s<0?new u(1).div(i):q(i,n,a);if((o=s.s)<0){if(t<e.d.length-1)return new u(NaN);if(0==(1&e.d[t])&&(o=1),0==s.e&&1==s.d[0]&&1==s.d.length)return s.s=o,s}return(t=0!=(r=y(+s,c))&&isFinite(r)?new u(r+"").e:_(c*(Math.log("0."+b(s.d))/Math.LN10+s.e+1)))>u.maxE+1||t<u.minE-1?new u(0<t?o/0:0):(x=!1,u.rounding=s.s=1,r=Math.min(12,(t+"").length),(i=l(e.times(O(s,n+r)),n)).d&&w((i=q(i,n+5,1)).d,n,a)&&(+b((i=q(l(e.times(O(s,(t=n+10)+r)),t),t+5,1)).d).slice(n+1,n+15)+1==1e14&&(i=q(i,n+1,0))),i.s=o,x=!0,q(i,n,u.rounding=a))},u.toPrecision=function(e,t){var r=this,n=r.constructor,t=void 0===e?M(r,r.e<=n.toExpNeg||r.e>=n.toExpPos):(g(e,1,1e9),void 0===t?t=n.rounding:g(t,0,8),M(r=q(new n(r),e,t),e<=r.e||r.e<=n.toExpNeg,e));return r.isNeg()&&!r.isZero()?"-"+t:t},u.toSignificantDigits=u.toSD=function(e,t){var r=this.constructor;return void 0===e?(e=r.precision,t=r.rounding):(g(e,1,1e9),void 0===t?t=r.rounding:g(t,0,8)),q(new r(this),e,t)},u.toString=function(){var e=this,t=e.constructor,t=M(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+t:t},u.truncated=u.trunc=function(){return q(new this.constructor(this),this.e+1,1)},u.valueOf=u.toJSON=function(){var e=this,t=e.constructor,t=M(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+t:t};var N=function(e,t,r,n,i,a){var o,s,u,c,f,l,p,m,h,d,y,g,v,x,b,w,N,M,E,S=e.constructor,A=e.s==t.s?1:-1,O=e.d,C=t.d;if(!(O&&O[0]&&C&&C[0]))return new S(e.s&&t.s&&(O?!C||O[0]!=C[0]:C)?O&&0==O[0]||!C?0*A:A/0:NaN);for(s=a?(f=1,e.e-t.e):(a=I,_(e.e/(f=7))-_(t.e/f)),M=C.length,w=O.length,h=(A=new S(A)).d=[],u=0;C[u]==(O[u]||0);u++);if(C[u]>(O[u]||0)&&s--,null==r?(v=r=S.precision,n=S.rounding):v=i?r+(e.e-t.e)+1:r,v<0)h.push(1),l=!0;else{if(v=v/f+2|0,u=0,1==M){for(C=C[c=0],v++;(u<w||c)&&v--;u++)x=c*a+(O[u]||0),h[u]=x/C|0,c=x%C|0;l=c||u<w}else{for(1<(c=a/(C[0]+1)|0)&&(C=k(C,c,a),O=k(O,c,a),M=C.length,w=O.length),b=M,y=(d=O.slice(0,M)).length;y<M;)d[y++]=0;for((E=C.slice()).unshift(0),N=C[0],C[1]>=a/2&&++N;c=0,(o=z(C,d,M,y))<0?(g=d[0],1<(c=(g=M!=y?g*a+(d[1]||0):g)/N|0)?1==(o=z(p=k(C,c=a<=c?a-1:c,a),d,m=p.length,y=d.length))&&(c--,R(p,M<m?E:C,m,a)):(0==c&&(o=c=1),p=C.slice()),(m=p.length)<y&&p.unshift(0),R(d,p,y,a),-1==o&&(o=z(C,d,M,y=d.length))<1&&(c++,R(d,M<y?E:C,y,a)),y=d.length):0===o&&(c++,d=[0]),h[u++]=c,o&&d[0]?d[y++]=O[b]||0:(d=[O[b]],y=1),(b++<w||void 0!==d[0])&&v--;);l=void 0!==d[0]}h[0]||h.shift()}if(1==f)A.e=s,T=l;else{for(u=1,c=h[0];10<=c;c/=10)u++;A.e=u+s*f-1,q(A,i?r+A.e+1:r,n,l)}return A};function k(e,t,r){var n,i=0,a=e.length;for(e=e.slice();a--;)n=e[a]*t+i,e[a]=n%r|0,i=n/r|0;return i&&e.unshift(i),e}function z(e,t,r,n){var i,a;if(r!=n)a=n<r?1:-1;else for(i=a=0;i<r;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function R(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&1<e.length;)e.shift()}function q(e,t,r,n){var i,a,o,s,u,c,f,l,p=e.constructor;e:if(null!=t){if(!(f=e.d))return e;for(i=1,s=f[0];10<=s;s/=10)i++;if((a=t-i)<0)a+=7,o=t,u=(c=f[l=0])/y(10,i-o-1)%10|0;else if((l=Math.ceil((a+1)/7))>=(s=f.length)){if(!n)break e;for(;s++<=l;)f.push(0);c=u=0,o=(a%=7)-7+(i=1)}else{for(c=s=f[l],i=1;10<=s;s/=10)i++;u=(o=(a%=7)-7+i)<0?0:c/y(10,i-o-1)%10|0}if(n=n||t<0||void 0!==f[l+1]||(o<0?c:c%y(10,i-o-1)),u=r<4?(u||n)&&(0==r||r==(e.s<0?3:2)):5<u||5==u&&(4==r||n||6==r&&(0<a?0<o?c/y(10,i-o):0:f[l-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,u?(t-=e.e+1,f[0]=y(10,(7-t%7)%7),e.e=-t||0):f[0]=e.e=0,e;if(0==a?(f.length=l,s=1,l--):(f.length=l+1,s=y(10,7-a),f[l]=0<o?(c/y(10,i-o)%y(10,o)|0)*s:0),u)for(;;){if(0==l){for(a=1,o=f[0];10<=o;o/=10)a++;for(o=f[0]+=s,s=1;10<=o;o/=10)s++;a!=s&&(e.e++,f[0]==I&&(f[0]=1));break}if(f[l]+=s,f[l]!=I)break;f[l--]=0,s=1}for(a=f.length;0===f[--a];)f.pop()}return x&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function M(e,t,r){if(!e.isFinite())return G(e);var n,i=e.e,a=b(e.d),o=a.length;return t?(r&&0<(n=r-o)?a=a.charAt(0)+"."+a.slice(1)+c(n):1<o&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):i<0?(a="0."+c(-i-1)+a,r&&0<(n=r-o)&&(a+=c(n))):o<=i?(a+=c(i+1-o),r&&0<(n=r-i-1)&&(a=a+"."+c(n))):((n=i+1)<o&&(a=a.slice(0,n)+"."+a.slice(n)),r&&0<(n=r-o)&&(i+1===o&&(a+="."),a+=c(n))),a}function E(e,t){var r=e[0];for(t*=7;10<=r;r/=10)t++;return t}function S(e,t,r){if(U<t)throw x=!0,r&&(e.precision=r),Error("[DecimalError] Precision limit exceeded");return q(new e(n),t,1,!0)}function A(e,t,r){if(m<t)throw Error("[DecimalError] Precision limit exceeded");return q(new e(i),t,r,!0)}function L(e){var t=e.length-1,r=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)r--;for(t=e[0];10<=t;t/=10)r++}return r}function c(e){for(var t="";e--;)t+="0";return t}function $(e,t,r,n){var i,a=new e(1),o=Math.ceil(n/7+4);for(x=!1;;){if(r%2&&Z((a=a.times(t)).d,o)&&(i=!0),0===(r=_(r/2))){r=a.d.length-1,i&&0===a.d[r]&&++a.d[r];break}Z((t=t.times(t)).d,o)}return x=!0,a}function H(e){return 1&e.d[e.d.length-1]}function e(e,t,r){for(var n,i=new e(t[0]),a=0;++a<t.length;){if(!(n=new e(t[a])).s){i=n;break}i[r](n)&&(i=n)}return i}function l(e,t){var r,n,i,a,o,s,u,c=0,f=0,l=0,p=e.constructor,m=p.rounding,h=p.precision;if(!e.d||!e.d[0]||17<e.e)return new p(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(u=null==t?(x=!1,h):t,s=new p(.03125);-2<e.e;)e=e.times(s),l+=5;for(u+=n=Math.log(y(2,l))/Math.LN10*2+5|0,r=a=o=new p(1),p.precision=u;;){if(a=q(a.times(e),u,1),r=r.times(++f),b((s=o.plus(N(a,r,u,1))).d).slice(0,u)===b(o.d).slice(0,u)){for(i=l;i--;)o=q(o.times(o),u,1);if(null!=t)return p.precision=h,o;if(!(c<3&&w(o.d,u-n,m,c)))return q(o,p.precision=h,m,x=!0);p.precision=u+=10,r=a=s=new p(1),f=0,c++}o=s}}function O(e,t){var r,n,i,a,o,s,u,c,f,l,p,m=1,h=e,d=h.d,y=h.constructor,g=y.rounding,v=y.precision;if(h.s<0||!d||!d[0]||!h.e&&1==d[0]&&1==d.length)return new y(d&&!d[0]?-1/0:1!=h.s?NaN:d?0:h);if(f=null==t?(x=!1,v):t,y.precision=f+=10,n=(r=b(d)).charAt(0),!(Math.abs(a=h.e)<15e14))return c=S(y,f+2,v).times(a+""),h=O(new y(n+"."+r.slice(1)),f-10).plus(c),y.precision=v,null==t?q(h,v,g,x=!0):h;for(;n<7&&1!=n||1==n&&3<r.charAt(1);)n=(r=b((h=h.times(e)).d)).charAt(0),m++;for(a=h.e,1<n?(h=new y("0."+r),a++):h=new y(n+"."+r.slice(1)),u=o=h=N((l=h).minus(1),h.plus(1),f,1),p=q(h.times(h),f,1),i=3;;){if(o=q(o.times(p),f,1),b((c=u.plus(N(o,new y(i),f,1))).d).slice(0,f)===b(u.d).slice(0,f)){if(u=u.times(2),0!==a&&(u=u.plus(S(y,f+2,v).times(a+""))),u=N(u,new y(m),f,1),null!=t)return y.precision=v,u;if(!w(u.d,f-10,g,s))return q(u,y.precision=v,g,x=!0);y.precision=f+=10,c=o=h=N(l.minus(1),l.plus(1),f,1),p=q(h.times(h),f,1),i=s=1}u=c,i+=2}}function G(e){return String(e.s*e.s/0)}function p(e,t){var r,n,i;for(0<(n=(t=-1<(r=t.indexOf("."))?t.replace(".",""):t).search(/e/i))?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;48===t.charCodeAt(n);n++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(n,i)){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%7,r<0&&(n+=7),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=7;n<i;)e.d.push(+t.slice(n,n+=7));n=7-(t=t.slice(n)).length}else n-=i;for(;n--;)t+="0";e.d.push(+t),x&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function C(e,t,r,n,i){var a,o,s,u,c=e.precision,f=Math.ceil(c/7);for(x=!1,u=r.times(r),s=new e(n);;){if(o=N(s.times(u),new e(t++*t++),c,1),s=i?n.plus(o):n.minus(o),n=N(o.times(u),new e(t++*t++),c,1),void 0!==(o=s.plus(n)).d[f]){for(a=f;o.d[a]===s.d[a]&&a--;);if(-1==a)break}a=s,s=n,n=o,o=a}return x=!0,o.d.length=f+1,o}function B(e,t){for(var r=e;--t;)r*=e;return r}function V(e,t){var r,n=t.s<0,e=A(e,e.precision,1),i=e.times(.5);if((t=t.abs()).lte(i))return a=n?4:1,t;if((r=t.divToInt(e)).isZero())a=n?3:2;else{if((t=t.minus(r.times(e))).lte(i))return a=H(r)?n?2:3:n?4:1,t;a=H(r)?n?1:4:n?3:2}return t.minus(e).abs()}function r(e,t,r,n){var i,a,o,s,u,c,f,l,p=e.constructor,m=void 0!==r;if(m?(g(r,1,1e9),void 0===n?n=p.rounding:g(n,0,8)):(r=p.precision,n=p.rounding),e.isFinite()){for(m?(i=2,16==t?r=4*r-3:8==t&&(r=3*r-2)):i=t,0<=(o=(c=M(e)).indexOf("."))&&(c=c.replace(".",""),(l=new p(1)).e=c.length-o,l.d=v(M(l),10,i),l.e=l.d.length),a=s=(f=v(c,10,i)).length;0==f[--s];)f.pop();if(f[0]){if(o<0?a--:((e=new p(e)).d=f,e.e=a,f=(e=N(e,l,r,n,0,i)).d,a=e.e,u=T),o=f[r],p=i/2,u=u||void 0!==f[r+1],u=n<4?(void 0!==o||u)&&(0===n||n===(e.s<0?3:2)):p<o||o===p&&(4===n||u||6===n&&1&f[r-1]||n===(e.s<0?8:7)),f.length=r,u)for(;++f[--r]>i-1;)f[r]=0,r||(++a,f.unshift(1));for(s=f.length;!f[s-1];--s);for(o=0,c="";o<s;o++)c+=h.charAt(f[o]);if(m){if(1<s)if(16==t||8==t){for(o=16==t?4:3,--s;s%o;s++)c+="0";for(s=(f=v(c,i,t)).length;!f[s-1];--s);for(o=1,c="1.";o<s;o++)c+=h.charAt(f[o])}else c=c.charAt(0)+"."+c.slice(1);c=c+(a<0?"p":"p+")+a}else if(a<0){for(;++a;)c="0"+c;c="0."+c}else if(++a>s)for(a-=s;a--;)c+="0";else a<s&&(c=c.slice(0,a)+"."+c.slice(a))}else c=m?"0p+0":"0";c=(16==t?"0x":2==t?"0b":8==t?"0o":"")+c}else c=G(e);return e.s<0?"-"+c:c}function Z(e,t){return e.length>t&&(e.length=t,1)}function W(e){return new this(e).abs()}function Y(e){return new this(e).acos()}function J(e){return new this(e).acosh()}function X(e,t){return new this(e).plus(t)}function Q(e){return new this(e).asin()}function K(e){return new this(e).asinh()}function ee(e){return new this(e).atan()}function te(e){return new this(e).atanh()}function re(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,a=n+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(r=t.s<0?A(this,n,i):new this(0)).s=e.s:!e.d||t.isZero()?(r=A(this,a,1).times(.5)).s=e.s:r=t.s<0?(this.precision=a,this.rounding=1,r=this.atan(N(e,t,a,1)),t=A(this,a,1),this.precision=n,this.rounding=i,e.s<0?r.minus(t):r.plus(t)):this.atan(N(e,t,a,1)):(r=A(this,a,1).times(0<t.s?.25:.75)).s=e.s:r=new this(NaN),r}function ne(e){return new this(e).cbrt()}function ie(e){return q(e=new this(e),e.e+1,2)}function ae(e,t,r){return new this(e).clamp(t,r)}function oe(e){if(!e||"object"!=typeof e)throw Error("[DecimalError] Object expected");for(var t,r,n=!0===e.defaults,i=["precision",1,1e9,"rounding",0,8,"toExpNeg",-o,0,"toExpPos",0,o,"maxE",0,o,"minE",-o,0,"modulo",0,9],a=0;a<i.length;a+=3)if(t=i[a],n&&(this[t]=s[t]),void 0!==(r=e[t])){if(!(_(r)===r&&i[a+1]<=r&&r<=i[a+2]))throw Error(d+t+": "+r);this[t]=r}if(t="crypto",n&&(this[t]=s[t]),void 0!==(r=e[t])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(d+t+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");this[t]=!0}else this[t]=!1}return this}function se(e){return new this(e).cos()}function ue(e){return new this(e).cosh()}function ce(e,t){return new this(e).div(t)}function fe(e){return new this(e).exp()}function le(e){return q(e=new this(e),e.e+1,3)}function pe(){var e,t,r=new this(0);for(x=!1,e=0;e<arguments.length;)if((t=new this(arguments[e++])).d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return x=!0,new this(1/0);r=t}return x=!0,r.sqrt()}function me(e){return e instanceof f||e&&e.toStringTag===t||!1}function he(e){return new this(e).ln()}function de(e,t){return new this(e).log(t)}function ye(e){return new this(e).log(2)}function ge(e){return new this(e).log(10)}function ve(){return e(this,arguments,"lt")}function xe(){return e(this,arguments,"gt")}function be(e,t){return new this(e).mod(t)}function we(e,t){return new this(e).mul(t)}function Ne(e,t){return new this(e).pow(t)}function Me(e){var t,r,n,i,a=0,o=new this(1),s=[];if(void 0===e?e=this.precision:g(e,1,1e9),n=Math.ceil(e/7),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));a<n;)429e7<=(i=t[a])?t[a]=crypto.getRandomValues(new Uint32Array(1))[0]:s[a++]=i%1e7;else{if(!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");for(t=crypto.randomBytes(n*=4);a<n;)214e7<=(i=t[a]+(t[a+1]<<8)+(t[a+2]<<16)+((127&t[a+3])<<24))?crypto.randomBytes(4).copy(t,a):(s.push(i%1e7),a+=4);a=n/4}else for(;a<n;)s[a++]=1e7*Math.random()|0;for(e%=7,(n=s[--a])&&e&&(i=y(10,7-e),s[a]=(n/i|0)*i);0===s[a];a--)s.pop();if(a<0)s=[r=0];else{for(r=-1;0===s[0];r-=7)s.shift();for(n=1,i=s[0];10<=i;i/=10)n++;n<7&&(r-=7-n)}return o.e=r,o.d=s,o}function Ee(e){return q(e=new this(e),e.e+1,this.rounding)}function Se(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function Ae(e){return new this(e).sin()}function Oe(e){return new this(e).sinh()}function Ce(e){return new this(e).sqrt()}function Te(e,t){return new this(e).sub(t)}function _e(){var e=0,t=arguments,r=new this(t[e]);for(x=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return x=!0,q(r,this.precision,this.rounding)}function Ie(e){return new this(e).tan()}function ke(e){return new this(e).tanh()}function ze(e){return q(e=new this(e),e.e+1,1)}((f=function e(t){var r,n,i;function a(e){var t,r,n,i=this;if(!(i instanceof a))return new a(e);if(i.constructor=a,me(e))return i.s=e.s,void(x?!e.d||e.e>a.maxE?(i.e=NaN,i.d=null):e.e<a.minE?(i.e=0,i.d=[0]):(i.e=e.e,i.d=e.d.slice()):(i.e=e.e,i.d=e.d&&e.d.slice()));if("number"==(n=typeof e)){if(0===e)return i.s=1/e<0?-1:1,i.e=0,void(i.d=[0]);if(e<0?(e=-e,i.s=-1):i.s=1,e===~~e&&e<1e7){for(t=0,r=e;10<=r;r/=10)t++;return void(x?a.maxE<t?(i.e=NaN,i.d=null):t<a.minE?(i.e=0,i.d=[0]):(i.e=t,i.d=[e]):(i.e=t,i.d=[e]))}return 0*e!=0?(e||(i.s=NaN),i.e=NaN,void(i.d=null)):p(i,e.toString())}if("string"!=n)throw Error(d+e);return 45===(r=e.charCodeAt(0))?(e=e.slice(1),i.s=-1):(43===r&&(e=e.slice(1)),i.s=1),(F.test(e)?p:function(e,t){var r,n,i,a,o,s,u,c;if(-1<t.indexOf("_")){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),F.test(t))return p(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(j.test(t))r=16,t=t.toLowerCase();else if(D.test(t))r=2;else{if(!P.test(t))throw Error(d+t);r=8}for(o=0<=(a=(t=0<(a=t.search(/p/i))?(u=+t.slice(a+1),t.substring(2,a)):t.slice(2)).indexOf(".")),n=e.constructor,o&&(a=(s=(t=t.replace(".","")).length)-a,i=$(n,new n(r),a,2*a)),a=t=(c=v(t,r,I)).length-1;0===c[a];--a)c.pop();return a<0?new n(0*e.s):(e.e=E(c,t),e.d=c,x=!1,o&&(e=N(e,i,4*s)),u&&(e=e.times(Math.abs(u)<54?y(2,u):f.pow(2,u))),x=!0,e)})(i,e)}if(a.prototype=u,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.EUCLID=9,a.config=a.set=oe,a.clone=e,a.isDecimal=me,a.abs=W,a.acos=Y,a.acosh=J,a.add=X,a.asin=Q,a.asinh=K,a.atan=ee,a.atanh=te,a.atan2=re,a.cbrt=ne,a.ceil=ie,a.clamp=ae,a.cos=se,a.cosh=ue,a.div=ce,a.exp=fe,a.floor=le,a.hypot=pe,a.ln=he,a.log=de,a.log10=ge,a.log2=ye,a.max=ve,a.min=xe,a.mod=be,a.mul=we,a.pow=Ne,a.random=Me,a.round=Ee,a.sign=Se,a.sin=Ae,a.sinh=Oe,a.sqrt=Ce,a.sub=Te,a.sum=_e,a.tan=Ie,a.tanh=ke,a.trunc=ze,(t=void 0===t?{}:t)&&!0!==t.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],r=0;r<i.length;)t.hasOwnProperty(n=i[r++])||(t[n]=this[n]);return a.config(t),a}(s)).prototype.constructor=f).default=f.Decimal=f,n=new f(n),i=new f(i),void 0!==(De=function(){return f}.call(qe,Be,qe,Re))&&(Re.exports=De)}()},function(e,t,r){var n;!function(){"use strict";var d={s:1,n:0,d:1};function y(e,t){if(isNaN(e=parseInt(e,10)))throw g.InvalidParameter;return e*t}function s(e,t){if(0===t)throw g.DivisionByZero;var r=Object.create(g.prototype),n=(r.s=e<0?-1:1,i(e=e<0?-e:e,t));return r.n=e/n,r.d=t/n,r}function u(e){for(var t={},r=e,n=2,i=4;i<=r;){for(;r%n==0;)r/=n,t[n]=(t[n]||0)+1;i+=1+2*n++}return r!==e?1<r&&(t[r]=(t[r]||0)+1):t[e]=(t[e]||0)+1,t}function c(e,t){var r,n=0,i=1,a=1,o=0,s=0,u=0,c=1,f=1,l=0,p=1,m=1,h=1;if(null!=e)if(void 0!==t){if(a=(n=e)*(i=t),n%1!=0||i%1!=0)throw g.NonIntegerParameter}else switch(typeof e){case"object":if("d"in e&&"n"in e)n=e.n,i=e.d,"s"in e&&(n*=e.s);else{if(!(0 in e))throw g.InvalidParameter;n=e[0],1 in e&&(i=e[1])}a=n*i;break;case"number":if((e=e<0?-(a=e):e)%1==0)n=e;else if(0<e){for(1<=e&&(e/=f=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)));p<=1e7&&h<=1e7;){if(e===(r=(l+m)/(p+h))){i=p+h<=1e7?(n=l+m,p+h):p<h?(n=m,h):(n=l,p);break}r<e?(l+=m,p+=h):(m+=l,h+=p),i=1e7<p?(n=m,h):(n=l,p)}n*=f}else(isNaN(e)||isNaN(t))&&(i=n=NaN);break;case"string":if(null===(p=e.match(/\d+|./g)))throw g.InvalidParameter;if("-"===p[l]?(a=-1,l++):"+"===p[l]&&l++,p.length===l+1?s=y(p[l++],a):"."===p[l+1]||"."===p[l]?("."!==p[l]&&(o=y(p[l++],a)),(++l+1===p.length||"("===p[l+1]&&")"===p[l+3]||"'"===p[l+1]&&"'"===p[l+3])&&(s=y(p[l],a),c=Math.pow(10,p[l].length),l++),("("===p[l]&&")"===p[l+2]||"'"===p[l]&&"'"===p[l+2])&&(u=y(p[l+1],a),f=Math.pow(10,p[l+1].length)-1,l+=3)):"/"===p[l+1]||":"===p[l+1]?(s=y(p[l],a),c=y(p[l+2],1),l+=3):"/"===p[l+3]&&" "===p[l+1]&&(o=y(p[l],a),s=y(p[l+2],a),c=y(p[l+4],1),l+=5),p.length<=l){a=n=u+(i=c*f)*o+f*s;break}default:throw g.InvalidParameter}if(0===i)throw g.DivisionByZero;d.s=a<0?-1:1,d.n=Math.abs(n),d.d=Math.abs(i)}function i(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function g(e,t){if(c(e,t),!(this instanceof g))return s(d.s*d.n,d.d);e=i(d.d,d.n),this.s=d.s,this.n=d.n/e,this.d=d.d/e}g.DivisionByZero=new Error("Division by Zero"),g.InvalidParameter=new Error("Invalid argument"),g.NonIntegerParameter=new Error("Parameters must be integer"),g.prototype={s:1,n:0,d:1,abs:function(){return s(this.n,this.d)},neg:function(){return s(-this.s*this.n,this.d)},add:function(e,t){return c(e,t),s(this.s*this.n*d.d+d.s*this.d*d.n,this.d*d.d)},sub:function(e,t){return c(e,t),s(this.s*this.n*d.d-d.s*this.d*d.n,this.d*d.d)},mul:function(e,t){return c(e,t),s(this.s*d.s*this.n*d.n,this.d*d.d)},div:function(e,t){return c(e,t),s(this.s*d.s*this.n*d.d,this.d*d.n)},clone:function(){return s(this.s*this.n,this.d)},mod:function(e,t){if(isNaN(this.n)||isNaN(this.d))return new g(NaN);if(void 0===e)return s(this.s*this.n%this.d,1);if(c(e,t),0===d.n&&0===this.d)throw g.DivisionByZero;return s(this.s*(d.d*this.n)%(d.n*this.d),d.d*this.d)},gcd:function(e,t){return c(e,t),s(i(d.n,this.n)*i(d.d,this.d),d.d*this.d)},lcm:function(e,t){return c(e,t),0===d.n&&0===this.n?s(0,1):s(d.n*this.n,i(d.n,this.n)*i(d.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new g(NaN):s(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new g(NaN):s(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new g(NaN):s(Math.round(e*this.s*this.n/this.d),e)},inverse:function(){return s(this.s*this.d,this.n)},pow:function(e,t){if(c(e,t),1===d.d)return d.s<0?s(Math.pow(this.s*this.d,d.n),Math.pow(this.n,d.n)):s(Math.pow(this.s*this.n,d.n),Math.pow(this.d,d.n));if(this.s<0)return null;var r,n=u(this.n),i=u(this.d),a=1,o=1;for(r in n)if("1"!==r){if("0"===r){a=0;break}if(n[r]*=d.n,n[r]%d.d!=0)return null;n[r]/=d.d,a*=Math.pow(r,n[r])}for(r in i)if("1"!==r){if(i[r]*=d.n,i[r]%d.d!=0)return null;i[r]/=d.d,o*=Math.pow(r,i[r])}return d.s<0?s(o,a):s(a,o)},equals:function(e,t){return c(e,t),this.s*this.n*d.d==d.s*d.n*this.d},compare:function(e,t){c(e,t);e=this.s*this.n*d.d-d.s*d.n*this.d;return(0<e)-(e<0)},simplify:function(e){if(isNaN(this.n)||isNaN(this.d))return this;e=e||.001;for(var t=this.abs(),r=t.toContinued(),n=1;n<r.length;n++){for(var i=s(r[n-1],1),a=n-2;0<=a;a--)i=i.inverse().add(r[a]);if(i.sub(t).abs().valueOf()<e)return i.mul(this.s)}return this},divisible:function(e,t){return c(e,t),!(!(d.n*this.d)||this.n*d.d%(d.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(e){var t="",r=this.n,n=this.d;return this.s<0&&(t+="-"),1===n?t+=r:(e&&0<(e=Math.floor(r/n))&&(t=t+e+" ",r%=n),t=(t+=r)+"/"+n),t},toLatex:function(e){var t="",r=this.n,n=this.d;return this.s<0&&(t+="-"),1===n?t+=r:(e&&0<(e=Math.floor(r/n))&&(t+=e,r%=n),t=(t=(t+="\\frac{")+r+"}{")+n+"}"),t},toContinued:function(){var e,t=this.n,r=this.d,n=[];if(isNaN(t)||isNaN(r))return n;for(;n.push(Math.floor(t/r)),e=t%r,t=r,r=e,1!==t;);return n},toString:function(e){var t=this.n,r=this.d;if(isNaN(t)||isNaN(r))return"NaN";e=e||15;var i=function(e){for(;e%2==0;e/=2);for(;e%5==0;e/=5);if(1===e)return 0;for(var t=10%e,r=1;1!==t;r++)if(t=10*t%e,2e3<r)return 0;return r}(r),n=function(e){for(var t=1,r=function(e,t,r){for(var n=1;0<t;e=e*e%r,t>>=1)1&t&&(n=n*e%r);return n}(10,i,e),n=0;n<300;n++){if(t===r)return n;t=10*t%e,r=10*r%e}return 0}(r),a=this.s<0?"-":"";if(a+=t/r|0,(t=t%r*10)&&(a+="."),i){for(var o=n;o--;)a+=t/r|0,t=t%r*10;for(a+="(",o=i;o--;)a+=t/r|0,t=t%r*10;a+=")"}else for(o=e;t&&o--;)a+=t/r|0,t=t%r*10;return a}},void 0!==(n=function(){return g}.apply(t,[]))&&(e.exports=n)}()},function(e,t){e.exports=function t(e,r){"use strict";function n(e){return t.insensitive&&(""+e).toLowerCase()||""+e}var i,a,o=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,s=/(^[ ]*|[ ]*$)/g,u=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,c=/^0x[0-9a-f]+$/i,f=/^0/,e=n(e).replace(s,"")||"",r=n(r).replace(s,"")||"",l=e.replace(o,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),p=r.replace(o,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),s=parseInt(e.match(c),16)||1!==l.length&&e.match(u)&&Date.parse(e),o=parseInt(r.match(c),16)||s&&r.match(u)&&Date.parse(r)||null;if(o){if(s<o)return-1;if(o<s)return 1}for(var m=0,h=Math.max(l.length,p.length);m<h;m++){if(i=!(l[m]||"").match(f)&&parseFloat(l[m])||l[m]||0,a=!(p[m]||"").match(f)&&parseFloat(p[m])||p[m]||0,isNaN(i)!==isNaN(a))return isNaN(i)?1:-1;if(typeof i!=typeof a&&(i+="",a+=""),i<a)return-1;if(a<i)return 1}return 0}},function(e,t,r){var n=r(79),r=r(7);e.exports=!!Object.getOwnPropertySymbols&&!r(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41})},function(e,t,r){var n=r(54);e.exports=function(e,t){e=e[t];return null==e?void 0:n(e)}},function(e,t,r){var n=r(50),i=r(110);(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.22.7",mode:n?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.22.7/LICENSE",source:"https://github.com/zloirock/core-js"})},function(e,t,r){var n=r(146),i=r(112).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},function(e,t,r){var n=r(9),i=r(54),a=r(94),o=n(n.bind);e.exports=function(e,t){return i(e),void 0===t?e:a?o(e,t):function(){return e.apply(t,arguments)}}},function(e,t,r){function n(){}function i(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t}var a,o=r(23),s=r(158),u=r(112),c=r(82),f=r(159),l=r(97),p=r(99)("IE_PROTO"),m=function(e){return"<script>"+e+"<\/script>"},h=function(){try{a=new ActiveXObject("htmlfile")}catch(e){}var e,t;h="undefined"==typeof document||document.domain&&a?i(a):((t=l("iframe")).style.display="none",f.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(m("document.F=Object")),e.close(),e.F);for(var r=u.length;r--;)delete h.prototype[u[r]];return h()};c[p]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(n.prototype=o(e),r=new n,n.prototype=null,r[p]=e):r=h(),void 0===t?r:s.f(r,t)}},function(e,t,r){"use strict";var n=r(95),i=r(25),a=r(77);e.exports=function(e,t,r){t=n(t);t in e?i.f(e,t,a(0,r)):e[t]=r}},function(e,t,r){"use strict";var N=r(106),i=r(17),n=r(9),a=r(124),o=r(7),M=r(23),E=r(12),S=r(61),A=r(100),O=r(28),s=r(49),C=r(125),u=r(67),T=r(217),_=r(127),c=r(15)("replace"),I=Math.max,k=Math.min,z=n([].concat),R=n([].push),q=n("".indexOf),B=n("".slice),r="$0"==="a".replace(/./,"$0"),f=!!/./[c]&&""===/./[c]("a","$0");a("replace",function(e,x,b){var w=f?"$":"$0";return[function(e,t){var r=s(this),n=null==e?void 0:u(e,c);return n?i(n,e,r,t):i(x,O(r),e,t)},function(e,t){var r=M(this),n=O(e);if("string"==typeof t&&-1===q(t,w)&&-1===q(t,"$<")){e=b(x,r,n,t);if(e.done)return e.value}var i,a=E(t),o=(a||(t=O(t)),r.global);o&&(i=r.unicode,r.lastIndex=0);for(var s=[];;){var u=_(r,n);if(null===u)break;if(R(s,u),!o)break;""===O(u[0])&&(r.lastIndex=C(n,A(r.lastIndex),i))}for(var c,f="",l=0,p=0;p<s.length;p++){for(var m=O((u=s[p])[0]),h=I(k(S(u.index),n.length),0),d=[],y=1;y<u.length;y++)R(d,void 0===(c=u[y])?c:String(c));var g=u.groups,v=a?(v=z([m],d,h,n),void 0!==g&&R(v,g),O(N(t,void 0,v))):T(m,n,h,d,g,t);l<=h&&(f+=B(n,l,h)+v,l=h+m.length)}return f+B(n,l)}]},!!o(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})||!r||f)},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(t,e){!function(e){t.exports=e}.call(this,{})},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,r){var n=r(1),i=r(40),a=r(12),o=r(53),r=r(140),s=n.Object;e.exports=r?function(e){return"symbol"==typeof e}:function(e){var t=i("Symbol");return a(t)&&o(t.prototype,s(e))}},function(e,t,r){var n,i,a=r(1),r=r(60),o=a.process,a=a.Deno,o=o&&o.versions||a&&a.version,a=o&&o.v8;!(i=a?0<(n=a.split("."))[0]&&n[0]<4?1:+(n[0]+n[1]):i)&&r&&(!(n=r.match(/Edge\/(\d+)/))||74<=n[1])&&(n=r.match(/Chrome\/(\d+)/))&&(i=+n[1]),e.exports=i},function(e,t,r){var n=r(1).String;e.exports=function(e){try{return n(e)}catch(e){return"Object"}}},function(e,t,r){var n=r(19),r=r(22),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,r=r(i,"name"),o=r&&"something"===function(){}.name,n=r&&(!n||a(i,"name").configurable);e.exports={EXISTS:r,PROPER:o,CONFIGURABLE:n}},function(e,t){e.exports={}},function(e,t,r){var n=r(61),i=Math.max,a=Math.min;e.exports=function(e,t){e=n(e);return e<0?i(e+t,0):a(e,t)}},function(e,t,r){function n(e,t){return(e=u[s(e)])==f||e!=c&&(a(t)?i(t):!!t)}var i=r(7),a=r(12),o=/#|\.prototype\./,s=n.normalize=function(e){return String(e).replace(o,".").toLowerCase()},u=n.data={},c=n.NATIVE="N",f=n.POLYFILL="P";e.exports=n},function(e,t,r){function n(p){var m=1==p,h=2==p,d=3==p,y=4==p,g=6==p,v=7==p,x=5==p||g;return function(e,t,r,n){for(var i,a,o=N(e),s=w(o),u=b(t,r),c=M(s),f=0,t=n||E,l=m?t(e,c):h||v?t(e,0):void 0;f<c;f++)if((x||f in s)&&(a=u(i=s[f],f,o),p))if(m)l[f]=a;else if(a)switch(p){case 3:return!0;case 5:return i;case 6:return f;case 2:S(l,i)}else switch(p){case 4:return!1;case 7:S(l,i)}return g?-1:d||y?y:l}}var b=r(70),i=r(9),w=r(109),N=r(37),M=r(47),E=r(116),S=i([].push);e.exports={forEach:n(0),map:n(1),filter:n(2),some:n(3),every:n(4),find:n(5),findIndex:n(6),filterReject:n(7)}},function(e,t,r){var n=r(7),i=r(15),a=r(79),o=i("species");e.exports=function(t){return 51<=a||!n(function(){var e=[];return(e.constructor={})[o]=function(){return{foo:1}},1!==e[t](Boolean).foo})}},function(e,t,r){"use strict";var i=r(17),n=r(124),c=r(23),f=r(100),l=r(28),a=r(49),o=r(67),p=r(125),m=r(127);n("match",function(n,s,u){return[function(e){var t=a(this),r=null==e?void 0:o(e,n);return r?i(r,e,t):new RegExp(e)[n](l(t))},function(e){var t=c(this),r=l(e),e=u(s,t,r);if(e.done)return e.value;if(!t.global)return m(t,r);for(var n=t.unicode,i=[],a=t.lastIndex=0;null!==(o=m(t,r));){var o=l(o[0]);""===(i[a]=o)&&(t.lastIndex=p(r,f(t.lastIndex),n)),a++}return 0===a?null:i}]})},function(e,t,r){"use strict";var n=r(3),i=r(225);n({target:"String",proto:!0,forced:r(226)("sub")},{sub:function(){return i(this,"sub","","")}})},function(e,t){e.exports={}},function(e,t,r){var n=r(25).f,i=r(22),a=r(15)("toStringTag");e.exports=function(e,t,r){(e=e&&!r?e.prototype:e)&&!i(e,a)&&n(e,a,{configurable:!0,value:t})}},function(e,t,r){r=r(1);e.exports=r.Promise},function(e,t,r){var n=r(1),i=r(91),a=r(12),o=r(84),s=r(98),u=r(15),c=r(248),f=r(50),l=r(79),p=i&&i.prototype,m=u("species"),h=!1,d=a(n.PromiseRejectionEvent),r=o("Promise",function(){var e=s(i),t=e!==String(i);if(!t&&66===l)return!0;if(f&&(!p.catch||!p.finally))return!0;if(51<=l&&/native code/.test(e))return!1;function r(e){e(function(){},function(){})}e=new i(function(e){e(1)});return(e.constructor={})[m]=r,!(h=e.then(function(){})instanceof r)||!t&&c&&!d});e.exports={CONSTRUCTOR:r,REJECTION_EVENT:d,SUBCLASSING:h}},function(e,t,r){"use strict";function n(e){var r,n;this.promise=new e(function(e,t){if(void 0!==r||void 0!==n)throw TypeError("Bad Promise constructor");r=e,n=t}),this.resolve=i(r),this.reject=i(n)}var i=r(54);e.exports.f=function(e){return new n(e)}},function(e,t,r){r=r(7);e.exports=!r(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})},function(e,t,r){var n=r(139),i=r(78);e.exports=function(e){e=n(e,"string");return i(e)?e:e+""}},function(e,t,r){var r=r(9),n=0,i=Math.random(),a=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++n+i,36)}},function(e,t,r){var n=r(1),r=r(24),i=n.document,a=r(i)&&r(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},function(e,t,r){var n=r(9),i=r(12),r=r(110),a=n(Function.toString);i(r.inspectSource)||(r.inspectSource=function(e){return a(e)}),e.exports=r.inspectSource},function(e,t,r){var n=r(68),i=r(96),a=n("keys");e.exports=function(e){return a[e]||(a[e]=i(e))}},function(e,t,r){var n=r(61),i=Math.min;e.exports=function(e){return 0<e?i(n(e),9007199254740991):0}},function(e,t,r){var n=r(1),i=r(115),a=r(12),o=r(45),s=r(15)("toStringTag"),u=n.Object,c="Arguments"==o(function(){return arguments}());e.exports=i?o:function(e){var t;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(t=function(e,t){try{return e[t]}catch(e){}}(e=u(e),s))?t:c?o(e):"Object"==(t=o(e))&&a(e.callee)?"Arguments":t}},function(e,t,r){var n=r(45);e.exports=Array.isArray||function(e){return"Array"==n(e)}},function(e,t,r){function n(){}function i(e){if(!u(e))return!1;try{return m(n,p,e),!0}catch(e){return!1}}function a(e){if(!u(e))return!1;switch(c(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return y||!!d(h,l(e))}catch(e){return!0}}var o=r(9),s=r(7),u=r(12),c=r(101),f=r(40),l=r(98),p=[],m=f("Reflect","construct"),h=/^\s*(?:class|function)\b/,d=o(h.exec),y=!h.exec(n);a.sham=!0,e.exports=!m||s(function(){var e;return i(i.call)||!i(Object)||!i(function(){e=!0})||e})?a:i},function(e,t,r){var n=r(7),i=r(1).RegExp,r=n(function(){var e=i("a","y");return e.lastIndex=2,null!=e.exec("abcd")}),a=r||n(function(){return!i("a","y").sticky}),n=r||n(function(){var e=i("^r","gy");return e.lastIndex=2,null!=e.exec("str")});e.exports={BROKEN_CARET:n,MISSED_STICKY:a,UNSUPPORTED_Y:r}},function(e,t,r){"use strict";var h=r(17),n=r(9),d=r(28),y=r(154),i=r(104),a=r(68),g=r(71),v=r(46).get,o=r(122),r=r(155),x=a("native-string-replace",String.prototype.replace),b=RegExp.prototype.exec,w=b,N=n("".charAt),M=n("".indexOf),E=n("".replace),S=n("".slice),A=(a=/b*/g,h(b,n=/a/,"a"),h(b,a,"a"),0!==n.lastIndex||0!==a.lastIndex),O=i.BROKEN_CARET,C=void 0!==/()??/.exec("")[1];(A||C||O||o||r)&&(w=function(e){var t,r,n,i,a,o,s=this,u=v(s),e=d(e),c=u.raw;if(c)return c.lastIndex=s.lastIndex,l=h(w,c,e),s.lastIndex=c.lastIndex,l;var f=u.groups,c=O&&s.sticky,l=h(y,s),u=s.source,p=0,m=e;if(c&&(l=E(l,"y",""),-1===M(l,"g")&&(l+="g"),m=S(e,s.lastIndex),0<s.lastIndex&&(!s.multiline||s.multiline&&"\n"!==N(e,s.lastIndex-1))&&(u="(?: "+u+")",m=" "+m,p++),t=new RegExp("^(?:"+u+")",l)),C&&(t=new RegExp("^"+u+"$(?!\\s)",l)),A&&(r=s.lastIndex),n=h(b,c?t:s,m),c?n?(n.input=S(n.input,p),n[0]=S(n[0],p),n.index=s.lastIndex,s.lastIndex+=n[0].length):s.lastIndex=0:A&&n&&(s.lastIndex=s.global?n.index+n[0].length:r),C&&n&&1<n.length&&h(x,n[0],t,function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(n[i]=void 0)}),n&&f)for(n.groups=a=g(null),i=0;i<f.length;i++)a[(o=f[i])[0]]=n[o[1]];return n}),e.exports=w},function(e,t,r){var r=r(94),n=Function.prototype,i=n.apply,a=n.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(i):function(){return a.apply(i,arguments)})},function(e,t){var r=Math.expm1,n=Math.exp;e.exports=!r||22025.465794806718<r(10)||r(10)<22025.465794806718||-2e-17!=r(-2e-17)?function(e){e=+e;return 0==e?e:-1e-6<e&&e<1e-6?e+e*e/2:n(e)-1}:r},function(e,t,r){function y(e,t){this.stopped=e,this.result=t}var n=r(1),g=r(70),v=r(17),x=r(23),b=r(80),w=r(176),N=r(47),M=r(53),E=r(177),S=r(130),A=r(178),O=n.TypeError,C=y.prototype;e.exports=function(e,t,r){function n(e){return a&&A(a,"normal",e),new y(!0,e)}function i(e){return p?(x(e),h?d(e[0],e[1],n):d(e[0],e[1])):h?d(e,n):d(e)}var a,o,s,u,c,f,l=r&&r.that,p=!(!r||!r.AS_ENTRIES),m=!(!r||!r.IS_ITERATOR),h=!(!r||!r.INTERRUPTED),d=g(t,l);if(m)a=e;else{if(!(r=S(e)))throw O(b(e)+" is not iterable");if(w(r)){for(o=0,s=N(e);o<s;o++)if((u=i(e[o]))&&M(C,u))return u;return new y(!1)}a=E(e,r)}for(c=a.next;!(f=v(c,a)).done;){try{u=i(f.value)}catch(e){A(a,"throw",e)}if("object"==typeof u&&u&&M(C,u))return u}return new y(!1)}},function(e,t,r){var n=r(1),i=r(9),a=r(7),o=r(45),s=n.Object,u=i("".split);e.exports=a(function(){return!s("z").propertyIsEnumerable(0)})?function(e){return"String"==o(e)?u(e,""):s(e)}:s},function(e,t,r){var n=r(1),r=r(111),n=n["__core-js_shared__"]||r("__core-js_shared__",{});e.exports=n},function(e,t,r){var n=r(1),i=Object.defineProperty;e.exports=function(t,r){try{i(n,t,{value:r,configurable:!0,writable:!0})}catch(e){n[t]=r}return r}},function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,r){var n=r(146),i=r(112);e.exports=Object.keys||function(e){return n(e,i)}},function(e,t,r){var n={};n[r(15)("toStringTag")]="z",e.exports="[object z]"===String(n)},function(e,t,r){var n=r(203);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},function(e,t,r){"use strict";var n=r(7);e.exports=function(e,t){var r=[][e];return!!r&&n(function(){r.call(null,t||function(){return 1},1)})}},function(e,t,r){var n=r(1),i=r(22),a=r(12),o=r(37),s=r(99),r=r(150),u=s("IE_PROTO"),c=n.Object,f=c.prototype;e.exports=r?c.getPrototypeOf:function(e){e=o(e);if(i(e,u))return e[u];var t=e.constructor;return a(t)&&e instanceof t?t.prototype:e instanceof c?f:null}},function(e,t,r){var n=r(12),i=r(24),a=r(120);e.exports=function(e,t,r){return a&&n(t=t.constructor)&&t!==r&&i(t=t.prototype)&&t!==r.prototype&&a(e,t),e}},function(e,t,r){var i=r(9),a=r(23),o=r(204);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r,n=!1,e={};try{(r=i(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(e,[]),n=e instanceof Array}catch(r){}return function(e,t){return a(e),o(t),n?r(e,t):e.__proto__=t,e}}():void 0)},function(e,t,r){"use strict";var n=r(40),i=r(25),a=r(15),o=r(19),s=a("species");e.exports=function(e){var e=n(e),t=i.f;o&&e&&!e[s]&&t(e,s,{configurable:!0,get:function(){return this}})}},function(e,t,r){var n=r(7),i=r(1).RegExp;e.exports=n(function(){var e=i(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})},function(e,t,r){r=r(9);e.exports=r([].slice)},function(e,t,r){"use strict";r(10);var u=r(9),c=r(35),f=r(105),l=r(7),p=r(15),m=r(55),h=p("species"),d=RegExp.prototype;e.exports=function(r,e,t,n){var o,i=p(r),s=!l(function(){var e={};return e[i]=function(){return 7},7!=""[r](e)}),a=s&&!l(function(){var e=!1,t=/a/;return"split"===r&&((t={}).constructor={},t.constructor[h]=function(){return t},t.flags="",t[i]=/./[i]),t.exec=function(){return e=!0,null},t[i](""),!e});s&&a&&!t||(o=u(/./[i]),a=e(i,""[r],function(e,t,r,n,i){var e=u(e),a=t.exec;return a===f||a===d.exec?s&&!i?{done:!0,value:o(t,r,n)}:{done:!0,value:e(r,t,n)}:{done:!1}}),c(String.prototype,r,a[0]),c(d,i,a[1])),n&&m(d[i],"sham",!0)}},function(e,t,r){"use strict";var n=r(162).charAt;e.exports=function(e,t,r){return t+(r?n(e,t).length:1)}},function(e,t,r){var n=r(1),u=r(83),c=r(47),f=r(72),l=n.Array,p=Math.max;e.exports=function(e,t,r){for(var n=c(e),i=u(t,n),a=u(void 0===r?n:r,n),o=l(p(a-i,0)),s=0;i<a;i++,s++)f(o,s,e[i]);return o.length=s,o}},function(e,t,r){var n=r(1),i=r(17),a=r(23),o=r(12),s=r(45),u=r(105),c=n.TypeError;e.exports=function(e,t){var r=e.exec;if(o(r))return null!==(r=i(r,e,t))&&a(r),r;if("RegExp"===s(e))return i(u,e,t);throw c("RegExp#exec called on incompatible receiver")}},function(e,t,r){var n=r(15),i=r(71),r=r(25).f,a=n("unscopables"),o=Array.prototype;null==o[a]&&r(o,a,{configurable:!0,value:i(null)}),e.exports=function(e){o[a][e]=!0}},function(e,t,r){"use strict";function d(){return this}var y=r(3),g=r(17),v=r(50),n=r(81),x=r(12),b=r(227),w=r(118),N=r(120),M=r(90),E=r(55),S=r(35),i=r(15),A=r(89),r=r(171),O=n.PROPER,C=n.CONFIGURABLE,T=r.IteratorPrototype,_=r.BUGGY_SAFARI_ITERATORS,I=i("iterator");e.exports=function(e,t,r,n,i,a,o){b(r,t,n);function s(e){if(e===i&&m)return m;if(!_&&e in l)return l[e];switch(e){case"keys":case"values":case"entries":return function(){return new r(this,e)}}return function(){return new r(this)}}var u,c,n=t+" Iterator",f=!1,l=e.prototype,p=l[I]||l["@@iterator"]||i&&l[i],m=!_&&p||s(i),h="Array"==t&&l.entries||p;if(h&&(h=w(h.call(new e)))!==Object.prototype&&h.next&&(v||w(h)===T||(N?N(h,T):x(h[I])||S(h,I,d)),M(h,n,!0,!0),v&&(A[n]=d)),O&&"values"==i&&p&&"values"!==p.name&&(!v&&C?E(l,"name","values"):(f=!0,m=function(){return g(p,this)})),i)if(u={values:s("values"),keys:a?m:s("keys"),entries:s("entries")},o)for(c in u)!_&&!f&&c in l||S(l,c,u[c]);else y({target:t,proto:!0,forced:_||f},u);return v&&!o||l[I]===m||S(l,I,m,{name:i}),A[t]=m,u}},function(e,t,r){var n=r(101),i=r(67),a=r(89),o=r(15)("iterator");e.exports=function(e){if(null!=e)return i(e,o)||i(e,"@@iterator")||a[n(e)]}},function(e,t,r){var n=r(1),i=r(53),a=n.TypeError;e.exports=function(e,t){if(i(t,e))return e;throw a("Incorrect invocation")}},function(e,t,r){var i=r(15)("iterator"),a=!1;try{var n=0,o={next:function(){return{done:!!n++}},return:function(){a=!0}};o[i]=function(){return this},Array.from(o,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!a)return!1;var r=!1;try{var n={};n[i]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r}},function(e,t,r){var n=r(45),r=r(1);e.exports="process"==n(r.process)},function(e,t){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},function(e,t,r){var n=r(3),i=r(264),r=r(128);n({target:"Array",proto:!0},{fill:i}),r("fill")},function(e,t,r){"use strict";var n;void 0!==(t="function"==typeof(n=function(){function g(){return!0}function se(){return!1}function ue(){}return function e(){var t=[{name:"number",test:function(e){return"number"==typeof e}},{name:"string",test:function(e){return"string"==typeof e}},{name:"boolean",test:function(e){return"boolean"==typeof e}},{name:"Function",test:function(e){return"function"==typeof e}},{name:"Array",test:Array.isArray},{name:"Date",test:function(e){return e instanceof Date}},{name:"RegExp",test:function(e){return e instanceof RegExp}},{name:"Object",test:function(e){return"object"==typeof e&&null!==e&&e.constructor===Object}},{name:"null",test:function(e){return null===e}},{name:"undefined",test:function(e){return void 0===e}}],r={name:"any",test:g},n=[],i=[],U={types:t,conversions:i,ignore:n};function L(t){var e=ie(U.types,function(e){return e.name===t});if(e)return e;if("any"===t)return r;e=ie(U.types,function(e){return e.name.toLowerCase()===t.toLowerCase()});throw new TypeError('Unknown type "'+t+'"'+(e?'. Did you mean "'+e.name+'"?':""))}function $(e){return e===r?999:U.types.indexOf(e)}function f(t){var e=ie(U.types,function(e){return e.test(t)});if(e)return e.name;throw new TypeError("Value has unknown type. Value: "+t)}function H(e){return e.map(function(e){var t=e.types.map(a);return(e.restParam?"...":"")+t.join("|")}).join(",")}function G(e){e=re(e);return!!e&&e.restParam}function V(e){return e.types.some(function(e){return null!=e.conversion})}function Z(e){if(e&&0!==e.types.length){if(1===e.types.length)return L(e.types[0].name).test;var t,r;if(2===e.types.length)return t=L(e.types[0].name).test,r=L(e.types[1].name).test,function(e){return t(e)||r(e)};var n=e.types.map(function(e){return L(e.name).test});return function(e){for(var t=0;t<n.length;t++)if(n[t](e))return!0;return!1}}return g}function l(e,t){return t<e.params.length?e.params[t]:G(e.params)?re(e.params):null}function W(e,t,r){e=l(e,t);return(e?r?e.types.filter(s):e.types:[]).map(a)}function a(e){return e.name}function s(e){return null===e.conversion||void 0===e.conversion}function p(e,t){e=function(e){for(var t={},r=0;r<e.length;r++)t[e[r]]=!0;return Object.keys(t)}(ae(e,function(e){return W(e,t,!1)}));return-1!==e.indexOf("any")?["any"]:e}function o(e,r,t){for(var n,i,a=e||"unnamed",o=t,s=0;s<r.length;s++){var u,c=o.filter(function(e){var t=Z(l(e,s));return(s<e.params.length||G(e.params))&&t(r[s])});if(0===c.length){if(0<(i=p(o,s)).length)return u=f(r[s]),(n=new TypeError("Unexpected type of argument in function "+a+" (expected: "+i.join(" or ")+", actual: "+u+", index: "+s+")")).data={category:"wrongType",fn:a,index:s,actual:u,expected:i},n}else o=c}e=o.map(function(e){return G(e.params)?1/0:e.params.length});if(r.length<Math.min.apply(null,e))return i=p(o,s),(n=new TypeError("Too few arguments in function "+a+" (expected: "+i.join(" or ")+", index: "+r.length+")")).data={category:"tooFewArgs",fn:a,index:r.length,expected:i},n;t=Math.max.apply(null,e);return r.length>t?(n=new TypeError("Too many arguments in function "+a+" (expected: "+t+", actual: "+r.length+")")).data={category:"tooManyArgs",fn:a,index:r.length,expectedLength:t}:(n=new TypeError('Arguments of type "'+r.join(", ")+'" do not match any of the defined signatures of function '+a+".")).data={category:"mismatch",actual:r.map(f)},n}function u(e){for(var t=999,r=0;r<e.types.length;r++)s(e.types[r])&&(t=Math.min(t,e.types[r].typeIndex));return t}function c(e){for(var t=999,r=0;r<e.types.length;r++)s(e.types[r])||(t=Math.min(t,e.types[r].conversionIndex));return t}function Y(e,t){var r,n,i,a,o,s=Math.min(e.params.length,t.params.length);if(0!=(n=e.params.some(V)-t.params.some(V)))return n;for(r=0;r<s;r++)if(0!=(n=V(e.params[r])-V(t.params[r])))return n;for(r=0;r<s;r++)if(0!==(i=e.params[r],a=t.params[r],o=void 0,n=0!=(o=i.restParam-a.restParam)||0!=(o=V(i)-V(a))||0!=(o=u(i)-u(a))?o:c(i)-c(a)))return n;return e.params.length-t.params.length}function J(e){var t,r,n,i,a=[],o=[];switch(e.types.forEach(function(e){e.conversion&&(a.push(L(e.conversion.from).test),o.push(e.conversion.convert))}),o.length){case 0:return function(e){return e};case 1:return t=a[0],n=o[0],function(e){return t(e)?n(e):e};case 2:return t=a[0],r=a[1],n=o[0],i=o[1],function(e){return t(e)?n(e):r(e)?i(e):e};default:return function(e){for(var t=0;t<o.length;t++)if(a[t](e))return o[t](e);return e}}}function X(e,o){return function t(r,n,i){var e,a;return n<r.length?(a=r[n],e=o?a.types.filter(s):a.types,ae(a.restParam?(a=e.filter(s)).length<e.length?[a,e]:[e]:e.map(function(e){return[e]}),function(e){return t(r,n+1,i.concat([e]))})):[i.map(function(e,t){return{types:e,restParam:t===r.length-1&&G(r)}})]}(e,0,[])}function m(r,n){if(0===Object.keys(n).length)throw new SyntaxError("No signatures provided");function i(e,t){return(arguments.length===z&&h(e)&&b(t)?O:arguments.length===R&&d(e)&&w(t)?C:arguments.length===q&&y(e)&&N(t)?T:arguments.length===B&&g(e)&&M(t)?_:arguments.length===D&&v(e)&&E(t)?I:arguments.length===j&&x(e)&&S(t)?k:function(){for(var e=P;e<F;e++)if(m[e](arguments))return A[e].apply(this,arguments);return U.onMismatch(r,arguments,o)}).apply(i,arguments)}var a,t=[],o=(Object.keys(n).map(function(e){return t=n[e=e],c=U.conversions,r=[],(r=""!==e.trim()?e.split(",").map(K).map(function(e,t,r){n=c,u=((o=0===(u=e).indexOf("..."))?3<u.length?u.slice(3):"any":u).split("|").map(K).filter(ee).filter(Q),i=u,a={},n.forEach(function(e){-1!==i.indexOf(e.from)||-1===i.indexOf(e.to)||a[e.from]||(a[e.from]=e)}),s=Object.keys(a).map(function(e){return a[e]}),u=u.map(function(e){var t=L(e);return{name:e,typeIndex:$(t),test:t.test,conversion:null,conversionIndex:-1}}),s=s.map(function(e){var t=L(e.from);return{name:e.from,typeIndex:$(t),test:t.test,conversion:e,conversionIndex:n.indexOf(e)}});var n,i,a,o,s,u={types:u.concat(s),restParam:o};if(u.restParam&&t!==r.length-1)throw new SyntaxError('Unexpected rest parameter "'+e+'": only allowed for the last parameter');return u}):r).some(oe)?null:{params:r,fn:t};var t,c,r}).filter(te).forEach(function(u){var e=ie(t,function(e){for(var t=e,r=u,n=Math.max(t.params.length,r.params.length),i=0;i<n;i++)if(!function(e,t){for(var r,n=0;n<e.length;n++)if(r=e[n],-1!==t.indexOf(r))return 1;return}(W(t,i,!0),W(r,i,!0)))return;var e=t.params.length,a=r.params.length,o=G(t.params),s=G(r.params);return o?s?e===a:e<=a:s?a<=e:e===a});if(e)throw new TypeError('Conflicting signatures "'+H(e.params)+'" and "'+H(u.params)+'".');t.push(u)}),ae(t,function(t){return(t?X(t.params,!1):[]).map(function(e){return{params:e,fn:t.fn}})}).filter(te)),e=(o.sort(Y),o[0]&&o[0].params.length<=2&&!G(o[0].params)),s=o[1]&&o[1].params.length<=2&&!G(o[1].params),u=o[2]&&o[2].params.length<=2&&!G(o[2].params),c=o[3]&&o[3].params.length<=2&&!G(o[3].params),f=o[4]&&o[4].params.length<=2&&!G(o[4].params),l=o[5]&&o[5].params.length<=2&&!G(o[5].params),p=e&&s&&u&&c&&f&&l,m=o.map(function(e){return G(e=e.params)?(i=(r=e.slice(0,e.length-1).map(Z)).length,a=Z(re(e)),function(e){for(var t=0;t<r.length;t++)if(!r[t](e[t]))return!1;return function(e){for(var t=i;t<e.length;t++)if(!a(e[t]))return!1;return!0}(e)&&e.length>=i+1}):0===e.length?function(e){return 0===e.length}:1===e.length?(t=Z(e[0]),function(e){return t(e[0])&&1===e.length}):2===e.length?(t=Z(e[0]),n=Z(e[1]),function(e){return t(e[0])&&n(e[1])&&2===e.length}):(r=e.map(Z),function(e){for(var t=0;t<r.length;t++)if(!r[t](e[t]))return!1;return e.length===r.length});var r,t,n,i,a}),h=e?Z(o[0].params[0]):se,d=s?Z(o[1].params[0]):se,y=u?Z(o[2].params[0]):se,g=c?Z(o[3].params[0]):se,v=f?Z(o[4].params[0]):se,x=l?Z(o[5].params[0]):se,b=e?Z(o[0].params[1]):se,w=s?Z(o[1].params[1]):se,N=u?Z(o[2].params[1]):se,M=c?Z(o[3].params[1]):se,E=f?Z(o[4].params[1]):se,S=l?Z(o[5].params[1]):se,A=o.map(function(e){return t=e.params,n=e.fn,o=n,t.some(V)&&(i=G(t),a=t.map(J),o=function(){for(var e=[],t=i?arguments.length-1:arguments.length,r=0;r<t;r++)e[r]=a[r](arguments[r]);return i&&(e[t]=arguments[t].map(a[t])),n.apply(this,e)}),e=o,G(t)&&(r=t.length-1,e=function(){return o.apply(this,ne(arguments,0,r).concat([ne(arguments,r)]))}),e;var t,n,i,a,r,o}),O=e?A[0]:ue,C=s?A[1]:ue,T=u?A[2]:ue,_=c?A[3]:ue,I=f?A[4]:ue,k=l?A[5]:ue,z=e?o[0].params.length:-1,R=s?o[1].params.length:-1,q=u?o[2].params.length:-1,B=c?o[3].params.length:-1,D=f?o[4].params.length:-1,j=l?o[5].params.length:-1,P=p?6:0,F=o.length;try{Object.defineProperty(i,"name",{value:r})}catch(r){}return i.signatures=(a={},o.forEach(function(t){t.params.some(V)||X(t.params,!0).forEach(function(e){a[H(e)]=t.fn})}),a),i}function h(e,t,r){throw o(e,t,r)}function Q(e){return-1===U.ignore.indexOf(e)}function K(e){return e.trim()}function ee(e){return!!e}function te(e){return null!==e}function oe(e){return 0===e.types.length}function re(e){return e[e.length-1]}function ne(e,t,r){return Array.prototype.slice.call(e,t,r)}function ie(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}function ae(e,t){return Array.prototype.concat.apply([],e.map(t))}function d(e){for(var t="",r=0;r<e.length;r++){var n,i=e[r];if(("object"==typeof i.signatures||"string"==typeof i.signature)&&""!==i.name)if(""===t)t=i.name;else if(t!==i.name)throw(n=new Error("Function names do not match (expected: "+t+", actual: "+i.name+")")).data={actual:i.name,expected:t},n}return t}function y(e){var r,n={};function t(e,t){if(n.hasOwnProperty(e)&&t!==n[e])throw(r=new Error('Signature "'+e+'" is defined twice')).data={signature:e},r}for(var i=0;i<e.length;i++){var a=e[i];if("object"==typeof a.signatures)for(var o in a.signatures)a.signatures.hasOwnProperty(o)&&(t(o,a.signatures[o]),n[o]=a.signatures[o]);else{if("string"!=typeof a.signature)throw(r=new TypeError("Function is no typed-function (index: "+i+")")).data={index:i},r;t(a.signature,a),n[a.signature]=a}}return n}return(U=m("typed",{"string, Object":m,Object:function(e){var t,r=[];for(t in e)e.hasOwnProperty(t)&&r.push(e[t]);return m(d(r),e)},"...Function":function(e){return m(d(e),y(e))},"string, ...Function":function(e,t){return m(e,y(t))}})).create=e,U.types=t,U.conversions=i,U.ignore=n,U.onMismatch=h,U.throwMismatchError=h,U.createError=o,U.convert=function(e,t){var r=f(e);if(t===r)return e;for(var n=0;n<U.conversions.length;n++){var i=U.conversions[n];if(i.from===r&&i.to===t)return i.convert(e)}throw new Error("Cannot convert from "+r+" to "+t)},U.find=function(e,t){if(!e.signatures)throw new TypeError("Function is no typed-function");if("string"==typeof t)for(var r=t.split(","),n=0;n<r.length;n++)r[n]=r[n].trim();else{if(!Array.isArray(t))throw new TypeError("String array or a comma separated string expected");r=t}t=r.join(","),t=e.signatures[t];if(t)return t;throw new TypeError("Signature not found (signature: "+(e.name||"unnamed")+"("+r.join(", ")+"))")},U.addType=function(e,t){if(!e||"string"!=typeof e.name||"function"!=typeof e.test)throw new TypeError("Object with properties {name: string, test: function} expected");if(!1!==t)for(var r=0;r<U.types.length;r++)if("Object"===U.types[r].name)return void U.types.splice(r,0,e);U.types.push(e)},U.addConversion=function(e){if(!e||"string"!=typeof e.from||"string"!=typeof e.to||"function"!=typeof e.convert)throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");U.conversions.push(e)},U}()})?n.apply(t,[]):n)&&(e.exports=t)},function(e,t,r){var n=r(266),i=r(267),a=r(268),o=r(269),s=r(270),u=r(271),r=r(272);r.alea=n,r.xor128=i,r.xorwow=a,r.xorshift7=o,r.xor4096=s,r.tychei=u,e.exports=r},function(e,t,r){"use strict";var n={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,a=i&&!n.call({1:2},1);t.f=a?function(e){e=i(this,e);return!!e&&e.enumerable}:n},function(e,t,r){var n=r(1),i=r(17),a=r(24),o=r(78),s=r(67),u=r(197),r=r(15),c=n.TypeError,f=r("toPrimitive");e.exports=function(e,t){if(!a(e)||o(e))return e;var r=s(e,f);if(r){if(r=i(r,e,t=void 0===t?"default":t),!a(r)||o(r))return r;throw c("Can't convert object to primitive value")}return u(e,t=void 0===t?"number":t)}},function(e,t,r){r=r(66);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(e,t,r){var n=r(19),i=r(7),a=r(97);e.exports=!n&&!i(function(){return 7!=Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a})},function(e,t,r){var n=r(19),r=r(7);e.exports=n&&r(function(){return 42!=Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},function(e,t,r){var n=r(7),i=r(12),a=r(22),o=r(19),s=r(81).CONFIGURABLE,u=r(98),r=r(46),c=r.enforce,f=r.get,l=Object.defineProperty,p=o&&!n(function(){return 8!==l(function(){},"length",{value:8}).length}),m=String(String).split("String"),r=e.exports=function(e,t,r){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!a(e,"name")||s&&e.name!==t)&&l(e,"name",{value:t,configurable:!0}),p&&r&&a(r,"arity")&&e.length!==r.arity&&l(e,"length",{value:r.arity});try{r&&a(r,"constructor")&&r.constructor?o&&l(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}r=c(e);return a(r,"source")||(r.source=m.join("string"==typeof t?t:"")),e};Function.prototype.toString=r(function(){return i(this)&&f(this).source||u(this)},"toString")},function(e,t,r){var u=r(22),c=r(145),f=r(59),l=r(25);e.exports=function(e,t,r){for(var n=c(t),i=l.f,a=f.f,o=0;o<n.length;o++){var s=n[o];u(e,s)||r&&u(r,s)||i(e,s,a(t,s))}}},function(e,t,r){var n=r(40),i=r(9),a=r(69),o=r(113),s=r(23),u=i([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=a.f(s(e)),r=o.f;return r?u(t,r(e)):t}},function(e,t,r){var n=r(9),o=r(22),s=r(39),u=r(199).indexOf,c=r(82),f=n([].push);e.exports=function(e,t){var r,n=s(e),i=0,a=[];for(r in n)!o(c,r)&&o(n,r)&&f(a,r);for(;t.length>i;)!o(n,r=t[i++])||~u(a,r)||f(a,r);return a}},function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(e,t,r){r=r(97)("span").classList,r=r&&r.constructor&&r.constructor.prototype;e.exports=r===Object.prototype?void 0:r},function(e,t,r){var n=r(3),i=r(7),a=r(37),o=r(118),r=r(150);n({target:"Object",stat:!0,forced:i(function(){o(1)}),sham:!r},{getPrototypeOf:function(e){return o(a(e))}})},function(e,t,r){r=r(7);e.exports=!r(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},function(B,D,e){var t=e(19),r=e(1),n=e(9),i=e(84),c=e(119),f=e(55),a=e(69).f,l=e(53),p=e(152),m=e(28),h=e(153),o=e(104),s=e(205),u=e(35),d=e(7),y=e(22),g=e(46).enforce,v=e(121),x=e(15),b=e(122),w=e(155),N=x("match"),M=r.RegExp,E=M.prototype,S=r.SyntaxError,A=n(E.exec),O=n("".charAt),C=n("".replace),T=n("".indexOf),j=n("".slice),P=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,_=/a/g,I=/a/g,e=new M(_)!==_,k=o.MISSED_STICKY,F=o.UNSUPPORTED_Y;if(i("RegExp",t&&(!e||k||b||w||d(function(){return I[N]=!1,M(_)!=_||M(I)==I||"/a/i"!=M(_,"i")})))){function z(e,t){var r,n,i=l(E,this),a=p(e),o=void 0===t,s=[],u=e;if(!i&&a&&o&&e.constructor===z)return e;if((a||l(E,e))&&(e=e.source,o&&(t=h(u))),e=void 0===e?"":m(e),t=void 0===t?"":m(t),u=e,a=t=b&&"dotAll"in _&&(r=!!t&&-1<T(t,"s"))?C(t,/s/g,""):t,k&&"sticky"in _&&(n=!!t&&-1<T(t,"y"))&&F&&(t=C(t,/y/g,"")),w&&(e=(o=function(e){for(var t,r=e.length,n=0,i="",a=[],o={},s=!1,u=!1,c=0,f="";n<=r;n++){if("\\"===(t=O(e,n)))t+=O(e,++n);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:A(P,j(e,n+1))&&(n+=2,u=!0),i+=t,c++;continue;case">"===t&&u:if(""===f||y(o,f))throw new S("Invalid capture group name");o[f]=!0,u=!(a[a.length]=[f,c]),f="";continue}u?f+=t:i+=t}return[i,a]}(e))[0],s=o[1]),o=c(M(e,t),i?this:E,z),(r||n||s.length)&&(t=g(o),r&&(t.dotAll=!0,t.raw=z(function(e){for(var t,r=e.length,n=0,i="",a=!1;n<=r;n++)"\\"!==(t=O(e,n))?a||"."!==t?("["===t?a=!0:"]"===t&&(a=!1),i+=t):i+="[\\s\\S]":i+=t+O(e,++n);return i}(e),a)),n&&(t.sticky=!0),s.length&&(t.groups=s)),e!==u)try{f(o,"source",""===u?"(?:)":u)}catch(e){}return o}for(var R=a(M),q=0;R.length>q;)s(z,M,R[q++]);(E.constructor=z).prototype=E,u(r,"RegExp",z,{constructor:!0})}v("RegExp")},function(e,t,r){var n=r(24),i=r(45),a=r(15)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[a])?!!t:"RegExp"==i(e))}},function(e,t,r){var n=r(17),i=r(22),a=r(53),o=r(154),s=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in s||i(e,"flags")||!a(s,e)?t:n(o,e)}},function(e,t,r){"use strict";var n=r(23);e.exports=function(){var e=n(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,r){var n=r(7),i=r(1).RegExp;e.exports=n(function(){var e=i("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})},function(e,t,r){var n=r(1),i=r(19),a=r(122),o=r(45),s=r(157),u=r(46).get,c=RegExp.prototype,f=n.TypeError;i&&a&&s(c,"dotAll",{configurable:!0,get:function(){if(this!==c){if("RegExp"===o(this))return!!u(this).dotAll;throw f("Incompatible receiver, RegExp required")}}})},function(e,t,r){var n=r(143),i=r(25);e.exports=function(e,t,r){return r.get&&n(r.get,t,{getter:!0}),r.set&&n(r.set,t,{setter:!0}),i.f(e,t,r)}},function(e,t,r){var n=r(19),i=r(142),s=r(25),u=r(23),c=r(39),f=r(114);t.f=n&&!i?Object.defineProperties:function(e,t){u(e);for(var r,n=c(t),i=f(t),a=i.length,o=0;o<a;)s.f(e,r=i[o++],n[r]);return e}},function(e,t,r){r=r(40);e.exports=r("document","documentElement")},function(e,t,r){var n=r(1),i=r(19),a=r(104).MISSED_STICKY,o=r(45),s=r(157),u=r(46).get,c=RegExp.prototype,f=n.TypeError;i&&a&&s(c,"sticky",{configurable:!0,get:function(){if(this!==c){if("RegExp"===o(this))return!!u(this).sticky;throw f("Incompatible receiver, RegExp required")}}})},function(e,t,r){var n=r(23),i=r(206),a=r(15)("species");e.exports=function(e,t){var e=n(e).constructor;return void 0===e||null==(e=n(e)[a])?t:i(e)}},function(e,t,r){function n(i){return function(e,t){var r,e=o(s(e)),t=a(t),n=e.length;return t<0||n<=t?i?"":void 0:(r=c(e,t))<55296||56319<r||t+1===n||(n=c(e,t+1))<56320||57343<n?i?u(e,t):r:i?f(e,t,t+2):n-56320+(r-55296<<10)+65536}}var i=r(9),a=r(61),o=r(28),s=r(49),u=i("".charAt),c=i("".charCodeAt),f=i("".slice);e.exports={codeAt:n(!1),charAt:n(!0)}},function(e,t){e.exports=Math.sign||function(e){e=+e;return 0==e||e!=e?e:e<0?-1:1}},function(e,t,r){var r=r(3),n=Math.log,i=Math.LN2;r({target:"Math",stat:!0},{log2:function(e){return n(e)/i}})},function(e,t){var r=Math.log;e.exports=Math.log1p||function(e){e=+e;return-1e-8<e&&e<1e-8?e-e*e/2:r(1+e)}},function(e,t,r){r=r(9);e.exports=r(1..valueOf)},function(e,t,r){function n(t){return function(e){e=o(a(e));return 1&t&&(e=s(e,u,"")),e=2&t?s(e,c,""):e}}var i=r(9),a=r(49),o=r(28),r=r(168),s=i("".replace),i="["+r+"]",u=RegExp("^"+i+i+"*"),c=RegExp(i+i+"*$");e.exports={start:n(1),end:n(2),trim:n(3)}},function(e,t){e.exports="\t\n\v\f\r                　\u2028\u2029\ufeff"},function(e,t,r){"use strict";function u(e,t,r){return 0===t?r:t%2==1?u(e,t-1,r*e):u(e*e,t/2,r)}function c(e,t,r){for(var n=-1,i=r;++n<6;)i+=t*e[n],e[n]=i%1e7,i=s(i/1e7)}function f(e,t){for(var r=6,n=0;0<=--r;)n+=e[r],e[r]=s(n/t),n=n%t*1e7}function l(e){for(var t,r=6,n="";0<=--r;)""===n&&0!==r&&0===e[r]||(t=d(e[r]),n=""===n?t:n+y("0",7-t.length)+t);return n}var n=r(3),i=r(1),a=r(9),p=r(61),m=r(166),o=r(170),r=r(7),h=i.RangeError,d=i.String,s=Math.floor,y=a(o),g=a("".slice),v=a(1..toFixed);n({target:"Number",proto:!0,forced:r(function(){return"0.000"!==v(8e-5,3)||"1"!==v(.9,0)||"1.25"!==v(1.255,2)||"1000000000000000128"!==v(0xde0b6b3a7640080,0)})||!r(function(){v({})})},{toFixed:function(e){var t,r,n,i=m(this),e=p(e),a=[0,0,0,0,0,0],o="",s="0";if(e<0||20<e)throw h("Incorrect fraction digits");if(i!=i)return"NaN";if(i<=-1e21||1e21<=i)return d(i);if(i<0&&(o="-",i=-i),1e-21<i)if(n=(t=function(){for(var e=0,t=i*u(2,69,1);4096<=t;)e+=12,t/=4096;for(;2<=t;)e+=1,t/=2;return e}()-69)<0?i*u(2,-t,1):i/u(2,t,1),n*=4503599627370496,0<(t=52-t)){for(c(a,0,n),r=e;7<=r;)c(a,1e7,0),r-=7;for(c(a,u(10,r,1),0),r=t-1;23<=r;)f(a,1<<23),r-=23;f(a,1<<r),c(a,1,1),f(a,2),s=l(a)}else c(a,0,n),c(a,1<<-t,0),s=l(a)+y("0",e);return 0<e?o+((n=s.length)<=e?"0."+y("0",e-n)+s:g(s,0,n-e)+"."+g(s,n-e)):o+s}})},function(e,t,r){"use strict";var n=r(1),i=r(61),a=r(28),o=r(49),s=n.RangeError;e.exports=function(e){var t=a(o(this)),r="",n=i(e);if(n<0||n==1/0)throw s("Wrong number of repetitions");for(;0<n;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r}},function(e,t,r){"use strict";var n,i,a=r(7),o=r(12),s=r(71),u=r(118),c=r(35),f=r(15),r=r(50),l=f("iterator"),f=!1;[].keys&&("next"in(i=[].keys())?(u=u(u(i)))!==Object.prototype&&(n=u):f=!0),null==n||a(function(){var e={};return n[l].call(e)!==e})?n={}:r&&(n=s(n)),o(n[l])||c(n,l,function(){return this}),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:f}},function(e,t,r){r(228)},function(e,t,r){"use strict";var y=r(3),g=r(1),v=r(9),x=r(84),b=r(35),w=r(174),N=r(108),M=r(131),E=r(12),S=r(24),A=r(7),O=r(132),C=r(90),T=r(119);e.exports=function(e,t,r){function n(e){var r=v(m[e]);b(m,e,"add"==e?function(e){return r(this,0===e?0:e),this}:"delete"==e?function(e){return!(f&&!S(e))&&r(this,0===e?0:e)}:"get"==e?function(e){return f&&!S(e)?void 0:r(this,0===e?0:e)}:"has"==e?function(e){return!(f&&!S(e))&&r(this,0===e?0:e)}:function(e,t){return r(this,0===e?0:e,t),this})}var i,a,o,s,u,c=-1!==e.indexOf("Map"),f=-1!==e.indexOf("Weak"),l=c?"set":"add",p=g[e],m=p&&p.prototype,h=p,d={};return x(e,!E(p)||!(f||m.forEach&&!A(function(){(new p).entries().next()})))?(h=r.getConstructor(t,e,c,l),w.enable()):x(e,!0)&&(a=(i=new h)[l](f?{}:-0,1)!=i,o=A(function(){i.has(1)}),s=O(function(e){new p(e)}),u=!f&&A(function(){for(var e=new p,t=5;t--;)e[l](t,t);return!e.has(-0)}),s||(((h=t(function(e,t){M(e,m);e=T(new p,e,h);return null!=t&&N(t,e[l],{that:e,AS_ENTRIES:c}),e})).prototype=m).constructor=h),(o||u)&&(n("delete"),n("has"),c&&n("get")),(u||a)&&n(l),f&&m.clear&&delete m.clear),d[e]=h,y({global:!0,constructor:!0,forced:h!=p},d),C(h,e),f||r.setStrong(h,e,c),h}},function(e,t,r){function n(e){c(e,y,{value:{objectID:"O"+g++,weakData:{}}})}var o=r(3),s=r(9),i=r(82),a=r(24),u=r(22),c=r(25).f,f=r(69),l=r(175),p=r(229),m=r(96),h=r(231),d=!1,y=m("meta"),g=0,v=e.exports={enable:function(){v.enable=function(){},d=!0;var i=f.f,a=s([].splice),e={};e[y]=1,i(e).length&&(f.f=function(e){for(var t=i(e),r=0,n=t.length;r<n;r++)if(t[r]===y){a(t,r,1);break}return t},o({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:l.f}))},fastKey:function(e,t){if(!a(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!u(e,y)){if(!p(e))return"F";if(!t)return"E";n(e)}return e[y].objectID},getWeakData:function(e,t){if(!u(e,y)){if(!p(e))return!0;if(!t)return!1;n(e)}return e[y].weakData},onFreeze:function(e){return h&&d&&p(e)&&!u(e,y)&&n(e),e}};i[y]=!0},function(e,t,r){var n=r(45),i=r(39),a=r(69).f,o=r(126),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){if(!s||"Window"!=n(e))return a(i(e));var t=e;try{return a(t)}catch(t){return o(s)}}},function(e,t,r){var n=r(15),i=r(89),a=n("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||o[a]===e)}},function(e,t,r){var n=r(1),i=r(17),a=r(54),o=r(23),s=r(80),u=r(130),c=n.TypeError;e.exports=function(e,t){var r=arguments.length<2?u(e):t;if(a(r))return o(i(r,e));throw c(s(e)+" is not iterable")}},function(e,t,r){var a=r(17),o=r(23),s=r(67);e.exports=function(e,t,r){var n,i;o(e);try{if(!(n=s(e,"return"))){if("throw"===t)throw r;return r}n=a(n,e)}catch(e){i=!0,n=e}if("throw"===t)throw r;if(i)throw n;return o(n),r}},function(e,t,r){"use strict";var c=r(25).f,f=r(71),l=r(232),p=r(70),m=r(131),h=r(108),o=r(129),s=r(121),d=r(19),y=r(174).fastKey,r=r(46),g=r.set,v=r.getterFor;e.exports={getConstructor:function(e,r,n,i){function a(e,t,r){var n,i=u(e),a=o(e,t);return a?a.value=r:(i.last=a={index:n=y(t,!0),key:t,value:r,previous:t=i.last,next:void 0,removed:!1},i.first||(i.first=a),t&&(t.next=a),d?i.size++:e.size++,"F"!==n&&(i.index[n]=a)),e}function o(e,t){var r,e=u(e),n=y(t);if("F"!==n)return e.index[n];for(r=e.first;r;r=r.next)if(r.key==t)return r}var e=e(function(e,t){m(e,s),g(e,{type:r,index:f(null),first:void 0,last:void 0,size:0}),d||(e.size=0),null!=t&&h(t,e[i],{that:e,AS_ENTRIES:n})}),s=e.prototype,u=v(r);return l(s,{clear:function(){for(var e=u(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,d?e.size=0:this.size=0},delete:function(e){var t,r,n=u(this),e=o(this,e);return e&&(t=e.next,r=e.previous,delete n.index[e.index],e.removed=!0,r&&(r.next=t),t&&(t.previous=r),n.first==e&&(n.first=t),n.last==e&&(n.last=r),d?n.size--:this.size--),!!e},forEach:function(e){for(var t,r=u(this),n=p(e,1<arguments.length?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!o(this,e)}}),l(s,n?{get:function(e){e=o(this,e);return e&&e.value},set:function(e,t){return a(this,0===e?0:e,t)}}:{add:function(e){return a(this,e=0===e?0:e,e)}}),d&&c(s,"size",{get:function(){return u(this).size}}),e},setStrong:function(e,t,r){var n=t+" Iterator",i=v(t),a=v(n);o(e,t,function(e,t){g(this,{type:n,target:e,state:i(e),kind:t,last:void 0})},function(){for(var e=a(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:{value:e.target=void 0,done:!0}},r?"entries":"values",!r,!0),s(t)}}},function(e,t,r){r=r(15);t.f=r},function(e,t,r){var n=r(236),i=r(22),a=r(180),o=r(25).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});i(t,e)||o(t,e,{value:a.f(e)})}},function(e,t,r){r=r(66);e.exports=r&&!!Symbol.for&&!!Symbol.keyFor},function(e,t,r){var n,i,a=r(1),o=r(106),s=r(70),u=r(12),c=r(22),f=r(7),l=r(159),p=r(123),m=r(97),h=r(242),d=r(184),r=r(133),y=a.setImmediate,g=a.clearImmediate,v=a.process,x=a.Dispatch,b=a.Function,w=a.MessageChannel,N=a.String,M=0,E={};try{n=a.location}catch(e){}function S(e){return function(){C(e)}}function A(e){C(e.data)}function O(e){a.postMessage(N(e),n.protocol+"//"+n.host)}var C=function(e){var t;c(E,e)&&(t=E[e],delete E[e],t())};y&&g||(y=function(e){h(arguments.length,1);var t=u(e)?e:b(e),r=p(arguments,1);return E[++M]=function(){o(t,void 0,r)},i(M),M},g=function(e){delete E[e]},r?i=function(e){v.nextTick(S(e))}:x&&x.now?i=function(e){x.now(S(e))}:w&&!d?(d=(r=new w).port2,r.port1.onmessage=A,i=s(d.postMessage,d)):a.addEventListener&&u(a.postMessage)&&!a.importScripts&&n&&"file:"!==n.protocol&&!f(O)?(i=O,a.addEventListener("message",A,!1)):i="onreadystatechange"in m("script")?function(e){l.appendChild(m("script")).onreadystatechange=function(){l.removeChild(this),C(e)}}:function(e){setTimeout(S(e),0)}),e.exports={set:y,clear:g}},function(e,t,r){r=r(60);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},function(e,t,r){var n=r(91),i=r(132),r=r(92).CONSTRUCTOR;e.exports=r||!i(function(e){n.all(e).then(void 0,function(){})})},function(e,t,r){r(3)({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},function(e,t,r){var n=r(188);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(r="Object"===r&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(3),i=r(7),a=r(39),o=r(59).f,r=r(19),i=i(function(){o(1)});n({target:"Object",stat:!0,forced:!r||i,sham:!r},{getOwnPropertyDescriptor:function(e,t){return o(a(e),t)}})},function(e,t,r){var n=r(3),i=r(19),u=r(145),c=r(39),f=r(59),l=r(72);n({target:"Object",stat:!0,sham:!i},{getOwnPropertyDescriptors:function(e){for(var t,r,n=c(e),i=f.f,a=u(n),o={},s=0;a.length>s;)void 0!==(r=i(n,t=a[s++]))&&l(o,t,r);return o}})},function(e,t,r){r(265)},function(e,t){function r(){}r.prototype={on:function(e,t,r){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:r}),this},once:function(e,t,r){var n=this;function i(){n.off(e,i),t.apply(r,arguments)}return i._=t,this.on(e,i,r)},emit:function(e){for(var t=[].slice.call(arguments,1),r=((this.e||(this.e={}))[e]||[]).slice(),n=0,i=r.length;n<i;n++)r[n].fn.apply(r[n].ctx,t);return this},off:function(e,t){var r=this.e||(this.e={}),n=r[e],i=[];if(n&&t)for(var a=0,o=n.length;a<o;a++)n[a].fn!==t&&n[a].fn._!==t&&i.push(n[a]);return i.length?r[e]=i:delete r[e],this}},e.exports=r,e.exports.TinyEmitter=r},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";function s(e,t){return u({},e,t)}var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r,n=arguments[t];for(r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c={"{":"\\{","}":"\\}","\\":"\\textbackslash{}","#":"\\#",$:"\\$","%":"\\%","&":"\\&","^":"\\textasciicircum{}",_:"\\_","~":"\\textasciitilde{}"},f={"–":"\\--","—":"\\---"," ":"~","\t":"\\qquad{}","\r\n":"\\newline{}","\n":"\\newline{}"};e.exports=function(e){for(var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=t.preserveFormatting,r=void 0!==r&&r,t=t.escapeMapFn,t=void 0===t?s:t,n=String(e),i="",a=t(u({},c),r?u({},f):{}),o=Object.keys(a);n;)!function(){var r=!1;o.forEach(function(e,t){r||n.length>=e.length&&n.slice(0,e.length)===e&&(i+=a[o[t]],n=n.slice(e.length,n.length),r=!0)}),r||(i+=n.slice(0,1),n=n.slice(1,n.length))}();return i}},function(e,t){var r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){var n=r(1),i=r(17),a=r(12),o=r(24),s=n.TypeError;e.exports=function(e,t){var r,n;if("string"===t&&a(r=e.toString)&&!o(n=i(r,e)))return n;if(a(r=e.valueOf)&&!o(n=i(r,e)))return n;if("string"!==t&&a(r=e.toString)&&!o(n=i(r,e)))return n;throw s("Can't convert object to primitive value")}},function(e,t,r){var n=r(1),i=r(12),r=r(98),n=n.WeakMap;e.exports=i(n)&&/native code/.test(r(n))},function(e,t,r){function n(s){return function(e,t,r){var n,i=u(e),a=f(i),o=c(r,a);if(s&&t!=t){for(;o<a;)if((n=i[o++])!=n)return!0}else for(;o<a;o++)if((s||o in i)&&i[o]===t)return s||o||0;return!s&&-1}}var u=r(39),c=r(83),f=r(47);e.exports={includes:n(!0),indexOf:n(!1)}},function(e,t){var r=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){e=+e;return(0<e?n:r)(e)}},function(e,t,r){"use strict";var n=r(115),i=r(101);e.exports=n?{}.toString:function(){return"[object "+i(this)+"]"}},function(e,t,r){"use strict";var n=r(85).forEach,r=r(117)("forEach");e.exports=r?[].forEach:function(e){return n(this,e,1<arguments.length?arguments[1]:void 0)}},function(e,t,r){var n=r(1),i=r(102),a=r(103),o=r(24),s=r(15)("species"),u=n.Array;e.exports=function(e){var t;return i(e)&&(t=e.constructor,(a(t)&&(t===u||i(t.prototype))||o(t)&&null===(t=t[s]))&&(t=void 0)),void 0===t?u:t}},function(e,t,r){var n=r(1),i=r(12),a=n.String,o=n.TypeError;e.exports=function(e){if("object"==typeof e||i(e))return e;throw o("Can't set "+a(e)+" as a prototype")}},function(e,t,r){var n=r(25).f;e.exports=function(e,t,r){r in e||n(e,r,{configurable:!0,get:function(){return t[r]},set:function(e){t[r]=e}})}},function(e,t,r){var n=r(1),i=r(103),a=r(80),o=n.TypeError;e.exports=function(e){if(i(e))return e;throw o(a(e)+" is not a constructor")}},function(e,t,r){function v(e,t){var r=e.length,n=b(r/2);if(r<8){for(var i,a,o=e,s=t,u=o.length,c=1;c<u;){for(i=o[a=c];a&&0<s(o[a-1],i);)o[a]=o[--a];a!==c++&&(o[a]=i)}return o}for(var f=e,l=v(x(e,0,n),t),p=v(x(e,n),t),m=t,h=l.length,d=p.length,y=0,g=0;y<h||g<d;)f[y+g]=y<h&&g<d?m(l[y],p[g])<=0?l[y++]:p[g++]:y<h?l[y++]:p[g++];return f}var x=r(126),b=Math.floor;e.exports=v},function(e,t,r){r=r(60).match(/firefox\/(\d+)/i);e.exports=!!r&&+r[1]},function(e,t,r){r=r(60);e.exports=/MSIE|Trident/.test(r)},function(e,t,r){r=r(60).match(/AppleWebKit\/(\d+)\./);e.exports=!!r&&+r[1]},function(e,t,r){r(3)({target:"Math",stat:!0},{sign:r(163)})},function(e,t,r){r(3)({target:"Math",stat:!0},{log10:r(213)})},function(e,t){var r=Math.log,n=Math.LOG10E;e.exports=Math.log10||function(e){return r(e)*n}},function(e,t,r){r(3)({target:"Math",stat:!0},{log1p:r(165)})},function(e,t,r){var n=r(3),i=r(163),a=Math.abs,o=Math.pow;n({target:"Math",stat:!0},{cbrt:function(e){e=+e;return i(e)*o(a(e),1/3)}})},function(e,t,r){var n=r(3),r=r(107);n({target:"Math",stat:!0,forced:r!=Math.expm1},{expm1:r})},function(e,t,r){var n=r(9),i=r(37),p=Math.floor,m=n("".charAt),h=n("".replace),d=n("".slice),y=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,g=/\$([$&'`]|\d{1,2})/g;e.exports=function(a,o,s,u,c,e){var f=s+a.length,l=u.length,t=g;return void 0!==c&&(c=i(c),t=y),h(e,t,function(e,t){var r;switch(m(t,0)){case"$":return"$";case"&":return a;case"`":return d(o,0,s);case"'":return d(o,f);case"<":r=c[d(t,1,-1)];break;default:var n,i=+t;if(0==i)return e;if(l<i)return 0!==(n=p(i/10))&&n<=l?void 0===u[n-1]?m(t,1):u[n-1]+m(t,1):e;r=u[i-1]}return void 0===r?"":r})}},function(e,t,r){r(3)({target:"Number",stat:!0},{EPSILON:Math.pow(2,-52)})},function(e,t,r){var n=r(3),i=r(165),r=Math.acosh,a=Math.log,o=Math.sqrt,s=Math.LN2;n({target:"Math",stat:!0,forced:!r||710!=Math.floor(r(Number.MAX_VALUE))||r(1/0)!=1/0},{acosh:function(e){e=+e;return e<1?NaN:94906265.62425156<e?a(e)+s:i(e-1+o(e-1)*o(1+e))}})},function(e,t,r){var r=r(3),n=Math.asinh,i=Math.log,a=Math.sqrt;r({target:"Math",stat:!0,forced:!(n&&0<1/n(0))},{asinh:function e(t){t=+t;return isFinite(t)&&0!=t?t<0?-e(-t):i(t+a(t*t+1)):t}})},function(e,t,r){var r=r(3),n=Math.atanh,i=Math.log;r({target:"Math",stat:!0,forced:!(n&&1/n(-0)<0)},{atanh:function(e){e=+e;return 0==e?e:i((1+e)/(1-e))/2}})},function(e,t,r){var n=r(3),i=r(107),r=Math.cosh,a=Math.abs,o=Math.E;n({target:"Math",stat:!0,forced:!r||r(710)===1/0},{cosh:function(e){e=i(a(e)-1)+1;return(e+1/(e*o*o))*(o/2)}})},function(e,t,r){var n=r(3),i=r(7),a=r(107),o=Math.abs,s=Math.exp,u=Math.E;n({target:"Math",stat:!0,forced:i(function(){return-2e-17!=Math.sinh(-2e-17)})},{sinh:function(e){e=+e;return o(e)<1?(a(e)-a(-e))/2:(s(e-1)-s(-e-1))*(u/2)}})},function(e,t,r){var n=r(3),i=r(107),a=Math.exp;n({target:"Math",stat:!0},{tanh:function(e){var e=+e,t=i(e),r=i(-e);return t==1/0?1:r==1/0?-1:(t-r)/(a(e)+a(-e))}})},function(e,t,r){var n=r(9),a=r(49),o=r(28),s=/"/g,u=n("".replace);e.exports=function(e,t,r,n){var e=o(a(e)),i="<"+t;return""!==r&&(i+=" "+r+'="'+u(o(n),s,"&quot;")+'"'),i+">"+e+"</"+t+">"}},function(e,t,r){var n=r(7);e.exports=function(t){return n(function(){var e=""[t]('"');return e!==e.toLowerCase()||3<e.split('"').length})}},function(e,t,r){"use strict";function i(){return this}var a=r(171).IteratorPrototype,o=r(71),s=r(77),u=r(90),c=r(89);e.exports=function(e,t,r,n){t+=" Iterator";return e.prototype=o(a,{next:s(+!n,r)}),u(e,t,!1,!0),c[t]=i,e}},function(e,t,r){"use strict";r(173)("Map",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},r(179))},function(e,t,r){var n=r(7),i=r(24),a=r(45),o=r(230),s=Object.isExtensible,r=n(function(){s(1)});e.exports=r||o?function(e){return!!i(e)&&(!o||"ArrayBuffer"!=a(e))&&(!s||s(e))}:s},function(e,t,r){r=r(7);e.exports=r(function(){var e;"function"==typeof ArrayBuffer&&(e=new ArrayBuffer(8),Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8}))})},function(e,t,r){r=r(7);e.exports=!r(function(){return Object.isExtensible(Object.preventExtensions({}))})},function(e,t,r){var i=r(35);e.exports=function(e,t,r){for(var n in t)i(e,n,t[n],r);return e}},function(e,t,r){"use strict";var n=r(1),p=r(70),m=r(17),h=r(37),d=r(234),y=r(176),g=r(103),v=r(47),x=r(72),b=r(177),w=r(130),N=n.Array;e.exports=function(e){var t=h(e),e=g(this),r=arguments.length,n=1<r?arguments[1]:void 0,i=void 0!==n;i&&(n=p(n,2<r?arguments[2]:void 0));var a,o,s,u,c,f,r=w(t),l=0;if(!r||this==N&&y(r))for(a=v(t),o=e?new this(a):N(a);l<a;l++)f=i?n(t[l],l):t[l],x(o,l,f);else for(c=(u=b(t,r)).next,o=e?new this:[];!(s=m(c,u)).done;l++)f=i?d(u,n,[s.value,l],!0):s.value,x(o,l,f);return o.length=l,o}},function(e,t,r){var i=r(23),a=r(178);e.exports=function(e,t,r,n){try{return n?t(i(r)[0],r[1]):t(r)}catch(t){a(e,"throw",t)}}},function(B,D,e){"use strict";function n(e,t){var r=k[e]=v(_);return ee(r,{type:"Symbol",tag:e,description:t}),l||(r.description=t),r}function i(e,t,r){return e===T&&i(z,t,r),h(e),t=y(t),h(r),m(k,t)?(r.enumerable?(m(e,C)&&e[C][t]&&(e[C][t]=!1),r=v(r,{enumerable:g(0,!1)})):(m(e,C)||I(e,C,g(1,{})),e[C][t]=!0),q(e,t,r)):I(e,t,r)}function r(t,e){h(t);var r=d(e),e=x(r).concat(s(r));return O(e,function(e){l&&!f(a,r,e)||i(t,e,r[e])}),t}function a(e){var e=y(e),t=f(ae,this,e);return!(this===T&&m(k,e)&&!m(z,e))&&(!(t||!m(this,e)||!m(k,e)||m(this,C)&&this[C][e])||t)}function t(e,t){var r,e=d(e),t=y(t);if(e!==T||!m(k,t)||m(z,t))return!(r=ne(e,t))||!m(k,t)||m(e,C)&&e[C][t]||(r.enumerable=!0),r}function o(e){var e=ie(d(e)),t=[];return O(e,function(e){m(k,e)||m(Z,e)||oe(t,e)}),t}function s(e){var t=e===T,e=ie(t?z:d(e)),r=[];return O(e,function(e){!m(k,e)||t&&!m(T,e)||oe(r,k[e])}),r}var u=e(3),c=e(1),f=e(17),j=e(9),P=e(50),l=e(19),p=e(66),F=e(7),m=e(22),U=e(53),h=e(23),d=e(39),y=e(95),L=e(28),g=e(77),v=e(71),x=e(114),$=e(69),b=e(175),H=e(113),w=e(59),N=e(25),G=e(158),V=e(138),M=e(35),E=e(68),S=e(99),Z=e(82),W=e(96),Y=e(15),J=e(180),X=e(181),Q=e(237),K=e(90),A=e(46),O=e(85).forEach,C=S("hidden"),ee=A.set,te=A.getterFor("Symbol"),T=Object.prototype,e=c.Symbol,_=e&&e.prototype,re=c.TypeError,S=c.QObject,ne=w.f,I=N.f,ie=b.f,ae=V.f,oe=j([].push),k=E("symbols"),z=E("op-symbols"),A=E("wks"),R=!S||!S.prototype||!S.prototype.findChild,q=l&&F(function(){return 7!=v(I({},"a",{get:function(){return I(this,"a",{value:7}).a}})).a})?function(e,t,r){var n=ne(T,t);n&&delete T[t],I(e,t,r),n&&e!==T&&I(T,t,n)}:I;p||(M(_=(e=function(){if(U(_,this))throw re("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?L(arguments[0]):void 0,t=W(e),r=function(e){this===T&&f(r,z,e),m(this,C)&&m(this[C],t)&&(this[C][t]=!1),q(this,t,g(1,e))};return l&&R&&q(T,t,{configurable:!0,set:r}),n(t,e)}).prototype,"toString",function(){return te(this).tag}),M(e,"withoutSetter",function(e){return n(W(e),e)}),V.f=a,N.f=i,G.f=r,w.f=t,$.f=b.f=o,H.f=s,J.f=function(e){return n(Y(e),e)},l&&(I(_,"description",{configurable:!0,get:function(){return te(this).description}}),P||M(T,"propertyIsEnumerable",a,{unsafe:!0}))),u({global:!0,constructor:!0,wrap:!0,forced:!p,sham:!p},{Symbol:e}),O(x(A),function(e){X(e)}),u({target:"Symbol",stat:!0,forced:!p},{useSetter:function(){R=!0},useSimple:function(){R=!1}}),u({target:"Object",stat:!0,forced:!p,sham:!l},{create:function(e,t){return void 0===t?v(e):r(v(e),t)},defineProperty:i,defineProperties:r,getOwnPropertyDescriptor:t}),u({target:"Object",stat:!0,forced:!p},{getOwnPropertyNames:o}),Q(),K(e,"Symbol"),Z[C]=!0},function(e,t,r){r=r(1);e.exports=r},function(e,t,r){var n=r(17),i=r(40),a=r(15),o=r(35);e.exports=function(){var e=i("Symbol"),e=e&&e.prototype,t=e&&e.valueOf,r=a("toPrimitive");e&&!e[r]&&o(e,r,function(e){return n(t,this)},{arity:1})}},function(e,t,r){var n=r(3),i=r(40),a=r(22),o=r(28),s=r(68),r=r(182),u=s("string-to-symbol-registry"),c=s("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!r},{for:function(e){e=o(e);if(a(u,e))return u[e];var t=i("Symbol")(e);return u[e]=t,c[t]=e,t}})},function(e,t,r){var n=r(3),i=r(22),a=r(78),o=r(80),s=r(68),r=r(182),u=s("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!r},{keyFor:function(e){if(!a(e))throw TypeError(o(e)+" is not a symbol");if(i(u,e))return u[e]}})},function(e,t,r){var n=r(3),i=r(66),a=r(7),o=r(113),s=r(37);n({target:"Object",stat:!0,forced:!i||a(function(){o.f(1)})},{getOwnPropertySymbols:function(e){var t=o.f;return t?t(s(e)):[]}})},function(e,B,t){"use strict";function a(e,t){var r,n,i,a,o=t.value,s=1==t.state,u=s?e.ok:e.fail,c=e.resolve,f=e.reject,l=e.domain;try{u?(s||(2===t.rejection&&(a=t,h(y,m,function(){var e=a.facade;p?O.emit("rejectionHandled",e):I("rejectionhandled",e,a.value)})),t.rejection=1),!0===u?r=o:(l&&l.enter(),r=u(o),l&&(l.exit(),i=!0)),r===e.promise?f(S("Promise-chain cycle")):(n=T(r))?h(n,r,c,f):c(r)):f(o)}catch(e){l&&!i&&l.exit(),f(e)}}var r,n,i,o=t(3),s=t(50),p=t(133),m=t(1),h=t(17),u=t(35),c=t(120),f=t(90),l=t(121),D=t(54),d=t(12),j=t(24),P=t(131),F=t(161),y=t(183).set,g=t(243),U=t(246),L=t(134),$=t(247),v=t(46),x=t(91),b=t(92),t=t(93),w=b.CONSTRUCTOR,H=b.REJECTION_EVENT,b=b.SUBCLASSING,N=v.getterFor("Promise"),G=v.set,v=x&&x.prototype,M=x,E=v,S=m.TypeError,A=m.document,O=m.process,C=t.f,V=C,Z=!!(A&&A.createEvent&&m.dispatchEvent),T=function(e){var t;return!(!j(e)||!d(t=e.then))&&t},_=function(r,i){r.notified||(r.notified=!0,g(function(){for(var e,n,t=r.reactions;e=t.get();)a(e,r);r.notified=!1,i&&!r.rejection&&(n=r,h(y,m,function(){var e,t=n.facade,r=n.value;if(k(n)&&(e=L(function(){p?O.emit("unhandledRejection",r,t):I("unhandledrejection",t,r)}),n.rejection=p||k(n)?2:1,e.error))throw e.value}))}))},I=function(e,t,r){var n;Z?((n=A.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),m.dispatchEvent(n)):n={promise:t,reason:r},!H&&(t=m["on"+e])?t(n):"unhandledrejection"===e&&U("Unhandled promise rejection",r)},k=function(e){return 1!==e.rejection&&!e.parent},z=function(t,r,n){return function(e){t(r,e,n)}},R=function(e,t,r){e.done||(e.done=!0,(e=r?r:e).value=t,e.state=2,_(e,!0))},q=function(r,e,t){if(!r.done){r.done=!0,t&&(r=t);try{if(r.facade===e)throw S("Promise can't be resolved itself");var n=T(e);n?g(function(){var t={done:!1};try{h(n,e,z(q,t,r),z(R,t,r))}catch(e){R(t,e,r)}}):(r.value=e,r.state=1,_(r,!1))}catch(e){R({done:!1},e,r)}}};if(w&&(E=(M=function(e){P(this,E),D(e),h(r,this);var t=N(this);try{e(z(q,t),z(R,t))}catch(e){R(t,e)}}).prototype,(r=function(e){G(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:new $,rejection:!1,state:0,value:void 0})}).prototype=u(E,"then",function(e,t){var r=N(this),n=C(F(this,M));return r.parent=!0,n.ok=!d(e)||e,n.fail=d(t)&&t,n.domain=p?O.domain:void 0,0==r.state?r.reactions.add(n):g(function(){a(n,r)}),n.promise}),n=function(){var e=new r,t=N(e);this.promise=e,this.resolve=z(q,t),this.reject=z(R,t)},t.f=C=function(e){return e===M||void 0===e?new n:V(e)},!s&&d(x)&&v!==Object.prototype)){i=v.then,b||u(v,"then",function(e,t){var r=this;return new M(function(e,t){h(i,r,e,t)}).then(e,t)},{unsafe:!0});try{delete v.constructor}catch(e){}c&&c(v,E)}o({global:!0,constructor:!0,wrap:!0,forced:w},{Promise:M}),f(M,"Promise",!1,!0),l("Promise")},function(e,t,r){var n=r(1).TypeError;e.exports=function(e,t){if(e<t)throw n("Not enough arguments");return e}},function(e,t,r){var n,i,a,o,s,u,c,f=r(1),l=r(70),p=r(59).f,m=r(183).set,h=r(184),d=r(244),y=r(245),g=r(133),r=f.MutationObserver||f.WebKitMutationObserver,v=f.document,x=f.process,b=f.Promise,p=p(f,"queueMicrotask"),p=p&&p.value;p||(n=function(){var e,t;for(g&&(e=x.domain)&&e.exit();i;){t=i.fn,i=i.next;try{t()}catch(e){throw i?o():a=void 0,e}}a=void 0,e&&e.enter()},o=h||g||y||!r||!v?!d&&b&&b.resolve?((h=b.resolve(void 0)).constructor=b,c=l(h.then,h),function(){c(n)}):g?function(){x.nextTick(n)}:(m=l(m,f),function(){m(n)}):(s=!0,u=v.createTextNode(""),new r(n).observe(u,{characterData:!0}),function(){u.data=s=!s})),e.exports=p||function(e){e={fn:e,next:void 0};a&&(a.next=e),i||(i=e,o()),a=e}},function(e,t,r){var n=r(60),r=r(1);e.exports=/ipad|iphone|ipod/i.test(n)&&void 0!==r.Pebble},function(e,t,r){r=r(60);e.exports=/web0s(?!.*chrome)/i.test(r)},function(e,t,r){var n=r(1);e.exports=function(e,t){var r=n.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))}},function(e,t){function r(){this.head=null,this.tail=null}r.prototype={add:function(e){e={item:e,next:null};this.head?this.tail.next=e:this.head=e,this.tail=e},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}},e.exports=r},function(e,t){e.exports="object"==typeof window&&"object"!=typeof Deno},function(e,t,r){"use strict";var n=r(3),f=r(17),l=r(54),i=r(93),a=r(134),p=r(108);n({target:"Promise",stat:!0,forced:r(185)},{all:function(e){var s=this,t=i.f(s),u=t.resolve,c=t.reject,r=a(function(){var n=l(s.resolve),i=[],a=0,o=1;p(e,function(e){var t=a++,r=!1;o++,f(n,s,e).then(function(e){r||(r=!0,i[t]=e,--o||u(i))},c)}),--o||u(i)});return r.error&&c(r.value),t.promise}})},function(e,t,r){"use strict";var n=r(3),i=r(50),a=r(92).CONSTRUCTOR,o=r(91),s=r(40),u=r(12),r=r(35),c=o&&o.prototype;n({target:"Promise",proto:!0,forced:a,real:!0},{catch:function(e){return this.then(void 0,e)}}),!i&&u(o)&&(n=s("Promise").prototype.catch,c.catch!==n&&r(c,"catch",n,{unsafe:!0}))},function(e,t,r){"use strict";var n=r(3),a=r(17),o=r(54),s=r(93),u=r(134),c=r(108);n({target:"Promise",stat:!0,forced:r(185)},{race:function(e){var r=this,n=s.f(r),i=n.reject,t=u(function(){var t=o(r.resolve);c(e,function(e){a(t,r,e).then(n.resolve,i)})});return t.error&&i(t.value),n.promise}})},function(e,t,r){"use strict";var n=r(3),i=r(17),a=r(93);n({target:"Promise",stat:!0,forced:r(92).CONSTRUCTOR},{reject:function(e){var t=a.f(this);return i(t.reject,void 0,e),t.promise}})},function(e,t,r){"use strict";var n=r(3),i=r(40),a=r(50),o=r(91),s=r(92).CONSTRUCTOR,u=r(254),c=i("Promise"),f=a&&!s;n({target:"Promise",stat:!0,forced:a||s},{resolve:function(e){return u(f&&this===c?o:this,e)}})},function(e,t,r){var n=r(23),i=r(24),a=r(93);e.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;e=a.f(e);return(0,e.resolve)(t),e.promise}},function(M,e,t){var E=t(5).default;function r(){"use strict";M.exports=function(){return o},M.exports.__esModule=!0,M.exports.default=M.exports;var o={},e=Object.prototype,u=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",r=t.asyncIterator||"@@asyncIterator",i=t.toStringTag||"@@toStringTag";function a(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var i,a,o,s,t=t&&t.prototype instanceof l?t:l,t=Object.create(t.prototype),n=new b(n||[]);return t._invoke=(i=e,a=r,o=n,s="suspendedStart",function(e,t){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===e)throw t;return N()}for(o.method=e,o.arg=t;;){var r=o.delegate;if(r){r=function e(t,r){var n=t.iterator[r.method];if(void 0===n){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=void 0,e(t,r),"throw"===r.method))return f;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}n=c(n,t.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,f;n=n.arg;return n?n.done?(r[t.resultName]=n.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,f):n:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,f)}(r,o);if(r){if(r===f)continue;return r}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===s)throw s="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);s="executing";r=c(i,a,o);if("normal"===r.type){if(s=o.done?"completed":"suspendedYield",r.arg===f)continue;return{value:r.arg,done:o.done}}"throw"===r.type&&(s="completed",o.method="throw",o.arg=r.arg)}}),t}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}o.wrap=s;var f={};function l(){}function p(){}function m(){}var t={},h=(a(t,n,function(){return this}),Object.getPrototypeOf),h=h&&h(h(w([]))),d=(h&&h!==e&&u.call(h,n)&&(t=h),m.prototype=l.prototype=Object.create(t));function y(e){["next","throw","return"].forEach(function(t){a(e,t,function(e){return this._invoke(t,e)})})}function g(o,s){var t;this._invoke=function(r,n){function e(){return new s(function(e,t){!function t(e,r,n,i){var a,e=c(o[e],o,r);return"throw"!==e.type?(r=(a=e.arg).value)&&"object"==E(r)&&u.call(r,"__await")?s.resolve(r.__await).then(function(e){t("next",e,n,i)},function(e){t("throw",e,n,i)}):s.resolve(r).then(function(e){a.value=e,n(a)},function(e){return t("throw",e,n,i)}):void i(e.arg)}(r,n,e,t)})}return t=t?t.then(e,e):e()}}function v(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function b(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(v,this),this.reset(!0)}function w(t){if(t){var r,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return r=-1,(e=function e(){for(;++r<t.length;)if(u.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e}).next=e}return{next:N}}function N(){return{value:void 0,done:!0}}return a(d,"constructor",p.prototype=m),a(m,"constructor",p),p.displayName=a(m,i,"GeneratorFunction"),o.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},o.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,a(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e},o.awrap=function(e){return{__await:e}},y(g.prototype),a(g.prototype,r,function(){return this}),o.AsyncIterator=g,o.async=function(e,t,r,n,i){void 0===i&&(i=Promise);var a=new g(s(e,t,r,n),i);return o.isGeneratorFunction(t)?a:a.next().then(function(e){return e.done?e.value:a.next()})},y(d),a(d,i,"Generator"),a(d,n,function(){return this}),a(d,"toString",function(){return"[object Generator]"}),o.keys=function(r){var e,n=[];for(e in r)n.push(e);return n.reverse(),function e(){for(;n.length;){var t=n.pop();if(t in r)return e.value=t,e.done=!1,e}return e.done=!0,e}},o.values=w,b.prototype={constructor:b,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&u.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function e(e,t){return a.type="throw",a.arg=r,n.next=e,t&&(n.method="next",n.arg=void 0),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var i=this.tryEntries[t],a=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var o=u.call(i,"catchLoc"),s=u.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&u.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}var a=(i=i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc?null:i)?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r,n,i=this.tryEntries[t];if(i.tryLoc===e)return"throw"===(r=i.completion).type&&(n=r.arg,x(i)),n}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:w(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},o}M.exports=r,M.exports.__esModule=!0,M.exports.default=M.exports},function(e,t,r){"use strict";var n=r(3),i=r(167).trim;n({target:"String",proto:!0,forced:r(257)("trim")},{trim:function(){return i(this)}})},function(e,t,r){var n=r(81).PROPER,i=r(7),a=r(168);e.exports=function(e){return i(function(){return!!a[e]()||"​᠎"!=="​᠎"[e]()||n&&a[e].name!==e})}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw i}}return a}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(188);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";var o=r(37),s=r(83),u=r(47);e.exports=function(e){for(var t=o(this),r=u(t),n=arguments.length,i=s(1<n?arguments[1]:void 0,r),n=2<n?arguments[2]:void 0,a=void 0===n?r:s(n,r);i<a;)t[i++]=e;return t}},function(e,t,r){"use strict";r(173)("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},r(179))},function(e,n,o){!function(e){var r;!function(e){function i(e){var n,t=this,r=(n=4022871197,function(e){e=String(e);for(var t=0;t<e.length;t++){var r=.02519603282416938*(n+=e.charCodeAt(t));n=(r=(r-=n=r>>>0)*n)>>>0,n+=4294967296*(r-=n)}return 2.3283064365386963e-10*(n>>>0)});t.next=function(){var e=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=e-(t.c=0|e)},t.c=1,t.s0=r(" "),t.s1=r(" "),t.s2=r(" "),t.s0-=r(e),t.s0<0&&(t.s0+=1),t.s1-=r(e),t.s1<0&&(t.s1+=1),t.s2-=r(e),t.s2<0&&(t.s2+=1)}function a(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function t(e,t){var r=new i(e),e=t&&t.state,n=r.next;return n.int32=function(){return 4294967296*r.next()|0},n.double=function(){return n()+11102230246251565e-32*(2097152*n()|0)},n.quick=n,e&&("object"==typeof e&&a(e,r),n.state=function(){return a(r,{})}),n}e&&e.exports?e.exports=t:o(38)&&o(75)?void 0!==(r=function(){return t}.call(n,o,n,e))&&(e.exports=r):this.alea=t}(e,o(38))}.call(this,o(74)(e))},function(e,n,o){!function(e){var r;!function(e){function i(e){var t=this,r="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:r+=e;for(var n=0;n<r.length+64;n++)t.x^=0|r.charCodeAt(n),t.next()}function a(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function t(e,t){function r(){return(n.next()>>>0)/4294967296}var n=new i(e),e=t&&t.state;return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,e&&("object"==typeof e&&a(e,n),r.state=function(){return a(n,{})}),r}e&&e.exports?e.exports=t:o(38)&&o(75)?void 0!==(r=function(){return t}.call(n,o,n,e))&&(e.exports=r):this.xor128=t}(e,o(38))}.call(this,o(74)(e))},function(e,n,o){!function(e){var r;!function(e){function i(e){var t=this,r="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,e===((t.v=0)|e)?t.x=e:r+=e;for(var n=0;n<r.length+64;n++)t.x^=0|r.charCodeAt(n),n==r.length&&(t.d=t.x<<10^t.x>>>4),t.next()}function a(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function t(e,t){function r(){return(n.next()>>>0)/4294967296}var n=new i(e),e=t&&t.state;return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,e&&("object"==typeof e&&a(e,n),r.state=function(){return a(n,{})}),r}e&&e.exports?e.exports=t:o(38)&&o(75)?void 0!==(r=function(){return t}.call(n,o,n,e))&&(e.exports=r):this.xorwow=t}(e,o(38))}.call(this,o(74)(e))},function(e,n,o){!function(e){var r;!function(e){function i(e){var t,i=this,r=(i.next=function(){var e=i.x,t=i.i,r=e[t],n=(r^=r>>>7)^r<<24;return n=(n=(n^=(r=e[t+1&7])^r>>>10)^((r=e[t+3&7])^r>>>3))^((r=e[t+4&7])^r<<7),r=e[t+7&7],n^=(r^=r<<13)^r<<9,e[t]=n,i.i=t+1&7,n},i),n=e,a=[];if(n===(0|n))a[0]=n;else for(n=""+n,t=0;t<n.length;++t)a[7&t]=a[7&t]<<15^n.charCodeAt(t)+a[t+1&7]<<13;for(;a.length<8;)a.push(0);for(t=0;t<8&&0===a[t];++t);for(8==t?a[7]=-1:a[t],r.x=a,r.i=0,t=256;0<t;--t)r.next()}function a(e,t){return t.x=e.x.slice(),t.i=e.i,t}function t(e,t){function r(){return(n.next()>>>0)/4294967296}var n=new i(e=null==e?+new Date:e),e=t&&t.state;return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,e&&(e.x&&a(e,n),r.state=function(){return a(n,{})}),r}e&&e.exports?e.exports=t:o(38)&&o(75)?void 0!==(r=function(){return t}.call(n,o,n,e))&&(e.exports=r):this.xorshift7=t}(e,o(38))}.call(this,o(74)(e))},function(e,n,o){!function(e){var r;!function(e){function i(e){var t,r,n,i,a,o=this,s=(o.next=function(){var e,t,r=o.w,n=o.X,i=o.i;return o.w=r=r+1640531527|0,t=n[i+34&127],e=n[i=i+1&127],t=n[i]=(t^=t<<13)^t>>>15^((e^=e<<17)^e>>>12),o.i=i,t+(r^r>>>16)|0},o),u=e,c=[],f=128;for(u===(0|u)?(r=u,u=null):(u+="\0",r=0,f=Math.max(f,u.length)),n=0,i=-32;i<f;++i)u&&(r^=u.charCodeAt((i+32)%u.length)),0===i&&(a=r),r=(r=(r=(r^=r<<10)^r>>>15)^r<<4)^r>>>13,0<=i&&(n=0==(t=c[127&i]^=r+(a=a+1640531527|0))?n+1:0);for(128<=n&&(c[127&(u&&u.length||0)]=-1),n=127,i=512;0<i;--i)r=c[n+34&127],t=c[n=n+1&127],c[n]=(r=(r^=r<<13)^r>>>15)^(t=(t^=t<<17)^t>>>12);s.w=a,s.X=c,s.i=n}function a(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function t(e,t){function r(){return(n.next()>>>0)/4294967296}var n=new i(e=null==e?+new Date:e),e=t&&t.state;return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,e&&(e.X&&a(e,n),r.state=function(){return a(n,{})}),r}e&&e.exports?e.exports=t:o(38)&&o(75)?void 0!==(r=function(){return t}.call(n,o,n,e))&&(e.exports=r):this.xor4096=t}(e,o(38))}.call(this,o(74)(e))},function(e,n,o){!function(e){var r;!function(e){function i(e){var i=this,t="";i.next=function(){var e=(e=i.b)<<25^e>>>7^(t=i.c),t=t-(r=i.d)|0,r=r<<24^r>>>8^(n=i.a),n=n-e|0;return i.b=e=e<<20^e>>>12^t,i.c=t=t-r|0,i.d=r<<16^t>>>16^n,i.a=n-e|0},i.a=0,i.b=0,i.c=-1640531527,i.d=1367130551,e===Math.floor(e)?(i.a=e/4294967296|0,i.b=0|e):t+=e;for(var r=0;r<t.length+20;r++)i.b^=0|t.charCodeAt(r),i.next()}function a(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function t(e,t){function r(){return(n.next()>>>0)/4294967296}var n=new i(e),e=t&&t.state;return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,e&&("object"==typeof e&&a(e,n),r.state=function(){return a(n,{})}),r}e&&e.exports?e.exports=t:o(38)&&o(75)?void 0!==(r=function(){return t}.call(n,o,n,e))&&(e.exports=r):this.tychei=t}(e,o(38))}.call(this,o(74)(e))},function(e,t,r){var o,s="undefined"!=typeof self?self:this,u=[],c=Math,f=c.pow(256,6),l=c.pow(2,52),p=2*l;function n(e,t,r){function n(){for(var e=a.g(6),t=f,r=0;e<l;)e=256*(e+r),t*=256,r=a.g(1);for(;p<=e;)e/=2,t/=2,r>>>=1;return(e+r)/t}var i=[],e=d(function e(t,r){var n,i=[],a=typeof t;if(r&&"object"==a)for(n in t)try{i.push(e(t[n],r-1))}catch(e){}return i.length?i:"string"==a?t:t+"\0"}((t=1==t?{entropy:!0}:t||{}).entropy?[e,y(u)]:null==e?function(){try{var e;return o&&(e=o.randomBytes)?e=e(256):(e=new Uint8Array(256),(s.crypto||s.msCrypto).getRandomValues(e)),y(e)}catch(e){var t=s.navigator,t=t&&t.plugins;return[+new Date,s,t,s.screen,y(u)]}}():e,3),i),a=new m(i);return n.int32=function(){return 0|a.g(4)},n.quick=function(){return a.g(4)/4294967296},n.double=n,d(y(a.S),u),(t.pass||r||function(e,t,r,n){return n&&(n.S&&h(n,a),e.state=function(){return h(a,{})}),r?(c.random=e,t):e})(n,e,"global"in t?t.global:this==c,t.state)}function m(e){var t,r=e.length,o=this,n=0,i=o.i=o.j=0,a=o.S=[];for(r||(e=[r++]);n<256;)a[n]=n++;for(n=0;n<256;n++)a[n]=a[i=255&i+e[n%r]+(t=a[n])],a[i]=t;(o.g=function(e){for(var t,r=0,n=o.i,i=o.j,a=o.S;e--;)t=a[n=255&n+1],r=256*r+a[255&(a[n]=a[i=255&i+t])+(a[i]=t)];return o.i=n,o.j=i,r})(256)}function h(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function d(e,t){for(var r,n=e+"",i=0;i<n.length;)t[255&i]=255&(r^=19*t[255&i])+n.charCodeAt(i++);return y(t)}function y(e){return String.fromCharCode.apply(0,e)}if(d(c.random(),u),e.exports){e.exports=n;try{o=r(273)}catch(e){}}else void 0!==(r=function(){return n}.call(t,r,t,e))&&(e.exports=r)},function(e,t){},function(e,t,r){r(3)({target:"String",proto:!0},{repeat:r(170)})},function(a,o,e){"use strict";e.r(o);var t={},r=(e.r(t),e.d(t,"createTyped",function(){return At}),e.d(t,"createResultSet",function(){return _t}),e.d(t,"createBigNumberClass",function(){return kt}),e.d(t,"createComplexClass",function(){return zt}),e.d(t,"createFractionClass",function(){return qt}),e.d(t,"createRangeClass",function(){return Bt}),e.d(t,"createMatrixClass",function(){return Dt}),e.d(t,"createDenseMatrixClass",function(){return Ft}),e.d(t,"createClone",function(){return Ut}),e.d(t,"createIsInteger",function(){return Wt}),e.d(t,"createIsNegative",function(){return Kt}),e.d(t,"createIsNumeric",function(){return er}),e.d(t,"createHasNumericValue",function(){return tr}),e.d(t,"createIsPositive",function(){return rr}),e.d(t,"createIsZero",function(){return nr}),e.d(t,"createIsNaN",function(){return ir}),e.d(t,"createTypeOf",function(){return ar}),e.d(t,"createEqualScalar",function(){return sr}),e.d(t,"createSparseMatrixClass",function(){return ur}),e.d(t,"createNumber",function(){return cr}),e.d(t,"createString",function(){return fr}),e.d(t,"createBoolean",function(){return lr}),e.d(t,"createBignumber",function(){return pr}),e.d(t,"createComplex",function(){return mr}),e.d(t,"createFraction",function(){return hr}),e.d(t,"createMatrix",function(){return dr}),e.d(t,"createMatrixFromFunction",function(){return yr}),e.d(t,"createMatrixFromRows",function(){return vr}),e.d(t,"createMatrixFromColumns",function(){return br}),e.d(t,"createSplitUnit",function(){return wr}),e.d(t,"createUnaryMinus",function(){return Lr}),e.d(t,"createUnaryPlus",function(){return $r}),e.d(t,"createAbs",function(){return Hr}),e.d(t,"createApply",function(){return Gr}),e.d(t,"createAddScalar",function(){return Zr}),e.d(t,"createCbrt",function(){return Wr}),e.d(t,"createCeil",function(){return Xr}),e.d(t,"createCube",function(){return Qr}),e.d(t,"createExp",function(){return Kr}),e.d(t,"createExpm1",function(){return en}),e.d(t,"createFix",function(){return rn}),e.d(t,"createFloor",function(){return an}),e.d(t,"createGcd",function(){return cn}),e.d(t,"createLcm",function(){return pn}),e.d(t,"createLog10",function(){return mn}),e.d(t,"createLog2",function(){return hn}),e.d(t,"createMod",function(){return yn}),e.d(t,"createMultiplyScalar",function(){return gn}),e.d(t,"createMultiply",function(){return vn}),e.d(t,"createNthRoot",function(){return xn}),e.d(t,"createSign",function(){return bn}),e.d(t,"createSqrt",function(){return wn}),e.d(t,"createSquare",function(){return Nn}),e.d(t,"createSubtract",function(){return Mn}),e.d(t,"createXgcd",function(){return Sn}),e.d(t,"createInvmod",function(){return An}),e.d(t,"createDotMultiply",function(){return Cn}),e.d(t,"createBitAnd",function(){return Hn}),e.d(t,"createBitNot",function(){return Gn}),e.d(t,"createBitOr",function(){return Vn}),e.d(t,"createBitXor",function(){return Wn}),e.d(t,"createArg",function(){return Yn}),e.d(t,"createConj",function(){return Jn}),e.d(t,"createIm",function(){return Xn}),e.d(t,"createRe",function(){return Qn}),e.d(t,"createNot",function(){return ni}),e.d(t,"createOr",function(){return ii}),e.d(t,"createXor",function(){return ai}),e.d(t,"createConcat",function(){return oi}),e.d(t,"createColumn",function(){return si}),e.d(t,"createCount",function(){return ui}),e.d(t,"createCross",function(){return ci}),e.d(t,"createDiag",function(){return fi}),e.d(t,"createFilter",function(){return hi}),e.d(t,"createFlatten",function(){return yi}),e.d(t,"createForEach",function(){return gi}),e.d(t,"createGetMatrixDataType",function(){return xi}),e.d(t,"createIdentity",function(){return bi}),e.d(t,"createKron",function(){return wi}),e.d(t,"createMap",function(){return Ni}),e.d(t,"createDiff",function(){return Ei}),e.d(t,"createOnes",function(){return Si}),e.d(t,"createRange",function(){return Ti}),e.d(t,"createReshape",function(){return _i}),e.d(t,"createResize",function(){return ki}),e.d(t,"createRotate",function(){return zi}),e.d(t,"createRotationMatrix",function(){return Ri}),e.d(t,"createRow",function(){return qi}),e.d(t,"createSize",function(){return Bi}),e.d(t,"createSqueeze",function(){return Di}),e.d(t,"createSubset",function(){return ji}),e.d(t,"createTranspose",function(){return $i}),e.d(t,"createCtranspose",function(){return Hi}),e.d(t,"createZeros",function(){return Gi}),e.d(t,"createFft",function(){return Zi}),e.d(t,"createIfft",function(){return Wi}),e.d(t,"createErf",function(){return Yi}),e.d(t,"createMode",function(){return ta}),e.d(t,"createProd",function(){return ra}),e.d(t,"createFormat",function(){return na}),e.d(t,"createBin",function(){return ia}),e.d(t,"createOct",function(){return aa}),e.d(t,"createHex",function(){return oa}),e.d(t,"createPrint",function(){return sa}),e.d(t,"createTo",function(){return ca}),e.d(t,"createIsPrime",function(){return fa}),e.d(t,"createNumeric",function(){return la}),e.d(t,"createDivideScalar",function(){return pa}),e.d(t,"createPow",function(){return ma}),e.d(t,"createRound",function(){return da}),e.d(t,"createLog",function(){return ya}),e.d(t,"createLog1p",function(){return ga}),e.d(t,"createNthRoots",function(){return va}),e.d(t,"createDotPow",function(){return xa}),e.d(t,"createDotDivide",function(){return ba}),e.d(t,"createLsolve",function(){return Na}),e.d(t,"createUsolve",function(){return Ma}),e.d(t,"createLsolveAll",function(){return Ea}),e.d(t,"createUsolveAll",function(){return Sa}),e.d(t,"createLeftShift",function(){return Oa}),e.d(t,"createRightArithShift",function(){return Ca}),e.d(t,"createRightLogShift",function(){return Ta}),e.d(t,"createAnd",function(){return _a}),e.d(t,"createCompare",function(){return Ia}),e.d(t,"createCompareNatural",function(){return za}),e.d(t,"createCompareText",function(){return Ra}),e.d(t,"createEqual",function(){return qa}),e.d(t,"createEqualText",function(){return Ba}),e.d(t,"createSmaller",function(){return Da}),e.d(t,"createSmallerEq",function(){return ja}),e.d(t,"createLarger",function(){return Pa}),e.d(t,"createLargerEq",function(){return Fa}),e.d(t,"createDeepEqual",function(){return Ua}),e.d(t,"createUnequal",function(){return La}),e.d(t,"createPartitionSelect",function(){return $a}),e.d(t,"createSort",function(){return Ha}),e.d(t,"createMax",function(){return Ga}),e.d(t,"createMin",function(){return Va}),e.d(t,"createImmutableDenseMatrixClass",function(){return Za}),e.d(t,"createIndexClass",function(){return Wa}),e.d(t,"createFibonacciHeapClass",function(){return Ya}),e.d(t,"createSpaClass",function(){return Ja}),e.d(t,"createUnitClass",function(){return oo}),e.d(t,"createUnitFunction",function(){return so}),e.d(t,"createSparse",function(){return uo}),e.d(t,"createCreateUnit",function(){return co}),e.d(t,"createAcos",function(){return fo}),e.d(t,"createAcosh",function(){return Co}),e.d(t,"createAcot",function(){return To}),e.d(t,"createAcoth",function(){return _o}),e.d(t,"createAcsc",function(){return Io}),e.d(t,"createAcsch",function(){return ko}),e.d(t,"createAsec",function(){return zo}),e.d(t,"createAsech",function(){return Ro}),e.d(t,"createAsin",function(){return qo}),e.d(t,"createAsinh",function(){return Bo}),e.d(t,"createAtan",function(){return Do}),e.d(t,"createAtan2",function(){return jo}),e.d(t,"createAtanh",function(){return Po}),e.d(t,"createCos",function(){return Fo}),e.d(t,"createCosh",function(){return Uo}),e.d(t,"createCot",function(){return Lo}),e.d(t,"createCoth",function(){return $o}),e.d(t,"createCsc",function(){return Ho}),e.d(t,"createCsch",function(){return Go}),e.d(t,"createSec",function(){return Vo}),e.d(t,"createSech",function(){return Zo}),e.d(t,"createSin",function(){return Wo}),e.d(t,"createSinh",function(){return Yo}),e.d(t,"createTan",function(){return Jo}),e.d(t,"createTanh",function(){return Xo}),e.d(t,"createSetCartesian",function(){return Qo}),e.d(t,"createSetDifference",function(){return Ko}),e.d(t,"createSetDistinct",function(){return es}),e.d(t,"createSetIntersect",function(){return ts}),e.d(t,"createSetIsSubset",function(){return rs}),e.d(t,"createSetMultiplicity",function(){return ns}),e.d(t,"createSetPowerset",function(){return is}),e.d(t,"createSetSize",function(){return as}),e.d(t,"createSetSymDifference",function(){return os}),e.d(t,"createSetUnion",function(){return ss}),e.d(t,"createAdd",function(){return us}),e.d(t,"createHypot",function(){return cs}),e.d(t,"createNorm",function(){return fs}),e.d(t,"createDot",function(){return ls}),e.d(t,"createTrace",function(){return ps}),e.d(t,"createIndex",function(){return ms}),e.d(t,"createNode",function(){return ds}),e.d(t,"createAccessorNode",function(){return gs}),e.d(t,"createArrayNode",function(){return vs}),e.d(t,"createAssignmentNode",function(){return Ns}),e.d(t,"createBlockNode",function(){return Ms}),e.d(t,"createConditionalNode",function(){return Es}),e.d(t,"createConstantNode",function(){return Is}),e.d(t,"createFunctionAssignmentNode",function(){return ks}),e.d(t,"createIndexNode",function(){return zs}),e.d(t,"createObjectNode",function(){return Rs}),e.d(t,"createOperatorNode",function(){return qs}),e.d(t,"createParenthesisNode",function(){return Bs}),e.d(t,"createRangeNode",function(){return Ds}),e.d(t,"createRelationalNode",function(){return js}),e.d(t,"createSymbolNode",function(){return Ps}),e.d(t,"createFunctionNode",function(){return Us}),e.d(t,"createParse",function(){return Ls}),e.d(t,"createCompile",function(){return $s}),e.d(t,"createEvaluate",function(){return Hs}),e.d(t,"createParserClass",function(){return Gs}),e.d(t,"createParser",function(){return Vs}),e.d(t,"createLup",function(){return Zs}),e.d(t,"createQr",function(){return Ws}),e.d(t,"createSlu",function(){return nu}),e.d(t,"createLusolve",function(){return au}),e.d(t,"createHelpClass",function(){return ou}),e.d(t,"createChainClass",function(){return su}),e.d(t,"createHelp",function(){return fu}),e.d(t,"createChain",function(){return lu}),e.d(t,"createDet",function(){return pu}),e.d(t,"createInv",function(){return mu}),e.d(t,"createPinv",function(){return hu}),e.d(t,"createEigs",function(){return vu}),e.d(t,"createExpm",function(){return xu}),e.d(t,"createSqrtm",function(){return bu}),e.d(t,"createDivide",function(){return wu}),e.d(t,"createDistance",function(){return Nu}),e.d(t,"createIntersect",function(){return Mu}),e.d(t,"createSum",function(){return Eu}),e.d(t,"createCumSum",function(){return Su}),e.d(t,"createMean",function(){return Au}),e.d(t,"createMedian",function(){return Ou}),e.d(t,"createMad",function(){return Cu}),e.d(t,"createVariance",function(){return Tu}),e.d(t,"createQuantileSeq",function(){return _u}),e.d(t,"createStd",function(){return Iu}),e.d(t,"createCombinations",function(){return Ru}),e.d(t,"createCombinationsWithRep",function(){return Bu}),e.d(t,"createGamma",function(){return $u}),e.d(t,"createLgamma",function(){return Hu}),e.d(t,"createFactorial",function(){return Gu}),e.d(t,"createKldivergence",function(){return Vu}),e.d(t,"createMultinomial",function(){return Zu}),e.d(t,"createPermutations",function(){return Wu}),e.d(t,"createPickRandom",function(){return Ku}),e.d(t,"createRandom",function(){return tc}),e.d(t,"createRandomInt",function(){return rc}),e.d(t,"createStirlingS2",function(){return nc}),e.d(t,"createBellNumbers",function(){return ic}),e.d(t,"createCatalan",function(){return ac}),e.d(t,"createComposition",function(){return oc}),e.d(t,"createLeafCount",function(){return sc}),e.d(t,"createSimplify",function(){return mc}),e.d(t,"createSimplifyCore",function(){return hc}),e.d(t,"createResolve",function(){return dc}),e.d(t,"createSymbolicEqual",function(){return yc}),e.d(t,"createDerivative",function(){return gc}),e.d(t,"createRationalize",function(){return vc}),e.d(t,"createReviver",function(){return xc}),e.d(t,"createReplacer",function(){return bc}),e.d(t,"createE",function(){return Ic}),e.d(t,"createUppercaseE",function(){return Uc}),e.d(t,"createFalse",function(){return Sc}),e.d(t,"createI",function(){return Pc}),e.d(t,"createInfinity",function(){return Oc}),e.d(t,"createLN10",function(){return Rc}),e.d(t,"createLN2",function(){return zc}),e.d(t,"createLOG10E",function(){return Bc}),e.d(t,"createLOG2E",function(){return qc}),e.d(t,"createNaN",function(){return Cc}),e.d(t,"createNull",function(){return Ac}),e.d(t,"createPhi",function(){return kc}),e.d(t,"createPi",function(){return Tc}),e.d(t,"createUppercasePi",function(){return Fc}),e.d(t,"createSQRT1_2",function(){return Dc}),e.d(t,"createSQRT2",function(){return jc}),e.d(t,"createTau",function(){return _c}),e.d(t,"createTrue",function(){return Ec}),e.d(t,"createVersion",function(){return Lc}),e.d(t,"createAtomicMass",function(){return bf}),e.d(t,"createAvogadro",function(){return wf}),e.d(t,"createBohrMagneton",function(){return Kc}),e.d(t,"createBohrRadius",function(){return of}),e.d(t,"createBoltzmann",function(){return Nf}),e.d(t,"createClassicalElectronRadius",function(){return sf}),e.d(t,"createConductanceQuantum",function(){return ef}),e.d(t,"createCoulomb",function(){return Xc}),e.d(t,"createDeuteronMass",function(){return mf}),e.d(t,"createEfimovFactor",function(){return xf}),e.d(t,"createElectricConstant",function(){return Yc}),e.d(t,"createElectronMass",function(){return uf}),e.d(t,"createElementaryCharge",function(){return Qc}),e.d(t,"createFaraday",function(){return Mf}),e.d(t,"createFermiCoupling",function(){return cf}),e.d(t,"createFineStructure",function(){return ff}),e.d(t,"createFirstRadiation",function(){return Ef}),e.d(t,"createGasConstant",function(){return Af}),e.d(t,"createGravitationConstant",function(){return Gc}),e.d(t,"createGravity",function(){return qf}),e.d(t,"createHartreeEnergy",function(){return lf}),e.d(t,"createInverseConductanceQuantum",function(){return tf}),e.d(t,"createKlitzing",function(){return af}),e.d(t,"createLoschmidt",function(){return Sf}),e.d(t,"createMagneticConstant",function(){return Wc}),e.d(t,"createMagneticFluxQuantum",function(){return rf}),e.d(t,"createMolarMass",function(){return zf}),e.d(t,"createMolarMassC12",function(){return Rf}),e.d(t,"createMolarPlanckConstant",function(){return Of}),e.d(t,"createMolarVolume",function(){return Cf}),e.d(t,"createNeutronMass",function(){return hf}),e.d(t,"createNuclearMagneton",function(){return nf}),e.d(t,"createPlanckCharge",function(){return Pf}),e.d(t,"createPlanckConstant",function(){return Vc}),e.d(t,"createPlanckLength",function(){return Bf}),e.d(t,"createPlanckMass",function(){return Df}),e.d(t,"createPlanckTemperature",function(){return Ff}),e.d(t,"createPlanckTime",function(){return jf}),e.d(t,"createProtonMass",function(){return pf}),e.d(t,"createQuantumOfCirculation",function(){return df}),e.d(t,"createReducedPlanckConstant",function(){return Zc}),e.d(t,"createRydberg",function(){return yf}),e.d(t,"createSackurTetrode",function(){return Tf}),e.d(t,"createSecondRadiation",function(){return _f}),e.d(t,"createSpeedOfLight",function(){return Hc}),e.d(t,"createStefanBoltzmann",function(){return If}),e.d(t,"createThomsonCrossSection",function(){return gf}),e.d(t,"createVacuumImpedance",function(){return Jc}),e.d(t,"createWeakMixingAngle",function(){return vf}),e.d(t,"createWienDisplacement",function(){return kf}),e.d(t,"createApplyTransform",function(){return Lf}),e.d(t,"createColumnTransform",function(){return $f}),e.d(t,"createFilterTransform",function(){return Gf}),e.d(t,"createForEachTransform",function(){return Zf}),e.d(t,"createIndexTransform",function(){return Wf}),e.d(t,"createMapTransform",function(){return Yf}),e.d(t,"createMaxTransform",function(){return Qf}),e.d(t,"createMeanTransform",function(){return Kf}),e.d(t,"createMinTransform",function(){return el}),e.d(t,"createRangeTransform",function(){return tl}),e.d(t,"createRowTransform",function(){return rl}),e.d(t,"createSubsetTransform",function(){return nl}),e.d(t,"createConcatTransform",function(){return il}),e.d(t,"createDiffTransform",function(){return al}),e.d(t,"createStdTransform",function(){return ol}),e.d(t,"createSumTransform",function(){return sl}),e.d(t,"createCumSumTransform",function(){return ul}),e.d(t,"createVarianceTransform",function(){return cl}),e(30),e(5)),Z=e.n(r);function K(e){return"number"==typeof e}function ee(e){return!(!e||"object"!==Z()(e)||"function"!=typeof e.constructor)&&(!0===e.isBigNumber&&"object"===Z()(e.constructor.prototype)&&!0===e.constructor.prototype.isBigNumber||"function"==typeof e.constructor.isDecimal&&!0===e.constructor.isDecimal(e))}function ie(e){return e&&"object"===Z()(e)&&!0===Object.getPrototypeOf(e).isComplex||!1}function ae(e){return e&&"object"===Z()(e)&&!0===Object.getPrototypeOf(e).isFraction||!1}function W(e){return e&&!0===e.constructor.prototype.isUnit||!1}function M(e){return"string"==typeof e}e(149),e(151),e(156),e(10),e(160),e(8);var x=Array.isArray;function F(e){return e&&!0===e.constructor.prototype.isMatrix||!1}function S(e){return Array.isArray(e)||F(e)}function N(e){return e&&e.isDenseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function A(e){return e&&e.isSparseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function O(e){return e&&!0===e.constructor.prototype.isRange||!1}function k(e){return e&&!0===e.constructor.prototype.isIndex||!1}function C(e){return"boolean"==typeof e}function T(e){return e&&!0===e.constructor.prototype.isResultSet||!1}function R(e){return e&&!0===e.constructor.prototype.isHelp||!1}function q(e){return"function"==typeof e}function B(e){return e instanceof Date}function D(e){return e instanceof RegExp}function j(e){return!(!e||"object"!==Z()(e)||e.constructor!==Object||ie(e)||ae(e))}function P(e){return null===e}function $(e){return void 0===e}function he(e){return e&&!0===e.isAccessorNode&&!0===e.constructor.prototype.isNode||!1}function U(e){return e&&!0===e.isArrayNode&&!0===e.constructor.prototype.isNode||!1}function H(e){return e&&!0===e.isAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function G(e){return e&&!0===e.isBlockNode&&!0===e.constructor.prototype.isNode||!1}function V(e){return e&&!0===e.isConditionalNode&&!0===e.constructor.prototype.isNode||!1}function ce(e){return e&&!0===e.isConstantNode&&!0===e.constructor.prototype.isNode||!1}function Y(e){return e&&!0===e.isFunctionAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function de(e){return e&&!0===e.isFunctionNode&&!0===e.constructor.prototype.isNode||!1}function J(e){return e&&!0===e.isIndexNode&&!0===e.constructor.prototype.isNode||!1}function L(e){return e&&!0===e.isNode&&!0===e.constructor.prototype.isNode||!1}function X(e){return e&&!0===e.isObjectNode&&!0===e.constructor.prototype.isNode||!1}function fe(e){return e&&!0===e.isOperatorNode&&!0===e.constructor.prototype.isNode||!1}function Q(e){return e&&!0===e.isParenthesisNode&&!0===e.constructor.prototype.isNode||!1}function oe(e){return e&&!0===e.isRangeNode&&!0===e.constructor.prototype.isNode||!1}function le(e){return e&&!0===e.isSymbolNode&&!0===e.constructor.prototype.isNode||!1}function se(e){return e&&!0===e.constructor.prototype.isChain||!1}function te(e){var t=Z()(e);return"object"===t?null===e?"null":Array.isArray(e)?"Array":e instanceof Date?"Date":e instanceof RegExp?"RegExp":ee(e)?"BigNumber":ie(e)?"Complex":ae(e)?"Fraction":F(e)?"Matrix":W(e)?"Unit":k(e)?"Index":O(e)?"Range":T(e)?"ResultSet":L(e)?e.type:se(e)?"Chain":R(e)?"Help":"Object":"function"===t?"Function":t}var r=e(136),s=e.n(r);function E(e){return"boolean"==typeof e||!!isFinite(e)&&e===Math.round(e)}e(211),e(164),e(212),e(214),e(215),e(216),e(20),e(0),e(73),e(87),e(4),e(51),e(16),e(18),e(29),e(218),e(219),e(220),e(221),e(222),e(223),e(224);var c=Math.sign||function(e){return 0<e?1:e<0?-1:0},f=Math.log2||function(e){return Math.log(e)/Math.LN2},ue=Math.log10||function(e){return Math.log(e)/Math.LN10},ye=Math.log1p||function(e){return Math.log(e+1)},ge=Math.cbrt||function(e){if(0===e)return e;var t,r=e<0;return r&&(e=-e),t=isFinite(e)?(e/((t=Math.exp(Math.log(e)/3))*t)+2*t)/3:e,r?-t:t},ve=Math.expm1||function(e){return 2e-4<=e||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function xe(e,t,r){var n={2:"0b",8:"0o",16:"0x"}[t],i="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!E(r))throw new Error("size must be an integer");if(e>Math.pow(2,r-1)-1||e<-Math.pow(2,r-1))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!E(e))throw new Error("Value must be an integer");e<0&&(e+=Math.pow(2,r)),i="i".concat(r)}r="";return e<0&&(e=-e,r="-"),"".concat(r).concat(n).concat(e.toString(t)).concat(i)}function be(e,t){if("function"==typeof t)return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var r,n,i="auto";if(t&&(t.notation&&(i=t.notation),K(t)?r=t:K(t.precision)&&(r=t.precision),t.wordSize&&"number"!=typeof(n=t.wordSize)))throw new Error('Option "wordSize" must be a number');switch(i){case"fixed":return Ne(e,r);case"exponential":return Me(e,r);case"engineering":var a=e,o=r;if(isNaN(a)||!isFinite(a))return String(a);var s=(a=Ee(we(a),o)).exponent,u=a.coefficients,c=s%3==0?s:s<0?s-3-s%3:s-s%3;if(K(o))for(;o>u.length||s-c+1>u.length;)u.push(0);else for(var f=Math.abs(s-c)-(u.length-1),l=0;l<f;l++)u.push(0);for(var p=Math.abs(s-c),m=1;0<p;)m++,p--;var h=u.slice(m).join(""),h=K(o)&&h.length||h.match(/[1-9]/)?"."+h:"",h=u.slice(0,m).join("")+h+"e"+(0<=s?"+":"")+c.toString();return a.sign+h;case"bin":return xe(e,2,n);case"oct":return xe(e,8,n);case"hex":return xe(e,16,n);case"auto":return function(e,t,r){if(isNaN(e)||!isFinite(e))return String(e);var n=r&&void 0!==r.lowerExp?r.lowerExp:-3,r=r&&void 0!==r.upperExp?r.upperExp:5,i=we(e),i=t?Ee(i,t):i;if(i.exponent<n||i.exponent>=r)return Me(e,t);n=i.coefficients,r=i.exponent,n=(n=n.length<t?n.concat(Se(t-n.length)):n).concat(Se(r-n.length+1+(n.length<t?t-n.length:0))),e=0<r?r:0;return e<(n=Se(-r).concat(n)).length-1&&n.splice(e+1,0,"."),i.sign+n.join("")}(e,r,t).replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t});default:throw new Error('Unknown notation "'+i+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function we(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var e=t[1],r=t[2],n=parseFloat(t[4]||"0"),t=r.indexOf("."),t=(n+=-1!==t?t-1:r.length-1,r.replace(".","").replace(/^0*/,function(e){return n-=e.length,""}).replace(/0*$/,"").split("").map(function(e){return parseInt(e)}));return 0===t.length&&(t.push(0),n++),{sign:e,coefficients:t,exponent:n}}function Ne(e,t){if(isNaN(e)||!isFinite(e))return String(e);var e=we(e),e="number"==typeof t?Ee(e,e.exponent+1+t):e,r=e.coefficients,n=e.exponent+1,t=n+(t||0);return r.length<t&&(r=r.concat(Se(t-r.length))),n<0&&(r=Se(1-n).concat(r),n=1),n<r.length&&r.splice(n,0,0===n?"0.":"."),e.sign+r.join("")}function Me(e,t){if(isNaN(e)||!isFinite(e))return String(e);var e=we(e),e=t?Ee(e,t):e,r=e.coefficients,n=e.exponent,t=(r=r.length<t?r.concat(Se(t-r.length)):r).shift();return e.sign+t+(0<r.length?"."+r.join(""):"")+"e"+(0<=n?"+":"")+n}function Ee(e,t){for(var r={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},n=r.coefficients;t<=0;)n.unshift(0),r.exponent++,t++;if(n.length>t&&5<=n.splice(t,n.length-t)[0]){var i=t-1;for(n[i]++;10===n[i];)n.pop(),0===i&&(n.unshift(0),r.exponent++,i++),n[--i]++}return r}function Se(e){for(var t=[],r=0;r<e;r++)t.push(0);return t}var Ae=Number.EPSILON||2220446049250313e-31;function Oe(e,t,r){return null==r?e===t:e===t||!isNaN(e)&&!isNaN(t)&&(!(!isFinite(e)||!isFinite(t))&&((n=Math.abs(e-t))<Ae||n<=Math.max(Math.abs(e),Math.abs(t))*r));var n}var Ce=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)},Te=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},_e=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},Ie=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},ke=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},ze=Math.tanh||function(e){e=Math.exp(2*e);return(e-1)/(e+1)};function Re(e,t,r){var n=new e.constructor(2),i="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!E(r))throw new Error("size must be an integer");if(e.greaterThan(n.pow(r-1).sub(1))||e.lessThan(n.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(n.pow(r))),i="i".concat(r)}switch(t){case 2:return"".concat(e.toBinary()).concat(i);case 8:return"".concat(e.toOctal()).concat(i);case 16:return"".concat(e.toHexadecimal()).concat(i);default:throw new Error("Base ".concat(t," not supported "))}}function qe(e,t){return void 0!==t?e.toExponential(t-1):e.toExponential()}function re(e,t){e=function(t,r){{if("number"==typeof t)return be(t,r);if(!ee(t))return(p=t)&&"object"===Z()(p)&&"number"==typeof p.s&&"number"==typeof p.n&&"number"==typeof p.d?r&&"decimal"===r.fraction?t.toString():t.s*t.n+"/"+t.d:Array.isArray(t)?function e(t,r){if(Array.isArray(t)){for(var n="[",i=t.length,a=0;a<i;a++)0!==a&&(n+=", "),n+=e(t[a],r);return n+"]"}return re(t,r)}(t,r):M(t)?'"'+t+'"':"function"==typeof t?t.syntax?String(t.syntax):"function":t&&"object"===Z()(t)?"function"==typeof t.format?t.format(r):t&&t.toString(r)!=={}.toString()?t.toString(r):"{"+Object.keys(t).map(function(e){return'"'+e+'": '+re(t[e],r)}).join(", ")+"}":String(t);var e=t,n=r;if("function"==typeof n)return n(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var i,a,o,s="auto";if(void 0!==n&&(n.notation&&(s=n.notation),"number"==typeof n?i=n:n.precision&&(i=n.precision),n.wordSize&&"number"!=typeof(a=n.wordSize)))throw new Error('Option "wordSize" must be a number');switch(s){case"fixed":return o=i,e.toFixed(o);case"exponential":return qe(e,i);case"engineering":return o=i,c=(u=e).e,f=c%3==0?c:c<0?c-3-c%3:c-c%3,u=u.mul(Math.pow(10,-f)),(o=-1!==(o=u.toPrecision(o)).indexOf("e")?u.toString():o)+"e"+(0<=c?"+":"")+f.toString();case"bin":return Re(e,2,a);case"oct":return Re(e,8,a);case"hex":return Re(e,16,a);case"auto":var u=n&&void 0!==n.lowerExp?n.lowerExp:-3,c=n&&void 0!==n.upperExp?n.upperExp:5;if(e.isZero())return"0";var f=e.toSignificantDigits(i),l=f.e;return(u<=l&&l<c?f.toFixed():qe(e,i)).replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t});default:throw new Error('Unknown notation "'+s+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}var p}(e,t);return t&&"object"===Z()(t)&&"truncate"in t&&e.length>t.truncate?e.substring(0,t.truncate-3)+"...":e}function Be(e){for(var t=String(e),r="",n=0;n<t.length;){var i=t.charAt(n);"\\"===i?(r+=i,n++,""!==(i=t.charAt(n))&&-1!=='"\\/bfnrtu'.indexOf(i)||(r+="\\"),r+=i):r+='"'===i?'\\"':i,n++}return'"'+r+'"'}function De(e){e=String(e);return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function je(e,t){if(!M(e))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+te(e)+", index: 0)");if(M(t))return e===t?0:t<e?1:-1;throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+te(t)+", index: 1)")}function z(e,t,r){if(!(this instanceof z))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}function Pe(e,t,r){if(!(this instanceof Pe))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),void 0!==this.min&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":void 0!==this.max&&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}function _(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function Fe(e,t){if(0===t.length){if(Array.isArray(e))throw new z(e.length,0)}else!function e(t,r,n){var i=t.length;if(i!==r[n])throw new z(i,r[n]);if(n<r.length-1)for(var a=n+1,o=0;o<i;o++){var s=t[o];if(!Array.isArray(s))throw new z(r.length-1,r.length,"<");e(t[o],r,a)}else for(o=0;o<i;o++)if(Array.isArray(t[o]))throw new z(r.length+1,r.length,">")}(e,t,0)}function I(e,t){if(!K(e)||!E(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||"number"==typeof t&&t<=e)throw new Pe(e,t)}function Ue(e,t,r){if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(0===t.length)throw new Error("Resizing to scalar is not supported");return t.forEach(function(e){if(!K(e)||!E(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+re(t)+")")}),function e(t,r,n,i){var a,o=t.length,s=r[n],u=Math.min(o,s);if(t.length=s,n<r.length-1){for(var c=n+1,f=0;f<u;f++)a=t[f],Array.isArray(a)||(t[f]=a=[a]),e(a,r,c,i);for(f=u;f<s;f++)e(t[f]=a=[],r,c,i)}else{for(f=0;f<u;f++)for(;Array.isArray(t[f]);)t[f]=t[f][0];for(f=u;f<s;f++)t[f]=i}}(e,t,0,void 0!==r?r:0),e}function Le(e,t){var r=b(e),n=r.length;if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(0===t.length)throw new z(0,n,"!=");var i=He(t=$e(t,n));if(n!==i)throw new z(i,n,"!=");try{for(var a=t,o=r,s=a.length-1;0<s;s--){for(var u=a[s],c=[],f=o.length/u,l=0;l<f;l++)c.push(o.slice(l*u,(l+1)*u));o=c}return o}catch(e){if(e instanceof z)throw new z(i,n,"!=");throw e}}function $e(e,t){var r=He(e),n=e.slice(),i=e.indexOf(-1);if(0<=e.indexOf(-1,i+1))throw new Error("More than one wildcard in sizes");if(0<=i){if(t%r!=0)throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-r);n[i]=-t/r}return n}function He(e){return e.reduce(function(e,t){return e*t},1)}function Ge(e,t){for(var r=t||_(e);Array.isArray(e)&&1===e.length;)e=e[0],r.shift();for(var n=r.length;1===r[n-1];)n--;return n<r.length&&(e=function e(t,r,n){if(n<r)for(var i=n+1,a=0,o=t.length;a<o;a++)t[a]=e(t[a],r,i);else for(;Array.isArray(t);)t=t[0];return t}(e,n,0),r.length=n),e}function Ve(e,t,r,n){var i=n||_(e);if(r)for(var a=0;a<r;a++)e=[e],i.unshift(1);for(e=function e(t,r,n){if(Array.isArray(t))for(var i=n+1,a=0,o=t.length;a<o;a++)t[a]=e(t[a],r,i);else for(var s=n;s<r;s++)t=[t];return t}(e,t,0);i.length<t;)i.push(1);return e}function b(e){if(!Array.isArray(e))return e;var r=[];return e.forEach(function e(t){Array.isArray(t)?t.forEach(e):r.push(t)}),r}function Ze(e,t){return Array.prototype.map.call(e,t)}function We(e,t){Array.prototype.forEach.call(e,t)}function Ye(e,t){if(1!==_(e).length)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,t)}function Je(e,t){if(1!==_(e).length)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,function(e){return t.test(e)})}function Xe(e,t){return Array.prototype.join.call(e,t)}function Qe(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(0===e.length)return e;var t=[],r=0;t[0]={value:e[0],identifier:0};for(var n=1;n<e.length;n++)e[n]===e[n-1]?r++:r=0,t.push({value:e[n],identifier:r});return t}function Ke(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(0===e.length)return e;for(var t=[],r=0;r<e.length;r++)t.push(e[r].value);return t}function et(e,t){for(var r,n=0,i=0;i<e.length;i++){var a=e[i],o=Array.isArray(a);if(0===i&&o&&(n=a.length),o&&a.length!==n)return;o=o?et(a,t):t(a);if(void 0===r)r=o;else if(r!==o)return"mixed"}return r}function tt(e,t){return-1!==e.indexOf(t)}function ne(e){var t=Z()(e);if("number"===t||"string"===t||"boolean"===t||null==e)return e;if("function"==typeof e.clone)return e.clone();if(Array.isArray(e))return e.map(ne);if(e instanceof Date)return new Date(e.valueOf());if(ee(e))return e;if(e instanceof RegExp)throw new TypeError("Cannot clone "+e);return rt(e,ne)}function rt(e,t){var r,n={};for(r in e)pe(e,r)&&(n[r]=t(e[r]));return n}function nt(e,t){for(var r in t)pe(t,r)&&(e[r]=t[r]);return e}function it(e,t){var r,n,i;if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(n=0,i=e.length;n<i;n++)if(!it(e[n],t[n]))return!1;return!0}if("function"==typeof e)return e===t;if(e instanceof Object){if(Array.isArray(t)||!(t instanceof Object))return!1;for(r in e)if(!(r in t&&it(e[r],t[r])))return!1;for(r in t)if(!(r in e))return!1;return!0}return e===t}function at(e,t,r){var n,i=!0;Object.defineProperty(e,t,{get:function(){return i&&(n=r(),i=!1),n},set:function(e){n=e,i=!1},configurable:!0,enumerable:!0})}function pe(e,t){return e&&Object.hasOwnProperty.call(e,t)}function ot(t){return Object.keys(t).map(function(e){return t[e]})}function l(a,o,s,e){function t(e){var t=function(e,t){for(var r={},n=0;n<t.length;n++){var i=t[n],a=e[i];void 0!==a&&(r[i]=a)}return r}(e,o.map(ut)),r=a,n=o,i=e;if(n.filter(function(e){return!(e&&"?"===e[0])}).every(function(e){return void 0!==i[e]}))return s(t);throw n=n.filter(function(e){return void 0===i[e]}),new Error('Cannot create function "'.concat(r,'", ')+"some dependencies are missing: ".concat(n.map(function(e){return'"'.concat(e,'"')}).join(", "),"."))}return t.isFactory=!0,t.fn=a,t.dependencies=o.slice().sort(),e&&(t.meta=e),t}function st(e){return"function"==typeof e&&"string"==typeof e.fn&&Array.isArray(e.dependencies)}function ut(e){return e&&"?"===e[0]?e.slice(1):e}e(42),e(6),e(13),e(36),e(48),e(34),e(88),e(169),(z.prototype=new RangeError).constructor=RangeError,z.prototype.name="DimensionError",z.prototype.isDimensionError=!0,(Pe.prototype=new RangeError).constructor=RangeError,Pe.prototype.name="IndexError",Pe.prototype.isIndexError=!0;var r=e(193),ct=e.n(r),r=e(194),r=e.n(r);function ft(e,t){if(ht(e)&&pt(e,t))return e[t];if("function"==typeof e[t]&&mt(e,t))throw new Error('Cannot access method "'+t+'" as a property');throw new Error('No access to property "'+t+'"')}function lt(e,t,r){if(ht(e)&&pt(e,t))return e[t]=r;throw new Error('No access to property "'+t+'"')}function pt(e,t){return e&&"object"===Z()(e)&&(pe(dt,t)||!(t in Object.prototype)&&!(t in Function.prototype))}function mt(e,t){return null!=e&&"function"==typeof e[t]&&!(pe(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e))&&(pe(yt,t)||!(t in Object.prototype)&&!(t in Function.prototype))}function ht(e){return"object"===Z()(e)&&e&&e.constructor===Object}e(27),e(172),e(43),e(31),e(62),e(44),e(52),e(56);var dt={length:!0,name:!0},yt={toString:!0,valueOf:!0,toLocaleString:!0};function gt(e,t){var r,n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e){if(e){if("string"==typeof e)return vt(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(t="Object"===t&&e.constructor?e.constructor.name:t)||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?vt(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length)return n&&(e=n),r=0,{s:t=function(){},n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(o)throw i}}}}function vt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}r()(bt,[{key:"keys",value:function(){return Object.keys(this.wrappedObject)}},{key:"get",value:function(e){return ft(this.wrappedObject,e)}},{key:"set",value:function(e,t){return lt(this.wrappedObject,e,t),this}},{key:"has",value:function(e){return e in this.wrappedObject}}]);var xt=bt;function bt(e){ct()(this,bt),this.wrappedObject=e}function wt(){return new Map}function Nt(e){if(!e)return wt();if(Mt(e))return e;if(j(e))return new xt(e);throw new Error("createMap can create maps from objects or Maps")}function Mt(e){return!!e&&(e instanceof Map||e instanceof xt||"function"==typeof e.set&&"function"==typeof e.get&&"function"==typeof e.keys&&"function"==typeof e.has)}function Et(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var i=0,a=r;i<a.length;i++){var o=a[i];if(o)if(Mt(o)){var s,u=gt(o.keys());try{for(u.s();!(s=u.n()).done;){var c=s.value;e.set(c,o.get(c))}}catch(e){u.e(e)}finally{u.f()}}else if(j(o))for(var f=0,l=Object.keys(o);f<l.length;f++){var p=l[f];e.set(p,o[p])}}return e}var St=function(){return St=s.a.create,s.a},At=l("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],function(e){var r=e.BigNumber,n=e.Complex,t=e.DenseMatrix,i=e.Fraction,e=St();return e.types=[{name:"number",test:K},{name:"Complex",test:ie},{name:"BigNumber",test:ee},{name:"Fraction",test:ae},{name:"Unit",test:W},{name:"string",test:M},{name:"Chain",test:se},{name:"Array",test:x},{name:"Matrix",test:F},{name:"DenseMatrix",test:N},{name:"SparseMatrix",test:A},{name:"Range",test:O},{name:"Index",test:k},{name:"boolean",test:C},{name:"ResultSet",test:T},{name:"Help",test:R},{name:"function",test:q},{name:"Date",test:B},{name:"RegExp",test:D},{name:"null",test:P},{name:"undefined",test:$},{name:"AccessorNode",test:he},{name:"ArrayNode",test:U},{name:"AssignmentNode",test:H},{name:"BlockNode",test:G},{name:"ConditionalNode",test:V},{name:"ConstantNode",test:ce},{name:"FunctionNode",test:de},{name:"FunctionAssignmentNode",test:Y},{name:"IndexNode",test:J},{name:"Node",test:L},{name:"ObjectNode",test:X},{name:"OperatorNode",test:fe},{name:"ParenthesisNode",test:Q},{name:"RangeNode",test:oe},{name:"SymbolNode",test:le},{name:"Map",test:Mt},{name:"Object",test:j}],e.conversions=[{from:"number",to:"BigNumber",convert:function(e){if(r||Ot(e),15<e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+e+"). Use function bignumber(x) to convert to BigNumber.");return new r(e)}},{from:"number",to:"Complex",convert:function(e){return n||Ct(e),new n(e,0)}},{from:"number",to:"string",convert:function(e){return e+""}},{from:"BigNumber",to:"Complex",convert:function(e){return n||Ct(e),new n(e.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(e){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(e){return n||Ct(e),new n(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){i||Tt(e);var t=new i(e);if(t.valueOf()!==e)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+e+"). Use function fraction(x) to convert to Fraction.");return t}},{from:"string",to:"number",convert:function(e){var t=Number(e);if(isNaN(t))throw new Error('Cannot convert "'+e+'" to a number');return t}},{from:"string",to:"BigNumber",convert:function(t){r||Ot(t);try{return new r(t)}catch(e){throw new Error('Cannot convert "'+t+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(t){i||Tt(t);try{return new i(t)}catch(e){throw new Error('Cannot convert "'+t+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(t){n||Ct(t);try{return new n(t)}catch(e){throw new Error('Cannot convert "'+t+'" to Complex')}}},{from:"boolean",to:"number",convert:function(e){return+e}},{from:"boolean",to:"BigNumber",convert:function(e){return r||Ot(e),new r(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return i||Tt(e),new i(+e)}},{from:"boolean",to:"string",convert:function(e){return String(e)}},{from:"Array",to:"Matrix",convert:function(e){if(t)return new t(e);throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}},{from:"Matrix",to:"Array",convert:function(e){return e.valueOf()}}],e});function Ot(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function Ct(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function Tt(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}e(14);var _t=l("ResultSet",[],function(){function t(e){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");this.entries=e||[]}return t.prototype.type="ResultSet",t.prototype.isResultSet=!0,t.prototype.valueOf=function(){return this.entries},t.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},t.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},t.fromJSON=function(e){return new t(e.entries)},t},{isClass:!0}),r=e(63),It=e.n(r),kt=l("BigNumber",["?on","config"],function(e){var t=e.on,e=e.config,r=It.a.clone({precision:e.precision,modulo:It.a.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(e){return new r(e.value)},t&&t("config",function(e,t){e.precision!==t.precision&&r.config({precision:e.precision})}),r},{isClass:!0}),r=e(33),n=e.n(r),zt=l("Complex",[],function(){return n.a.prototype.type="Complex",n.a.prototype.isComplex=!0,n.a.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},n.a.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},n.a.prototype.format=function(e){var t=this.im,r=this.re,n=be(this.re,e),i=be(this.im,e),e=K(e)?e:e?e.precision:null;return null!==e&&(e=Math.pow(10,-e),Math.abs(r/t)<e&&(r=0),Math.abs(t/r)<e&&(t=0)),0===t?n:0===r?1===t?"i":-1===t?"-i":i+"i":t<0?-1===t?n+" - i":n+" - "+i.substring(1)+"i":1===t?n+" + i":n+" + "+i+"i"},n.a.fromPolar=function(e){switch(arguments.length){case 1:var t=e;if("object"===Z()(t))return n()(t);throw new TypeError("Input has to be an object with r and phi keys.");case 2:var t=e,r=arguments[1];if(K(t)){if(K(r=W(r)&&r.hasBase("ANGLE")?r.toNumber("rad"):r))return new n.a({r:t,phi:r});throw new TypeError("Phi is not a number nor an angle unit.")}throw new TypeError("Radius r is not a number.");default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},n.a.prototype.valueOf=n.a.prototype.toString,n.a.fromJSON=function(e){return new n.a(e)},n.a.compare=function(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0},n.a},{isClass:!0}),r=e(64),Rt=e.n(r),qt=l("Fraction",[],function(){return Rt.a.prototype.type="Fraction",Rt.a.prototype.isFraction=!0,Rt.a.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Rt.a.fromJSON=function(e){return new Rt.a(e)},Rt.a},{isClass:!0}),Bt=(e(11),l("Range",[],function(){function o(e,t,r){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");var n=null!=e,i=null!=t,a=null!=r;if(n)if(ee(e))e=e.toNumber();else if("number"!=typeof e)throw new TypeError("Parameter start must be a number");if(i)if(ee(t))t=t.toNumber();else if("number"!=typeof t)throw new TypeError("Parameter end must be a number");if(a)if(ee(r))r=r.toNumber();else if("number"!=typeof r)throw new TypeError("Parameter step must be a number");this.start=n?parseFloat(e):0,this.end=i?parseFloat(t):0,this.step=a?parseFloat(r):1}return o.prototype.type="Range",o.prototype.isRange=!0,o.parse=function(e){if("string"!=typeof e)return null;var t=e.split(":").map(function(e){return parseFloat(e)});if(t.some(function(e){return isNaN(e)}))return null;switch(t.length){case 2:return new o(t[0],t[1]);case 3:return new o(t[0],t[2],t[1]);default:return null}},o.prototype.clone=function(){return new o(this.start,this.end,this.step)},o.prototype.size=function(){var e=0,t=this.start,r=this.step,t=this.end-t;return c(r)===c(t)?e=Math.ceil(t/r):0==t&&(e=0),[e=isNaN(e)?0:e]},o.prototype.min=function(){var e=this.size()[0];return 0<e?0<this.step?this.start:this.start+(e-1)*this.step:void 0},o.prototype.max=function(){var e=this.size()[0];return 0<e?0<this.step?this.start+(e-1)*this.step:this.start:void 0},o.prototype.forEach=function(e){var t=this.start,r=this.step,n=this.end,i=0;if(0<r)for(;t<n;)e(t,[i],this),t+=r,i++;else if(r<0)for(;n<t;)e(t,[i],this),t+=r,i++},o.prototype.map=function(n){var i=[];return this.forEach(function(e,t,r){i[t[0]]=n(e,t,r)}),i},o.prototype.toArray=function(){var r=[];return this.forEach(function(e,t){r[t[0]]=e}),r},o.prototype.valueOf=function(){return this.toArray()},o.prototype.format=function(e){var t=be(this.start,e);return 1!==this.step&&(t+=":"+be(this.step,e)),t+(":"+be(this.end,e))},o.prototype.toString=function(){return this.format()},o.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},o.fromJSON=function(e){return new o(e.start,e.end,e.step)},o},{isClass:!0})),Dt=l("Matrix",[],function(){function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(e,t){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(e,t,r){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(e,t,r){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(e,t){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(e,t){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(e,t){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(e){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0}),r=e(58),jt=e.n(r);function Pt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ft=l("DenseMatrix",["Matrix"],function(e){e=e.Matrix;function g(e,t){if(!(this instanceof g))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!M(t))throw new Error("Invalid datatype: "+t);if(F(e))"DenseMatrix"===e.type?(this._data=ne(e._data),this._size=ne(e._size)):(this._data=e.toArray(),this._size=e.size()),this._datatype=t||e._datatype;else if(e&&x(e.data)&&x(e.size))this._data=e.data,this._size=e.size,Fe(this._data,this._size),this._datatype=t||e.datatype;else if(x(e))this._data=function e(t){for(var r=0,n=t.length;r<n;r++){var i=t[r];x(i)?t[r]=e(i):i&&!0===i.isMatrix&&(t[r]=e(i.valueOf()))}return t}(e),this._size=_(this._data),Fe(this._data,this._size),this._datatype=t;else{if(e)throw new TypeError("Unsupported type of data ("+te(e)+")");this._data=[],this._size=[0],this._datatype=t}}function s(e,t,r){if(0!==t.length)return e._size=t.slice(0),e._data=Ue(e._data,e._size,r),e;for(var n=e._data;x(n);)n=n[0];return n}function v(e,t,r){for(var n=e._size.slice(0),i=!1;n.length<t.length;)n.push(0),i=!0;for(var a=0,o=t.length;a<o;a++)t[a]>n[a]&&(n[a]=t[a],i=!0);i&&s(e,n,r)}return(g.prototype=new e).createDenseMatrix=function(e,t){return new g(e,t)},g.prototype.type="DenseMatrix",g.prototype.isDenseMatrix=!0,g.prototype.getDataType=function(){return et(this._data,te)},g.prototype.storage=function(){return"dense"},g.prototype.datatype=function(){return this._datatype},g.prototype.create=function(e,t){return new g(e,t)},g.prototype.subset=function(e,t,r){switch(arguments.length){case 1:var n=this,i=e;if(!k(i))throw new TypeError("Invalid index");if(i.isScalar())return n.get(i.min());var a=i.size();if(a.length!==n._size.length)throw new z(a.length,n._size.length);for(var o=i.min(),s=i.max(),u=0,c=n._size.length;u<c;u++)I(o[u],n._size[u]),I(s[u],n._size[u]);return new g(function t(r,n,i,a){var e=a===i-1,o=n.dimension(a);return(e?o.map(function(e){return I(e,r.length),r[e]}):o.map(function(e){I(e,r.length);e=r[e];return t(e,n,i,a+1)})).valueOf()}(n._data,i,a.length,0),n._datatype);case 2:case 3:var i=this,a=e,f=t,l=r;if(!a||!0!==a.isIndex)throw new TypeError("Invalid index");var p,m=a.size(),h=a.isScalar();if(F(f)?(p=f.size(),f=f.valueOf()):p=_(f),h){if(0!==p.length)throw new TypeError("Scalar expected");i.set(a.min(),f,l)}else{if(m.length<i._size.length)throw new z(m.length,i._size.length,"<");if(p.length<m.length){for(var d=0,y=0;1===m[d]&&1===p[d];)d++;for(;1===m[d];)y++,d++;f=Ve(f,m.length,y,p)}if(!it(m,p))throw new z(m,p,">");v(i,a.max().map(function(e){return e+1}),l);h=m.length;!function r(n,i,a,o,s){var e=s===o-1,t=i.dimension(s);e?t.forEach(function(e,t){I(e),n[e]=a[t[0]]}):t.forEach(function(e,t){I(e),r(n[e],i,a[t[0]],o,s+1)})}(i._data,a,f,h,0)}return i;default:throw new SyntaxError("Wrong number of arguments")}},g.prototype.get=function(e){if(!x(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new z(e.length,this._size.length);for(var t=0;t<e.length;t++)I(e[t],this._size[t]);for(var r=this._data,n=0,i=e.length;n<i;n++){var a=e[n];I(a,r.length),r=r[a]}return r},g.prototype.set=function(e,t,r){if(!x(e))throw new TypeError("Array expected");if(e.length<this._size.length)throw new z(e.length,this._size.length,"<");v(this,e.map(function(e){return e+1}),r);for(var n,i=this._data,a=0,o=e.length-1;a<o;a++)I(n=e[a],i.length),i=i[n];return I(n=e[e.length-1],i.length),i[n]=t,this},g.prototype.resize=function(e,t,r){if(!S(e))throw new TypeError("Array or Matrix expected");e=e.valueOf().map(function(e){return Array.isArray(e)&&1===e.length?e[0]:e});return s(r?this.clone():this,e,t)},g.prototype.reshape=function(e,t){var t=t?this.clone():this,r=(t._data=Le(t._data,e),t._size.reduce(function(e,t){return e*t}));return t._size=$e(e,r),t},g.prototype.clone=function(){return new g({data:ne(this._data),size:ne(this._size),datatype:this._datatype})},g.prototype.size=function(){return this._size.slice(0)},g.prototype.map=function(t){var i=this,e=function r(e,n){return x(e)?e.map(function(e,t){return r(e,n.concat(t))}):t(e,n,i)}(this._data,[]);return new g(e,void 0!==this._datatype?et(e,te):void 0)},g.prototype.forEach=function(t){var i=this;!function r(e,n){x(e)?e.forEach(function(e,t){r(e,n.concat(t))}):t(e,n,i)}(this._data,[])},g.prototype[Symbol.iterator]=jt.a.mark(function e(){var t;return jt.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=jt.a.mark(function t(r,n){var i;return jt.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!x(r)){e.next=9;break}i=0;case 2:if(i<r.length)return e.delegateYield(t(r[i],n.concat(i)),"t0",4);e.next=7;break;case 4:i++,e.next=2;break;case 7:e.next=11;break;case 9:return e.next=11,{value:r,index:n};case 11:case"end":return e.stop()}},t)}),e.delegateYield(t(this._data,[]),"t0",2);case 2:case"end":return e.stop()}},e,this)}),g.prototype.rows=function(){var e=[];if(2!==this.size().length)throw new TypeError("Rows can only be returned for a 2D matrix.");var t,r=function(e,t){var r,n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e){if(e){if("string"==typeof e)return Pt(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(t="Object"===t&&e.constructor?e.constructor.name:t)||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Pt(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length)return n&&(e=n),r=0,{s:t=function(){},n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(o)throw i}}}}(this._data);try{for(r.s();!(t=r.n()).done;){var n=t.value;e.push(new g([n],this._datatype))}}catch(e){r.e(e)}finally{r.f()}return e},g.prototype.columns=function(){var r=this,n=[],e=this.size();if(2!==e.length)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var i=this._data,t=0;t<e[1];t++)!function(t){var e=i.map(function(e){return[e[t]]});n.push(new g(e,r._datatype))}(t);return n},g.prototype.toArray=function(){return ne(this._data)},g.prototype.valueOf=function(){return this._data},g.prototype.format=function(e){return re(this._data,e)},g.prototype.toString=function(){return re(this._data)},g.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},g.prototype.diagonal=function(e){if(e){if(!K(e=ee(e)?e.toNumber():e)||!E(e))throw new TypeError("The parameter k must be an integer number")}else e=0;for(var t=0<e?e:0,r=e<0?-e:0,e=this._size[0],n=this._size[1],i=Math.min(e-r,n-t),a=[],o=0;o<i;o++)a[o]=this._data[o+r][o+t];return new g({data:a,size:[i],datatype:this._datatype})},g.diagonal=function(e,t,r,n){if(!x(e))throw new TypeError("Array expected, size parameter");if(2!==e.length)throw new Error("Only two dimensions matrix are supported");if(e=e.map(function(e){if(!K(e=ee(e)?e.toNumber():e)||!E(e)||e<1)throw new Error("Size values must be positive integers");return e}),r){if(!K(r=ee(r)?r.toNumber():r)||!E(r))throw new TypeError("The parameter k must be an integer number")}else r=0;var i,a=0<r?r:0,o=r<0?-r:0,r=e[0],s=e[1],u=Math.min(r-o,s-a);if(x(t)){if(t.length!==u)throw new Error("Invalid value array length");i=function(e){return t[e]}}else if(F(t)){var c=t.size();if(1!==c.length||c[0]!==u)throw new Error("Invalid matrix length");i=function(e){return t.get([e])}}else i=function(){return t};n=n||(ee(i(0))?i(0).mul(0):0);var f=[];if(0<e.length)for(var f=Ue(f,e,n),l=0;l<u;l++)f[l+o][l+a]=i(l);return new g({data:f,size:[r,s]})},g.fromJSON=function(e){return new g(e)},g.prototype.swapRows=function(e,t){if(!(K(e)&&E(e)&&K(t)&&E(t)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return I(e,this._size[0]),I(t,this._size[0]),g._swapRows(e,t,this._data),this},g._swapRows=function(e,t,r){var n=r[e];r[e]=r[t],r[t]=n},g},{isClass:!0}),Ut=l("clone",["typed"],function(e){return(0,e.typed)("clone",{any:ne})});function Lt(e){for(var t=e.length,r=e[0].length,n=[],i=0;i<r;i++){for(var a=[],o=0;o<t;o++)a.push(e[o][i]);n.push(a)}return n}function $t(e){for(var t=0;t<e.length;t++)if(S(e[t]))return 1}function Ht(e,t){for(var r=0,n=(e=F(e)?e.valueOf():e).length;r<n;r++){var i=e[r];Array.isArray(i)?Ht(i,t):t(i)}}function me(e,t,r){return e&&"function"==typeof e.map?e.map(function(e){return me(e,t,r)}):t(e)}function Gt(e,t,r){var n=Array.isArray(e)?_(e):e.size();if(t<0||t>=n.length)throw new Pe(t,n.length);return F(e)?e.create(Vt(e.valueOf(),t,r)):Vt(e,t,r)}function Vt(e,t,r){var n,i,a,o;if(t<=0){if(Array.isArray(e[0])){for(o=Lt(e),i=[],n=0;n<o.length;n++)i[n]=Vt(o[n],t-1,r);return i}for(a=e[0],n=1;n<e.length;n++)a=r(a,e[n]);return a}for(i=[],n=0;n<e.length;n++)i[n]=Vt(e[n],t-1,r);return i}function Zt(e,t,r,n,i,a,o,s,u,c,f){var l,p,m,h,d=e._values,y=e._index,e=e._ptr;if(n)for(p=e[t],m=e[t+1],l=p;l<m;l++)r[h=y[l]]!==a?(r[h]=a,o.push(h),c?(n[h]=u?s(d[l],f):s(f,d[l]),i[h]=a):n[h]=d[l]):(n[h]=u?s(d[l],n[h]):s(n[h],d[l]),i[h]=a);else for(p=e[t],m=e[t+1],l=p;l<m;l++)r[h=y[l]]!==a?(r[h]=a,o.push(h)):i[h]=a}var Wt=l("isInteger",["typed"],function(e){return(0,e.typed)("isInteger",{number:E,BigNumber:function(e){return e.isInt()},Fraction:function(e){return 1===e.d&&isFinite(e.n)},"Array | Matrix":function(e){return me(e,this)}})});function Yt(e){return e<0}function Jt(e){return 0<e}function Xt(e){return 0===e}function Qt(e){return Number.isNaN(e)}e(186),Qt.signature=Xt.signature=Jt.signature=Yt.signature="number";var Kt=l("isNegative",["typed"],function(e){return(0,e.typed)("isNegative",{number:Yt,BigNumber:function(e){return e.isNeg()&&!e.isZero()&&!e.isNaN()},Fraction:function(e){return e.s<0},Unit:function(e){return this(e.value)},"Array | Matrix":function(e){return me(e,this)}})}),er=l("isNumeric",["typed"],function(e){return(0,e.typed)("isNumeric",{"number | BigNumber | Fraction | boolean":function(){return!0},"Complex | Unit | string | null | undefined | Node":function(){return!1},"Array | Matrix":function(e){return me(e,this)}})}),tr=(e(256),l("hasNumericValue",["typed","isNumeric"],function(e){var t=e.typed,r=e.isNumeric;return t("hasNumericValue",{string:function(e){return 0<e.trim().length&&!isNaN(Number(e))},any:function(e){return r(e)}})})),rr=l("isPositive",["typed"],function(e){return(0,e.typed)("isPositive",{number:Jt,BigNumber:function(e){return!e.isNeg()&&!e.isZero()&&!e.isNaN()},Fraction:function(e){return 0<e.s&&0<e.n},Unit:function(e){return this(e.value)},"Array | Matrix":function(e){return me(e,this)}})}),nr=l("isZero",["typed"],function(e){return(0,e.typed)("isZero",{number:Xt,BigNumber:function(e){return e.isZero()},Complex:function(e){return 0===e.re&&0===e.im},Fraction:function(e){return 1===e.d&&0===e.n},Unit:function(e){return this(e.value)},"Array | Matrix":function(e){return me(e,this)}})}),ir=l("isNaN",["typed"],function(e){return(0,e.typed)("isNaN",{number:Qt,BigNumber:function(e){return e.isNaN()},Fraction:function(e){return!1},Complex:function(e){return e.isNaN()},Unit:function(e){return Number.isNaN(e.value)},"Array | Matrix":function(e){return me(e,Number.isNaN)}})}),ar=l("typeOf",["typed"],function(e){return(0,e.typed)("typeOf",{any:te})});function or(e,t,r){if(null==r)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;e=e.constructor.max(e.abs(),t.abs());return n.lte(e.times(r))}return!1}var sr=l("equalScalar",["typed","config"],function(e){var t=e.typed,n=e.config;return t("equalScalar",{"boolean, boolean":function(e,t){return e===t},"number, number":function(e,t){return Oe(e,t,n.epsilon)},"BigNumber, BigNumber":function(e,t){return e.eq(t)||or(e,t,n.epsilon)},"Fraction, Fraction":function(e,t){return e.equals(t)},"Complex, Complex":function(e,t){return e=e,t=t,r=n.epsilon,Oe(e.re,t.re,r)&&Oe(e.im,t.im,r);var r},"Unit, Unit":function(e,t){if(e.equalBase(t))return this(e.value,t.value);throw new Error("Cannot compare units with different base")}})}),ur=(l("equalScalar",["typed","config"],function(e){var t=e.typed,r=e.config;return t("equalScalar",{"number, number":function(e,t){return Oe(e,t,r.epsilon)}})}),e(26),l("SparseMatrix",["typed","equalScalar","Matrix"],function(e){var w=e.typed,N=e.equalScalar,e=e.Matrix;function T(e,t){if(!(this instanceof T))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!M(t))throw new Error("Invalid datatype: "+t);if(F(e))r=this,i=t,"SparseMatrix"===(n=e).type?(r._values=n._values?ne(n._values):void 0,r._index=ne(n._index),r._ptr=ne(n._ptr),r._size=ne(n._size),r._datatype=i||n._datatype):a(r,n.valueOf(),i||n._datatype);else if(e&&x(e.index)&&x(e.ptr)&&x(e.size))this._values=e.values,this._index=e.index,this._ptr=e.ptr,this._size=e.size,this._datatype=t||e.datatype;else if(x(e))a(this,e,t);else{if(e)throw new TypeError("Unsupported type of data ("+te(e)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t}var r,n,i}function a(e,t,r){e._values=[],e._index=[],e._ptr=[],e._datatype=r;var n=t.length,i=0,a=N,o=0;if(M(r)&&(a=w.find(N,[r,r])||N,o=w.convert(0,r)),0<n){var s=0;do{e._ptr.push(e._index.length);for(var u=0;u<n;u++){var c,f=t[u];x(f)?(0===s&&i<f.length&&(i=f.length),s<f.length&&(a(c=f[s],o)||(e._values.push(c),e._index.push(u)))):(0===s&&i<1&&(i=1),a(f,o)||(e._values.push(f),e._index.push(u)))}}while(++s<i)}e._ptr.push(e._index.length),e._size=[n,i]}function g(e,t,r,n){if(r-t==0)return r;for(var i=t;i<r;i++)if(n[i]===e)return i;return t}function v(e,t,r,n,i,a,o){i.splice(e,0,n),a.splice(e,0,t);for(var s=r+1;s<o.length;s++)o[s]++}function f(e,t,r,n){var i=n||0,n=N,a=0;M(e._datatype)&&(n=w.find(N,[e._datatype,e._datatype])||N,a=w.convert(0,e._datatype),i=w.convert(i,e._datatype));var o=!n(i,a),s=e._size[0],u=e._size[1];if(u<r){for(f=u;f<r;f++)if(e._ptr[f]=e._values.length,o)for(m=0;m<s;m++)e._values.push(i),e._index.push(m);e._ptr[r]=e._values.length}else r<u&&(e._ptr.splice(r+1,u-r),e._values.splice(e._ptr[r],e._values.length),e._index.splice(e._ptr[r],e._index.length));if(u=r,s<t){if(o){for(var c=0,f=0;f<u;f++){e._ptr[f]=e._ptr[f]+c;for(var l=e._ptr[f+1]+c,p=0,m=s;m<t;m++,p++)e._values.splice(l+p,0,i),e._index.splice(l+p,0,m),c++}e._ptr[u]=e._values.length}}else if(t<s){var h=0;for(f=0;f<u;f++){e._ptr[f]=e._ptr[f]-h;var d=e._ptr[f],y=e._ptr[f+1]-h;for(l=d;l<y;l++)(m=e._index[l])>t-1&&(e._values.splice(l,1),e._index.splice(l,1),h++)}e._ptr[f]=e._values.length}return e._size[0]=t,e._size[1]=r,e}function t(e,t,r,n,i){for(var a,o=n[0],s=n[1],u=[],c=0;c<o;c++)for(u[c]=[],a=0;a<s;a++)u[c][a]=0;for(a=0;a<s;a++)for(var f=r[a],l=r[a+1],p=f;p<l;p++)u[c=t[p]][a]=e?i?ne(e[p]):e[p]:1;return u}return(T.prototype=new e).createSparseMatrix=function(e,t){return new T(e,t)},T.prototype.type="SparseMatrix",T.prototype.isSparseMatrix=!0,T.prototype.getDataType=function(){return et(this._values,te)},T.prototype.storage=function(){return"sparse"},T.prototype.datatype=function(){return this._datatype},T.prototype.create=function(e,t){return new T(e,t)},T.prototype.density=function(){var e=this._size[0],t=this._size[1];return 0!==e&&0!==t?this._index.length/(e*t):0},T.prototype.subset=function(e,t,r){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:var n=this,i=e;if(!k(i))throw new TypeError("Invalid index");if(i.isScalar())return n.get(i.min());var a,o,s=i.size();if(s.length!==n._size.length)throw new z(s.length,n._size.length);for(var u=i.min(),c=i.max(),f=0,l=n._size.length;f<l;f++)I(u[f],n._size[f]),I(c[f],n._size[f]);var p=n._values,m=n._index,h=n._ptr,d=i.dimension(0),i=i.dimension(1),y=[],g=[],v=(d.forEach(function(e,t){g[e]=t[0],y[e]=!0}),p?[]:void 0),x=[],b=[];return i.forEach(function(e){for(b.push(x.length),a=h[e],o=h[e+1];a<o;a++)f=m[a],!0===y[f]&&(x.push(g[f]),v&&v.push(p[a]))}),b.push(x.length),new T({values:v,index:x,ptr:b,size:s,datatype:n._datatype});case 2:case 3:var w=this,d=e,N=t,M=r;if(!d||!0!==d.isIndex)throw new TypeError("Invalid index");var E,S,A=d.size(),i=d.isScalar();if(F(N)?(E=N.size(),N=N.toArray()):E=_(N),i){if(0!==E.length)throw new TypeError("Scalar expected");w.set(d.min(),N,M)}else{if(1!==A.length&&2!==A.length)throw new z(A.length,w._size.length,"<");if(E.length<A.length){for(var O=0,C=0;1===A[O]&&1===E[O];)O++;for(;1===A[O];)C++,O++;N=Ve(N,A.length,C,E)}if(!it(A,E))throw new z(A,E,">");1===A.length?d.dimension(0).forEach(function(e,t){I(e),w.set([e,0],N[t[0]],M)}):(i=d.dimension(0),S=d.dimension(1),i.forEach(function(r,n){I(r),S.forEach(function(e,t){I(e),w.set([r,e],N[n[0]][t[0]],M)})}))}return w;default:throw new SyntaxError("Wrong number of arguments")}},T.prototype.get=function(e){if(!x(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new z(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var t=e[0],e=e[1],r=(I(t,this._size[0]),I(e,this._size[1]),g(t,this._ptr[e],this._ptr[e+1],this._index));return r<this._ptr[e+1]&&this._index[r]===t?this._values[r]:0},T.prototype.set=function(e,t,r){if(!x(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new z(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var n=e[0],e=e[1],i=this._size[0],a=this._size[1],o=N,s=0,r=(M(this._datatype)&&(o=w.find(N,[this._datatype,this._datatype])||N,s=w.convert(0,this._datatype)),(i-1<n||a-1<e)&&(f(this,Math.max(n+1,i),Math.max(e+1,a),r),i=this._size[0],a=this._size[1]),I(n,i),I(e,a),g(n,this._ptr[e],this._ptr[e+1],this._index));if(r<this._ptr[e+1]&&this._index[r]===n)if(o(t,s)){i=r,a=e,o=this._values,s=this._index;var u=this._ptr;o.splice(i,1),s.splice(i,1);for(var c=a+1;c<u.length;c++)u[c]--}else this._values[r]=t;else v(r,n,e,t,this._values,this._index,this._ptr);return this},T.prototype.resize=function(e,t,r){if(!S(e))throw new TypeError("Array or Matrix expected");var n=e.valueOf().map(function(e){return Array.isArray(e)&&1===e.length?e[0]:e});if(2!==n.length)throw new Error("Only two dimensions matrix are supported");return n.forEach(function(e){if(!K(e)||!E(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+re(n)+")")}),f(r?this.clone():this,n[0],n[1],t)},T.prototype.reshape=function(t,e){if(!x(t))throw new TypeError("Array expected");if(2!==t.length)throw new Error("Sparse matrices can only be reshaped in two dimensions");t.forEach(function(e){if(!K(e)||!E(e)||e<=-2||0===e)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+re(t)+")")});var r=this._size[0]*this._size[1];if(r!=(t=$e(t,r))[0]*t[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var n=e?this.clone():this;if(this._size[0]===t[0]&&this._size[1]===t[1])return n;for(var i=[],a=0;a<n._ptr.length;a++)for(var o=0;o<n._ptr[a+1]-n._ptr[a];o++)i.push(a);for(var s=n._values.slice(),u=n._index.slice(),c=0;c<n._index.length;c++){var f=u[c],l=i[c],f=f*n._size[1]+l;i[c]=f%t[1],u[c]=Math.floor(f/t[1])}n._values.length=0,n._index.length=0,n._ptr.length=t[1]+1,n._size=t.slice();for(var p=0;p<n._ptr.length;p++)n._ptr[p]=0;for(var m=0;m<s.length;m++){var h=u[m],d=i[m],y=s[m];v(g(h,n._ptr[d],n._ptr[d+1],n._index),h,d,y,n._values,n._index,n._ptr)}return n},T.prototype.clone=function(){return new T({values:this._values?ne(this._values):void 0,index:ne(this._index),ptr:ne(this._ptr),size:ne(this._size),datatype:this._datatype})},T.prototype.size=function(){return this._size.slice(0)},T.prototype.map=function(n,e){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var i=this,t=this,r=this._size[0]-1,a=this._size[1]-1,o=e,s=[],u=[],c=[],f=N,l=0;M(t._datatype)&&(f=w.find(N,[t._datatype,t._datatype])||N,l=w.convert(0,t._datatype));for(var p=function(e,t,r){e=n(e,[t,r],i),f(e,l)||(s.push(e),u.push(t))},m=0;m<=a;m++){c.push(s.length);var h=t._ptr[m],d=t._ptr[m+1];if(o)for(var y=h;y<d;y++){var g=t._index[y];0<=g&&g<=r&&p(t._values[y],+g,+m)}else{for(var v={},x=h;x<d;x++)v[t._index[x]]=t._values[x];for(var b=0;b<=r;b++)p(b in v?v[b]:0,+b,+m)}}return c.push(s.length),new T({values:s,index:u,ptr:c,size:[1+r,1+a]})},T.prototype.forEach=function(e,t){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var r=this._size[0],n=this._size[1],i=0;i<n;i++){var a=this._ptr[i],o=this._ptr[i+1];if(t)for(var s=a;s<o;s++){var u=this._index[s];e(this._values[s],[u,i],this)}else{for(var c={},f=a;f<o;f++)c[this._index[f]]=this._values[f];for(var l=0;l<r;l++)e(l in c?c[l]:0,[l,i],this)}}},T.prototype[Symbol.iterator]=jt.a.mark(function e(){var t,r,n,i,a;return jt.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this._values){e.next=2;break}throw new Error("Cannot iterate a Pattern only matrix");case 2:t=this._size[1],r=0;case 4:if(!(r<t)){e.next=18;break}i=this._ptr[r],n=this._ptr[r+1],i=i;case 8:if(i<n)return a=this._index[i],e.next=12,{value:this._values[i],index:[a,r]};e.next=15;break;case 12:i++,e.next=8;break;case 15:r++,e.next=4;break;case 18:case"end":return e.stop()}},e,this)}),T.prototype.toArray=function(){return t(this._values,this._index,this._ptr,this._size,!0)},T.prototype.valueOf=function(){return t(this._values,this._index,this._ptr,this._size,!1)},T.prototype.format=function(e){for(var t=this._size[0],r=this._size[1],n=this.density(),i="Sparse Matrix ["+re(t,e)+" x "+re(r,e)+"] density: "+re(n,e)+"\n",a=0;a<r;a++)for(var o=this._ptr[a],s=this._ptr[a+1],u=o;u<s;u++)i+="\n    ("+re(this._index[u],e)+", "+re(a,e)+") ==> "+(this._values?re(this._values[u],e):"X");return i},T.prototype.toString=function(){return re(this.toArray())},T.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},T.prototype.diagonal=function(e){if(e){if(!K(e=ee(e)?e.toNumber():e)||!E(e))throw new TypeError("The parameter k must be an integer number")}else e=0;var t=0<e?e:0,r=e<0?-e:0,e=this._size[0],n=this._size[1],i=Math.min(e-r,n-t),a=[],o=[],e=[];e[0]=0;for(var s=t;s<n&&a.length<i;s++)for(var u=this._ptr[s],c=this._ptr[s+1],f=u;f<c;f++){var l=this._index[f];if(l===s-t+r){a.push(this._values[f]),o[a.length-1]=l-r;break}}return e.push(a.length),new T({values:a,index:o,ptr:e,size:[i,1]})},T.fromJSON=function(e){return new T(e)},T.diagonal=function(e,t,r,n,i){if(!x(e))throw new TypeError("Array expected, size parameter");if(2!==e.length)throw new Error("Only two dimensions matrix are supported");if(e=e.map(function(e){if(!K(e=ee(e)?e.toNumber():e)||!E(e)||e<1)throw new Error("Size values must be positive integers");return e}),r){if(!K(r=ee(r)?r.toNumber():r)||!E(r))throw new TypeError("The parameter k must be an integer number")}else r=0;var a=N,o=0;M(i)&&(a=w.find(N,[i,i])||N,o=w.convert(0,i));var s,u=0<r?r:0,c=r<0?-r:0,i=e[0],f=e[1],l=Math.min(i-c,f-u);if(x(t)){if(t.length!==l)throw new Error("Invalid value array length");s=function(e){return t[e]}}else if(F(t)){r=t.size();if(1!==r.length||r[0]!==l)throw new Error("Invalid matrix length");s=function(e){return t.get([e])}}else s=function(){return t};for(var p=[],m=[],h=[],d=0;d<f;d++){h.push(p.length);var y,g=d-u;0<=g&&g<l&&(a(y=s(g),o)||(m.push(g+c),p.push(y)))}return h.push(p.length),new T({values:p,index:m,ptr:h,size:[i,f]})},T.prototype.swapRows=function(e,t){if(!(K(e)&&E(e)&&K(t)&&E(t)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return I(e,this._size[0]),I(t,this._size[0]),T._swapRows(e,t,this._size[1],this._values,this._index,this._ptr),this},T._forEachRow=function(e,t,r,n,i){for(var a=n[e],o=n[e+1],s=a;s<o;s++)i(r[s],t[s])},T._swapRows=function(e,t,r,n,i,a){for(var o=0;o<r;o++){var s,u=a[o],c=a[o+1],f=g(e,u,c,i),u=g(t,u,c,i);f<c&&u<c&&i[f]===e&&i[u]===t?n&&(s=n[f],n[f]=n[u],n[u]=s):f<c&&i[f]===e&&(c<=u||i[u]!==t)?(s=n?n[f]:void 0,i.splice(u,0,t),n&&n.splice(u,0,s),i.splice(u<=f?f+1:f,1),n&&n.splice(u<=f?f+1:f,1)):u<c&&i[u]===t&&(c<=f||i[f]!==e)&&(c=n?n[u]:void 0,i.splice(f,0,e),n&&n.splice(f,0,c),i.splice(f<=u?u+1:u,1),n&&n.splice(f<=u?u+1:u,1))}},T},{isClass:!0})),cr=l("number",["typed"],function(e){e=(0,e.typed)("number",{"":function(){return 0},number:function(e){return e},string:function(e){if("NaN"===e)return NaN;var t=(n=(t=e).match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/))?{input:t,radix:{"0b":2,"0o":8,"0x":16}[n[1]],integerPart:n[2],fractionalPart:n[3]}:null;if(t){for(var r=t,n=parseInt(r.integerPart,r.radix),i=0,a=0;a<r.fractionalPart.length;a++)i+=parseInt(r.fractionalPart[a],r.radix)/Math.pow(r.radix,a+1);if(n+=i,isNaN(n))throw new SyntaxError('String "'+r.input+'" is no valid number');return n}var t=0,n=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/),o=(n&&(t=Number(n[2]),e=n[1]),Number(e));if(isNaN(o))throw new SyntaxError('String "'+e+'" is no valid number');if(n){if(o>Math.pow(2,t)-1)throw new SyntaxError('String "'.concat(e,'" is out of range'));o>=Math.pow(2,t-1)&&(o-=Math.pow(2,t))}return o},BigNumber:function(e){return e.toNumber()},Fraction:function(e){return e.valueOf()},Unit:function(e){throw new Error("Second argument with valueless unit expected")},null:function(e){return 0},"Unit, string | Unit":function(e,t){return e.toNumber(t)},"Array | Matrix":function(e){return me(e,this)}});return e.fromJSON=function(e){return parseFloat(e.value)},e}),fr=l("string",["typed"],function(e){return(0,e.typed)("string",{"":function(){return""},number:be,null:function(e){return"null"},boolean:function(e){return e+""},string:function(e){return e},"Array | Matrix":function(e){return me(e,this)},any:function(e){return String(e)}})}),lr=l("boolean",["typed"],function(e){return(0,e.typed)("boolean",{"":function(){return!1},boolean:function(e){return e},number:function(e){return!!e},null:function(e){return!1},BigNumber:function(e){return!e.isZero()},string:function(e){var t=e.toLowerCase();if("true"===t)return!0;if("false"===t)return!1;t=Number(e);if(""===e||isNaN(t))throw new Error('Cannot convert "'+e+'" to a boolean');return!!t},"Array | Matrix":function(e){return me(e,this)}})}),pr=l("bignumber",["typed","BigNumber"],function(e){var t=e.typed,i=e.BigNumber;return t("bignumber",{"":function(){return new i(0)},number:function(e){return new i(e+"")},string:function(e){var t=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(t){var r=t[2],t=i(t[1]),n=new i(2).pow(Number(r));if(t.gt(n.sub(1)))throw new SyntaxError('String "'.concat(e,'" is out of range'));r=new i(2).pow(Number(r)-1);return t.gte(r)?t.sub(n):t}return new i(e)},BigNumber:function(e){return e},Fraction:function(e){return new i(e.n).div(e.d).times(e.s)},null:function(e){return new i(0)},"Array | Matrix":function(e){return me(e,this)}})}),mr=l("complex",["typed","Complex"],function(e){var t=e.typed,r=e.Complex;return t("complex",{"":function(){return r.ZERO},number:function(e){return new r(e,0)},"number, number":function(e,t){return new r(e,t)},"BigNumber, BigNumber":function(e,t){return new r(e.toNumber(),t.toNumber())},Fraction:function(e){return new r(e.valueOf(),0)},Complex:function(e){return e.clone()},string:function(e){return r(e)},null:function(e){return r(0)},Object:function(e){if("re"in e&&"im"in e)return new r(e.re,e.im);if("r"in e&&"phi"in e||"abs"in e&&"arg"in e)return new r(e);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":function(e){return me(e,this)}})}),hr=l("fraction",["typed","Fraction"],function(e){var t=e.typed,r=e.Fraction;return t("fraction",{number:function(e){if(!isFinite(e)||isNaN(e))throw new Error(e+" cannot be represented as a fraction");return new r(e)},string:function(e){return new r(e)},"number, number":function(e,t){return new r(e,t)},null:function(e){return new r(0)},BigNumber:function(e){return new r(e.toString())},Fraction:function(e){return e},Object:function(e){return new r(e)},"Array | Matrix":function(e){return me(e,this)}})}),dr=(e(41),l("matrix",["typed","Matrix","DenseMatrix","SparseMatrix"],function(e){var t=e.typed,n=(e.Matrix,e.DenseMatrix),i=e.SparseMatrix;return t("matrix",{"":function(){return r([])},string:function(e){return r([],e)},"string, string":function(e,t){return r([],e,t)},Array:function(e){return r(e)},Matrix:function(e){return r(e,e.storage())},"Array | Matrix, string":r,"Array | Matrix, string, string":r});function r(e,t,r){if("dense"===t||"default"===t||void 0===t)return new n(e,r);if("sparse"===t)return new i(e,r);throw new TypeError("Unknown matrix type "+JSON.stringify(t)+".")}})),yr=l("matrixFromFunction",["typed","matrix","isZero"],function(e){var t=e.typed,a=e.matrix,o=e.isZero;return t("matrixFromFunction",{"Array | Matrix, function, string, string":i,"Array | Matrix, function, string":function(e,t,r){return i(e,t,r)},"Matrix, function":function(e,t){return i(e,t,"dense")},"Array, function":function(e,t){return i(e,t,"dense").toArray()},"Array | Matrix, string, function":function(e,t,r){return i(e,r,t)},"Array | Matrix, string, string, function":function(e,t,r,n){return i(e,n,t,r)}});function i(e,n,t,r){var i;return(i=void 0!==r?a(t,r):a(t)).resize(e),i.forEach(function(e,t){var r=n(t);o(r)||i.set(t,r)}),i}});function gr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var vr=l("matrixFromRows",["typed","matrix","flatten","size"],function(e){var t=e.typed,r=e.matrix,s=e.flatten,n=e.size;return t("matrixFromRows",{"...Array":i,"...Matrix":function(e){return r(i(e.map(function(e){return e.toArray()})))}});function i(e){if(0===e.length)throw new TypeError("At least one row is needed to construct a matrix.");var t,r=u(e[0]),n=[],i=function(e,t){var r,n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e){if(e){if("string"==typeof e)return gr(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(t="Object"===t&&e.constructor?e.constructor.name:t)||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?gr(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length)return n&&(e=n),r=0,{s:t=function(){},n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(o)throw i}}}}(e);try{for(i.s();!(t=i.n()).done;){var a=t.value,o=u(a);if(o!==r)throw new TypeError("The vectors had different length: "+(0|r)+" ≠ "+(0|o));n.push(s(a))}}catch(e){i.e(e)}finally{i.f()}return n}function u(e){e=n(e);if(1===e.length)return e[0];if(2!==e.length)throw new TypeError("Only one- or two-dimensional vectors are supported.");if(1===e[0])return e[1];if(1===e[1])return e[0];throw new TypeError("At least one of the arguments is not a vector.")}});function xr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var br=l("matrixFromColumns",["typed","matrix","flatten","size"],function(e){var t=e.typed,r=e.matrix,f=e.flatten,n=e.size;return t("matrixFromColumns",{"...Array":i,"...Matrix":function(e){return r(i(e.map(function(e){return e.toArray()})))}});function i(e){if(0===e.length)throw new TypeError("At least one column is needed to construct a matrix.");for(var t=l(e[0]),r=[],n=0;n<t;n++)r[n]=[];var i,a=function(e,t){var r,n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e){if(e){if("string"==typeof e)return xr(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(t="Object"===t&&e.constructor?e.constructor.name:t)||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?xr(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length)return n&&(e=n),r=0,{s:t=function(){},n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(o)throw i}}}}(e);try{for(a.s();!(i=a.n()).done;){var o=i.value,s=l(o);if(s!==t)throw new TypeError("The vectors had different length: "+(0|t)+" ≠ "+(0|s));for(var u=f(o),c=0;c<t;c++)r[c].push(u[c])}}catch(e){a.e(e)}finally{a.f()}return r}function l(e){e=n(e);if(1===e.length)return e[0];if(2!==e.length)throw new TypeError("Only one- or two-dimensional vectors are supported.");if(1===e[0])return e[1];if(1===e[1])return e[0];throw new TypeError("At least one of the arguments is not a vector.")}}),wr=l("splitUnit",["typed"],function(e){return(0,e.typed)("splitUnit",{"Unit, Array":function(e,t){return e.splitUnit(t)}})});function Nr(e){return Math.abs(e)}function Mr(e,t){return e+t}function Er(e,t){return e*t}function Sr(e){return-e}function Ar(e){return e}function Or(e){return ge(e)}function Cr(e){return e*e*e}function Tr(e){return Math.exp(e)}function _r(e){return ve(e)}function Ir(e,t){if(!E(e)||!E(t))throw new Error("Parameters in function gcd must be integer numbers");for(var r;0!==t;)r=e%t,e=t,t=r;return e<0?-e:e}function kr(e,t){if(!E(e)||!E(t))throw new Error("Parameters in function lcm must be integer numbers");if(0===e||0===t)return 0;for(var r,n=e*t;0!==t;)t=e%(r=t),e=r;return Math.abs(n/e)}function zr(e){return ue(e)}function Rr(e){return f(e)}function qr(e,t){if(0<t)return e-t*Math.floor(e/t);if(0===t)return e;throw new Error("Cannot calculate mod for a negative divisor")}function Br(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:2,r=t<0;if(0===(t=r?-t:t))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(0===e)return r?1/0:0;if(!isFinite(e))return r?0:e;t=Math.pow(Math.abs(e),1/t),t=e<0?-t:t;return r?1/t:t}function Dr(e){return c(e)}function jr(e){return e*e}function Pr(e,t){var r,n,i,a=0,o=1,s=1,u=0;if(!E(e)||!E(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)i=e-(n=Math.floor(e/t))*t,a=o-n*(r=a),o=r,s=u-n*(r=s),u=r,e=t,t=i;return e<0?[-e,-o,-u]:[e,e?o:0,u]}function Fr(e,t){return e*e<1&&t===1/0||1<e*e&&t===-1/0?0:Math.pow(e,t)}function Ur(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;if(!E(t)||t<0||15<t)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(Ne(e,t))}Nr.signature="number",Er.signature=Mr.signature="number, number",_r.signature=Tr.signature=Cr.signature=Or.signature=Ar.signature=Sr.signature="number",kr.signature=Ir.signature="number, number",Rr.signature=zr.signature="number",qr.signature="number, number",jr.signature=Dr.signature="number",Fr.signature=Pr.signature="number, number";var Lr=l("unaryMinus",["typed"],function(e){return(0,e.typed)("unaryMinus",{number:Sr,Complex:function(e){return e.neg()},BigNumber:function(e){return e.neg()},Fraction:function(e){return e.neg()},Unit:function(e){var t=e.clone();return t.value=this(e.value),t},"Array | Matrix":function(e){return me(e,this,!0)}})}),$r=l("unaryPlus",["typed","config","BigNumber"],function(e){var t=e.typed,r=e.config,n=e.BigNumber;return t("unaryPlus",{number:Ar,Complex:function(e){return e},BigNumber:function(e){return e},Fraction:function(e){return e},Unit:function(e){return e.clone()},"Array | Matrix":function(e){return me(e,this,!0)},"boolean | string":function(e){return"BigNumber"===r.number?new n(+e):+e}})}),Hr=l("abs",["typed"],function(e){return(0,e.typed)("abs",{number:Nr,Complex:function(e){return e.abs()},BigNumber:function(e){return e.abs()},Fraction:function(e){return e.abs()},"Array | Matrix":function(e){return me(e,this,!0)},Unit:function(e){return e.abs()}})}),Gr=l("apply",["typed","isInteger"],function(e){var t=e.typed,i=e.isInteger;return t("apply",{"Array | Matrix, number | BigNumber, function":function(e,t,r){if(!i(t))throw new TypeError("Integer number expected for dimension");var n=Array.isArray(e)?_(e):e.size();if(t<0||t>=n.length)throw new Pe(t,n.length);return F(e)?e.create(Vr(e.valueOf(),t,r)):Vr(e,t,r)}})});function Vr(e,t,r){var n,i,a;if(t<=0){if(Array.isArray(e[0])){for(a=function(e){for(var t=e.length,r=e[0].length,n=[],i=0;i<r;i++){for(var a=[],o=0;o<t;o++)a.push(e[o][i]);n.push(a)}return n}(e),i=[],n=0;n<a.length;n++)i[n]=Vr(a[n],t-1,r);return i}return r(e)}for(i=[],n=0;n<e.length;n++)i[n]=Vr(e[n],t-1,r);return i}var Zr=l("addScalar",["typed"],function(e){return(0,e.typed)("addScalar",{"number, number":Mr,"Complex, Complex":function(e,t){return e.add(t)},"BigNumber, BigNumber":function(e,t){return e.plus(t)},"Fraction, Fraction":function(e,t){return e.add(t)},"Unit, Unit":function(e,t){if(null===e.value||void 0===e.value)throw new Error("Parameter x contains a unit with undefined value");if(null===t.value||void 0===t.value)throw new Error("Parameter y contains a unit with undefined value");if(!e.equalBase(t))throw new Error("Units do not match");e=e.clone();return e.value=this(e.value,t.value),e.fixPrefix=!1,e}})}),Wr=l("cbrt",["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],function(e){var i=e.config,t=e.typed,n=e.isNegative,a=e.unaryMinus,o=e.matrix,s=e.Complex,u=e.BigNumber,c=e.Fraction;return t("cbrt",{number:Or,Complex:f,"Complex, boolean":f,BigNumber:function(e){return e.cbrt()},Unit:function(e){if(e.value&&ie(e.value))return(r=e.clone()).value=1,(r=r.pow(1/3)).value=f(e.value),r;var t,r=n(e.value),e=(r&&(e.value=a(e.value)),t=ee(e.value)?new u(1).div(3):ae(e.value)?new c(1,3):1/3,e.pow(t));return r&&(e.value=a(e.value)),e},"Array | Matrix":function(e){return me(e,this,!0)}});function f(e,t){var r=e.arg()/3,e=e.abs(),n=new s(Or(e),0).mul(new s(0,r).exp());return t?(t=[n,new s(Or(e),0).mul(new s(0,r+2*Math.PI/3).exp()),new s(Or(e),0).mul(new s(0,r-2*Math.PI/3).exp())],"Array"===i.matrix?t:o(t)):n}}),r=e(57),Yr=e.n(r),m=l("algorithm11",["typed","equalScalar"],function(e){var E=e.typed,S=e.equalScalar;return function(e,t,r,n){var i=e._values,a=e._index,o=e._ptr,s=e._size,u=e._datatype;if(!i)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var c,f=s[0],l=s[1],p=S,m=0,h=r;"string"==typeof u&&(p=E.find(S,[c=u,c]),m=E.convert(0,c),t=E.convert(t,c),h=E.find(r,[c,c]));for(var d=[],y=[],g=[],v=0;v<l;v++){g[v]=y.length;for(var x=o[v],b=o[v+1],w=x;w<b;w++){var N=a[w],M=n?h(t,i[w]):h(i[w],t);p(M,m)||(y.push(N),d.push(M))}}return g[l]=y.length,e.createSparseMatrix({values:d,index:y,ptr:g,size:[f,l],datatype:c})}}),p=l("algorithm12",["typed","DenseMatrix"],function(e){var N=e.typed,M=e.DenseMatrix;return function(e,t,r,n){var i=e._values,a=e._index,o=e._ptr,s=e._size,e=e._datatype;if(!i)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var u,c=s[0],f=s[1],l=r;"string"==typeof e&&(t=N.convert(t,u=e),l=N.find(r,[u,u]));for(var p=[],m=[],h=[],d=0;d<f;d++){for(var y=d+1,g=o[d],v=o[d+1],x=g;x<v;x++){var b=a[x];m[b]=i[x],h[b]=y}for(var w=0;w<c;w++)0===d&&(p[w]=[]),h[w]===y?p[w][d]=n?l(t,m[w]):l(m[w],t):p[w][d]=n?l(t,0):l(0,t)}return new M({data:p,size:[c,f],datatype:u})}}),h=l("algorithm14",["typed"],function(e){var c=e.typed;return function(e,t,r,n){var i,a=e._data,o=e._size,s=e._datatype,u=r,s=("string"==typeof s&&(t=c.convert(t,i=s),u=c.find(r,[i,i])),0<o.length?function e(t,r,n,i,a,o,s){var u=[];if(r===n.length-1)for(var c=0;c<i;c++)u[c]=s?t(o,a[c]):t(a[c],o);else for(var f=0;f<i;f++)u[f]=e(t,r+1,n,n[r+1],a[f],o,s);return u}(u,0,o,o[0],a,t,n):[]);return e.createDenseMatrix({data:s,size:ne(o),datatype:i})}}),Jr=l("ceil",["typed","config","round"],function(e){var t=e.typed,i=e.config,a=e.round;return t("ceil",{number:function(e){return Oe(e,a(e),i.epsilon)?a(e):Math.ceil(e)},"number, number":function(e,t){if(Oe(e,a(e,t),i.epsilon))return a(e,t);var e="".concat(e,"e").split("e"),e=Yr()(e,2),r=e[0],e=e[1],n=Math.ceil(Number("".concat(r,"e").concat(Number(e)+t))),n="".concat(n,"e").split("e"),n=Yr()(n,2),r=n[0],e=n[1];return Number("".concat(r,"e").concat(Number(e)-t))}})}),Xr=l("ceil",["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],function(e){var t=e.typed,r=e.config,n=e.round,i=e.matrix,a=e.equalScalar,o=e.zeros,e=e.DenseMatrix,s=m({typed:t,equalScalar:a}),u=p({typed:t,DenseMatrix:e}),c=h({typed:t}),e=Jr({typed:t,config:r,round:n});return t("ceil",{number:e.signatures.number,"number,number":e.signatures["number,number"],Complex:function(e){return e.ceil()},"Complex, number":function(e,t){return e.ceil(t)},"Complex, BigNumber":function(e,t){return e.ceil(t.toNumber())},BigNumber:function(e){return or(e,n(e),r.epsilon)?n(e):e.ceil()},"BigNumber, BigNumber":function(e,t){return or(e,n(e,t),r.epsilon)?n(e,t):e.toDecimalPlaces(t.toNumber(),It.a.ROUND_CEIL)},Fraction:function(e){return e.ceil()},"Fraction, number":function(e,t){return e.ceil(t)},"Fraction, BigNumber":function(e,t){return e.ceil(t.toNumber())},"Array | Matrix":function(e){return me(e,this,!0)},"Array, number | BigNumber":function(e,t){var r=this;return me(e,function(e){return r(e,t)},!0)},"SparseMatrix, number | BigNumber":function(e,t){return s(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return c(e,t,this,!1)},"number | Complex | Fraction | BigNumber, Array":function(e,t){return c(i(t),e,this,!0).valueOf()},"number | Complex | Fraction | BigNumber, Matrix":function(e,t){return a(e,0)?o(t.size(),t.storage()):("dense"===t.storage()?c:u)(t,e,this,!0)}})}),Qr=l("cube",["typed"],function(e){return(0,e.typed)("cube",{number:Cr,Complex:function(e){return e.mul(e).mul(e)},BigNumber:function(e){return e.times(e).times(e)},Fraction:function(e){return e.pow(3)},"Array | Matrix":function(e){return me(e,this,!0)},Unit:function(e){return e.pow(3)}})}),Kr=l("exp",["typed"],function(e){return(0,e.typed)("exp",{number:Tr,Complex:function(e){return e.exp()},BigNumber:function(e){return e.exp()},"Array | Matrix":function(e){return me(e,this)}})}),en=l("expm1",["typed","Complex"],function(e){var t=e.typed,r=e.Complex;return t("expm1",{number:_r,Complex:function(e){var t=Math.exp(e.re);return new r(t*Math.cos(e.im)-1,t*Math.sin(e.im))},BigNumber:function(e){return e.exp().minus(1)},"Array | Matrix":function(e){return me(e,this)}})}),tn=l("fix",["typed","ceil","floor"],function(e){var t=e.typed,r=e.ceil,n=e.floor;return t("fix",{number:function(e){return(0<e?n:r)(e)},"number, number":function(e,t){return(0<e?n:r)(e,t)}})}),rn=l("fix",["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],function(e){var t=e.typed,r=e.Complex,n=e.matrix,i=e.ceil,a=e.floor,o=e.equalScalar,s=e.zeros,e=e.DenseMatrix,u=p({typed:t,DenseMatrix:e}),c=h({typed:t}),e=tn({typed:t,ceil:i,floor:a});return t("fix",{number:e.signatures.number,"number, number | BigNumber":e.signatures["number,number"],Complex:function(e){return new r(0<e.re?Math.floor(e.re):Math.ceil(e.re),0<e.im?Math.floor(e.im):Math.ceil(e.im))},"Complex, number":function(e,t){return new r((0<e.re?a:i)(e.re,t),(0<e.im?a:i)(e.im,t))},"Complex, BigNumber":function(e,t){t=t.toNumber();return new r((0<e.re?a:i)(e.re,t),(0<e.im?a:i)(e.im,t))},BigNumber:function(e){return(e.isNegative()?i:a)(e)},"BigNumber, number | BigNumber":function(e,t){return(e.isNegative()?i:a)(e,t)},Fraction:function(e){return e.s<0?e.ceil():e.floor()},"Fraction, number | BigNumber":function(e,t){return(e.s<0?i:a)(e,t)},"Array | Matrix":function(e){return me(e,this,!0)},"Array | Matrix, number | BigNumber":function(e,t){var r=this;return me(e,function(e){return r(e,t)},!0)},"number | Complex | Fraction | BigNumber, Array":function(e,t){return c(n(t),e,this,!0).valueOf()},"number | Complex | Fraction | BigNumber, Matrix":function(e,t){return o(e,0)?s(t.size(),t.storage()):("dense"===t.storage()?c:u)(t,e,this,!0)}})}),nn=l("floor",["typed","config","round"],function(e){var t=e.typed,i=e.config,a=e.round;return t("floor",{number:function(e){return Oe(e,a(e),i.epsilon)?a(e):Math.floor(e)},"number, number":function(e,t){if(Oe(e,a(e,t),i.epsilon))return a(e,t);var e="".concat(e,"e").split("e"),e=Yr()(e,2),r=e[0],e=e[1],n=Math.floor(Number("".concat(r,"e").concat(Number(e)+t))),n="".concat(n,"e").split("e"),n=Yr()(n,2),r=n[0],e=n[1];return Number("".concat(r,"e").concat(Number(e)-t))}})}),an=l("floor",["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],function(e){var t=e.typed,r=e.config,n=e.round,i=e.matrix,a=e.equalScalar,o=e.zeros,e=e.DenseMatrix,s=m({typed:t,equalScalar:a}),u=p({typed:t,DenseMatrix:e}),c=h({typed:t}),e=nn({typed:t,config:r,round:n});return t("floor",{number:e.signatures.number,"number,number":e.signatures["number,number"],Complex:function(e){return e.floor()},"Complex, number":function(e,t){return e.floor(t)},"Complex, BigNumber":function(e,t){return e.floor(t.toNumber())},BigNumber:function(e){return or(e,n(e),r.epsilon)?n(e):e.floor()},"BigNumber, BigNumber":function(e,t){return or(e,n(e,t),r.epsilon)?n(e,t):e.toDecimalPlaces(t.toNumber(),It.a.ROUND_FLOOR)},Fraction:function(e){return e.floor()},"Fraction, number":function(e,t){return e.floor(t)},"Fraction, BigNumber":function(e,t){return e.floor(t.toNumber())},"Array | Matrix":function(e){return me(e,this,!0)},"Array, number | BigNumber":function(e,t){var r=this;return me(e,function(e){return r(e,t)},!0)},"SparseMatrix, number | BigNumber":function(e,t){return s(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return c(e,t,this,!1)},"number | Complex | Fraction | BigNumber, Array":function(e,t){return c(i(t),e,this,!0).valueOf()},"number | Complex | Fraction | BigNumber, Matrix":function(e,t){return a(e,0)?o(t.size(),t.storage()):("dense"===t.storage()?c:u)(t,e,this,!0)}})}),on=l("algorithm01",["typed"],function(e){var M=e.typed;return function(e,t,r,n){var i=e._data,a=e._size,o=e._datatype,s=t._values,u=t._index,c=t._ptr,f=t._size,t=t._datatype;if(a.length!==f.length)throw new z(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+")");if(!s)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");for(var l=a[0],p=a[1],f="string"==typeof o&&o===t?o:void 0,m=f?M.find(r,[f,f]):r,h=[],d=0;d<l;d++)h[d]=[];for(var y=[],g=[],v=0;v<p;v++){for(var x=v+1,b=c[v],w=c[v+1],N=b;N<w;N++)y[d=u[N]]=n?m(s[N],i[d][v]):m(i[d][v],s[N]),g[d]=x;for(d=0;d<l;d++)g[d]===x?h[d][v]=y[d]:h[d][v]=i[d][v]}return e.createDenseMatrix({data:h,size:[l,p],datatype:f})}}),sn=l("algorithm04",["typed","equalScalar"],function(e){var I=e.typed,k=e.equalScalar;return function(e,t,r){var n=e._values,i=e._index,a=e._ptr,o=e._size,s=e._datatype,u=t._values,c=t._index,f=t._ptr,l=t._size,t=t._datatype;if(o.length!==l.length)throw new z(o.length,l.length);if(o[0]!==l[0]||o[1]!==l[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+l+")");var p,l=o[0],m=o[1],h=k,d=0,y=r;"string"==typeof s&&s===t&&(h=I.find(k,[p=s,p]),d=I.convert(0,p),y=I.find(r,[p,p]));for(var g,v=n&&u?[]:void 0,x=[],b=[],w=n&&u?[]:void 0,N=n&&u?[]:void 0,M=[],E=[],S=0;S<m;S++){b[S]=x.length;for(var A,O=S+1,C=a[S],T=a[S+1],_=C;_<T;_++)g=i[_],x.push(g),M[g]=O,w&&(w[g]=n[_]);for(C=f[S],T=f[S+1],_=C;_<T;_++)M[g=c[_]]===O?w&&(h(A=y(w[g],u[_]),d)?M[g]=null:w[g]=A):(x.push(g),E[g]=O,N&&(N[g]=u[_]));if(w&&N)for(_=b[S];_<x.length;)M[g=x[_]]===O?(v[_]=w[g],_++):E[g]===O?(v[_]=N[g],_++):x.splice(_,1)}return b[m]=x.length,e.createSparseMatrix({values:v,index:x,ptr:b,size:[l,m],datatype:p})}}),un=l("algorithm10",["typed","DenseMatrix"],function(e){var N=e.typed,M=e.DenseMatrix;return function(e,t,r,n){var i=e._values,a=e._index,o=e._ptr,s=e._size,e=e._datatype;if(!i)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var u,c=s[0],f=s[1],l=r;"string"==typeof e&&(t=N.convert(t,u=e),l=N.find(r,[u,u]));for(var p=[],m=[],h=[],d=0;d<f;d++){for(var y=d+1,g=o[d],v=o[d+1],x=g;x<v;x++){var b=a[x];m[b]=i[x],h[b]=y}for(var w=0;w<c;w++)0===d&&(p[w]=[]),h[w]===y?p[w][d]=n?l(t,m[w]):l(m[w],t):p[w][d]=t}return new M({data:p,size:[c,f],datatype:u})}}),d=l("algorithm13",["typed"],function(e){var p=e.typed;return function(e,t,r){var n,i=e._data,a=e._size,o=e._datatype,s=t._data,u=t._size,t=t._datatype,c=[];if(a.length!==u.length)throw new z(a.length,u.length);for(var f=0;f<a.length;f++){if(a[f]!==u[f])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+u+")");c[f]=a[f]}var l=r,t=("string"==typeof o&&o===t&&(l=p.find(r,[n=o,n])),0<c.length?function e(t,r,n,i,a,o){var s=[];if(r===n.length-1)for(var u=0;u<i;u++)s[u]=t(a[u],o[u]);else for(var c=0;c<i;c++)s[c]=e(t,r+1,n,n[r+1],a[c],o[c]);return s}(l,0,c,c[0],i,s):[]);return e.createDenseMatrix({data:t,size:c,datatype:n})}}),cn=l("gcd",["typed","matrix","equalScalar","BigNumber","DenseMatrix"],function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.BigNumber,e=e.DenseMatrix,a=on({typed:t}),o=sn({typed:t,equalScalar:n}),s=un({typed:t,DenseMatrix:e}),u=d({typed:t}),c=h({typed:t});return t("gcd",{"number, number":Ir,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var r=new i(0);!t.isZero();){var n=e.mod(t);e=t,t=n}return e.lt(r)?e.neg():e},"Fraction, Fraction":function(e,t){return e.gcd(t)},"SparseMatrix, SparseMatrix":function(e,t){return o(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, number | BigNumber":function(e,t){return s(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return c(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return s(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return c(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return c(r(e),t,this,!1).valueOf()},"number | BigNumber, Array":function(e,t){return c(r(t),e,this,!0).valueOf()},"Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber":function(e,t,r){for(var n=this(e,t),i=0;i<r.length;i++)n=this(n,r[i]);return n}})}),fn=l("algorithm02",["typed","equalScalar"],function(e){var S=e.typed,A=e.equalScalar;return function(e,t,r,n){var i=e._data,a=e._size,e=e._datatype,o=t._values,s=t._index,u=t._ptr,c=t._size,f=t._datatype;if(a.length!==c.length)throw new z(a.length,c.length);if(a[0]!==c[0]||a[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+c+")");if(!o)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var l,c=a[0],p=a[1],m=A,h=0,d=r;"string"==typeof e&&e===f&&(m=S.find(A,[l=e,l]),h=S.convert(0,l),d=S.find(r,[l,l]));for(var y=[],g=[],v=[],x=0;x<p;x++){v[x]=g.length;for(var b=u[x],w=u[x+1],N=b;N<w;N++){var M=s[N],E=n?d(o[N],i[M][x]):d(i[M][x],o[N]);m(E,h)||(g.push(M),y.push(E))}}return v[p]=g.length,t.createSparseMatrix({values:y,index:g,ptr:v,size:[c,p],datatype:l})}}),ln=l("algorithm06",["typed","equalScalar"],function(e){var S=e.typed,A=e.equalScalar;return function(e,t,r){var n=e._values,i=e._size,a=e._datatype,o=t._values,s=t._size,u=t._datatype;if(i.length!==s.length)throw new z(i.length,s.length);if(i[0]!==s[0]||i[1]!==s[1])throw new RangeError("Dimension mismatch. Matrix A ("+i+") must match Matrix B ("+s+")");var c,s=i[0],f=i[1],l=A,p=0,m=r;"string"==typeof a&&a===u&&(l=S.find(A,[c=a,c]),p=S.convert(0,c),m=S.find(r,[c,c]));for(var h=n&&o?[]:void 0,d=[],y=[],g=h?[]:void 0,v=[],x=[],b=0;b<f;b++){y[b]=d.length;var w=b+1;if(Zt(e,b,v,g,x,w,d,m),Zt(t,b,v,g,x,w,d,m),g)for(var N=y[b];N<d.length;){var M=d[N];x[M]!==w||l(M=g[M],p)?d.splice(N,1):(h.push(M),N++)}else for(var E=y[b];E<d.length;)x[d[E]]!==w?d.splice(E,1):E++}return y[f]=d.length,e.createSparseMatrix({values:h,index:d,ptr:y,size:[s,f],datatype:c})}}),pn=l("lcm",["typed","matrix","equalScalar"],function(e){var t=e.typed,r=e.matrix,e=e.equalScalar,n=fn({typed:t,equalScalar:e}),i=ln({typed:t,equalScalar:e}),a=m({typed:t,equalScalar:e}),o=d({typed:t}),s=h({typed:t});return t("lcm",{"number, number":kr,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(e.isZero())return e;if(t.isZero())return t;for(var r=e.times(t);!t.isZero();){var n=t;t=e.mod(n),e=n}return r.div(e).abs()},"Fraction, Fraction":function(e,t){return e.lcm(t)},"SparseMatrix, SparseMatrix":function(e,t){return i(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return n(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return n(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return o(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, number | BigNumber":function(e,t){return a(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return s(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return a(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return s(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return s(r(e),t,this,!1).valueOf()},"number | BigNumber, Array":function(e,t){return s(r(t),e,this,!0).valueOf()},"Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber":function(e,t,r){for(var n=this(e,t),i=0;i<r.length;i++)n=this(n,r[i]);return n}})}),mn=l("log10",["typed","config","Complex"],function(e){var t=e.typed,r=e.config,n=e.Complex;return t("log10",{number:function(e){return 0<=e||r.predictable?zr(e):new n(e,0).log().div(Math.LN10)},Complex:function(e){return new n(e).log().div(Math.LN10)},BigNumber:function(e){return!e.isNegative()||r.predictable?e.log():new n(e.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":function(e){return me(e,this)}})}),hn=l("log2",["typed","config","Complex"],function(e){var t=e.typed,r=e.config,n=e.Complex;return t("log2",{number:function(e){return 0<=e||r.predictable?Rr(e):i(new n(e,0))},Complex:i,BigNumber:function(e){return!e.isNegative()||r.predictable?e.log(2):i(new n(e.toNumber(),0))},"Array | Matrix":function(e){return me(e,this)}});function i(e){var t=Math.sqrt(e.re*e.re+e.im*e.im);return new n(Math.log2?Math.log2(t):Math.log(t)/Math.LN2,Math.atan2(e.im,e.re)/Math.LN2)}}),y=l("algorithm03",["typed"],function(e){var O=e.typed;return function(e,t,r,n){var i=e._data,a=e._size,o=e._datatype,s=t._values,u=t._index,c=t._ptr,f=t._size,t=t._datatype;if(a.length!==f.length)throw new z(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+")");if(!s)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var l,p=a[0],m=a[1],h=0,d=r;"string"==typeof o&&o===t&&(h=O.convert(0,l=o),d=O.find(r,[l,l]));for(var y=[],g=0;g<p;g++)y[g]=[];for(var v=[],x=[],b=0;b<m;b++){for(var w=b+1,N=c[b],M=c[b+1],E=N;E<M;E++){var S=u[E];v[S]=n?d(s[E],i[S][b]):d(i[S][b],s[E]),x[S]=w}for(var A=0;A<p;A++)x[A]===w?y[A][b]=v[A]:y[A][b]=n?d(h,i[A][b]):d(i[A][b],h)}return e.createDenseMatrix({data:y,size:[p,m],datatype:l})}}),dn=l("algorithm05",["typed","equalScalar"],function(e){var I=e.typed,k=e.equalScalar;return function(e,t,r){var n=e._values,i=e._index,a=e._ptr,o=e._size,s=e._datatype,u=t._values,c=t._index,f=t._ptr,l=t._size,t=t._datatype;if(o.length!==l.length)throw new z(o.length,l.length);if(o[0]!==l[0]||o[1]!==l[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+l+")");var p,l=o[0],m=o[1],h=k,d=0,y=r;"string"==typeof s&&s===t&&(h=I.find(k,[p=s,p]),d=I.convert(0,p),y=I.find(r,[p,p]));for(var g,v=n&&u?[]:void 0,x=[],b=[],w=v?[]:void 0,N=v?[]:void 0,M=[],E=[],S=0;S<m;S++){b[S]=x.length;for(var A=S+1,O=a[S],C=a[S+1];O<C;O++)g=i[O],x.push(g),M[g]=A,w&&(w[g]=n[O]);for(O=f[S],C=f[S+1];O<C;O++)M[g=c[O]]!==A&&x.push(g),E[g]=A,N&&(N[g]=u[O]);if(v)for(O=b[S];O<x.length;){var T=M[g=x[O]],_=E[g];T!==A&&_!==A||(h(T=y(T===A?w[g]:d,_===A?N[g]:d),d)?x.splice(O,1):(v.push(T),O++))}}return b[m]=x.length,e.createSparseMatrix({values:v,index:x,ptr:b,size:[l,m],datatype:p})}}),yn=l("mod",["typed","matrix","equalScalar","DenseMatrix"],function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,e=e.DenseMatrix,i=fn({typed:t,equalScalar:n}),a=y({typed:t}),o=dn({typed:t,equalScalar:n}),s=m({typed:t,equalScalar:n}),u=p({typed:t,DenseMatrix:e}),c=d({typed:t}),f=h({typed:t});return t("mod",{"number, number":qr,"BigNumber, BigNumber":function(e,t){if(t.isNeg())throw new Error("Cannot calculate mod for a negative divisor");return t.isZero()?e:e.mod(t)},"Fraction, Fraction":function(e,t){if(t.compare(0)<0)throw new Error("Cannot calculate mod for a negative divisor");return(0<=e.compare(0)?e:e.mod(t).add(t)).mod(t)},"SparseMatrix, SparseMatrix":function(e,t){return o(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return i(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return c(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return s(e,t,this,!1)},"DenseMatrix, any":function(e,t){return f(e,t,this,!1)},"any, SparseMatrix":function(e,t){return u(t,e,this,!0)},"any, DenseMatrix":function(e,t){return f(t,e,this,!0)},"Array, any":function(e,t){return f(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return f(r(t),e,this,!0).valueOf()}})}),gn=l("multiplyScalar",["typed"],function(e){return(0,e.typed)("multiplyScalar",{"number, number":Er,"Complex, Complex":function(e,t){return e.mul(t)},"BigNumber, BigNumber":function(e,t){return e.times(t)},"Fraction, Fraction":function(e,t){return e.mul(t)},"number | Fraction | BigNumber | Complex, Unit":function(e,t){t=t.clone();return t.value=null===t.value?t._normalize(e):this(t.value,e),t},"Unit, number | Fraction | BigNumber | Complex":function(e,t){e=e.clone();return e.value=null===e.value?e._normalize(t):this(e.value,t),e},"Unit, Unit":function(e,t){return e.multiply(t)}})}),vn=l("multiply",["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],function(e){var R=e.typed,r=e.matrix,q=e.addScalar,B=e.multiplyScalar,z=e.equalScalar,i=e.dot,n=m({typed:R,equalScalar:z}),a=h({typed:R});function o(e,t){switch(e.length){case 1:switch(t.length){case 1:if(e[0]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(e[0]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+e[0]+") must match Matrix rows ("+t[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+t.length+" dimensions)")}break;case 2:switch(t.length){case 1:if(e[1]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+e[1]+") must match Vector length ("+t[0]+")");break;case 2:if(e[1]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+e[1]+") must match Matrix B rows ("+t[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+t.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+e.length+" dimensions)")}}var s=R("_multiplyMatrixVector",{"DenseMatrix, any":function(e,t){var r,n=e._data,i=e._size,a=e._datatype,o=t._data,t=t._datatype,s=i[0],u=i[1],c=q,f=B;a&&t&&a===t&&"string"==typeof a&&(c=R.find(q,[r=a,r]),f=R.find(B,[r,r]));for(var l=[],p=0;p<s;p++){for(var m=n[p],h=f(m[0],o[0]),d=1;d<u;d++)h=c(h,f(m[d],o[d]));l[p]=h}return e.createDenseMatrix({data:l,size:[s],datatype:r})},"SparseMatrix, any":function(e,t){var r=e._values,n=e._index,i=e._ptr,a=e._datatype;if(!r)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");for(var o,s=t._data,u=t._datatype,c=e._size[0],f=t._size[0],l=[],p=[],t=[],m=q,h=B,d=z,y=0,g=(a&&u&&a===u&&"string"==typeof a&&(m=R.find(q,[o=a,o]),h=R.find(B,[o,o]),d=R.find(z,[o,o]),y=R.convert(0,o)),[]),v=[],x=t[0]=0;x<f;x++){var b=s[x];if(!d(b,y))for(var w=i[x],N=i[x+1],M=w;M<N;M++){var E=n[M];v[E]?g[E]=m(g[E],h(b,r[M])):(v[E]=!0,p.push(E),g[E]=h(b,r[M]))}}for(var S=p.length,A=0;A<S;A++){var O=p[A];l[A]=g[O]}return t[1]=p.length,e.createSparseMatrix({values:l,index:p,ptr:t,size:[c,1],datatype:o})}}),u=R("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":function(e,t){var r,n=e._data,i=e._size,a=e._datatype,o=t._data,s=t._size,t=t._datatype,u=i[0],c=i[1],f=s[1],l=q,p=B;a&&t&&a===t&&"string"==typeof a&&(l=R.find(q,[r=a,r]),p=R.find(B,[r,r]));for(var m=[],h=0;h<u;h++){var d=n[h];m[h]=[];for(var y=0;y<f;y++){for(var g=p(d[0],o[0][y]),v=1;v<c;v++)g=l(g,p(d[v],o[v][y]));m[h][y]=g}}return e.createDenseMatrix({data:m,size:[u,f],datatype:r})},"DenseMatrix, SparseMatrix":function(e,t){var r=e._data,n=e._size,e=e._datatype,i=t._values,a=t._index,o=t._ptr,s=t._size,u=t._datatype;if(!i)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var c,f=n[0],l=s[1],p=q,m=B,h=z,d=0;e&&u&&e===u&&"string"==typeof e&&(p=R.find(q,[c=e,c]),m=R.find(B,[c,c]),h=R.find(z,[c,c]),d=R.convert(0,c));for(var y=[],g=[],v=[],n=t.createSparseMatrix({values:y,index:g,ptr:v,size:[f,l],datatype:c}),x=0;x<l;x++){v[x]=g.length;var b=o[x],w=o[x+1];if(b<w)for(var N=0,M=0;M<f;M++){for(var E=M+1,S=void 0,A=b;A<w;A++){var O=a[A];N!==E?(S=m(r[M][O],i[A]),N=E):S=p(S,m(r[M][O],i[A]))}N!==E||h(S,d)||(g.push(M),y.push(S))}}return v[l]=g.length,n},"SparseMatrix, DenseMatrix":function(e,t){var r=e._values,n=e._index,i=e._ptr,a=e._datatype;if(!r)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var o,s=t._data,u=t._datatype,c=e._size[0],f=t._size[0],l=t._size[1],p=q,m=B,h=z,d=0;a&&u&&a===u&&"string"==typeof a&&(p=R.find(q,[o=a,o]),m=R.find(B,[o,o]),h=R.find(z,[o,o]),d=R.convert(0,o));for(var y=[],g=[],v=[],t=e.createSparseMatrix({values:y,index:g,ptr:v,size:[c,l],datatype:o}),x=[],b=[],w=0;w<l;w++){v[w]=g.length;for(var N=w+1,M=0;M<f;M++){var E=s[M][w];if(!h(E,d))for(var S=i[M],A=i[M+1],O=S;O<A;O++){var C=n[O];b[C]!==N?(b[C]=N,g.push(C),x[C]=m(E,r[O])):x[C]=p(x[C],m(E,r[O]))}}for(var T=v[w],_=g.length,I=T;I<_;I++){var k=g[I];y[I]=x[k]}}return v[l]=g.length,t},"SparseMatrix, SparseMatrix":function(e,t){var r,n=e._values,i=e._index,a=e._ptr,o=e._datatype,s=t._values,u=t._index,c=t._ptr,f=t._datatype,l=e._size[0],p=t._size[1],m=n&&s,h=q,d=B;o&&f&&o===f&&"string"==typeof o&&(h=R.find(q,[r=o,r]),d=R.find(B,[r,r]));for(var y,g,v,x,b,w=m?[]:void 0,N=[],M=[],t=e.createSparseMatrix({values:w,index:N,ptr:M,size:[l,p],datatype:r}),E=m?[]:void 0,S=[],A=0;A<p;A++){M[A]=N.length;for(var O=A+1,C=c[A],T=c[A+1],_=C;_<T;_++)if(b=u[_],m)for(g=a[b],v=a[b+1],y=g;y<v;y++)S[x=i[y]]!==O?(S[x]=O,N.push(x),E[x]=d(s[_],n[y])):E[x]=h(E[x],d(s[_],n[y]));else for(g=a[b],v=a[b+1],y=g;y<v;y++)S[x=i[y]]!==O&&(S[x]=O,N.push(x));if(m)for(var C=M[A],I=N.length,k=C;k<I;k++){var z=N[k];w[k]=E[z]}}return M[p]=N.length,t}});return R("multiply",nt({"Array, Array":function(e,t){o(_(e),_(t));e=this(r(e),r(t));return F(e)?e.valueOf():e},"Matrix, Matrix":function(e,t){var r=e.size(),n=t.size();return o(r,n),(1===r.length?1===n.length?function(e,t){if(0===r[0])throw new Error("Cannot multiply two empty vectors");return i(e,t)}:function(e,t){if("dense"!==t.storage())throw new Error("Support for SparseMatrix not implemented");var r,n=e._data,i=e._size,a=e._datatype,o=t._data,s=t._size,t=t._datatype,u=i[0],c=s[1],f=q,l=B;a&&t&&a===t&&"string"==typeof a&&(f=R.find(q,[r=a,r]),l=R.find(B,[r,r]));for(var p=[],m=0;m<c;m++){for(var h=l(n[0],o[0][m]),d=1;d<u;d++)h=f(h,l(n[d],o[d][m]));p[m]=h}return e.createDenseMatrix({data:p,size:[c],datatype:r})}:1===n.length?s:u)(e,t)},"Matrix, Array":function(e,t){return this(e,r(t))},"Array, Matrix":function(e,t){return this(r(e,t.storage()),t)},"SparseMatrix, any":function(e,t){return n(e,t,B,!1)},"DenseMatrix, any":function(e,t){return a(e,t,B,!1)},"any, SparseMatrix":function(e,t){return n(t,e,B,!0)},"any, DenseMatrix":function(e,t){return a(t,e,B,!0)},"Array, any":function(e,t){return a(r(e),t,B,!1).valueOf()},"any, Array":function(e,t){return a(r(t),e,B,!0).valueOf()},"any, any":B,"any, any, ...any":function(e,t,r){for(var n=this(e,t),i=0;i<r.length;i++)n=this(n,r[i]);return n}},B.signatures))}),xn=l("nthRoot",["typed","matrix","equalScalar","BigNumber"],function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,s=e.BigNumber,i=on({typed:t}),a=fn({typed:t,equalScalar:n}),o=ln({typed:t,equalScalar:n}),u=m({typed:t,equalScalar:n}),c=d({typed:t}),f=h({typed:t}),l="Complex number not supported in function nthRoot. Use nthRoots instead.";return t("nthRoot",{number:Br,"number, number":Br,BigNumber:function(e){return p(e,new s(2))},Complex:function(e){throw new Error(l)},"Complex, number":function(e,t){throw new Error(l)},"BigNumber, BigNumber":p,"Array | Matrix":function(e){return this(e,2)},"SparseMatrix, SparseMatrix":function(e,t){if(1===t.density())return o(e,t,this);throw new Error("Root must be non-zero")},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){if(1===t.density())return i(e,t,this,!1);throw new Error("Root must be non-zero")},"DenseMatrix, DenseMatrix":function(e,t){return c(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, number | BigNumber":function(e,t){return u(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return f(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){if(1===t.density())return u(t,e,this,!0);throw new Error("Root must be non-zero")},"number | BigNumber, DenseMatrix":function(e,t){return f(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return this(r(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return this(e,r(t)).valueOf()}});function p(e,t){var r=s.precision,n=s.clone({precision:r+2}),i=new s(0),a=new n(1),o=t.isNegative();if((t=o?t.neg():t).isZero())throw new Error("Root must be non-zero");if(e.isNegative()&&!t.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(e.isZero())return o?new n(1/0):0;if(!e.isFinite())return o?i:e;n=e.abs().pow(a.div(t)),n=e.isNeg()?n.neg():n;return new s((o?a.div(n):n).toPrecision(r))}}),bn=l("sign",["typed","BigNumber","Fraction","complex"],function(e){var t=e.typed,r=e.BigNumber,n=e.complex,i=e.Fraction;return t("sign",{number:Dr,Complex:function(e){return 0===e.im?n(Dr(e.re)):e.sign()},BigNumber:function(e){return new r(e.cmp(0))},Fraction:function(e){return new i(e.s,1)},"Array | Matrix":function(e){return me(e,this,!0)},Unit:function(e){if(e._isDerived()||0===e.units[0].unit.offset)return this(e.value);throw new TypeError("sign is ambiguous for units with offset")}})}),wn=l("sqrt",["config","typed","Complex"],function(e){var t=e.config,r=e.typed,n=e.Complex;return r("sqrt",{number:i,Complex:function(e){return e.sqrt()},BigNumber:function(e){return!e.isNegative()||t.predictable?e.sqrt():i(e.toNumber())},"Array | Matrix":function(e){return me(e,this,!0)},Unit:function(e){return e.pow(.5)}});function i(e){return isNaN(e)?NaN:0<=e||t.predictable?Math.sqrt(e):new n(e,0).sqrt()}}),Nn=l("square",["typed"],function(e){return(0,e.typed)("square",{number:jr,Complex:function(e){return e.mul(e)},BigNumber:function(e){return e.times(e)},Fraction:function(e){return e.mul(e)},"Array | Matrix":function(e){return me(e,this,!0)},Unit:function(e){return e.pow(2)}})}),Mn=l("subtract",["typed","matrix","equalScalar","addScalar","unaryMinus","DenseMatrix"],function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.addScalar,a=e.unaryMinus,e=e.DenseMatrix,o=on({typed:t}),s=y({typed:t}),u=dn({typed:t,equalScalar:n}),c=un({typed:t,DenseMatrix:e}),f=d({typed:t}),l=h({typed:t});return t("subtract",{"number, number":function(e,t){return e-t},"Complex, Complex":function(e,t){return e.sub(t)},"BigNumber, BigNumber":function(e,t){return e.minus(t)},"Fraction, Fraction":function(e,t){return e.sub(t)},"Unit, Unit":function(e,t){if(null===e.value)throw new Error("Parameter x contains a unit with undefined value");if(null===t.value)throw new Error("Parameter y contains a unit with undefined value");if(!e.equalBase(t))throw new Error("Units do not match");e=e.clone();return e.value=this(e.value,t.value),e.fixPrefix=!1,e},"SparseMatrix, SparseMatrix":function(e,t){return En(e,t),u(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return En(e,t),s(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return En(e,t),o(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return En(e,t),f(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return c(e,a(t),i)},"DenseMatrix, any":function(e,t){return l(e,t,this)},"any, SparseMatrix":function(e,t){return c(t,e,this,!0)},"any, DenseMatrix":function(e,t){return l(t,e,this,!0)},"Array, any":function(e,t){return l(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return l(r(t),e,this,!0).valueOf()}})});function En(e,t){e=e.size(),t=t.size();if(e.length!==t.length)throw new z(e.length,t.length)}var Sn=l("xgcd",["typed","config","matrix","BigNumber"],function(e){var t=e.typed,l=e.config,p=e.matrix,m=e.BigNumber;return t("xgcd",{"number, number":function(e,t){e=Pr(e,t);return"Array"===l.matrix?e:p(e)},"BigNumber, BigNumber":function(e,t){var r,n,i,a=new m(0),o=new m(1),s=a,u=o,c=o,f=a;if(!e.isInt()||!t.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!t.isZero();)n=e.div(t).floor(),i=e.mod(t),r=s,s=u.minus(n.times(s)),u=r,r=c,c=f.minus(n.times(c)),f=r,e=t,t=i;return o=e.lt(a)?[e.neg(),u.neg(),f.neg()]:[e,e.isZero()?0:u,f],"Array"===l.matrix?o:p(o)}})}),An=l("invmod",["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],function(e){var t=e.typed,n=(e.config,e.BigNumber),i=e.xgcd,a=e.equal,o=e.smaller,s=e.mod,u=e.add,c=e.isInteger;return t("invmod",{"number, number":r,"BigNumber, BigNumber":r});function r(e,t){if(!c(e)||!c(t))throw new Error("Parameters in function invmod must be integer numbers");if(e=s(e,t),a(t,0))throw new Error("Divisor must be non zero");var e=i(e,t).valueOf(),e=Yr()(e,2),r=e[0],e=e[1];return a(r,n(1))?(e=s(e,t),e=o(e,n(0))?u(e,t):e):NaN}}),On=l("algorithm09",["typed","equalScalar"],function(e){var T=e.typed,_=e.equalScalar;return function(e,t,r){var n=e._values,i=e._index,a=e._ptr,o=e._size,s=e._datatype,u=t._values,c=t._index,f=t._ptr,l=t._size,t=t._datatype;if(o.length!==l.length)throw new z(o.length,l.length);if(o[0]!==l[0]||o[1]!==l[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+l+")");var p,l=o[0],m=o[1],h=_,d=0,y=r;"string"==typeof s&&s===t&&(h=T.find(_,[p=s,p]),d=T.convert(0,p),y=T.find(r,[p,p]));for(var g,v,x,b,w=n&&u?[]:void 0,N=[],M=[],E=w?[]:void 0,S=[],A=0;A<m;A++){M[A]=N.length;var O,C=A+1;if(E)for(x=f[A],b=f[A+1],v=x;v<b;v++)S[g=c[v]]=C,E[g]=u[v];for(x=a[A],b=a[A+1],v=x;v<b;v++)g=i[v],E?(O=S[g]===C?E[g]:d,h(O=y(n[v],O),d)||(N.push(g),w.push(O))):N.push(g)}return M[m]=N.length,e.createSparseMatrix({values:w,index:N,ptr:M,size:[l,m],datatype:p})}}),Cn=l("dotMultiply",["typed","matrix","equalScalar","multiplyScalar"],function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.multiplyScalar,a=fn({typed:t,equalScalar:n}),o=On({typed:t,equalScalar:n}),s=m({typed:t,equalScalar:n}),u=d({typed:t}),c=h({typed:t});return t("dotMultiply",{"any, any":i,"SparseMatrix, SparseMatrix":function(e,t){return o(e,t,i,!1)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,i,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,i,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,i)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return s(e,t,i,!1)},"DenseMatrix, any":function(e,t){return c(e,t,i,!1)},"any, SparseMatrix":function(e,t){return s(t,e,i,!0)},"any, DenseMatrix":function(e,t){return c(t,e,i,!0)},"Array, any":function(e,t){return c(r(e),t,i,!1).valueOf()},"any, Array":function(e,t){return c(r(t),e,i,!0).valueOf()}})});function Tn(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 kn(e,t,function(e,t){return e&t})}function _n(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var t=e.constructor,r=t.precision,e=(t.config({precision:1e9}),e.plus(new t(1)));return e.s=-e.s||null,t.config({precision:r}),e}function In(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);r=new r(-1);return e.isZero()||t.eq(r)||e.eq(t)?t:t.isZero()||e.eq(r)?e:e.isFinite()&&t.isFinite()?kn(e,t,function(e,t){return e|t}):!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?r:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e}function kn(e,t,r){var n,i,a=e.constructor,o=+(e.s<0),s=+(t.s<0);if(o)for(var u=zn(_n(e)),c=0;c<u.length;++c)u[c]^=1;else u=zn(e);if(s)for(var f=zn(_n(t)),l=0;l<f.length;++l)f[l]^=1;else f=zn(t);var p=u.length<=f.length?(n=u,i=f,o):(n=f,i=u,s),m=n.length,h=i.length,d=1^r(o,s),y=new a(1^d),g=new a(1),v=new a(2),e=a.precision;for(a.config({precision:1e9});0<m;)r(n[--m],i[--h])===d&&(y=y.plus(g)),g=g.times(v);for(;0<h;)r(p,i[--h])===d&&(y=y.plus(g)),g=g.times(v);return a.config({precision:e}),0==d&&(y.s=-y.s),y}function zn(e){for(var t=e.d,r=t[0]+"",n=1;n<t.length;++n){for(var i=t[n]+"",a=7-i.length;a--;)i="0"+i;r+=i}for(var o=r.length;"0"===r.charAt(o);)o--;var s=e.e,u=r.slice(0,o+1||1),e=u.length;if(0<s)if(++s>e)for(s-=e;s--;)u+="0";else s<e&&(u=u.slice(0,s)+"."+u.slice(s));for(var c=[0],f=0;f<u.length;){for(var l=c.length;l--;)c[l]*=10;c[0]+=parseInt(u.charAt(f++));for(var p=0;p<c.length;++p)1<c[p]&&(null!==c[p+1]&&void 0!==c[p+1]||(c[p+1]=0),c[p+1]+=c[p]>>1,c[p]&=1)}return c.reverse()}function Rn(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)?_n(t):t.eq(n)?_n(e):e.isFinite()&&t.isFinite()?kn(e,t,function(e,t){return e^t}):e.isFinite()||t.isFinite()?new r(e.isNegative()===t.isNegative()?1/0:-1/0):n}function qn(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()?t.lt(55)?e.times(Math.pow(2,t.toNumber())+""):e.times(new r(2).pow(t)):new r(NaN)}function Bn(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())+""):e.div(new r(2).pow(t))).floor():e.isNegative()?new r(-1):e.isFinite()?new r(0):new r(NaN)}r="number, number";function Dn(e,t){if(E(e)&&E(t))return e&t;throw new Error("Integers expected in function bitAnd")}function jn(e){if(E(e))return~e;throw new Error("Integer expected in function bitNot")}function Pn(e,t){if(E(e)&&E(t))return e|t;throw new Error("Integers expected in function bitOr")}function Fn(e,t){if(E(e)&&E(t))return e^t;throw new Error("Integers expected in function bitXor")}function Un(e,t){if(E(e)&&E(t))return e<<t;throw new Error("Integers expected in function leftShift")}function Ln(e,t){if(E(e)&&E(t))return e>>t;throw new Error("Integers expected in function rightArithShift")}function $n(e,t){if(E(e)&&E(t))return e>>>t;throw new Error("Integers expected in function rightLogShift")}Dn.signature=r,jn.signature="number",$n.signature=Ln.signature=Un.signature=Fn.signature=Pn.signature=r;var Hn=l("bitAnd",["typed","matrix","equalScalar"],function(e){var t=e.typed,r=e.matrix,e=e.equalScalar,n=fn({typed:t,equalScalar:e}),i=ln({typed:t,equalScalar:e}),a=m({typed:t,equalScalar:e}),o=d({typed:t}),s=h({typed:t});return t("bitAnd",{"number, number":Dn,"BigNumber, BigNumber":Tn,"SparseMatrix, SparseMatrix":function(e,t){return i(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return n(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return n(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return o(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return a(e,t,this,!1)},"DenseMatrix, any":function(e,t){return s(e,t,this,!1)},"any, SparseMatrix":function(e,t){return a(t,e,this,!0)},"any, DenseMatrix":function(e,t){return s(t,e,this,!0)},"Array, any":function(e,t){return s(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return s(r(t),e,this,!0).valueOf()}})}),Gn=l("bitNot",["typed"],function(e){return(0,e.typed)("bitNot",{number:jn,BigNumber:_n,"Array | Matrix":function(e){return me(e,this)}})}),Vn=l("bitOr",["typed","matrix","equalScalar","DenseMatrix"],function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,e=e.DenseMatrix,i=on({typed:t}),a=sn({typed:t,equalScalar:n}),o=un({typed:t,DenseMatrix:e}),s=d({typed:t}),u=h({typed:t});return t("bitOr",{"number, number":Pn,"BigNumber, BigNumber":In,"SparseMatrix, SparseMatrix":function(e,t){return a(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return i(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return i(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return s(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return o(e,t,this,!1)},"DenseMatrix, any":function(e,t){return u(e,t,this,!1)},"any, SparseMatrix":function(e,t){return o(t,e,this,!0)},"any, DenseMatrix":function(e,t){return u(t,e,this,!0)},"Array, any":function(e,t){return u(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return u(r(t),e,this,!0).valueOf()}})}),Zn=l("algorithm07",["typed","DenseMatrix"],function(e){var b=e.typed,w=e.DenseMatrix;return function(e,t,r){var n=e._size,i=e._datatype,a=t._size,o=t._datatype;if(n.length!==a.length)throw new z(n.length,a.length);if(n[0]!==a[0]||n[1]!==a[1])throw new RangeError("Dimension mismatch. Matrix A ("+n+") must match Matrix B ("+a+")");for(var s,u=n[0],c=n[1],f=0,l=r,p=("string"==typeof i&&i===o&&(f=b.convert(0,s=i),l=b.find(r,[s,s])),[]),m=0;m<u;m++)p[m]=[];for(var h=[],d=[],y=[],g=[],v=0;v<c;v++){var x=v+1;for(N(e,v,y,h,x),N(t,v,g,d,x),m=0;m<u;m++)p[m][v]=l(y[m]===x?h[m]:f,g[m]===x?d[m]:f)}return new w({data:p,size:[u,c],datatype:s})};function N(e,t,r,n,i){for(var a=e._values,o=e._index,e=e._ptr,s=e[t],u=e[t+1];s<u;s++){var c=o[s];r[c]=i,n[c]=a[s]}}}),Wn=l("bitXor",["typed","matrix","DenseMatrix"],function(e){var t=e.typed,r=e.matrix,e=e.DenseMatrix,n=y({typed:t}),i=Zn({typed:t,DenseMatrix:e}),a=p({typed:t,DenseMatrix:e}),o=d({typed:t}),s=h({typed:t});return t("bitXor",{"number, number":Fn,"BigNumber, BigNumber":Rn,"SparseMatrix, SparseMatrix":function(e,t){return i(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return n(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return n(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return o(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return a(e,t,this,!1)},"DenseMatrix, any":function(e,t){return s(e,t,this,!1)},"any, SparseMatrix":function(e,t){return a(t,e,this,!0)},"any, DenseMatrix":function(e,t){return s(t,e,this,!0)},"Array, any":function(e,t){return s(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return s(r(t),e,this,!0).valueOf()}})}),Yn=l("arg",["typed"],function(e){return(0,e.typed)("arg",{number:function(e){return Math.atan2(0,e)},BigNumber:function(e){return e.constructor.atan2(0,e)},Complex:function(e){return e.arg()},"Array | Matrix":function(e){return me(e,this)}})}),Jn=l("conj",["typed"],function(e){return(0,e.typed)("conj",{number:function(e){return e},BigNumber:function(e){return e},Complex:function(e){return e.conjugate()},"Array | Matrix":function(e){return me(e,this)}})}),Xn=l("im",["typed"],function(e){return(0,e.typed)("im",{number:function(e){return 0},BigNumber:function(e){return e.mul(0)},Fraction:function(e){return e.mul(0)},Complex:function(e){return e.im},"Array | Matrix":function(e){return me(e,this)}})}),Qn=l("re",["typed"],function(e){return(0,e.typed)("re",{number:function(e){return e},BigNumber:function(e){return e},Fraction:function(e){return e},Complex:function(e){return e.re},"Array | Matrix":function(e){return me(e,this)}})});function Kn(e){return!e}function ei(e,t){return!(!e&&!t)}function ti(e,t){return!!e!=!!t}function ri(e,t){return!(!e||!t)}Kn.signature="number",ri.signature=ti.signature=ei.signature="number, number";var ni=l("not",["typed"],function(e){return(0,e.typed)("not",{number:Kn,Complex:function(e){return 0===e.re&&0===e.im},BigNumber:function(e){return e.isZero()||e.isNaN()},Unit:function(e){return null===e.value||this(e.value)},"Array | Matrix":function(e){return me(e,this)}})}),ii=l("or",["typed","matrix","equalScalar","DenseMatrix"],function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,e=e.DenseMatrix,i=y({typed:t}),a=dn({typed:t,equalScalar:n}),o=p({typed:t,DenseMatrix:e}),s=d({typed:t}),u=h({typed:t});return t("or",{"number, number":ei,"Complex, Complex":function(e,t){return 0!==e.re||0!==e.im||0!==t.re||0!==t.im},"BigNumber, BigNumber":function(e,t){return!e.isZero()&&!e.isNaN()||!t.isZero()&&!t.isNaN()},"Unit, Unit":function(e,t){return this(e.value||0,t.value||0)},"SparseMatrix, SparseMatrix":function(e,t){return a(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return i(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return i(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return s(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return o(e,t,this,!1)},"DenseMatrix, any":function(e,t){return u(e,t,this,!1)},"any, SparseMatrix":function(e,t){return o(t,e,this,!0)},"any, DenseMatrix":function(e,t){return u(t,e,this,!0)},"Array, any":function(e,t){return u(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return u(r(t),e,this,!0).valueOf()}})}),ai=l("xor",["typed","matrix","DenseMatrix"],function(e){var t=e.typed,r=e.matrix,e=e.DenseMatrix,n=y({typed:t}),i=Zn({typed:t,DenseMatrix:e}),a=p({typed:t,DenseMatrix:e}),o=d({typed:t}),s=h({typed:t});return t("xor",{"number, number":ti,"Complex, Complex":function(e,t){return(0!==e.re||0!==e.im)!=(0!==t.re||0!==t.im)},"BigNumber, BigNumber":function(e,t){return(!e.isZero()&&!e.isNaN())!=(!t.isZero()&&!t.isNaN())},"Unit, Unit":function(e,t){return this(e.value||0,t.value||0)},"SparseMatrix, SparseMatrix":function(e,t){return i(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return n(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return n(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return o(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return a(e,t,this,!1)},"DenseMatrix, any":function(e,t){return s(e,t,this,!1)},"any, SparseMatrix":function(e,t){return a(t,e,this,!0)},"any, DenseMatrix":function(e,t){return s(t,e,this,!0)},"Array, any":function(e,t){return s(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return s(r(t),e,this,!0).valueOf()}})}),oi=l("concat",["typed","matrix","isInteger"],function(e){var t=e.typed,f=e.matrix,l=e.isInteger;return t("concat",{"...Array | Matrix | number | BigNumber":function(e){for(var t,r=e.length,n=-1,i=!1,a=[],o=0;o<r;o++){var s=e[o];if(F(s)&&(i=!0),K(s)||ee(s)){if(o!==r-1)throw new Error("Dimension must be specified as last argument");if(t=n,n=s.valueOf(),!l(n))throw new TypeError("Integer number expected for dimension");if(n<0||0<o&&t<n)throw new Pe(n,t+1)}else{var s=ne(s).valueOf(),u=_(s);if(a[o]=s,t=n,n=u.length-1,0<o&&n!==t)throw new z(t+1,n+1)}}if(0===a.length)throw new SyntaxError("At least one matrix expected");for(var c=a.shift();a.length;)c=function e(t,r,n,i){if(i<n){if(t.length!==r.length)throw new z(t.length,r.length);for(var a=[],o=0;o<t.length;o++)a[o]=e(t[o],r[o],n,i+1);return a}return t.concat(r)}(c,a.shift(),n,0);return i?f(c):c},"...string":function(e){return e.join("")}})});var si=l("column",["typed","Index","matrix","range"],function(e){var t=e.typed,n=e.Index,r=e.matrix,i=e.range;return t("column",{"Matrix, number":a,"Array, number":function(e,t){return a(r(ne(e)),t).valueOf()}});function a(e,t){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");I(t,e.size()[1]);var r=i(0,e.size()[0]),r=new n(r,t);return e.subset(r)}}),ui=l("count",["typed","size","prod"],function(e){var t=e.typed,r=e.size,n=e.prod;return t("count",{string:function(e){return e.length},"Matrix | Array":function(e){return n(r(e))}})}),ci=l("cross",["typed","matrix","subtract","multiply"],function(e){var t=e.typed,r=e.matrix,a=e.subtract,o=e.multiply;return t("cross",{"Matrix, Matrix":function(e,t){return r(n(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return r(n(e.toArray(),t))},"Array, Matrix":function(e,t){return r(n(e,t.toArray()))},"Array, Array":n});function n(e,t){var r=Math.max(_(e).length,_(t).length),n=(e=Ge(e),t=Ge(t),_(e)),i=_(t);if(1!==n.length||1!==i.length||3!==n[0]||3!==i[0])throw new RangeError("Vectors with length 3 expected (Size A = ["+n.join(", ")+"], B = ["+i.join(", ")+"])");n=[a(o(e[1],t[2]),o(e[2],t[1])),a(o(e[2],t[0]),o(e[0],t[2])),a(o(e[0],t[1]),o(e[1],t[0]))];return 1<r?[n]:n}}),fi=l("diag",["typed","matrix","DenseMatrix","SparseMatrix"],function(e){var t=e.typed,y=e.matrix,g=e.DenseMatrix,v=e.SparseMatrix;return t("diag",{Array:function(e){return n(e,0,_(e),null)},"Array, number":function(e,t){return n(e,t,_(e),null)},"Array, BigNumber":function(e,t){return n(e,t.toNumber(),_(e),null)},"Array, string":function(e,t){return n(e,0,_(e),t)},"Array, number, string":function(e,t,r){return n(e,t,_(e),r)},"Array, BigNumber, string":function(e,t,r){return n(e,t.toNumber(),_(e),r)},Matrix:function(e){return n(e,0,e.size(),e.storage())},"Matrix, number":function(e,t){return n(e,t,e.size(),e.storage())},"Matrix, BigNumber":function(e,t){return n(e,t.toNumber(),e.size(),e.storage())},"Matrix, string":function(e,t){return n(e,0,e.size(),t)},"Matrix, number, string":function(e,t,r){return n(e,t,e.size(),r)},"Matrix, BigNumber, string":function(e,t,r){return n(e,t.toNumber(),e.size(),r)}});function n(e,t,r,n){if(!E(t))throw new TypeError("Second parameter in function diag must be an integer");var i=0<t?t:0,a=t<0?-t:0;switch(r.length){case 1:var o=e,s=t,u=n,c=r[0];if(c=[c+a,c+i],u&&"sparse"!==u&&"dense"!==u)throw new TypeError("Unknown matrix type ".concat(u,'"'));return c=("sparse"===u?v:g).diagonal(c,o,s),null!==u?c:c.valueOf();case 2:var f=e,o=n,s=r,l=a,p=i;if(F(f))return u=f.diagonal(t),null!==o?o!==u.storage()?y(u,o):u:u.valueOf();for(var m=Math.min(s[0]-l,s[1]-p),h=[],d=0;d<m;d++)h[d]=f[d+l][d+p];return null!==o?y(h):h}throw new RangeError("Matrix for function diag must be 2 dimensional")}});function li(n){function i(e){var t=u[e];if(t&&(delete s[t],delete u[e],--a,o===t)){if(!a)return c=0,void(o=1);for(;!hasOwnProperty.call(s,++o););}}var a=0,o=1,s=Object.create(null),u=Object.create(null),c=0;return n=Math.abs(n),{hit:function(e){var t=u[e],r=++c;if(s[r]=e,u[e]=r,!t)return++a<=n?void 0:(e=s[o],i(e),e);if(delete s[t],o===t)for(;!hasOwnProperty.call(s,++o););},delete:i,clear:function(){a=c=0,o=1,s=Object.create(null),u=Object.create(null)}}}function pi(a,e){var e=1<arguments.length&&void 0!==e?e:{},o=e.hasher,s=null==(s=e.limit)?Number.POSITIVE_INFINITY:s,o=null==o?JSON.stringify:o;return function e(){"object"!==Z()(e.cache)&&(e.cache={values:new Map,lru:li(s||Number.POSITIVE_INFINITY)});for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=o(t);if(e.cache.values.has(n))return e.cache.lru.hit(n),e.cache.values.get(n);var i=a.apply(a,t);return e.cache.values.set(n,i),e.cache.values.delete(e.cache.lru.hit(n)),i}}function mi(e){return Object.keys(e.signatures||{}).reduce(function(e,t){t=(t.match(/,/g)||[]).length+1;return Math.max(e,t)},-1)}var hi=l("filter",["typed"],function(e){return(0,e.typed)("filter",{"Array, function":di,"Matrix, function":function(e,t){return e.create(di(e.toArray(),t))},"Array, RegExp":Je,"Matrix, RegExp":function(e,t){return e.create(Je(e.toArray(),t))}})});function di(e,n){var i=mi(n);return Ye(e,function(e,t,r){return 1===i?n(e):2===i?n(e,[t]):n(e,[t],r)})}var yi=l("flatten",["typed","matrix"],function(e){var t=e.typed,r=e.matrix;return t("flatten",{Array:function(e){return b(ne(e))},Matrix:function(e){e=b(ne(e.toArray()));return r(e)}})}),gi=l("forEach",["typed"],function(e){return(0,e.typed)("forEach",{"Array, function":vi,"Matrix, function":function(e,t){return e.forEach(t)}})});function vi(t,i){var a=mi(i);!function r(e,n){Array.isArray(e)?We(e,function(e,t){r(e,n.concat(t))}):1===a?i(e):2===a?i(e,n):i(e,n,t)}(t,[])}var xi=l("getMatrixDataType",["typed"],function(e){return(0,e.typed)("getMatrixDataType",{Array:function(e){return et(e,te)},Matrix:function(e){return e.getDataType()}})}),bi=l("identity",["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],function(e){var t=e.typed,r=e.config,n=e.matrix,c=e.BigNumber,f=e.DenseMatrix,l=e.SparseMatrix;return t("identity",{"":function(){return"Matrix"===r.matrix?n([]):[]},string:function(e){return n(e)},"number | BigNumber":function(e){return a(e,e,"Matrix"===r.matrix?"dense":void 0)},"number | BigNumber, string":function(e,t){return a(e,e,t)},"number | BigNumber, number | BigNumber":function(e,t){return a(e,t,"Matrix"===r.matrix?"dense":void 0)},"number | BigNumber, number | BigNumber, string":a,Array:function(e){return i(e)},"Array, string":i,Matrix:function(e){return i(e.valueOf(),e.storage())},"Matrix, string":function(e,t){return i(e.valueOf(),t)}});function i(e,t){switch(e.length){case 0:return t?n(t):[];case 1:return a(e[0],e[0],t);case 2:return a(e[0],e[1],t);default:throw new Error("Vector containing two values expected")}}function a(e,t,r){var n=ee(e)||ee(t)?c:null;if(ee(e)&&(e=e.toNumber()),ee(t)&&(t=t.toNumber()),!E(e)||e<1)throw new Error("Parameters in function identity must be positive integers");if(!E(t)||t<1)throw new Error("Parameters in function identity must be positive integers");var i=n?new c(1):1,n=n?new n(0):0,a=[e,t];if(r){if("sparse"===r)return l.diagonal(a,i,0,n);if("dense"===r)return f.diagonal(a,i,0,n);throw new TypeError('Unknown matrix type "'.concat(r,'"'))}for(var o=Ue([],a,n),s=e<t?e:t,u=0;u<s;u++)o[u][u]=i;return o}}),wi=l("kron",["typed","matrix","multiplyScalar"],function(e){var t=e.typed,r=e.matrix,a=e.multiplyScalar;return t("kron",{"Matrix, Matrix":function(e,t){return r(n(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return r(n(e.toArray(),t))},"Array, Matrix":function(e,t){return r(n(e,t.toArray()))},"Array, Array":n});function n(e,r){if(1===_(e).length&&(e=[e]),1===_(r).length&&(r=[r]),2<_(e).length||2<_(r).length)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(e.length)+", y = "+JSON.stringify(r.length)+")");var n=[],i=[];return e.map(function(t){return r.map(function(e){return i=[],n.push(i),t.map(function(t){return e.map(function(e){return i.push(a(t,e))})})})})&&n}}),Ni=l("map",["typed"],function(e){return(0,e.typed)("map",{"Array, function":Mi,"Matrix, function":function(e,t){return e.map(t)}})});function Mi(a,e){var o=mi(e);return function r(t,n){if(Array.isArray(t))return t.map(function(e,t){return r(e,n.concat(t))});try{return 1===o?e(t):2===o?e(t,n):e(t,n,a)}catch(e){var i;if(e instanceof TypeError&&"data"in e&&"wrongType"===e.data.category)throw t="map attempted to call '".concat(e.data.fn,"(").concat(t),i=JSON.stringify(n),2===o?t+=","+i:1!==o&&(t+=",".concat(i,",").concat(a)),t=(t=(t+=")' but argument ".concat(e.data.index+1," of type "))+"".concat(e.data.actual," does not match expected type "))+e.data.expected.join(" or "),new TypeError(t);throw e}}(a,[])}var Ei=l("diff",["typed","matrix","subtract","number"],function(e){var t=e.typed,r=e.matrix,i=e.subtract,n=e.number;return t("diff",{"Array | Matrix":function(e){return F(e)?r(o(e.toArray())):o(e)},"Array | Matrix, number":function(e,t){if(E(t))return F(e)?r(a(e.toArray(),t)):a(e,t);throw new RangeError("Dimension must be a whole number")},"Array | Matrix, BigNumber":function(e,t){return this(e,n(t))}});function a(e,t){if(F(e)&&(e=e.toArray()),!Array.isArray(e))throw RangeError("Array/Matrix does not have that many dimensions");var r;if(0<t)return r=[],e.forEach(function(e){r.push(a(e,t-1))}),r;if(0===t)return o(e);throw RangeError("Cannot have negative dimension")}function o(e){var t=[],r=e.length;if(r<2)return e;for(var n=1;n<r;n++)t.push(function a(e,t){F(e)&&(e=e.toArray()),F(t)&&(t=t.toArray());var r=Array.isArray(e),n=Array.isArray(t);if(r&&n)return function(e,t){if(e.length!==t.length)throw RangeError("Not all sub-arrays have the same length");for(var r=[],n=e.length,i=0;i<n;i++)r.push(a(e[i],t[i]));return r}(e,t);if(!r&&!n)return i(t,e);throw TypeError("Cannot calculate difference between 1 array and 1 non-array")}(e[n-1],e[n]));return t}}),Si=l("ones",["typed","config","matrix","BigNumber"],function(e){var t=e.typed,r=e.config,i=e.matrix,a=e.BigNumber;return t("ones",{"":function(){return"Array"===r.matrix?n([]):n([],"default")},"...number | BigNumber | string":function(e){var t;return"string"==typeof e[e.length-1]?(t=e.pop(),n(e,t)):"Array"===r.matrix?n(e):n(e,"default")},Array:n,Matrix:function(e){var t=e.storage();return n(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return n(e.valueOf(),t)}});function n(e,t){n=!1,e.forEach(function(e,t,r){ee(e)&&(n=!0,r[t]=e.toNumber())});var n,r=n?new a(1):1;if(e.forEach(function(e){if("number"!=typeof e||!E(e)||e<0)throw new Error("Parameters in function ones must be positive integers")}),t)return t=i(t),0<e.length?t.resize(e,r):t;t=[];return 0<e.length?Ue(t,e,r):t}});function Ai(){throw new Error('No "bignumber" implementation available')}function Oi(){throw new Error('No "fraction" implementation available')}function Ci(){throw new Error('No "matrix" implementation available')}var Ti=l("range",["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq"],function(e){var t=e.typed,n=e.config,r=e.matrix,o=e.bignumber,s=e.smaller,u=e.smallerEq,c=e.larger,f=e.largerEq;return t("range",{string:a,"string, boolean":a,"number, number":function(e,t){return i(l(e,t,1))},"number, number, number":function(e,t,r){return i(l(e,t,r))},"number, number, boolean":function(e,t,r){return i((r?p:l)(e,t,1))},"number, number, number, boolean":function(e,t,r,n){return i((n?p:l)(e,t,r))},"BigNumber, BigNumber":function(e,t){return i(m(e,t,new e.constructor(1)))},"BigNumber, BigNumber, BigNumber":function(e,t,r){return i(m(e,t,r))},"BigNumber, BigNumber, boolean":function(e,t,r){var n=e.constructor;return i((r?h:m)(e,t,new n(1)))},"BigNumber, BigNumber, BigNumber, boolean":function(e,t,r,n){return i((n?h:m)(e,t,r))}});function i(e){return"Matrix"===n.matrix?r?r(e):Ci():e}function a(t,e){var r=function(){var e=t.split(":").map(function(e){return Number(e)});if(e.some(function(e){return isNaN(e)}))return null;switch(e.length){case 2:return{start:e[0],end:e[1],step:1};case 3:return{start:e[0],end:e[2],step:e[1]};default:return null}}();if(r)return"BigNumber"===n.number?(void 0===o&&Ai(),i((e?h:m)(o(r.start),o(r.end),o(r.step)))):i((e?p:l)(r.start,r.end,r.step));throw new SyntaxError('String "'+t+'" is no valid range')}function l(e,t,r){var n=[],i=e;if(0<r)for(;s(i,t);)n.push(i),i+=r;else if(r<0)for(;c(i,t);)n.push(i),i+=r;return n}function p(e,t,r){var n=[],i=e;if(0<r)for(;u(i,t);)n.push(i),i+=r;else if(r<0)for(;f(i,t);)n.push(i),i+=r;return n}function m(e,t,r){var n=o(0),i=[],a=e;if(r.gt(n))for(;s(a,t);)i.push(a),a=a.plus(r);else if(r.lt(n))for(;c(a,t);)i.push(a),a=a.plus(r);return i}function h(e,t,r){var n=o(0),i=[],a=e;if(r.gt(n))for(;u(a,t);)i.push(a),a=a.plus(r);else if(r.lt(n))for(;f(a,t);)i.push(a),a=a.plus(r);return i}}),_i=l("reshape",["typed","isInteger","matrix"],function(e){var t=e.typed,r=e.isInteger;return t("reshape",{"Matrix, Array":function(e,t){return e.reshape(t)},"Array, Array":function(e,t){return t.forEach(function(e){if(!r(e))throw new TypeError("Invalid size for dimension: "+e)}),Le(e,t)}})});function Ii(e,t,r,n){if(!(this instanceof Ii))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=r,this.max=n,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+r+(null!=n?"-"+n:"")+" expected)",this.stack=(new Error).stack}(Ii.prototype=new Error).constructor=Error,Ii.prototype.name="ArgumentsError",Ii.prototype.isArgumentsError=!0;var ki=l("resize",["config","matrix"],function(e){var f=e.config,l=e.matrix;return function(e,t,r){if(2!==arguments.length&&3!==arguments.length)throw new Ii("resize",arguments.length,2,3);if(ee((t=F(t)?t.valueOf():t)[0])&&(t=t.map(function(e){return ee(e)?e.toNumber():e})),F(e))return e.resize(t,r,!0);if("string"==typeof e){var n=e,i=t,a=r;if(void 0!==a){if("string"!=typeof a||1!==a.length)throw new TypeError("Single character expected as defaultValue")}else a=" ";if(1!==i.length)throw new z(i.length,1);var o=i[0];if("number"!=typeof o||!E(o))throw new TypeError("Invalid size, must contain positive integers (size: "+re(i)+")");if(n.length>o)return n.substring(0,o);if(n.length<o){for(var s=n,u=0,c=o-n.length;u<c;u++)s+=a;return s}return n}i=!Array.isArray(e)&&"Array"!==f.matrix;if(0===t.length){for(;Array.isArray(e);)e=e[0];return ne(e)}o=Ue(e=ne(e=Array.isArray(e)?e:[e]),t,r);return i?l(o):o}}),zi=l("rotate",["typed","multiply","rotationMatrix"],function(e){var t=e.typed,n=e.multiply,i=e.rotationMatrix;return t("rotate",{"Array , number | BigNumber | Complex | Unit":function(e,t){return a(e,2),n(i(t),e).toArray()},"Matrix , number | BigNumber | Complex | Unit":function(e,t){return a(e,2),n(i(t),e)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,r){return a(e,3),n(i(t,r),e)},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,r){return a(e,3),n(i(t,r),e)}});function a(e,t){e=Array.isArray(e)?_(e):e.size();if(2<e.length)throw new RangeError("Vector must be of dimensions 1x".concat(t));if(2===e.length&&1!==e[1])throw new RangeError("Vector must be of dimensions 1x".concat(t));if(e[0]!==t)throw new RangeError("Vector must be of dimensions 1x".concat(t))}}),Ri=l("rotationMatrix",["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],function(e){var t=e.typed,n=e.config,i=e.multiplyScalar,c=e.addScalar,f=e.unaryMinus,l=e.norm,p=e.BigNumber,a=e.matrix,r=e.DenseMatrix,o=e.SparseMatrix,m=e.cos,h=e.sin;return t("rotationMatrix",{"":function(){return"Matrix"===n.matrix?a([]):[]},string:function(e){return a(e)},"number | BigNumber | Complex | Unit":function(e){return s(e,"Matrix"===n.matrix?"dense":void 0)},"number | BigNumber | Complex | Unit, string":s,"number | BigNumber | Complex | Unit, Array":function(e,t){t=a(t);return u(t),g(e,t,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(e,t){u(t);var r=t.storage()||("Matrix"===n.matrix?"dense":void 0);return g(e,t,r)},"number | BigNumber | Complex | Unit, Array, string":function(e,t,r){t=a(t);return u(t),g(e,t,r)},"number | BigNumber | Complex | Unit, Matrix, string":function(e,t,r){return u(t),g(e,t,r)}});function s(e,t){var r=ee(e)?new p(-1):-1,n=m(e),e=h(e);return y([[n,i(r,e)],[e,n]],t)}function u(e){e=e.size();if(e.length<1||3!==e[0])throw new RangeError("Vector must be of dimensions 1x3")}function d(e){return e.reduce(function(e,t){return i(e,t)})}function y(e,t){if(t){if("sparse"===t)return new o(e);if("dense"===t)return new r(e);throw new TypeError('Unknown matrix type "'.concat(t,'"'))}return e}function g(e,t,r){var n=l(t);if(0===n)throw new RangeError("Rotation around zero vector");var i=ee(e)?p:null,a=i?new i(1):1,o=i?new i(-1):-1,s=i?new i(t.get([0])/n):t.get([0])/n,u=i?new i(t.get([1])/n):t.get([1])/n,i=i?new i(t.get([2])/n):t.get([2])/n,t=m(e),n=c(a,f(t)),a=h(e);return y([[c(t,d([s,s,n])),c(d([s,u,n]),d([o,i,a])),c(d([s,i,n]),d([u,a]))],[c(d([s,u,n]),d([i,a])),c(t,d([u,u,n])),c(d([u,i,n]),d([o,s,a]))],[c(d([s,i,n]),d([o,u,a])),c(d([u,i,n]),d([s,a])),c(t,d([i,i,n]))]],r)}}),qi=l("row",["typed","Index","matrix","range"],function(e){var t=e.typed,n=e.Index,r=e.matrix,i=e.range;return t("row",{"Matrix, number":a,"Array, number":function(e,t){return a(r(ne(e)),t).valueOf()}});function a(e,t){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");I(t,e.size()[0]);var r=i(0,e.size()[1]),t=new n(t,r);return e.subset(t)}}),Bi=l("size",["typed","config","?matrix"],function(e){var t=e.typed,r=e.config,n=e.matrix;return t("size",{Matrix:function(e){return e.create(e.size())},Array:_,string:function(e){return"Array"===r.matrix?[e.length]:n([e.length])},"number | Complex | BigNumber | Unit | boolean | null":function(e){return"Array"===r.matrix?[]:n?n([]):Ci()}})}),Di=l("squeeze",["typed","matrix"],function(e){var t=e.typed,r=e.matrix;return t("squeeze",{Array:function(e){return Ge(ne(e))},Matrix:function(e){e=Ge(e.toArray());return Array.isArray(e)?r(e):e},any:ne})}),ji=l("subset",["typed","matrix"],function(e){var t=e.typed,i=e.matrix;return t("subset",{"Array, Index":function(e,t){e=i(e).subset(t);return t.isScalar()?e:e.valueOf()},"Matrix, Index":function(e,t){return e.subset(t)},"Object, Index":Ui,"string, Index":Pi,"Array, Index, any":function(e,t,r){return i(ne(e)).subset(t,r,void 0).valueOf()},"Array, Index, any, any":function(e,t,r,n){return i(ne(e)).subset(t,r,n).valueOf()},"Matrix, Index, any":function(e,t,r){return e.clone().subset(t,r)},"Matrix, Index, any, any":function(e,t,r,n){return e.clone().subset(t,r,n)},"string, Index, string":Fi,"string, Index, string, string":Fi,"Object, Index, any":Li})});function Pi(t,e){if(!k(e))throw new TypeError("Index expected");if(1!==e.size().length)throw new z(e.size().length,1);var r=t.length,r=(I(e.min()[0],r),I(e.max()[0],r),e.dimension(0)),n="";return r.forEach(function(e){n+=t.charAt(e)}),n}function Fi(e,t,r,n){if(!t||!0!==t.isIndex)throw new TypeError("Index expected");if(1!==t.size().length)throw new z(t.size().length,1);if(void 0!==n){if("string"!=typeof n||1!==n.length)throw new TypeError("Single character expected as defaultValue")}else n=" ";var i=t.dimension(0);if(i.size()[0]!==r.length)throw new z(i.size()[0],r.length);var a=e.length;I(t.min()[0]),I(t.max()[0]);for(var o=[],s=0;s<a;s++)o[s]=e.charAt(s);if(i.forEach(function(e,t){o[e]=r.charAt(t[0])}),o.length>a)for(var u=a-1,c=o.length;u<c;u++)o[u]||(o[u]=n);return o.join("")}function Ui(e,t){if(1!==t.size().length)throw new z(t.size(),1);t=t.dimension(0);if("string"!=typeof t)throw new TypeError("String expected as index to retrieve an object property");return ft(e,t)}function Li(e,t,r){if(1!==t.size().length)throw new z(t.size(),1);t=t.dimension(0);if("string"!=typeof t)throw new TypeError("String expected as index to retrieve an object property");e=ne(e);return lt(e,t,r),e}var $i=l("transpose",["typed","matrix"],function(e){var t=e.typed,r=e.matrix;return t("transpose",{Array:function(e){return this(r(e)).valueOf()},Matrix:function(e){var t,r=e.size();switch(r.length){case 1:t=e.clone();break;case 2:var n=r[0],i=r[1];if(0===i)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+re(r)+")");switch(e.storage()){case"dense":t=function(e,t,r){for(var n=e._data,i=[],a=0;a<r;a++)for(var o=i[a]=[],s=0;s<t;s++)o[s]=ne(n[s][a]);return e.createDenseMatrix({data:i,size:[r,t],datatype:e._datatype})}(e,n,i);break;case"sparse":t=function(e,t,r){for(var n,i,a,o=e._values,s=e._index,u=e._ptr,c=o?[]:void 0,f=[],l=[],p=[],m=0;m<t;m++)p[m]=0;for(n=0,i=s.length;n<i;n++)p[s[n]]++;for(var h=0,d=0;d<t;d++)l.push(h),h+=p[d],p[d]=l[d];for(l.push(h),a=0;a<r;a++)for(var y=u[a],g=u[a+1],v=y;v<g;v++){var x=p[s[v]]++;f[x]=a,o&&(c[x]=ne(o[v]))}return e.createSparseMatrix({values:c,index:f,ptr:l,size:[r,t],datatype:e._datatype})}(e,n,i)}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+re(this._size)+")")}return t},any:ne})}),Hi=l("ctranspose",["typed","transpose","conj"],function(e){var t=e.typed,r=e.transpose,n=e.conj;return t("ctranspose",{any:function(e){return n(r(e))}})}),Gi=l("zeros",["typed","config","matrix","BigNumber"],function(e){var t=e.typed,r=e.config,i=e.matrix,a=e.BigNumber;return t("zeros",{"":function(){return"Array"===r.matrix?n([]):n([],"default")},"...number | BigNumber | string":function(e){var t;return"string"==typeof e[e.length-1]?(t=e.pop(),n(e,t)):"Array"===r.matrix?n(e):n(e,"default")},Array:n,Matrix:function(e){var t=e.storage();return n(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return n(e.valueOf(),t)}});function n(e,t){n=!1,e.forEach(function(e,t,r){ee(e)&&(n=!0,r[t]=e.toNumber())});var n,r=n?new a(0):0;if(e.forEach(function(e){if("number"!=typeof e||!E(e)||e<0)throw new Error("Parameters in function zeros must be positive integers")}),t)return t=i(t),0<e.length?t.resize(e,r):t;t=[];return 0<e.length?Ue(t,e,r):t}}),r=e(21),Vi=e.n(r),Zi=(e(135),l("fft",["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i"],function(e){var t=e.typed,o=(e.matrix,e.addScalar),s=e.multiplyScalar,u=e.divideScalar,c=e.exp,f=e.tau,l=e.i;return t("fft",{Array:r,Matrix:function(e){return e.create(r(e.toArray()))}});function r(e){var t=_(e);return 1===t.length?p(e,t[0]):function r(n,i){var e=_(n);return 0!==i?new Array(e[0]).fill(0).map(function(e,t){return r(n[t],i-1)}):1===e.length?p(n):t(r(t(n),1));function t(n){var t=_(n);return new Array(t[1]).fill(0).map(function(e,r){return new Array(t[0]).fill(0).map(function(e,t){return n[t][r]})})}}(e.map(function(e){return r(e,t.slice(1))}),0)}function p(e){var t=e.length;if(1===t)return[e[0]];if(t%2!=0)throw new Error("Can only calculate FFT of power-of-two size");for(var r=[].concat(Vi()(p(e.filter(function(e,t){return t%2==0}))),Vi()(p(e.filter(function(e,t){return t%2==1})))),n=0;n<t/2;n++){var i=r[n],a=s(r[n+t/2],c(s(s(f,l),u(-n,t))));r[n]=o(i,a),r[n+t/2]=o(i,s(-1,a))}return r}})),Wi=l("ifft",["typed","fft","dotDivide","conj"],function(e){var t=e.typed,r=e.fft,n=e.dotDivide,i=e.conj;return t("ifft",{"Array | Matrix":function(e){var t=F(e)?e.size():_(e);return n(i(r(i(e))),t.reduce(function(e,t){return e*t},1))}})}),Yi=l("erf",["typed"],function(e){return(0,e.typed)("name",{number:function(e){var t=Math.abs(e);return ea<=t?c(e):t<=Ji?c(e)*function(e){for(var t=e*e,r=Qi[0][4]*t,n=t,i=0;i<3;i+=1)r=(r+Qi[0][i])*t,n=(n+Ki[0][i])*t;return e*(r+Qi[0][3])/(n+Ki[0][3])}(t):t<=4?c(e)*(1-function(e){for(var t=Qi[1][8]*e,r=e,n=0;n<7;n+=1)t=(t+Qi[1][n])*e,r=(r+Ki[1][n])*e;var i=(t+Qi[1][7])/(r+Ki[1][7]),a=parseInt(16*e)/16,o=(e-a)*(e+a);return Math.exp(-a*a)*Math.exp(-o)*i}(t)):c(e)*(1-function(e){for(var t=1/(e*e),r=Qi[2][5]*t,n=t,i=0;i<4;i+=1)r=(r+Qi[2][i])*t,n=(n+Ki[2][i])*t;var a=t*(r+Qi[2][4])/(n+Ki[2][4]),a=(Xi-a)/e,e=(e-(t=parseInt(16*e)/16))*(e+t);return Math.exp(-t*t)*Math.exp(-e)*a}(t))},"Array | Matrix":function(e){return me(e,this)}})}),Ji=.46875,Xi=.5641895835477563,Qi=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,2.1531153547440383e-8],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],Ki=[[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]],ea=Math.pow(2,53),ta=l("mode",["typed","isNaN","isNumeric"],function(e){var t=e.typed,o=e.isNaN,s=e.isNumeric;return t("mode",{"Array | Matrix":r,"...":r});function r(e){if(0===(e=b(e.valueOf())).length)throw new Error("Cannot calculate mode of an empty array");for(var t={},r=[],n=0,i=0;i<e.length;i++){var a=e[i];if(s(a)&&o(a))throw new Error("Cannot calculate mode of an array containing NaN values");a in t||(t[a]=0),t[a]++,t[a]===n?r.push(a):t[a]>n&&(n=t[a],r=[a])}return r}});function g(e,t,r){var n;return-1!==String(e).indexOf("Unexpected type")?(n=2<arguments.length?" (type: "+te(r)+", value: "+JSON.stringify(r)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+n)):-1!==String(e).indexOf("complex numbers")?(n=2<arguments.length?" (type: "+te(r)+", value: "+JSON.stringify(r)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+n)):e}var ra=l("prod",["typed","config","multiplyScalar","numeric"],function(e){var t=e.typed,n=e.config,i=e.multiplyScalar,a=e.numeric;return t("prod",{"Array | Matrix":r,"Array | Matrix, number | BigNumber":function(e,t){throw new Error("prod(A, dim) is not yet supported")},"...":r});function r(e){var r;if(Ht(e,function(t){try{r=void 0===r?t:i(r,t)}catch(e){throw g(e,"prod",t)}}),void 0===(r="string"==typeof r?a(r,n.number):r))throw new Error("Cannot calculate prod of an empty array");return r}}),na=l("format",["typed"],function(e){return(0,e.typed)("format",{any:re,"any, Object | function | number":re})}),ia=l("bin",["typed","format"],function(e){var t=e.typed,r=e.format;return t("bin",{"number | BigNumber":function(e){return r(e,{notation:"bin"})},"number | BigNumber, number":function(e,t){return r(e,{notation:"bin",wordSize:t})}})}),aa=l("oct",["typed","format"],function(e){var t=e.typed,r=e.format;return t("oct",{"number | BigNumber":function(e){return r(e,{notation:"oct"})},"number | BigNumber, number":function(e,t){return r(e,{notation:"oct",wordSize:t})}})}),oa=l("hex",["typed","format"],function(e){var t=e.typed,r=e.format;return t("hex",{"number | BigNumber":function(e){return r(e,{notation:"hex"})},"number | BigNumber, number":function(e,t){return r(e,{notation:"hex",wordSize:t})}})}),sa=l("print",["typed"],function(e){return(0,e.typed)("print",{"string, Object | Array":ua,"string, Object | Array, number | Object":ua})});function ua(e,a,o){return e.replace(/\$([\w.]+)/g,function(e,t){for(var r=t.split("."),n=a[r.shift()];r.length&&void 0!==n;)var i=r.shift(),n=i?n[i]:n+".";return void 0!==n?M(n)?n:re(n,o):e})}var ca=l("to",["typed","matrix"],function(e){var t=e.typed,r=e.matrix,n=d({typed:t}),i=h({typed:t});return t("to",{"Unit, Unit | string":function(e,t){return e.to(t)},"Matrix, Matrix":function(e,t){return n(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"Matrix, any":function(e,t){return i(e,t,this,!1)},"any, Matrix":function(e,t){return i(t,e,this,!0)},"Array, any":function(e,t){return i(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return i(r(t),e,this,!0).valueOf()}})}),fa=l("isPrime",["typed"],function(e){return(0,e.typed)("isPrime",{number:function(e){if(0*e!=0)return!1;if(e<=3)return 1<e;if(e%2==0||e%3==0)return!1;for(var t=5;t*t<=e;t+=6)if(e%t==0||e%(t+2)==0)return!1;return!0},BigNumber:function(t){if(0*t.toNumber()!=0)return!1;if(t.lte(3))return t.gt(1);if(t.mod(2).eq(0)||t.mod(3).eq(0))return!1;if(t.lt(Math.pow(2,32))){for(var e=t.toNumber(),r=5;r*r<=e;r+=6)if(e%r==0||e%(r+2)==0)return!1;return!0}for(var n=0,i=(t=new(t.constructor.clone({precision:2*t.toFixed(0).length}))(t)).sub(1);i.mod(2).eq(0);)i=i.div(2),n+=1;var a=null;if(t.lt("3317044064679887385961981"))a=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter(function(e){return e<t});else for(var o=Math.min(t.toNumber()-2,Math.floor(2*Math.pow(t.toFixed(0).length*Math.log(10),2))),a=[],s=2;s<=o;s+=1)a.push(o);for(var u=0;u<a.length;u+=1){var c=a[u],c=function(e,t,r){for(var n=1;!t.eq(0);)t.mod(2).eq(0)?(t=t.div(2),e=e.mul(e).mod(r)):(t=t.sub(1),n=e.mul(n).mod(r));return n}(t.sub(t).add(c),i,t);if(!c.eq(1))for(var f=0,l=c;!l.eq(t.sub(1));f+=1,l=l.mul(l).mod(t))if(f===n-1)return!1}return!0},"Array | Matrix":function(e){return me(e,this)}})}),la=l("numeric",["number","?bignumber","?fraction"],function(e){var t=e.number,r=e.bignumber,n=e.fraction,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:function(e){return t(e)},BigNumber:r?function(e){return r(e)}:Ai,Fraction:n?function(e){return n(e)}:Oi};return function(e,t){var r=te(e);if(!(r in i))throw new TypeError("Cannot convert "+e+' of type "'+r+'"; valid input types are '+Object.keys(i).join(", "));if(t in a)return t===r?e:a[t](e);throw new TypeError("Cannot convert "+e+' to type "'+t+'"; valid output types are '+Object.keys(a).join(", "))}}),pa=l("divideScalar",["typed","numeric"],function(e){var t=e.typed,i=e.numeric;return t("divideScalar",{"number, number":function(e,t){return e/t},"Complex, Complex":function(e,t){return e.div(t)},"BigNumber, BigNumber":function(e,t){return e.div(t)},"Fraction, Fraction":function(e,t){return e.div(t)},"Unit, number | Fraction | BigNumber":function(e,t){var e=e.clone(),r=i(1,te(t));return e.value=this(null===e.value?e._normalize(r):e.value,t),e},"number | Fraction | BigNumber, Unit":function(e,t){var r=(r=t.clone()).pow(-1),n=i(1,te(e));return r.value=this(e,null===t.value?t._normalize(n):t.value),r},"Unit, Unit":function(e,t){return e.divide(t)}})}),ma=l("pow",["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],function(e){var t=e.typed,i=e.config,a=e.identity,o=e.multiply,r=e.matrix,s=e.inv,u=e.number,c=e.fraction,f=e.Complex;return t("pow",{"number, number":n,"Complex, Complex":function(e,t){return e.pow(t)},"BigNumber, BigNumber":function(e,t){return t.isInteger()||0<=e||i.predictable?e.pow(t):new f(e.toNumber(),0).pow(t.toNumber(),0)},"Fraction, Fraction":function(e,t){var r=e.pow(t);if(null!=r)return r;if(i.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return n(e.valueOf(),t.valueOf())},"Array, number":l,"Array, BigNumber":function(e,t){return l(e,t.toNumber())},"Matrix, number":p,"Matrix, BigNumber":function(e,t){return p(e,t.toNumber())},"Unit, number | BigNumber":function(e,t){return e.pow(t)}});function n(e,t){if(i.predictable&&!E(t)&&e<0)try{var r=c(t),n=u(r);if((t===n||Math.abs((t-n)/t)<1e-14)&&r.d%2==1)return(r.n%2==0?1:-1)*Math.pow(-e,t)}catch(e){}return i.predictable&&(e<-1&&t===1/0||-1<e&&e<0&&t===-1/0)?NaN:E(t)||0<=e||i.predictable?Fr(e,t):e*e<1&&t===1/0||1<e*e&&t===-1/0?0:new f(e,0).pow(t,0)}function l(e,t){if(!E(t))throw new TypeError("For A^b, b must be an integer (value is "+t+")");var r=_(e);if(2!==r.length)throw new Error("For A^b, A must be 2 dimensional (A has "+r.length+" dimensions)");if(r[0]!==r[1])throw new Error("For A^b, A must be square (size is "+r[0]+"x"+r[1]+")");if(t<0)try{return l(s(e),-t)}catch(e){if("Cannot calculate inverse, determinant is zero"===e.message)throw new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+t+")");throw e}for(var n=a(r[0]).valueOf(),i=e;1<=t;)1==(1&t)&&(n=o(i,n)),t>>=1,i=o(i,i);return n}function p(e,t){return r(l(e.valueOf(),t))}}),ha="Number of decimals in function round must be an integer",da=l("round",["typed","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.zeros,a=e.BigNumber,e=e.DenseMatrix,o=m({typed:t,equalScalar:n}),s=p({typed:t,DenseMatrix:e}),u=h({typed:t});return t("round",{number:Ur,"number, number":Ur,"number, BigNumber":function(e,t){if(t.isInteger())return new a(e).toDecimalPlaces(t.toNumber());throw new TypeError(ha)},Complex:function(e){return e.round()},"Complex, number":function(e,t){if(t%1)throw new TypeError(ha);return e.round(t)},"Complex, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(ha);t=t.toNumber();return e.round(t)},BigNumber:function(e){return e.toDecimalPlaces(0)},"BigNumber, BigNumber":function(e,t){if(t.isInteger())return e.toDecimalPlaces(t.toNumber());throw new TypeError(ha)},Fraction:function(e){return e.round()},"Fraction, number":function(e,t){if(t%1)throw new TypeError(ha);return e.round(t)},"Fraction, BigNumber":function(e,t){if(t.isInteger())return e.round(t.toNumber());throw new TypeError(ha)},"Array | Matrix":function(e){return me(e,this,!0)},"SparseMatrix, number | BigNumber":function(e,t){return o(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return u(e,t,this,!1)},"Array, number | BigNumber":function(e,t){return u(r(e),t,this,!1).valueOf()},"number | Complex | BigNumber | Fraction, SparseMatrix":function(e,t){return n(e,0)?i(t.size(),t.storage()):s(t,e,this,!0)},"number | Complex | BigNumber | Fraction, DenseMatrix":function(e,t){return n(e,0)?i(t.size(),t.storage()):u(t,e,this,!0)},"number | Complex | BigNumber | Fraction, Array":function(e,t){return u(r(t),e,this,!0).valueOf()}})}),ya=l("log",["config","typed","divideScalar","Complex"],function(e){var t=e.typed,r=e.config,n=e.divideScalar,i=e.Complex;return t("log",{number:function(e){return 0<=e||r.predictable?(t=e,Math.log(t)):new i(e,0).log();var t},Complex:function(e){return e.log()},BigNumber:function(e){return!e.isNegative()||r.predictable?e.ln():new i(e.toNumber(),0).log()},"Array | Matrix":function(e){return me(e,this)},"any, any":function(e,t){return n(this(e),this(t))}})}),ga=l("log1p",["typed","config","divideScalar","log","Complex"],function(e){var t=e.typed,r=e.config,n=e.divideScalar,i=e.log,a=e.Complex;return t("log1p",{number:function(e){return-1<=e||r.predictable?ye(e):o(new a(e,0))},Complex:o,BigNumber:function(e){var t=e.plus(1);return!t.isNegative()||r.predictable?t.ln():o(new a(e.toNumber(),0))},"Array | Matrix":function(e){return me(e,this)},"any, any":function(e,t){return n(this(e),i(t))}});function o(e){var t=e.re+1;return new a(Math.log(Math.sqrt(t*t+e.im*e.im)),Math.atan2(e.im,t))}}),va=l("nthRoots",["config","typed","divideScalar","Complex"],function(e){var t=e.typed,c=(e.config,e.divideScalar,e.Complex),f=[function(e){return new c(e,0)},function(e){return new c(0,e)},function(e){return new c(-e,0)},function(e){return new c(0,-e)}];function r(e,t){if(t<0)throw new Error("Root must be greater than zero");if(0===t)throw new Error("Root must be non-zero");if(t%1!=0)throw new Error("Root must be an integer");if(0===e||0===e.abs())return[new c(0,0)];var r,n="number"==typeof e;!n&&0!==e.re&&0!==e.im||(r=n?2*(e<0):0===e.im?2*(e.re<0):2*(e.im<0)+1);for(var i=e.arg(),n=e.abs(),a=[],o=Math.pow(n,1/t),s=0;s<t;s++){var u=(r+4*s)/t;u!==Math.round(u)?a.push(new c({r:o,phi:(i+2*Math.PI*s)/t})):a.push(f[u%4](o))}return a}return t("nthRoots",{Complex:function(e){return r(e,2)},"Complex, number":r})}),xa=l("dotPow",["typed","equalScalar","matrix","pow","DenseMatrix"],function(e){var t=e.typed,r=e.equalScalar,n=e.matrix,i=e.pow,e=e.DenseMatrix,a=y({typed:t}),o=Zn({typed:t,DenseMatrix:e}),s=m({typed:t,equalScalar:r}),u=p({typed:t,DenseMatrix:e}),c=d({typed:t}),f=h({typed:t});return t("dotPow",{"any, any":i,"SparseMatrix, SparseMatrix":function(e,t){return o(e,t,i,!1)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,i,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,i,!1)},"DenseMatrix, DenseMatrix":function(e,t){return c(e,t,i)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return s(e,t,this,!1)},"DenseMatrix, any":function(e,t){return f(e,t,this,!1)},"any, SparseMatrix":function(e,t){return u(t,e,this,!0)},"any, DenseMatrix":function(e,t){return f(t,e,this,!0)},"Array, any":function(e,t){return f(n(e),t,this,!1).valueOf()},"any, Array":function(e,t){return f(n(t),e,this,!0).valueOf()}})}),ba=l("dotDivide",["typed","matrix","equalScalar","divideScalar","DenseMatrix"],function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.divideScalar,e=e.DenseMatrix,a=fn({typed:t,equalScalar:n}),o=y({typed:t}),s=Zn({typed:t,DenseMatrix:e}),u=m({typed:t,equalScalar:n}),c=p({typed:t,DenseMatrix:e}),f=d({typed:t}),l=h({typed:t});return t("dotDivide",{"any, any":i,"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,i,!1)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,i,!0)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,i,!1)},"DenseMatrix, DenseMatrix":function(e,t){return f(e,t,i)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return u(e,t,i,!1)},"DenseMatrix, any":function(e,t){return l(e,t,i,!1)},"any, SparseMatrix":function(e,t){return c(t,e,i,!0)},"any, DenseMatrix":function(e,t){return l(t,e,i,!0)},"Array, any":function(e,t){return l(r(e),t,i,!1).valueOf()},"any, Array":function(e,t){return l(r(t),e,i,!0).valueOf()}})});function wa(e){var d=e.DenseMatrix;return function(e,t,r){e=e.size();if(2!==e.length)throw new RangeError("Matrix must be two dimensional (size: "+re(e)+")");var n=e[0];if(n!==e[1])throw new RangeError("Matrix must be square (size: "+re(e)+")");var i=[];if(F(t)){var e=t.size(),a=t._data;if(1===e.length){if(e[0]!==n)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var o=0;o<n;o++)i[o]=[a[o]];return new d({data:i,size:[n,1],datatype:t._datatype})}if(2===e.length){if(e[0]!==n||1!==e[1])throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");if(N(t)){if(r){for(var i=[],s=0;s<n;s++)i[s]=[a[s][0]];return new d({data:i,size:[n,1],datatype:t._datatype})}return t}if(A(t)){for(var u=0;u<n;u++)i[u]=[0];for(var c=t._values,f=t._index,e=t._ptr,l=e[1],p=e[0];p<l;p++)i[f[p]][0]=c[p];return new d({data:i,size:[n,1],datatype:t._datatype})}}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}if(x(t)){r=_(t);if(1===r.length){if(r[0]!==n)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var m=0;m<n;m++)i[m]=[t[m]];return new d({data:i,size:[n,1]})}if(2!==r.length)throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.");if(r[0]!==n||1!==r[1])throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var h=0;h<n;h++)i[h]=[t[h][0]];return new d({data:i,size:[n,1]})}}}var Na=l("lsolve",["typed","matrix","divideScalar","multiplyScalar","subtract","equalScalar","DenseMatrix"],function(e){var t=e.typed,r=e.matrix,w=e.divideScalar,N=e.multiplyScalar,M=e.subtract,E=e.equalScalar,S=e.DenseMatrix,A=wa({DenseMatrix:S});return t("lsolve",{"SparseMatrix, Array | Matrix":function(e,t){for(var r=A(e,t,!0)._data,t=e._size[0],n=e._size[1],i=e._values,a=e._index,o=e._ptr,s=[],u=0;u<n;u++){var c=r[u][0]||0;if(E(c,0))s[u]=[0];else{for(var f=0,l=[],p=[],m=o[u],h=o[u+1],d=m;d<h;d++){var y=a[d];y===u?f=i[d]:u<y&&(l.push(i[d]),p.push(y))}if(E(f,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var g=w(c,f),v=0,x=p.length;v<x;v++){var b=p[v];r[b]=[M(r[b][0]||0,N(g,l[v]))]}s[u]=[g]}}return new S({data:s,size:[t,1]})},"DenseMatrix, Array | Matrix":n,"Array, Array | Matrix":function(e,t){return n(r(e),t).valueOf()}});function n(e,t){for(var r=(t=A(e,t,!0))._data,n=e._size[0],i=e._size[1],a=[],o=e._data,s=0;s<i;s++){var u=r[s][0]||0,c=void 0;if(E(u,0))c=0;else{var f=o[s][s];if(E(f,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var c=w(u,f),l=s+1;l<n;l++)r[l]=[M(r[l][0]||0,N(c,o[l][s]))]}a[s]=[c]}return new S({data:a,size:[n,1]})}}),Ma=l("usolve",["typed","matrix","divideScalar","multiplyScalar","subtract","equalScalar","DenseMatrix"],function(e){var t=e.typed,r=e.matrix,b=e.divideScalar,w=e.multiplyScalar,N=e.subtract,M=e.equalScalar,E=e.DenseMatrix,S=wa({DenseMatrix:E});return t("usolve",{"SparseMatrix, Array | Matrix":function(e,t){for(var r=S(e,t,!0)._data,t=e._size[0],n=e._size[1],i=e._values,a=e._index,o=e._ptr,s=[],u=n-1;0<=u;u--){var c=r[u][0]||0;if(M(c,0))s[u]=[0];else{for(var f=0,l=[],p=[],m=o[u],h=o[u+1]-1;m<=h;h--){var d=a[h];d===u?f=i[h]:d<u&&(l.push(i[h]),p.push(d))}if(M(f,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var y=b(c,f),g=0,v=p.length;g<v;g++){var x=p[g];r[x]=[N(r[x][0],w(y,l[g]))]}s[u]=[y]}}return new E({data:s,size:[t,1]})},"DenseMatrix, Array | Matrix":n,"Array, Array | Matrix":function(e,t){return n(r(e),t).valueOf()}});function n(e,t){for(var r=(t=S(e,t,!0))._data,t=e._size[0],n=e._size[1],i=[],a=e._data,o=n-1;0<=o;o--){var s=r[o][0]||0,u=void 0;if(M(s,0))u=0;else{var c=a[o][o];if(M(c,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var u=b(s,c),f=o-1;0<=f;f--)r[f]=[N(r[f][0]||0,w(u,a[f][o]))]}i[o]=[u]}return new E({data:i,size:[t,1]})}}),Ea=l("lsolveAll",["typed","matrix","divideScalar","multiplyScalar","subtract","equalScalar","DenseMatrix"],function(e){var t=e.typed,r=e.matrix,A=e.divideScalar,O=e.multiplyScalar,C=e.subtract,T=e.equalScalar,_=e.DenseMatrix,I=wa({DenseMatrix:_});return t("lsolveAll",{"SparseMatrix, Array | Matrix":function(e,t){for(var r=[I(e,t,!0)._data.map(function(e){return e[0]})],n=e._size[0],i=e._size[1],a=e._values,o=e._index,s=e._ptr,u=0;u<i;u++)for(var c=r.length,f=0;f<c;f++){for(var l=r[f],p=[],m=[],h=s[u],d=s[u+1],y=0,g=h;g<d;g++){var v=o[g];v===u?y=a[g]:u<v&&(p.push(a[g]),m.push(v))}if(T(y,0))if(T(l[u],0)){if(0===f){var x=Vi()(l);x[u]=1;for(var b=0,w=m.length;b<w;b++){var N=m[b];x[N]=C(x[N],p[b])}r.push(x)}}else{if(0===f)return[];r.splice(f,1),--f,--c}else{l[u]=A(l[u],y);for(var M=0,E=m.length;M<E;M++){var S=m[M];l[S]=C(l[S],O(l[u],p[M]))}}}return r.map(function(e){return new _({data:e.map(function(e){return[e]}),size:[n,1]})})},"DenseMatrix, Array | Matrix":n,"Array, Array | Matrix":function(e,t){return n(r(e),t).map(function(e){return e.valueOf()})}});function n(e,t){for(var r=[I(e,t,!0)._data.map(function(e){return e[0]})],n=e._data,i=e._size[0],a=e._size[1],o=0;o<a;o++)for(var s=r.length,u=0;u<s;u++){var c=r[u];if(T(n[o][o],0))if(T(c[o],0)){if(0===u){for(var f=Vi()(c),l=o+(f[o]=1);l<a;l++)f[l]=C(f[l],n[l][o]);r.push(f)}}else{if(0===u)return[];r.splice(u,1),--u,--s}else{c[o]=A(c[o],n[o][o]);for(var p=o+1;p<a;p++)c[p]=C(c[p],O(c[o],n[p][o]))}}return r.map(function(e){return new _({data:e.map(function(e){return[e]}),size:[i,1]})})}}),Sa=l("usolveAll",["typed","matrix","divideScalar","multiplyScalar","subtract","equalScalar","DenseMatrix"],function(e){var t=e.typed,r=e.matrix,E=e.divideScalar,S=e.multiplyScalar,A=e.subtract,O=e.equalScalar,C=e.DenseMatrix,T=wa({DenseMatrix:C});return t("usolveAll",{"SparseMatrix, Array | Matrix":function(e,t){for(var r=[T(e,t,!0)._data.map(function(e){return e[0]})],n=e._size[0],t=e._size[1],i=e._values,a=e._index,o=e._ptr,s=t-1;0<=s;s--)for(var u=r.length,c=0;c<u;c++){for(var f=r[c],l=[],p=[],m=o[s],h=0,d=o[s+1]-1;m<=d;d--){var y=a[d];y===s?h=i[d]:y<s&&(l.push(i[d]),p.push(y))}if(O(h,0))if(O(f[s],0)){if(0===c){var g=Vi()(f);g[s]=1;for(var v=0,x=p.length;v<x;v++){var b=p[v];g[b]=A(g[b],l[v])}r.push(g)}}else{if(0===c)return[];r.splice(c,1),--c,--u}else{f[s]=E(f[s],h);for(var w=0,N=p.length;w<N;w++){var M=p[w];f[M]=A(f[M],S(f[s],l[w]))}}}return r.map(function(e){return new C({data:e.map(function(e){return[e]}),size:[n,1]})})},"DenseMatrix, Array | Matrix":n,"Array, Array | Matrix":function(e,t){return n(r(e),t).map(function(e){return e.valueOf()})}});function n(e,t){for(var r=[T(e,t,!0)._data.map(function(e){return e[0]})],n=e._data,i=e._size[0],a=e._size[1]-1;0<=a;a--)for(var o=r.length,s=0;s<o;s++){var u=r[s];if(O(n[a][a],0))if(O(u[a],0)){if(0===s){for(var c=Vi()(u),f=a-(c[a]=1);0<=f;f--)c[f]=A(c[f],n[f][a]);r.push(c)}}else{if(0===s)return[];r.splice(s,1),--s,--o}else{u[a]=E(u[a],n[a][a]);for(var l=a-1;0<=l;l--)u[l]=A(u[l],S(u[a],n[l][a]))}}return r.map(function(e){return new C({data:e.map(function(e){return[e]}),size:[i,1]})})}}),Aa=l("algorithm08",["typed","equalScalar"],function(e){var T=e.typed,_=e.equalScalar;return function(e,t,r){var n=e._values,i=e._index,a=e._ptr,o=e._size,s=e._datatype,u=t._values,c=t._index,f=t._ptr,l=t._size,t=t._datatype;if(o.length!==l.length)throw new z(o.length,l.length);if(o[0]!==l[0]||o[1]!==l[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+l+")");if(!n||!u)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var p,l=o[0],m=o[1],h=_,d=0,y=r;"string"==typeof s&&s===t&&(h=T.find(_,[p=s,p]),d=T.convert(0,p),y=T.find(r,[p,p]));for(var g,v=[],x=[],b=[],w=[],N=[],M=0;M<m;M++){b[M]=x.length;for(var E=M+1,S=a[M],A=a[M+1],O=S;O<A;O++)N[g=i[O]]=E,w[g]=n[O],x.push(g);for(S=f[M],A=f[M+1],O=S;O<A;O++)N[g=c[O]]===E&&(w[g]=y(w[g],u[O]));for(O=b[M];O<x.length;){var C=w[g=x[O]];h(C,d)?x.splice(O,1):(v.push(C),O++)}}return b[m]=x.length,e.createSparseMatrix({values:v,index:x,ptr:b,size:[l,m],datatype:p})}}),Oa=l("leftShift",["typed","matrix","equalScalar","zeros","DenseMatrix"],function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.zeros,e=e.DenseMatrix,a=on({typed:t}),o=fn({typed:t,equalScalar:n}),s=Aa({typed:t,equalScalar:n}),u=un({typed:t,DenseMatrix:e}),c=m({typed:t,equalScalar:n}),f=d({typed:t}),l=h({typed:t});return t("leftShift",{"number, number":Un,"BigNumber, BigNumber":qn,"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return f(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, number | BigNumber":function(e,t){return n(t,0)?e.clone():c(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return n(t,0)?e.clone():l(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return n(e,0)?i(t.size(),t.storage()):u(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return n(e,0)?i(t.size(),t.storage()):l(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return this(r(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return this(e,r(t)).valueOf()}})}),Ca=l("rightArithShift",["typed","matrix","equalScalar","zeros","DenseMatrix"],function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.zeros,e=e.DenseMatrix,a=on({typed:t}),o=fn({typed:t,equalScalar:n}),s=Aa({typed:t,equalScalar:n}),u=un({typed:t,DenseMatrix:e}),c=m({typed:t,equalScalar:n}),f=d({typed:t}),l=h({typed:t});return t("rightArithShift",{"number, number":Ln,"BigNumber, BigNumber":Bn,"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return f(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, number | BigNumber":function(e,t){return n(t,0)?e.clone():c(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return n(t,0)?e.clone():l(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return n(e,0)?i(t.size(),t.storage()):u(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return n(e,0)?i(t.size(),t.storage()):l(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return this(r(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return this(e,r(t)).valueOf()}})}),Ta=l("rightLogShift",["typed","matrix","equalScalar","zeros","DenseMatrix"],function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.zeros,e=e.DenseMatrix,a=on({typed:t}),o=fn({typed:t,equalScalar:n}),s=Aa({typed:t,equalScalar:n}),u=un({typed:t,DenseMatrix:e}),c=m({typed:t,equalScalar:n}),f=d({typed:t}),l=h({typed:t});return t("rightLogShift",{"number, number":$n,"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return f(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, number | BigNumber":function(e,t){return n(t,0)?e.clone():c(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return n(t,0)?e.clone():l(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return n(e,0)?i(t.size(),t.storage()):u(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return n(e,0)?i(t.size(),t.storage()):l(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return this(r(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return this(e,r(t)).valueOf()}})}),_a=l("and",["typed","matrix","equalScalar","zeros","not"],function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.zeros,a=e.not,o=fn({typed:t,equalScalar:n}),s=ln({typed:t,equalScalar:n}),u=m({typed:t,equalScalar:n}),c=d({typed:t}),f=h({typed:t});return t("and",{"number, number":ri,"Complex, Complex":function(e,t){return!(0===e.re&&0===e.im||0===t.re&&0===t.im)},"BigNumber, BigNumber":function(e,t){return!(e.isZero()||t.isZero()||e.isNaN()||t.isNaN())},"Unit, Unit":function(e,t){return this(e.value||0,t.value||0)},"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return c(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return a(t)?i(e.size(),e.storage()):u(e,t,this,!1)},"DenseMatrix, any":function(e,t){return a(t)?i(e.size(),e.storage()):f(e,t,this,!1)},"any, SparseMatrix":function(e,t){return a(e)?i(e.size(),e.storage()):u(t,e,this,!0)},"any, DenseMatrix":function(e,t){return a(e)?i(e.size(),e.storage()):f(t,e,this,!0)},"Array, any":function(e,t){return this(r(e),t).valueOf()},"any, Array":function(e,t){return this(e,r(t)).valueOf()}})}),Ia=l("compare",["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix"],function(e){var t=e.typed,r=e.config,n=e.equalScalar,i=e.matrix,a=e.BigNumber,o=e.Fraction,e=e.DenseMatrix,s=y({typed:t}),u=dn({typed:t,equalScalar:n}),c=p({typed:t,DenseMatrix:e}),f=d({typed:t}),l=h({typed:t});return t("compare",{"boolean, boolean":function(e,t){return e===t?0:t<e?1:-1},"number, number":function(e,t){return Oe(e,t,r.epsilon)?0:t<e?1:-1},"BigNumber, BigNumber":function(e,t){return or(e,t,r.epsilon)?new a(0):new a(e.cmp(t))},"Fraction, Fraction":function(e,t){return new o(e.compare(t))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(e,t){if(e.equalBase(t))return this(e.value,t.value);throw new Error("Cannot compare units with different base")},"SparseMatrix, SparseMatrix":function(e,t){return u(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return s(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return s(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return f(e,t,this)},"Array, Array":function(e,t){return this(i(e),i(t)).valueOf()},"Array, Matrix":function(e,t){return this(i(e),t)},"Matrix, Array":function(e,t){return this(e,i(t))},"SparseMatrix, any":function(e,t){return c(e,t,this,!1)},"DenseMatrix, any":function(e,t){return l(e,t,this,!1)},"any, SparseMatrix":function(e,t){return c(t,e,this,!0)},"any, DenseMatrix":function(e,t){return l(t,e,this,!0)},"Array, any":function(e,t){return l(i(e),t,this,!1).valueOf()},"any, Array":function(e,t){return l(i(t),e,this,!0).valueOf()}})}),r=e(65),ka=e.n(r),za=l("compareNatural",["typed","compare"],function(e){var t=e.typed,p=e.compare,m=p.signatures["boolean,boolean"];return t("compareNatural",{"any, any":function(e,t){var r=te(e),n=te(t);if(!("number"!==r&&"BigNumber"!==r&&"Fraction"!==r||"number"!==n&&"BigNumber"!==n&&"Fraction"!==n))return"0"!==(c=p(e,t)).toString()?0<c?1:-1:ka()(r,n);if("Array"===r||"Matrix"===r||"Array"===n||"Matrix"===n)return 0!==(c=function e(t,r,n){return A(r)&&A(n)?h(t,r.toJSON().values,n.toJSON().values):A(r)?e(t,r.toArray(),n):A(n)?e(t,r,n.toArray()):N(r)?e(t,r.toJSON().data,n):N(n)?e(t,r,n.toJSON().data):Array.isArray(r)?Array.isArray(n)?h(t,r,n):e(t,r,[n]):e(t,[r],n)}(this,e,t))?c:ka()(r,n);if(r!==n)return ka()(r,n);if("Complex"===r)return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0;if("Unit"===r)return e.equalBase(t)?this(e.value,t.value):h(this,e.formatUnits(),t.formatUnits());if("boolean"===r)return m(e,t);if("string"===r)return ka()(e,t);if("Object"===r){var i=this,a=e,o=t,s=Object.keys(a),u=Object.keys(o),c=(s.sort(ka.a),u.sort(ka.a),h(i,s,u));if(0!==c)return c;for(var f=0;f<s.length;f++){var l=i(a[s[f]],o[u[f]]);if(0!==l)return l}return 0}if("null"===r)return 0;if("undefined"===r)return 0;throw new TypeError('Unsupported type of value "'+r+'"')}});function h(e,t,r){for(var n=0,i=Math.min(t.length,r.length);n<i;n++){var a=e(t[n],r[n]);if(0!==a)return a}return t.length>r.length?1:t.length<r.length?-1:0}}),Ra=l("compareText",["typed","matrix"],function(e){var t=e.typed,r=e.matrix,n=d({typed:t}),i=h({typed:t});return t("compareText",{"any, any":je,"DenseMatrix, DenseMatrix":function(e,t){return n(e,t,je)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"DenseMatrix, any":function(e,t){return i(e,t,je,!1)},"any, DenseMatrix":function(e,t){return i(t,e,je,!0)},"Array, any":function(e,t){return i(r(e),t,je,!1).valueOf()},"any, Array":function(e,t){return i(r(t),e,je,!0).valueOf()}})}),qa=l("equal",["typed","matrix","equalScalar","DenseMatrix"],function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,e=e.DenseMatrix,i=y({typed:t}),a=Zn({typed:t,DenseMatrix:e}),o=p({typed:t,DenseMatrix:e}),s=d({typed:t}),u=h({typed:t});return t("equal",{"any, any":function(e,t){return null===e?null===t:null===t?null===e:void 0===e?void 0===t:void 0===t?void 0===e:n(e,t)},"SparseMatrix, SparseMatrix":function(e,t){return a(e,t,n)},"SparseMatrix, DenseMatrix":function(e,t){return i(t,e,n,!0)},"DenseMatrix, SparseMatrix":function(e,t){return i(e,t,n,!1)},"DenseMatrix, DenseMatrix":function(e,t){return s(e,t,n)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return o(e,t,n,!1)},"DenseMatrix, any":function(e,t){return u(e,t,n,!1)},"any, SparseMatrix":function(e,t){return o(t,e,n,!0)},"any, DenseMatrix":function(e,t){return u(t,e,n,!0)},"Array, any":function(e,t){return u(r(e),t,n,!1).valueOf()},"any, Array":function(e,t){return u(r(t),e,n,!0).valueOf()}})}),Ba=(l("equal",["typed","equalScalar"],function(e){var t=e.typed,r=e.equalScalar;return t("equal",{"any, any":function(e,t){return null===e?null===t:null===t?null===e:void 0===e?void 0===t:void 0===t?void 0===e:r(e,t)}})}),l("equalText",["typed","compareText","isZero"],function(e){var t=e.typed,r=e.compareText,n=e.isZero;return t("equalText",{"any, any":function(e,t){return n(r(e,t))}})})),Da=l("smaller",["typed","config","matrix","DenseMatrix"],function(e){var t=e.typed,r=e.config,n=e.matrix,e=e.DenseMatrix,i=y({typed:t}),a=Zn({typed:t,DenseMatrix:e}),o=p({typed:t,DenseMatrix:e}),s=d({typed:t}),u=h({typed:t});return t("smaller",{"boolean, boolean":function(e,t){return e<t},"number, number":function(e,t){return e<t&&!Oe(e,t,r.epsilon)},"BigNumber, BigNumber":function(e,t){return e.lt(t)&&!or(e,t,r.epsilon)},"Fraction, Fraction":function(e,t){return-1===e.compare(t)},"Complex, Complex":function(e,t){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(e,t){if(e.equalBase(t))return this(e.value,t.value);throw new Error("Cannot compare units with different base")},"SparseMatrix, SparseMatrix":function(e,t){return a(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return i(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return i(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return s(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return o(e,t,this,!1)},"DenseMatrix, any":function(e,t){return u(e,t,this,!1)},"any, SparseMatrix":function(e,t){return o(t,e,this,!0)},"any, DenseMatrix":function(e,t){return u(t,e,this,!0)},"Array, any":function(e,t){return u(n(e),t,this,!1).valueOf()},"any, Array":function(e,t){return u(n(t),e,this,!0).valueOf()}})}),ja=l("smallerEq",["typed","config","matrix","DenseMatrix"],function(e){var t=e.typed,r=e.config,n=e.matrix,e=e.DenseMatrix,i=y({typed:t}),a=Zn({typed:t,DenseMatrix:e}),o=p({typed:t,DenseMatrix:e}),s=d({typed:t}),u=h({typed:t});return t("smallerEq",{"boolean, boolean":function(e,t){return e<=t},"number, number":function(e,t){return e<=t||Oe(e,t,r.epsilon)},"BigNumber, BigNumber":function(e,t){return e.lte(t)||or(e,t,r.epsilon)},"Fraction, Fraction":function(e,t){return 1!==e.compare(t)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(e,t){if(e.equalBase(t))return this(e.value,t.value);throw new Error("Cannot compare units with different base")},"SparseMatrix, SparseMatrix":function(e,t){return a(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return i(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return i(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return s(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return o(e,t,this,!1)},"DenseMatrix, any":function(e,t){return u(e,t,this,!1)},"any, SparseMatrix":function(e,t){return o(t,e,this,!0)},"any, DenseMatrix":function(e,t){return u(t,e,this,!0)},"Array, any":function(e,t){return u(n(e),t,this,!1).valueOf()},"any, Array":function(e,t){return u(n(t),e,this,!0).valueOf()}})}),Pa=l("larger",["typed","config","matrix","DenseMatrix"],function(e){var t=e.typed,r=e.config,n=e.matrix,e=e.DenseMatrix,i=y({typed:t}),a=Zn({typed:t,DenseMatrix:e}),o=p({typed:t,DenseMatrix:e}),s=d({typed:t}),u=h({typed:t});return t("larger",{"boolean, boolean":function(e,t){return t<e},"number, number":function(e,t){return t<e&&!Oe(e,t,r.epsilon)},"BigNumber, BigNumber":function(e,t){return e.gt(t)&&!or(e,t,r.epsilon)},"Fraction, Fraction":function(e,t){return 1===e.compare(t)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(e,t){if(e.equalBase(t))return this(e.value,t.value);throw new Error("Cannot compare units with different base")},"SparseMatrix, SparseMatrix":function(e,t){return a(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return i(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return i(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return s(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return o(e,t,this,!1)},"DenseMatrix, any":function(e,t){return u(e,t,this,!1)},"any, SparseMatrix":function(e,t){return o(t,e,this,!0)},"any, DenseMatrix":function(e,t){return u(t,e,this,!0)},"Array, any":function(e,t){return u(n(e),t,this,!1).valueOf()},"any, Array":function(e,t){return u(n(t),e,this,!0).valueOf()}})}),Fa=l("largerEq",["typed","config","matrix","DenseMatrix"],function(e){var t=e.typed,r=e.config,n=e.matrix,e=e.DenseMatrix,i=y({typed:t}),a=Zn({typed:t,DenseMatrix:e}),o=p({typed:t,DenseMatrix:e}),s=d({typed:t}),u=h({typed:t});return t("largerEq",{"boolean, boolean":function(e,t){return t<=e},"number, number":function(e,t){return t<=e||Oe(e,t,r.epsilon)},"BigNumber, BigNumber":function(e,t){return e.gte(t)||or(e,t,r.epsilon)},"Fraction, Fraction":function(e,t){return-1!==e.compare(t)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(e,t){if(e.equalBase(t))return this(e.value,t.value);throw new Error("Cannot compare units with different base")},"SparseMatrix, SparseMatrix":function(e,t){return a(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return i(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return i(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return s(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return o(e,t,this,!1)},"DenseMatrix, any":function(e,t){return u(e,t,this,!1)},"any, SparseMatrix":function(e,t){return o(t,e,this,!0)},"any, DenseMatrix":function(e,t){return u(t,e,this,!0)},"Array, any":function(e,t){return u(n(e),t,this,!1).valueOf()},"any, Array":function(e,t){return u(n(t),e,this,!0).valueOf()}})}),Ua=l("deepEqual",["typed","equal"],function(e){var t=e.typed,a=e.equal;return t("deepEqual",{"any, any":function(e,t){return function e(t,r){if(Array.isArray(t)){if(Array.isArray(r)){var n=t.length;if(n!==r.length)return!1;for(var i=0;i<n;i++)if(!e(t[i],r[i]))return!1;return!0}return!1}return!Array.isArray(r)&&a(t,r)}(e.valueOf(),t.valueOf())}})}),La=l("unequal",["typed","config","equalScalar","matrix","DenseMatrix"],function(e){var t=e.typed,r=(e.config,e.equalScalar),n=e.matrix,e=e.DenseMatrix,i=y({typed:t}),a=Zn({typed:t,DenseMatrix:e}),o=p({typed:t,DenseMatrix:e}),s=d({typed:t}),u=h({typed:t});return t("unequal",{"any, any":function(e,t){return null===e?null!==t:null===t?null!==e:void 0===e?void 0!==t:void 0===t?void 0!==e:c(e,t)},"SparseMatrix, SparseMatrix":function(e,t){return a(e,t,c)},"SparseMatrix, DenseMatrix":function(e,t){return i(t,e,c,!0)},"DenseMatrix, SparseMatrix":function(e,t){return i(e,t,c,!1)},"DenseMatrix, DenseMatrix":function(e,t){return s(e,t,c)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return o(e,t,c,!1)},"DenseMatrix, any":function(e,t){return u(e,t,c,!1)},"any, SparseMatrix":function(e,t){return o(t,e,c,!0)},"any, DenseMatrix":function(e,t){return u(t,e,c,!0)},"Array, any":function(e,t){return u(n(e),t,c,!1).valueOf()},"any, Array":function(e,t){return u(n(t),e,c,!0).valueOf()}});function c(e,t){return!r(e,t)}}),$a=(l("unequal",["typed","equalScalar"],function(e){var t=e.typed,r=e.equalScalar;return t("unequal",{"any, any":function(e,t){return null===e?null!==t:null===t?null!==e:void 0===e?void 0!==t:void 0===t?void 0!==e:!r(e,t)}})}),l("partitionSelect",["typed","isNumeric","isNaN","compare"],function(e){function n(e,t){return-r(e,t)}var t=e.typed,f=e.isNumeric,l=e.isNaN,r=e.compare,i=r;return t("partitionSelect",{"Array | Matrix, number":function(e,t){return a(e,t,i)},"Array | Matrix, number, string":function(e,t,r){if("asc"===r)return a(e,t,i);if("desc"===r)return a(e,t,n);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":a});function a(e,t,r){if(!E(t)||t<0)throw new Error("k must be a non-negative integer");if(F(e)){if(1<e.size().length)throw new Error("Only one dimensional matrices supported");return o(e.valueOf(),t,r)}if(Array.isArray(e))return o(e,t,r)}function o(e,t,r){if(t>=e.length)throw new Error("k out of bounds");for(var n=0;n<e.length;n++)if(f(e[n])&&l(e[n]))return e[n];for(var i=0,a=e.length-1;i<a;){for(var o,s=i,u=a,c=e[Math.floor(Math.random()*(a-i+1))+i];s<u;)0<=r(e[s],c)?(o=e[u],e[u]=e[s],e[s]=o,--u):++s;0<r(e[s],c)&&--s,t<=s?a=s:i=s+1}return e[t]}})),Ha=l("sort",["typed","matrix","compare","compareNatural"],function(e){function t(e,t){return-i(e,t)}var r=e.typed,n=e.matrix,i=e.compare,a=e.compareNatural,o=i;return r("sort",{Array:function(e){return u(e),e.sort(o)},Matrix:function(e){return c(e),n(e.toArray().sort(o),e.storage())},"Array, function":function(e,t){return u(e),e.sort(t)},"Matrix, function":function(e,t){return c(e),n(e.toArray().sort(t),e.storage())},"Array, string":function(e,t){return u(e),e.sort(s(t))},"Matrix, string":function(e,t){return c(e),n(e.toArray().sort(s(t)),e.storage())}});function s(e){if("asc"===e)return o;if("desc"===e)return t;if("natural"===e)return a;throw new Error('String "asc", "desc", or "natural" expected')}function u(e){if(1!==_(e).length)throw new Error("One dimensional array expected")}function c(e){if(1!==e.size().length)throw new Error("One dimensional matrix expected")}}),Ga=l("max",["typed","config","numeric","larger"],function(e){var t=e.typed,n=e.config,i=e.numeric,a=e.larger;return t("max",{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,t){return Gt(e,t.valueOf(),r)},"...":function(e){if($t(e))throw new TypeError("Scalar values expected in function max");return o(e)}});function r(e,t){try{return a(e,t)?e:t}catch(e){throw g(e,"max",t)}}function o(e){var r;if(Ht(e,function(t){try{isNaN(t)&&"number"==typeof t?r=NaN:void 0!==r&&!a(t,r)||(r=t)}catch(e){throw g(e,"max",t)}}),void 0===r)throw new Error("Cannot calculate max of an empty array");return r="string"==typeof r?i(r,n.number):r}}),Va=l("min",["typed","config","numeric","smaller"],function(e){var t=e.typed,n=e.config,i=e.numeric,a=e.smaller;return t("min",{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,t){return Gt(e,t.valueOf(),r)},"...":function(e){if($t(e))throw new TypeError("Scalar values expected in function min");return o(e)}});function r(e,t){try{return a(e,t)?e:t}catch(e){throw g(e,"min",t)}}function o(e){var r;if(Ht(e,function(t){try{isNaN(t)&&"number"==typeof t?r=NaN:void 0!==r&&!a(t,r)||(r=t)}catch(e){throw g(e,"min",t)}}),void 0===r)throw new Error("Cannot calculate min of an empty array");return r="string"==typeof r?i(r,n.number):r}}),Za=l("ImmutableDenseMatrix",["smaller","DenseMatrix"],function(e){var r=e.smaller,n=e.DenseMatrix;function i(e,t){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!M(t))throw new Error("Invalid datatype: "+t);if(F(e)||x(e)){var r=new n(e,t);this._data=r._data,this._size=r._size,this._datatype=r._datatype,this._min=null,this._max=null}else if(e&&x(e.data)&&x(e.size))this._data=e.data,this._size=e.size,this._datatype=e.datatype,this._min=void 0!==e.min?e.min:null,this._max=void 0!==e.max?e.max:null;else{if(e)throw new TypeError("Unsupported type of data ("+te(e)+")");this._data=[],this._size=[0],this._datatype=t,this._min=null,this._max=null}}return(i.prototype=new n).type="ImmutableDenseMatrix",i.prototype.isImmutableDenseMatrix=!0,i.prototype.subset=function(e){switch(arguments.length){case 1:var t=n.prototype.subset.call(this,e);return F(t)?new i({data:t._data,size:t._size,datatype:t._datatype}):t;case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},i.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},i.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},i.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},i.prototype.clone=function(){return new i({data:ne(this._data),size:ne(this._size),datatype:this._datatype})},i.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},i.fromJSON=function(e){return new i(e)},i.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},i.prototype.min=function(){var t;return null===this._min&&(t=null,this.forEach(function(e){null!==t&&!r(e,t)||(t=e)}),this._min=null!==t?t:void 0),this._min},i.prototype.max=function(){var t;return null===this._max&&(t=null,this.forEach(function(e){null!==t&&!r(t,e)||(t=e)}),this._max=null!==t?t:void 0),this._max},i},{isClass:!0}),Wa=l("Index",["ImmutableDenseMatrix"],function(e){var n=e.ImmutableDenseMatrix;function a(e){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._isScalar=!0;for(var t=0,r=arguments.length;t<r;t++){var n=arguments[t];if(O(n))this._dimensions.push(n),this._isScalar=!1;else if(Array.isArray(n)||F(n)){var i=o(n.valueOf()),i=(this._dimensions.push(i),i.size());1===i.length&&1===i[0]||(this._isScalar=!1)}else if("number"==typeof n)this._dimensions.push(o([n]));else{if("string"!=typeof n)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");this._dimensions.push(n)}}}function o(e){for(var t=0,r=e.length;t<r;t++)if("number"!=typeof e[t]||!E(e[t]))throw new TypeError("Index parameters must be positive integer numbers");return new n(e)}return a.prototype.type="Index",a.prototype.isIndex=!0,a.prototype.clone=function(){var e=new a;return e._dimensions=ne(this._dimensions),e._isScalar=this._isScalar,e},a.create=function(e){var t=new a;return a.apply(t,e),t},a.prototype.size=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];e[t]="string"==typeof n?1:n.size()[0]}return e},a.prototype.max=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];e[t]="string"==typeof n?n:n.max()}return e},a.prototype.min=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];e[t]="string"==typeof n?n:n.min()}return e},a.prototype.forEach=function(e){for(var t=0,r=this._dimensions.length;t<r;t++)e(this._dimensions[t],t,this)},a.prototype.dimension=function(e){return this._dimensions[e]||null},a.prototype.isObjectProperty=function(){return 1===this._dimensions.length&&"string"==typeof this._dimensions[0]},a.prototype.getObjectProperty=function(){return this.isObjectProperty()?this._dimensions[0]:null},a.prototype.isScalar=function(){return this._isScalar},a.prototype.valueOf=a.prototype.toArray=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];e.push("string"==typeof n?n:n.toArray())}return e},a.prototype.toString=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];"string"==typeof n?e.push(JSON.stringify(n)):e.push(n.toString())}return"["+e.join(", ")+"]"},a.prototype.toJSON=function(){return{mathjs:"Index",dimensions:this._dimensions}},a.fromJSON=function(e){return a.create(e.dimensions)},a},{isClass:!0}),Ya=l("FibonacciHeap",["smaller","larger"],function(e){var l=e.smaller,p=e.larger,m=1/Math.log((1+Math.sqrt(5))/2);function t(){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}function i(e,t,r){t.left.right=t.right,t.right.left=t.left,r.degree--,r.child===t&&(r.child=t.right),0===r.degree&&(r.child=null),t.left=e,t.right=e.right,((e.right=t).right.left=t).parent=null,t.mark=!1}t.prototype.type="FibonacciHeap",t.prototype.isFibonacciHeap=!0,t.prototype.insert=function(e,t){var r,t={key:e,value:t,degree:0};return this._minimum?(r=this._minimum,t.left=r,t.right=r.right,(r.right=t).right.left=t,l(e,r.key)&&(this._minimum=t)):((t.left=t).right=t,this._minimum=t),this._size++,t},t.prototype.size=function(){return this._size},t.prototype.clear=function(){this._minimum=null,this._size=0},t.prototype.isEmpty=function(){return 0===this._size},t.prototype.extractMinimum=function(){var e=this._minimum;if(null===e)return e;for(var t=this._minimum,r=e.degree,n=e.child;0<r;){var i=n.right;n.left.right=n.right,n.right.left=n.left,n.left=t,n.right=t.right,((t.right=n).right.left=n).parent=null,n=i,r--}return e.left.right=e.right,e.right.left=e.left,t=e===e.right?null:function(e,t){var r=Math.floor(Math.log(t)*m)+1,n=new Array(r),i=0;if(s=e)for(i++,s=s.right;s!==e;)i++,s=s.right;for(;0<i;){for(var a,o,s,u=s.degree,c=s.right;o=n[u];)p(s.key,o.key)&&(a=o,o=s,s=a),h(o,s),n[u]=null,u++;n[u]=s,s=c,i--}e=null;for(var f=0;f<r;f++)(o=n[f])&&(e?(o.left.right=o.right,o.right.left=o.left,o.left=e,o.right=e.right,(e.right=o).right.left=o,l(o.key,e.key)&&(e=o)):e=o);return e}(t=e.right,this._size),this._size--,this._minimum=t,e},t.prototype.remove=function(e){var t,r;this._minimum=(t=this._minimum,(e=e).key=-1,(r=e.parent)&&l(e.key,r.key)&&(i(t,e,r),function e(t,r){var n=r.parent;n&&(r.mark?(i(t,r,n),e(n)):r.mark=!0)}(t,r)),t=l(e.key,t.key)?e:t),this.extractMinimum()};var h=function(e,t){e.left.right=e.right,e.right.left=e.left,(e.parent=t).child?(e.left=t.child,e.right=t.child.right,(t.child.right=e).right.left=e):((t.child=e).right=e).left=e,t.degree++,e.mark=!1};return t},{isClass:!0}),Ja=l("Spa",["addScalar","equalScalar","FibonacciHeap"],function(e){var n=e.addScalar,c=e.equalScalar,t=e.FibonacciHeap;function r(){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new t}return r.prototype.type="Spa",r.prototype.isSpa=!0,r.prototype.set=function(e,t){this._values[e]?this._values[e].value=t:(t=this._heap.insert(e,t),this._values[e]=t)},r.prototype.get=function(e){e=this._values[e];return e?e.value:0},r.prototype.accumulate=function(e,t){var r=this._values[e];r?r.value=n(r.value,t):(r=this._heap.insert(e,t),this._values[e]=r)},r.prototype.forEach=function(e,t,r){var n=this._heap,i=this._values,a=[],o=n.extractMinimum();for(o&&a.push(o);o&&o.key<=t;)o.key>=e&&(c(o.value,0)||r(o.key,o.value,this)),(o=n.extractMinimum())&&a.push(o);for(var s=0;s<a.length;s++){var u=a[s];i[(o=n.insert(u.key,u.value)).key]=o}},r.prototype.swap=function(e,t){var r=this._values[e],n=this._values[t];!r&&n?(r=this._heap.insert(e,n.value),this._heap.remove(n),this._values[e]=r,this._values[t]=void 0):r&&!n?(n=this._heap.insert(t,r.value),this._heap.remove(r),this._values[t]=n,this._values[e]=void 0):r&&n&&(t=r.value,r.value=n.value,n.value=t)},r},{isClass:!0}),r=(e(189),e(190),e(32)),Xa=e.n(r),r=e(76),Qa=e.n(r),Ka=pi(function(e){return new e(1).exp()},{hasher:no}),eo=pi(function(e){return new e(1).plus(new e(5).sqrt()).div(2)},{hasher:no}),to=pi(function(e){return e.acos(-1)},{hasher:no}),ro=pi(function(e){return to(e).times(2)},{hasher:no});function no(e){return e[0].precision}function io(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function ao(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?io(Object(r),!0).forEach(function(e){Qa()(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):io(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var oo=l("Unit",["?on","config","addScalar","subtract","multiplyScalar","divideScalar","pow","abs","fix","round","equal","isNumeric","format","number","Complex","BigNumber","Fraction"],function(e){var h,d,E,t=e.on,y=e.config,u=e.addScalar,c=e.subtract,f=e.multiplyScalar,l=e.divideScalar,p=e.pow,m=e.abs,B=e.fix,D=e.round,g=e.equal,j=e.isNumeric,P=e.format,F=e.number,U=e.Complex,v=e.BigNumber,x=e.Fraction,L=F;function S(e,t){if(!(this instanceof S))throw new Error("Constructor must be called with the new operator");if(null!=e&&!j(e)&&!ie(e))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(void 0!==t&&("string"!=typeof t||""===t))throw new TypeError("Second parameter in Unit constructor must be a string");if(void 0!==t){t=S.parse(t);this.units=t.units,this.dimensions=t.dimensions}else{this.units=[{unit:H,prefix:C.NONE,power:0}],this.dimensions=[];for(var r=0;r<T.length;r++)this.dimensions[r]=0}this.value=null!=e?this._normalize(e):null,this.fixPrefix=!1,this.skipAutomaticSimplification=!0}function b(){for(;" "===E||"\t"===E;)w()}function A(e){return"0"<=e&&e<="9"}function w(){d++,E=h.charAt(d)}function n(e){d=e,E=h.charAt(d)}function $(){var e="",t=d;if("+"===E?w():"-"===E&&(e+=E,w()),!("0"<=E&&E<="9"||"."===E))return n(t),null;if("."===E){if(e+=E,w(),!A(E))return n(t),null}else{for(;A(E);)e+=E,w();"."===E&&(e+=E,w())}for(;A(E);)e+=E,w();if("E"===E||"e"===E){var t="",r=d;if(t+=E,w(),"+"!==E&&"-"!==E||(t+=E,w()),!A(E))return n(r),e;for(e+=t;A(E);)e+=E,w()}return e}function N(e){return E===e&&(w(),e)}S.prototype.type="Unit",S.prototype.isUnit=!0,S.parse=function(e,t){if(t=t||{},d=-1,E="","string"!=typeof(h=e))throw new TypeError("Invalid argument in Unit.parse, string expected");var r=new S,n=1,i=!(r.units=[]),a=(w(),b(),$()),o=null;if(a){if("BigNumber"===y.number)o=new v(a);else if("Fraction"===y.number)try{o=new x(a)}catch(e){o=parseFloat(a)}else o=parseFloat(a);b(),N("*")?(n=1,i=!0):N("/")&&(n=-1,i=!0)}for(var s=[],u=1;;){for(b();"("===E;)s.push(n),u*=n,n=1,w(),b();if(!E)break;var c=E;if(null===(m=function(){for(var e="";A(E)||S.isValidAlpha(E);)e+=E,w();var t=e.charAt(0);return S.isValidAlpha(t)?e:null}()))throw new SyntaxError('Unexpected "'+c+'" in "'+h+'" at index '+d.toString());var f=O(m);if(null===f)throw new SyntaxError('Unit "'+m+'" not found.');var l=n*u;if(b(),N("^")){b();c=$();if(null===c)throw new SyntaxError('In "'+e+'", "^" must be followed by a floating-point number');l*=c}r.units.push({unit:f.unit,prefix:f.prefix,power:l});for(var p=0;p<T.length;p++)r.dimensions[p]+=(f.unit.dimensions[p]||0)*l;for(b();")"===E;){if(0===s.length)throw new SyntaxError('Unmatched ")" in "'+h+'" at index '+d.toString());u/=s.pop(),w(),b()}var m,i=!1;N("*")?(n=1,i=!0):N("/")?(n=-1,i=!0):n=1,f.unit.base&&(m=f.unit.base.key,M.auto[m]={unit:f.unit,prefix:f.prefix})}if(b(),E)throw new SyntaxError('Could not parse: "'+e+'"');if(i)throw new SyntaxError('Trailing characters: "'+e+'"');if(0!==s.length)throw new SyntaxError('Unmatched "(" in "'+h+'"');if(0!==r.units.length||t.allowNoUnits)return r.value=void 0!==o?r._normalize(o):null,r;throw new SyntaxError('"'+e+'" contains no units')},S.prototype.clone=function(){var e=new S;e.fixPrefix=this.fixPrefix,e.skipAutomaticSimplification=this.skipAutomaticSimplification,e.value=ne(this.value),e.dimensions=this.dimensions.slice(0),e.units=[];for(var t=0;t<this.units.length;t++)for(var r in e.units[t]={},this.units[t])pe(this.units[t],r)&&(e.units[t][r]=this.units[t][r]);return e},S.prototype._isDerived=function(){return 0!==this.units.length&&(1<this.units.length||1e-15<Math.abs(this.units[0].power-1))},S.prototype._normalize=function(e){if(null==e||0===this.units.length)return e;for(var t=e,r=S._getNumberConverter(te(e)),n=0;n<this.units.length;n++)var i=r(this.units[n].unit.value),a=r(this.units[n].prefix.value),o=r(this.units[n].power),t=f(t,p(f(i,a),o));return t},S.prototype._denormalize=function(e,t){if(null==e||0===this.units.length)return e;for(var r=e,n=S._getNumberConverter(te(e)),i=0;i<this.units.length;i++)var a=n(this.units[i].unit.value),o=n(this.units[i].prefix.value),s=n(this.units[i].power),r=l(r,p(f(a,o),s));return r};var O=pi(function(e){var t,r;if(pe(I,e))return{unit:t=I[e],prefix:t.prefixes[""]};for(r in I)if(pe(I,r)&&(n=e,o=r,i=void 0,a=void 0,i=n.length-o.length,a=n.length,n.substring(i,a)===o)){var n=I[r],i=e.length-r.length,a=e.substring(0,i),o=pe(n.prefixes,a)?n.prefixes[a]:void 0;if(void 0!==o)return{unit:n,prefix:o}}return null},{hasher:function(e){return e[0]},limit:100});function s(e){return e.equalBase(_.NONE)&&null!==e.value&&!y.predictable?e.value:e}S.isValuelessUnit=function(e){return null!==O(e)},S.prototype.hasBase=function(e){if(!(e="string"==typeof e?_[e]:e))return!1;for(var t=0;t<T.length;t++)if(1e-12<Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0)))return!1;return!0},S.prototype.equalBase=function(e){for(var t=0;t<T.length;t++)if(1e-12<Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0)))return!1;return!0},S.prototype.equals=function(e){return this.equalBase(e)&&g(this.value,e.value)},S.prototype.multiply=function(e){for(var t=this.clone(),r=0;r<T.length;r++)t.dimensions[r]=(this.dimensions[r]||0)+(e.dimensions[r]||0);for(var n,i,a=0;a<e.units.length;a++){var o=ao({},e.units[a]);t.units.push(o)}return null!==this.value||null!==e.value?(n=null===this.value?this._normalize(1):this.value,i=null===e.value?e._normalize(1):e.value,t.value=f(n,i)):t.value=null,t.skipAutomaticSimplification=!1,s(t)},S.prototype.divide=function(e){for(var t=this.clone(),r=0;r<T.length;r++)t.dimensions[r]=(this.dimensions[r]||0)-(e.dimensions[r]||0);for(var n,i,a=0;a<e.units.length;a++){var o=ao(ao({},e.units[a]),{},{power:-e.units[a].power});t.units.push(o)}return null!==this.value||null!==e.value?(n=null===this.value?this._normalize(1):this.value,i=null===e.value?e._normalize(1):e.value,t.value=l(n,i)):t.value=null,t.skipAutomaticSimplification=!1,s(t)},S.prototype.pow=function(e){for(var t=this.clone(),r=0;r<T.length;r++)t.dimensions[r]=(this.dimensions[r]||0)*e;for(var n=0;n<t.units.length;n++)t.units[n].power*=e;return null!==t.value?t.value=p(t.value,e):t.value=null,t.skipAutomaticSimplification=!1,s(t)},S.prototype.abs=function(){var e,t,r,n=this.clone();for(r in null!==n.value&&(n._isDerived()||0===n.units[0].unit.offset?n.value=m(n.value):(t=(e=S._getNumberConverter(te(n.value)))(n.units[0].unit.value),e=e(n.units[0].unit.offset),t=f(t,e),n.value=c(m(u(n.value,t)),t))),n.units)"VA"!==n.units[r].unit.name&&"VAR"!==n.units[r].unit.name||(n.units[r].unit=I.W);return n},S.prototype.to=function(e){var t,r,n,i=null===this.value?this._normalize(1):this.value;if("string"==typeof e)t=S.parse(e);else{if(!W(e))throw new Error("String or Unit expected as parameter");t=e.clone()}if(!this.equalBase(t))throw new Error("Units do not match ('".concat(t.toString(),"' != '").concat(this.toString(),"')"));if(null!==t.value)throw new Error("Cannot convert to a unit with a value");return null===this.value||this._isDerived()||this.units[0].unit.offset===t.units[0].unit.offset?t.value=ne(i):(r=(e=S._getNumberConverter(te(i)))(this.units[0].unit.value),n=e(this.units[0].unit.offset),r=f(r,n),n=e(t.units[0].unit.value),e=e(t.units[0].unit.offset),n=f(n,e),t.value=c(u(i,r),n)),t.fixPrefix=!0,t.skipAutomaticSimplification=!0,t},S.prototype.toNumber=function(e){return L(this.toNumeric(e))},S.prototype.toNumeric=function(e){return(e=e?this.to(e):this.clone())._isDerived()||0===e.units.length?e._denormalize(e.value):e._denormalize(e.value,e.units[0].prefix.value)},S.prototype.toString=function(){return this.format()},S.prototype.toJSON=function(){return{mathjs:"Unit",value:this._denormalize(this.value),unit:this.formatUnits(),fixPrefix:this.fixPrefix}},S.fromJSON=function(e){var t=new S(e.value,e.unit);return t.fixPrefix=e.fixPrefix||!1,t},S.prototype.valueOf=S.prototype.toString,S.prototype.simplify=function(){var e,t,r,n=this.clone(),i=[];for(r in k)if(pe(k,r)&&n.hasBase(_[r])){e=r;break}if("NONE"===e)n.units=[];else if(t=e&&pe(k,e)?k[e]:t)n.units=[{unit:t.unit,prefix:t.prefix,power:1}];else{for(var a=!1,o=0;o<T.length;o++){var s=T[o];1e-12<Math.abs(n.dimensions[o]||0)&&(pe(k,s)?i.push({unit:k[s].unit,prefix:k[s].prefix,power:n.dimensions[o]||0}):a=!0)}i.length<n.units.length&&!a&&(n.units=i)}return n},S.prototype.toSI=function(){for(var e=this.clone(),t=[],r=0;r<T.length;r++){var n=T[r];if(1e-12<Math.abs(e.dimensions[r]||0)){if(!pe(M.si,n))throw new Error("Cannot express custom unit "+n+" in SI units");t.push({unit:M.si[n].unit,prefix:M.si[n].prefix,power:e.dimensions[r]||0})}}return e.units=t,e.fixPrefix=!0,e.skipAutomaticSimplification=!0,e},S.prototype.formatUnits=function(){for(var e="",t="",r=0,n=0,i=0;i<this.units.length;i++)0<this.units[i].power?(r++,e+=" "+this.units[i].prefix.name+this.units[i].unit.name,1e-15<Math.abs(this.units[i].power-1)&&(e+="^"+this.units[i].power)):this.units[i].power<0&&n++;if(0<n)for(var a=0;a<this.units.length;a++)this.units[a].power<0&&(0<r?(t+=" "+this.units[a].prefix.name+this.units[a].unit.name,1e-15<Math.abs(this.units[a].power+1)&&(t+="^"+-this.units[a].power)):t=(t+=" "+this.units[a].prefix.name+this.units[a].unit.name)+("^"+this.units[a].power));var e=e.substr(1),t=t.substr(1),o=e=1<r&&0<n?"("+e+")":e;return 0<r&&0<n&&(o+=" / "),o+(t=1<n&&0<r?"("+t+")":t)},S.prototype.format=function(e){var t,r=this.skipAutomaticSimplification||null===this.value?this.clone():this.simplify(),n=!1;for(t in void 0!==r.value&&null!==r.value&&ie(r.value)&&(n=Math.abs(r.value.re)<1e-14),r.units)pe(r.units,t)&&r.units[t].unit&&("VA"===r.units[t].unit.name&&n?r.units[t].unit=I.VAR:"VAR"!==r.units[t].unit.name||n||(r.units[t].unit=I.VA));1!==r.units.length||r.fixPrefix||Math.abs(r.units[0].power-Math.round(r.units[0].power))<1e-14&&(r.units[0].prefix=r._bestPrefix());var i=r._denormalize(r.value),i=null!==r.value?P(i,e||{}):"",e=r.formatUnits();return r.value&&ie(r.value)&&(i="("+i+")"),0<e.length&&0<i.length&&(i+=" "),i+e},S.prototype._bestPrefix=function(){if(1!==this.units.length)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(1e-14<=Math.abs(this.units[0].power-Math.round(this.units[0].power)))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 e=null!==this.value?m(this.value):0,t=m(this.units[0].unit.value),r=this.units[0].prefix;if(0===e)return r;var n=this.units[0].power;if(-2.200001<(s=Math.log(e/Math.pow(r.value*t,n))/Math.LN10-1.2)&&s<1.800001)return r;var i,a,o,s=Math.abs(s),u=this.units[0].unit.prefixes;for(i in u)pe(u,i)&&(a=u[i]).scientific&&((o=Math.abs(Math.log(e/Math.pow(a.value*t,n))/Math.LN10-1.2))<s||o===s&&a.name.length<r.name.length)&&(r=a,s=o);return r};var r,C={NONE:{"":{name:"",value:1,scientific:!0}},SHORT:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:10,scientific:!(S.prototype.splitUnit=function(e){for(var t=this.clone(),r=[],n=0;n<e.length&&(t=t.to(e[n]),n!==e.length-1);n++){var i=t.toNumeric(),a=D(i),i=new S(g(a,i)?a:B(t.toNumeric()),e[n].toString());r.push(i),t=c(t,i)}for(var o=0,s=0;s<r.length;s++)o=u(o,r[s].value);return g(o,this.value)&&(t.value=0),r.push(t),r})},h:{name:"h",value:100,scientific:!1},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0},d:{name:"d",value:.1,scientific:!1},c:{name:"c",value:.01,scientific:!1},m:{name:"m",value:.001,scientific:!0},u:{name:"u",value:1e-6,scientific:!0},n:{name:"n",value:1e-9,scientific:!0},p:{name:"p",value:1e-12,scientific:!0},f:{name:"f",value:1e-15,scientific:!0},a:{name:"a",value:1e-18,scientific:!0},z:{name:"z",value:1e-21,scientific:!0},y:{name:"y",value:1e-24,scientific:!0}},LONG:{"":{name:"",value:1,scientific:!0},deca:{name:"deca",value:10,scientific:!1},hecto:{name:"hecto",value:100,scientific:!1},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0},deci:{name:"deci",value:.1,scientific:!1},centi:{name:"centi",value:.01,scientific:!1},milli:{name:"milli",value:.001,scientific:!0},micro:{name:"micro",value:1e-6,scientific:!0},nano:{name:"nano",value:1e-9,scientific:!0},pico:{name:"pico",value:1e-12,scientific:!0},femto:{name:"femto",value:1e-15,scientific:!0},atto:{name:"atto",value:1e-18,scientific:!0},zepto:{name:"zepto",value:1e-21,scientific:!0},yocto:{name:"yocto",value:1e-24,scientific:!0}},SQUARED:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:100,scientific:!1},h:{name:"h",value:1e4,scientific:!1},k:{name:"k",value:1e6,scientific:!0},M:{name:"M",value:1e12,scientific:!0},G:{name:"G",value:1e18,scientific:!0},T:{name:"T",value:1e24,scientific:!0},P:{name:"P",value:1e30,scientific:!0},E:{name:"E",value:1e36,scientific:!0},Z:{name:"Z",value:1e42,scientific:!0},Y:{name:"Y",value:1e48,scientific:!0},d:{name:"d",value:.01,scientific:!1},c:{name:"c",value:1e-4,scientific:!1},m:{name:"m",value:1e-6,scientific:!0},u:{name:"u",value:1e-12,scientific:!0},n:{name:"n",value:1e-18,scientific:!0},p:{name:"p",value:1e-24,scientific:!0},f:{name:"f",value:1e-30,scientific:!0},a:{name:"a",value:1e-36,scientific:!0},z:{name:"z",value:1e-42,scientific:!0},y:{name:"y",value:1e-48,scientific:!0}},CUBIC:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:1e3,scientific:!1},h:{name:"h",value:1e6,scientific:!1},k:{name:"k",value:1e9,scientific:!0},M:{name:"M",value:1e18,scientific:!0},G:{name:"G",value:1e27,scientific:!0},T:{name:"T",value:1e36,scientific:!0},P:{name:"P",value:1e45,scientific:!0},E:{name:"E",value:1e54,scientific:!0},Z:{name:"Z",value:1e63,scientific:!0},Y:{name:"Y",value:1e72,scientific:!0},d:{name:"d",value:.001,scientific:!1},c:{name:"c",value:1e-6,scientific:!1},m:{name:"m",value:1e-9,scientific:!0},u:{name:"u",value:1e-18,scientific:!0},n:{name:"n",value:1e-27,scientific:!0},p:{name:"p",value:1e-36,scientific:!0},f:{name:"f",value:1e-45,scientific:!0},a:{name:"a",value:1e-54,scientific:!0},z:{name:"z",value:1e-63,scientific:!0},y:{name:"y",value:1e-72,scientific:!0}},BINARY_SHORT_SI:{"":{name:"",value:1,scientific:!0},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0}},BINARY_SHORT_IEC:{"":{name:"",value:1,scientific:!0},Ki:{name:"Ki",value:1024,scientific:!0},Mi:{name:"Mi",value:Math.pow(1024,2),scientific:!0},Gi:{name:"Gi",value:Math.pow(1024,3),scientific:!0},Ti:{name:"Ti",value:Math.pow(1024,4),scientific:!0},Pi:{name:"Pi",value:Math.pow(1024,5),scientific:!0},Ei:{name:"Ei",value:Math.pow(1024,6),scientific:!0},Zi:{name:"Zi",value:Math.pow(1024,7),scientific:!0},Yi:{name:"Yi",value:Math.pow(1024,8),scientific:!0}},BINARY_LONG_SI:{"":{name:"",value:1,scientific:!0},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0}},BINARY_LONG_IEC:{"":{name:"",value:1,scientific:!0},kibi:{name:"kibi",value:1024,scientific:!0},mebi:{name:"mebi",value:Math.pow(1024,2),scientific:!0},gibi:{name:"gibi",value:Math.pow(1024,3),scientific:!0},tebi:{name:"tebi",value:Math.pow(1024,4),scientific:!0},pebi:{name:"pebi",value:Math.pow(1024,5),scientific:!0},exi:{name:"exi",value:Math.pow(1024,6),scientific:!0},zebi:{name:"zebi",value:Math.pow(1024,7),scientific:!0},yobi:{name:"yobi",value:Math.pow(1024,8),scientific:!0}},BTU:{"":{name:"",value:1,scientific:!0},MM:{name:"MM",value:1e6,scientific:!0}}},T=(C.SHORTLONG=Xa()({},C.SHORT,C.LONG),C.BINARY_SHORT=Xa()({},C.BINARY_SHORT_SI,C.BINARY_SHORT_IEC),C.BINARY_LONG=Xa()({},C.BINARY_LONG_SI,C.BINARY_LONG_IEC),["MASS","LENGTH","TIME","CURRENT","TEMPERATURE","LUMINOUS_INTENSITY","AMOUNT_OF_SUBSTANCE","ANGLE","BIT"]),_={NONE:{dimensions:[0,0,0,0,0,0,0,0,0]},MASS:{dimensions:[1,0,0,0,0,0,0,0,0]},LENGTH:{dimensions:[0,1,0,0,0,0,0,0,0]},TIME:{dimensions:[0,0,1,0,0,0,0,0,0]},CURRENT:{dimensions:[0,0,0,1,0,0,0,0,0]},TEMPERATURE:{dimensions:[0,0,0,0,1,0,0,0,0]},LUMINOUS_INTENSITY:{dimensions:[0,0,0,0,0,1,0,0,0]},AMOUNT_OF_SUBSTANCE:{dimensions:[0,0,0,0,0,0,1,0,0]},FORCE:{dimensions:[1,1,-2,0,0,0,0,0,0]},SURFACE:{dimensions:[0,2,0,0,0,0,0,0,0]},VOLUME:{dimensions:[0,3,0,0,0,0,0,0,0]},ENERGY:{dimensions:[1,2,-2,0,0,0,0,0,0]},POWER:{dimensions:[1,2,-3,0,0,0,0,0,0]},PRESSURE:{dimensions:[1,-1,-2,0,0,0,0,0,0]},ELECTRIC_CHARGE:{dimensions:[0,0,1,1,0,0,0,0,0]},ELECTRIC_CAPACITANCE:{dimensions:[-1,-2,4,2,0,0,0,0,0]},ELECTRIC_POTENTIAL:{dimensions:[1,2,-3,-1,0,0,0,0,0]},ELECTRIC_RESISTANCE:{dimensions:[1,2,-3,-2,0,0,0,0,0]},ELECTRIC_INDUCTANCE:{dimensions:[1,2,-2,-2,0,0,0,0,0]},ELECTRIC_CONDUCTANCE:{dimensions:[-1,-2,3,2,0,0,0,0,0]},MAGNETIC_FLUX:{dimensions:[1,2,-2,-1,0,0,0,0,0]},MAGNETIC_FLUX_DENSITY:{dimensions:[1,0,-2,-1,0,0,0,0,0]},FREQUENCY:{dimensions:[0,0,-1,0,0,0,0,0,0]},ANGLE:{dimensions:[0,0,0,0,0,0,0,1,0]},BIT:{dimensions:[0,0,0,0,0,0,0,0,1]}};for(r in _)pe(_,r)&&(_[r].key=r);var H={name:"",base:{},value:1,offset:0,dimensions:T.map(function(e){return 0})},I={meter:{name:"meter",base:_.LENGTH,prefixes:C.LONG,value:1,offset:0},inch:{name:"inch",base:_.LENGTH,prefixes:C.NONE,value:.0254,offset:0},foot:{name:"foot",base:_.LENGTH,prefixes:C.NONE,value:.3048,offset:0},yard:{name:"yard",base:_.LENGTH,prefixes:C.NONE,value:.9144,offset:0},mile:{name:"mile",base:_.LENGTH,prefixes:C.NONE,value:1609.344,offset:0},link:{name:"link",base:_.LENGTH,prefixes:C.NONE,value:.201168,offset:0},rod:{name:"rod",base:_.LENGTH,prefixes:C.NONE,value:5.0292,offset:0},chain:{name:"chain",base:_.LENGTH,prefixes:C.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:_.LENGTH,prefixes:C.NONE,value:1e-10,offset:0},m:{name:"m",base:_.LENGTH,prefixes:C.SHORT,value:1,offset:0},in:{name:"in",base:_.LENGTH,prefixes:C.NONE,value:.0254,offset:0},ft:{name:"ft",base:_.LENGTH,prefixes:C.NONE,value:.3048,offset:0},yd:{name:"yd",base:_.LENGTH,prefixes:C.NONE,value:.9144,offset:0},mi:{name:"mi",base:_.LENGTH,prefixes:C.NONE,value:1609.344,offset:0},li:{name:"li",base:_.LENGTH,prefixes:C.NONE,value:.201168,offset:0},rd:{name:"rd",base:_.LENGTH,prefixes:C.NONE,value:5.02921,offset:0},ch:{name:"ch",base:_.LENGTH,prefixes:C.NONE,value:20.1168,offset:0},mil:{name:"mil",base:_.LENGTH,prefixes:C.NONE,value:254e-7,offset:0},m2:{name:"m2",base:_.SURFACE,prefixes:C.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:_.SURFACE,prefixes:C.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:_.SURFACE,prefixes:C.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:_.SURFACE,prefixes:C.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:_.SURFACE,prefixes:C.NONE,value:2589988.110336,offset:0},sqrd:{name:"sqrd",base:_.SURFACE,prefixes:C.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:_.SURFACE,prefixes:C.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:_.SURFACE,prefixes:C.NONE,value:6.4516e-10,offset:0},acre:{name:"acre",base:_.SURFACE,prefixes:C.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:_.SURFACE,prefixes:C.NONE,value:1e4,offset:0},m3:{name:"m3",base:_.VOLUME,prefixes:C.CUBIC,value:1,offset:0},L:{name:"L",base:_.VOLUME,prefixes:C.SHORT,value:.001,offset:0},l:{name:"l",base:_.VOLUME,prefixes:C.SHORT,value:.001,offset:0},litre:{name:"litre",base:_.VOLUME,prefixes:C.LONG,value:.001,offset:0},cuin:{name:"cuin",base:_.VOLUME,prefixes:C.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:_.VOLUME,prefixes:C.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:_.VOLUME,prefixes:C.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:_.VOLUME,prefixes:C.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:_.VOLUME,prefixes:C.NONE,value:15e-6,offset:0},drop:{name:"drop",base:_.VOLUME,prefixes:C.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:_.VOLUME,prefixes:C.NONE,value:5e-8,offset:0},minim:{name:"minim",base:_.VOLUME,prefixes:C.NONE,value:6.161152e-8,offset:0},fluiddram:{name:"fluiddram",base:_.VOLUME,prefixes:C.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:_.VOLUME,prefixes:C.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:_.VOLUME,prefixes:C.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:_.VOLUME,prefixes:C.NONE,value:1e-6,offset:0},cup:{name:"cup",base:_.VOLUME,prefixes:C.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:_.VOLUME,prefixes:C.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:_.VOLUME,prefixes:C.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:_.VOLUME,prefixes:C.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:_.VOLUME,prefixes:C.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:_.VOLUME,prefixes:C.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:_.VOLUME,prefixes:C.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:_.VOLUME,prefixes:C.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:_.VOLUME,prefixes:C.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:_.VOLUME,prefixes:C.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:_.VOLUME,prefixes:C.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:_.VOLUME,prefixes:C.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:_.VOLUME,prefixes:C.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:_.VOLUME,prefixes:C.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:_.VOLUME,prefixes:C.NONE,value:.1173478,offset:0},obl:{name:"obl",base:_.VOLUME,prefixes:C.NONE,value:.1589873,offset:0},g:{name:"g",base:_.MASS,prefixes:C.SHORT,value:.001,offset:0},gram:{name:"gram",base:_.MASS,prefixes:C.LONG,value:.001,offset:0},ton:{name:"ton",base:_.MASS,prefixes:C.SHORT,value:907.18474,offset:0},t:{name:"t",base:_.MASS,prefixes:C.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:_.MASS,prefixes:C.LONG,value:1e3,offset:0},grain:{name:"grain",base:_.MASS,prefixes:C.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:_.MASS,prefixes:C.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:_.MASS,prefixes:C.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:_.MASS,prefixes:C.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:_.MASS,prefixes:C.NONE,value:45.359237,offset:0},stick:{name:"stick",base:_.MASS,prefixes:C.NONE,value:.115,offset:0},stone:{name:"stone",base:_.MASS,prefixes:C.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:_.MASS,prefixes:C.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:_.MASS,prefixes:C.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:_.MASS,prefixes:C.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:_.MASS,prefixes:C.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:_.MASS,prefixes:C.NONE,value:45.359237,offset:0},s:{name:"s",base:_.TIME,prefixes:C.SHORT,value:1,offset:0},min:{name:"min",base:_.TIME,prefixes:C.NONE,value:60,offset:0},h:{name:"h",base:_.TIME,prefixes:C.NONE,value:3600,offset:0},second:{name:"second",base:_.TIME,prefixes:C.LONG,value:1,offset:0},sec:{name:"sec",base:_.TIME,prefixes:C.LONG,value:1,offset:0},minute:{name:"minute",base:_.TIME,prefixes:C.NONE,value:60,offset:0},hour:{name:"hour",base:_.TIME,prefixes:C.NONE,value:3600,offset:0},day:{name:"day",base:_.TIME,prefixes:C.NONE,value:86400,offset:0},week:{name:"week",base:_.TIME,prefixes:C.NONE,value:604800,offset:0},month:{name:"month",base:_.TIME,prefixes:C.NONE,value:2629800,offset:0},year:{name:"year",base:_.TIME,prefixes:C.NONE,value:31557600,offset:0},decade:{name:"decade",base:_.TIME,prefixes:C.NONE,value:315576e3,offset:0},century:{name:"century",base:_.TIME,prefixes:C.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:_.TIME,prefixes:C.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:_.FREQUENCY,prefixes:C.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:_.FREQUENCY,prefixes:C.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:_.ANGLE,prefixes:C.SHORT,value:1,offset:0},radian:{name:"radian",base:_.ANGLE,prefixes:C.LONG,value:1,offset:0},deg:{name:"deg",base:_.ANGLE,prefixes:C.SHORT,value:null,offset:0},degree:{name:"degree",base:_.ANGLE,prefixes:C.LONG,value:null,offset:0},grad:{name:"grad",base:_.ANGLE,prefixes:C.SHORT,value:null,offset:0},gradian:{name:"gradian",base:_.ANGLE,prefixes:C.LONG,value:null,offset:0},cycle:{name:"cycle",base:_.ANGLE,prefixes:C.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:_.ANGLE,prefixes:C.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:_.ANGLE,prefixes:C.NONE,value:null,offset:0},A:{name:"A",base:_.CURRENT,prefixes:C.SHORT,value:1,offset:0},ampere:{name:"ampere",base:_.CURRENT,prefixes:C.LONG,value:1,offset:0},K:{name:"K",base:_.TEMPERATURE,prefixes:C.NONE,value:1,offset:0},degC:{name:"degC",base:_.TEMPERATURE,prefixes:C.NONE,value:1,offset:273.15},degF:{name:"degF",base:_.TEMPERATURE,prefixes:C.NONE,value:1/1.8,offset:459.67},degR:{name:"degR",base:_.TEMPERATURE,prefixes:C.NONE,value:1/1.8,offset:0},kelvin:{name:"kelvin",base:_.TEMPERATURE,prefixes:C.NONE,value:1,offset:0},celsius:{name:"celsius",base:_.TEMPERATURE,prefixes:C.NONE,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:_.TEMPERATURE,prefixes:C.NONE,value:1/1.8,offset:459.67},rankine:{name:"rankine",base:_.TEMPERATURE,prefixes:C.NONE,value:1/1.8,offset:0},mol:{name:"mol",base:_.AMOUNT_OF_SUBSTANCE,prefixes:C.SHORT,value:1,offset:0},mole:{name:"mole",base:_.AMOUNT_OF_SUBSTANCE,prefixes:C.LONG,value:1,offset:0},cd:{name:"cd",base:_.LUMINOUS_INTENSITY,prefixes:C.SHORT,value:1,offset:0},candela:{name:"candela",base:_.LUMINOUS_INTENSITY,prefixes:C.LONG,value:1,offset:0},N:{name:"N",base:_.FORCE,prefixes:C.SHORT,value:1,offset:0},newton:{name:"newton",base:_.FORCE,prefixes:C.LONG,value:1,offset:0},dyn:{name:"dyn",base:_.FORCE,prefixes:C.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:_.FORCE,prefixes:C.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:_.FORCE,prefixes:C.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:_.FORCE,prefixes:C.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:_.FORCE,prefixes:C.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:_.FORCE,prefixes:C.NONE,value:9.80665,offset:0},J:{name:"J",base:_.ENERGY,prefixes:C.SHORT,value:1,offset:0},joule:{name:"joule",base:_.ENERGY,prefixes:C.SHORT,value:1,offset:0},erg:{name:"erg",base:_.ENERGY,prefixes:C.NONE,value:1e-7,offset:0},Wh:{name:"Wh",base:_.ENERGY,prefixes:C.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:_.ENERGY,prefixes:C.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:_.ENERGY,prefixes:C.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:_.ENERGY,prefixes:C.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:_.POWER,prefixes:C.SHORT,value:1,offset:0},watt:{name:"watt",base:_.POWER,prefixes:C.LONG,value:1,offset:0},hp:{name:"hp",base:_.POWER,prefixes:C.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:_.POWER,prefixes:C.SHORT,value:U.I,offset:0},VA:{name:"VA",base:_.POWER,prefixes:C.SHORT,value:1,offset:0},Pa:{name:"Pa",base:_.PRESSURE,prefixes:C.SHORT,value:1,offset:0},psi:{name:"psi",base:_.PRESSURE,prefixes:C.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:_.PRESSURE,prefixes:C.NONE,value:101325,offset:0},bar:{name:"bar",base:_.PRESSURE,prefixes:C.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:_.PRESSURE,prefixes:C.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:_.PRESSURE,prefixes:C.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:_.PRESSURE,prefixes:C.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:_.PRESSURE,prefixes:C.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:_.ELECTRIC_CHARGE,prefixes:C.LONG,value:1,offset:0},C:{name:"C",base:_.ELECTRIC_CHARGE,prefixes:C.SHORT,value:1,offset:0},farad:{name:"farad",base:_.ELECTRIC_CAPACITANCE,prefixes:C.LONG,value:1,offset:0},F:{name:"F",base:_.ELECTRIC_CAPACITANCE,prefixes:C.SHORT,value:1,offset:0},volt:{name:"volt",base:_.ELECTRIC_POTENTIAL,prefixes:C.LONG,value:1,offset:0},V:{name:"V",base:_.ELECTRIC_POTENTIAL,prefixes:C.SHORT,value:1,offset:0},ohm:{name:"ohm",base:_.ELECTRIC_RESISTANCE,prefixes:C.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:_.ELECTRIC_INDUCTANCE,prefixes:C.LONG,value:1,offset:0},H:{name:"H",base:_.ELECTRIC_INDUCTANCE,prefixes:C.SHORT,value:1,offset:0},siemens:{name:"siemens",base:_.ELECTRIC_CONDUCTANCE,prefixes:C.LONG,value:1,offset:0},S:{name:"S",base:_.ELECTRIC_CONDUCTANCE,prefixes:C.SHORT,value:1,offset:0},weber:{name:"weber",base:_.MAGNETIC_FLUX,prefixes:C.LONG,value:1,offset:0},Wb:{name:"Wb",base:_.MAGNETIC_FLUX,prefixes:C.SHORT,value:1,offset:0},tesla:{name:"tesla",base:_.MAGNETIC_FLUX_DENSITY,prefixes:C.LONG,value:1,offset:0},T:{name:"T",base:_.MAGNETIC_FLUX_DENSITY,prefixes:C.SHORT,value:1,offset:0},b:{name:"b",base:_.BIT,prefixes:C.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:_.BIT,prefixes:C.BINARY_LONG,value:1,offset:0},B:{name:"B",base:_.BIT,prefixes:C.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:_.BIT,prefixes:C.BINARY_LONG,value:8,offset:0}},i={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",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function G(e){"BigNumber"===e.number?(e=to(v),I.rad.value=new v(1),I.deg.value=e.div(180),I.grad.value=e.div(200),I.cycle.value=e.times(2),I.arcsec.value=e.div(648e3),I.arcmin.value=e.div(10800)):(I.rad.value=1,I.deg.value=Math.PI/180,I.grad.value=Math.PI/200,I.cycle.value=2*Math.PI,I.arcsec.value=Math.PI/648e3,I.arcmin.value=Math.PI/10800),I.radian.value=I.rad.value,I.degree.value=I.deg.value,I.gradian.value=I.grad.value}G(y),t&&t("config",function(e,t){e.number!==t.number&&G(e)});var a,V,o,M={si:{NONE:{unit:H,prefix:C.NONE[""]},LENGTH:{unit:I.m,prefix:C.SHORT[""]},MASS:{unit:I.g,prefix:C.SHORT.k},TIME:{unit:I.s,prefix:C.SHORT[""]},CURRENT:{unit:I.A,prefix:C.SHORT[""]},TEMPERATURE:{unit:I.K,prefix:C.SHORT[""]},LUMINOUS_INTENSITY:{unit:I.cd,prefix:C.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:I.mol,prefix:C.SHORT[""]},ANGLE:{unit:I.rad,prefix:C.SHORT[""]},BIT:{unit:I.bits,prefix:C.SHORT[""]},FORCE:{unit:I.N,prefix:C.SHORT[""]},ENERGY:{unit:I.J,prefix:C.SHORT[""]},POWER:{unit:I.W,prefix:C.SHORT[""]},PRESSURE:{unit:I.Pa,prefix:C.SHORT[""]},ELECTRIC_CHARGE:{unit:I.C,prefix:C.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:I.F,prefix:C.SHORT[""]},ELECTRIC_POTENTIAL:{unit:I.V,prefix:C.SHORT[""]},ELECTRIC_RESISTANCE:{unit:I.ohm,prefix:C.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:I.H,prefix:C.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:I.S,prefix:C.SHORT[""]},MAGNETIC_FLUX:{unit:I.Wb,prefix:C.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:I.T,prefix:C.SHORT[""]},FREQUENCY:{unit:I.Hz,prefix:C.SHORT[""]}}},k=(M.cgs=JSON.parse(JSON.stringify(M.si)),M.cgs.LENGTH={unit:I.m,prefix:C.SHORT.c},M.cgs.MASS={unit:I.g,prefix:C.SHORT[""]},M.cgs.FORCE={unit:I.dyn,prefix:C.SHORT[""]},M.cgs.ENERGY={unit:I.erg,prefix:C.NONE[""]},M.us=JSON.parse(JSON.stringify(M.si)),M.us.LENGTH={unit:I.ft,prefix:C.NONE[""]},M.us.MASS={unit:I.lbm,prefix:C.NONE[""]},M.us.TEMPERATURE={unit:I.degF,prefix:C.NONE[""]},M.us.FORCE={unit:I.lbf,prefix:C.NONE[""]},M.us.ENERGY={unit:I.BTU,prefix:C.BTU[""]},M.us.POWER={unit:I.hp,prefix:C.NONE[""]},M.us.PRESSURE={unit:I.psi,prefix:C.NONE[""]},M.auto=JSON.parse(JSON.stringify(M.si)),M.auto);for(a in S.setUnitSystem=function(e){if(!pe(M,e))throw new Error("Unit system "+e+" does not exist. Choices are: "+Object.keys(M).join(", "));k=M[e]},S.getUnitSystem=function(){for(var e in M)if(pe(M,e)&&M[e]===k)return e},S.typeConverters={BigNumber:function(e){return new v(e+"")},Fraction:function(e){return new x(e)},Complex:function(e){return e},number:function(e){return e}},S._getNumberConverter=function(e){if(S.typeConverters[e])return S.typeConverters[e];throw new TypeError('Unsupported type "'+e+'"')},I)pe(I,a)&&((V=I[a]).dimensions=V.base.dimensions);for(o in i)if(pe(i,o)){var z,R=I[i[o]],q={};for(z in R)pe(R,z)&&(q[z]=R[z]);q.name=o,I[o]=q}return S.isValidAlpha=function(e){return/^[a-zA-Z]$/.test(e)},S.createUnit=function(e,t){if("object"!==Z()(e))throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(t&&t.override)for(var r in e)if(pe(e,r)&&S.deleteUnit(r),e[r].aliases)for(var n=0;n<e[r].aliases.length;n++)S.deleteUnit(e[r].aliases[n]);var i,a;for(a in e)pe(e,a)&&(i=S.createUnitSingle(a,e[a]));return i},S.createUnitSingle=function(e,t,r){if(null==t&&(t={}),"string"!=typeof e)throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(pe(I,e))throw new Error('Cannot create unit "'+e+'": a unit with that name already exists');for(var n=e,i=0;i<n.length;i++){if(E=n.charAt(i),0===i&&!S.isValidAlpha(E))throw new Error('Invalid unit name (must begin with alpha character): "'+n+'"');if(0<i&&!S.isValidAlpha(E)&&!A(E))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+n+'"')}var a=null,o=[],s=0;if(t&&"Unit"===t.type)a=t.clone();else if("string"==typeof t)""!==t&&(m=t);else{if("object"!==Z()(t))throw new TypeError('Cannot create unit "'+e+'" from "'+t.toString()+'": expecting "string" or "Unit" or "Object"');m=t.definition,c=t.prefixes,s=t.offset,p=t.baseName,t.aliases&&(o=t.aliases.valueOf())}if(o)for(var u=0;u<o.length;u++)if(pe(I,o[u]))throw new Error('Cannot create alias "'+o[u]+'": a unit with that name already exists');if(m&&"string"==typeof m&&!a)try{a=S.parse(m,{allowNoUnits:!0})}catch(t){throw t.message='Could not create unit "'+e+'" from "'+m+'": '+t.message,t}else m&&"Unit"===m.type&&(a=m.clone());var o=o||[],s=s||0,c=c&&c.toUpperCase&&C[c.toUpperCase()]||C.NONE,f={};if(a){var l,p,m,f={name:e,value:a.value,dimensions:a.dimensions.slice(0),prefixes:c,offset:s},h=!1;for(l in _)if(pe(_,l)){for(var d=!0,y=0;y<T.length;y++)if(1e-12<Math.abs((f.dimensions[y]||0)-(_[l].dimensions[y]||0))){d=!1;break}if(d){h=!0,f.base=_[l];break}}h||(p=p||e+"_STUFF",(m={dimensions:a.dimensions.slice(0)}).key=p,_[p]=m,k[p]={unit:f,prefix:C.NONE[""]},f.base=_[p])}else{if(0<=T.indexOf(p=p||e+"_STUFF"))throw new Error('Cannot create new base unit "'+e+'": a base unit with that name already exists (and cannot be overridden)');for(var g in T.push(p),_)pe(_,g)&&(_[g].dimensions[T.length-1]=0);for(var v={dimensions:[]},x=0;x<T.length;x++)v.dimensions[x]=0;v.dimensions[T.length-1]=1,v.key=p,_[p]=v,f={name:e,value:1,dimensions:_[p].dimensions.slice(0),prefixes:c,offset:s,base:_[p]},k[p]={unit:f,prefix:C.NONE[""]}}S.UNITS[e]=f;for(var b=0;b<o.length;b++){var w,N=o[b],M={};for(w in f)pe(f,w)&&(M[w]=f[w]);M.name=N,S.UNITS[N]=M}return delete O.cache,new S(null,e)},S.deleteUnit=function(e){delete S.UNITS[e]},S.PREFIXES=C,S.BASE_DIMENSIONS=T,S.BASE_UNITS=_,S.UNIT_SYSTEMS=M,S.UNITS=I,S},{isClass:!0}),so=l("unit",["typed","Unit"],function(e){var t=e.typed,r=e.Unit;return t("unit",{Unit:function(e){return e.clone()},string:function(e){return r.isValuelessUnit(e)?new r(null,e):r.parse(e,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string":function(e,t){return new r(e,t)},"Array | Matrix":function(e){return me(e,this)}})}),uo=l("sparse",["typed","SparseMatrix"],function(e){var t=e.typed,r=e.SparseMatrix;return t("sparse",{"":function(){return new r([])},string:function(e){return new r([],e)},"Array | Matrix":function(e){return new r(e)},"Array | Matrix, string":function(e,t){return new r(e,t)}})}),co=l("createUnit",["typed","Unit"],function(e){var t=e.typed,i=e.Unit;return t("createUnit",{"Object, Object":function(e,t){return i.createUnit(e,t)},Object:function(e){return i.createUnit(e,{})},"string, Unit | string | Object, Object":function(e,t,r){var n={};return n[e]=t,i.createUnit(n,r)},"string, Unit | string | Object":function(e,t){var r={};return r[e]=t,i.createUnit(r,{})},string:function(e){var t={};return t[e]={},i.createUnit(t,{})}})}),fo=l("acos",["typed","config","Complex"],function(e){var t=e.typed,r=e.config,n=e.Complex;return t("acos",{number:function(e){return-1<=e&&e<=1||r.predictable?Math.acos(e):new n(e,0).acos()},Complex:function(e){return e.acos()},BigNumber:function(e){return e.acos()},"Array | Matrix":function(e){return me(e,this)}})});function lo(e){return Ce(e)}function po(e){return Math.atan(1/e)}function mo(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}function ho(e){return Math.asin(1/e)}function yo(e){e=1/e;return Math.log(e+Math.sqrt(e*e+1))}function go(e){return Math.acos(1/e)}function vo(e){var e=1/e,t=Math.sqrt(e*e-1);return Math.log(t+e)}function xo(e){return Te(e)}function bo(e){return _e(e)}function wo(e){return 1/Math.tan(e)}function No(e){e=Math.exp(2*e);return(e+1)/(e-1)}function Mo(e){return 1/Math.sin(e)}function Eo(e){return 0===e?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*c(e)}function So(e){return 1/Math.cos(e)}function Ao(e){return 2/(Math.exp(e)+Math.exp(-e))}function Oo(e){return ke(e)}Oo.signature=Ao.signature=So.signature=Eo.signature=Mo.signature=No.signature=wo.signature=bo.signature=xo.signature=vo.signature=go.signature=yo.signature=ho.signature=mo.signature=po.signature=lo.signature="number";var Co=l("acosh",["typed","config","Complex"],function(e){var t=e.typed,r=e.config,n=e.Complex;return t("acosh",{number:function(e){return 1<=e||r.predictable?lo(e):e<=-1?new n(Math.log(Math.sqrt(e*e-1)-e),Math.PI):new n(e,0).acosh()},Complex:function(e){return e.acosh()},BigNumber:function(e){return e.acosh()},"Array | Matrix":function(e){return me(e,this)}})}),To=l("acot",["typed","BigNumber"],function(e){var t=e.typed,r=e.BigNumber;return t("acot",{number:po,Complex:function(e){return e.acot()},BigNumber:function(e){return new r(1).div(e).atan()},"Array | Matrix":function(e){return me(e,this)}})}),_o=l("acoth",["typed","config","Complex","BigNumber"],function(e){var t=e.typed,r=e.config,n=e.Complex,i=e.BigNumber;return t("acoth",{number:function(e){return 1<=e||e<=-1||r.predictable?mo(e):new n(e,0).acoth()},Complex:function(e){return e.acoth()},BigNumber:function(e){return new i(1).div(e).atanh()},"Array | Matrix":function(e){return me(e,this)}})}),Io=l("acsc",["typed","config","Complex","BigNumber"],function(e){var t=e.typed,r=e.config,n=e.Complex,i=e.BigNumber;return t("acsc",{number:function(e){return e<=-1||1<=e||r.predictable?ho(e):new n(e,0).acsc()},Complex:function(e){return e.acsc()},BigNumber:function(e){return new i(1).div(e).asin()},"Array | Matrix":function(e){return me(e,this)}})}),ko=l("acsch",["typed","BigNumber"],function(e){var t=e.typed,r=e.BigNumber;return t("acsch",{number:yo,Complex:function(e){return e.acsch()},BigNumber:function(e){return new r(1).div(e).asinh()},"Array | Matrix":function(e){return me(e,this)}})}),zo=l("asec",["typed","config","Complex","BigNumber"],function(e){var t=e.typed,r=e.config,n=e.Complex,i=e.BigNumber;return t("asec",{number:function(e){return e<=-1||1<=e||r.predictable?go(e):new n(e,0).asec()},Complex:function(e){return e.asec()},BigNumber:function(e){return new i(1).div(e).acos()},"Array | Matrix":function(e){return me(e,this)}})}),Ro=l("asech",["typed","config","Complex","BigNumber"],function(e){var t=e.typed,n=e.config,i=e.Complex,r=e.BigNumber;return t("asech",{number:function(e){if(e<=1&&-1<=e||n.predictable){var t=1/e;if(0<t||n.predictable)return vo(e);var r=Math.sqrt(t*t-1);return new i(Math.log(r-t),Math.PI)}return new i(e,0).asech()},Complex:function(e){return e.asech()},BigNumber:function(e){return new r(1).div(e).acosh()},"Array | Matrix":function(e){return me(e,this)}})}),qo=l("asin",["typed","config","Complex"],function(e){var t=e.typed,r=e.config,n=e.Complex;return t("asin",{number:function(e){return-1<=e&&e<=1||r.predictable?Math.asin(e):new n(e,0).asin()},Complex:function(e){return e.asin()},BigNumber:function(e){return e.asin()},"Array | Matrix":function(e){return me(e,this,!0)}})}),Bo=l("asinh",["typed"],function(e){return(0,e.typed)("asinh",{number:xo,Complex:function(e){return e.asinh()},BigNumber:function(e){return e.asinh()},"Array | Matrix":function(e){return me(e,this,!0)}})}),Do=l("atan",["typed"],function(e){return(0,e.typed)("atan",{number:function(e){return Math.atan(e)},Complex:function(e){return e.atan()},BigNumber:function(e){return e.atan()},"Array | Matrix":function(e){return me(e,this,!0)}})}),jo=l("atan2",["typed","matrix","equalScalar","BigNumber","DenseMatrix"],function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.BigNumber,e=e.DenseMatrix,a=fn({typed:t,equalScalar:n}),o=y({typed:t}),s=On({typed:t,equalScalar:n}),u=m({typed:t,equalScalar:n}),c=p({typed:t,DenseMatrix:e}),f=d({typed:t}),l=h({typed:t});return t("atan2",{"number, number":Math.atan2,"BigNumber, BigNumber":function(e,t){return i.atan2(e,t)},"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return f(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, number | BigNumber":function(e,t){return u(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return l(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return c(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return l(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return l(r(e),t,this,!1).valueOf()},"number | BigNumber, Array":function(e,t){return l(r(t),e,this,!0).valueOf()}})}),Po=l("atanh",["typed","config","Complex"],function(e){var t=e.typed,r=e.config,n=e.Complex;return t("atanh",{number:function(e){return e<=1&&-1<=e||r.predictable?bo(e):new n(e,0).atanh()},Complex:function(e){return e.atanh()},BigNumber:function(e){return e.atanh()},"Array | Matrix":function(e){return me(e,this,!0)}})}),Fo=l("cos",["typed"],function(e){return(0,e.typed)("cos",{number:Math.cos,Complex:function(e){return e.cos()},BigNumber:function(e){return e.cos()},Unit:function(e){if(e.hasBase(e.constructor.BASE_UNITS.ANGLE))return this(e.value);throw new TypeError("Unit in function cos is no angle")},"Array | Matrix":function(e){return me(e,this)}})}),Uo=l("cosh",["typed"],function(e){return(0,e.typed)("cosh",{number:Ie,Complex:function(e){return e.cosh()},BigNumber:function(e){return e.cosh()},Unit:function(e){if(e.hasBase(e.constructor.BASE_UNITS.ANGLE))return this(e.value);throw new TypeError("Unit in function cosh is no angle")},"Array | Matrix":function(e){return me(e,this)}})}),Lo=l("cot",["typed","BigNumber"],function(e){var t=e.typed,r=e.BigNumber;return t("cot",{number:wo,Complex:function(e){return e.cot()},BigNumber:function(e){return new r(1).div(e.tan())},Unit:function(e){if(e.hasBase(e.constructor.BASE_UNITS.ANGLE))return this(e.value);throw new TypeError("Unit in function cot is no angle")},"Array | Matrix":function(e){return me(e,this)}})}),$o=l("coth",["typed","BigNumber"],function(e){var t=e.typed,r=e.BigNumber;return t("coth",{number:No,Complex:function(e){return e.coth()},BigNumber:function(e){return new r(1).div(e.tanh())},Unit:function(e){if(e.hasBase(e.constructor.BASE_UNITS.ANGLE))return this(e.value);throw new TypeError("Unit in function coth is no angle")},"Array | Matrix":function(e){return me(e,this)}})}),Ho=l("csc",["typed","BigNumber"],function(e){var t=e.typed,r=e.BigNumber;return t("csc",{number:Mo,Complex:function(e){return e.csc()},BigNumber:function(e){return new r(1).div(e.sin())},Unit:function(e){if(e.hasBase(e.constructor.BASE_UNITS.ANGLE))return this(e.value);throw new TypeError("Unit in function csc is no angle")},"Array | Matrix":function(e){return me(e,this)}})}),Go=l("csch",["typed","BigNumber"],function(e){var t=e.typed,r=e.BigNumber;return t("csch",{number:Eo,Complex:function(e){return e.csch()},BigNumber:function(e){return new r(1).div(e.sinh())},Unit:function(e){if(e.hasBase(e.constructor.BASE_UNITS.ANGLE))return this(e.value);throw new TypeError("Unit in function csch is no angle")},"Array | Matrix":function(e){return me(e,this)}})}),Vo=l("sec",["typed","BigNumber"],function(e){var t=e.typed,r=e.BigNumber;return t("sec",{number:So,Complex:function(e){return e.sec()},BigNumber:function(e){return new r(1).div(e.cos())},Unit:function(e){if(e.hasBase(e.constructor.BASE_UNITS.ANGLE))return this(e.value);throw new TypeError("Unit in function sec is no angle")},"Array | Matrix":function(e){return me(e,this)}})}),Zo=l("sech",["typed","BigNumber"],function(e){var t=e.typed,r=e.BigNumber;return t("sech",{number:Ao,Complex:function(e){return e.sech()},BigNumber:function(e){return new r(1).div(e.cosh())},Unit:function(e){if(e.hasBase(e.constructor.BASE_UNITS.ANGLE))return this(e.value);throw new TypeError("Unit in function sech is no angle")},"Array | Matrix":function(e){return me(e,this)}})}),Wo=l("sin",["typed"],function(e){return(0,e.typed)("sin",{number:Math.sin,Complex:function(e){return e.sin()},BigNumber:function(e){return e.sin()},Unit:function(e){if(e.hasBase(e.constructor.BASE_UNITS.ANGLE))return this(e.value);throw new TypeError("Unit in function sin is no angle")},"Array | Matrix":function(e){return me(e,this,!0)}})}),Yo=l("sinh",["typed"],function(e){return(0,e.typed)("sinh",{number:Oo,Complex:function(e){return e.sinh()},BigNumber:function(e){return e.sinh()},Unit:function(e){if(e.hasBase(e.constructor.BASE_UNITS.ANGLE))return this(e.value);throw new TypeError("Unit in function sinh is no angle")},"Array | Matrix":function(e){return me(e,this,!0)}})}),Jo=l("tan",["typed"],function(e){return(0,e.typed)("tan",{number:Math.tan,Complex:function(e){return e.tan()},BigNumber:function(e){return e.tan()},Unit:function(e){if(e.hasBase(e.constructor.BASE_UNITS.ANGLE))return this(e.value);throw new TypeError("Unit in function tan is no angle")},"Array | Matrix":function(e){return me(e,this,!0)}})}),Xo=l("tanh",["typed"],function(e){return(0,e.typed)("tanh",{number:ze,Complex:function(e){return e.tanh()},BigNumber:function(e){return e.tanh()},Unit:function(e){if(e.hasBase(e.constructor.BASE_UNITS.ANGLE))return this(e.value);throw new TypeError("Unit in function tanh is no angle")},"Array | Matrix":function(e){return me(e,this,!0)}})}),Qo=l("setCartesian",["typed","size","subset","compareNatural","Index","DenseMatrix"],function(e){var t=e.typed,s=e.size,u=e.subset,c=e.compareNatural,f=e.Index,l=e.DenseMatrix;return t("setCartesian",{"Array | Matrix, Array | Matrix":function(e,t){var r=[];if(0!==u(s(e),new f(0))&&0!==u(s(t),new f(0)))for(var n=b(Array.isArray(e)?e:e.toArray()).sort(c),i=b(Array.isArray(t)?t:t.toArray()).sort(c),r=[],a=0;a<n.length;a++)for(var o=0;o<i.length;o++)r.push([n[a],i[o]]);return Array.isArray(e)&&Array.isArray(t)?r:new l(r)}})}),Ko=l("setDifference",["typed","size","subset","compareNatural","Index","DenseMatrix"],function(e){var t=e.typed,u=e.size,c=e.subset,f=e.compareNatural,l=e.Index,p=e.DenseMatrix;return t("setDifference",{"Array | Matrix, Array | Matrix":function(e,t){if(0===c(u(e),new l(0)))i=[];else{if(0===c(u(t),new l(0)))return b(e.toArray());for(var r=Qe(b(Array.isArray(e)?e:e.toArray()).sort(f)),n=Qe(b(Array.isArray(t)?t:t.toArray()).sort(f)),i=[],a=0;a<r.length;a++){for(var o=!1,s=0;s<n.length;s++)if(0===f(r[a].value,n[s].value)&&r[a].identifier===n[s].identifier){o=!0;break}o||i.push(r[a])}}return Array.isArray(e)&&Array.isArray(t)?Ke(i):new p(Ke(i))}})}),es=l("setDistinct",["typed","size","subset","compareNatural","Index","DenseMatrix"],function(e){var t=e.typed,i=e.size,a=e.subset,o=e.compareNatural,s=e.Index,u=e.DenseMatrix;return t("setDistinct",{"Array | Matrix":function(e){var t;if(0===a(i(e),new s(0)))t=[];else{var r=b(Array.isArray(e)?e:e.toArray()).sort(o);(t=[]).push(r[0]);for(var n=1;n<r.length;n++)0!==o(r[n],r[n-1])&&t.push(r[n])}return Array.isArray(e)?t:new u(t)}})}),ts=l("setIntersect",["typed","size","subset","compareNatural","Index","DenseMatrix"],function(e){var t=e.typed,s=e.size,u=e.subset,c=e.compareNatural,f=e.Index,l=e.DenseMatrix;return t("setIntersect",{"Array | Matrix, Array | Matrix":function(e,t){if(0===u(s(e),new f(0))||0===u(s(t),new f(0)))i=[];else for(var r=Qe(b(Array.isArray(e)?e:e.toArray()).sort(c)),n=Qe(b(Array.isArray(t)?t:t.toArray()).sort(c)),i=[],a=0;a<r.length;a++)for(var o=0;o<n.length;o++)if(0===c(r[a].value,n[o].value)&&r[a].identifier===n[o].identifier){i.push(r[a]);break}return Array.isArray(e)&&Array.isArray(t)?Ke(i):new l(Ke(i))}})}),rs=l("setIsSubset",["typed","size","subset","compareNatural","Index"],function(e){var t=e.typed,s=e.size,u=e.subset,c=e.compareNatural,f=e.Index;return t("setIsSubset",{"Array | Matrix, Array | Matrix":function(e,t){if(0===u(s(e),new f(0)))return!0;if(0===u(s(t),new f(0)))return!1;for(var r=Qe(b(Array.isArray(e)?e:e.toArray()).sort(c)),n=Qe(b(Array.isArray(t)?t:t.toArray()).sort(c)),i=0;i<r.length;i++){for(var a=!1,o=0;o<n.length;o++)if(0===c(r[i].value,n[o].value)&&r[i].identifier===n[o].identifier){a=!0;break}if(!1===a)return!1}return!0}})}),ns=l("setMultiplicity",["typed","size","subset","compareNatural","Index"],function(e){var t=e.typed,a=e.size,o=e.subset,s=e.compareNatural,u=e.Index;return t("setMultiplicity",{"number | BigNumber | Fraction | Complex, Array | Matrix":function(e,t){if(0===o(a(t),new u(0)))return 0;for(var r=b(Array.isArray(t)?t:t.toArray()),n=0,i=0;i<r.length;i++)0===s(r[i],e)&&n++;return n}})}),is=l("setPowerset",["typed","size","subset","compareNatural","Index"],function(e){var t=e.typed,u=e.size,c=e.subset,f=e.compareNatural,l=e.Index;return t("setPowerset",{"Array | Matrix":function(e){if(0===c(u(e),new l(0)))return[];for(var t=b(Array.isArray(e)?e:e.toArray()).sort(f),r=[],n=0;n.toString(2).length<=t.length;)r.push(function(e,t){for(var r=[],n=0;n<t.length;n++)"1"===t[n]&&r.push(e[n]);return r}(t,n.toString(2).split("").reverse())),n++;for(var i,a=r,o=a.length-1;0<o;o--)for(var s=0;s<o;s++)a[s].length>a[s+1].length&&(i=a[s],a[s]=a[s+1],a[s+1]=i);return a}})}),as=l("setSize",["typed","compareNatural"],function(e){var t=e.typed,a=e.compareNatural;return t("setSize",{"Array | Matrix":function(e){return(Array.isArray(e)?b(e):b(e.toArray())).length},"Array | Matrix, boolean":function(e,t){if(!1===t||0===e.length)return(Array.isArray(e)?b(e):b(e.toArray())).length;for(var r=b(Array.isArray(e)?e:e.toArray()).sort(a),n=1,i=1;i<r.length;i++)0!==a(r[i],r[i-1])&&n++;return n}})}),os=l("setSymDifference",["typed","size","concat","subset","setDifference","Index"],function(e){var t=e.typed,r=e.size,n=e.concat,i=e.subset,a=e.setDifference,o=e.Index;return t("setSymDifference",{"Array | Matrix, Array | Matrix":function(e,t){if(0===i(r(e),new o(0)))return b(t);if(0===i(r(t),new o(0)))return b(e);e=b(e),t=b(t);return n(a(e,t),a(t,e))}})}),ss=l("setUnion",["typed","size","concat","subset","setIntersect","setSymDifference","Index"],function(e){var t=e.typed,r=e.size,n=e.concat,i=e.subset,a=e.setIntersect,o=e.setSymDifference,s=e.Index;return t("setUnion",{"Array | Matrix, Array | Matrix":function(e,t){if(0===i(r(e),new s(0)))return b(t);if(0===i(r(t),new s(0)))return b(e);e=b(e),t=b(t);return n(o(e,t),a(e,t))}})}),us=l("add",["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix"],function(e){var t=e.typed,r=e.matrix,n=e.addScalar,i=e.equalScalar,a=e.DenseMatrix,o=(e.SparseMatrix,on({typed:t})),s=sn({typed:t,equalScalar:i}),u=un({typed:t,DenseMatrix:a}),c=d({typed:t}),f=h({typed:t});return t("add",nt({"DenseMatrix, DenseMatrix":function(e,t){return c(e,t,n)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,n,!1)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,n,!0)},"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,n)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"DenseMatrix, any":function(e,t){return f(e,t,n,!1)},"SparseMatrix, any":function(e,t){return u(e,t,n,!1)},"any, DenseMatrix":function(e,t){return f(t,e,n,!0)},"any, SparseMatrix":function(e,t){return u(t,e,n,!0)},"Array, any":function(e,t){return f(r(e),t,n,!1).valueOf()},"any, Array":function(e,t){return f(r(t),e,n,!0).valueOf()},"any, any":n,"any, any, ...any":function(e,t,r){for(var n=this(e,t),i=0;i<r.length;i++)n=this(n,r[i]);return n}},n.signatures))}),cs=l("hypot",["typed","abs","addScalar","divideScalar","multiplyScalar","sqrt","smaller","isPositive"],function(e){var t=e.typed,a=e.abs,o=e.addScalar,s=e.divideScalar,u=e.multiplyScalar,c=e.sqrt,f=e.smaller,l=e.isPositive;return t("hypot",{"... number | BigNumber":function(e){for(var t=0,r=0,n=0;n<e.length;n++){var i=a(e[n]);f(r,i)?(t=u(t,u(s(r,i),s(r,i))),t=o(t,1),r=i):t=o(t,l(i)?u(s(i,r),s(i,r)):i)}return u(r,c(t))},Array:function(e){return this.apply(this,b(e))},Matrix:function(e){return this.apply(this,b(e.toArray()))}})}),fs=l("norm",["typed","abs","add","pow","conj","sqrt","multiply","equalScalar","larger","smaller","matrix","ctranspose","eigs"],function(e){var t=e.typed,m=e.abs,h=e.add,d=e.pow,y=e.conj,g=e.sqrt,v=e.multiply,x=e.equalScalar,b=e.larger,w=e.smaller,r=e.matrix,N=e.ctranspose,M=e.eigs;return t("norm",{number:Math.abs,Complex:function(e){return e.abs()},BigNumber:function(e){return e.abs()},boolean:function(e){return Math.abs(e)},Array:function(e){return E(r(e),2)},Matrix:function(e){return E(e,2)},"number | Complex | BigNumber | boolean, number | BigNumber | string":function(e){return this(e)},"Array, number | BigNumber | string":function(e,t){return E(r(e),t)},"Matrix, number | BigNumber | string":E});function E(e,t){var r,n,i,a=e.size();if(1===a.length){var o=e,s=t;if(s===Number.POSITIVE_INFINITY||"inf"===s)return r=0,o.forEach(function(e){e=m(e);b(e,r)&&(r=e)},!0),r;if(s===Number.NEGATIVE_INFINITY||"-inf"===s)return o.forEach(function(e){e=m(e);n&&!w(e,n)||(n=e)},!0),n||0;if("fro"===s)return E(o,2);if("number"!=typeof s||isNaN(s))throw new Error("Unsupported parameter value");return x(s,0)?Number.POSITIVE_INFINITY:(i=0,o.forEach(function(e){i=h(d(m(e),s),i)},!0),d(i,1/s))}if(2===a.length){if(a[0]&&a[1]){var u,c,f,l,p,o=e,a=t;if(1===a)return u=[],c=0,o.forEach(function(e,t){t=t[1],e=h(u[t]||0,m(e));b(e,c)&&(c=e),u[t]=e},!0),c;if(a===Number.POSITIVE_INFINITY||"inf"===a)return f=[],l=0,o.forEach(function(e,t){t=t[0],e=h(f[t]||0,m(e));b(e,l)&&(l=e),f[t]=e},!0),l;if("fro"===a)return p=0,o.forEach(function(e,t){p=h(p,v(e,y(e)))}),m(g(p));if(2!==a)throw new Error("Unsupported parameter value "+a);if((o=(a=o).size())[0]!==o[1])throw new RangeError("Invalid matrix dimensions");return o=N(a),o=v(o,a),a=M(o).values.toArray(),o=a[a.length-1],m(g(o))}throw new RangeError("Invalid matrix dimensions")}}}),ls=l("dot",["typed","addScalar","multiplyScalar","conj","size"],function(e){var g=e.typed,v=e.addScalar,x=e.multiplyScalar,b=e.conj,t=e.size;return g("dot",{"Array | DenseMatrix, Array | DenseMatrix":function(e,t){var r=w(e,t),n=F(e)?e._data:e,i=F(e)?e._datatype:void 0,a=F(t)?t._data:t,o=F(t)?t._datatype:void 0,e=2===N(e).length,t=2===N(t).length,s=v,u=x;if(i&&o&&i===o&&"string"==typeof i&&(s=g.find(v,[o=i,o]),u=g.find(x,[o,o])),!e&&!t){for(var c=u(b(n[0]),a[0]),f=1;f<r;f++)c=s(c,u(b(n[f]),a[f]));return c}if(!e&&t){for(var l=u(b(n[0]),a[0][0]),p=1;p<r;p++)l=s(l,u(b(n[p]),a[p][0]));return l}if(e&&!t){for(var m=u(b(n[0][0]),a[0]),h=1;h<r;h++)m=s(m,u(b(n[h][0]),a[h]));return m}if(e&&t){for(var d=u(b(n[0][0]),a[0][0]),y=1;y<r;y++)d=s(d,u(b(n[y][0]),a[y][0]));return d}},"SparseMatrix, SparseMatrix":function(e,t){w(e,t);for(var r=e._index,n=e._values,i=t._index,a=t._values,o=0,s=v,u=x,c=0,f=0;c<r.length&&f<i.length;){var l=r[c],p=i[f];l<p?c++:p<l?f++:l===p&&(o=s(o,u(n[c],a[f])),c++,f++)}return o}});function w(e,t){var r,n,e=N(e),t=N(t);if(1===e.length)r=e[0];else{if(2!==e.length||1!==e[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+e.join(", ")+")");r=e[0]}if(1===t.length)n=t[0];else{if(2!==t.length||1!==t[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+t.join(", ")+")");n=t[0]}if(r!==n)throw new RangeError("Vectors must have equal length ("+r+" != "+n+")");if(0===r)throw new RangeError("Cannot calculate the dot product of empty vectors");return r}function N(e){return F(e)?e.size():t(e)}}),ps=l("trace",["typed","matrix","add"],function(e){var t=e.typed,r=e.matrix,p=e.add;return t("trace",{Array:function(e){return n(r(e))},SparseMatrix:function(e){var t=e._values,r=e._index,n=e._ptr,e=e._size,i=e[0],a=e[1];if(i!==a)throw new RangeError("Matrix must be square (size: "+re(e)+")");var o=0;if(0<t.length)for(var s=0;s<a;s++)for(var u=n[s],c=n[s+1],f=u;f<c;f++){var l=r[f];if(l===s){o=p(o,t[f]);break}if(s<l)break}return o},DenseMatrix:n,any:ne});function n(e){var t=e._size,r=e._data;switch(t.length){case 1:if(1===t[0])return ne(r[0]);throw new RangeError("Matrix must be square (size: "+re(t)+")");case 2:var n=t[0];if(n!==t[1])throw new RangeError("Matrix must be square (size: "+re(t)+")");for(var i=0,a=0;a<n;a++)i=p(i,r[a][a]);return i;default:throw new RangeError("Matrix must be two dimensional (size: "+re(t)+")")}}}),ms=l("index",["typed","Index"],function(e){var t=e.typed,r=e.Index;return t("index",{"...number | string | BigNumber | Range | Array | Matrix":function(e){var e=e.map(function(e){return ee(e)?e.toNumber():Array.isArray(e)||F(e)?e.map(function(e){return ee(e)?e.toNumber():e}):e}),t=new r;return r.apply(t,e),t}})}),hs=(e(191),new Set(["end"])),ds=l("Node",["mathWithTransform"],function(e){var t=e.mathWithTransform;function r(){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator")}return r.prototype.evaluate=function(e){return this.compile().evaluate(e)},r.prototype.type="Node",r.prototype.isNode=!0,r.prototype.comment="",r.prototype.compile=function(){var a=this._compile(t,{}),o={};return{evaluate:function(e){for(var e=Nt(e),t=e,r=0,n=Vi()(hs);r<n.length;r++){var i=n[r];if(t.has(i))throw new Error('Scope contains an illegal symbol, "'+i+'" is a reserved keyword')}return a(e,o,null)}}},r.prototype._compile=function(e,t){throw new Error("Method _compile should be implemented by type "+this.type)},r.prototype.forEach=function(e){throw new Error("Cannot run forEach on a Node interface")},r.prototype.map=function(e){throw new Error("Cannot run map on a Node interface")},r.prototype._ifNode=function(e){if(L(e))return e;throw new TypeError("Callback function must return a Node")},r.prototype.traverse=function(e){e(this,null,null),function n(e,i){e.forEach(function(e,t,r){i(e,t,r),n(e,i)})}(this,e)},r.prototype.transform=function(i){return function e(t,r,n){r=i(t,r,n);return r!==t?r:t.map(e)}(this,null,null)},r.prototype.filter=function(n){var i=[];return this.traverse(function(e,t,r){n(e,t,r)&&i.push(e)}),i},r.prototype.clone=function(){throw new Error("Cannot clone a Node interface")},r.prototype.cloneDeep=function(){return this.map(function(e){return e.cloneDeep()})},r.prototype.equals=function(e){return!!e&&it(this,e)},r.prototype.toString=function(e){var t=this._getCustomString(e);return void 0!==t?t:this._toString(e)},r.prototype.toJSON=function(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)},r.prototype.toHTML=function(e){var t=this._getCustomString(e);return void 0!==t?t:this.toHTML(e)},r.prototype._toString=function(){throw new Error("_toString not implemented for "+this.type)},r.prototype.toTex=function(e){var t=this._getCustomString(e);return void 0!==t?t:this._toTex(e)},r.prototype._toTex=function(e){throw new Error("_toTex not implemented for "+this.type)},r.prototype._getCustomString=function(e){if(e&&"object"===Z()(e))switch(Z()(e.handler)){case"object":case"undefined":return;case"function":return e.handler(this,e);default:throw new TypeError("Object or function expected as callback")}},r.prototype.getIdentifier=function(){return this.type},r.prototype.getContent=function(){return this},r},{isClass:!0,isNode:!0});function u(e){return e&&e.isIndexError?new Pe(e.index+1,e.min+1,void 0!==e.max?e.max+1:void 0):e}function ys(e){var r=e.subset;return function(e,t){try{if(Array.isArray(e))return r(e,t);if(e&&"function"==typeof e.subset)return e.subset(t);if("string"==typeof e)return r(e,t);if("object"!==Z()(e))throw new TypeError("Cannot apply index: unsupported type of object");if(t.isObjectProperty())return ft(e,t.getObjectProperty());throw new TypeError("Cannot apply a numeric index as object property")}catch(e){throw u(e)}}}var gs=l("AccessorNode",["subset","Node"],function(e){var t=e.subset,e=e.Node,o=ys({subset:t});function r(e,t){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!L(e))throw new TypeError('Node expected for parameter "object"');if(!J(t))throw new TypeError('IndexNode expected for parameter "index"');this.object=e||null,this.index=t,Object.defineProperty(this,"name",{get:function(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}.bind(this),set:function(){throw new Error("Cannot assign a new name, name is read-only")}})}function n(e){return!(he(e)||U(e)||ce(e)||de(e)||X(e)||Q(e)||le(e))}return(r.prototype=new e).type="AccessorNode",r.prototype.isAccessorNode=!0,r.prototype._compile=function(e,t){var n,i=this.object._compile(e,t),a=this.index._compile(e,t);return this.index.isObjectProperty()?(n=this.index.getObjectProperty(),function(e,t,r){return ft(i(e,t,r),n)}):function(e,t,r){r=i(e,t,r),e=a(e,t,r);return o(r,e)}},r.prototype.forEach=function(e){e(this.object,"object",this),e(this.index,"index",this)},r.prototype.map=function(e){return new r(this._ifNode(e(this.object,"object",this)),this._ifNode(e(this.index,"index",this)))},r.prototype.clone=function(){return new r(this.object,this.index)},r.prototype._toString=function(e){var t=this.object.toString(e);return(t=n(this.object)?"("+t+")":t)+this.index.toString(e)},r.prototype.toHTML=function(e){var t=this.object.toHTML(e);return(t=n(this.object)?'<span class="math-parenthesis math-round-parenthesis">(</span>'+t+'<span class="math-parenthesis math-round-parenthesis">)</span>':t)+this.index.toHTML(e)},r.prototype._toTex=function(e){var t=this.object.toTex(e);return(t=n(this.object)?"\\left(' + object + '\\right)":t)+this.index.toTex(e)},r.prototype.toJSON=function(){return{mathjs:"AccessorNode",object:this.object,index:this.index}},r.fromJSON=function(e){return new r(e.object,e.index)},r},{isClass:!0,isNode:!0}),vs=l("ArrayNode",["Node"],function(e){e=e.Node;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(this.items=e||[],!Array.isArray(this.items)||!this.items.every(L))throw new TypeError("Array containing Nodes expected")}return(n.prototype=new e).type="ArrayNode",n.prototype.isArrayNode=!0,n.prototype._compile=function(t,r){var e,i=Ze(this.items,function(e){return e._compile(t,r)});return"Array"!==t.config.matrix?(e=t.matrix,function(t,r,n){return e(Ze(i,function(e){return e(t,r,n)}))}):function(t,r,n){return Ze(i,function(e){return e(t,r,n)})}},n.prototype.forEach=function(e){for(var t=0;t<this.items.length;t++)e(this.items[t],"items["+t+"]",this)},n.prototype.map=function(e){for(var t=[],r=0;r<this.items.length;r++)t[r]=this._ifNode(e(this.items[r],"items["+r+"]",this));return new n(t)},n.prototype.clone=function(){return new n(this.items.slice(0))},n.prototype._toString=function(t){return"["+this.items.map(function(e){return e.toString(t)}).join(", ")+"]"},n.prototype.toJSON=function(){return{mathjs:"ArrayNode",items:this.items}},n.fromJSON=function(e){return new n(e.items)},n.prototype.toHTML=function(t){return'<span class="math-parenthesis math-square-parenthesis">[</span>'+this.items.map(function(e){return e.toHTML(t)}).join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'},n.prototype._toTex=function(o){return function t(e,r){var n=e.some(U)&&!e.every(U),i=r||n,a=i?"&":"\\\\",e=e.map(function(e){return e.items?t(e.items,!r):e.toTex(o)}).join(a);return n||!i||i&&!r?"\\begin{bmatrix}"+e+"\\end{bmatrix}":e}(this.items,!1)},n},{isClass:!0,isNode:!0}),xs=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{associativity:"left",associativeWith:[]}},{"OperatorNode:and":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{associativity:"left",associativeWith:[]},"OperatorNode:unequal":{associativity:"left",associativeWith:[]},"OperatorNode:smaller":{associativity:"left",associativeWith:[]},"OperatorNode:larger":{associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{associativity:"left",associativeWith:[]}},{"OperatorNode:to":{associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{associativity:"left",associativeWith:[]},"OperatorNode:mod":{associativity:"left",associativeWith:[]}},{"OperatorNode:unaryPlus":{associativity:"right"},"OperatorNode:unaryMinus":{associativity:"right"},"OperatorNode:bitNot":{associativity:"right"},"OperatorNode:not":{associativity:"right"}},{"OperatorNode:pow":{associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{associativity:"left"}},{"OperatorNode:transpose":{associativity:"left"}}];function v(e,t){for(var r=e,n=(r="keep"!==t?e.getContent():r).getIdentifier(),i=0;i<xs.length;i++)if(n in xs[i])return i;return null}function bs(e,t){var r=e,e=(r="keep"!==t?e.getContent():r).getIdentifier(),r=v(r,t);if(null===r)return null;t=xs[r][e];if(pe(t,"associativity")){if("left"===t.associativity)return"left";if("right"===t.associativity)return"right";throw Error("'"+e+"' has the invalid associativity '"+t.associativity+"'.")}return null}function ws(e,t,r){var n="keep"!==r?e.getContent():e,e="keep"!==r?e.getContent():t,t=n.getIdentifier(),i=e.getIdentifier(),e=v(n,r);if(null===e)return null;var a=xs[e][t];if(pe(a,"associativeWith")&&a.associativeWith instanceof Array){for(var o=0;o<a.associativeWith.length;o++)if(a.associativeWith[o]===i)return!0;return!1}return null}var Ns=l("AssignmentNode",["subset","?matrix","Node"],function(e){var n,i,t=e.subset,r=e.matrix,e=e.Node,p=ys({subset:t}),m=(n=(t={subset:t,matrix:r}).subset,i=t.matrix,function(e,t,r){try{if(Array.isArray(e))return i(e).subset(t,r).valueOf();if(e&&"function"==typeof e.subset)return e.subset(t,r);if("string"==typeof e)return n(e,t,r);if("object"!==Z()(e))throw new TypeError("Cannot apply index: unsupported type of object");if(t.isObjectProperty())return lt(e,t.getObjectProperty(),r),e;throw TypeError("Cannot apply a numeric index as object property")}catch(e){throw u(e)}});function a(e,t,r){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");if(this.object=e,this.index=r?t:null,this.value=r||t,!le(e)&&!he(e))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(le(e)&&"end"===e.name)throw new Error('Cannot assign to symbol "end"');if(this.index&&!J(this.index))throw new TypeError('IndexNode expected as "index"');if(!L(this.value))throw new TypeError('Node expected as "value"');Object.defineProperty(this,"name",{get:function(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}.bind(this),set:function(){throw new Error("Cannot assign a new name, name is read-only")}})}function o(e,t){var r=v(e,t=t||"keep"),e=v(e.value,t);return"all"===t||null!==e&&e<=r}return(a.prototype=new e).type="AssignmentNode",a.prototype.isAssignmentNode=!0,a.prototype._compile=function(e,t){var i,a=this.object._compile(e,t),s=this.index?this.index._compile(e,t):null,u=this.value._compile(e,t),o=this.object.name;if(this.index){if(this.index.isObjectProperty())return i=this.index.getObjectProperty(),function(e,t,r){var n=a(e,t,r),e=u(e,t,r);return lt(n,i,e),e};if(le(this.object))return function(e,t,r){var n=a(e,t,r),r=u(e,t,r),t=s(e,t,n);return e.set(o,m(n,t,r)),r};var c,f=this.object.object._compile(e,t);if(this.object.index.isObjectProperty())return c=this.object.index.getObjectProperty(),function(e,t,r){var n=f(e,t,r),i=ft(n,c),a=s(e,t,i),e=u(e,t,r);return lt(n,c,m(i,a,e)),e};var l=this.object.index._compile(e,t);return function(e,t,r){var n=f(e,t,r),i=l(e,t,n),a=p(n,i),o=s(e,t,a),e=u(e,t,r);return m(n,i,m(a,o,e)),e}}if(le(this.object))return function(e,t,r){t=u(e,t,r);return e.set(o,t),t};throw new TypeError("SymbolNode expected as object")},a.prototype.forEach=function(e){e(this.object,"object",this),this.index&&e(this.index,"index",this),e(this.value,"value",this)},a.prototype.map=function(e){return new a(this._ifNode(e(this.object,"object",this)),this.index?this._ifNode(e(this.index,"index",this)):null,this._ifNode(e(this.value,"value",this)))},a.prototype.clone=function(){return new a(this.object,this.index,this.value)},a.prototype._toString=function(e){var t=this.object.toString(e),r=this.index?this.index.toString(e):"",n=this.value.toString(e);return t+r+" = "+(n=o(this,e&&e.parenthesis)?"("+n+")":n)},a.prototype.toJSON=function(){return{mathjs:"AssignmentNode",object:this.object,index:this.index,value:this.value}},a.fromJSON=function(e){return new a(e.object,e.index,e.value)},a.prototype.toHTML=function(e){var t=this.object.toHTML(e),r=this.index?this.index.toHTML(e):"",n=this.value.toHTML(e);return t+r+'<span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+(n=o(this,e&&e.parenthesis)?'<span class="math-paranthesis math-round-parenthesis">(</span>'+n+'<span class="math-paranthesis math-round-parenthesis">)</span>':n)},a.prototype._toTex=function(e){var t=this.object.toTex(e),r=this.index?this.index.toTex(e):"",n=this.value.toTex(e);return t+r+":="+(n=o(this,e&&e.parenthesis)?"\\left(".concat(n,"\\right)"):n)},a},{isClass:!0,isNode:!0}),Ms=l("BlockNode",["ResultSet","Node"],function(e){var o=e.ResultSet,e=e.Node;function a(e){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");if(!Array.isArray(e))throw new Error("Array expected");this.blocks=e.map(function(e){var t=e&&e.node,e=!e||void 0===e.visible||e.visible;if(!L(t))throw new TypeError('Property "node" must be a Node');if("boolean"!=typeof e)throw new TypeError('Property "visible" must be a boolean');return{node:t,visible:e}})}return(a.prototype=new e).type="BlockNode",a.prototype.isBlockNode=!0,a.prototype._compile=function(t,r){var e=Ze(this.blocks,function(e){return{evaluate:e.node._compile(t,r),visible:e.visible}});return function(r,n,i){var a=[];return We(e,function(e){var t=e.evaluate(r,n,i);e.visible&&a.push(t)}),new o(a)}},a.prototype.forEach=function(e){for(var t=0;t<this.blocks.length;t++)e(this.blocks[t].node,"blocks["+t+"].node",this)},a.prototype.map=function(e){for(var t=[],r=0;r<this.blocks.length;r++){var n=this.blocks[r],i=this._ifNode(e(n.node,"blocks["+r+"].node",this));t[r]={node:i,visible:n.visible}}return new a(t)},a.prototype.clone=function(){return new a(this.blocks.map(function(e){return{node:e.node,visible:e.visible}}))},a.prototype._toString=function(t){return this.blocks.map(function(e){return e.node.toString(t)+(e.visible?"":";")}).join("\n")},a.prototype.toJSON=function(){return{mathjs:"BlockNode",blocks:this.blocks}},a.fromJSON=function(e){return new a(e.blocks)},a.prototype.toHTML=function(t){return this.blocks.map(function(e){return e.node.toHTML(t)+(e.visible?"":'<span class="math-separator">;</span>')}).join('<span class="math-separator"><br /></span>')},a.prototype._toTex=function(t){return this.blocks.map(function(e){return e.node.toTex(t)+(e.visible?"":";")}).join("\\;\\;\n")},a},{isClass:!0,isNode:!0}),Es=l("ConditionalNode",["Node"],function(e){e=e.Node;function n(e,t,r){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!L(e))throw new TypeError("Parameter condition must be a Node");if(!L(t))throw new TypeError("Parameter trueExpr must be a Node");if(!L(r))throw new TypeError("Parameter falseExpr must be a Node");this.condition=e,this.trueExpr=t,this.falseExpr=r}return(n.prototype=new e).type="ConditionalNode",n.prototype.isConditionalNode=!0,n.prototype._compile=function(e,t){var n=this.condition._compile(e,t),i=this.trueExpr._compile(e,t),a=this.falseExpr._compile(e,t);return function(e,t,r){return(function(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e)return e;if(e){if(ee(e))return!e.isZero();if(ie(e))return e.re||e.im;if(W(e))return e.value}if(null!=e)throw new TypeError('Unsupported type of condition "'+te(e)+'"')}(n(e,t,r))?i:a)(e,t,r)}},n.prototype.forEach=function(e){e(this.condition,"condition",this),e(this.trueExpr,"trueExpr",this),e(this.falseExpr,"falseExpr",this)},n.prototype.map=function(e){return new n(this._ifNode(e(this.condition,"condition",this)),this._ifNode(e(this.trueExpr,"trueExpr",this)),this._ifNode(e(this.falseExpr,"falseExpr",this)))},n.prototype.clone=function(){return new n(this.condition,this.trueExpr,this.falseExpr)},n.prototype._toString=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=v(this,t),n=this.condition.toString(e),i=v(this.condition,t),i=(("all"===t||"OperatorNode"===this.condition.type||null!==i&&i<=r)&&(n="("+n+")"),this.trueExpr.toString(e)),a=v(this.trueExpr,t),a=(("all"===t||"OperatorNode"===this.trueExpr.type||null!==a&&a<=r)&&(i="("+i+")"),this.falseExpr.toString(e)),e=v(this.falseExpr,t);return n+" ? "+i+" : "+(a="all"===t||"OperatorNode"===this.falseExpr.type||null!==e&&e<=r?"("+a+")":a)},n.prototype.toJSON=function(){return{mathjs:"ConditionalNode",condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}},n.fromJSON=function(e){return new n(e.condition,e.trueExpr,e.falseExpr)},n.prototype.toHTML=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=v(this,t),n=this.condition.toHTML(e),i=v(this.condition,t),i=(("all"===t||"OperatorNode"===this.condition.type||null!==i&&i<=r)&&(n='<span class="math-parenthesis math-round-parenthesis">(</span>'+n+'<span class="math-parenthesis math-round-parenthesis">)</span>'),this.trueExpr.toHTML(e)),a=v(this.trueExpr,t),a=(("all"===t||"OperatorNode"===this.trueExpr.type||null!==a&&a<=r)&&(i='<span class="math-parenthesis math-round-parenthesis">(</span>'+i+'<span class="math-parenthesis math-round-parenthesis">)</span>'),this.falseExpr.toHTML(e)),e=v(this.falseExpr,t);return n+'<span class="math-operator math-conditional-operator">?</span>'+i+'<span class="math-operator math-conditional-operator">:</span>'+(a="all"===t||"OperatorNode"===this.falseExpr.type||null!==e&&e<=r?'<span class="math-parenthesis math-round-parenthesis">(</span>'+a+'<span class="math-parenthesis math-round-parenthesis">)</span>':a)},n.prototype._toTex=function(e){return"\\begin{cases} {"+this.trueExpr.toTex(e)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(e)+"}\\\\{"+this.falseExpr.toTex(e)+"}, &\\quad{\\text{otherwise}}\\end{cases}"},n},{isClass:!0,isNode:!0}),r=e(195),Ss=e.n(r),As={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{?}"},w={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"},Os={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(w.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(w.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(w.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(w.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(w.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(w.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(w.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(w.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(w.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(w.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(w.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(w.bitAnd,"${args[1]}\\right)")},bitNot:{1:w.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(w.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(w.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(w.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(w.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(w.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(w.and,"${args[1]}\\right)")},not:{1:w.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(w.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(w.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(w.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(w.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(w.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(w.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(w.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(w.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(w.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(w.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(w.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(w.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(w.to,"${args[1]}\\right)")},numeric:function(e,t){return e.args[0].toTex()},number:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:"0",1:"\\left(${args[0]}\\right)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(As.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)"}},Cs={deg:"^\\circ"};function Ts(e){return Ss()(e,{preserveFormatting:!0})}function _s(e,t){return(t=void 0!==t&&t)?pe(Cs,e)?Cs[e]:"\\mathrm{"+Ts(e)+"}":pe(As,e)?As[e]:Ts(e)}var Is=l("ConstantNode",["Node"],function(e){e=e.Node;function t(e){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");this.value=e}return(t.prototype=new e).type="ConstantNode",t.prototype.isConstantNode=!0,t.prototype._compile=function(e,t){var r=this.value;return function(){return r}},t.prototype.forEach=function(e){},t.prototype.map=function(e){return this.clone()},t.prototype.clone=function(){return new t(this.value)},t.prototype._toString=function(e){return re(this.value,e)},t.prototype.toHTML=function(e){var t=this._toString(e);switch(te(this.value)){case"number":case"BigNumber":case"Fraction":return'<span class="math-number">'+t+"</span>";case"string":return'<span class="math-string">'+t+"</span>";case"boolean":return'<span class="math-boolean">'+t+"</span>";case"null":return'<span class="math-null-symbol">'+t+"</span>";case"undefined":return'<span class="math-undefined">'+t+"</span>";default:return'<span class="math-symbol">'+t+"</span>"}},t.prototype.toJSON=function(){return{mathjs:"ConstantNode",value:this.value}},t.fromJSON=function(e){return new t(e.value)},t.prototype._toTex=function(e){var t=this._toString(e);switch(te(this.value)){case"string":return"\\mathtt{"+Ts(t)+"}";case"number":case"BigNumber":if(!isFinite(this.value))return this.value.valueOf()<0?"-\\infty":"\\infty";var r=t.toLowerCase().indexOf("e");return-1!==r?t.substring(0,r)+"\\cdot10^{"+t.substring(r+1)+"}":t;case"Fraction":return this.value.toLatex();default:return t}},t},{isClass:!0,isNode:!0}),ks=l("FunctionAssignmentNode",["typed","Node"],function(e){var f=e.typed,e=e.Node;function n(e,t,r){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if("string"!=typeof e)throw new TypeError('String expected for parameter "name"');if(!Array.isArray(t))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!L(r))throw new TypeError('Node expected for parameter "expr"');if(hs.has(e))throw new Error('Illegal function name, "'+e+'" is a reserved keyword');this.name=e,this.params=t.map(function(e){return e&&e.name||e}),this.types=t.map(function(e){return e&&e.type||"any"}),this.expr=r}function i(e,t){var r=v(e,t),e=v(e.expr,t);return"all"===t||null!==e&&e<=r}return(n.prototype=new e).type="FunctionAssignmentNode",n.prototype.isFunctionAssignmentNode=!0,n.prototype._compile=function(e,t){var r=Object.create(t),a=(We(this.params,function(e){r[e]=!0}),this.expr._compile(e,r)),o=this.name,s=this.params,u=Xe(this.types,","),c=o+"("+Xe(this.params,", ")+")";return function(r,n,i){var e={},e=(e[u]=function(){for(var e=Object.create(n),t=0;t<s.length;t++)e[s[t]]=arguments[t];return a(r,e,i)},f(o,e));return e.syntax=c,r.set(o,e),e}},n.prototype.forEach=function(e){e(this.expr,"expr",this)},n.prototype.map=function(e){e=this._ifNode(e(this.expr,"expr",this));return new n(this.name,this.params.slice(0),e)},n.prototype.clone=function(){return new n(this.name,this.params.slice(0),this.expr)},n.prototype._toString=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",e=this.expr.toString(e);return i(this,t)&&(e="("+e+")"),this.name+"("+this.params.join(", ")+") = "+e},n.prototype.toJSON=function(){var r=this.types;return{mathjs:"FunctionAssignmentNode",name:this.name,params:this.params.map(function(e,t){return{name:e,type:r[t]}}),expr:this.expr}},n.fromJSON=function(e){return new n(e.name,e.params,e.expr)},n.prototype.toHTML=function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",r=[],n=0;n<this.params.length;n++)r.push('<span class="math-symbol math-parameter">'+De(this.params[n])+"</span>");e=this.expr.toHTML(e);return i(this,t)&&(e='<span class="math-parenthesis math-round-parenthesis">(</span>'+e+'<span class="math-parenthesis math-round-parenthesis">)</span>'),'<span class="math-function">'+De(this.name)+'</span><span class="math-parenthesis math-round-parenthesis">(</span>'+r.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-round-parenthesis">)</span><span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+e},n.prototype._toTex=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",e=this.expr.toTex(e);return i(this,t)&&(e="\\left(".concat(e,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(_s).join(",")+"\\right):="+e},n},{isClass:!0,isNode:!0}),zs=l("IndexNode",["Node","size"],function(e){var t=e.Node,o=e.size;function n(e,t){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(this.dimensions=e,this.dotNotation=t||!1,!Array.isArray(e)||!e.every(L))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}return(n.prototype=new t).type="IndexNode",n.prototype.isIndexNode=!0,n.prototype._compile=function(r,n){var i=Ze(this.dimensions,function(e,i){var t,a;return 0<e.filter(function(e){return e.isSymbolNode&&"end"===e.name}).length?((t=Object.create(n)).end=!0,a=e._compile(r,t),function(e,t,r){if(!F(r)&&!x(r)&&!M(r))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+te(r));var n=o(r).valueOf(),t=Object.create(t);return t.end=n[i],a(e,t,r)}):e._compile(r,n)}),a=ft(r,"index");return function(t,r,n){var e=Ze(i,function(e){return e(t,r,n)});return a.apply(void 0,Vi()(e))}},n.prototype.forEach=function(e){for(var t=0;t<this.dimensions.length;t++)e(this.dimensions[t],"dimensions["+t+"]",this)},n.prototype.map=function(e){for(var t=[],r=0;r<this.dimensions.length;r++)t[r]=this._ifNode(e(this.dimensions[r],"dimensions["+r+"]",this));return new n(t,this.dotNotation)},n.prototype.clone=function(){return new n(this.dimensions.slice(0),this.dotNotation)},n.prototype.isObjectProperty=function(){return 1===this.dimensions.length&&ce(this.dimensions[0])&&"string"==typeof this.dimensions[0].value},n.prototype.getObjectProperty=function(){return this.isObjectProperty()?this.dimensions[0].value:null},n.prototype._toString=function(e){return this.dotNotation?"."+this.getObjectProperty():"["+this.dimensions.join(", ")+"]"},n.prototype.toJSON=function(){return{mathjs:"IndexNode",dimensions:this.dimensions,dotNotation:this.dotNotation}},n.fromJSON=function(e){return new n(e.dimensions,e.dotNotation)},n.prototype.toHTML=function(e){for(var t=[],r=0;r<this.dimensions.length;r++)t[r]=this.dimensions[r].toHTML();return this.dotNotation?'<span class="math-operator math-accessor-operator">.</span><span class="math-symbol math-property">'+De(this.getObjectProperty())+"</span>":'<span class="math-parenthesis math-square-parenthesis">[</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'},n.prototype._toTex=function(t){var e=this.dimensions.map(function(e){return e.toTex(t)});return this.dotNotation?"."+this.getObjectProperty():"_{"+e.join(",")+"}"},n},{isClass:!0,isNode:!0}),Rs=l("ObjectNode",["Node"],function(e){e=e.Node;function n(t){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(this.properties=t||{},t&&("object"!==Z()(t)||!Object.keys(t).every(function(e){return L(t[e])})))throw new TypeError("Object containing Nodes expected")}return(n.prototype=new e).type="ObjectNode",n.prototype.isObjectNode=!0,n.prototype._compile=function(e,t){var r,a={};for(r in this.properties)if(pe(this.properties,r)){var n=Be(r),n=JSON.parse(n);if(!pt(this.properties,n))throw new Error('No access to property "'+n+'"');a[n]=this.properties[r]._compile(e,t)}return function(e,t,r){var n,i={};for(n in a)pe(a,n)&&(i[n]=a[n](e,t,r));return i}},n.prototype.forEach=function(e){for(var t in this.properties)pe(this.properties,t)&&e(this.properties[t],"properties["+Be(t)+"]",this)},n.prototype.map=function(e){var t,r={};for(t in this.properties)pe(this.properties,t)&&(r[t]=this._ifNode(e(this.properties[t],"properties["+Be(t)+"]",this)));return new n(r)},n.prototype.clone=function(){var e,t={};for(e in this.properties)pe(this.properties,e)&&(t[e]=this.properties[e]);return new n(t)},n.prototype._toString=function(e){var t,r=[];for(t in this.properties)pe(this.properties,t)&&r.push(Be(t)+": "+this.properties[t].toString(e));return"{"+r.join(", ")+"}"},n.prototype.toJSON=function(){return{mathjs:"ObjectNode",properties:this.properties}},n.fromJSON=function(e){return new n(e.properties)},n.prototype.toHTML=function(e){var t,r=[];for(t in this.properties)pe(this.properties,t)&&r.push('<span class="math-symbol math-property">'+De(t)+'</span><span class="math-operator math-assignment-operator math-property-assignment-operator math-binary-operator">:</span>'+this.properties[t].toHTML(e));return'<span class="math-parenthesis math-curly-parenthesis">{</span>'+r.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-curly-parenthesis">}</span>'},n.prototype._toTex=function(e){var t,r=[];for(t in this.properties)pe(this.properties,t)&&r.push("\\mathbf{"+t+":} & "+this.properties[t].toTex(e)+"\\\\");return"\\left\\{\\begin{array}{ll}".concat(r.join("\n"),"\\end{array}\\right\\}")},n},{isClass:!0,isNode:!0}),qs=l("OperatorNode",["Node"],function(e){e=e.Node;function a(e,t,r,n,i){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");if("string"!=typeof e)throw new TypeError('string expected for parameter "op"');if("string"!=typeof t)throw new TypeError('string expected for parameter "fn"');if(!Array.isArray(r)||!r.every(L))throw new TypeError('Array containing Nodes expected for parameter "args"');this.implicit=!0===n,this.isPercentage=!0===i,this.op=e,this.fn=t,this.args=r||[]}function l(n,i,e,t,r){var a,o=v(n,i),s=bs(n,i);if("all"===i||2<t.length&&"OperatorNode:add"!==n.getIdentifier()&&"OperatorNode:multiply"!==n.getIdentifier())return t.map(function(e){switch(e.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});switch(t.length){case 0:a=[];break;case 1:var u=v(t[0],i);if(r&&null!==u){var c="keep"===i?(m=t[0].getIdentifier(),n.getIdentifier()):(m=t[0].getContent().getIdentifier(),n.getContent().getIdentifier());if(!1===xs[o][c].latexLeftParens){a=[!1];break}if(!1===xs[u][m].latexParens){a=[!1];break}}if(null===u){a=[!1];break}if(u<=o){a=[!0];break}a=[!1];break;case 2:var f,l,p,c=v(t[0],i),m=ws(n,t[0],i),u=null!==c&&(c===o&&"right"===s&&!m||c<o),m=v(t[1],i),h=ws(n,t[1],i),h=null!==m&&(m===o&&"left"===s&&!h||m<o);r&&(p="keep"===i?(f=n.getIdentifier(),l=n.args[0].getIdentifier(),n.args[1].getIdentifier()):(f=n.getContent().getIdentifier(),l=n.args[0].getContent().getIdentifier(),n.args[1].getContent().getIdentifier()),null!==c&&(!1===xs[o][f].latexLeftParens&&(u=!1),!1===xs[c][l].latexParens&&(u=!1)),null!==m&&(!1===xs[o][f].latexRightParens&&(h=!1),!1===xs[m][p].latexParens&&(h=!1))),a=[u,h];break;default:"OperatorNode:add"!==n.getIdentifier()&&"OperatorNode:multiply"!==n.getIdentifier()||(a=t.map(function(e){var t=v(e,i),r=ws(n,e,i),e=bs(e,i);return null!==t&&(o===t&&s===e&&!r||t<o)}))}return a=2<=t.length&&"OperatorNode:multiply"===n.getIdentifier()&&n.implicit&&"auto"===i&&"hide"===e?t.map(function(e,t){e="ParenthesisNode"===e.getIdentifier();return!(!a[t]&&!e)}):a}return(a.prototype=new e).type="OperatorNode",a.prototype.isOperatorNode=!0,a.prototype._compile=function(t,r){if("string"!=typeof this.fn||!mt(t,this.fn))throw t[this.fn]?new Error('No access to function "'+this.fn+'"'):new Error("Function "+this.fn+' missing in provided namespace "math"');var n,i,a,o=ft(t,this.fn),e=Ze(this.args,function(e){return e._compile(t,r)});return 1===e.length?(n=e[0],function(e,t,r){return o(n(e,t,r))}):2===e.length?(i=e[0],a=e[1],function(e,t,r){return o(i(e,t,r),a(e,t,r))}):function(t,r,n){return o.apply(null,Ze(e,function(e){return e(t,r,n)}))}},a.prototype.forEach=function(e){for(var t=0;t<this.args.length;t++)e(this.args[t],"args["+t+"]",this)},a.prototype.map=function(e){for(var t=[],r=0;r<this.args.length;r++)t[r]=this._ifNode(e(this.args[r],"args["+r+"]",this));return new a(this.op,this.fn,t,this.implicit,this.isPercentage)},a.prototype.clone=function(){return new a(this.op,this.fn,this.args.slice(0),this.implicit,this.isPercentage)},a.prototype.isUnary=function(){return 1===this.args.length},a.prototype.isBinary=function(){return 2===this.args.length},a.prototype._toString=function(r){var e,t,n=r&&r.parenthesis?r.parenthesis:"keep",i=r&&r.implicit?r.implicit:"hide",a=this.args,o=l(this,n,i,a,!1);return 1===a.length?(n=bs(this,n),t=a[0].toString(r),o[0]&&(t="("+t+")"),e=/[a-zA-Z]+/.test(this.op),"right"===n?this.op+(e?" ":"")+t:"left"===n?t+(e?" ":"")+this.op:t+this.op):2===a.length?(n=a[0].toString(r),e=a[1].toString(r),o[0]&&(n="("+n+")"),o[1]&&(e="("+e+")"),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===i?n+" "+e:n+" "+this.op+" "+e):2<a.length&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())?(t=a.map(function(e,t){return e=e.toString(r),e=o[t]?"("+e+")":e}),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===i?t.join(" "):t.join(" "+this.op+" ")):this.fn+"("+this.args.join(", ")+")"},a.prototype.toJSON=function(){return{mathjs:"OperatorNode",op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}},a.fromJSON=function(e){return new a(e.op,e.fn,e.args,e.implicit,e.isPercentage)},a.prototype.toHTML=function(r){var e,t=r&&r.parenthesis?r.parenthesis:"keep",n=r&&r.implicit?r.implicit:"hide",i=this.args,a=l(this,t,n,i,!1);if(1===i.length)return t=bs(this,t),e=i[0].toHTML(r),a[0]&&(e='<span class="math-parenthesis math-round-parenthesis">(</span>'+e+'<span class="math-parenthesis math-round-parenthesis">)</span>'),"right"===t?'<span class="math-operator math-unary-operator math-lefthand-unary-operator">'+De(this.op)+"</span>"+e:e+'<span class="math-operator math-unary-operator math-righthand-unary-operator">'+De(this.op)+"</span>";if(2===i.length)return t=i[0].toHTML(r),e=i[1].toHTML(r),a[0]&&(t='<span class="math-parenthesis math-round-parenthesis">(</span>'+t+'<span class="math-parenthesis math-round-parenthesis">)</span>'),a[1]&&(e='<span class="math-parenthesis math-round-parenthesis">(</span>'+e+'<span class="math-parenthesis math-round-parenthesis">)</span>'),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?t+'<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'+e:t+'<span class="math-operator math-binary-operator math-explicit-binary-operator">'+De(this.op)+"</span>"+e;t=i.map(function(e,t){return e=e.toHTML(r),e=a[t]?'<span class="math-parenthesis math-round-parenthesis">(</span>'+e+'<span class="math-parenthesis math-round-parenthesis">)</span>':e});return 2<i.length&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())?this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?t.join('<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'):t.join('<span class="math-operator math-binary-operator math-explicit-binary-operator">'+De(this.op)+"</span>"):'<span class="math-function">'+De(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'},a.prototype._toTex=function(r){var e,t=r&&r.parenthesis?r.parenthesis:"keep",n=r&&r.implicit?r.implicit:"hide",i=this.args,a=l(this,t,n,i,!0),o=void 0===(o=w[this.fn])?this.op:o;if(1===i.length)return e=bs(this,t),s=i[0].toTex(r),a[0]&&(s="\\left(".concat(s,"\\right)")),"right"===e?o+s:s+o;if(2!==i.length)return 2<i.length&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())?(e=i.map(function(e,t){return e=e.toTex(r),e=a[t]?"\\left(".concat(e,"\\right)"):e}),"OperatorNode:multiply"===this.getIdentifier()&&this.implicit?e.join("~"):e.join(o)):"\\mathrm{"+this.fn+"}\\left("+i.map(function(e){return e.toTex(r)}).join(",")+"\\right)";var s=i[0],u=s.toTex(r);a[0]&&(u="\\left(".concat(u,"\\right)"));var c,f=i[1].toTex(r);switch(a[1]&&(f="\\left(".concat(f,"\\right)")),c=("keep"===t?s:s.getContent()).getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return o+"{"+u+"}{"+f+"}";case"OperatorNode:pow":switch(u="{"+u+"}",f="{"+f+"}",c){case"ConditionalNode":case"OperatorNode:divide":u="\\left(".concat(u,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&"hide"===n)return u+"~"+f}return u+o+f},a.prototype.getIdentifier=function(){return this.type+":"+this.fn},a},{isClass:!0,isNode:!0}),Bs=l("ParenthesisNode",["Node"],function(e){e=e.Node;function t(e){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");if(!L(e))throw new TypeError('Node expected for parameter "content"');this.content=e}return(t.prototype=new e).type="ParenthesisNode",t.prototype.isParenthesisNode=!0,t.prototype._compile=function(e,t){return this.content._compile(e,t)},t.prototype.getContent=function(){return this.content.getContent()},t.prototype.forEach=function(e){e(this.content,"content",this)},t.prototype.map=function(e){return new t(e(this.content,"content",this))},t.prototype.clone=function(){return new t(this.content)},t.prototype._toString=function(e){return!e||!e.parenthesis||e&&"keep"===e.parenthesis?"("+this.content.toString(e)+")":this.content.toString(e)},t.prototype.toJSON=function(){return{mathjs:"ParenthesisNode",content:this.content}},t.fromJSON=function(e){return new t(e.content)},t.prototype.toHTML=function(e){return!e||!e.parenthesis||e&&"keep"===e.parenthesis?'<span class="math-parenthesis math-round-parenthesis">(</span>'+this.content.toHTML(e)+'<span class="math-parenthesis math-round-parenthesis">)</span>':this.content.toHTML(e)},t.prototype._toTex=function(e){return!e||!e.parenthesis||e&&"keep"===e.parenthesis?"\\left(".concat(this.content.toTex(e),"\\right)"):this.content.toTex(e)},t},{isClass:!0,isNode:!0}),Ds=l("RangeNode",["Node"],function(e){e=e.Node;function n(e,t,r){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!L(e))throw new TypeError("Node expected");if(!L(t))throw new TypeError("Node expected");if(r&&!L(r))throw new TypeError("Node expected");if(3<arguments.length)throw new Error("Too many arguments");this.start=e,this.end=t,this.step=r||null}function i(e,t){var r=v(e,t),n={},i=v(e.start,t),i=(n.start=null!==i&&i<=r||"all"===t,e.step&&(i=v(e.step,t),n.step=null!==i&&i<=r||"all"===t),v(e.end,t));return n.end=null!==i&&i<=r||"all"===t,n}return(n.prototype=new e).type="RangeNode",n.prototype.isRangeNode=!0,n.prototype.needsEnd=function(){return 0<this.filter(function(e){return le(e)&&"end"===e.name}).length},n.prototype._compile=function(e,t){var n,i=e.range,a=this.start._compile(e,t),o=this.end._compile(e,t);return this.step?(n=this.step._compile(e,t),function(e,t,r){return i(a(e,t,r),o(e,t,r),n(e,t,r))}):function(e,t,r){return i(a(e,t,r),o(e,t,r))}},n.prototype.forEach=function(e){e(this.start,"start",this),e(this.end,"end",this),this.step&&e(this.step,"step",this)},n.prototype.map=function(e){return new n(this._ifNode(e(this.start,"start",this)),this._ifNode(e(this.end,"end",this)),this.step&&this._ifNode(e(this.step,"step",this)))},n.prototype.clone=function(){return new n(this.start,this.end,this.step&&this.step)},n.prototype._toString=function(e){var t=i(this,e&&e.parenthesis?e.parenthesis:"keep"),r=this.start.toString(e),r=r=t.start?"("+r+")":r,n=(this.step&&(n=this.step.toString(e),r+=":"+(n=t.step?"("+n+")":n)),this.end.toString(e));return r+":"+(n=t.end?"("+n+")":n)},n.prototype.toJSON=function(){return{mathjs:"RangeNode",start:this.start,end:this.end,step:this.step}},n.fromJSON=function(e){return new n(e.start,e.end,e.step)},n.prototype.toHTML=function(e){var t=i(this,e&&e.parenthesis?e.parenthesis:"keep"),r=this.start.toHTML(e),r=r=t.start?'<span class="math-parenthesis math-round-parenthesis">(</span>'+r+'<span class="math-parenthesis math-round-parenthesis">)</span>':r,n=(this.step&&(n=this.step.toHTML(e),r+='<span class="math-operator math-range-operator">:</span>'+(n=t.step?'<span class="math-parenthesis math-round-parenthesis">(</span>'+n+'<span class="math-parenthesis math-round-parenthesis">)</span>':n)),this.end.toHTML(e));return r+'<span class="math-operator math-range-operator">:</span>'+(n=t.end?'<span class="math-parenthesis math-round-parenthesis">(</span>'+n+'<span class="math-parenthesis math-round-parenthesis">)</span>':n)},n.prototype._toTex=function(e){var t=i(this,e&&e.parenthesis?e.parenthesis:"keep"),r=this.start.toTex(e),n=(t.start&&(r="\\left(".concat(r,"\\right)")),this.step&&(n=this.step.toTex(e),r+=":"+(n=t.step?"\\left(".concat(n,"\\right)"):n)),this.end.toTex(e));return r+":"+(n=t.end?"\\left(".concat(n,"\\right)"):n)},n},{isClass:!0,isNode:!0}),js=l("RelationalNode",["Node"],function(e){e=e.Node;function i(e,t){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(!Array.isArray(e))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(t))throw new TypeError("Parameter params must be an array");if(e.length!==t.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=e,this.params=t}return(i.prototype=new e).type="RelationalNode",i.prototype.isRelationalNode=!0,i.prototype._compile=function(o,t){var s=this,u=this.params.map(function(e){return e._compile(o,t)});return function(e,t,r){for(var n,i=u[0](e,t,r),a=0;a<s.conditionals.length;a++)if(n=i,i=u[a+1](e,t,r),!ft(o,s.conditionals[a])(n,i))return!1;return!0}},i.prototype.forEach=function(r){var n=this;this.params.forEach(function(e,t){return r(e,"params["+t+"]",n)},this)},i.prototype.map=function(r){var n=this;return new i(this.conditionals.slice(),this.params.map(function(e,t){return n._ifNode(r(e,"params["+t+"]",n))},this))},i.prototype.clone=function(){return new i(this.conditionals,this.params)},i.prototype._toString=function(n){for(var i=n&&n.parenthesis?n.parenthesis:"keep",a=v(this,i),e=this.params.map(function(e,t){var r=v(e,i);return"all"===i||null!==r&&r<=a?"("+e.toString(n)+")":e.toString(n)}),t={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="},r=e[0],o=0;o<this.conditionals.length;o++)r+=" "+t[this.conditionals[o]]+" "+e[o+1];return r},i.prototype.toJSON=function(){return{mathjs:"RelationalNode",conditionals:this.conditionals,params:this.params}},i.fromJSON=function(e){return new i(e.conditionals,e.params)},i.prototype.toHTML=function(n){for(var i=n&&n.parenthesis?n.parenthesis:"keep",a=v(this,i),e=this.params.map(function(e,t){var r=v(e,i);return"all"===i||null!==r&&r<=a?'<span class="math-parenthesis math-round-parenthesis">(</span>'+e.toHTML(n)+'<span class="math-parenthesis math-round-parenthesis">)</span>':e.toHTML(n)}),t={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="},r=e[0],o=0;o<this.conditionals.length;o++)r+='<span class="math-operator math-binary-operator math-explicit-binary-operator">'+De(t[this.conditionals[o]])+"</span>"+e[o+1];return r},i.prototype._toTex=function(n){for(var i=n&&n.parenthesis?n.parenthesis:"keep",a=v(this,i),e=this.params.map(function(e,t){var r=v(e,i);return"all"===i||null!==r&&r<=a?"\\left("+e.toTex(n)+"\right)":e.toTex(n)}),t=e[0],r=0;r<this.conditionals.length;r++)t+=w[this.conditionals[r]]+e[r+1];return t},i},{isClass:!0,isNode:!0}),Ps=l("SymbolNode",["math","?Unit","Node"],function(e){var r=e.math,o=e.Unit,e=e.Node;function s(e){return!!o&&o.isValuelessUnit(e)}function u(e){if(!(this instanceof u))throw new SyntaxError("Constructor must be called with the new operator");if("string"!=typeof e)throw new TypeError('String expected for parameter "name"');this.name=e}return(u.prototype=new e).type="SymbolNode",u.prototype.isSymbolNode=!0,u.prototype._compile=function(n,e){var i=this.name;if(!0===e[i])return function(e,t,r){return t[i]};if(i in n)return function(e,t,r){return e.has(i)?e.get(i):ft(n,i)};var a=s(i);return function(e,t,r){return e.has(i)?e.get(i):a?new o(null,i):u.onUndefinedSymbol(i)}},u.prototype.forEach=function(e){},u.prototype.map=function(e){return this.clone()},u.onUndefinedSymbol=function(e){throw new Error("Undefined symbol "+e)},u.prototype.clone=function(){return new u(this.name)},u.prototype._toString=function(e){return this.name},u.prototype.toHTML=function(e){var t=De(this.name);return"true"===t||"false"===t?'<span class="math-symbol math-boolean">'+t+"</span>":"i"===t?'<span class="math-symbol math-imaginary-symbol">'+t+"</span>":"Infinity"===t?'<span class="math-symbol math-infinity-symbol">'+t+"</span>":"NaN"===t?'<span class="math-symbol math-nan-symbol">'+t+"</span>":"null"===t?'<span class="math-symbol math-null-symbol">'+t+"</span>":"undefined"===t?'<span class="math-symbol math-undefined-symbol">'+t+"</span>":'<span class="math-symbol">'+t+"</span>"},u.prototype.toJSON=function(){return{mathjs:"SymbolNode",name:this.name}},u.fromJSON=function(e){return new u(e.name)},u.prototype._toTex=function(e){var t=!1,t=(void 0===r[this.name]&&s(this.name)&&(t=!0),_s(this.name,t));return"\\"===t[0]?t:" "+t},u},{isClass:!0,isNode:!0});function Fs(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return"function"==typeof e.createSubScope?Et.apply(void 0,[e.createSubScope()].concat(r)):Et.apply(void 0,[wt(),e].concat(r))}var Us=l("FunctionNode",["math","Node","SymbolNode"],function(e){var i=e.math,t=e.Node,r=e.SymbolNode;function y(e,t){if(!(this instanceof y))throw new SyntaxError("Constructor must be called with the new operator");if(!L(e="string"==typeof e?new r(e):e))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(t)||!t.every(L))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=e,this.args=t||[],Object.defineProperty(this,"name",{get:function(){return this.fn.name||""}.bind(this),set:function(){throw new Error("Cannot assign a new name, name is read-only")}})}(y.prototype=new t).type="FunctionNode",y.prototype.isFunctionNode=!0;function g(e){return re(e,{truncate:78})}y.prototype._compile=function(a,t){if(!(this instanceof y))throw new TypeError("No valid FunctionNode");var o,s,u,c=this.args.map(function(e){return e._compile(a,t)});if(!le(this.fn)){if(he(this.fn)&&J(this.fn.index)&&this.fn.index.isObjectProperty())return o=this.fn.object._compile(a,t),s=this.fn.index.getObjectProperty(),u=this.args,function(t,r,n){var e=o(t,r,n),i=s;if(!mt(e,i))throw new Error('No access to method "'+i+'"');if(e[s]&&e[s].rawArgs)return e[s](u,a,Fs(t,r),t);i=c.map(function(e){return e(t,r,n)});return e[s].apply(e,i)};var f=this.fn.toString(),l=this.fn._compile(a,t),p=this.args;return function(t,r,n){var e=l(t,r,n);if("function"!=typeof e)throw new TypeError("Expression '".concat(f,"' did not evaluate to a function; value is:")+"\n  ".concat(g(e)));if(e.rawArgs)return e(p,a,Fs(t,r),t);var i=c.map(function(e){return e(t,r,n)});return e.apply(e,i)}}var m,h=this.fn.name;if(t[h])return m=this.args,function(t,r,n){var e=r[h];if("function"!=typeof e)throw new TypeError("Argument '".concat(h,"' was not a function; received: ").concat(g(e)));if(e.rawArgs)return e(m,a,Fs(t,r),t);var i=c.map(function(e){return e(t,r,n)});return e.apply(e,i)};function d(e){var t;if(e.has(h))t=e.get(h);else{if(!(h in a))return y.onUndefinedFunction(h);t=ft(a,h)}if("function"==typeof t)return t;throw new TypeError("'".concat(h,"' is not a function; its value is:\n  ").concat(g(t)))}var n,e=h in a?ft(a,h):void 0,e="function"==typeof e&&!0===e.rawArgs;if(e)return n=this.args,function(e,t,r){return d(e)(n,a,Fs(e,t),e)};switch(c.length){case 0:return function(e,t,r){return d(e)()};case 1:return function(e,t,r){return d(e)((0,c[0])(e,t,r))};case 2:return function(e,t,r){var n=d(e),i=c[0],a=c[1];return n(i(e,t,r),a(e,t,r))};default:return function(t,r,n){var e=d(t),i=c.map(function(e){return e(t,r,n)});return e.apply(void 0,Vi()(i))}}},y.prototype.forEach=function(e){e(this.fn,"fn",this);for(var t=0;t<this.args.length;t++)e(this.args[t],"args["+t+"]",this)},y.prototype.map=function(e){for(var t=this._ifNode(e(this.fn,"fn",this)),r=[],n=0;n<this.args.length;n++)r[n]=this._ifNode(e(this.args[n],"args["+n+"]",this));return new y(t,r)},y.prototype.clone=function(){return new y(this.fn,this.args.slice(0))},y.onUndefinedFunction=function(e){throw new Error("Undefined function "+e)};var n=y.prototype.toString;function a(e,t,r){for(var n,i="",a=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,o=0;null!==(n=a.exec(e));)if(i+=e.substring(o,n.index),o=n.index,"$$"===n[0])i+="$",o++;else{o+=n[0].length;var s=t[n[1]];if(!s)throw new ReferenceError("Template: Property "+n[1]+" does not exist.");if(void 0===n[2])switch(Z()(s)){case"string":i+=s;break;case"object":if(L(s))i+=s.toTex(r);else{if(!Array.isArray(s))throw new TypeError("Template: "+n[1]+" has to be a Node, String or array of Nodes");i+=s.map(function(e,t){if(L(e))return e.toTex(r);throw new TypeError("Template: "+n[1]+"["+t+"] is not a Node.")}).join(",")}break;default:throw new TypeError("Template: "+n[1]+" has to be a Node, String or array of Nodes")}else{if(!L(s[n[2]]&&s[n[2]]))throw new TypeError("Template: "+n[1]+"["+n[2]+"] is not a Node.");i+=s[n[2]].toTex(r)}}return i+e.slice(o)}y.prototype.toString=function(e){var t,r=this.fn.toString(e);return void 0!==(t=e&&"object"===Z()(e.handler)&&pe(e.handler,r)?e.handler[r](this,e):t)?t:n.call(this,e)},y.prototype._toString=function(t){var e=this.args.map(function(e){return e.toString(t)});return(Y(this.fn)?"("+this.fn.toString(t)+")":this.fn.toString(t))+"("+e.join(", ")+")"},y.prototype.toJSON=function(){return{mathjs:"FunctionNode",fn:this.fn,args:this.args}},y.fromJSON=function(e){return new y(e.fn,e.args)},y.prototype.toHTML=function(t){var e=this.args.map(function(e){return e.toHTML(t)});return'<span class="math-function">'+De(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+e.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'};var o=y.prototype.toTex;return y.prototype.toTex=function(e){var t;return void 0!==(t=e&&"object"===Z()(e.handler)&&pe(e.handler,this.name)?e.handler[this.name](this,e):t)?t:o.call(this,e)},y.prototype._toTex=function(t){var e,r,n=this.args.map(function(e){return e.toTex(t)});switch(Os[this.name]&&(e=Os[this.name]),!i[this.name]||"function"!=typeof i[this.name].toTex&&"object"!==Z()(i[this.name].toTex)&&"string"!=typeof i[this.name].toTex||(e=i[this.name].toTex),Z()(e)){case"function":r=e(this,t);break;case"string":r=a(e,this,t);break;case"object":switch(Z()(e[n.length])){case"function":r=e[n.length](this,t);break;case"string":r=a(e[n.length],this,t)}}return void 0!==r?r:a("\\mathrm{${name}}\\left(${args}\\right)",this,t)},y.prototype.getIdentifier=function(){return this.type+":"+this.name},y},{isClass:!0,isNode:!0}),Ls=l("parse",["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],function(e){var B=e.typed,v=e.numeric,D=e.config,i=e.AccessorNode,x=e.ArrayNode,o=e.AssignmentNode,j=e.BlockNode,P=e.ConditionalNode,b=e.ConstantNode,F=e.FunctionAssignmentNode,U=e.FunctionNode,a=e.IndexNode,L=e.ObjectNode,s=e.OperatorNode,$=e.ParenthesisNode,n=e.RangeNode,H=e.RelationalNode,w=e.SymbolNode,u=B("parse",{string:function(e){return g(e,{})},"Array | Matrix":function(e){return t(e,{})},"string, Object":function(e,t){return g(e,void 0!==t.nodes?t.nodes:{})},"Array | Matrix, Object":t});function t(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=void 0!==t.nodes?t.nodes:{};return me(e,function(e){if("string"!=typeof e)throw new TypeError("String expected");return g(e,r)})}var c=0,N=1,M=2,E=3,G=4,f={",":!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},S={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},A={true:!0,false:!1,null:null,undefined:void 0},V=["NaN","Infinity"];function l(e,t){return e.expression.substr(e.index,t)}function p(e){return l(e,1)}function m(e){e.index++}function h(e){return e.expression.charAt(e.index-1)}function d(e){return e.expression.charAt(e.index+1)}function O(e){for(e.tokenType=c,e.token="",e.comment="";;){if("#"===p(e))for(;"\n"!==p(e)&&""!==p(e);)e.comment+=p(e),m(e);if(!u.isWhitespace(p(e),e.nestingLevel))break;m(e)}if(""!==p(e)){if("\n"===p(e)&&!e.nestingLevel)return e.tokenType=N,e.token=p(e),m(e);var t=p(e),r=l(e,2),n=l(e,3);if(3===n.length&&f[n])return e.tokenType=N,e.token=n,m(e),m(e),m(e);if(2===r.length&&f[r])return e.tokenType=N,e.token=r,m(e),m(e);if(f[t])return e.tokenType=N,e.token=t,m(e);if(u.isDigitDot(t)){e.tokenType=M;n=l(e,2);if("0b"===n||"0o"===n||"0x"===n){for(e.token+=p(e),m(e),e.token+=p(e),m(e);u.isHexDigit(p(e));)e.token+=p(e),m(e);if("."===p(e))for(e.token+=".",m(e);u.isHexDigit(p(e));)e.token+=p(e),m(e);else if("i"===p(e))for(e.token+="i",m(e);u.isDigit(p(e));)e.token+=p(e),m(e)}else{if("."===p(e)){if(e.token+=p(e),m(e),!u.isDigit(p(e)))return e.tokenType=N}else{for(;u.isDigit(p(e));)e.token+=p(e),m(e);u.isDecimalMark(p(e),d(e))&&(e.token+=p(e),m(e))}for(;u.isDigit(p(e));)e.token+=p(e),m(e);if("E"===p(e)||"e"===p(e))if(u.isDigit(d(e))||"-"===d(e)||"+"===d(e)){if(e.token+=p(e),m(e),"+"!==p(e)&&"-"!==p(e)||(e.token+=p(e),m(e)),!u.isDigit(p(e)))throw q(e,'Digit expected, got "'+p(e)+'"');for(;u.isDigit(p(e));)e.token+=p(e),m(e);if(u.isDecimalMark(p(e),d(e)))throw q(e,'Digit expected, got "'+p(e)+'"')}else if("."===d(e))throw m(e),q(e,'Digit expected, got "'+p(e)+'"')}}else{if(!u.isAlpha(p(e),h(e),d(e))){for(e.tokenType=G;""!==p(e);)e.token+=p(e),m(e);throw q(e,'Syntax error in part "'+e.token+'"')}for(;u.isAlpha(p(e),h(e),d(e))||u.isDigit(p(e));)e.token+=p(e),m(e);pe(S,e.token)?e.tokenType=N:e.tokenType=E}}else e.tokenType=N}function y(e){for(;O(e),"\n"===e.token;);}function C(e){e.nestingLevel++}function T(e){e.nestingLevel--}function g(e,t){var r={extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:c,nestingLevel:0,conditionalLevel:null},e=(Xa()(r,{expression:e,extraNodes:t}),O(r),function(e){var t,r=[];for(""!==e.token&&"\n"!==e.token&&";"!==e.token&&((t=_(e)).comment=e.comment);"\n"===e.token||";"===e.token;)0===r.length&&t&&r.push({node:t,visible:";"!==e.token}),O(e),"\n"!==e.token&&";"!==e.token&&""!==e.token&&((t=_(e)).comment=e.comment,r.push({node:t,visible:";"!==e.token}));return 0<r.length?new j(r):(t||((t=new b(void 0)).comment=e.comment),t)}(r));if(""!==r.token)throw r.tokenType===N?ue(r,"Unexpected operator "+r.token):q(r,'Unexpected part "'+r.token+'"');return e}function _(e){var t,r,n,i,a=function(e){for(var t=function(e){for(var t=I(e);"or"===e.token;)y(e),t=new s("or","or",[t,I(e)]);return t}(e);"?"===e.token;){var r=e.conditionalLevel,n=(e.conditionalLevel=e.nestingLevel,y(e),t),i=_(e);if(":"!==e.token)throw q(e,"False part of conditional expression expected");e.conditionalLevel=null,y(e);var a=_(e),t=new P(n,i,a);e.conditionalLevel=r}return t}(e);if("="!==e.token)return a;if(le(a))return t=a.name,y(e),n=_(e),new o(new w(t),n);if(he(a))return y(e),n=_(e),new o(a.object,a.index,n);if(de(a)&&le(a.fn)&&(i=!0,r=[],t=a.name,a.args.forEach(function(e,t){le(e)?r[t]=e.name:i=!1}),i))return y(e),n=_(e),new F(t,r,n);throw q(e,"Invalid left hand side of assignment operator =")}function I(e){for(var t=r(e);"xor"===e.token;)y(e),t=new s("xor","xor",[t,r(e)]);return t}function r(e){for(var t=k(e);"and"===e.token;)y(e),t=new s("and","and",[t,k(e)]);return t}function k(e){for(var t=Z(e);"|"===e.token;)y(e),t=new s("|","bitOr",[t,Z(e)]);return t}function Z(e){for(var t=W(e);"^|"===e.token;)y(e),t=new s("^|","bitXor",[t,W(e)]);return t}function W(e){for(var t=Y(e);"&"===e.token;)y(e),t=new s("&","bitAnd",[t,Y(e)]);return t}function Y(e){for(var t=[J(e)],r=[],n={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};pe(n,e.token);){var i={name:e.token,fn:n[e.token]};r.push(i),y(e),t.push(J(e))}return 1===t.length?t[0]:2===t.length?new s(r[0].name,r[0].fn,t):new H(r.map(function(e){return e.fn}),t)}function J(e){for(var t,r,n,i=X(e),a={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};pe(a,e.token);)r=a[t=e.token],y(e),n=[i,X(e)],i=new s(t,r,n);return i}function X(e){for(var t,r,n,i=Q(e),a={to:"to",in:"to"};pe(a,e.token);)r=a[t=e.token],y(e),i="in"===t&&""===e.token?new s("*","multiply",[i,new w("in")],!0):(n=[i,Q(e)],new s(t,r,n));return i}function Q(e){var t=[],r=":"===e.token?new b(1):K(e);if(":"===e.token&&e.conditionalLevel!==e.nestingLevel){for(t.push(r);":"===e.token&&t.length<3;)y(e),")"===e.token||"]"===e.token||","===e.token||""===e.token?t.push(new w("end")):t.push(K(e));r=3===t.length?new n(t[0],t[2],t[1]):new n(t[0],t[1])}return r}function K(e){var t,r;a=ee(e);for(var n={"+":"add","-":"subtract"};pe(n,e.token);){r=n[t=e.token],y(e);var i=ee(e),i=i.isPercentage?[a,new s("*","multiply",[a,i])]:[a,i],a=new s(t,r,i)}return a}function ee(e){t=te(e);for(var t,r,n,i,a={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};pe(a,e.token);)n=a[r=e.token],y(e),i=te(e),t=new s(r,n,[t,i]);return t}function te(e){for(var t,r=t=re(e);e.tokenType===E||"in"===e.token&&ce(t)||!(e.tokenType!==M||ce(r)||fe(r)&&"!"!==r.op)||"("===e.token;)r=re(e),t=new s("*","multiply",[t,r],!0);return t}function re(e){for(var t=ne(e),r=t,n=[];"/"===e.token&&ce(r);){if(n.push(Xa()({},e)),y(e),e.tokenType!==M){Xa()(e,n.pop());break}if(n.push(Xa()({},e)),y(e),e.tokenType!==E&&"("!==e.token){n.pop(),Xa()(e,n.pop());break}Xa()(e,n.pop()),n.pop(),r=ne(e),t=new s("/","divide",[t,r])}return t}function ne(e){for(var t,r,n,i=z(e),a={"%":"mod",mod:"mod"};pe(a,e.token);)r=a[t=e.token],y(e),i="%"===t&&e.tokenType===N&&"("!==e.token?new s("/","divide",[i,new b(100)],!1,!0):(n=[i,z(e)],new s(t,r,n));return i}function z(e){var t,r,n={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return pe(n,e.token)?(n=n[e.token],t=e.token,y(e),r=[z(e)],new s(t,n,r)):(n=function(e){for(var t,r,n=function(e){var t,r,n,i=[];if(e.tokenType===E&&pe(e.extraNodes,e.token)){var a=e.extraNodes[e.token];if(O(e),"("===e.token){if(i=[],C(e),O(e),")"!==e.token)for(i.push(_(e));","===e.token;)O(e),i.push(_(e));if(")"!==e.token)throw q(e,"Parenthesis ) expected");T(e),O(e)}return new a(i)}a=e;if(a.tokenType===E||a.tokenType===N&&a.token in S)return o=a.token,O(a),R(a,pe(A,o)?new b(A[o]):-1!==V.indexOf(o)?new b(v(o,"number")):new w(o));var o=a;if('"'===o.token)return s=ie(o),R(o,new b(s));var s=o;if("'"===s.token)return d=ae(s),R(s,new b(d));var u=s;if("["!==u.token){var c=u;if("{"!==c.token){var f,l=c;if(l.tokenType===M)return p=l.token,O(l),new b(v(p,D.number));var p=l;if("("!==p.token)throw""===(f=p).token?q(f,"Unexpected end of expression"):q(f,"Value expected");if(C(p),O(p),f=_(p),")"!==p.token)throw q(p,"Parenthesis ) expected");return T(p),O(p),R(p,f=new $(f))}C(c);var m,h={};do{if(O(c),"}"!==c.token){if('"'===c.token)m=ie(c);else if("'"===c.token)m=ae(c);else{if(!(c.tokenType===E||c.tokenType===N&&c.token in S))throw q(c,"Symbol or string expected as object key");m=c.token,O(c)}if(":"!==c.token)throw q(c,"Colon : expected after object key");O(c),h[m]=_(c)}}while(","===c.token);if("}"!==c.token)throw q(c,"Comma , or bracket } expected after object value");return T(c),O(c),l=new L(h),R(c,l)}if(C(u),O(u),"]"!==u.token){var d=oe(u);if(";"===u.token){for(n=1,r=[d];";"===u.token;)O(u),r[n]=oe(u),n++;if("]"!==u.token)throw q(u,"End of matrix ] expected");T(u),O(u);for(var y=r[0].items.length,g=1;g<n;g++)if(r[g].items.length!==y)throw ue(u,"Column dimensions mismatch ("+r[g].items.length+" !== "+y+")");t=new x(r)}else{if("]"!==u.token)throw q(u,"End of matrix ] expected");T(u),O(u),t=d}}else T(u),O(u),t=new x([]);return R(u,t)}(e),i={"!":"factorial","'":"ctranspose"};pe(i,e.token);)r=i[t=e.token],O(e),n=R(e,n=new s(t,r,[n]));return n}(t=e),"^"!==t.token&&".^"!==t.token||(e="^"===(r=t.token)?"pow":"dotPow",y(t),t=[n,z(t)],n=new s(r,e,t)),n)}function R(e,t,r){for(var n;!("("!==e.token&&"["!==e.token&&"."!==e.token||r&&-1===r.indexOf(e.token));)if(n=[],"("===e.token){if(!le(t)&&!he(t))return t;if(C(e),O(e),")"!==e.token)for(n.push(_(e));","===e.token;)O(e),n.push(_(e));if(")"!==e.token)throw q(e,"Parenthesis ) expected");T(e),O(e),t=new U(t,n)}else if("["===e.token){if(C(e),O(e),"]"!==e.token)for(n.push(_(e));","===e.token;)O(e),n.push(_(e));if("]"!==e.token)throw q(e,"Parenthesis ] expected");T(e),O(e),t=new i(t,new a(n))}else{if(O(e),e.tokenType!==E)throw q(e,"Property name expected after dot");n.push(new b(e.token)),O(e),t=new i(t,new a(n,!0))}return t}function ie(e){for(var t="";""!==p(e)&&'"'!==p(e);)"\\"===p(e)&&(t+=p(e),m(e)),t+=p(e),m(e);if(O(e),'"'!==e.token)throw q(e,'End of string " expected');return O(e),JSON.parse('"'+t+'"')}function ae(e){for(var t="";""!==p(e)&&"'"!==p(e);)"\\"===p(e)&&(t+=p(e),m(e)),t+=p(e),m(e);if(O(e),"'"!==e.token)throw q(e,"End of string ' expected");return O(e),JSON.parse('"'+t+'"')}function oe(e){for(var t=[_(e)],r=1;","===e.token;)O(e),t[r]=_(e),r++;return new x(t)}function se(e){return e.index-e.token.length+1}function q(e,t){e=se(e),t=new SyntaxError(t+" (char "+e+")");return t.char=e,t}function ue(e,t){e=se(e),t=new SyntaxError(t+" (char "+e+")");return t.char=e,t}return u.isAlpha=function(e,t,r){return u.isValidLatinOrGreek(e)||u.isValidMathSymbol(e,r)||u.isValidMathSymbol(t,e)},u.isValidLatinOrGreek=function(e){return/^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(e)},u.isValidMathSymbol=function(e,t){return/^[\uD835]$/.test(e)&&/^[\uDC00-\uDFFF]$/.test(t)&&/^[^\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(t)},u.isWhitespace=function(e,t){return" "===e||"\t"===e||"\n"===e&&0<t},u.isDecimalMark=function(e,t){return"."===e&&"/"!==t&&"*"!==t&&"^"!==t},u.isDigitDot=function(e){return"0"<=e&&e<="9"||"."===e},u.isDigit=function(e){return"0"<=e&&e<="9"},u.isHexDigit=function(e){return"0"<=e&&e<="9"||"a"<=e&&e<="f"||"A"<=e&&e<="F"},u}),$s=l("compile",["typed","parse"],function(e){var t=e.typed,r=e.parse;return t("compile",{string:function(e){return r(e).compile()},"Array | Matrix":function(e){return me(e,function(e){return r(e).compile()})}})}),Hs=l("evaluate",["typed","parse"],function(e){var t=e.typed,r=e.parse;return t("evaluate",{string:function(e){var t=wt();return r(e).compile().evaluate(t)},"string, Map | Object":function(e,t){return r(e).compile().evaluate(t)},"Array | Matrix":function(e){var t=wt();return me(e,function(e){return r(e).compile().evaluate(t)})},"Array | Matrix, Map | Object":function(e,t){return me(e,function(e){return r(e).compile().evaluate(t)})}})}),Gs=l("Parser",["evaluate"],function(e){var t=e.evaluate;function r(){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:wt(),writable:!1})}return r.prototype.type="Parser",r.prototype.isParser=!0,r.prototype.evaluate=function(e){return t(e,this.scope)},r.prototype.get=function(e){if(this.scope.has(e))return this.scope.get(e)},r.prototype.getAll=function(){var e=this.scope;if(e instanceof xt)return e.wrappedObject;var t,r={},n=gt(e.keys());try{for(n.s();!(t=n.n()).done;){var i=t.value;lt(r,i,e.get(i))}}catch(e){n.e(e)}finally{n.f()}return r},r.prototype.getAllAsMap=function(){return this.scope},r.prototype.set=function(e,t){return this.scope.set(e,t),t},r.prototype.remove=function(e){this.scope.delete(e)},r.prototype.clear=function(){this.scope.clear()},r},{isClass:!0}),Vs=l("parser",["typed","Parser"],function(e){var t=e.typed,r=e.Parser;return t("parser",{"":function(){return new r}})}),Zs=l("lup",["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtract","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],function(e){var t=e.typed,r=e.matrix,A=e.abs,w=e.addScalar,O=e.divideScalar,C=e.multiplyScalar,N=e.subtract,T=e.larger,_=e.equalScalar,I=e.unaryMinus,M=e.DenseMatrix,k=e.SparseMatrix,z=e.Spa;return t("lup",{DenseMatrix:n,SparseMatrix:function(e){var c,f,l,p=e._size[0],t=e._size[1],r=Math.min(p,t),m=e._values,h=e._index,d=e._ptr,y=[],g=[],v=[],x=[p,r],b=[],w=[],N=[],M=[r,t],E=[],S=[];for(c=0;c<p;c++)E[c]=c,S[c]=c;for(f=0;f<t;f++)!function(){var i=new z,e=(f<p&&(v.push(y.length),y.push(1),g.push(f)),N.push(b.length),d[f]),t=d[f+1];for(l=e;l<t;l++)c=h[l],i.set(E[c],m[l]);0<f&&i.forEach(0,f-1,function(r,n){k._forEachRow(r,y,g,v,function(e,t){r<e&&i.accumulate(e,I(C(t,n)))})});var r,n,a,o=f,s=i.get(f),u=A(s);i.forEach(f+1,p-1,function(e,t){var r=A(t);T(r,u)&&(o=e,u=r,s=t)}),f!==o&&(k._swapRows(f,o,x[1],y,g,v),k._swapRows(f,o,M[1],b,w,N),i.swap(f,o),e=o,n=S[r=f],a=S[e],E[n]=e,E[a]=r,S[r]=a,S[e]=n),i.forEach(0,p-1,function(e,t){e<=f?(b.push(t),w.push(e)):(t=O(t,s),_(t,0)||(y.push(t),g.push(e)))})}();return N.push(b.length),v.push(y.length),{L:new k({values:y,index:g,ptr:v,size:x}),U:new k({values:b,index:w,ptr:N,size:M}),p:E,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\nP: "+this.p}}},Array:function(e){e=n(r(e));return{L:e.L.valueOf(),U:e.U.valueOf(),p:e.p}}});function n(e){var t,r=e._size[0],n=e._size[1],i=Math.min(r,n),a=ne(e._data),o=[],e=[r,i],s=[],u=[i,n],c=[];for(y=0;y<r;y++)c[y]=y;for(t=0;t<n;t++){if(0<t)for(y=0;y<r;y++){for(var f=Math.min(y,t),l=0,p=0;p<f;p++)l=w(l,C(a[y][p],a[p][t]));a[y][t]=N(a[y][t],l)}for(var m=t,h=0,d=0,y=t;y<r;y++){var g=a[y][t],v=A(g);T(v,h)&&(m=y,h=v,d=g)}if(t!==m&&(c[t]=[c[m],c[m]=c[t]][0],M._swapRows(t,m,a)),t<r)for(y=t+1;y<r;y++){var x=a[y][t];_(x,0)||(a[y][t]=O(a[y][t],d))}}for(t=0;t<n;t++)for(y=0;y<r;y++)0===t&&(y<n&&(s[y]=[]),o[y]=[]),y<t?(y<n&&(s[y][t]=a[y][t]),t<r&&(o[y][t]=0)):y!==t?(y<n&&(s[y][t]=0),t<r&&(o[y][t]=a[y][t])):(y<n&&(s[y][t]=a[y][t]),t<r&&(o[y][t]=1));var e=new M({data:o,size:e}),u=new M({data:s,size:u}),b=[];for(y=0,i=c.length;y<i;y++)b[c[y]]=y;return{L:e,U:u,p:b,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\nP: "+this.p}}}}),Ws=l("qr",["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtract","complex"],function(e){var t=e.typed,r=e.matrix,g=e.zeros,v=e.identity,x=e.isZero,b=e.equal,w=e.sign,N=e.sqrt,M=e.conj,E=e.unaryMinus,S=e.addScalar,A=e.divideScalar,O=e.multiplyScalar,C=e.subtract,o=e.complex;return Xa()(t("qr",{DenseMatrix:n,SparseMatrix:function(e){throw new Error("qr not implemented for sparse matrices yet")},Array:function(e){e=n(r(e));return{Q:e.Q.valueOf(),R:e.R.valueOf()}}}),{_denseQRimpl:s});function s(e){for(var t=e._size[0],r=e._size[1],n=v([t],"dense"),i=n._data,e=e.clone(),a=e._data,o=g([t],""),s=0;s<Math.min(r,t);++s){var u=a[s][s],c=E(b(u,0)?1:w(u)),f=M(c),l=0;for(m=s;m<t;m++)l=S(l,O(a[m][s],M(a[m][s])));c=O(c,N(l));if(!x(c)){for(var p=C(u,c),m=s+(o[s]=1);m<t;m++)o[m]=A(a[m][s],p);for(var h=E(M(A(p,c))),d=void 0,y=s;y<r;y++){for(d=0,m=s;m<t;m++)d=S(d,O(M(o[m]),a[m][y]));for(d=O(d,h),m=s;m<t;m++)a[m][y]=O(C(a[m][y],O(o[m],d)),f)}for(m=0;m<t;m++){for(d=0,y=s;y<t;y++)d=S(d,O(i[m][y],o[y]));for(d=O(d,h),y=s;y<t;++y)i[m][y]=A(C(i[m][y],O(d,M(o[y]))),f)}}}return{Q:n,R:e,toString:function(){return"Q: "+this.Q.toString()+"\nR: "+this.R.toString()}}}function n(e){var t=s(e),r=t.R._data;if(0<e._data.length)for(var n="Complex"===r[0][0].type?o(0):0,i=0;i<r.length;++i)for(var a=0;a<i&&a<(r[0]||[]).length;++a)r[i][a]=n;return t}});function Ys(e,t,r,n,i,a,o){var s=0;for(r[o]=e;0<=s;){var u=r[o+s],c=r[n+u];-1===c?(s--,a[t++]=u):(r[n+u]=r[i+c],r[o+ ++s]=c)}return t}var Js=l("csAmd",["add","multiply","transpose"],function(e){var ae=e.add,oe=e.multiply,se=e.transpose;return function(e,B){if(!B||e<=0||3<e)return null;for(var t=B._size,D=t[0],r=t[1],j=0,t=Math.max(16,10*Math.sqrt(r)),e=function(e,t,r,n,i){var a=se(t);if(1===e&&n===r)return ae(t,a);if(2!==e)return oe(a,t);for(var o=a._index,s=a._ptr,u=0,c=0;c<r;c++){var f=s[c];if(s[c]=u,!(s[c+1]-f>i))for(var l=s[c+1];f<l;f++)o[u++]=o[f]}return s[r]=u,t=se(a),oe(a,t)}(e,B,D,r,t=Math.min(r-2,t)),P=ce,n=e._values,i=e._index,F=e._ptr,U=e._size[1],a=0,o=0;o<U;o++){var s=F[o];for(F[o]=a;s<F[o+1];s++)P(i[s],o,n?n[s]:1,null)&&(i[a]=i[s],n&&(n[a]=n[s]),a++)}F[U]=a,i.splice(a,i.length-a),n&&n.splice(a,n.length-a);for(var u,c,L,f,$,l,p,m,H,G,h,d,y,g=e._index,v=e._ptr,V=v[r],Z=[],x=[],b=r+1,w=2*(r+1),N=3*(r+1),M=4*(r+1),E=5*(r+1),S=6*(r+1),W=7*(r+1),A=Z,O=function(e,t,r,n,i,a,o,s,u,c,f){for(var l=0;l<e;l++)r[0+l]=t[l+1]-t[l];for(var p=r[0+e]=0;p<=e;p++)r[n+p]=-1,i[p]=-1,r[a+p]=-1,r[o+p]=-1,r[s+p]=1,r[u+p]=1,r[c+p]=0,r[f+p]=r[0+p];var m=ue(0,0,r,u,e);return r[c+e]=-2,t[e]=-1,r[u+e]=0,m}(r,v,x,N,A,w,W,b,S,M,E),Y=function(e,t,r,n,i,a,o,s,u,c,f){for(var l=0,p=0;p<e;p++){var m,h=r[n+p];0===h?(r[i+p]=-2,l++,t[p]=-1,r[a+p]=0):o<h?(r[s+p]=0,r[i+p]=-1,l++,t[p]=-e-2,r[s+e]++):(-1!==(m=r[u+h])&&(c[m]=p),r[f+p]=r[u+h],r[u+h]=p)}return l}(r,v,x,E,M,S,t,b,N,A,w),C=0;Y<r;){for(c=-1;C<r&&-1===(c=x[N+C]);C++);-1!==x[w+c]&&(A[x[w+c]]=-1),x[N+C]=x[w+c];for(var J,T=x[M+c],X=x[b+c],_=(Y+=X,0),I=(x[b+c]=-X,v[c]),k=0===T?I:V,z=k,Q=1;Q<=T+1;Q++){for(l=T<Q?($=I,x[0+(f=c)]-T):($=v[f=g[I++]],x[0+f]),L=1;L<=l;L++)(p=x[b+(u=g[$++])])<=0||(_+=p,x[b+u]=-p,-1!==x[w+(g[z++]=u)]&&(A[x[w+u]]=A[u]),-1!==A[u]?x[w+A[u]]=x[w+u]:x[N+x[E+u]]=x[w+u]);f!==c&&(v[f]=-c-2,x[S+f]=0)}for(0!==T&&(V=z),x[E+c]=_,v[c]=k,x[0+c]=z-k,x[M+c]=-2,O=ue(O,j,x,S,r),m=k;m<z;m++)if(!((H=x[M+(u=g[m])])<=0))for(var K=O-(p=-x[b+u]),I=v[u],R=v[u]+H-1;I<=R;I++)x[S+(f=g[I])]>=O?x[S+f]-=p:0!==x[S+f]&&(x[S+f]=x[E+f]+K);for(m=k;m<z;m++){for(G=(R=v[u=g[m]])+x[M+u]-1,y=d=0,I=h=R;I<=G;I++)0!==x[S+(f=g[I])]&&(0<(J=x[S+f]-O)?(y+=J,d+=g[h++]=f):(v[f]=-c-2,x[S+f]=0));x[M+u]=h-R+1;var ee=h,te=R+x[0+u];for(I=1+G;I<te;I++){var re=x[b+(q=g[I])];re<=0||(y+=re,d+=g[h++]=q)}0===y?(v[u]=-c-2,_-=p=-x[b+u],X+=p,Y+=p,x[b+u]=0,x[M+u]=-1):(x[E+u]=Math.min(x[E+u],y),g[h]=g[ee],g[ee]=g[R],g[R]=c,x[0+u]=h-R+1,x[w+u]=x[W+(d=(d<0?-d:d)%r)],A[x[W+d]=u]=d)}for(x[E+c]=_,O=ue(O+(j=Math.max(j,_)),j,x,S,r),m=k;m<z;m++)if(!(0<=x[b+(u=g[m])]))for(u=x[W+(d=A[u])],x[W+d]=-1;-1!==u&&-1!==x[w+u];u=x[w+u],O++){for(l=x[0+u],H=x[M+u],I=v[u]+1;I<=v[u]+l-1;I++)x[S+g[I]]=O;for(var ne=u,q=x[w+u];-1!==q;){var ie=x[0+q]===l&&x[M+q]===H;for(I=v[q]+1;ie&&I<=v[q]+l-1;I++)x[S+g[I]]!==O&&(ie=0);ie?(v[q]=-u-2,x[b+u]+=x[b+q],x[b+q]=0,x[M+q]=-1,q=x[w+q],x[w+ne]=q):q=x[w+(ne=q)]}}for(m=I=k;m<z;m++)(p=-x[b+(u=g[m])])<=0||(x[b+u]=p,y=x[E+u]+_-p,-1!==x[N+(y=Math.min(y,r-Y-p))]&&(A[x[N+y]]=u),x[w+u]=x[N+y],A[u]=-1,x[N+y]=u,C=Math.min(C,y),x[E+u]=y,g[I++]=u);x[b+c]=X,0==(x[0+c]=I-k)&&(v[c]=-1,x[S+c]=0),0!==T&&(V=I)}for(u=0;u<r;u++)v[u]=-v[u]-2;for(q=0;q<=r;q++)x[N+q]=-1;for(q=r;0<=q;q--)0<x[b+q]||(x[w+q]=x[N+v[q]],x[N+v[q]]=q);for(f=r;0<=f;f--)x[b+f]<=0||-1!==v[f]&&(x[w+f]=x[N+v[f]],x[N+v[f]]=f);for(u=c=0;u<=r;u++)-1===v[u]&&(c=Ys(u,c,x,N,w,Z,S));return Z.splice(Z.length-1,1),Z};function ue(e,t,r,n,i){if(e<2||e+t<0){for(var a=0;a<i;a++)0!==r[n+a]&&(r[n+a]=1);e=2}return e}function ce(e,t){return e!==t}});var Xs=l("csCounts",["transpose"],function(e){var S=e.transpose;return function(e,t,r,n){if(!e||!t||!r)return null;for(var i,a,o,s,u,c,f=e._size,l=f[0],p=f[1],m=4*p+(n?p+l+1:0),h=[],d=p,y=2*p,g=3*p,v=4*p,x=5*p+1,b=0;b<m;b++)h[b]=-1;var w=[],f=S(e),N=f._index,M=f._ptr;for(b=0;b<p;b++)for(w[a=r[b]]=-1===h[g+a]?1:0;-1!==a&&-1===h[g+a];a=t[a])h[g+a]=b;if(n){for(b=0;b<p;b++)h[r[b]]=b;for(i=0;i<l;i++){for(b=p,u=M[i],c=M[i+1],s=u;s<c;s++)b=Math.min(b,h[N[s]]);h[x+i]=h[v+b],h[v+b]=i}}for(i=0;i<p;i++)h[0+i]=i;for(b=0;b<p;b++){for(-1!==t[a=r[b]]&&w[t[a]]--,o=n?h[v+b]:a;-1!==o;o=n?h[x+o]:-1)for(s=M[o];s<M[o+1];s++){var E=function(e,t,r,n,i,a,o){var s,u,c,f=0;if(e<=t||r[n+t]<=r[i+e])return-1;if(r[i+e]=r[n+t],i=r[a+e],r[a+e]=t,-1===i)f=1,c=e;else{for(f=2,c=i;c!==r[o+c];c=r[o+c]);for(s=i;s!==c;s=u)u=r[o+s],r[o+s]=c}return{jleaf:f,q:c}}(i=N[s],a,h,g,d,y,0);1<=E.jleaf&&w[a]++,2===E.jleaf&&w[E.q]--}-1!==t[a]&&(h[0+a]=t[a])}for(a=0;a<p;a++)-1!==t[a]&&(w[t[a]]+=w[a]);return w}}),Qs=l("csSqr",["add","multiply","transpose"],function(e){var t=e.add,r=e.multiply,e=e.transpose,s=Js({add:t,multiply:r,transpose:e}),u=Xs({transpose:e});return function(e,t,r){var n,i=t._ptr,a=t._size[1],o={};if(o.q=s(e,t),e&&!o.q)return null;if(r){var x=e?function(e,t){e._values;for(var r=e._index,n=e._ptr,i=e._size,a=e._datatype,o=i[0],s=i[1],i=null,u=[],c=[],f=0,l=0;l<s;l++){c[l]=f;for(var p=t?t[l]:l,m=n[p],h=n[p+1],d=m;d<h;d++){var y=r[d];u[f]=y,f++}}return c[s]=f,e.createSparseMatrix({values:i,index:u,ptr:c,size:[o,s],datatype:a})}(t,o.q):t,r=(o.parent=function(){if(!x)return null;var e,t=x._index,r=x._ptr,n=x._size,i=n[0],a=n[1],o=[],s=[],u=a;for(h=0;h<i;h++)s[u+h]=-1;for(var c=0;c<a;c++){o[c]=-1,s[0+c]=-1;for(var f=r[c],l=r[c+1],p=f;p<l;p++){for(var m=t[p],h=s[u+m];-1!==h&&h<c;h=e)e=s[0+h],s[0+h]=c,-1===e&&(o[h]=c);s[u+m]=c}}return o}(),function(e,t){if(!e)return null;for(var r=0,n=[],i=[],a=t,o=2*t,s=0;s<t;s++)i[0+s]=-1;for(s=t-1;0<=s;s--)-1!==e[s]&&(i[a+s]=i[0+e[s]],i[0+e[s]]=s);for(s=0;s<t;s++)-1===e[s]&&(r=Ys(s,r,i,0,a,n,o));return n}(o.parent,a));if(o.cp=u(x,o.parent,r,1),x&&o.parent&&o.cp&&function(e){var t=x._ptr,r=x._index,n=x._size,i=n[0],a=n[1];e.pinv=[],e.leftmost=[];for(var o,s,u,c=e.parent,f=e.pinv,l=e.leftmost,p=[],m=i,h=i+a,d=i+2*a,y=0;y<a;y++)p[m+y]=-1,p[h+y]=-1,p[d+y]=0;for(v=0;v<i;v++)l[v]=-1;for(y=a-1;0<=y;y--)for(s=t[y],u=t[y+1],o=s;o<u;o++)l[r[o]]=y;for(v=i-1;0<=v;v--)(f[v]=-1)!==(y=l[v])&&(0==p[d+y]++&&(p[h+y]=v),p[0+v]=p[m+y],p[m+y]=v);for(e.lnz=0,e.m2=i,y=0;y<a;y++){var g,v=p[m+y];e.lnz++,--d[f[v=v<0?e.m2++:v]=y]<=0||(e.lnz+=p[d+y],-1!==(g=c[y])&&(0===p[d+g]&&(p[h+g]=p[h+y]),p[0+p[h+y]]=p[m+g],p[m+g]=p[0+v],p[d+g]+=p[d+y]))}for(v=0;v<i;v++)f[v]<0&&(f[v]=y++);return 1}(o))for(n=o.unz=0;n<a;n++)o.unz+=o.cp[n]}else o.unz=4*i[a]+a,o.lnz=o.unz;return o}});function Ks(e,t){e[t]=-e[t]-2}function eu(e){return e<0?-e-2:e}var tu=l("csSpsolve",["divideScalar","multiply","subtract"],function(e){var N=e.divideScalar,M=e.multiply,E=e.subtract;return function(e,p,m,t,r,n,i){for(var a,o,s,u=e._values,c=e._index,f=e._ptr,l=e._size[1],h=p._values,d=p._index,y=p._ptr,e=function(e,t,r){for(var n=e._ptr,i=e._size,a=p._index,o=p._ptr,s=i[1],u=s,i=o[m],c=o[m+1],f=i;f<c;f++){var l=a[f];n[l]<0||(u=function(e,t,r,n,i){var a,o=t._index,s=t._ptr,u=t._size[1],c=0;for(n[0]=e;0<=c;){e=n[c];for(var f=i?i[e]:e,l=(s[e]<0||(Ks(s,e),n[u+c]=f<0?0:eu(s[f])),1),p=n[u+c],m=f<0?0:eu(s[f+1]);p<m;p++)if(!(s[a=o[p]]<0)){n[u+c]=p,n[++c]=a,l=0;break}l&&(c--,n[--r]=e)}return r}(l,e,u,t,r))}for(f=u;f<s;f++)Ks(n,t[f]);return u}(e,t,n),g=e;g<l;g++)r[t[g]]=0;for(a=y[m],o=y[m+1],g=a;g<o;g++)r[d[g]]=h[g];for(var v=e;v<l;v++){var x=t[v],b=n?n[x]:x;if(!(b<0))for(a=f[b],o=f[b+1],r[x]=N(r[x],u[i?a:o-1]),g=i?a+1:a,s=i?o:o-1;g<s;g++){var w=c[g];r[w]=E(r[w],M(u[g],r[x]))}}return e}}),ru=l("csLu",["abs","divideScalar","multiply","subtract","larger","largerEq","SparseMatrix"],function(e){var A=e.abs,O=e.divideScalar,C=e.multiply,t=e.subtract,T=e.larger,_=e.largerEq,I=e.SparseMatrix,k=tu({divideScalar:O,multiply:C,subtract:t});return function(e,t,r){if(!e)return null;var n,i=e._size[1],a=100,o=100;t&&(n=t.q,a=t.lnz||a,o=t.unz||o);for(var s=[],u=[],c=[],f=new I({values:s,index:u,ptr:c,size:[i,i]}),l=[],p=[],m=[],t=new I({values:l,index:p,ptr:m,size:[i,i]}),h=[],d=[],y=[],g=0;g<i;g++)d[g]=0,h[g]=-1,c[g+1]=0;for(var a=0,o=0,v=0;v<i;v++){c[v]=a,m[v]=o;for(var x,b=n?n[v]:v,w=k(f,e,b,y,d,h,1),N=-1,M=-1,E=w;E<i;E++)h[g=y[E]]<0?(x=A(d[g]),T(x,M)&&(M=x,N=g)):(p[o]=h[g],l[o++]=d[g]);if(-1===N||M<=0)return null;var S=d[N=h[b]<0&&_(A(d[b]),C(M,r))?b:N];for(p[o]=v,l[o++]=S,h[N]=v,u[a]=N,s[a++]=1,E=w;E<i;E++)h[g=y[E]]<0&&(u[a]=g,s[a++]=O(d[g],S)),d[g]=0}for(c[i]=a,m[i]=o,E=0;E<a;E++)u[E]=h[u[E]];return s.splice(a,s.length-a),u.splice(a,u.length-a),l.splice(o,l.length-o),p.splice(o,p.length-o),{L:f,U:t,pinv:h}}}),nu=l("slu",["typed","abs","add","multiply","transpose","divideScalar","subtract","larger","largerEq","SparseMatrix"],function(e){var t=e.typed,r=e.abs,n=e.add,i=e.multiply,a=e.transpose,o=e.divideScalar,s=e.subtract,u=e.larger,c=e.largerEq,e=e.SparseMatrix,f=Qs({add:n,multiply:i,transpose:a}),l=ru({abs:r,divideScalar:o,multiply:i,subtract:s,larger:u,largerEq:c,SparseMatrix:e});return t("slu",{"SparseMatrix, number, number":function(e,t,r){if(!E(t)||t<0||3<t)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(r<0||1<r)throw new Error("Partial pivoting threshold must be a number from 0 to 1");t=f(t,e,!1),e=l(e,t,r);return{L:e.L,U:e.U,p:e.pinv,q:t.q,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\np: "+this.p.toString()+(this.q?"\nq: "+this.q.toString():"")+"\n"}}}})});function iu(e,t){var r,n=t.length,i=[];if(e)for(r=0;r<n;r++)i[e[r]]=t[r];else for(r=0;r<n;r++)i[r]=t[r];return i}var au=l("lusolve",["typed","matrix","lup","slu","usolve","lsolve","DenseMatrix"],function(e){var t=e.typed,r=e.matrix,n=e.lup,i=e.slu,a=e.usolve,o=e.lsolve,s=wa({DenseMatrix:e.DenseMatrix});return t("lusolve",{"Array, Array | Matrix":function(e,t){e=r(e);e=n(e);return c(e.L,e.U,e.p,null,t).valueOf()},"DenseMatrix, Array | Matrix":function(e,t){e=n(e);return c(e.L,e.U,e.p,null,t)},"SparseMatrix, Array | Matrix":function(e,t){e=n(e);return c(e.L,e.U,e.p,null,t)},"SparseMatrix, Array | Matrix, number, number":function(e,t,r,n){e=i(e,r,n);return c(e.L,e.U,e.p,e.q,t)},"Object, Array | Matrix":function(e,t){return c(e.L,e.U,e.p,e.q,t)}});function u(e){if(F(e))return e;if(x(e))return r(e);throw new TypeError("Invalid Matrix LU decomposition")}function c(e,t,r,n,i){e=u(e),t=u(t),r&&((i=s(e,i,!0))._data=iu(r,i._data));r=o(e,i),e=a(t,r);return n&&(e._data=iu(n,e._data)),e}}),ou=l("Help",["parse"],function(e){var o=e.parse;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!e)throw new Error('Argument "doc" missing');this.doc=e}return n.prototype.type="Help",n.prototype.isHelp=!0,n.prototype.toString=function(){var e=this.doc||{},t="\n";if(e.name&&(t+="Name: "+e.name+"\n\n"),e.category&&(t+="Category: "+e.category+"\n\n"),e.description&&(t+="Description:\n    "+e.description+"\n\n"),e.syntax&&(t+="Syntax:\n    "+e.syntax.join("\n    ")+"\n\n"),e.examples){t+="Examples:\n";for(var r={},n=0;n<e.examples.length;n++){var i=e.examples[n],a=(t+="    "+i+"\n",void 0);try{a=o(i).compile().evaluate(r)}catch(e){a=e}void 0===a||R(a)||(t+="        "+re(a,{precision:14})+"\n")}t+="\n"}return e.mayThrow&&e.mayThrow.length&&(t+="Throws: "+e.mayThrow.join(", ")+"\n\n"),e.seealso&&e.seealso.length&&(t+="See also: "+e.seealso.join(", ")+"\n"),t},n.prototype.toJSON=function(){var e=ne(this.doc);return e.mathjs="Help",e},n.fromJSON=function(t){var r={};return Object.keys(t).filter(function(e){return"mathjs"!==e}).forEach(function(e){r[e]=t[e]}),new n(r)},n.prototype.valueOf=n.prototype.toString,n},{isClass:!0}),su=l("Chain",["?on","math"],function(e){var t=e.on,e=e.math;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");se(e)?this.value=e.value:this.value=e}function i(e,t){at(n.prototype,e,function(){var e=t();if("function"==typeof e)return a(e)})}function a(r){return function(){for(var e=[this.value],t=0;t<arguments.length;t++)e[t+1]=arguments[t];return new n(r.apply(r,e))}}n.prototype.type="Chain",n.prototype.isChain=!0,n.prototype.done=function(){return this.value},n.prototype.valueOf=function(){return this.value},n.prototype.toString=function(){return re(this.value)},n.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},n.fromJSON=function(e){return new n(e.value)};var o={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return(n.createProxy=function(t,e){if("string"==typeof t)"function"==typeof e&&(n.prototype[t]=a(e));else for(var r in t)!function(e){pe(t,e)&&void 0===o[e]&&i(e,function(){return t[e]})}(r)})(e),t&&t("import",function(e,t,r){r||i(e,t)}),n},{isClass:!0}),r={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"]},uu={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"]},cu={bignumber:{name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","complex","fraction","index","matrix","string","unit"]},boolean:{name:"boolean",category:"Construction",syntax:["x","boolean(x)"],description:"Convert a string or number into a boolean.",examples:["boolean(0)","boolean(1)","boolean(3)",'boolean("true")','boolean("false")',"boolean([1, 0, 1, 1])"],seealso:["bignumber","complex","index","matrix","number","string","unit"]},complex:{name:"complex",category:"Construction",syntax:["complex()","complex(re, im)","complex(string)"],description:"Create a complex number.",examples:["complex()","complex(2, 3)",'complex("7 - 2i")'],seealso:["bignumber","boolean","index","matrix","number","string","unit"]},createUnit:{name:"createUnit",category:"Construction",syntax:["createUnit(definitions)","createUnit(name, definition)"],description:"Create a user-defined unit and register it with the Unit type.",examples:['createUnit("foo")','createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})','createUnit("mph", "1 mile/hour")'],seealso:["unit","splitUnit"]},fraction:{name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,den)","fraction({n: num, d: den})"],description:"Create a fraction from a number or from integer numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)","fraction({n: 333, d: 53})","fraction([sqrt(9), sqrt(10), sqrt(11)])"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]},index:{name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["[]","[1, 2, 3]","A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[0:2, 0:2] = ones(2, 2)"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]},matrix:{name:"matrix",category:"Construction",syntax:["[]","[a1, b1, ...; a2, b2, ...]","matrix()",'matrix("dense")',"matrix([...])"],description:"Create a matrix.",examples:["[]","[1, 2, 3]","[1, 2, 3; 4, 5, 6]","matrix()","matrix([3, 4])",'matrix([3, 4; 5, 6], "sparse")','matrix([3, 4; 5, 6], "sparse", "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","sparse"]},number:{name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","boolean","complex","fraction","index","matrix","string","unit"]},sparse:{name:"sparse",category:"Construction",syntax:["sparse()","sparse([a1, b1, ...; a1, b2, ...])",'sparse([a1, b1, ...; a1, b2, ...], "number")'],description:"Create a sparse matrix.",examples:["sparse()","sparse([3, 4; 5, 6])",'sparse([3, 0; 5, 0], "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","matrix"]},splitUnit:{name:"splitUnit",category:"Construction",syntax:["splitUnit(unit: Unit, parts: Unit[])"],description:"Split a unit in an array of units whose sum is equal to the original unit.",examples:['splitUnit(1 m, ["feet", "inch"])'],seealso:["unit","createUnit"]},string:{name:"string",category:"Construction",syntax:['"text"',"string(x)"],description:"Create a string or convert a value to a string",examples:['"Hello World!"',"string(4.2)","string(3 + 2i)"],seealso:["bignumber","boolean","complex","index","matrix","number","unit"]},unit:{name:"unit",category:"Construction",syntax:["value unit","unit(value, unit)","unit(string)"],description:"Create a unit.",examples:["5.5 mm","3 inch",'unit(7.1, "kilogram")','unit("23 deg")'],seealso:["bignumber","boolean","complex","index","matrix","number","string"]},e:r,E:r,false:{name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]},i:{name:"i",category:"Constants",syntax:["i"],description:"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",examples:["i","i * i","sqrt(-1)"],seealso:[]},Infinity:{name:"Infinity",category:"Constants",syntax:["Infinity"],description:"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",examples:["Infinity","1 / 0"],seealso:[]},LN2:{name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]},LN10:{name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]},LOG2E:{name:"LOG2E",category:"Constants",syntax:["LOG2E"],description:"Returns the base-2 logarithm of E, approximately equal to 1.442",examples:["LOG2E","log(e, 2)"],seealso:[]},LOG10E:{name:"LOG10E",category:"Constants",syntax:["LOG10E"],description:"Returns the base-10 logarithm of E, approximately equal to 0.434",examples:["LOG10E","log(e, 10)"],seealso:[]},NaN:{name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]},null:{name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]},pi:uu,PI:uu,phi:{name:"phi",category:"Constants",syntax:["phi"],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...",examples:["phi"],seealso:[]},SQRT1_2:{name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examples:["SQRT1_2","sqrt(1/2)"],seealso:[]},SQRT2:{name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]},tau:{name:"tau",category:"Constants",syntax:["tau"],description:"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",examples:["tau","2 * pi"],seealso:["pi"]},true:{name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]},version:{name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]},speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant",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:{name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.evaluate({x: 3})"],seealso:["simplify","parse","evaluate"]},lsolve:{name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolveAll","lup","lusolve","usolve","matrix","sparse"]},lsolveAll:{name:"lsolveAll",category:"Algebra",syntax:["x=lsolveAll(L, b)"],description:"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolve","lup","lusolve","usolve","matrix","sparse"]},lup:{name:"lup",category:"Algebra",syntax:["lup(m)"],description:"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",examples:["lup([[2, 1], [1, 4]])","lup(matrix([[2, 1], [1, 4]]))","lup(sparse([[2, 1], [1, 4]]))"],seealso:["lusolve","lsolve","usolve","matrix","sparse","slu","qr"]},lusolve:{name:"lusolve",category:"Algebra",syntax:["x=lusolve(A, b)","x=lusolve(lu, b)"],description:"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lusolve(a, b)"],seealso:["lup","slu","lsolve","usolve","matrix","sparse"]},leafCount:{name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leafCount("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]},resolve:{name:"resolve",category:"Algebra",syntax:["resolve(node, scope)"],description:"Recursively substitute variables in an expression tree.",examples:['resolve(parse("1 + x"), { x: 7 })','resolve(parse("size(text)"), { text: "Hello World" })','resolve(parse("x + y"), { x: parse("3z") })','resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'],seealso:["simplify","evaluate"],mayThrow:["ReferenceError"]},simplify:{name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.evaluate({x: 2})"],seealso:["simplifyCore","derivative","evaluate","parse","rationalize","resolve"]},simplifyCore:{name:"simplifyCore",category:"Algebra",syntax:["simplifyCore(node)"],description:"Perform simple one-pass simplifications on an expression tree.",examples:['simplifyCore(parse("0*x"))','simplifyCore(parse("(x+0)*2"))'],seealso:["simplify","evaluate"]},symbolicEqual:{name:"symbolicEqual",category:"Algebra",syntax:["symbolicEqual(expr1, expr2)","symbolicEqual(expr1, expr2, options)"],description:"Returns true if the difference of the expressions simplifies to 0",examples:['symbolicEqual("x*y","y*x")','symbolicEqual("abs(x^2)", "x^2")','symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'],seealso:["simplify","evaluate"]},rationalize:{name:"rationalize",category:"Algebra",syntax:["rationalize(expr)","rationalize(expr, scope)","rationalize(expr, scope, detailed)"],description:"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",examples:['rationalize("2x/y - y/(x+1)")','rationalize("2x/y - y/(x+1)", true)'],seealso:["simplify"]},slu:{name:"slu",category:"Algebra",syntax:["slu(A, order, threshold)"],description:"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",examples:["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"],seealso:["lusolve","lsolve","usolve","matrix","sparse","lup","qr"]},usolve:{name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolveAll","lup","lusolve","lsolve","matrix","sparse"]},usolveAll:{name:"usolveAll",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolve","lup","lusolve","lsolve","matrix","sparse"]},qr:{name:"qr",category:"Algebra",syntax:["qr(A)"],description:"Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.",examples:["qr([[1, -1,  4], [1,  4, -2], [1,  4,  2], [1,  -1, 0]])"],seealso:["lup","slu","matrix"]},abs:{name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]},add:{name:"add",category:"Operators",syntax:["x + y","add(x, y)"],description:"Add two values.",examples:["a = 2.1 + 3.6","a - 3.6","3 + 2i","3 cm + 2 inch",'"2.3" + "4"'],seealso:["subtract"]},cbrt:{name:"cbrt",category:"Arithmetic",syntax:["cbrt(x)","cbrt(x, allRoots)"],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:["cbrt(64)","cube(4)","cbrt(-8)","cbrt(2 + 3i)","cbrt(8i)","cbrt(8i, true)","cbrt(27 m^3)"],seealso:["square","sqrt","cube","multiply"]},ceil:{name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],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"]},cube:{name:"cube",category:"Arithmetic",syntax:["cube(x)"],description:"Compute the cube of a value. The cube of x is x * x * x.",examples:["cube(2)","2^3","2 * 2 * 2"],seealso:["multiply","square","pow"]},divide:{name:"divide",category:"Operators",syntax:["x / y","divide(x, y)"],description:"Divide two values.",examples:["a = 2 / 3","a * 3","4.5 / 2","3 + 4 / 2","(3 + 4) / 2","18 km / 4.5"],seealso:["multiply"]},dotDivide:{name:"dotDivide",category:"Operators",syntax:["x ./ y","dotDivide(x, y)"],description:"Divide two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a ./ b"],seealso:["multiply","dotMultiply","divide"]},dotMultiply:{name:"dotMultiply",category:"Operators",syntax:["x .* y","dotMultiply(x, y)"],description:"Multiply two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a .* b"],seealso:["multiply","divide","dotDivide"]},dotPow:{name:"dotPow",category:"Operators",syntax:["x .^ y","dotPow(x, y)"],description:"Calculates the power of x to y element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","a .^ 2"],seealso:["pow"]},exp:{name:"exp",category:"Arithmetic",syntax:["exp(x)"],description:"Calculate the exponent of a value.",examples:["exp(1.3)","e ^ 1.3","log(exp(1.3))","x = 2.4","(exp(i*x) == cos(x) + i*sin(x))   # Euler's formula"],seealso:["expm","expm1","pow","log"]},expm:{name:"expm",category:"Arithmetic",syntax:["exp(x)"],description:"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",examples:["expm([[0,2],[0,0]])"],seealso:["exp"]},expm1:{name:"expm1",category:"Arithmetic",syntax:["expm1(x)"],description:"Calculate the value of subtracting 1 from the exponential value.",examples:["expm1(2)","pow(e, 2) - 1","log(expm1(2) + 1)"],seealso:["exp","pow","log"]},fix:{name:"fix",category:"Arithmetic",syntax:["fix(x)"],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"]},floor:{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"]},gcd:{name:"gcd",category:"Arithmetic",syntax:["gcd(a, b)","gcd(a, b, c, ...)"],description:"Compute the greatest common divisor.",examples:["gcd(8, 12)","gcd(-4, 6)","gcd(25, 15, -10)"],seealso:["lcm","xgcd"]},hypot:{name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenusa of a list with values. ",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]},lcm:{name:"lcm",category:"Arithmetic",syntax:["lcm(x, y)"],description:"Compute the least common multiple.",examples:["lcm(4, 6)","lcm(6, 21)","lcm(6, 21, 5)"],seealso:["gcd"]},log:{name:"log",category:"Arithmetic",syntax:["log(x)","log(x, base)"],description:"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",examples:["log(3.5)","a = log(2.4)","exp(a)","10 ^ 4","log(10000, 10)","log(10000) / log(10)","b = log(1024, 2)","2 ^ b"],seealso:["exp","log1p","log2","log10"]},log2:{name:"log2",category:"Arithmetic",syntax:["log2(x)"],description:"Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.",examples:["log2(0.03125)","log2(16)","log2(16) / log2(2)","pow(2, 4)"],seealso:["exp","log1p","log","log10"]},log1p:{name:"log1p",category:"Arithmetic",syntax:["log1p(x)","log1p(x, base)"],description:"Calculate the logarithm of a `value+1`",examples:["log1p(2.5)","exp(log1p(1.4))","pow(10, 4)","log1p(9999, 10)","log1p(9999) / log(10)"],seealso:["exp","log","log2","log10"]},log10:{name:"log10",category:"Arithmetic",syntax:["log10(x)"],description:"Compute the 10-base logarithm of a value.",examples:["log10(0.00001)","log10(10000)","10 ^ 4","log(10000) / log(10)","log(10000, 10)"],seealso:["exp","log"]},mod:{name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]},multiply:{name:"multiply",category:"Operators",syntax:["x * y","multiply(x, y)"],description:"multiply two values.",examples:["a = 2.1 * 3.4","a / 3.4","2 * 3 + 4","2 * (3 + 4)","3 * 2.1 km"],seealso:["divide"]},norm:{name:"norm",category:"Arithmetic",syntax:["norm(x)","norm(x, p)"],description:"Calculate the norm of a number, vector or matrix.",examples:["abs(-3.5)","norm(-3.5)","norm(3 - 4i)","norm([1, 2, -3], Infinity)","norm([1, 2, -3], -Infinity)","norm([3, 4], 2)","norm([[1, 2], [3, 4]], 1)",'norm([[1, 2], [3, 4]], "inf")','norm([[1, 2], [3, 4]], "fro")']},nthRoot:{name:"nthRoot",category:"Arithmetic",syntax:["nthRoot(a)","nthRoot(a, root)"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',examples:["4 ^ 3","nthRoot(64, 3)","nthRoot(9, 2)","sqrt(9)"],seealso:["nthRoots","pow","sqrt"]},nthRoots:{name:"nthRoots",category:"Arithmetic",syntax:["nthRoots(A)","nthRoots(A, root)"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',examples:["nthRoots(1)","nthRoots(1, 3)"],seealso:["sqrt","pow","nthRoot"]},pow:{name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)","math.pow([[1, 2], [4, 3]], 2)","math.pow([[1, 2], [4, 3]], -1)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]},round:{name:"round",category:"Arithmetic",syntax:["round(x)","round(x, 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.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)"],seealso:["ceil","floor","fix"]},sign:{name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]},sqrt:{name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]},sqrtm:{name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.",examples:["sqrtm([[1, 2], [3, 4]])"],seealso:["sqrt","abs","square","multiply"]},square:{name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]},subtract:{name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]},unaryMinus:{name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]},unaryPlus:{name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]},xgcd:{name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]},invmod:{name:"invmod",category:"Arithmetic",syntax:["invmod(a, b)"],description:"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax ≣ 1 (mod b)",examples:["invmod(8, 12)=NaN","invmod(7, 13)=2","math.invmod(15151, 15122)=10429"],seealso:["gcd","xgcd"]},bitAnd:{name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},bitNot:{name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},bitOr:{name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]},bitXor:{name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]},leftShift:{name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]},rightArithShift:{name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]},rightLogShift:{name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]},bellNumbers:{name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]},catalan:{name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]},composition:{name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]},stirlingS2:{name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers"]},config:{name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]},import:{name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]},typed:{name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number": f(x)=x+x })',"double(2)",'double("hello")'],seealso:[]},arg:{name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]},conj:{name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]},re:{name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]},im:{name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]},evaluate:{name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate([expr1, expr2, expr3, ...])"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(" + 4 + ")")'],seealso:[]},help:{name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]},distance:{name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2]])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]},intersect:{name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1],  [4, -2, 2], [1, 1, 1, 6])"],seealso:[]},and:{name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]},not:{name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]},or:{name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]},xor:{name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]},concat:{name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},count:{name:"count",category:"Matrix",syntax:["count(x)"],description:"Count the number of elements of a matrix, array or string.",examples:["a = [1, 2; 3, 4; 5, 6]","count(a)","size(a)",'count("hello world")'],seealso:["size"]},cross:{name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0],  [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4],  [5, 6, 7])"],seealso:["multiply","dot"]},column:{name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row","matrixFromColumns"]},ctranspose:{name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},det:{name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},diag:{name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},diff:{name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to 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:["diff([1, 2, 4, 7, 0])","diff([1, 2, 4, 7, 0], 0)","diff(matrix([1, 2, 4, 7, 0]))","diff([[1, 2], [3, 4]])","diff([[1, 2], [3, 4]], 0)","diff([[1, 2], [3, 4]], 1)","diff([[1, 2], [3, 4]], bignumber(1))","diff(matrix([[1, 2], [3, 4]]), 1)","diff([[1, 2], matrix([3, 4])], 1)"],seealso:["subtract","partitionSelect"]},dot:{name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]},getMatrixDataType:{name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeOf"]},identity:{name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},filter:{name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]},flatten:{name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]},forEach:{name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["numberOfPets = {}","addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;",'forEach(["Dog","Cat","Cat"], addPet)',"numberOfPets"],seealso:["map","sort","filter"]},inv:{name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]},pinv:{name:"pinv",category:"Matrix",syntax:["pinv(x)"],description:"Calculate the Moore–Penrose inverse of a matrix",examples:["pinv([1, 2; 3, 4])","pinv([[1, 0], [0, 1], [0, 1]])","pinv(4)"],seealso:["inv"]},eigs:{name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and eigenvectors of a real symmetric matrix",examples:["eigs([[5, 2.3], [2.3, 1]])"],seealso:["inv"]},kron:{name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]},matrixFromFunction:{name:"matrixFromFunction",category:"Matrix",syntax:["math.matrixFromFunction(size, fn)","math.matrixFromFunction(size, fn, format)","math.matrixFromFunction(size, fn, format, datatype)","math.matrixFromFunction(size, format, fn)","math.matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]},matrixFromRows:{name:"matrixFromRows",category:"Matrix",syntax:["math.matrixFromRows(...arr)","math.matrixFromRows(row1, row2)","math.matrixFromRows(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual rows.",examples:["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromColumns","matrixFromFunction","zeros"]},matrixFromColumns:{name:"matrixFromColumns",category:"Matrix",syntax:["math.matrixFromColumns(...arr)","math.matrixFromColumns(row1, row2)","math.matrixFromColumns(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual columns.",examples:["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromRows","matrixFromFunction","zeros"]},map:{name:"map",category:"Matrix",syntax:["map(x, callback)"],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"]},ones:{name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]},partitionSelect:{name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1)'],seealso:["sort"]},range:{name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]},resize:{name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]},reshape:{name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])"],seealso:["size","squeeze","resize"]},rotate:{name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], math.pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]},rotationMatrix:{name:"rotationMatrix",category:"Matrix",syntax:["rotationMatrix(theta)","rotationMatrix(theta, v)","rotationMatrix(theta, v, format)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotationMatrix(pi / 2)",'rotationMatrix(unit("45deg"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), "sparse")'],seealso:["cos","sin"]},row:{name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column","matrixFromRows"]},size:{name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]},sort:{name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"])',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]},squeeze:{name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]},subset:{name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation `l:u`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]","f[[1,2], [1,3]] = [9, 10; 11, 12]","f"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]},trace:{name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]},transpose:{name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},zeros:{name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]},fft:{name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]},ifft:{name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]},combinations:{name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]},combinationsWithRep:{name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]},factorial:{name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]},gamma:{name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]},kldivergence:{name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence  between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]},lgamma:{name:"lgamma",category:"Probability",syntax:["lgamma(n)"],description:"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.",examples:["lgamma(4)","lgamma(1/2)","lgamma(math.i)","lgamma(complex(1.1, 2))"],seealso:["gamma"]},multinomial:{name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]},permutations:{name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]},pickRandom:{name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]},random:{name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]},randomInt:{name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]},compare:{name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]},compareNatural:{name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]},compareText:{name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]},deepEqual:{name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]},equal:{name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]},equalText:{name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]},larger:{name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]},largerEq:{name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]},smaller:{name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]},smallerEq:{name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]},unequal:{name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]},setCartesian:{name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]},setDifference:{name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]},setDistinct:{name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]},setIntersect:{name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]},setIsSubset:{name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]},setMultiplicity:{name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]},setPowerset:{name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]},setSize:{name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]},setSymDifference:{name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]},setUnion:{name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]},erf:{name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]},cumsum:{name:"cumsum",category:"Statistics",syntax:["cumsum(a, b, c, ...)","cumsum(A)"],description:"Compute the cumulative sum of all values.",examples:["cumsum(2, 3, 4, 1)","cumsum([2, 3, 4, 1])","cumsum([1, 2; 3, 4])","cumsum([1, 2; 3, 4], 1)","cumsum([1, 2; 3, 4], 2)"],seealso:["max","mean","median","min","prod","std","sum","variance"]},mad:{name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]},max:{name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dim)"],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"]},mean:{name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dim)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]},median:{name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]},min:{name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dim)"],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"]},mode:{name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]},prod:{name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]},quantileSeq:{name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:"Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber. \n\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.",examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]},std:{name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]},sum:{name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)"],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"]},variance:{name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, 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"]},acos:{name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]},acosh:{name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]},acot:{name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]},acoth:{name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the 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"]},acsc:{name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]},acsch:{name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]},asec:{name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]},asech:{name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]},asin:{name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]},asinh:{name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]},atan:{name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]},atanh:{name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]},atan2:{name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]},cos:{name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]},cosh:{name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]},cot:{name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]},coth:{name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]},csc:{name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]},csch:{name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]},sec:{name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]},sech:{name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]},sin:{name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]},sinh:{name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]},tan:{name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]},tanh:{name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]},to:{name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]},clone:{name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]},format:{name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]},bin:{name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]},oct:{name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]},hex:{name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]},isNaN:{name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero"]},isInteger:{name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]},isNegative:{name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]},isNumeric:{name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue"]},hasNumericValue:{name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]},isPositive:{name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},isPrime:{name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},isZero:{name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]},print:{name:"print",category:"Utils",syntax:["print(template, values)","print(template, values, precision)"],description:"Interpolate values into a string template.",examples:['print("Lucy is $age years old", {age: 5})','print("The value of pi is $pi", {pi: pi}, 3)','print("Hello, $user.name!", {user: {name: "John"}})','print("Values: $0, $1, $2", [6, 9, 4])'],seealso:["format"]},typeOf:{name:"typeOf",category:"Utils",syntax:["typeOf(x)"],description:"Get the type of a variable.",examples:["typeOf(3.5)","typeOf(2 - 4i)","typeOf(45 deg)",'typeOf("hello world")'],seealso:["getMatrixDataType"]},numeric:{name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, 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"]}},fu=l("help",["typed","mathWithTransform","Help"],function(e){var t=e.typed,i=e.mathWithTransform,a=e.Help;return t("help",{any:function(e){var t,r=e;if("string"!=typeof e)for(t in i)if(pe(i,t)&&e===i[t]){r=t;break}var n=ft(cu,r);if(n)return new a(n);throw n="function"==typeof r?r.name:r,new Error('No documentation found on "'+n+'"')}})}),lu=l("chain",["typed","Chain"],function(e){var t=e.typed,r=e.Chain;return t("chain",{"":function(){return new r},any:function(e){return new r(e)}})}),pu=l("det",["typed","matrix","subtract","multiply","divideScalar","isZero","unaryMinus"],function(e){var t=e.typed,d=e.matrix,y=e.subtract,g=e.multiply,v=e.divideScalar,x=e.isZero,b=e.unaryMinus;return t("det",{any:ne,"Array | Matrix":function(e){var t;switch((t=F(e)?e.size():Array.isArray(e)?(e=d(e)).size():[]).length){case 0:return ne(e);case 1:if(1===t[0])return ne(e.valueOf()[0]);throw new RangeError("Matrix must be square (size: "+re(t)+")");case 2:var r=t[0];if(r!==t[1])throw new RangeError("Matrix must be square (size: "+re(t)+")");var n=e.clone().valueOf(),i=r;if(1===i)return ne(n[0][0]);if(2===i)return y(g(n[0][0],n[1][1]),g(n[1][0],n[0][1]));for(var a=!1,o=new Array(i).fill(0).map(function(e,t){return t}),s=0;s<i;s++){var u=o[s];if(x(n[u][s])){for(var c=void 0,c=s+1;c<i;c++)if(!x(n[o[c]][s])){u=o[c],o[c]=o[s],o[s]=u,a=!a;break}if(c===i)return n[u][s]}for(var f=n[u][s],l=0===s?1:n[o[s-1]][s-1],p=s+1;p<i;p++)for(var m=o[p],h=s+1;h<i;h++)n[m][h]=v(y(g(n[m][h],f),g(n[m][s],n[u][h])),l)}r=n[o[i-1]][i-1];return a?b(r):r;default:throw new RangeError("Matrix must be two dimensional (size: "+re(t)+")")}}})}),mu=l("inv",["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],function(e){var t=e.typed,i=e.matrix,g=e.divideScalar,v=e.addScalar,x=e.multiply,b=e.unaryMinus,w=e.det,N=e.identity,M=e.abs;return t("inv",{"Array | Matrix":function(e){var t=F(e)?e.size():_(e);switch(t.length){case 1:if(1===t[0])return F(e)?i([g(1,e.valueOf()[0])]):[g(1,e[0])];throw new RangeError("Matrix must be square (size: "+re(t)+")");case 2:var r=t[0],n=t[1];if(r===n)return F(e)?i(a(e.valueOf(),r,n),e.storage()):a(e,r,n);throw new RangeError("Matrix must be square (size: "+re(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+re(t)+")")}},any:function(e){return g(1,e)}});function a(e,t,r){var n,i,a;if(1===t){if(0===(o=e[0][0]))throw Error("Cannot calculate inverse, determinant is zero");return[[g(1,o)]]}if(2===t){var o=w(e);if(0===o)throw Error("Cannot calculate inverse, determinant is zero");return[[g(e[1][1],o),g(b(e[0][1]),o)],[g(b(e[1][0]),o),g(e[0][0],o)]]}var s=e.concat();for(p=0;p<t;p++)s[p]=s[p].concat();for(var u=N(t).valueOf(),c=0;c<r;c++){for(var f=M(s[c][c]),l=c,p=c+1;p<t;)M(s[p][c])>f&&(f=M(s[p][c]),l=p),p++;if(0===f)throw Error("Cannot calculate inverse, determinant is zero");(p=l)!==c&&(a=s[c],s[c]=s[p],s[p]=a,a=u[c],u[c]=u[p],u[p]=a);var m=s[c],h=u[c];for(p=0;p<t;p++){var d=s[p],y=u[p];if(p!==c){if(0!==d[c]){for(i=g(b(d[c]),m[c]),n=c;n<r;n++)d[n]=v(d[n],x(i,m[n]));for(n=0;n<r;n++)y[n]=v(y[n],x(i,h[n]))}}else{for(i=m[c],n=c;n<r;n++)d[n]=g(d[n],i);for(n=0;n<r;n++)y[n]=g(y[n],i)}}}return u}}),hu=l("pinv",["typed","matrix","inv","deepEqual","equal","dotDivide","dot","ctranspose","divideScalar","multiply","add","Complex"],function(e){var t=e.typed,i=e.matrix,a=e.inv,r=e.deepEqual,n=e.equal,p=e.dotDivide,o=e.dot,s=e.ctranspose,u=e.divideScalar,m=e.multiply,h=e.add,c=e.Complex;return t("pinv",{"Array | Matrix":function(e){var t=F(e)?e.size():_(e);switch(t.length){case 1:return l(e)?s(e):1===t[0]?a(e):p(s(e),o(e,e));case 2:if(l(e))return s(e);var r=t[0],n=t[1];if(r===n)try{return a(e)}catch(e){if(!(e instanceof Error&&e.message.match(/Cannot calculate inverse, determinant is zero/)))throw e}return F(e)?i(f(e.valueOf(),r,n),e.storage()):f(e,r,n);default:throw new RangeError("Matrix must be two dimensional (size: "+re(t)+")")}},any:function(e){return n(e,0)?ne(e):u(1,e)}});function f(e,t,r){l=e,i=function(e,t){for(var r=ne(l),n=0,i=0;i<e;i++){if(t<=n)return r;for(var a=i;d(r[a][n]);)if(e===++a&&(a=i,t===++n))return r;var o=[r[i],r[a]];r[a]=o[0],r[i]=o[1];for(var s=r[i][n],u=0;u<t;u++)r[i][u]=p(r[i][u],s);for(var c=0;c<e;c++)if(c!==i)for(var s=r[c][n],f=0;f<t;f++)r[c][f]=h(r[c][f],m(-1,m(s,r[i][f])));n++}return r}(n=t,r);var l,n,i,e={C:l.map(function(e,t){return e.filter(function(e,t){return t<n&&!d(o(i[t],i[t]))})}),F:i.filter(function(e,t){return!d(o(i[t],i[t]))})},t=e.C,r=e.F,e=m(a(m(s(t),t)),s(t)),t=m(s(r),a(m(r,s(r))));return m(t,e)}function d(e){return n(h(e,c(1,1)),h(0,c(1,1)))}function l(e){return r(h(e,c(1,1)),h(m(e,0),c(1,1)))}});function du(e,t){var r,n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e){if(e){if("string"==typeof e)return yu(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(t="Object"===t&&e.constructor?e.constructor.name:t)||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?yu(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length)return n&&(e=n),r=0,{s:t=function(){},n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(o)throw i}}}}function yu(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function gu(e){var T=e.addScalar,_=e.subtract,C=e.flatten,I=e.multiply,k=e.multiplyScalar,z=e.divideScalar,R=e.sqrt,q=e.abs,B=e.bignumber,D=e.diag,j=e.inv,P=e.qr,h=e.usolve,F=e.usolveAll,U=e.equal,L=e.complex,$=e.larger,H=e.smaller,G=e.matrixFromColumns,a=e.dot;function V(e,t){for(var r,n=0;n<e.length;n++)(r=e[n]).push.apply(r,Vi()(Array(t-e[n].length).fill(0)));for(var i=e.length;i<t;i++)e.push(Array(t).fill(0)),e[i][i]=1}function Z(e,t,r,n,i){for(var a,o,s,u,c,f,l="BigNumber"===i?B(1e3):1e3,p=0;o=t,s=r,f=c=void 0,c="BigNumber"===(u=i),f="Complex"===u,o=Array(o).fill(0).map(function(e){return 2*Math.random()-1}),c&&(o=o.map(function(e){return B(e)})),a=g(o=d(o=f?o.map(function(e){return L(e)}):o,s),u),a=h(e,a),!$(y(a),l);)if(5<=++p)return null;for(p=0;;){var m=h(e,a);if(H(y(d(a,[m])),n))break;if(10<=++p)return null;a=g(m)}return a}function d(e,t){var r,n=du(t);try{for(n.s();!(r=n.n()).done;){var i=r.value;e=_(e,I(z(a(i,e),a(i,i)),i))}}catch(e){n.e(e)}finally{n.f()}return e}function y(e){return q(R(a(e,e)))}function g(e,t){var r="Complex"===t,t="BigNumber"===t?B(1):r?L(1):1;return I(z(t,y(e)),e)}return function(e,t,r,N,n){var i=function(e,t,r){for(var n,i="BigNumber"===N,a="Complex"===N,o=i?B(0):0,a=i?B(1):a?L(1):1,s=i?B(1):1,u=i?B(10):2,c=k(u,u),f=(r&&(n=Array(t).fill(a)),!1);!f;){f=!0;for(var l=0;l<t;l++){for(var p,m=o,h=o,d=0;d<t;d++)l!==d&&(p=q(e[l][d]),m=T(m,p),h=T(h,p));if(!U(m,0)&&!U(h,0)){for(var y=s,g=m,v=z(h,u),x=k(h,u);H(g,v);)g=k(g,c),y=k(y,u);for(;$(g,x);)g=z(g,c),y=z(y,u);if(H(z(T(g,h),y),k(T(m,h),.95))){for(var f=!1,b=z(1,y),w=0;w<t;w++)l!==w&&(e[l][w]=k(e[l][w],y),e[w][l]=k(e[w][l],b));r&&(n[l]=k(n[l],y))}}}}return D(n)}(e,t,n=void 0===n?!0:n),a=e,o=t,s=r,u=n,c=i,f="BigNumber"===N,l="Complex"===N,p=f?B(0):l?L(0):0;f&&(s=B(s));for(var m=0;m<o-2;m++){for(var h=0,d=p,y=m+1;y<o;y++){var g=a[y][m];H(q(d),q(g))&&(d=g,h=y)}if(!H(q(d),s)){if(h!==m+1){var v=a[h];a[h]=a[m+1],a[m+1]=v;for(var x=0;x<o;x++){var b=a[x][h];a[x][h]=a[x][m+1],a[x][m+1]=b}u&&(v=c[h],c[h]=c[m+1],c[m+1]=v)}for(var w=m+2;w<o;w++){var M=z(a[w][m],d);if(0!==M){for(var E=0;E<o;E++)a[w][E]=_(a[w][E],k(M,a[m+1][E]));for(var S=0;S<o;S++)a[S][m+1]=T(a[S][m+1],k(M,a[S][w]));if(u)for(var A=0;A<o;A++)c[w][A]=_(c[w][A],k(M,c[m+1][A]))}}}}var O,l=function(e,t,r,n,i){for(var a,o,s,u,c,f,l,p="BigNumber"===n,m="Complex"===n,h=p?B(1):m?L(1):1,d=(p&&(r=B(r)),ne(e)),y=[],g=t,v=[],x=i?D(Array(t).fill(h)):void 0,b=i?D(Array(g).fill(h)):void 0,w=0;w<=100;){w+=1;for(var N=0;N<g;N++)d[N][N]=_(d[N][N],0);for(var M=P(d),E=M.Q,M=M.R,d=I(M,E),S=0;S<g;S++)d[S][S]=T(d[S][S],0);if(i&&(b=I(b,E)),1===g||H(q(d[g-1][g-2]),r)){w=0,y.push(d[g-1][g-1]),i&&(v.unshift([[1]]),V(b,t),x=I(x,b),1<g&&(b=D(Array(g-1).fill(h)))),--g,d.pop();for(var A=0;A<g;A++)d[A].pop()}else if(2===g||H(q(d[g-2][g-3]),r)){var w=0,O=(M=d[g-2][g-2],E=d[g-2][g-1],O=d[g-1][g-2],l=d[g-1][g-1],0,f=T(M,l),M=_(k(M,l),k(E,O)),l=k(f,.5),E=k(R(_(k(f,f),k(4,M))),.5),[T(l,E),_(l,E)]);y.push.apply(y,Vi()(O)),i&&(v.unshift((f=d[g-2][g-2],M=d[g-2][g-1],l=d[g-1][g-2],E=d[g-1][g-1],a=O[0],O=O[1],o=r,u=c=u=void 0,u="BigNumber"===(s=n),s="Complex"===s,c=u?B(0):s?L(0):0,u=u?B(1):s?L(1):1,H(q(l),o)?[[u,c],[c,u]]:$(q(_(a,O)),o)?[[_(a,E),_(O,E)],[l,l]]:(s=_(f,a),O=_(M,a),f=_(l,a),M=_(E,a),H(q(O),o)?[[s,u],[f,c]]:[[O,c],[M,u]]))),V(b,t),x=I(x,b),2<g&&(b=D(Array(g-2).fill(h)))),g-=2,d.pop(),d.pop();for(var C=0;C<g;C++)d[C].pop(),d[C].pop()}if(0===g)break}if(y.sort(function(e,t){return+_(q(e),q(t))}),100<w)throw(m=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+y.join(", "))).values=y,m.vectors=[],m;return{values:y,C:i?I(x,function(e,t){for(var r=[],n=0;n<t;n++)r[n]=Array(t).fill(0);var i,a=0,o=du(e);try{for(o.s();!(i=o.n()).done;){for(var s=i.value,u=s.length,c=0;c<u;c++)for(var f=0;f<u;f++)r[a+c][a+f]=s[c][f];a+=u}}catch(e){o.e(e)}finally{o.f()}return r}(v,t)):void 0}}(e,t,r,N,n),f=l.values,l=l.C;return n&&(O=function(e,o,s,u,t,c,f){var r,n=j(s),l=I(n,e,s),n="BigNumber"===f,e="Complex"===f,i=n?B(0):e?L(0):0,n=n?B(1):e?L(1):1,p=[],m=[],a=du(t);try{for(a.s();!(r=a.n()).done;){var h=r.value,d=function(e,t,r){for(var n=0;n<e.length;n++)if(r(e[n],t))return n;return-1}(p,h,U);-1===d?(p.push(h),m.push(1)):m[d]+=1}}catch(y){a.e(y)}finally{a.f()}for(var y,g=[],v=p.length,x=Array(o).fill(i),b=D(Array(o).fill(n)),w=[],N=0;N<v;N++)!function(e){var t=p[e],r=_(l,I(t,b));for((a=F(r,x)).shift();a.length<m[e];){var n=Z(r,o,a,c,f);if(null==n){w.push(t);break}a.push(n)}var i=I(j(u),s),a=a.map(function(e){return I(i,e)});g.push.apply(g,Vi()(a.map(function(e){return C(e)})))}(N);if(0!==w.length)throw(y=new Error("Failed to find eigenvectors for the following eigenvalues: "+w.join(", "))).values=t,y.vectors=g,y;return g}(e,t,l,i,f,r,N),O=G.apply(void 0,Vi()(O))),{values:f,vectors:O}}}var vu=l("eigs",["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],function(e){var d,h,y,p,m,g,v,x,b,w,N,M,a=e.config,t=e.typed,r=e.matrix,n=e.addScalar,o=e.subtract,i=e.equal,s=e.abs,u=e.atan,c=e.cos,B=e.sin,f=e.multiplyScalar,D=e.divideScalar,l=e.inv,E=e.bignumber,S=e.multiply,j=e.add,A=e.larger,O=e.column,C=e.flatten,P=e.number,T=e.complex,F=e.sqrt,U=e.diag,L=e.qr,$=e.usolve,H=e.usolveAll,G=e.im,V=e.re,Z=e.smaller,W=e.matrixFromColumns,e=e.dot,Y=(d=(O={config:a,addScalar:n,subtract:o,column:O,flatten:C,equal:i,abs:s,atan:u,cos:c,sin:B,multiplyScalar:f,inv:l,bignumber:E,complex:T,multiply:S,add:j}).config,h=O.addScalar,y=O.subtract,p=O.abs,m=O.atan,g=O.cos,v=O.sin,x=O.multiplyScalar,b=O.inv,w=O.bignumber,N=O.multiply,M=O.add,function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:d.epsilon,n=3<arguments.length?arguments[3]:void 0;if("number"===n)return X(e,r);if("BigNumber"===n)return Q(e,r);throw TypeError("Unsupported data type: "+n)}),J=gu({config:a,addScalar:n,subtract:o,multiply:S,multiplyScalar:f,flatten:C,divideScalar:D,sqrt:F,abs:s,bignumber:E,diag:U,qr:L,inv:l,usolve:$,usolveAll:H,equal:i,complex:T,larger:A,smaller:Z,matrixFromColumns:W,dot:e});function X(e,t){for(var r=e.length,n=Math.abs(t/r),i=new Array(r),a=0;a<r;a++)i[a]=z(r,0),i[a][a]=1;for(var o,s,u,c,f=_(e);Math.abs(f[1])>=Math.abs(n);){var l=f[0][0],p=f[0][1];e=function(e,t,r,n){for(var i=e.length,a=Math.cos(t),o=Math.sin(t),t=a*a,s=o*o,u=z(i,0),c=z(i,0),f=t*e[r][r]-2*a*o*e[r][n]+s*e[n][n],s=s*e[r][r]+2*a*o*e[r][n]+t*e[n][n],l=0;l<i;l++)u[l]=a*e[r][l]-o*e[n][l],c[l]=o*e[r][l]+a*e[n][l];e[r][r]=f,e[n][n]=s,e[r][n]=0;for(var p=e[n][r]=0;p<i;p++)p!==r&&p!==n&&(e[r][p]=u[p],e[p][r]=u[p],e[n][p]=c[p],e[p][n]=c[p]);return e}(e,(o=e[l][l],s=e[p][p],u=e[l][p],c=void 0,c=s-o,c=Math.abs(c)<=d.epsilon?Math.PI/4:.5*Math.atan(2*u/(s-o))),l,p),i=function(e,t,r,n){for(var i=e.length,a=Math.cos(t),o=Math.sin(t),s=z(i,0),u=z(i,0),c=0;c<i;c++)s[c]=a*e[c][r]-o*e[c][n],u[c]=o*e[c][r]+a*e[c][n];for(var f=0;f<i;f++)e[f][r]=s[f],e[f][n]=u[f];return e}(i,c,l,p),f=_(e)}for(var m=z(r,0),h=0;h<r;h++)m[h]=e[h][h];return k(ne(m),ne(i))}function Q(e,t){for(var r,n=e.length,i=p(t/n),a=new Array(n),o=0;o<n;o++)a[o]=z(n,0),a[o][o]=1;for(var s=I(e);p(s[1])>=p(i);){var u=s[0][0],c=s[0][1];e=function(e,t,r,n){for(var i=e.length,a=w(g(t)),o=w(v(t)),t=x(a,a),s=x(o,o),u=z(i,w(0)),c=z(i,w(0)),f=N(w(2),a,o,e[r][n]),l=h(y(x(t,e[r][r]),f),x(s,e[n][n])),s=M(x(s,e[r][r]),f,x(t,e[n][n])),p=0;p<i;p++)u[p]=y(x(a,e[r][p]),x(o,e[n][p])),c[p]=h(x(o,e[r][p]),x(a,e[n][p]));e[r][r]=l,e[n][n]=s,e[r][n]=w(0),e[n][r]=w(0);for(var m=0;m<i;m++)m!==r&&m!==n&&(e[r][m]=u[m],e[m][r]=u[m],e[n][m]=c[m],e[m][n]=c[m]);return e}(e,r=function(e,t,r){t=y(t,e);return p(t)<=d.epsilon?w(-1).acos().div(4):x(.5,m(N(2,r,b(t))))}(e[u][u],e[c][c],e[u][c]),u,c),a=function(e,t,r,n){for(var i=e.length,a=g(t),o=v(t),s=z(i,w(0)),u=z(i,w(0)),c=0;c<i;c++)s[c]=y(x(a,e[c][r]),x(o,e[c][n])),u[c]=h(x(o,e[c][r]),x(a,e[c][n]));for(var f=0;f<i;f++)e[f][r]=s[f],e[f][n]=u[f];return e}(a,r,u,c),s=I(e)}for(var f=z(n,0),l=0;l<n;l++)f[l]=e[l][l];return k(ne(f),ne(a))}function _(e){for(var t=e.length,r=0,n=[0,1],i=0;i<t;i++)for(var a=i+1;a<t;a++)Math.abs(r)<Math.abs(e[i][a])&&(r=Math.abs(e[i][a]),n=[i,a]);return[n,r]}function I(e){for(var t=e.length,r=0,n=[0,1],i=0;i<t;i++)for(var a=i+1;a<t;a++)p(r)<p(e[i][a])&&(r=p(e[i][a]),n=[i,a]);return[n,r]}function k(e,t){for(var r=e.length,n=Array(r),i=Array(r),a=0;a<r;a++)i[a]=Array(r);for(var o=0;o<r;o++){for(var s=0,u=e[0],c=0;c<e.length;c++)p(e[c])<p(u)&&(u=e[s=c]);n[o]=e.splice(s,1)[0];for(var f=0;f<r;f++)i[f][o]=t[f][s],t[f].splice(s,1)}return{values:n,vectors:i}}function z(e,t){for(var r=new Array(e),n=0;n<e;n++)r[n]=t;return r}return t("eigs",{Array:function(e){return R(r(e))},"Array, number|BigNumber":function(e,t){return R(r(e),t)},Matrix:function(e){var e=R(e),t=e.values,e=e.vectors;return{values:r(t),vectors:r(e)}},"Matrix, number|BigNumber":function(e,t){e=R(e,t),t=e.values,e=e.vectors;return{values:r(t),vectors:r(e)}}});function R(e,t){void 0===t&&(t=a.epsilon);var r=e.size();if(2!==r.length||r[0]!==r[1])throw new RangeError("Matrix must be square (size: "+re(r)+")");var n=e.toArray(),r=r[0];if(function(e,t,r){for(var n=0;n<t;n++)for(var i=0;i<t;i++)if(A(E(s(G(e[n][i]))),r))return;return 1}(n,r,t)&&(function(e,t){for(var r=0;r<t;r++)for(var n=0;n<t;n++)e[r][n]=V(e[r][n])}(n,r),function(e,t,r){for(var n=0;n<t;n++)for(var i=n;i<t;i++)if(A(E(s(o(e[n][i],e[i][n]))),r))return;return 1}(n,r,t)))return i=q(e,n,r),Y(n,r,t,i);var i=q(e,n,r);return J(n,r,t,i)}function q(e,t,r){e=e.datatype();if("number"===e||"BigNumber"===e||"Complex"===e)return e;for(var n=!1,i=!1,a=!1,o=0;o<r;o++)for(var s=0;s<r;s++){var u=t[o][s];if(K(u)||ae(u))n=!0;else if(ee(u))i=!0;else{if(!ie(u))throw TypeError("Unsupported type in Matrix: "+te(u));a=!0}}if(i&&a&&console.warn("Complex BigNumbers not supported, this operation will lose precission."),a){for(var c=0;c<r;c++)for(var f=0;f<r;f++)t[c][f]=T(t[c][f]);return"Complex"}if(i){for(var l=0;l<r;l++)for(var p=0;p<r;p++)t[l][p]=E(t[l][p]);return"BigNumber"}if(n){for(var m=0;m<r;m++)for(var h=0;h<r;h++)t[m][h]=P(t[m][h]);return"number"}throw TypeError("Matrix contains unsupported types only.")}}),xu=l("expm",["typed","abs","add","identity","inv","multiply"],function(e){var t=e.typed,h=e.abs,d=e.add,y=e.identity,g=e.inv,v=e.multiply;return t("expm",{Matrix:function(e){var t=e.size();if(2!==t.length||t[0]!==t[1])throw new RangeError("Matrix must be square (size: "+re(t)+")");for(var t=t[0],r=function(e){for(var t=0;t<30;t++)for(var r=0;r<=t;r++){var n=t-r;if(function(e,t,r){for(var n=1,i=2;i<=t;i++)n*=i;for(var a=n,o=t+1;o<=2*t;o++)a*=o;var s=a*(2*t+1);return 8*Math.pow(e/Math.pow(2,r),2*t)*n*n/(a*s)}(e,r,n)<1e-15)return{q:r,j:n}}throw new Error("Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)")}(function(e){for(var t=e.size()[0],r=0,n=0;n<t;n++){for(var i=0,a=0;a<t;a++)i+=h(e.get([n,a]));r=Math.max(i,r)}return r}(e)),n=r.q,i=r.j,a=v(e,Math.pow(2,-i)),o=y(t),s=y(t),u=1,c=a,f=-1,l=1;l<=n;l++)1<l&&(c=v(c,a),f=-f),o=d(o,v(u=u*(n-l+1)/((2*n-l+1)*l),c)),s=d(s,v(u*f,c));for(var p=v(g(s),o),m=0;m<i;m++)p=v(p,p);return A(e)?e.createSparseMatrix(p):p}})}),bu=l("sqrtm",["typed","abs","add","multiply","sqrt","subtract","inv","size","max","identity"],function(e){var t=e.typed,o=e.abs,s=e.add,u=e.multiply,c=e.sqrt,f=e.subtract,l=e.inv,p=e.size,m=e.max,h=e.identity;return t("sqrtm",{"Array | Matrix":function(e){var t=F(e)?e.size():_(e);switch(t.length){case 1:if(1===t[0])return c(e);throw new RangeError("Matrix must be square (size: "+re(t)+")");case 2:if(t[0]!==t[1])throw new RangeError("Matrix must be square (size: "+re(t)+")");var r=0,n=e,i=h(p(e));do{var a=n,n=u(.5,s(a,l(i))),i=u(.5,s(i,l(a)));if(1e-6<(a=m(o(f(n,a))))&&1e3<++r)throw new Error("computing square root of matrix: iterative method could not converge")}while(1e-6<a);return n;default:throw new RangeError("Matrix must be at most two dimensional (size: "+re(t)+")")}}})}),wu=l("divide",["typed","matrix","multiply","equalScalar","divideScalar","inv"],function(e){var t=e.typed,r=e.matrix,n=e.multiply,i=e.equalScalar,a=e.divideScalar,o=e.inv,s=m({typed:t,equalScalar:i}),u=h({typed:t});return t("divide",nt({"Array | Matrix, Array | Matrix":function(e,t){return n(e,o(t))},"DenseMatrix, any":function(e,t){return u(e,t,a,!1)},"SparseMatrix, any":function(e,t){return s(e,t,a,!1)},"Array, any":function(e,t){return u(r(e),t,a,!1).valueOf()},"any, Array | Matrix":function(e,t){return n(e,o(t))}},a.signatures))}),Nu=l("distance",["typed","addScalar","subtract","divideScalar","multiplyScalar","unaryMinus","sqrt","abs"],function(e){var t=e.typed,c=e.addScalar,f=e.subtract,l=e.multiplyScalar,p=e.divideScalar,i=e.unaryMinus,m=e.sqrt,a=e.abs;return t("distance",{"Array, Array, Array":function(e,t,r){if(2!==e.length||2!==t.length||2!==r.length)throw new TypeError("Invalid Arguments: Try again");if(!o(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!o(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!o(r))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");var r=p(f(r[1],r[0]),f(t[1],t[0])),n=l(l(r,r),t[0]),r=i(l(r,t[0])),t=e[1];return d(e[0],e[1],n,r,t)},"Object, Object, Object":function(e,t,r){if(2!==Object.keys(e).length||2!==Object.keys(t).length||2!==Object.keys(r).length)throw new TypeError("Invalid Arguments: Try again");if(!o(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!o(t))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!o(r))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");var n;if("pointX"in e&&"pointY"in e&&"lineOnePtX"in t&&"lineOnePtY"in t&&"lineTwoPtX"in r&&"lineTwoPtY"in r)return r=p(f(r.lineTwoPtY,r.lineTwoPtX),f(t.lineOnePtY,t.lineOnePtX)),n=l(l(r,r),t.lineOnePtX),r=i(l(r,t.lineOnePtX)),t=e.pointX,d(e.pointX,e.pointY,n,r,t);throw new TypeError("Key names do not match")},"Array, Array":function(e,t){if(2===e.length&&3===t.length){if(!o(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(r(t))return d(e[0],e[1],t[0],t[1],t[2]);throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument")}if(3===e.length&&6===t.length){if(!r(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(u(t))return y(e[0],e[1],e[2],t[0],t[1],t[2],t[3],t[4],t[5]);throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument")}if(e.length===t.length&&0<e.length){if(!n(e))throw new TypeError("All values of an array should be numbers or BigNumbers");if(n(t))return g(e,t);throw new TypeError("All values of an array should be numbers or BigNumbers")}throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(e,t){if(2===Object.keys(e).length&&3===Object.keys(t).length){if(!o(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!r(t))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in e&&"pointY"in e&&"xCoeffLine"in t&&"yCoeffLine"in t&&"constant"in t)return d(e.pointX,e.pointY,t.xCoeffLine,t.yCoeffLine,t.constant);throw new TypeError("Key names do not match")}if(3===Object.keys(e).length&&6===Object.keys(t).length){if(!r(e))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!u(t))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in e&&"pointY"in e&&"x0"in t&&"y0"in t&&"z0"in t&&"a"in t&&"b"in t&&"c"in t)return y(e.pointX,e.pointY,e.pointZ,t.x0,t.y0,t.z0,t.a,t.b,t.c);throw new TypeError("Key names do not match")}if(2===Object.keys(e).length&&2===Object.keys(t).length){if(!o(e))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!o(t))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in e&&"pointOneY"in e&&"pointTwoX"in t&&"pointTwoY"in t)return g([e.pointOneX,e.pointOneY],[t.pointTwoX,t.pointTwoY]);throw new TypeError("Key names do not match")}if(3!==Object.keys(e).length||3!==Object.keys(t).length)throw new TypeError("Invalid Arguments: Try again");if(!r(e))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!r(t))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in e&&"pointOneY"in e&&"pointOneZ"in e&&"pointTwoX"in t&&"pointTwoY"in t&&"pointTwoZ"in t)return g([e.pointOneX,e.pointOneY,e.pointOneZ],[t.pointTwoX,t.pointTwoY,t.pointTwoZ]);throw new TypeError("Key names do not match")},Array:function(e){if(function(e){if(2===e[0].length&&s(e[0][0])&&s(e[0][1])){if(e.some(function(e){return 2!==e.length||!s(e[0])||!s(e[1])}))return}else{if(!(3===e[0].length&&s(e[0][0])&&s(e[0][1])&&s(e[0][2])))return;if(e.some(function(e){return 3!==e.length||!s(e[0])||!s(e[1])||!s(e[2])}))return}return 1}(e)){for(var t=e,r=[],n=[],i=[],a=0;a<t.length-1;a++)for(var o=a+1;o<t.length;o++)2===t[0].length?(n=[t[a][0],t[a][1]],i=[t[o][0],t[o][1]]):3===t[0].length&&(n=[t[a][0],t[a][1],t[a][2]],i=[t[o][0],t[o][1],t[o][2]]),r.push(g(n,i));return r}throw new TypeError("Incorrect array format entered for pairwise distance calculation")}});function s(e){return"number"==typeof e||ee(e)}function o(e){return s((e=e.constructor!==Array?h(e):e)[0])&&s(e[1])}function r(e){return s((e=e.constructor!==Array?h(e):e)[0])&&s(e[1])&&s(e[2])}function n(e){return(e=Array.isArray(e)?e:h(e)).every(s)}function u(e){return s((e=e.constructor!==Array?h(e):e)[0])&&s(e[1])&&s(e[2])&&s(e[3])&&s(e[4])&&s(e[5])}function h(e){for(var t=Object.keys(e),r=[],n=0;n<t.length;n++)r.push(e[t[n]]);return r}function d(e,t,r,n,i){e=a(c(c(l(r,e),l(n,t)),i)),t=m(c(l(r,r),l(n,n)));return p(e,t)}function y(e,t,r,n,i,a,o,s,u){a=[f(l(f(i,t),u),l(f(a,r),s)),f(l(f(a,r),o),l(f(n,e),u)),f(l(f(n,e),s),l(f(i,t),o))],a=m(c(c(l(a[0],a[0]),l(a[1],a[1])),l(a[2],a[2]))),r=m(c(c(l(o,o),l(s,s)),l(u,u)));return p(a,r)}function g(e,t){for(var r,n=e.length,i=0,a=0;a<n;a++)r=f(e[a],t[a]),i=c(l(r,r),i);return m(i)}}),Mu=l("intersect",["typed","config","abs","add","addScalar","matrix","multiply","multiplyScalar","divideScalar","subtract","smaller","equalScalar","flatten","isZero","isNumeric"],function(e){var t=e.typed,g=e.config,v=e.abs,x=e.add,b=e.addScalar,i=e.matrix,w=e.multiply,N=e.multiplyScalar,M=e.divideScalar,E=e.subtract,S=e.smaller,A=e.equalScalar,r=e.flatten,O=e.isZero,m=e.isNumeric;return t("intersect",{"Array, Array, Array":n,"Array, Array, Array, Array":a,"Matrix, Matrix, Matrix":function(e,t,r){e=n(e.valueOf(),t.valueOf(),r.valueOf());return null===e?null:i(e)},"Matrix, Matrix, Matrix, Matrix":function(e,t,r,n){e=a(e.valueOf(),t.valueOf(),r.valueOf(),n.valueOf());return null===e?null:i(e)}});function n(e,t,r){if(e=C(e),t=C(t),r=C(r),!_(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!_(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(4===(n=r).length&&m(n[0])&&m(n[1])&&m(n[2])&&m(n[3]))return n=e[0],i=e[1],e=e[2],a=t[0],o=t[1],t=t[2],s=r[0],u=r[1],c=r[2],r=r[3],f=N(n,s),s=N(a,s),l=N(i,u),u=N(o,u),p=N(e,c),c=N(t,c),r=E(E(E(r,f),l),p),s=E(E(E(b(b(s,u),c),f),l),p),u=M(r,s),[b(n,N(u,E(a,n))),b(i,N(u,E(o,i))),b(e,N(u,E(t,e)))];var n,i,a,o,s,u,c,f,l,p;throw new TypeError("Array with 4 numbers expected as third argument")}function a(e,t,r,n){if(e=C(e),t=C(t),r=C(r),n=C(n),2===e.length){if(!T(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!T(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!T(r))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(T(n)){var i=n;var a=e,o=r,s=E(a,t),i=E(o,i),u=E(N(s[0],i[1]),N(i[0],s[1]));if(O(u))return null;if(S(v(u),g.epsilon))return null;var c=N(i[0],a[1]),f=N(i[1],a[0]),l=N(i[0],o[1]),i=N(i[1],o[0]),o=M(b(E(E(c,f),l),i),u);return x(w(s,o),a);return}throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument")}if(3!==e.length)throw new TypeError("Arrays with two or thee dimensional points expected");if(!_(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!_(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!_(r))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");var p,m,h,d,y;{if(_(n))return c=e[0],f=e[1],l=e[2],i=t[0],u=t[1],s=t[2],o=r[0],a=r[1],e=r[2],t=n[0],r=n[1],n=n[2],p=I(c,o,t,o,f,a,r,a,l,e,n,e),m=I(t,o,i,c,r,a,u,f,n,e,s,l),d=I(c,o,i,c,f,a,u,f,l,e,s,l),h=I(t,o,t,o,r,a,r,a,n,e,n,e),y=I(i,c,i,c,u,f,u,f,s,l,s,l),d=E(N(p,m),N(d,h)),y=E(N(y,h),N(m,m)),O(y)?null:(d=M(d,y),y=M(b(p,N(d,m)),h),p=b(c,N(d,E(i,c))),m=b(f,N(d,E(u,f))),h=b(l,N(d,E(s,l))),i=b(o,N(y,E(t,o))),c=b(a,N(y,E(r,a))),u=b(e,N(y,E(n,e))),A(p,i)&&A(m,c)&&A(h,u)?[p,m,h]:null);throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument")}}function C(e){return 1===e.length?e[0]:1<e.length&&Array.isArray(e[0])&&e.every(function(e){return Array.isArray(e)&&1===e.length})?r(e):e}function T(e){return 2===e.length&&m(e[0])&&m(e[1])}function _(e){return 3===e.length&&m(e[0])&&m(e[1])&&m(e[2])}function I(e,t,r,n,i,a,o,s,u,c,f,l){e=N(E(e,t),E(r,n)),t=N(E(i,a),E(o,s)),r=N(E(u,c),E(f,l));return b(b(e,t),r)}}),Eu=l("sum",["typed","config","add","numeric"],function(e){var t=e.typed,n=e.config,i=e.add,a=e.numeric;return t("sum",{"Array | Matrix":r,"Array | Matrix, number | BigNumber":function(e,t){try{return Gt(e,t,i)}catch(e){throw g(e,"sum")}},"...":function(e){if($t(e))throw new TypeError("Scalar values expected in function sum");return r(e)}});function r(e){var r;return Ht(e,function(t){try{r=void 0===r?t:i(r,t)}catch(e){throw g(e,"sum",t)}}),r="string"==typeof(r=void 0===r?a(0,n.number):r)?a(r,n.number):r}}),Su=l("cumsum",["typed","add","unaryPlus"],function(e){var t=e.typed,n=e.add,i=e.unaryPlus;return t("cumsum",{Array:r,Matrix:function(e){return e.create(r(e.valueOf()))},"Array, number | BigNumber":a,"Matrix, number | BigNumber":function(e,t){return e.create(a(e.valueOf(),t))},"...":function(e){if($t(e))throw new TypeError("All values expected to be scalar in function cumsum");return r(e)}});function r(e){try{return s(e)}catch(e){throw g(e,"cumsum")}}function s(e){if(0===e.length)return[];for(var t=[i(e[0])],r=1;r<e.length;++r)t.push(n(t[r-1],e[r]));return t}function a(e,t){var r=_(e);if(t<0||t>=r.length)throw new Pe(t,r.length);try{return function e(t,r){var n,i,a;if(r<=0){var o=t[0][0];if(Array.isArray(o)){for(a=Lt(t),i=[],n=0;n<a.length;n++)i[n]=e(a[n],r-1);return i}return s(t)}for(i=[],n=0;n<t.length;n++)i[n]=e(t[n],r-1);return i}(e,t)}catch(e){throw g(e,"cumsum")}}}),Au=l("mean",["typed","add","divide"],function(e){var t=e.typed,i=e.add,a=e.divide;return t("mean",{"Array | Matrix":r,"Array | Matrix, number | BigNumber":function(e,t){try{var r=Gt(e,t,i),n=Array.isArray(e)?_(e):e.size();return a(r,n[t])}catch(e){throw g(e,"mean")}},"...":function(e){if($t(e))throw new TypeError("Scalar values expected in function mean");return r(e)}});function r(e){var r,n=0;if(Ht(e,function(t){try{r=void 0===r?t:i(r,t),n++}catch(e){throw g(e,"mean",t)}}),0===n)throw new Error("Cannot calculate the mean of an empty array");return a(r,n)}}),Ou=l("median",["typed","add","divide","compare","partitionSelect"],function(e){var t=e.typed,r=e.add,n=e.divide,s=e.compare,u=e.partitionSelect;function i(e){try{var t=(e=b(e.valueOf())).length;if(0===t)throw new Error("Cannot calculate median of an empty array");if(t%2==0){for(var r=t/2-1,n=u(e,1+r),i=e[r],a=0;a<r;++a)0<s(e[a],i)&&(i=e[a]);return f(i,n)}var o=u(e,(t-1)/2);return c(o)}catch(e){throw g(e,"median")}}var c=t({"number | BigNumber | Complex | Unit":function(e){return e}}),f=t({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(e,t){return n(r(e,t),2)}});return t("median",{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(e,t){throw new Error("median(A, dim) is not yet supported")},"...":function(e){if($t(e))throw new TypeError("Scalar values expected in function median");return i(e)}})}),Cu=l("mad",["typed","abs","map","median","subtract"],function(e){var t=e.typed,r=e.abs,n=e.map,i=e.median,a=e.subtract;return t("mad",{"Array | Matrix":o,"...":o});function o(e){if(0===(e=b(e.valueOf())).length)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var t=i(e);return i(n(e,function(e){return r(a(e,t))}))}catch(e){throw e instanceof TypeError&&-1!==e.message.indexOf("median")?new TypeError(e.message.replace("median","mad")):g(e,"mad")}}}),Tu=l("variance",["typed","add","subtract","multiply","divide","apply","isNaN"],function(e){var t=e.typed,o=e.add,s=e.subtract,u=e.multiply,c=e.divide,n=e.apply,f=e.isNaN;return t("variance",{"Array | Matrix":function(e){return i(e,"unbiased")},"Array | Matrix, string":i,"Array | Matrix, number | BigNumber":function(e,t){return r(e,t,"unbiased")},"Array | Matrix, number | BigNumber, string":r,"...":function(e){return i(e,"unbiased")}});function i(e,t){var r=0;if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(Ht(e,function(t){try{i=void 0===i?t:o(i,t),r++}catch(e){throw g(e,"variance",t)}}),0===r)throw new Error("Cannot calculate variance of an empty array");var n=c(i,r),i=void 0;if(Ht(e,function(e){e=s(e,n);i=void 0===i?u(e,e):o(i,u(e,e))}),f(i))return i;switch(t){case"uncorrected":return c(i,r);case"biased":return c(i,r+1);case"unbiased":var a=ee(i)?i.mul(0):0;return 1===r?a:c(i,r-1);default:throw new Error('Unknown normalization "'+t+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function r(e,t,r){try{if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return n(e,t,function(e){return i(e,r)})}catch(e){throw g(e,"variance")}}}),_u=l("quantileSeq",["typed","add","multiply","partitionSelect","compare"],function(e){var t=e.typed,d=e.add,y=e.multiply,g=e.partitionSelect,v=e.compare;function h(e,t,r){var n=b(e),e=n.length;if(0===e)throw new Error("Cannot calculate quantile of an empty sequence");if(K(t)){var i=t*(e-1),a=i%1;if(0==a)return f=r?n[i]:g(n,i),x(f),f;var o=Math.floor(i);if(r)u=n[o],s=n[o+1];else for(var s=g(n,o+1),u=n[o],c=0;c<o;++c)0<v(n[c],u)&&(u=n[c]);return x(u),x(s),d(y(u,1-a),y(s,a))}var f=t.times(e-1);if(f.isInteger())return f=f.toNumber(),i=r?n[f]:g(n,f),x(i),i;var s=f.floor(),a=f.minus(s),l=s.toNumber();if(r)m=n[l],p=n[l+1];else for(var p=g(n,l+1),m=n[l],h=0;h<l;++h)0<v(n[h],m)&&(m=n[h]);x(m),x(p);t=new a.constructor(1);return d(y(m,t.minus(a)),y(p,a))}var x=t({"number | BigNumber | Unit":function(e){return e}});return function(e,t,r){var n,i;if(arguments.length<2||3<arguments.length)throw new SyntaxError("Function quantileSeq requires two or three parameters");if(S(e)){if("boolean"!=typeof(r=r||!1))throw new TypeError("Unexpected type of argument in function quantileSeq");if(n=e.valueOf(),K(t)){if(t<0)throw new Error("N/prob must be non-negative");if(t<=1)return h(n,t,r);if(1<t){if(!E(t))throw new Error("N must be a positive integer");for(var a=t+1,o=new Array(t),s=0;s<t;)o[s]=h(n,++s/a,r);return o}}if(ee(t)){var u=t.constructor;if(t.isNegative())throw new Error("N/prob must be non-negative");if(i=new u(1),t.lte(i))return new u(h(n,t,r));if(t.gt(i)){if(!t.isInteger())throw new Error("N must be a positive integer");var c=t.toNumber();if(4294967295<c)throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var f=new u(c+1);o=new Array(c);for(var l=0;l<c;)o[l]=new u(h(n,new u(++l).div(f),r));return o}}if(Array.isArray(t)){o=new Array(t.length);for(var p=0;p<o.length;++p){var m=t[p];if(K(m)){if(m<0||1<m)throw new Error("Probability must be between 0 and 1, inclusive")}else{if(!ee(m))throw new TypeError("Unexpected type of argument in function quantileSeq");if(i=new m.constructor(1),m.isNegative()||m.gt(i))throw new Error("Probability must be between 0 and 1, inclusive")}o[p]=h(n,m,r)}return o}throw new TypeError("Unexpected type of argument in function quantileSeq")}throw new TypeError("Unexpected type of argument in function quantileSeq")}}),Iu=l("std",["typed","sqrt","variance"],function(e){var t=e.typed,r=e.sqrt,n=e.variance;return t("std",{"Array | Matrix":i,"Array | Matrix, string":i,"Array | Matrix, number | BigNumber":i,"Array | Matrix, number | BigNumber, string":i,"...":function(e){return i(e)}});function i(e,t){if(0===e.length)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{return r(n.apply(null,arguments))}catch(e){throw e instanceof TypeError&&-1!==e.message.indexOf(" variance")?new TypeError(e.message.replace(" variance"," std")):e}}});function ku(e,t){if(t<e)return 1;if(t===e)return t;var r=t+e>>1;return ku(e,r)*ku(1+r,t)}function zu(e,t){if(!E(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!E(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(e<t)throw new TypeError("k must be less than or equal to n");for(var r=e-t,n=1,i=2,a=t<r?t:r,o=t<r?1+r:t+1;o<=e;++o)for(n*=o;i<=a&&n%i==0;)n/=i,++i;return i<=a&&(n/=ku(i,a)),n}zu.signature="number, number";var Ru=l("combinations",["typed"],function(e){return(0,e.typed)("combinations",{"number, number":zu,"BigNumber, BigNumber":function(e,t){var r,n,i=e.constructor,a=e.minus(t),o=new i(1);if(!qu(e)||!qu(t))throw new TypeError("Positive integer value expected in function combinations");if(t.gt(e))throw new TypeError("k must be less than n in function combinations");if(r=o,t.lt(a))for(n=o;n.lte(a);n=n.plus(o))r=r.times(t.plus(n)).dividedBy(n);else for(n=o;n.lte(t);n=n.plus(o))r=r.times(a.plus(n)).dividedBy(n);return r}})});function qu(e){return e.isInteger()&&e.gte(0)}var Bu=l("combinationsWithRep",["typed"],function(e){return(0,e.typed)("combinationsWithRep",{"number, number":function(e,t){if(!E(e)||e<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!E(t)||t<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(e<1)throw new TypeError("k must be less than or equal to n + k - 1");return t<e-1?ku(e,e+t-1)/ku(1,t):ku(t+1,e+t-1)/ku(1,e-1)},"BigNumber, BigNumber":function(e,t){var r,n,i=new e.constructor(1),a=e.minus(i);if(!Du(e)||!Du(t))throw new TypeError("Positive integer value expected in function combinationsWithRep");if(e.lt(i))throw new TypeError("k must be less than or equal to n + k - 1 in function combinationsWithRep");if(r=i,t.lt(a))for(n=i;n.lte(a);n=n.plus(i))r=r.times(t.plus(n)).dividedBy(n);else for(n=i;n.lte(t);n=n.plus(i))r=r.times(a.plus(n)).dividedBy(n);return r}})});function Du(e){return e.isInteger()&&e.gte(0)}function ju(e){var t,r,n;if(E(e))return e<=0?isFinite(e)?1/0:NaN:171<e?1/0:ku(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*ju(1-e));if(171.35<=e)return 1/0;if(85<e)return n=(r=(t=(o=e*e)*e)*e)*e,Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*o)-139/(51840*t)-571/(2488320*r)+163879/(209018880*n)+5246819/(75246796800*n*e));--e;for(var i=Fu[0],a=1;a<Fu.length;++a)i+=Fu[a]/(e+a);var o=e+Pu+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,e+.5)*Math.exp(-o)*i}var Pu=4.7421875,Fu=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],Uu=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];function Lu(e){if(e<0)return NaN;if(0===e)return 1/0;if(!isFinite(e))return e;if(e<.5)return Math.log(Math.PI/Math.sin(Math.PI*e))-Lu(1-e);for(var t=5+--e+.5,r=Uu[0],n=6;1<=n;n--)r+=Uu[n]/(e+n);return.9189385332046728+(e+.5)*Math.log(t)-t+Math.log(r)}Lu.signature=ju.signature="number";var $u=l("gamma",["typed","config","multiplyScalar","pow","BigNumber","Complex"],function(e){var t=e.typed,o=e.config,s=(e.multiplyScalar,e.pow,e.BigNumber),u=e.Complex;return t("gamma",{number:ju,Complex:function(e){if(0===e.im)return this(e.re);if(e.re<.5)return a=new u(1-e.re,-e.im),i=new u(Math.PI*e.re,Math.PI*e.im),new u(Math.PI).div(i.sin()).div(this(a));e=new u(e.re-1,e.im);for(var t=new u(Fu[0],0),r=1;r<Fu.length;++r)var n=new u(Fu[r],0),t=t.add(n.div(e.add(r)));var i=new u(e.re+Pu+.5,e.im),a=Math.sqrt(2*Math.PI),o=i.pow(e.add(.5)),i=i.neg().exp();return t.mul(a).mul(o).mul(i)},BigNumber:function(e){if(e.isInteger())return e.isNegative()||e.isZero()?new s(1/0):function e(t){if(t<8)return new s([1,1,2,6,24,120,720,5040][t]);var r=o.precision+(0|Math.log(t.toNumber())),r=s.clone({precision:r});if(t%2==1)return t.times(e(new s(t-1)));for(var n=t,i=new r(t),a=t.toNumber();2<n;)a+=n-=2,i=i.times(a);return new s(i.toPrecision(s.precision))}(e.minus(1));if(e.isFinite())throw new Error("Integer BigNumber expected");return new s(e.isNegative()?NaN:1/0)},"Array | Matrix":function(e){return me(e,this)}})}),Hu=l("lgamma",["Complex","typed"],function(e){var c=e.Complex,e=e.typed,f=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return e("lgamma",{number:Lu,Complex:function(e){var t,r,n;return e.isNaN()?new c(NaN,NaN):0===e.im?new c(Lu(e.re),0):7<=e.re||7<=Math.abs(e.im)?a(e):e.re<=.1?(r=6.283185307179586,t=(!0^(0<(t=e.im)||!(t<0)&&1/t==1/0)?-r:r)*Math.floor(.5*e.re+.25),r=e.mul(Math.PI).sin().log(),n=this(new c(1-e.re,-e.im)),new c(1.1447298858494002,t).sub(r).sub(n)):0<=e.im?i(e):i(e.conjugate()).conjugate()},BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function a(e){for(var t=e.sub(.5).mul(e.log()).sub(e).add(.9189385332046728),r=new c(1,0).div(e),e=r.div(e),n=f[0],i=f[1],a=2*e.re,o=e.re*e.re+e.im*e.im,s=2;s<8;s++)var u=i,i=-o*n+f[s],n=a*n+u;r=r.mul(e.mul(n).add(i));return t.add(r)}function i(e){var t=0,r=0,n=e;for(e=e.add(1);e.re<=7;){var i=(n=n.mul(e)).im<0?1:0;0!=i&&0===r&&t++,r=i,e=e.add(1)}return a(e).sub(n.log()).sub(new c(0,2*t*Math.PI*1))}}),Gu=l("factorial",["typed","gamma"],function(e){var t=e.typed,r=e.gamma;return t("factorial",{number:function(e){if(e<0)throw new Error("Value must be non-negative");return r(e+1)},BigNumber:function(e){if(e.isNegative())throw new Error("Value must be non-negative");return r(e.plus(1))},"Array | Matrix":function(e){return me(e,this)}})}),Vu=l("kldivergence",["typed","matrix","divide","sum","multiply","dotDivide","log","isNumeric"],function(e){var t=e.typed,r=e.matrix,i=e.divide,a=e.sum,o=e.multiply,s=e.dotDivide,u=e.log,c=e.isNumeric;return t("kldivergence",{"Array, Array":function(e,t){return n(r(e),r(t))},"Matrix, Array":function(e,t){return n(e,r(t))},"Array, Matrix":function(e,t){return n(r(e),t)},"Matrix, Matrix":n});function n(e,t){var r=t.size().length,n=e.size().length;if(1<r)throw new Error("first object must be one dimensional");if(1<n)throw new Error("second object must be one dimensional");if(r!==n)throw new Error("Length of two vectors must be equal");if(0===a(e))throw new Error("Sum of elements in first object must be non zero");if(0===a(t))throw new Error("Sum of elements in second object must be non zero");r=i(e,a(e)),n=i(t,a(t)),e=a(o(r,u(s(r,n))));return c(e)?e:Number.NaN}}),Zu=l("multinomial",["typed","add","divide","multiply","factorial","isInteger","isPositive"],function(e){var t=e.typed,n=e.add,i=e.divide,a=e.multiply,o=e.factorial,s=e.isInteger,u=e.isPositive;return t("multinomial",{"Array | Matrix":function(e){var t=0,r=1;return Ht(e,function(e){if(!s(e)||!u(e))throw new TypeError("Positive integer value expected in function multinomial");t=n(t,e),r=a(r,o(e))}),i(o(t),r)}})}),Wu=l("permutations",["typed","factorial"],function(e){return(0,e.typed)("permutations",{"number | BigNumber":e.factorial,"number, number":function(e,t){if(!E(e)||e<0)throw new TypeError("Positive integer value expected in function permutations");if(!E(t)||t<0)throw new TypeError("Positive integer value expected in function permutations");if(e<t)throw new TypeError("second argument k must be less than or equal to first argument n");return ku(e-t+1,e)},"BigNumber, BigNumber":function(e,t){var r,n;if(!Yu(e)||!Yu(t))throw new TypeError("Positive integer value expected in function permutations");if(t.gt(e))throw new TypeError("second argument k must be less than or equal to first argument n");for(r=e.mul(0).add(1),n=e.minus(t).plus(1);n.lte(e);n=n.plus(1))r=r.times(n);return r}})});function Yu(e){return e.isInteger()&&e.gte(0)}var r=e(137),Ju=e.n(r),Xu=Ju()(Date.now());function Qu(e){var t=null===(e=e)?Xu:Ju()(String(e));return function(){return t()}}var Ku=l("pickRandom",["typed","config","?on"],function(e){var t=e.typed,r=e.config,e=e.on,d=Qu(r.randomSeed);return e&&e("config",function(e,t){e.randomSeed!==t.randomSeed&&(d=Qu(e.randomSeed))}),t("pickRandom",{"Array | Matrix":function(e){return n(e,{})},"Array | Matrix, Object":n,"Array | Matrix, number":function(e,t){return n(e,{number:t})},"Array | Matrix, Array | Matrix":function(e,t){return n(e,{weights:t})},"Array | Matrix, Array | Matrix, number":function(e,t,r){return n(e,{number:r,weights:t})},"Array | Matrix, number, Array | Matrix":function(e,t,r){return n(e,{number:t,weights:r})}});function n(e,t){var r=t.number,n=t.weights,t=t.elementWise,t=void 0===t||t,i=void 0===r,a=(i&&(r=1),F(e)?e.create:F(n)?n.create:null),o=(e=e.valueOf(),n=n&&n.valueOf(),!0===t&&(e=b(e),n=b(n)),0);if(void 0!==n){if(n.length!==e.length)throw new Error("Weights must have the same length as possibles");for(var s=0,u=n.length;s<u;s++){if(!K(n[s])||n[s]<0)throw new Error("Weights must be an array of positive numbers");o+=n[s]}}for(var c,f=e.length,l=[];l.length<r;){if(void 0===n)c=e[Math.floor(d()*f)];else for(var p=d()*o,m=0,h=e.length;m<h;m++)if((p-=n[m])<0){c=e[m];break}l.push(c)}return i?l[0]:a?a(l):l}});function ec(e,t){var r=[];if(1<(e=e.slice(0)).length)for(var n=0,i=e.shift();n<i;n++)r.push(ec(e,t));else for(var a=0,o=e.shift();a<o;a++)r.push(t());return r}var tc=l("random",["typed","config","?on"],function(e){var t=e.typed,r=e.config,e=e.on,n=Qu(r.randomSeed);return e&&e("config",function(e,t){e.randomSeed!==t.randomSeed&&(n=Qu(e.randomSeed))}),t("random",{"":function(){return a(0,1)},number:function(e){return a(0,e)},"number, number":a,"Array | Matrix":function(e){return i(e,0,1)},"Array | Matrix, number":function(e,t){return i(e,0,t)},"Array | Matrix, number, number":i});function i(e,t,r){var n=ec(e.valueOf(),function(){return a(t,r)});return F(e)?e.create(n):n}function a(e,t){return e+n()*(t-e)}}),rc=l("randomInt",["typed","config","?on"],function(e){var t=e.typed,r=e.config,e=e.on,n=Qu(r.randomSeed);return e&&e("config",function(e,t){e.randomSeed!==t.randomSeed&&(n=Qu(e.randomSeed))}),t("randomInt",{"":function(){return a(0,1)},number:function(e){return a(0,e)},"number, number":a,"Array | Matrix":function(e){return i(e,0,1)},"Array | Matrix, number":function(e,t){return i(e,0,t)},"Array | Matrix, number, number":i});function i(e,t,r){var n=ec(e.valueOf(),function(){return a(t,r)});return F(e)?e.create(n):n}function a(e,t){return Math.floor(e+n()*(t-e))}}),nc=l("stirlingS2",["typed","addScalar","subtract","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],function(e){var t=e.typed,l=e.addScalar,p=(e.subtract,e.multiplyScalar),m=(e.divideScalar,e.pow,e.factorial,e.combinations,e.isNegative),h=e.isInteger,d=e.number,y=e.bignumber,g=e.larger,v=[],x=[];return t("stirlingS2",{"number | BigNumber, number | BigNumber":function(e,t){if(!h(e)||m(e)||!h(t)||m(t))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(g(t,e))throw new TypeError("k must be less than or equal to n in function stirlingS2");var r=!(K(e)&&K(t)),n=r?x:v,i=r?y:d,a=d(e),o=d(t);if(n[a]&&n[a].length>o)return n[a][o];for(var s=0;s<=a;++s)if(n[s]||(n[s]=[i(0===s?1:0)]),0!==s)for(var u=n[s],c=n[s-1],f=u.length;f<=s&&f<=o;++f)u[f]=f===s?1:l(p(i(f),c[f]),c[f-1]);return n[a][o]}})}),ic=l("bellNumbers",["typed","addScalar","isNegative","isInteger","stirlingS2"],function(e){var t=e.typed,n=e.addScalar,i=e.isNegative,a=e.isInteger,o=e.stirlingS2;return t("bellNumbers",{"number | BigNumber":function(e){if(!a(e)||i(e))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var t=0,r=0;r<=e;r++)t=n(t,o(e,r));return t}})}),ac=l("catalan",["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],function(e){var t=e.typed,r=e.addScalar,n=e.divideScalar,i=e.multiplyScalar,a=e.combinations,o=e.isNegative,s=e.isInteger;return t("catalan",{"number | BigNumber":function(e){if(!s(e)||o(e))throw new TypeError("Non-negative integer value expected in function catalan");return n(a(i(e,2),e),r(e,1))}})}),oc=l("composition",["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],function(e){var t=e.typed,r=e.addScalar,n=e.combinations,i=e.isPositive,a=(e.isNegative,e.isInteger),o=e.larger;return t("composition",{"number | BigNumber, number | BigNumber":function(e,t){if(!(a(e)&&i(e)&&a(t)&&i(t)))throw new TypeError("Positive integer value expected in function composition");if(o(t,e))throw new TypeError("k must be less than or equal to n in function composition");return n(r(e,-1),r(t,-1))}})}),sc=l("leafCount",["parse","typed"],function(e){var t=e.parse;return(0,e.typed)("leafCount",{string:function(e){return this(t(e))},Node:function t(e){var r=0;return e.forEach(function(e){r+=t(e)}),r||1}})});function uc(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function cc(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?uc(Object(r),!0).forEach(function(e){Qa()(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):uc(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}e(274);var fc=l("simplifyUtil",["FunctionNode","OperatorNode","SymbolNode"],function(e){var r=e.FunctionNode,n=e.OperatorNode,i=e.SymbolNode,a={add:{trivial:!0,total:!0,commutative:!0,associative:!0},unaryPlus:{trivial:!0,total:!0,commutative:!0,associative:!0},subtract:{trivial:!1,total:!0,commutative:!1,associative:!1},multiply:{trivial:!0,total:!0,commutative:!0,associative:!0},divide:{trivial:!1,total:!0,commutative:!1,associative:!1},paren:{trivial:!0,total:!0,commutative:!0,associative:!1},defaultF:{trivial:!1,total:!0,commutative:!1,associative:!1}};function t(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:a,n="defaultF";if("string"==typeof e?n=e:fe(e)?n=e.fn.toString():de(e)?n=e.name:Q(e)&&(n="paren"),pe(r,n)){var e=r[n];if(pe(e,t))return e[t];if(pe(a,n))return a[n][t]}if(pe(r,"defaultF"))return(pe(e=r.defaultF,t)?e:a.defaultF)[t];if(pe(a,n)){r=a[n];if(pe(r,t))return r[t]}return a.defaultF[t]}function s(e){return t(e,"associative",1<arguments.length&&void 0!==arguments[1]?arguments[1]:a)}function o(e,t){var i,a=[];return s(e,t)?(i=e.op,function e(t){for(var r=0;r<t.args.length;r++){var n=t.args[r];fe(n)&&i===n.op?e(n):a.push(n)}}(e),a):e.args}function u(t){return fe(t)?function(e){try{return new n(t.op,t.fn,e,t.implicit)}catch(e){return console.error(e),[]}}:function(e){return new r(new i(t.name),e)}}return{createMakeNodeFunction:u,hasProperty:t,isCommutative:function(e){return t(e,"commutative",1<arguments.length&&void 0!==arguments[1]?arguments[1]:a)},isAssociative:s,mergeContext:function(e,t){var r,n=cc({},e);for(r in t)pe(e,r)?n[r]=cc(cc({},t[r]),e[r]):n[r]=t[r];return n},flatten:function e(t,r){if(!t.args||0===t.args.length)return t;t.args=o(t,r);for(var n=0;n<t.args.length;n++)e(t.args[n],r)},allChildren:o,unflattenr:function e(t,r){if(t.args&&0!==t.args.length){for(var n=u(t),i=t.args.length,a=0;a<i;a++)e(t.args[a],r);if(2<i&&s(t,r)){for(var o=t.args.pop();0<t.args.length;)o=n([t.args.pop(),o]);t.args=o.args}}},unflattenl:function e(t,r){if(t.args&&0!==t.args.length){for(var n=u(t),i=t.args.length,a=0;a<i;a++)e(t.args[a],r);if(2<i&&s(t,r)){for(var o=t.args.shift();0<t.args.length;)o=n([o,t.args.shift()]);t.args=o.args}}},defaultContext:a,realContext:{divide:{total:!1},log:{total:!1}},positiveContext:{subtract:{total:!1},abs:{trivial:!0},log:{total:!0}}}});function lc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var pc=l("simplifyConstant",["typed","config","mathWithTransform","matrix","?fraction","?bignumber","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode"],function(e){var t=e.typed,r=e.config,E=e.mathWithTransform,S=e.matrix,n=e.fraction,i=e.bignumber,A=e.AccessorNode,O=e.ArrayNode,C=e.ConstantNode,T=e.FunctionNode,_=e.IndexNode,I=e.ObjectNode,a=e.OperatorNode,e=e.SymbolNode,e=fc({FunctionNode:T,OperatorNode:a,SymbolNode:e}),k=e.isCommutative,z=e.isAssociative,R=e.allChildren,q=e.createMakeNodeFunction;function o(e){return ae(e)?e.valueOf():e instanceof Array?e.map(o):F(e)?S(o(e.valueOf())):e}function B(t,r,n){try{return E[t].apply(null,r)}catch(e){return r=r.map(o),j(E[t].apply(null,r),n)}}var s=t({Fraction:function(e){var t=e.s*e.n,t=t<0?new a("-","unaryMinus",[new C(-t)]):new C(t);return 1===e.d?t:new a("/","divide",[t,new C(e.d)])},number:function(e){return e<0?c(new C(-e)):new C(e)},BigNumber:function(e){return e<0?c(new C(-e)):new C(e)},Complex:function(e){throw new Error("Cannot convert Complex number to Node")},string:function(e){return new C(e)},Matrix:function(e){return new O(e.valueOf().map(function(e){return s(e)}))}});function D(e){return L(e)?e:s(e)}function u(e,t){if(t&&!1!==t.exactFractions&&isFinite(e)&&n){var r=n(e),t=t&&"number"==typeof t.fractionsLimit?t.fractionsLimit:1/0;if(r.valueOf()===e&&r.n<t&&r.d<t)return r}return e}var j=t({"string, Object":function(e,t){return"BigNumber"===r.number?(void 0===i&&Ai(),i(e)):"Fraction"===r.number?(void 0===n&&Oi(),n(e)):u(parseFloat(e),t)},"Fraction, Object":function(e,t){return e},"BigNumber, Object":function(e,t){return e},"number, Object":u,"Complex, Object":function(e,t){return 0!==e.im?e:u(e.re,t)},"Matrix, Object":function(e,t){return S(u(e.valueOf()))},"Array, Object":function(e,t){return e.map(u)}});function c(e){return new a("-","unaryMinus",[e])}function P(r,e,n,i){return e.reduce(function(e,t){if(L(e)||L(t))L(e)?L(t)||(t=s(t)):e=s(e);else{try{return B(r,[e,t],i)}catch(e){}e=s(e),t=s(t)}return n([e,t])})}return function M(e,t){return D(function t(e,r){switch(e.type){case"SymbolNode":return e;case"ConstantNode":switch(Z()(e.value)){case"number":return j(e.value,r);case"string":return e.value;default:if(!isNaN(e.value))return j(e.value,r)}return e;case"FunctionNode":if(E[e.name]&&E[e.name].rawArgs)return e;if(-1===["add","multiply"].indexOf(e.name)){if(!(o=e.args.map(function(e){return t(e,r)})).some(L))try{return B(e.name,o,r)}catch(t){}if("size"===e.name&&1===o.length&&U(o[0])){for(var n=[],i=o[0];U(i);)n.push(i.items.length),i=i.items[0];return S(n)}return new T(e.name,o.map(D))}case"OperatorNode":var a,o=e.fn.toString(),s=q(e);if(fe(e)&&e.isUnary())b=L((a=[t(e.args[0],r)])[0])?s(a):B(o,a,r);else if(z(e,r.context))if(a=(a=R(e,r.context)).map(function(e){return t(e,r)}),k(o,r.context)){for(var u=[],c=[],f=0;f<a.length;f++)(L(a[f])?c:u).push(a[f]);b=1<u.length?(b=P(o,u,s,r),c.unshift(b),P(o,c,s,r)):P(o,a,s,r)}else b=P(o,a,s,r);else b=P(o,a=e.args.map(function(e){return t(e,r)}),s,r);return b;case"ParenthesisNode":return t(e.content,r);case"AccessorNode":var l=t(e.object,r),o=t(e.index,r),p=r;if(!J(o))return new A(D(l),D(o));if(U(l)||F(l)){for(var m=Array.from(o.dimensions);0<m.length;)if(ce(m[0])&&"string"!=typeof m[0].value){var h=j(m.shift().value,p);U(l)?l=l.items[h-1]:(l=l.valueOf()[h-1])instanceof Array&&(l=S(l))}else{if(!(1<m.length&&ce(m[1])&&"string"!=typeof m[1].value))break;var d,y=j(m[1].value,p),g=[],v=function(e,t){var r,n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e){if(e){if("string"==typeof e)return lc(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(t="Object"===t&&e.constructor?e.constructor.name:t)||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?lc(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length)return n&&(e=n),r=0,{s:t=function(){},n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(o)throw i}}}}(h=U(l)?l.items:l.valueOf());try{for(v.s();!(d=v.n()).done;){var x=d.value;if(U(x))g.push(x.items[y-1]);else{if(!F(l))break;g.push(x[y-1])}}}catch(l){v.e(l)}finally{v.f()}if(g.length!==h.length)break;l=U(l)?new O(g):S(g),m.splice(1,1)}return m.length===o.dimensions.length?new A(D(l),o):0<m.length?(o=new _(m),new A(D(l),o)):l}return X(l)&&1===o.dimensions.length&&ce(o.dimensions[0])?(s=o.dimensions[0].value)in l.properties?l.properties[s]:new C:new A(D(l),o);case"ArrayNode":var b=e.items.map(function(e){return t(e,r)});return b.some(L)?new O(b.map(D)):S(b);case"IndexNode":return new _(e.dimensions.map(function(e){return M(e,r)}));case"ObjectNode":var w,N={};for(w in e.properties)N[w]=M(e.properties[w],r);return new I(N);default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(e.type))}}(e,t))}}),mc=l("simplify",["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],function(e){var t=e.config,r=e.typed,p=e.parse,m=(e.add,e.subtract,e.multiply,e.divide,e.pow,e.isZero,e.equal),h=e.resolve,n=e.simplifyCore,i=e.fraction,a=e.bignumber,o=e.mathWithTransform,s=e.matrix,d=e.AccessorNode,y=e.ArrayNode,g=e.ConstantNode,v=e.FunctionNode,x=e.IndexNode,b=e.ObjectNode,w=e.OperatorNode,N=e.ParenthesisNode,M=e.SymbolNode,e=pc({typed:r,config:t,mathWithTransform:o,matrix:s,fraction:i,bignumber:a,AccessorNode:d,ArrayNode:y,ConstantNode:g,FunctionNode:v,IndexNode:x,ObjectNode:b,OperatorNode:w,SymbolNode:M}),t=fc({FunctionNode:v,OperatorNode:w,SymbolNode:M}),E=t.hasProperty,S=t.isCommutative,A=t.isAssociative,O=t.mergeContext,C=t.flatten,T=t.unflattenr,_=t.unflattenl,I=t.createMakeNodeFunction,o=t.defaultContext,s=t.realContext,i=t.positiveContext,a=r("simplify",{string:function(e){return this(p(e),this.rules,wt(),{})},"string, Map | Object":function(e,t){return this(p(e),this.rules,t,{})},"string, Map | Object, Object":function(e,t,r){return this(p(e),this.rules,t,r)},"string, Array":function(e,t){return this(p(e),t,wt(),{})},"string, Array, Map | Object":function(e,t,r){return this(p(e),t,r,{})},"string, Array, Map | Object, Object":function(e,t,r,n){return this(p(e),t,r,n)},"Node, Map | Object":function(e,t){return this(e,this.rules,t,{})},"Node, Map | Object, Object":function(e,t,r){return this(e,this.rules,t,r)},Node:function(e){return this(e,this.rules,wt(),{})},"Node, Array":function(e,t){return this(e,t,wt(),{})},"Node, Array, Map | Object":function(e,t,r){return this(e,t,r,{})},"Node, Array, Object, Object":function(e,t,r,n){return this(e,t,Nt(r),n)},"Node, Array, Map, Object":function(e,t,r,n){var i=n.consoleDebug;t=function(e,t){for(var r=[],n=0;n<e.length;n++){var i=e[n],a=void 0,o=Z()(i);switch(o){case"string":i={s:i};case"object":a=function(e,t){var r={};if(e.s){var n=e.s.split("->");if(2!==n.length)throw SyntaxError("Could not parse rule: "+e.s);r.l=n[0],r.r=n[1]}else r.l=e.l,r.r=e.r;r.l=k(p(r.l)),r.r=k(p(r.r));for(var i=0,a=["imposeContext","repeat","assuming"];i<a.length;i++){var o=a[i];o in e&&(r[o]=e[o])}{var s;e.evaluate&&(r.evaluate=p(e.evaluate)),A(r.l,t)&&(n=I(r.l),s=new M("_p"+R++),r.expanded={},r.expanded.l=n([r.l.clone(),s]),C(r.expanded.l,t),T(r.expanded.l,t),r.expanded.r=n([r.r,s]))}return r}(i,t);break;case"function":a=i;break;default:throw TypeError("Unsupported type of rule: "+o)}r.push(a)}return r}(t,n.context);for(var a=h(e,r),o={},s=(a=k(a)).toString({parenthesis:"all"});!o[s];){o[s]=!0,R=0;var u=s;i&&console.log("Working on: ",s);for(var c=0;c<t.length;c++){var f,l="";"function"==typeof t[c]?(a=t[c](a,n),i&&(l=t[c].name)):(C(a,n.context),a=B(a,t[c],n.context),i&&(l="".concat(t[c].l.toString()," -> ").concat(t[c].r.toString()))),i&&(f=a.toString({parenthesis:"all"}))!==u&&(console.log("Applying",l,"produced",f),u=f),_(a,n.context)}s=a.toString({parenthesis:"all"})}return a}});function k(e){return e.transform(function(e,t,r){return Q(e)?k(e.content):e})}a.defaultContext=o,a.realContext=s,a.positiveContext=i;var z={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};a.rules=[n,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(c*v) -> v * (-c)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(c*v) -> (-c) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*c) -> v * (-c)",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:" v   * ( v   * n1 + n2)",r:"v^2       * n1 +  v   * n2"},{s:" v   * (v^n4 * n1 + n2)   ->  v^(1+n4)  * n1 +  v   * n2",assuming:{divide:{total:!0}}},{s:"v^n3 * ( v   * n1 + n2)   ->  v^(n3+1)  * n1 + v^n3 * n2",assuming:{divide:{total:!0}}},{s:"v^n3 * (v^n4 * n1 + n2)   ->  v^(n3+n4) * n1 + v^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}}},e,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"v*n + v",r:"v*(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*v + v -> (n+1)*v",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{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*c + c",r:"(n+1)*c"},{s:"c*n + c -> c*(n+1)",assuming:{multiply:{commutative:!1}}},e,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"c+v -> v+c",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"v*c -> c*v",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{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"}];var R=0;function q(e,t,r){var n=e;if(e)for(var i=0;i<e.length;++i){var a=B(e[i],t,r);a!==e[i]&&((n=n===e?e.slice():n)[i]=a)}return n}function B(e,t,r){if(t.assuming)for(var n in t.assuming)for(var i in t.assuming[n])if(E(n,i,r)!==t.assuming[n][i])return e;var a=O(t.imposeContext,r),o=e;if(o instanceof w||o instanceof v){var s=q(o.args,t,r);s!==o.args&&((o=o.clone()).args=s)}else if(o instanceof N)!o.content||(s=B(o.content,t,r))!==o.content&&(o=new N(s));else if(o instanceof y){s=q(o.items,t,r);s!==o.items&&(o=new y(s))}else if(o instanceof d){var s=o.object,u=(o.object&&(s=B(o.object,t,r)),o.index);o.index&&(u=B(o.index,t,r)),s===o.object&&u===o.index||(o=new d(s,u))}else if(o instanceof x){s=q(o.dimensions,t,r);s!==o.dimensions&&(o=new x(s))}else if(o instanceof b){var c,f=!1,l={};for(c in o.properties)l[c]=B(o.properties[c],t,r),l[c]!==o.properties[c]&&(f=!0);f&&(o=new b(l))}var u=t.r,p=j(t.l,o,a)[0];return!p&&t.expanded&&(u=t.expanded.r,p=j(t.expanded.l,o,a)[0]),p&&(s=o.implicit,o=u.clone(),s&&"implicit"in u&&(o.implicit=!0),o=o.transform(function(e){return e.isSymbolNode&&pe(p.placeholders,e.name)?p.placeholders[e.name].clone():e})),o=t.repeat&&o!==e?B(o,t,r):o}function u(e,t){var r,n,i={placeholders:{}};if(!e.placeholders&&!t.placeholders)return i;if(!e.placeholders)return t;if(!t.placeholders)return e;for(r in e.placeholders)if(pe(e.placeholders,r)&&(i.placeholders[r]=e.placeholders[r],pe(t.placeholders,r)&&!function e(t,r){if(t instanceof g&&r instanceof g){if(!m(t.value,r.value))return!1}else if(t instanceof M&&r instanceof M){if(t.name!==r.name)return!1}else{if(!(t instanceof w&&r instanceof w||t instanceof v&&r instanceof v))return!1;if(t instanceof w){if(t.op!==r.op||t.fn!==r.fn)return!1}else if(t instanceof v&&t.name!==r.name)return!1;if(t.args.length!==r.args.length)return!1;for(var n=0;n<t.args.length;n++)if(!e(t.args[n],r.args[n]))return!1}return!0}(e.placeholders[r],t.placeholders[r])))return null;for(n in t.placeholders)pe(t.placeholders,n)&&(i.placeholders[n]=t.placeholders[n]);return i}function D(e,t){var r,n=[];if(0===e.length||0===t.length)return n;for(var i=0;i<e.length;i++)for(var a=0;a<t.length;a++)(r=u(e[i],t[a]))&&n.push(r);return n}function j(e,t,r,n){var i=[{placeholders:{}}];if(e instanceof w&&t instanceof w||e instanceof v&&t instanceof v){if(e instanceof w){if(e.op!==t.op||e.fn!==t.fn)return[]}else if(e instanceof v&&e.name!==t.name)return[];if(!(1===t.args.length&&1===e.args.length||!A(t,r)&&t.args.length===e.args.length||n)){if(2<=t.args.length&&2===e.args.length){for(var a=function(e,t){var r,n,i=[],a=I(e);if(S(e,t))for(var o=0;o<e.args.length;o++)(n=e.args.slice(0)).splice(o,1),r=1===n.length?n[0]:a(n),i.push(a([e.args[o],r]));else for(var s=1;s<e.args.length;s++){var u=e.args[0];1<s&&(u=a(e.args.slice(0,s))),r=1===(n=e.args.slice(s)).length?n[0]:a(n),i.push(a([u,r]))}return i}(t,r),o=[],s=0;s<a.length;s++)var u=j(e,a[s],r,!0),o=o.concat(u);return o}if(2<e.args.length)throw Error("Unexpected non-binary associative function: "+e.toString());return[]}for(var c=[],f=0;f<e.args.length;f++){var l=j(e.args[f],t.args[f],r);if(0===l.length)break;c.push(l)}if(c.length!==e.args.length){if(!S(t,r)||1===e.args.length)return[];if(2<e.args.length)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");n=j(e.args[0],t.args[1],r);if(0===n.length)return[];var p=j(e.args[1],t.args[0],r);if(0===p.length)return[];c=[n,p]}i=function(e){if(0===e.length)return e;for(var t=e.reduce(D),r=[],n={},i=0;i<t.length;i++){var a=JSON.stringify(t[i]);n[a]||(n[a]=!0,r.push(t[i]))}return r}(c)}else if(e instanceof M){if(0===e.name.length)throw new Error("Symbol in rule has 0 length...!?");if(z[e.name]){if(e.name!==t.name)return[]}else if("n"===e.name[0]||"_p"===e.name.substring(0,2))i[0].placeholders[e.name]=t;else if("v"===e.name[0]){if(ce(t))return[];i[0].placeholders[e.name]=t}else{if("c"!==e.name[0])throw new Error("Invalid symbol in rule: "+e.name);if(!(t instanceof g))return[];i[0].placeholders[e.name]=t}}else{if(!(e instanceof g))return[];if(!m(e.value,t.value))return[]}return i}return a}),hc=l("simplifyCore",["equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],function(e){var l=e.equal,p=e.isZero,m=e.add,h=e.subtract,d=e.multiply,y=e.divide,g=e.pow,v=e.AccessorNode,x=e.ArrayNode,b=e.ConstantNode,w=e.FunctionNode,N=e.IndexNode,M=e.ObjectNode,E=e.OperatorNode,e=(e.ParenthesisNode,e.SymbolNode),S=new b(0),A=new b(1),e=fc({FunctionNode:w,OperatorNode:E,SymbolNode:e}),O=e.hasProperty,C=e.isCommutative;return function t(e,r){var n=r?r.context:void 0;if(O(e,"trivial",n)){if(de(e)&&1===e.args.length)return t(e.args[0],r);var i=!1,a=0;if(e.forEach(function(e){1==++a&&(i=t(e,r))}),1===a)return i}if(fe(e)&&e.isUnary()){var o=t(e.args[0],r);if("-"===e.op){if(fe(o)){if(o.isUnary()&&"-"===o.op)return o.args[0];if(o.isBinary()&&"subtract"===o.fn)return new E("-","subtract",[o.args[1],o.args[0]])}return new E(e.op,e.fn,[o])}}else{if(fe(e)&&e.isBinary()){var o=t(e.args[0],r),s=t(e.args[1],r);if("+"===e.op){if(ce(o)){if(p(o.value))return s;if(ce(s))return new b(m(o.value,s.value))}return ce(s)&&p(s.value)?o:fe(s)&&s.isUnary()&&"-"===s.op?new E("-","subtract",[o,s.args[0]]):new E(e.op,e.fn,s?[o,s]:[o])}if("-"===e.op){if(ce(o)&&s){if(ce(s))return new b(h(o.value,s.value));if(p(o.value))return new E("-","unaryMinus",[s])}if("subtract"===e.fn)return ce(s)&&p(s.value)?o:fe(s)&&s.isUnary()&&"-"===s.op?t(new E("+","add",[o,s.args[0]]),r):new E(e.op,e.fn,[o,s])}else{if("*"===e.op){if(ce(o)){if(p(o.value))return S;if(l(o.value,1))return s;if(ce(s))return new b(d(o.value,s.value))}if(ce(s)){if(p(s.value))return S;if(l(s.value,1))return o;if(fe(o)&&o.isBinary()&&o.op===e.op&&C(e,n)){var u=o.args[0];if(ce(u))return u=new b(d(u.value,s.value)),new E(e.op,e.fn,[u,o.args[1]],e.implicit)}return C(e,n)?new E(e.op,e.fn,[s,o],e.implicit):new E(e.op,e.fn,[o,s],e.implicit)}return new E(e.op,e.fn,[o,s],e.implicit)}if("/"===e.op){if(ce(o)){if(p(o.value))return S;if(ce(s)&&(l(s.value,1)||l(s.value,2)||l(s.value,4)))return new b(y(o.value,s.value))}return new E(e.op,e.fn,[o,s])}if("^"===e.op&&ce(s)){if(p(s.value))return A;if(l(s.value,1))return o;if(ce(o))return new b(g(o.value,s.value));if(fe(o)&&o.isBinary()&&"^"===o.op){u=o.args[1];if(ce(u))return new E(e.op,e.fn,[o.args[0],new b(d(u.value,s.value))])}}}return new E(e.op,e.fn,[o,s])}if(de(e))return new w(t(e.fn),e.args.map(function(e){return t(e,r)}));if(U(e))return new x(e.items.map(function(e){return t(e,r)}));if(he(e))return new v(t(e.object,r),t(e.index,r));if(J(e))return new N(e.dimensions.map(function(e){return t(e,r)}));if(X(e)){var c,f={};for(c in e.properties)f[c]=t(e.properties[c],r);return new M(f)}}return e}}),dc=l("resolve",["parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],function(e){var o=e.parse,s=e.ConstantNode,u=e.FunctionNode,c=e.OperatorNode,f=e.ParenthesisNode;return function t(e,r){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new Set;if(!r)return e;if(Mt(r)||(r=Nt(r)),le(e)){if(n.has(e.name))throw a=Array.from(n).join(", "),new ReferenceError("recursive loop of variable definitions among {".concat(a,"}"));var i,a=r.get(e.name);return L(a)?((i=new Set(n)).add(e.name),t(a,r,i)):"number"==typeof a?o(String(a)):void 0!==a?new s(a):e}return fe(e)?(i=e.args.map(function(e){return t(e,r,n)}),new c(e.op,e.fn,i,e.implicit)):Q(e)?new f(t(e.content,r,n)):de(e)?(a=e.args.map(function(e){return t(e,r,n)}),new u(e.name,a)):e.map(function(e){return t(e,r,n)})}}),yc=l("symbolicEqual",["parse","simplify","typed","OperatorNode"],function(e){var n=e.parse,i=e.simplify,t=e.typed,a=e.OperatorNode;return t("symbolicEqual",{"string, string":function(e,t){return this(n(e),n(t),{})},"string, string, Object":function(e,t,r){return this(n(e),n(t),r)},"Node, string":function(e,t){return this(e,n(t),{})},"Node, string, Object":function(e,t,r){return this(e,n(t),r)},"string, Node":function(e,t){return this(n(e),t,{})},"string, Node, Object":function(e,t,r){return this(n(e),t,r)},"Node, Node":function(e,t){return this(e,t,{})},"Node, Node, Object":function(e,t,r){e=new a("-","subtract",[e,t]),t=i(e,{},r);return ce(t)&&!t.value}})}),gc=l("derivative",["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],function(e){var t=e.typed,r=e.config,n=e.parse,i=e.simplify,a=e.equal,o=e.isZero,s=e.numeric,u=e.ConstantNode,p=e.FunctionNode,m=e.OperatorNode,c=e.ParenthesisNode,h=e.SymbolNode,e=t("derivative",{"Node, SymbolNode, Object":function(e,t,r){var n={},t=(l(n,e,t.name),d(e,n));return r.simplify?i(t):t},"Node, SymbolNode":function(e,t){return this(e,t,{simplify:!0})},"string, SymbolNode":function(e,t){return this(n(e),t)},"string, SymbolNode, Object":function(e,t,r){return this(n(e),t,r)},"string, string":function(e,t){return this(n(e),n(t))},"string, string, Object":function(e,t,r){return this(n(e),n(t),r)},"Node, string":function(e,t){return this(e,n(t))},"Node, string, Object":function(e,t,r){return this(e,n(t),r)}}),f=(e._simplify=!0,e.toTex=function(e){return f.apply(null,e.args)},t("_derivTex",{"Node, SymbolNode":function(e,t){return ce(e)&&"string"===te(e.value)?f(n(e.value).toString(),t.toString(),1):f(e.toTex(),t.toString(),1)},"Node, ConstantNode":function(e,t){if("string"===te(t.value))return f(e,n(t.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(e,t,r){return f(e.toString(),t.name,r.value)},"string, string, number":function(e,t,r){return(1===r?"{d\\over d"+t+"}":"{d^{"+r+"}\\over d"+t+"^{"+r+"}}")+"\\left[".concat(e,"\\right]")}})),l=t("constTag",{"Object, ConstantNode, string":function(e,t){return e[t]=!0},"Object, SymbolNode, string":function(e,t,r){return t.name!==r&&(e[t]=!0)},"Object, ParenthesisNode, string":function(e,t,r){return l(e,t.content,r)},"Object, FunctionAssignmentNode, string":function(e,t,r){return-1===t.params.indexOf(r)?e[t]=!0:l(e,t.expr,r)},"Object, FunctionNode | OperatorNode, string":function(e,t,r){if(0<t.args.length){for(var n=l(e,t.args[0],r),i=1;i<t.args.length;++i)n=l(e,t.args[i],r)&&n;if(n)return e[t]=!0}return!1}}),d=t("_derivative",{"ConstantNode, Object":function(e){return y(0)},"SymbolNode, Object":function(e,t){return void 0!==t[e]?y(0):y(1)},"ParenthesisNode, Object":function(e,t){return new c(d(e.content,t))},"FunctionAssignmentNode, Object":function(e,t){return void 0!==t[e]?y(0):d(e.expr,t)},"FunctionNode, Object":function(e,t){if(1!==e.args.length){var r=e;if("log"!==r.name&&"nthRoot"!==r.name&&"pow"!==r.name||2!==r.args.length){for(var n=0;n<r.args.length;++n)r.args[n]=y(0);throw r.compile().evaluate(),new Error("Expected TypeError, but none found")}}if(void 0!==t[e])return y(0);var i,a,o,s=e.args[0],u=!1,c=!1;switch(e.name){case"cbrt":u=!0,a=new m("*","multiply",[y(3),new m("^","pow",[s,new m("/","divide",[y(2),y(3)])])]);break;case"sqrt":case"nthRoot":if(1===e.args.length)u=!0,a=new m("*","multiply",[y(2),new p("sqrt",[s])]);else if(2===e.args.length)return t[i=new m("/","divide",[y(1),e.args[1]])]=t[e.args[1]],d(new m("^","pow",[s,i]),t);break;case"log10":i=y(10);case"log":if(i||1!==e.args.length){if(1===e.args.length&&i||2===e.args.length&&void 0!==t[e.args[1]])a=new m("*","multiply",[s.clone(),new p("log",[i||e.args[1]])]),u=!0;else if(2===e.args.length)return d(new m("/","divide",[new p("log",[s]),new p("log",[e.args[1]])]),t)}else a=s.clone(),u=!0;break;case"pow":return t[i]=t[e.args[1]],d(new m("^","pow",[s,e.args[1]]),t);case"exp":a=new p("exp",[s.clone()]);break;case"sin":a=new p("cos",[s.clone()]);break;case"cos":a=new m("-","unaryMinus",[new p("sin",[s.clone()])]);break;case"tan":a=new m("^","pow",[new p("sec",[s.clone()]),y(2)]);break;case"sec":a=new m("*","multiply",[e,new p("tan",[s.clone()])]);break;case"csc":c=!0,a=new m("*","multiply",[e,new p("cot",[s.clone()])]);break;case"cot":c=!0,a=new m("^","pow",[new p("csc",[s.clone()]),y(2)]);break;case"asin":u=!0,a=new p("sqrt",[new m("-","subtract",[y(1),new m("^","pow",[s.clone(),y(2)])])]);break;case"acos":c=u=!0,a=new p("sqrt",[new m("-","subtract",[y(1),new m("^","pow",[s.clone(),y(2)])])]);break;case"atan":u=!0,a=new m("+","add",[new m("^","pow",[s.clone(),y(2)]),y(1)]);break;case"asec":u=!0,a=new m("*","multiply",[new p("abs",[s.clone()]),new p("sqrt",[new m("-","subtract",[new m("^","pow",[s.clone(),y(2)]),y(1)])])]);break;case"acsc":c=u=!0,a=new m("*","multiply",[new p("abs",[s.clone()]),new p("sqrt",[new m("-","subtract",[new m("^","pow",[s.clone(),y(2)]),y(1)])])]);break;case"acot":c=u=!0,a=new m("+","add",[new m("^","pow",[s.clone(),y(2)]),y(1)]);break;case"sinh":a=new p("cosh",[s.clone()]);break;case"cosh":a=new p("sinh",[s.clone()]);break;case"tanh":a=new m("^","pow",[new p("sech",[s.clone()]),y(2)]);break;case"sech":c=!0,a=new m("*","multiply",[e,new p("tanh",[s.clone()])]);break;case"csch":c=!0,a=new m("*","multiply",[e,new p("coth",[s.clone()])]);break;case"coth":c=!0,a=new m("^","pow",[new p("csch",[s.clone()]),y(2)]);break;case"asinh":u=!0,a=new p("sqrt",[new m("+","add",[new m("^","pow",[s.clone(),y(2)]),y(1)])]);break;case"acosh":u=!0,a=new p("sqrt",[new m("-","subtract",[new m("^","pow",[s.clone(),y(2)]),y(1)])]);break;case"atanh":u=!0,a=new m("-","subtract",[y(1),new m("^","pow",[s.clone(),y(2)])]);break;case"asech":c=u=!0,a=new m("*","multiply",[s.clone(),new p("sqrt",[new m("-","subtract",[y(1),new m("^","pow",[s.clone(),y(2)])])])]);break;case"acsch":c=u=!0,a=new m("*","multiply",[new p("abs",[s.clone()]),new p("sqrt",[new m("+","add",[new m("^","pow",[s.clone(),y(2)]),y(1)])])]);break;case"acoth":c=u=!0,a=new m("-","subtract",[y(1),new m("^","pow",[s.clone(),y(2)])]);break;case"abs":a=new m("/","divide",[new p(new h("abs"),[s.clone()]),s.clone()]);break;default:throw new Error('Function "'+e.name+'" is not supported by derivative, or a wrong number of arguments is passed')}var f=u?(o="/","divide"):(o="*","multiply"),l=d(s,t);return c&&(l=new m("-","unaryMinus",[l])),new m(o,f,[l,a])},"OperatorNode, Object":function(e,r){if(void 0!==r[e])return y(0);if("+"===e.op)return new m(e.op,e.fn,e.args.map(function(e){return d(e,r)}));if("-"===e.op){if(e.isUnary())return new m(e.op,e.fn,[d(e.args[0],r)]);if(e.isBinary())return new m(e.op,e.fn,[d(e.args[0],r),d(e.args[1],r)])}if("*"===e.op)return 0<(n=e.args.filter(function(e){return void 0!==r[e]})).length?(t=1===(t=e.args.filter(function(e){return void 0===r[e]})).length?t[0]:new m("*","multiply",t),n=n.concat(d(t,r)),new m("*","multiply",n)):new m("+","add",e.args.map(function(t){return new m("*","multiply",e.args.map(function(e){return e===t?d(e,r):e.clone()}))}));if("/"===e.op&&e.isBinary())return t=e.args[0],n=e.args[1],void 0!==r[n]?new m("/","divide",[d(t,r),n]):void 0!==r[t]?new m("*","multiply",[new m("-","unaryMinus",[t]),new m("/","divide",[d(n,r),new m("^","pow",[n.clone(),y(2)])])]):new m("/","divide",[new m("-","subtract",[new m("*","multiply",[d(t,r),n.clone()]),new m("*","multiply",[t.clone(),d(n,r)])]),new m("^","pow",[n.clone(),y(2)])]);if("^"===e.op&&e.isBinary()){var t=e.args[0],n=e.args[1];if(void 0!==r[t])return ce(t)&&(o(t.value)||a(t.value,1))?y(0):new m("*","multiply",[e,new m("*","multiply",[new p("log",[t.clone()]),d(n.clone(),r)])]);if(void 0===r[n])return new m("*","multiply",[new m("^","pow",[t.clone(),n.clone()]),new m("+","add",[new m("*","multiply",[d(t,r),new m("/","divide",[n.clone(),t.clone()])]),new m("*","multiply",[d(n,r),new p("log",[t.clone()])])])]);if(ce(n)){if(o(n.value))return y(0);if(a(n.value,1))return d(t,r)}var i=new m("^","pow",[t.clone(),new m("-","subtract",[n,y(1)])]);return new m("*","multiply",[n.clone(),new m("*","multiply",[d(t,r),i])])}throw new Error('Operator "'+e.op+'" is not supported by derivative, or a wrong number of arguments is passed')}});function y(e,t){return new u(s(e,t||r.number))}return e}),vc=l("rationalize",["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],function(e){var t=e.config,r=e.typed,n=(e.equal,e.isZero,e.add,e.subtract,e.multiply,e.divide,e.pow,e.parse),d=e.simplifyCore,y=e.simplify,i=e.fraction,a=e.bignumber,o=e.mathWithTransform,s=e.matrix,u=e.AccessorNode,c=e.ArrayNode,g=e.ConstantNode,f=e.FunctionNode,l=e.IndexNode,p=e.ObjectNode,v=e.OperatorNode,m=e.SymbolNode,x=(e.ParenthesisNode,pc({typed:r,config:t,mathWithTransform:o,matrix:s,fraction:i,bignumber:a,AccessorNode:u,ArrayNode:c,ConstantNode:g,FunctionNode:f,IndexNode:l,ObjectNode:p,OperatorNode:v,SymbolNode:m}));return r("rationalize",{string:function(e){return this(n(e),{},!1)},"string, boolean":function(e,t){return this(n(e),{},t)},"string, Object":function(e,t){return this(n(e),t,!1)},"string, Object, boolean":function(e,t,r){return this(n(e),t,r)},Node:function(e){return this(e,{},!1)},"Node, boolean":function(e,t){return this(e,{},t)},"Node, Object":function(e,t){return this(e,t,!1)},"Node, Object, boolean":function(e,t,r){(u={}).firstRules=(h=[d,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},x,{l:"n*(n1^-1)",r:"n/n1"},{l:"n*n1^-n2",r:"n/n1^n2"},{l:"n1^-1",r:"1/n1"},{l:"n*(n1/n2)",r:"(n*n1)/n2"},{l:"1*n",r:"n"}]).concat(s=[{l:"(-n1)/(-n2)",r:"n1/n2"},{l:"(-n1)*(-n2)",r:"n1*n2"},{l:"n1--n2",r:"n1+n2"},{l:"n1-n2",r:"n1+(-n2)"},{l:"(n1+n2)*n3",r:"(n1*n3 + n2*n3)"},{l:"n1*(n2+n3)",r:"(n1*n2+n1*n3)"},{l:"c1*n + c2*n",r:"(c1+c2)*n"},{l:"c1*n + n",r:"(c1+1)*n"},{l:"c1*n - c2*n",r:"(c1-c2)*n"},{l:"c1*n - n",r:"(c1-1)*n"},{l:"v/c",r:"(1/c)*v"},{l:"v/-c",r:"-(1/c)*v"},{l:"-v*-c",r:"c*v"},{l:"-v*c",r:"-c*v"},{l:"v*-c",r:"-c*v"},{l:"v*c",r:"c*v"},{l:"-(-n1*n2)",r:"(n1*n2)"},{l:"-(n1*n2)",r:"(-n1*n2)"},{l:"-(-n1+n2)",r:"(n1-n2)"},{l:"-(n1+n2)",r:"(-n1-n2)"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"},{l:"-(-n1/n2)",r:"(n1/n2)"},{l:"-(n1/n2)",r:"(-n1/n2)"}],m=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}]),u.distrDivRules=[{l:"(n1/n2 + n3/n4)",r:"((n1*n4 + n3*n2)/(n2*n4))"},{l:"(n1/n2 + n3)",r:"((n1 + n3*n2)/n2)"},{l:"(n1 + n2/n3)",r:"((n1*n3 + n2)/n3)"}],u.sucDivRules=m,u.firstRulesAgain=h.concat(s),u.finalRules=[d,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},x,{l:"n*-n^n1",r:"-n^(n1+1)"},{l:"n*n^n1",r:"n^(n1+1)"},{l:"n^n1*-n^n2",r:"-n^(n1+n2)"},{l:"n^n1*n^n2",r:"n^(n1+n2)"},{l:"n^n1*-n",r:"-n^(n1+1)"},{l:"n^n1*n",r:"n^(n1+1)"},{l:"n^n1/-n",r:"-n^(n1-1)"},{l:"n^n1/n",r:"n^(n1-1)"},{l:"n/-n^n1",r:"-n^(1-n1)"},{l:"n/n^n1",r:"n^(1-n1)"},{l:"n^n1/-n^n2",r:"n^(n1-n2)"},{l:"n^n1/n^n2",r:"n^(n1-n2)"},{l:"n1+(-n2*n3)",r:"n1-n2*n3"},{l:"v*(-c)",r:"-c*v"},{l:"n1+-n2",r:"n1-n2"},{l:"v*c",r:"c*v"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"}];var a,o,n,i=u,s=(m=e,h=i.firstRules,m=y(m,h,t,{exactFractions:!(a=[])}),o="+-*/",function e(t){var r=t.type;if("FunctionNode"===r)throw new Error("There is an unsolved function call");if("OperatorNode"===r)if("^"===t.op){if("ConstantNode"!==t.args[1].type||!E(parseFloat(t.args[1].value)))throw new Error("There is a non-integer exponent");e(t.args[0])}else{if(-1===o.indexOf(t.op))throw new Error("Operator "+t.op+" invalid in polynomial expression");for(var n=0;n<t.args.length;n++)e(t.args[n])}else if("SymbolNode"===r){var i=t.name;-1===a.indexOf(i)&&a.push(i)}else if("ParenthesisNode"===r)e(t.content);else if("ConstantNode"!==r)throw new Error("type "+r+" is not allowed in polynomial expression")}(m),(h={}).expression=m,h.variables=a,h),u=s.variables.length,t={exactFractions:!1},c={exactFractions:!0};if(e=s.expression,1<=u){e=function e(t,r,n){var i,a,o=t.type,s=1<arguments.length;if("OperatorNode"===o&&t.isBinary()&&(i=!1,(i="^"!==t.op||"ParenthesisNode"!==t.args[0].type&&"OperatorNode"!==t.args[0].type||"ConstantNode"!==t.args[1].type?i:2<=(a=parseFloat(t.args[1].value))&&E(a))&&(t=2<a?(i=t.args[0],a=new v("^","pow",[t.args[0].cloneDeep(),new g(a-1)]),new v("*","multiply",[i,a])):new v("*","multiply",[t.args[0],t.args[0].cloneDeep()]),s&&("content"===n?r.content=t:r.args[n]=t))),"ParenthesisNode"===o)e(t.content,t,"content");else if("ConstantNode"!==o&&"SymbolNode"!==o)for(var u=0;u<t.args.length;u++)e(t.args[u],t,u);if(!s)return t}(e);var f,l=!0,p=!1;for(e=y(e,i.firstRules,{},t);f=l?i.distrDivRules:i.sucDivRules,l=!l,(f=(e=y(e,f,{},c)).toString())!==n;)p=!0,n=f;p&&(e=y(e,i.firstRulesAgain,{},t)),e=y(e,i.finalRules,{},t)}var m=[],h={};return"OperatorNode"===e.type&&e.isBinary()&&"/"===e.op?(1===u&&(e.args[0]=b(e.args[0],m),e.args[1]=b(e.args[1])),r&&(h.numerator=e.args[0],h.denominator=e.args[1])):(1===u&&(e=b(e,m)),r&&(h.numerator=e,h.denominator=null)),r?(h.coefficients=m,h.variables=s.variables,h.expression=e,h):e}});function b(e,u){var c=(u=void 0===u?[]:u)[0]=0,f="";!function e(t,r,n){var i=t.type;if("FunctionNode"===i)throw new Error("There is an unsolved function call");if("OperatorNode"===i){if(-1==="+-*^".indexOf(t.op))throw new Error("Operator "+t.op+" invalid");if(null!==r){if(("unaryMinus"===t.fn||"pow"===t.fn)&&"add"!==r.fn&&"subtract"!==r.fn&&"multiply"!==r.fn)throw new Error("Invalid "+t.op+" placing");if(("subtract"===t.fn||"add"===t.fn||"multiply"===t.fn)&&"add"!==r.fn&&"subtract"!==r.fn)throw new Error("Invalid "+t.op+" placing");if(("subtract"===t.fn||"add"===t.fn||"unaryMinus"===t.fn)&&0!==n.noFil)throw new Error("Invalid "+t.op+" placing")}"^"!==t.op&&"*"!==t.op||(n.fire=t.op);for(var a=0;a<t.args.length;a++)"unaryMinus"===t.fn&&(n.oper="-"),"+"!==t.op&&"subtract"!==t.fn||(n.fire="",n.cte=1,n.oper=0===a?"+":t.op),n.noFil=a,e(t.args[a],t,n)}else if("SymbolNode"===i){if(t.name!==f&&""!==f)throw new Error("There is more than one variable");if(f=t.name,null===r)return u[1]=1,0;if("^"===r.op&&0!==n.noFil)throw new Error("In power the variable should be the first parameter");if("*"===r.op&&1!==n.noFil)throw new Error("In multiply the variable should be the second parameter");""!==n.fire&&"*"!==n.fire||(c<1&&(u[1]=0),u[1]+=n.cte*("+"===n.oper?1:-1),c=Math.max(1,c))}else{if("ConstantNode"!==i)throw new Error("Type "+i+" is not allowed");var o=parseFloat(t.value);if(null===r)return u[0]=o,0;if("^"===r.op){if(1!==n.noFil)throw new Error("Constant cannot be powered");if(!E(o)||o<=0)throw new Error("Non-integer exponent is not allowed");for(var s=c+1;s<o;s++)u[s]=0;return c<o&&(u[o]=0),u[o]+=n.cte*("+"===n.oper?1:-1),c=Math.max(o,c),0}n.cte=o,""===n.fire&&(u[0]+=n.cte*("+"===n.oper?1:-1))}}(e,null,{cte:1,oper:"+",fire:""});for(var t,r,n,i,a,o=!0,s=c=u.length-1;0<=s;s--)0!==u[s]&&(r=new g(o?u[s]:Math.abs(u[s])),n=u[s]<0?"-":"+",0<s&&(a=new m(f),1<s&&(i=new g(s),a=new v("^","pow",[a,i])),r=-1===u[s]&&o?new v("-","unaryMinus",[a]):1===Math.abs(u[s])?a:new v("*","multiply",[r,a])),t=o?r:"+"==n?new v("+","add",[t,r]):new v("-","subtract",[t,r]),o=!1);return o?new g(0):t}}),xc=l("reviver",["classes"],function(e){var n=e.classes;return function(e,t){var r=n[t&&t.mathjs];return r&&"function"==typeof r.fromJSON?r.fromJSON(t):t}}),bc=l("replacer",[],function(){return function(e,t){return"number"!=typeof t||isFinite(t)&&!isNaN(t)?t:{mathjs:"number",value:String(t)}}}),wc=Math.PI,Nc=2*Math.PI,Mc=Math.E,Ec=l("true",[],function(){return!0}),Sc=l("false",[],function(){return!1}),Ac=l("null",[],function(){return null}),Oc=$c("Infinity",["config","?BigNumber"],function(e){var t=e.config,e=e.BigNumber;return"BigNumber"===t.number?new e(1/0):1/0}),Cc=$c("NaN",["config","?BigNumber"],function(e){var t=e.config,e=e.BigNumber;return"BigNumber"===t.number?new e(NaN):NaN}),Tc=$c("pi",["config","?BigNumber"],function(e){var t=e.config,e=e.BigNumber;return"BigNumber"===t.number?to(e):wc}),_c=$c("tau",["config","?BigNumber"],function(e){var t=e.config,e=e.BigNumber;return"BigNumber"===t.number?ro(e):Nc}),Ic=$c("e",["config","?BigNumber"],function(e){var t=e.config,e=e.BigNumber;return"BigNumber"===t.number?Ka(e):Mc}),kc=$c("phi",["config","?BigNumber"],function(e){var t=e.config,e=e.BigNumber;return"BigNumber"===t.number?eo(e):1.618033988749895}),zc=$c("LN2",["config","?BigNumber"],function(e){var t=e.config,e=e.BigNumber;return"BigNumber"===t.number?new e(2).ln():Math.LN2}),Rc=$c("LN10",["config","?BigNumber"],function(e){var t=e.config,e=e.BigNumber;return"BigNumber"===t.number?new e(10).ln():Math.LN10}),qc=$c("LOG2E",["config","?BigNumber"],function(e){var t=e.config,e=e.BigNumber;return"BigNumber"===t.number?new e(1).div(new e(2).ln()):Math.LOG2E}),Bc=$c("LOG10E",["config","?BigNumber"],function(e){var t=e.config,e=e.BigNumber;return"BigNumber"===t.number?new e(1).div(new e(10).ln()):Math.LOG10E}),Dc=$c("SQRT1_2",["config","?BigNumber"],function(e){var t=e.config,e=e.BigNumber;return"BigNumber"===t.number?new e("0.5").sqrt():Math.SQRT1_2}),jc=$c("SQRT2",["config","?BigNumber"],function(e){var t=e.config,e=e.BigNumber;return"BigNumber"===t.number?new e(2).sqrt():Math.SQRT2}),Pc=$c("i",["Complex"],function(e){return e.Complex.I}),Fc=l("PI",["pi"],function(e){return e.pi}),Uc=l("E",["e"],function(e){return e.e}),Lc=l("version",[],function(){return"10.6.1"});function $c(e,t,r){return l(e,t,r,{recreateOnConfigChange:!0})}var Hc=i("speedOfLight","299792458","m s^-1"),Gc=i("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),Vc=i("planckConstant","6.62607015e-34","J s"),Zc=i("reducedPlanckConstant","1.0545718176461565e-34","J s"),Wc=i("magneticConstant","1.25663706212e-6","N A^-2"),Yc=i("electricConstant","8.8541878128e-12","F m^-1"),Jc=i("vacuumImpedance","376.730313667","ohm"),Xc=i("coulomb","8.987551792261171e9","N m^2 C^-2"),Qc=i("elementaryCharge","1.602176634e-19","C"),Kc=i("bohrMagneton","9.2740100783e-24","J T^-1"),ef=i("conductanceQuantum","7.748091729863649e-5","S"),tf=i("inverseConductanceQuantum","12906.403729652257","ohm"),rf=i("magneticFluxQuantum","2.0678338484619295e-15","Wb"),nf=i("nuclearMagneton","5.0507837461e-27","J T^-1"),af=i("klitzing","25812.807459304513","ohm"),of=i("bohrRadius","5.29177210903e-11","m"),sf=i("classicalElectronRadius","2.8179403262e-15","m"),uf=i("electronMass","9.1093837015e-31","kg"),cf=i("fermiCoupling","1.1663787e-5","GeV^-2"),ff=Uf("fineStructure",.0072973525693),lf=i("hartreeEnergy","4.3597447222071e-18","J"),pf=i("protonMass","1.67262192369e-27","kg"),mf=i("deuteronMass","3.3435830926e-27","kg"),hf=i("neutronMass","1.6749271613e-27","kg"),df=i("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),yf=i("rydberg","10973731.568160","m^-1"),gf=i("thomsonCrossSection","6.6524587321e-29","m^2"),vf=Uf("weakMixingAngle",.2229),xf=Uf("efimovFactor",22.7),bf=i("atomicMass","1.66053906660e-27","kg"),wf=i("avogadro","6.02214076e23","mol^-1"),Nf=i("boltzmann","1.380649e-23","J K^-1"),Mf=i("faraday","96485.33212331001","C mol^-1"),Ef=i("firstRadiation","3.7417718521927573e-16","W m^2"),Sf=i("loschmidt","2.686780111798444e25","m^-3"),Af=i("gasConstant","8.31446261815324","J K^-1 mol^-1"),Of=i("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),Cf=i("molarVolume","0.022413969545014137","m^3 mol^-1"),Tf=Uf("sackurTetrode",-1.16487052358),_f=i("secondRadiation","0.014387768775039337","m K"),If=i("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),kf=i("wienDisplacement","2.897771955e-3","m K"),zf=i("molarMass","0.99999999965e-3","kg mol^-1"),Rf=i("molarMassC12","11.9999999958e-3","kg mol^-1"),qf=i("gravity","9.80665","m s^-2"),Bf=i("planckLength","1.616255e-35","m"),Df=i("planckMass","2.176435e-8","kg"),jf=i("planckTime","5.391245e-44","s"),Pf=i("planckCharge","1.87554603778e-18","C"),Ff=i("planckTemperature","1.416785e+32","K");function i(e,n,i){return l(e,["config","Unit","BigNumber"],function(e){var t=e.config,r=e.Unit,e=e.BigNumber,r=new r("BigNumber"===t.number?new e(n):parseFloat(n),i);return r.fixPrefix=!0,r})}function Uf(e,r){return l(e,["config","BigNumber"],function(e){var t=e.config,e=e.BigNumber;return"BigNumber"===t.number?new e(r):r})}var Lf=l("apply",["typed","isInteger"],function(e){var t=e.typed,e=e.isInteger,r=Gr({typed:t,isInteger:e});return t("apply",{"...any":function(e){var t=e[1];K(t)?e[1]=t-1:ee(t)&&(e[1]=t.minus(1));try{return r.apply(null,e)}catch(e){throw u(e)}}})},{isTransformFunction:!0}),$f=l("column",["typed","Index","matrix","range"],function(e){var t=e.typed,r=e.Index,n=e.matrix,e=e.range,i=si({typed:t,Index:r,matrix:n,range:e});return t("column",{"...any":function(e){var t=e.length-1,r=e[t];K(r)&&(e[t]=r-1);try{return i.apply(null,e)}catch(e){throw u(e)}}})},{isTransformFunction:!0});function Hf(e,t,r){var n=e.filter(function(e){return le(e)&&!(e.name in t)&&!r.has(e.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');var i=n.name,a=Fs(r),o=e.compile();return function(e){return a.set(i,e),o.evaluate(a)}}var Gf=l("filter",["typed"],function(e){e=e.typed;function t(e,t,r){var n,i;return e[0]&&(n=e[0].compile().evaluate(r)),e[1]&&(i=le(e[1])||Y(e[1])?e[1].compile().evaluate(r):Hf(e[1],t,r)),a(n,i)}t.rawArgs=!0;var a=e("filter",{"Array, function":Vf,"Matrix, function":function(e,t){return e.create(Vf(e.toArray(),t))},"Array, RegExp":Je,"Matrix, RegExp":function(e,t){return e.create(Je(e.toArray(),t))}});return t},{isTransformFunction:!0});function Vf(e,n){var i=mi(n);return Ye(e,function(e,t,r){return 1===i?n(e):2===i?n(e,[t+1]):n(e,[t+1],r)})}var Zf=l("forEach",["typed"],function(e){e=e.typed;function t(e,t,r){var n,i;return e[0]&&(n=e[0].compile().evaluate(r)),e[1]&&(i=le(e[1])||Y(e[1])?e[1].compile().evaluate(r):Hf(e[1],t,r)),a(n,i)}t.rawArgs=!0;var a=e("forEach",{"Array | Matrix, function":function(t,i){var a=mi(i);!function r(e,n){Array.isArray(e)?We(e,function(e,t){r(e,n.concat(t+1))}):1===a?i(e):2===a?i(e,n):i(e,n,t)}(t.valueOf(),[])}});return t},{isTransformFunction:!0}),Wf=l("index",["Index"],function(e){var a=e.Index;return function(){for(var e=[],t=0,r=arguments.length;t<r;t++){var n=arguments[t];if(O(n))n.start--,n.end-=0<n.step?0:2;else if(n&&!0===n.isSet)n=n.map(function(e){return e-1});else if(x(n)||F(n))n=n.map(function(e){return e-1});else if(K(n))n--;else if(ee(n))n=n.toNumber()-1;else if("string"!=typeof n)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");e[t]=n}var i=new a;return a.apply(i,e),i}},{isTransformFunction:!0}),Yf=l("map",["typed"],function(e){e=e.typed;function t(e,t,r){var n,i;return e[0]&&(n=e[0].compile().evaluate(r)),e[1]&&(i=le(e[1])||Y(e[1])?e[1].compile().evaluate(r):Hf(e[1],t,r)),a(n,i)}t.rawArgs=!0;var a=e("map",{"Array, function":function(e,t){return Jf(e,t,e)},"Matrix, function":function(e,t){return e.create(Jf(e.valueOf(),t,e))}});return t},{isTransformFunction:!0});function Jf(e,t,i){var a=mi(t);return function r(e,n){return Array.isArray(e)?Ze(e,function(e,t){return r(e,n.concat(t+1))}):1===a?t(e):2===a?t(e,n):t(e,n,i)}(e,[])}function Xf(e){var t;return 2===e.length&&S(e[0])&&(K(t=(e=e.slice())[1])?e[1]=t-1:ee(t)&&(e[1]=t.minus(1))),e}var Qf=l("max",["typed","config","numeric","larger"],function(e){var t=e.typed,r=e.config,n=e.numeric,e=e.larger,i=Ga({typed:t,config:r,numeric:n,larger:e});return t("max",{"...any":function(e){e=Xf(e);try{return i.apply(null,e)}catch(e){throw u(e)}}})},{isTransformFunction:!0}),Kf=l("mean",["typed","add","divide"],function(e){var t=e.typed,r=e.add,e=e.divide,n=Au({typed:t,add:r,divide:e});return t("mean",{"...any":function(e){e=Xf(e);try{return n.apply(null,e)}catch(e){throw u(e)}}})},{isTransformFunction:!0}),el=l("min",["typed","config","numeric","smaller"],function(e){var t=e.typed,r=e.config,n=e.numeric,e=e.smaller,i=Va({typed:t,config:r,numeric:n,smaller:e});return t("min",{"...any":function(e){e=Xf(e);try{return i.apply(null,e)}catch(e){throw u(e)}}})},{isTransformFunction:!0}),tl=l("range",["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq"],function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.bignumber,a=e.smaller,o=e.smallerEq,s=e.larger,e=e.largerEq,u=Ti({typed:t,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:s,largerEq:e});return t("range",{"...any":function(e){return"boolean"!=typeof e[e.length-1]&&e.push(!0),u.apply(null,e)}})},{isTransformFunction:!0}),rl=l("row",["typed","Index","matrix","range"],function(e){var t=e.typed,r=e.Index,n=e.matrix,e=e.range,i=qi({typed:t,Index:r,matrix:n,range:e});return t("row",{"...any":function(e){var t=e.length-1,r=e[t];K(r)&&(e[t]=r-1);try{return i.apply(null,e)}catch(e){throw u(e)}}})},{isTransformFunction:!0}),nl=l("subset",["typed","matrix"],function(e){var t=e.typed,e=e.matrix,r=ji({typed:t,matrix:e});return t("subset",{"...any":function(e){try{return r.apply(null,e)}catch(e){throw u(e)}}})},{isTransformFunction:!0}),il=l("concat",["typed","matrix","isInteger"],function(e){var t=e.typed,r=e.matrix,e=e.isInteger,n=oi({typed:t,matrix:r,isInteger:e});return t("concat",{"...any":function(e){var t=e.length-1,r=e[t];K(r)?e[t]=r-1:ee(r)&&(e[t]=r.minus(1));try{return n.apply(null,e)}catch(e){throw u(e)}}})},{isTransformFunction:!0}),al=l("diff",["typed","matrix","subtract","number","bignumber"],function(e){var t=e.typed,r=e.matrix,n=e.subtract,i=e.number,e=e.bignumber,a=Ei({typed:t,matrix:r,subtract:n,number:i,bignumber:e});return t("diff",{"...any":function(e){e=Xf(e);try{return a.apply(null,e)}catch(e){throw u(e)}}})},{isTransformFunction:!0}),ol=l("std",["typed","sqrt","variance"],function(e){var t=e.typed,r=e.sqrt,e=e.variance,n=Iu({typed:t,sqrt:r,variance:e});return t("std",{"...any":function(e){e=Xf(e);try{return n.apply(null,e)}catch(e){throw u(e)}}})},{isTransformFunction:!0}),sl=l("sum",["typed","config","add","numeric"],function(e){var t=e.typed,r=e.config,n=e.add,e=e.numeric,i=Eu({typed:t,config:r,add:n,numeric:e});return t("sum",{"...any":function(e){e=Xf(e);try{return i.apply(null,e)}catch(e){throw u(e)}}})},{isTransformFunction:!0}),ul=l("cumsum",["typed","add","unaryPlus"],function(e){var t=e.typed,r=e.add,e=e.unaryPlus,n=Su({typed:t,add:r,unaryPlus:e});return t("cumsum",{"...any":function(e){var t;2===e.length&&S(e[0])&&(K(t=e[1])?e[1]=t-1:ee(t)&&(e[1]=t.minus(1)));try{return n.apply(null,e)}catch(e){throw u(e)}}})},{isTransformFunction:!0}),cl=l("variance",["typed","add","subtract","multiply","divide","apply","isNaN"],function(e){var t=e.typed,r=e.add,n=e.subtract,i=e.multiply,a=e.divide,o=e.apply,e=e.isNaN,s=Tu({typed:t,add:r,subtract:n,multiply:i,divide:a,apply:o,isNaN:e});return t("variance",{"...any":function(e){e=Xf(e);try{return s.apply(null,e)}catch(e){throw u(e)}}})},{isTransformFunction:!0}),uu=e(192),fl=e.n(uu);function ll(s,e,u,c){function f(e,t,r){var i;if(r.wrap&&"function"==typeof t&&((i=t).transform&&(n.transform=i.transform),t=n),"function"==typeof t&&"string"==typeof t.signature&&(t=s(e,Qa()({},t.signature,t))),m(u[e])&&m(t))return t=r.override?s(e,t.signatures):s(u[e],t),u[e]=t,delete c[e],a(e,t),u.emit("import",e,function(){return t});function n(){for(var e=[],t=0,r=arguments.length;t<r;t++){var n=arguments[t];e[t]=n&&n.valueOf()}return i.apply(u,e)}if(void 0===u[e]||r.override)return u[e]=t,delete c[e],a(e,t),u.emit("import",e,function(){return t});if(!r.silent)throw new Error('Cannot import "'+e+'": already exists')}function a(e,t){t&&"function"==typeof t.transform?(u.expression.transform[e]=t.transform,r(e)&&(u.expression.mathWithTransform[e]=t.transform)):(delete u.expression.transform[e],r(e)&&(u.expression.mathWithTransform[e]=t))}function l(e){delete u.expression.transform[e],r(e)?u.expression.mathWithTransform[e]=u[e]:delete u.expression.mathWithTransform[e]}function p(r,n,e){var i=2<arguments.length&&void 0!==e?e:r.fn;if(tt(i,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(i));function t(){var t={},e=(r.dependencies.map(ut).forEach(function(e){if(tt(e,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(e));"math"===e?t.math=u:"mathWithTransform"===e?t.mathWithTransform=u.expression.mathWithTransform:"classes"===e?t.classes=u:t[e]=u[e]}),r(t));if(e&&"function"==typeof e.transform)throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(void 0===o||n.override)return e;if(m(o)&&m(e))return s(o,e);if(n.silent)return o;throw new Error('Cannot import "'+i+'": already exists')}var a=d(r)?u.expression.transform:u,e=i in u.expression.transform,o=pe(a,i)?a[i]:void 0;r.meta&&!1===r.meta.lazy?a[i]=t():at(a,i,t),o&&e?l(i):(d(r)||h(r))&&at(u.expression.mathWithTransform,i,function(){return a[i]}),c[i]=r,u.emit("import",i,t)}function m(e){return"function"==typeof e&&"object"===Z()(e.signatures)}function r(e){return!pe(t,e)}function h(e){return!(-1!==e.fn.indexOf(".")||pe(t,e.fn)||e.meta&&e.meta.isClass)}function d(e){return void 0!==e&&void 0!==e.meta&&!0===e.meta.isTransformFunction}var t={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return function(e,a){var t=arguments.length;if(1!==t&&2!==t)throw new Ii("import",t,1,2);a=a||{};var r,n,i={};for(r in function t(r,e,n){if(Array.isArray(e))e.forEach(function(e){return t(r,e)});else if("object"===Z()(e))for(var i in e)pe(e,i)&&t(r,e[i],i);else if(st(e)||void 0!==n){if(n=st(e)?d(e)?e.fn+".transform":e.fn:n,pe(r,n)&&r[n]!==e&&!a.silent)throw new Error('Cannot import "'+n+'" twice');r[n]=e}else if(!a.silent)throw new TypeError("Factory, Object, or Array expected")}(i,e),i)if(pe(i,r)){var o=i[r];if(st(o))p(o,a);else if("function"==typeof(n=o)||"number"==typeof n||"string"==typeof n||"boolean"==typeof n||null===n||W(n)||ie(n)||ee(n)||ae(n)||F(n)||Array.isArray(n))f(r,o,a);else if(!a.silent)throw new TypeError("Factory, Object, or Array expected")}}}var pl={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null},ml=["Matrix","Array"],hl=["number","BigNumber","Fraction"];function dl(e,t,r){var n;void 0!==e[t]&&(n=e[t],-1===r.indexOf(n))&&console.warn('Warning: Unknown value "'+e[t]+'" for configuration option "'+t+'". Available options: '+r.map(function(e){return JSON.stringify(e)}).join(", ")+".")}o.default=function e(t,r){r=Xa()({},pl,r);if("function"!=typeof Object.create)throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");n={isNumber:K,isComplex:ie,isBigNumber:ee,isFraction:ae,isUnit:W,isString:M,isArray:x,isMatrix:F,isCollection:S,isDenseMatrix:N,isSparseMatrix:A,isRange:O,isIndex:k,isBoolean:C,isResultSet:T,isHelp:R,isFunction:q,isDate:B,isRegExp:D,isObject:j,isNull:P,isUndefined:$,isAccessorNode:he,isArrayNode:U,isAssignmentNode:H,isBlockNode:G,isConditionalNode:V,isConstantNode:ce,isFunctionAssignmentNode:Y,isFunctionNode:de,isIndexNode:J,isNode:L,isObjectNode:X,isOperatorNode:fe,isParenthesisNode:Q,isRangeNode:oe,isSymbolNode:le,isChain:se},u=new fl.a,n.on=u.on.bind(u),n.off=u.off.bind(u),n.once=u.once.bind(u),n.emit=u.emit.bind(u);var n,i,a,o=n;function s(e){var t,r;return e?(t=rt(i,ne),dl(e,"matrix",ml),dl(e,"number",hl),function e(t,r){if(Array.isArray(r))throw new TypeError("Arrays are not supported by deepExtend");for(var n in r)if(pe(r,n)&&!(n in Object.prototype)&&!(n in Function.prototype))if(r[n]&&r[n].constructor===Object)void 0===t[n]&&(t[n]={}),t[n]&&t[n].constructor===Object?e(t[n],r[n]):t[n]=r[n];else{if(Array.isArray(r[n]))throw new TypeError("Arrays are not supported by deepExtend");t[n]=r[n]}}(i,e),r=rt(i,ne),e=rt(e,ne),a("config",r,t,e),r):rt(i,ne)}o.config=(i=r,a=o.emit,s.MATRIX_OPTIONS=ml,s.NUMBER_OPTIONS=hl,Object.keys(pl).forEach(function(e){Object.defineProperty(s,e,{get:function(){return i[e]},enumerable:!0,configurable:!0})}),s),o.expression={transform:{},mathWithTransform:{config:o.config}};var u,c={},f=ll(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return o.typed.apply(o.typed,t)},0,o,c);return o.import=f,o.on("config",function(){ot(c).forEach(function(e){e&&e.meta&&e.meta.recreateOnConfigChange&&f(e,{override:!0})})}),o.create=e.bind(null,t),o.factory=l,o.import(ot((function e(t,r){for(var n in t){var i;pe(t,n)&&(i=t[n],"object"===Z()(i)&&null!==i?e(i,r):r[n]=i)}}(t,u={}),u))),o.ArgumentsError=Ii,o.DimensionError=z,o.IndexError=Pe,o}(t)}],n={},i.m=r,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(r,n,function(e){return t[e]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=275).default;function i(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}var r,n});
// source --> https://www.lebens-retter.org/wp-includes/js/underscore.min.js?ver=1.13.7 
/*! This file is auto-generated */
!function(n,t){var r,e;"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("underscore",t):(n="undefined"!=typeof globalThis?globalThis:n||self,r=n._,(e=n._=t()).noConflict=function(){return n._=r,e})}(this,function(){var n="1.13.7",t="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},e=Array.prototype,V=Object.prototype,F="undefined"!=typeof Symbol?Symbol.prototype:null,P=e.push,f=e.slice,s=V.toString,q=V.hasOwnProperty,r="undefined"!=typeof ArrayBuffer,u="undefined"!=typeof DataView,U=Array.isArray,W=Object.keys,z=Object.create,L=r&&ArrayBuffer.isView,$=isNaN,C=isFinite,K=!{toString:null}.propertyIsEnumerable("toString"),J=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],G=Math.pow(2,53)-1;function l(u,o){return o=null==o?u.length-1:+o,function(){for(var n=Math.max(arguments.length-o,0),t=Array(n),r=0;r<n;r++)t[r]=arguments[r+o];switch(o){case 0:return u.call(this,t);case 1:return u.call(this,arguments[0],t);case 2:return u.call(this,arguments[0],arguments[1],t)}for(var e=Array(o+1),r=0;r<o;r++)e[r]=arguments[r];return e[o]=t,u.apply(this,e)}}function o(n){var t=typeof n;return"function"==t||"object"==t&&!!n}function H(n){return void 0===n}function Q(n){return!0===n||!1===n||"[object Boolean]"===s.call(n)}function i(n){var t="[object "+n+"]";return function(n){return s.call(n)===t}}var X=i("String"),Y=i("Number"),Z=i("Date"),nn=i("RegExp"),tn=i("Error"),rn=i("Symbol"),en=i("ArrayBuffer"),a=i("Function"),t=t.document&&t.document.childNodes,p=a="function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof t?function(n){return"function"==typeof n||!1}:a,t=i("Object"),un=u&&(!/\[native code\]/.test(String(DataView))||t(new DataView(new ArrayBuffer(8)))),a="undefined"!=typeof Map&&t(new Map),u=i("DataView");var h=un?function(n){return null!=n&&p(n.getInt8)&&en(n.buffer)}:u,v=U||i("Array");function y(n,t){return null!=n&&q.call(n,t)}var on=i("Arguments"),an=(!function(){on(arguments)||(on=function(n){return y(n,"callee")})}(),on);function fn(n){return Y(n)&&$(n)}function cn(n){return function(){return n}}function ln(t){return function(n){n=t(n);return"number"==typeof n&&0<=n&&n<=G}}function sn(t){return function(n){return null==n?void 0:n[t]}}var d=sn("byteLength"),pn=ln(d),hn=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var vn=r?function(n){return L?L(n)&&!h(n):pn(n)&&hn.test(s.call(n))}:cn(!1),g=sn("length");function yn(n,t){t=function(t){for(var r={},n=t.length,e=0;e<n;++e)r[t[e]]=!0;return{contains:function(n){return!0===r[n]},push:function(n){return r[n]=!0,t.push(n)}}}(t);var r=J.length,e=n.constructor,u=p(e)&&e.prototype||V,o="constructor";for(y(n,o)&&!t.contains(o)&&t.push(o);r--;)(o=J[r])in n&&n[o]!==u[o]&&!t.contains(o)&&t.push(o)}function b(n){if(!o(n))return[];if(W)return W(n);var t,r=[];for(t in n)y(n,t)&&r.push(t);return K&&yn(n,r),r}function dn(n,t){var r=b(t),e=r.length;if(null==n)return!e;for(var u=Object(n),o=0;o<e;o++){var i=r[o];if(t[i]!==u[i]||!(i in u))return!1}return!0}function m(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)}function gn(n){return new Uint8Array(n.buffer||n,n.byteOffset||0,d(n))}m.VERSION=n,m.prototype.valueOf=m.prototype.toJSON=m.prototype.value=function(){return this._wrapped},m.prototype.toString=function(){return String(this._wrapped)};var bn="[object DataView]";function mn(n,t,r,e){var u;return n===t?0!==n||1/n==1/t:null!=n&&null!=t&&(n!=n?t!=t:("function"==(u=typeof n)||"object"==u||"object"==typeof t)&&function n(t,r,e,u){t instanceof m&&(t=t._wrapped);r instanceof m&&(r=r._wrapped);var o=s.call(t);if(o!==s.call(r))return!1;if(un&&"[object Object]"==o&&h(t)){if(!h(r))return!1;o=bn}switch(o){case"[object RegExp]":case"[object String]":return""+t==""+r;case"[object Number]":return+t!=+t?+r!=+r:0==+t?1/+t==1/r:+t==+r;case"[object Date]":case"[object Boolean]":return+t==+r;case"[object Symbol]":return F.valueOf.call(t)===F.valueOf.call(r);case"[object ArrayBuffer]":case bn:return n(gn(t),gn(r),e,u)}o="[object Array]"===o;if(!o&&vn(t)){var i=d(t);if(i!==d(r))return!1;if(t.buffer===r.buffer&&t.byteOffset===r.byteOffset)return!0;o=!0}if(!o){if("object"!=typeof t||"object"!=typeof r)return!1;var i=t.constructor,a=r.constructor;if(i!==a&&!(p(i)&&i instanceof i&&p(a)&&a instanceof a)&&"constructor"in t&&"constructor"in r)return!1}e=e||[];u=u||[];var f=e.length;for(;f--;)if(e[f]===t)return u[f]===r;e.push(t);u.push(r);if(o){if((f=t.length)!==r.length)return!1;for(;f--;)if(!mn(t[f],r[f],e,u))return!1}else{var c,l=b(t);if(f=l.length,b(r).length!==f)return!1;for(;f--;)if(c=l[f],!y(r,c)||!mn(t[c],r[c],e,u))return!1}e.pop();u.pop();return!0}(n,t,r,e))}function c(n){if(!o(n))return[];var t,r=[];for(t in n)r.push(t);return K&&yn(n,r),r}function jn(e){var u=g(e);return function(n){if(null==n)return!1;var t=c(n);if(g(t))return!1;for(var r=0;r<u;r++)if(!p(n[e[r]]))return!1;return e!==_n||!p(n[wn])}}var wn="forEach",t=["clear","delete"],u=["get","has","set"],U=t.concat(wn,u),_n=t.concat(u),r=["add"].concat(t,wn,"has"),u=a?jn(U):i("Map"),t=a?jn(_n):i("WeakMap"),U=a?jn(r):i("Set"),a=i("WeakSet");function j(n){for(var t=b(n),r=t.length,e=Array(r),u=0;u<r;u++)e[u]=n[t[u]];return e}function An(n){for(var t={},r=b(n),e=0,u=r.length;e<u;e++)t[n[r[e]]]=r[e];return t}function xn(n){var t,r=[];for(t in n)p(n[t])&&r.push(t);return r.sort()}function Sn(f,c){return function(n){var t=arguments.length;if(c&&(n=Object(n)),!(t<2||null==n))for(var r=1;r<t;r++)for(var e=arguments[r],u=f(e),o=u.length,i=0;i<o;i++){var a=u[i];c&&void 0!==n[a]||(n[a]=e[a])}return n}}var On=Sn(c),w=Sn(b),Mn=Sn(c,!0);function En(n){var t;return o(n)?z?z(n):((t=function(){}).prototype=n,n=new t,t.prototype=null,n):{}}function Bn(n){return v(n)?n:[n]}function _(n){return m.toPath(n)}function Nn(n,t){for(var r=t.length,e=0;e<r;e++){if(null==n)return;n=n[t[e]]}return r?n:void 0}function In(n,t,r){n=Nn(n,_(t));return H(n)?r:n}function Tn(n){return n}function A(t){return t=w({},t),function(n){return dn(n,t)}}function kn(t){return t=_(t),function(n){return Nn(n,t)}}function x(u,o,n){if(void 0===o)return u;switch(null==n?3:n){case 1:return function(n){return u.call(o,n)};case 3:return function(n,t,r){return u.call(o,n,t,r)};case 4:return function(n,t,r,e){return u.call(o,n,t,r,e)}}return function(){return u.apply(o,arguments)}}function Dn(n,t,r){return null==n?Tn:p(n)?x(n,t,r):(o(n)&&!v(n)?A:kn)(n)}function Rn(n,t){return Dn(n,t,1/0)}function S(n,t,r){return m.iteratee!==Rn?m.iteratee(n,t):Dn(n,t,r)}function Vn(){}function Fn(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))}m.toPath=Bn,m.iteratee=Rn;var O=Date.now||function(){return(new Date).getTime()};function Pn(t){function r(n){return t[n]}var n="(?:"+b(t).join("|")+")",e=RegExp(n),u=RegExp(n,"g");return function(n){return e.test(n=null==n?"":""+n)?n.replace(u,r):n}}var r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},qn=Pn(r),r=Pn(An(r)),Un=m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Wn=/(.)^/,zn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Ln=/\\|'|\r|\n|\u2028|\u2029/g;function $n(n){return"\\"+zn[n]}var Cn=/^\s*(\w|\$)+\s*$/;var Kn=0;function Jn(n,t,r,e,u){return e instanceof t?(e=En(n.prototype),o(t=n.apply(e,u))?t:e):n.apply(r,u)}var M=l(function(u,o){function i(){for(var n=0,t=o.length,r=Array(t),e=0;e<t;e++)r[e]=o[e]===a?arguments[n++]:o[e];for(;n<arguments.length;)r.push(arguments[n++]);return Jn(u,i,this,this,r)}var a=M.placeholder;return i}),Gn=(M.placeholder=m,l(function(t,r,e){var u;if(p(t))return u=l(function(n){return Jn(t,u,r,this,e.concat(n))});throw new TypeError("Bind must be called on a function")})),E=ln(g);function B(n,t,r,e){if(e=e||[],t||0===t){if(t<=0)return e.concat(n)}else t=1/0;for(var u=e.length,o=0,i=g(n);o<i;o++){var a=n[o];if(E(a)&&(v(a)||an(a)))if(1<t)B(a,t-1,r,e),u=e.length;else for(var f=0,c=a.length;f<c;)e[u++]=a[f++];else r||(e[u++]=a)}return e}var Hn=l(function(n,t){var r=(t=B(t,!1,!1)).length;if(r<1)throw new Error("bindAll must be passed function names");for(;r--;){var e=t[r];n[e]=Gn(n[e],n)}return n});var Qn=l(function(n,t,r){return setTimeout(function(){return n.apply(null,r)},t)}),Xn=M(Qn,m,1);function Yn(n){return function(){return!n.apply(this,arguments)}}function Zn(n,t){var r;return function(){return 0<--n&&(r=t.apply(this,arguments)),n<=1&&(t=null),r}}var nt=M(Zn,2);function tt(n,t,r){t=S(t,r);for(var e,u=b(n),o=0,i=u.length;o<i;o++)if(t(n[e=u[o]],e,n))return e}function rt(o){return function(n,t,r){t=S(t,r);for(var e=g(n),u=0<o?0:e-1;0<=u&&u<e;u+=o)if(t(n[u],u,n))return u;return-1}}var et=rt(1),ut=rt(-1);function ot(n,t,r,e){for(var u=(r=S(r,e,1))(t),o=0,i=g(n);o<i;){var a=Math.floor((o+i)/2);r(n[a])<u?o=a+1:i=a}return o}function it(o,i,a){return function(n,t,r){var e=0,u=g(n);if("number"==typeof r)0<o?e=0<=r?r:Math.max(r+u,e):u=0<=r?Math.min(r+1,u):r+u+1;else if(a&&r&&u)return n[r=a(n,t)]===t?r:-1;if(t!=t)return 0<=(r=i(f.call(n,e,u),fn))?r+e:-1;for(r=0<o?e:u-1;0<=r&&r<u;r+=o)if(n[r]===t)return r;return-1}}var at=it(1,et,ot),ft=it(-1,ut);function ct(n,t,r){t=(E(n)?et:tt)(n,t,r);if(void 0!==t&&-1!==t)return n[t]}function N(n,t,r){if(t=x(t,r),E(n))for(u=0,o=n.length;u<o;u++)t(n[u],u,n);else for(var e=b(n),u=0,o=e.length;u<o;u++)t(n[e[u]],e[u],n);return n}function I(n,t,r){t=S(t,r);for(var e=!E(n)&&b(n),u=(e||n).length,o=Array(u),i=0;i<u;i++){var a=e?e[i]:i;o[i]=t(n[a],a,n)}return o}function lt(f){return function(n,t,r,e){var u=3<=arguments.length;return function(n,t,r,e){var u=!E(n)&&b(n),o=(u||n).length,i=0<f?0:o-1;for(e||(r=n[u?u[i]:i],i+=f);0<=i&&i<o;i+=f){var a=u?u[i]:i;r=t(r,n[a],a,n)}return r}(n,x(t,e,4),r,u)}}var st=lt(1),pt=lt(-1);function T(n,e,t){var u=[];return e=S(e,t),N(n,function(n,t,r){e(n,t,r)&&u.push(n)}),u}function ht(n,t,r){t=S(t,r);for(var e=!E(n)&&b(n),u=(e||n).length,o=0;o<u;o++){var i=e?e[o]:o;if(!t(n[i],i,n))return!1}return!0}function vt(n,t,r){t=S(t,r);for(var e=!E(n)&&b(n),u=(e||n).length,o=0;o<u;o++){var i=e?e[o]:o;if(t(n[i],i,n))return!0}return!1}function k(n,t,r,e){return E(n)||(n=j(n)),0<=at(n,t,r="number"==typeof r&&!e?r:0)}var yt=l(function(n,r,e){var u,o;return p(r)?o=r:(r=_(r),u=r.slice(0,-1),r=r[r.length-1]),I(n,function(n){var t=o;if(!t){if(null==(n=u&&u.length?Nn(n,u):n))return;t=n[r]}return null==t?t:t.apply(n,e)})});function dt(n,t){return I(n,kn(t))}function gt(n,e,t){var r,u,o=-1/0,i=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=E(n)?n:j(n)).length;a<f;a++)null!=(r=n[a])&&o<r&&(o=r);else e=S(e,t),N(n,function(n,t,r){u=e(n,t,r),(i<u||u===-1/0&&o===-1/0)&&(o=n,i=u)});return o}var bt=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function mt(n){return n?v(n)?f.call(n):X(n)?n.match(bt):E(n)?I(n,Tn):j(n):[]}function jt(n,t,r){if(null==t||r)return(n=E(n)?n:j(n))[Fn(n.length-1)];for(var e=mt(n),r=g(e),u=(t=Math.max(Math.min(t,r),0),r-1),o=0;o<t;o++){var i=Fn(o,u),a=e[o];e[o]=e[i],e[i]=a}return e.slice(0,t)}function D(o,t){return function(r,e,n){var u=t?[[],[]]:{};return e=S(e,n),N(r,function(n,t){t=e(n,t,r);o(u,n,t)}),u}}var wt=D(function(n,t,r){y(n,r)?n[r].push(t):n[r]=[t]}),_t=D(function(n,t,r){n[r]=t}),At=D(function(n,t,r){y(n,r)?n[r]++:n[r]=1}),xt=D(function(n,t,r){n[r?0:1].push(t)},!0);function St(n,t,r){return t in r}var Ot=l(function(n,t){var r={},e=t[0];if(null!=n){p(e)?(1<t.length&&(e=x(e,t[1])),t=c(n)):(e=St,t=B(t,!1,!1),n=Object(n));for(var u=0,o=t.length;u<o;u++){var i=t[u],a=n[i];e(a,i,n)&&(r[i]=a)}}return r}),Mt=l(function(n,r){var t,e=r[0];return p(e)?(e=Yn(e),1<r.length&&(t=r[1])):(r=I(B(r,!1,!1),String),e=function(n,t){return!k(r,t)}),Ot(n,e,t)});function Et(n,t,r){return f.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))}function Bt(n,t,r){return null==n||n.length<1?null==t||r?void 0:[]:null==t||r?n[0]:Et(n,n.length-t)}function R(n,t,r){return f.call(n,null==t||r?1:t)}var Nt=l(function(n,t){return t=B(t,!0,!0),T(n,function(n){return!k(t,n)})}),It=l(function(n,t){return Nt(n,t)});function Tt(n,t,r,e){Q(t)||(e=r,r=t,t=!1),null!=r&&(r=S(r,e));for(var u=[],o=[],i=0,a=g(n);i<a;i++){var f=n[i],c=r?r(f,i,n):f;t&&!r?(i&&o===c||u.push(f),o=c):r?k(o,c)||(o.push(c),u.push(f)):k(u,f)||u.push(f)}return u}var kt=l(function(n){return Tt(B(n,!0,!0))});function Dt(n){for(var t=n&&gt(n,g).length||0,r=Array(t),e=0;e<t;e++)r[e]=dt(n,e);return r}var Rt=l(Dt);function Vt(n,t){return n._chain?m(t).chain():t}function Ft(r){return N(xn(r),function(n){var t=m[n]=r[n];m.prototype[n]=function(){var n=[this._wrapped];return P.apply(n,arguments),Vt(this,t.apply(m,n))}}),m}N(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var r=e[t];m.prototype[t]=function(){var n=this._wrapped;return null!=n&&(r.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0]),Vt(this,n)}}),N(["concat","join","slice"],function(n){var t=e[n];m.prototype[n]=function(){var n=this._wrapped;return Vt(this,n=null!=n?t.apply(n,arguments):n)}});n=Ft({__proto__:null,VERSION:n,restArguments:l,isObject:o,isNull:function(n){return null===n},isUndefined:H,isBoolean:Q,isElement:function(n){return!(!n||1!==n.nodeType)},isString:X,isNumber:Y,isDate:Z,isRegExp:nn,isError:tn,isSymbol:rn,isArrayBuffer:en,isDataView:h,isArray:v,isFunction:p,isArguments:an,isFinite:function(n){return!rn(n)&&C(n)&&!isNaN(parseFloat(n))},isNaN:fn,isTypedArray:vn,isEmpty:function(n){var t;return null==n||("number"==typeof(t=g(n))&&(v(n)||X(n)||an(n))?0===t:0===g(b(n)))},isMatch:dn,isEqual:function(n,t){return mn(n,t)},isMap:u,isWeakMap:t,isSet:U,isWeakSet:a,keys:b,allKeys:c,values:j,pairs:function(n){for(var t=b(n),r=t.length,e=Array(r),u=0;u<r;u++)e[u]=[t[u],n[t[u]]];return e},invert:An,functions:xn,methods:xn,extend:On,extendOwn:w,assign:w,defaults:Mn,create:function(n,t){return n=En(n),t&&w(n,t),n},clone:function(n){return o(n)?v(n)?n.slice():On({},n):n},tap:function(n,t){return t(n),n},get:In,has:function(n,t){for(var r=(t=_(t)).length,e=0;e<r;e++){var u=t[e];if(!y(n,u))return!1;n=n[u]}return!!r},mapObject:function(n,t,r){t=S(t,r);for(var e=b(n),u=e.length,o={},i=0;i<u;i++){var a=e[i];o[a]=t(n[a],a,n)}return o},identity:Tn,constant:cn,noop:Vn,toPath:Bn,property:kn,propertyOf:function(t){return null==t?Vn:function(n){return In(t,n)}},matcher:A,matches:A,times:function(n,t,r){var e=Array(Math.max(0,n));t=x(t,r,1);for(var u=0;u<n;u++)e[u]=t(u);return e},random:Fn,now:O,escape:qn,unescape:r,templateSettings:Un,template:function(o,n,t){n=Mn({},n=!n&&t?t:n,m.templateSettings);var r,t=RegExp([(n.escape||Wn).source,(n.interpolate||Wn).source,(n.evaluate||Wn).source].join("|")+"|$","g"),i=0,a="__p+='";if(o.replace(t,function(n,t,r,e,u){return a+=o.slice(i,u).replace(Ln,$n),i=u+n.length,t?a+="'+\n((__t=("+t+"))==null?'':_.escape(__t))+\n'":r?a+="'+\n((__t=("+r+"))==null?'':__t)+\n'":e&&(a+="';\n"+e+"\n__p+='"),n}),a+="';\n",t=n.variable){if(!Cn.test(t))throw new Error("variable is not a bare identifier: "+t)}else a="with(obj||{}){\n"+a+"}\n",t="obj";a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{r=new Function(t,"_",a)}catch(n){throw n.source=a,n}function e(n){return r.call(this,n,m)}return e.source="function("+t+"){\n"+a+"}",e},result:function(n,t,r){var e=(t=_(t)).length;if(!e)return p(r)?r.call(n):r;for(var u=0;u<e;u++){var o=null==n?void 0:n[t[u]];void 0===o&&(o=r,u=e),n=p(o)?o.call(n):o}return n},uniqueId:function(n){var t=++Kn+"";return n?n+t:t},chain:function(n){return(n=m(n))._chain=!0,n},iteratee:Rn,partial:M,bind:Gn,bindAll:Hn,memoize:function(e,u){function o(n){var t=o.cache,r=""+(u?u.apply(this,arguments):n);return y(t,r)||(t[r]=e.apply(this,arguments)),t[r]}return o.cache={},o},delay:Qn,defer:Xn,throttle:function(r,e,u){function o(){l=!1===u.leading?0:O(),i=null,c=r.apply(a,f),i||(a=f=null)}function n(){var n=O(),t=(l||!1!==u.leading||(l=n),e-(n-l));return a=this,f=arguments,t<=0||e<t?(i&&(clearTimeout(i),i=null),l=n,c=r.apply(a,f),i||(a=f=null)):i||!1===u.trailing||(i=setTimeout(o,t)),c}var i,a,f,c,l=0;return u=u||{},n.cancel=function(){clearTimeout(i),l=0,i=a=f=null},n},debounce:function(t,r,e){function u(){var n=O()-i;n<r?o=setTimeout(u,r-n):(o=null,e||(f=t.apply(c,a)),o||(a=c=null))}var o,i,a,f,c,n=l(function(n){return c=this,a=n,i=O(),o||(o=setTimeout(u,r),e&&(f=t.apply(c,a))),f});return n.cancel=function(){clearTimeout(o),o=a=c=null},n},wrap:function(n,t){return M(t,n)},negate:Yn,compose:function(){var r=arguments,e=r.length-1;return function(){for(var n=e,t=r[e].apply(this,arguments);n--;)t=r[n].call(this,t);return t}},after:function(n,t){return function(){if(--n<1)return t.apply(this,arguments)}},before:Zn,once:nt,findKey:tt,findIndex:et,findLastIndex:ut,sortedIndex:ot,indexOf:at,lastIndexOf:ft,find:ct,detect:ct,findWhere:function(n,t){return ct(n,A(t))},each:N,forEach:N,map:I,collect:I,reduce:st,foldl:st,inject:st,reduceRight:pt,foldr:pt,filter:T,select:T,reject:function(n,t,r){return T(n,Yn(S(t)),r)},every:ht,all:ht,some:vt,any:vt,contains:k,includes:k,include:k,invoke:yt,pluck:dt,where:function(n,t){return T(n,A(t))},max:gt,min:function(n,e,t){var r,u,o=1/0,i=1/0;if(null==e||"number"==typeof e&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=E(n)?n:j(n)).length;a<f;a++)null!=(r=n[a])&&r<o&&(o=r);else e=S(e,t),N(n,function(n,t,r){((u=e(n,t,r))<i||u===1/0&&o===1/0)&&(o=n,i=u)});return o},shuffle:function(n){return jt(n,1/0)},sample:jt,sortBy:function(n,e,t){var u=0;return e=S(e,t),dt(I(n,function(n,t,r){return{value:n,index:u++,criteria:e(n,t,r)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(e<r||void 0===r)return 1;if(r<e||void 0===e)return-1}return n.index-t.index}),"value")},groupBy:wt,indexBy:_t,countBy:At,partition:xt,toArray:mt,size:function(n){return null==n?0:(E(n)?n:b(n)).length},pick:Ot,omit:Mt,first:Bt,head:Bt,take:Bt,initial:Et,last:function(n,t,r){return null==n||n.length<1?null==t||r?void 0:[]:null==t||r?n[n.length-1]:R(n,Math.max(0,n.length-t))},rest:R,tail:R,drop:R,compact:function(n){return T(n,Boolean)},flatten:function(n,t){return B(n,t,!1)},without:It,uniq:Tt,unique:Tt,union:kt,intersection:function(n){for(var t=[],r=arguments.length,e=0,u=g(n);e<u;e++){var o=n[e];if(!k(t,o)){for(var i=1;i<r&&k(arguments[i],o);i++);i===r&&t.push(o)}}return t},difference:Nt,unzip:Dt,transpose:Dt,zip:Rt,object:function(n,t){for(var r={},e=0,u=g(n);e<u;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},range:function(n,t,r){null==t&&(t=n||0,n=0),r=r||(t<n?-1:1);for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),o=0;o<e;o++,n+=r)u[o]=n;return u},chunk:function(n,t){if(null==t||t<1)return[];for(var r=[],e=0,u=n.length;e<u;)r.push(f.call(n,e,e+=t));return r},mixin:Ft,default:m});return n._=n});