1(function(pa,ni){typeof exports=="object"&&typeof module<"u"?module.exports=ni():typeof define=="function"&&define.amd?define(ni):(pa=typeof globalThis<"u"?globalThis:pa||self,pa.Atumquiz=ni())})(this,function(){"use strict";const pa="3.7.7",ni=pa,va=typeof Buffer=="function",Pl=typeof TextDecoder=="function"?new TextDecoder:void 0,ql=typeof TextEncoder=="function"?new TextEncoder:void 0,ai=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),Yi=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(ai),k0=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Kt=String.fromCharCode.bind(String),Ul=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),zl=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),Yl=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),Vl=t=>{let e,r,n,a,i="";const s=t.length%3;for(let u=0;u<t.length;){if((r=t.charCodeAt(u++))>255||(n=t.charCodeAt(u++))>255||(a=t.charCodeAt(u++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|a,i+=ai[e>>18&63]+ai[e>>12&63]+ai[e>>6&63]+ai[e&63]}return s?i.slice(0,s-3)+"===".substring(s):i},qo=typeof btoa=="function"?t=>btoa(t):va?t=>Buffer.from(t,"binary").toString("base64"):Vl,Uo=va?t=>Buffer.from(t).toString("base64"):t=>{let r=[];for(let n=0,a=t.length;n<a;n+=4096)r.push(Kt.apply(null,t.subarray(n,n+4096)));return qo(r.join(""))},Vi=(t,e=!1)=>e?zl(Uo(t)):Uo(t),I0=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?Kt(192|e>>>6)+Kt(128|e&63):Kt(224|e>>>12&15)+Kt(128|e>>>6&63)+Kt(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return Kt(240|e>>>18&7)+Kt(128|e>>>12&63)+Kt(128|e>>>6&63)+Kt(128|e&63)}},L0=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Hl=t=>t.replace(L0,I0),Wl=va?t=>Buffer.from(t,"utf8").toString("base64"):ql?t=>Uo(ql.encode(t)):t=>qo(Hl(t)),ga=(t,e=!1)=>e?zl(Wl(t)):Wl(t),Gl=t=>ga(t,!0),R0=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,$0=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return Kt((r>>>10)+55296)+Kt((r&1023)+56320);case 3:return Kt((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return Kt((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},jl=t=>t.replace(R0,$0),Zl=t=>{if(t=t.replace(/\s+/g,""),!k0.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,r="",n,a;for(let i=0;i<t.length;)e=Yi[t.charAt(i++)]<<18|Yi[t.charAt(i++)]<<12|(n=Yi[t.charAt(i++)])<<6|(a=Yi[t.charAt(i++)]),r+=n===64?Kt(e>>16&255):a===64?Kt(e>>16&255,e>>8&255):Kt(e>>16&255,e>>8&255,e&255);return r},zo=typeof atob=="function"?t=>atob(Yl(t)):va?t=>Buffer.from(t,"base64").toString("binary"):Zl,Xl=va?t=>Ul(Buffer.from(t,"base64")):t=>Ul(zo(t).split("").map(e=>e.charCodeAt(0))),Jl=t=>Xl(Ql(t)),P0=va?t=>Buffer.from(t,"base64").toString("utf8"):Pl?t=>Pl.decode(Xl(t)):t=>jl(zo(t)),Ql=t=>Yl(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),Yo=t=>P0(Ql(t)),q0=t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},Kl=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),ec=function(){const t=(e,r)=>Object.defineProperty(String.prototype,e,Kl(r));t("fromBase64",function(){return Yo(this)}),t("toBase64",function(e){return ga(this,e)}),t("toBase64URI",function(){return ga(this,!0)}),t("toBase64URL",function(){return ga(this,!0)}),t("toUint8Array",function(){return Jl(this)})},tc=function(){const t=(e,r)=>Object.defineProperty(Uint8Array.prototype,e,Kl(r));t("toBase64",function(e){return Vi(this,e)}),t("toBase64URI",function(){return Vi(this,!0)}),t("toBase64URL",function(){return Vi(this,!0)})},Vo={version:pa,VERSION:ni,atob:zo,atobPolyfill:Zl,btoa:qo,btoaPolyfill:Vl,fromBase64:Yo,toBase64:ga,encode:ga,encodeURI:Gl,encodeURL:Gl,utob:Hl,btou:jl,decode:Yo,isValid:q0,fromUint8Array:Vi,toUint8Array:Jl,extendString:ec,extendUint8Array:tc,extendBuiltins:()=>{ec(),tc()}};function Nn(t){return typeof t=="string"||t instanceof String}function rc(t){var e;return typeof t=="object"&&t!=null&&(t==null||(e=t.constructor)==null?void 0:e.name)==="Object"}function nc(t,e){return Array.isArray(e)?nc(t,(r,n)=>e.includes(n)):Object.entries(t).reduce((r,n)=>{let[a,i]=n;return e(i,a)&&(r[a]=i),r},{})}const Ue={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function U0(t){switch(t){case Ue.LEFT:return Ue.FORCE_LEFT;case Ue.RIGHT:return Ue.FORCE_RIGHT;default:return t}}function Ho(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function Hi(t,e){if(e===t)return!0;const r=Array.isArray(e),n=Array.isArray(t);let a;if(r&&n){if(e.length!=t.length)return!1;for(a=0;a<e.length;a++)if(!Hi(e[a],t[a]))return!1;return!0}if(r!=n)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){const i=e instanceof Date,s=t instanceof Date;if(i&&s)return e.getTime()==t.getTime();if(i!=s)return!1;const u=e instanceof RegExp,l=t instanceof RegExp;if(u&&l)return e.toString()==t.toString();if(u!=l)return!1;const o=Object.keys(e);for(a=0;a<o.length;a++)if(!Object.prototype.hasOwnProperty.call(t,o[a]))return!1;for(a=0;a<o.length;a++)if(!Hi(t[o[a]],e[o[a]]))return!1;return!0}else if(e&&t&&typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();return!1}class z0{constructor(e){for(Object.assign(this,e);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?Ue.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?Ue.RIGHT:Ue.LEFT}}
1function He(t,e){return new He.InputMask(t,e)}function ac(t){if(t==null)throw new Error("mask property should be defined");return t instanceof RegExp?He.MaskedRegExp:Nn(t)?He.MaskedPattern:t===Date?He.MaskedDate:t===Number?He.MaskedNumber:Array.isArray(t)||t===Array?He.MaskedDynamic:He.Masked&&t.prototype instanceof He.Masked?t:He.Masked&&t instanceof He.Masked?t.constructor:t instanceof Function?He.MaskedFunction:(console.warn("Mask not found for mask",t),He.Masked)}function ii(t){if(!t)throw new Error("Options in not defined");if(He.Masked){if(t.prototype instanceof He.Masked)return{mask:t};const{mask:e=void 0,...r}=t instanceof He.Masked?{mask:t}:rc(t)&&t.mask instanceof He.Masked?t:{};if(e){const n=e.mask;return{...nc(e,(a,i)=>!i.startsWith("_")),mask:e.constructor,_mask:n,...r}}}return rc(t)?{...t}:{mask:t}}function un(t){if(He.Masked&&t instanceof He.Masked)return t;const e=ii(t),r=ac(e.mask);if(!r)throw new Error("Masked class is not found for provided mask "+e.mask+", appropriate module needs to be imported manually before creating mask.");return e.mask===r&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new r(e)}He.createMask=un;class Wo{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return e??this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return e??this.value.length}select(e,r){if(!(e==null||r==null||e===this.selectionStart&&r===this.selectionEnd))try{this._unsafeSelect(e,r)}catch{}}get isActive(){return!1}}He.MaskElement=Wo;const ic=90,Y0=89;class Wi extends Wo{constructor(e){super(),this.input=e,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var e,r,n;return(e=(r=(n=this.input).getRootNode)==null?void 0:r.call(n))!=null?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",e.drop),this.input.addEventListener("click",e.click),this.input.addEventListener("focus",e.focus),this.input.addEventListener("blur",e.commit),this._handlers=e}_onKeydown(e){if(this._handlers.redo&&(e.keyCode===ic&&e.shiftKey&&(e.metaKey||e.ctrlKey)||e.keyCode===Y0&&e.ctrlKey))return e.preventDefault(),this._handlers.redo(e);if(this._handlers.undo&&e.keyCode===ic&&(e.metaKey||e.ctrlKey))return e.preventDefault(),this._handlers.undo(e);e.isComposing||this._handlers.selectionChange(e)}_onBeforeinput(e){if(e.inputType==="historyUndo"&&this._handlers.undo)return e.preventDefault(),this._handlers.undo(e);if(e.inputType==="historyRedo"&&this._handlers.redo)return e.preventDefault(),this._handlers.redo(e)}_onCompositionEnd(e){this._handlers.input(e)}_onInput(e){e.isComposing||this._handlers.input(e)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}He.HTMLMaskElement=Wi;class V0 extends Wi{constructor(e){super(e),this.input=e}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,r){this.input.setSelectionRange(e,r)}get value(){return this.input.value}set value(e){this.input.value=e}}He.HTMLMaskElement=Wi;class sc extends Wi{get _unsafeSelectionStart(){const e=this.rootElement,r=e.getSelection&&e.getSelection(),n=r&&r.anchorOffset,a=r&&r.focusOffset;return a==null||n==null||n<a?n:a}get _unsafeSelectionEnd(){const e=this.rootElement,r=e.getSelection&&e.getSelection(),n=r&&r.anchorOffset,a=r&&r.focusOffset;return a==null||n==null||n>a?n:a}_unsafeSelect(e,r){if(!this.rootElement.createRange)return;const n=this.rootElement.createRange();n.setStart(this.input.firstChild||this.input,e),n.setEnd(this.input.last
1Child||this.input,r);const a=this.rootElement,i=a.getSelection&&a.getSelection();i&&(i.removeAllRanges(),i.addRange(n))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}He.HTMLContenteditableMaskElement=sc;class Gi{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(e){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(e),this.states.length>Gi.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(e){return this.currentIndex=Math.min(Math.max(this.currentIndex+e,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}Gi.MAX_LENGTH=100;class H0{constructor(e,r){this.el=e instanceof Wo?e:e.isContentEditable&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"?new sc(e):new V0(e),this.masked=un(r),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Gi,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(e){var r;return e==null||((r=this.masked)==null?void 0:r.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof He.Masked)&&this.masked.constructor===ac(e)){this.masked.updateOptions({mask:e});return}const r=e instanceof He.Masked?e:un({mask:e});r.unmaskedValue=this.masked.unmaskedValue,this.masked=r}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(e){this.rawInputValue!==e&&(this.masked.rawInputValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e,r){const n=this._listeners[e];n&&n.forEach(a=>a(r))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){!this.el||!this.el.isActive||(this.el.select(e,e),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(e){const r=this.masked.unmaskedValue,n=this.masked.value,a=this.masked.rawInputValue,i=this.displayValue,s=this.unmaskedValue!==r||this.value!==n||this._rawInputValue!==a;this._unmaskedValue=r,this._value=n,this._rawInputValue=a,this.el.value!==i&&(this.el.value=i),e==="auto"?this.alignCursor():e!=null&&(this.cursorPos=e),s&&this._fireChangeEvents(),!this._historyChanging&&(s||this.history.isEmpty)&&this.history.push({unmaskedValue:r,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(e){const{mask:r,...n}=e,a=!this.maskEquals(r),i=this.masked.optionsIsChanged(n);a&&(this.mask=r),i&&this.masked.updateOptions(n),(a||i)&&this.updateControl()}updateCursor(e){e!=null&&(this.cursorPos=e,this._delayUpdateCursor(e))}
vendor: 5,828 bytes, line 1
1_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,Ue.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,r){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(r),this}off(e,r){if(!this._listeners[e])return this;if(!r)return delete this._listeners[e],this;const n=this._listeners[e].indexOf(r);return n>=0&&this._listeners[e].splice(n,1),this}_onInput(e){this._inputEvent=e,this._abortUpdateCursor();const r=new z0({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),n=this.masked.rawInputValue,a=this.masked.splice(r.startChangePos,r.removed.length,r.inserted,r.removeDirection,{input:!0,raw:!0}).offset,i=n===this.masked.rawInputValue?r.removeDirection:Ue.NONE;let s=this.masked.nearestInputPos(r.startChangePos+a,i);i!==Ue.NONE&&(s=this.masked.nearestInputPos(s,Ue.NONE)),this.updateControl(s),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(e){e&&(this._historyChanging=!0,this.unmaskedValue=e.unmaskedValue,this.el.select(e.selection.start,e.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}He.InputMask=H0;class ct{static normalize(e){return Array.isArray(e)?e:[e,new ct]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},e)}aggregate(e){return this.inserted+=e.inserted,this.rawInserted+=e.rawInserted,this.tailShift+=e.tailShift,this.skip=this.skip||e.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(e){return this.inserted===e.inserted&&this.tailShift===e.tailShift&&this.rawInserted===e.rawInserted&&this.skip===e.skip}}He.ChangeDetails=ct;class Qr{constructor(e,r,n){e===void 0&&(e=""),r===void 0&&(r=0),this.value=e,this.from=r,this.stop=n}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||e!=null&&this.from>=e)return"";const r=this.value[0];return this.value=this.value.slice(1),r}shift(){if(!this.value.length)return"";const e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class rr{constructor(e){this._value="",this._update({...rr.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){this.optionsIsChanged(e)&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,r){r===void 0&&(r={input:!0}),this.reset(),this.append(e,r,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,r){return e}totalInputPositions(e,r){return e===void 0&&(e=0),r===void 0&&(r=this.displayValue.length),Math.min(this.displayValue.length,r-e)}extractInput(e,r,n){return e===void 0&&(e=0),r===void 0&&(r=this.displayValue.length),this.displayValue.slice(e,r)}extractTail(e,r){return e===void 0&&(e=0),r===void 0&&(r=this.displayValue.length),new Qr(this.extractInput(e,r),e)}appendTail(e){return Nn(e)&&(e=new Qr(String(e))),e.appendTo(this)}_appendCharRaw(e,r){return e?(this._value+=e,new ct({inserted:e,rawInserted:e})):new ct}_appendChar(e,r,n){r===void 0&&(r={});const a=this.state;let i;if([e,i]=this.doPrepareChar(e,r),e&&(i=i.aggregate(this._appendCharRaw(e,r)),!i.rawInserted&&this.autofix==="pad")){const s=this.state;this.state=a;let u=this.pad(r);const l=this._appendCharRaw(e,r);u=u.aggregate(l),l.rawInserted||u.equals(i)?i=u:this.state=s}if(i.inserted){let s,u=this.doValidate(r)!==!1;if(u&&n!=null){const l=this.state;if(this.overwrite===!0){s=n.state;for(let c=0;c<i.rawInserted.length;++c)n.unshift(this.displayValue.length-i.tailShift)}let o=this.appendTail(n);if(u=o.rawInserted.length===n.toString().length,!(u&&o.inserted)&&this.overwrite==="shift"){this.state=l,s=n.state;for(let c=0;c<i.rawInserted.length;++c)n.shift();o=this.appendTail(n),u=o.rawInserted.length===n.toString().length}u&&o.inserted&&(this.state=l)}u||(i=new ct,this.state=a,n&&s&&(n.state=s))}return i}_appendPlaceholder(){return new ct}_appendEager(){return new ct}append(e,r,n){if(!Nn(e))throw new Error("value should be string");const a=Nn(n)?new Qr(String(n)):n;r!=null&&r.tail&&(r._beforeTailState=this.state);let i;
1[e,i]=this.doPrepare(e,r);for(let s=0;s<e.length;++s){const u=this._appendChar(e[s],r,a);if(!u.rawInserted&&!this.doSkipInvalid(e[s],r,a))break;i.aggregate(u)}return(this.eager===!0||this.eager==="append")&&r!=null&&r.input&&e&&i.aggregate(this._appendEager()),a!=null&&(i.tailShift+=this.appendTail(a).tailShift),i}remove(e,r){return e===void 0&&(e=0),r===void 0&&(r=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(r),new ct}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;const r=this.rawInputValue,n=this.value,a=e();return this.rawInputValue=r,this.value&&this.value!==n&&n.indexOf(this.value)===0&&(this.append(n.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,a}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;const r=this.state,n=e(this);return this.state=r,delete this._isolated,n}doSkipInvalid(e,r,n){return!!this.skipInvalid}doPrepare(e,r){return r===void 0&&(r={}),ct.normalize(this.prepare?this.prepare(e,this,r):e)}doPrepareChar(e,r){return r===void 0&&(r={}),ct.normalize(this.prepareChar?this.prepareChar(e,this,r):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,r,n,a,i){n===void 0&&(n=""),a===void 0&&(a=Ue.NONE),i===void 0&&(i={input:!0});const s=e+r,u=this.extractTail(s),l=this.eager===!0||this.eager==="remove";let o;l&&(a=U0(a),o=this.extractInput(0,s,{raw:!0}));let c=e;const f=new ct;if(a!==Ue.NONE&&(c=this.nearestInputPos(e,r>1&&e!==0&&!l?Ue.NONE:a),f.tailShift=c-e),f.aggregate(this.remove(c)),l&&a!==Ue.NONE&&o===this.rawInputValue)if(a===Ue.FORCE_LEFT){let d;for(;o===this.rawInputValue&&(d=this.displayValue.length);)f.aggregate(new ct({tailShift:-1})).aggregate(this.remove(d-1))}else a===Ue.FORCE_RIGHT&&u.unshift();return f.aggregate(this.append(n,i,u))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!Hi(this,e)}typedValueEquals(e){const r=this.typedValue;return e===r||rr.EMPTY_VALUES.includes(e)&&rr.EMPTY_VALUES.includes(r)||(this.format?this.format(e,this)===this.format(this.typedValue,this):!1)}pad(e){return new ct}}rr.DEFAULTS={skipInvalid:!0},rr.EMPTY_VALUES=[void 0,null,""],He.Masked=rr;class jn{constructor(e,r){e===void 0&&(e=[]),r===void 0&&(r=0),this.chunks=e,this.from=r}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=Nn(e)?new Qr(String(e)):e;const r=this.chunks[this.chunks.length-1],n=r&&(r.stop===e.stop||e.stop==null)&&e.from===r.from+r.toString().length;if(e instanceof Qr)n?r.extend(e.toString()):this.chunks.push(e);else if(e instanceof jn){if(e.stop==null){let a;for(;e.chunks.length&&e.chunks[0].stop==null;)a=e.chunks.shift(),a.from+=e.from,this.extend(a)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof He.MaskedPattern))return new Qr(this.toString()).appendTo(e);const r=new ct;for(let n=0;n<this.chunks.length;++n){const a=this.chunks[n],i=e._mapPosToBlock(e.displayValue.length),s=a.stop;let u;if(s!=null&&(!i||i.index<=s)&&((a instanceof jn||e._stops.indexOf(s)>=0)&&r.aggregate(e._appendPlaceholder(s)),u=a instanceof jn&&e._blocks[s]),u){const l=u.appendTail(a);r.aggregate(l);const o=a.toString().slice(l.rawInserted.length);o&&r.aggregate(e.append(o,{tail:!0}))}else r.aggregate(e.append(a.toString(),{tail:!0}))}return r}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:r,...n}=e;Object.assign(this,n),this.chunks=r.map(a=>{const i="chunks"in a?new jn:new Qr;return i.state=a,i})}unshift(e){if(!this.chunks.length||e!=null&&this.from>=e)return"";const r=e!=null?e-this.from:e;let n=0;for(;n<this.chunks.length;){const a=this.chunks[n],i=a.unshift(r);if(a.toString()){if(!i)break;++n}else this.chunks.splice(n,1);if(i)return i}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const r=this.chunks[e],n=r.shift();if(r.toString()){if(!n)break;--e}else this.chunks.splice(e,1);if(n)return n}return""}}class W0{constructor(e,r){this.masked=e,this._log=[];const{offset:n,index:a}=e._mapPosToBlock(r)||(r<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=n,this.index=a,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){const e=this._log.pop();return e&&(this.state=e),e}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((r=this.block)==null?void 0:r.displayValue.length)||0){var r;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Ue.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Ue.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Ue.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Ue.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Ue.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Ue.NONE),!0})}}class oc{constructor(e){Object.assign(this,e),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(e,r){return e===void 0&&(e=0),r===void 0&&(r=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(r),this._value||(this._isRawInput=!1),new ct}nearestInputPos(e,r){r===void 0&&(r=Ue.NONE);const n=0,a=this._value.length;switch(r){case Ue.LEFT:case Ue.FORCE_LEFT:return n;case Ue.NONE:case Ue.RIGHT:case Ue.FORCE_RIGHT:default:return a}}totalInputPositions(e,r){return e===void 0&&(e=0),r===void 0&&(r=this._value.length),this._isRawInput?r-e:0}extractInput(e,r,n){return e===void 0&&(e=0),r===void 0&&(r=this._value.length),n===void 0&&(n={}),n.raw&&this._isRawInput&&this._value.slice(e,r)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(e,r){if(r===void 0&&(r={}),this.isFilled)return new ct;
1const n=this.eager===!0||this.eager==="append",i=this.char===e&&(this.isUnmasking||r.input||r.raw)&&(!r.raw||!n)&&!r.tail,s=new ct({inserted:this.char,rawInserted:i?this.char:""});return this._value=this.char,this._isRawInput=i&&(r.raw||r.input),s}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new ct;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new Qr("")}appendTail(e){return Nn(e)&&(e=new Qr(String(e))),e.appendTo(this)}append(e,r,n){const a=this._appendChar(e[0],r);return n!=null&&(a.tailShift+=this.appendTail(n).tailShift),a}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=!!e._rawInputValue}pad(e){return this._appendPlaceholder()}}class ji{constructor(e){const{parent:r,isOptional:n,placeholderChar:a,displayChar:i,lazy:s,eager:u,...l}=e;this.masked=un(l),Object.assign(this,{parent:r,isOptional:n,placeholderChar:a,displayChar:i,lazy:s,eager:u})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,r){return e===void 0&&(e=0),r===void 0&&(r=this.value.length),e===0&&r>=1?(this.isFilled=!1,this.masked.remove(e,r)):new ct}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(e,r){if(r===void 0&&(r={}),this.isFilled)return new ct;const n=this.masked.state;let a=this.masked._appendChar(e,this.currentMaskFlags(r));return a.inserted&&this.doValidate(r)===!1&&(a=new ct,this.masked.state=n),!a.inserted&&!this.isOptional&&!this.lazy&&!r.input&&(a.inserted=this.placeholderChar),a.skip=!a.inserted&&!this.isOptional,this.isFilled=!!a.inserted,a}append(e,r,n){return this.masked.append(e,this.currentMaskFlags(r),n)}_appendPlaceholder(){return this.isFilled||this.isOptional?new ct:(this.isFilled=!0,new ct({inserted:this.placeholderChar}))}_appendEager(){return new ct}extractTail(e,r){return this.masked.extractTail(e,r)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,r,n){return e===void 0&&(e=0),r===void 0&&(r=this.value.length),this.masked.extractInput(e,r,n)}nearestInputPos(e,r){r===void 0&&(r=Ue.NONE);const n=0,a=this.value.length,i=Math.min(Math.max(e,n),a);switch(r){case Ue.LEFT:case Ue.FORCE_LEFT:return this.isComplete?i:n;case Ue.RIGHT:case Ue.FORCE_RIGHT:return this.isComplete?i:a;case Ue.NONE:default:return i}}totalInputPositions(e,r){return e===void 0&&(e=0),r===void 0&&(r=this.value.length),this.value.slice(e,r).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var r;return{...e,_beforeTailState:(e==null||(r=e._beforeTailState)==null?void 0:r.masked)||e?._beforeTailState}}pad(e){return new ct}}ji.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u
10EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class G0 extends rr{updateOptions(e){super.updateOptions(e)}_update(e){const r=e.mask;r&&(e.validate=n=>n.search(r)>=0),super._update(e)}}He.MaskedRegExp=G0;class nr extends rr{constructor(e){super({...nr.DEFAULTS,...e,definitions:Object.assign({},ji.DEFAULT_DEFINITIONS,e?.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){const e=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const r=this.mask;if(!r||!e)return;let n=!1,a=!1;for(let i=0;i<r.length;++i){if(this.blocks){const o=r.slice(i),c=Object.keys(this.blocks).filter(d=>o.indexOf(d)===0);c.sort((d,m)=>m.length-d.length);const f=c[0];if(f){const{expose:d,repeat:m,...h}=ii(this.blocks[f]),p={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...h,repeat:m,parent:this},g=m!=null?new He.RepeatBlock(p):un(p);g&&(this._blocks.push(g),d&&(this.exposeBlock=g),this._maskedBlocks[f]||(this._maskedBlocks[f]=[]),this._maskedBlocks[f].push(this._blocks.length-1)),i+=f.length-1;continue}}let s=r[i],u=s in e;if(s===nr.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(s==="{"||s==="}"){n=!n;continue}if(s==="["||s==="]"){a=!a;continue}if(s===nr.ESCAPE_CHAR){if(++i,s=r[i],!s)break;u=!1}const l=u?new ji({isOptional:a,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...ii(e[s]),parent:this}):new oc({char:s,eager:this.eager,isUnmasking:n});this._blocks.push(l)}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){if(!e){this.reset();return}const{_blocks:r,...n}=e;this._blocks.forEach((a,i)=>a.state=r[i]),super.state=n}
1reset(){super.reset(),this._blocks.forEach(e=>e.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(e=>e.isComplete)}get isFilled(){return this._blocks.every(e=>e.isFilled)}get isFixed(){return this._blocks.every(e=>e.isFixed)}get isOptional(){return this._blocks.every(e=>e.isOptional)}doCommit(){this._blocks.forEach(e=>e.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((e,r)=>e+=r.unmaskedValue,"")}set unmaskedValue(e){if(this.exposeBlock){const r=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(r),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,r)=>e+=r.value,"")}set value(e){if(this.exposeBlock){const r=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(r),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){const r=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(r),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce((e,r)=>e+=r.displayValue,"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;const r=new ct;let n=(e=this._mapPosToBlock(this.displayValue.length))==null?void 0:e.index;if(n==null)return r;this._blocks[n].isFilled&&++n;for(let a=n;a<this._blocks.length;++a){const i=this._blocks[a]._appendEager();if(!i.inserted)break;r.aggregate(i)}return r}_appendCharRaw(e,r){r===void 0&&(r={});const n=this._mapPosToBlock(this.displayValue.length),a=new ct;if(!n)return a;for(let s=n.index,u;u=this._blocks[s];++s){var i;const l=u._appendChar(e,{...r,_beforeTailState:(i=r._beforeTailState)==null||(i=i._blocks)==null?void 0:i[s]});if(a.aggregate(l),l.consumed)break}return a}extractTail(e,r){e===void 0&&(e=0),r===void 0&&(r=this.displayValue.length);const n=new jn;return e===r||this._forEachBlocksInRange(e,r,(a,i,s,u)=>{const l=a.extractTail(s,u);l.stop=this._findStopBefore(i),l.from=this._blockStartPos(i),l instanceof jn&&(l.blockIndex=i),n.extend(l)}),n}extractInput(e,r,n){if(e===void 0&&(e=0),r===void 0&&(r=this.displayValue.length),n===void 0&&(n={}),e===r)return"";let a="";return this._forEachBlocksInRange(e,r,(i,s,u,l)=>{a+=i.extractInput(u,l,n)}),a}_findStopBefore(e){let r;for(let n=0;n<this._stops.length;++n){const a=this._stops[n];if(a<=e)r=a;else break}return r}_appendPlaceholder(e){const r=new ct;if(this.lazy&&e==null)return r;const n=this._mapPosToBlock(this.displayValue.length);if(!n)return r;const a=n.index,i=e??this._blocks.length;return this._blocks.slice(a,i).forEach(s=>{if(!s.lazy||e!=null){var u;r.aggregate(s._appendPlaceholder((u=s._blocks)==null?void 0:u.length))}}),r}_mapPosToBlock(e){let r="";for(let n=0;n<this._blocks.length;++n){const a=this._blocks[n],i=r.length;if(r+=a.displayValue,e<=r.length)return{index:n,offset:e-i}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((r,n)=>r+=n.displayValue.length,0)}_forEachBlocksInRange(e,r,n){r===void 0&&(r=this.displayValue.length);const a=this._mapPosToBlock(e);if(a){const i=this._mapPosToBlock(r),s=i&&a.index===i.index,u=a.offset,l=i&&s?i.offset:this._blocks[a.index].displayValue.length;if(n(this._blocks[a.index],a.index,u,l),i&&!s){for(let o=a.index+1;o<i.index;++o)n(this._blocks[o],o,0,this._blocks[o].displayValue.length);n(this._blocks[i.index],i.index,0,i.offset)}}}remove(e,r){e===void 0&&(e=0),r===void 0&&(r=this.displayValue.length);const n=super.remove(e,r);return this._forEachBlocksInRange(e,r,(a,i,s,u)=>{n.aggregate(a.remove(s,u))}),n}nearestInputPos(e,r){if(r===void 0&&(r=Ue.NONE),!this._blocks.length)return 0;const n=new W0(this,e);if(r===Ue.NONE)return n.pushRightBeforeInput()||(n.popState(),n.pushLeftBeforeInput())?n.pos:this.displayValue.length;if(r===Ue.LEFT||r===Ue.FORCE_LEFT){if(r===Ue.LEFT){if(n.pushRightBeforeFilled(),n.ok&&n.pos===e)return e;n.popState()}if(n.pushLeftBeforeInput(),n.pushLeftBeforeRequired(),n.pushLeftBeforeFilled(),r===Ue.LEFT){if(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.ok&&n.pos<=e||(n.popState(),n.ok&&n.pos<=e))return n.pos;n.popState()}return n.ok?n.pos:r===Ue.FORCE_LEFT?0:(n.popState(),n.ok||(n.popState(),n.ok)?n.pos:0)}return r===Ue.RIGHT||r===Ue.FORCE_RIGHT?(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.pushRightBeforeFilled()?n.pos:r===Ue.FORCE_RIGHT?this.displayValue.length:(n.popState(),n.ok||(n.popState(),n.ok)?n.pos:this.nearestInputPos(e,Ue.LEFT))):e}totalInputPositions(e,r){e===void 0&&(e=0),r===void 0&&(r=this.displayValue.length);let n=0;
1return this._forEachBlocksInRange(e,r,(a,i,s,u)=>{n+=a.totalInputPositions(s,u)}),n}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const r=this._maskedBlocks[e];return r?r.map(n=>this._blocks[n]):[]}pad(e){const r=new ct;return this._forEachBlocksInRange(0,this.displayValue.length,n=>r.aggregate(n.pad(e))),r}}nr.DEFAULTS={...rr.DEFAULTS,lazy:!0,placeholderChar:"_"},nr.STOP_CHAR="`",nr.ESCAPE_CHAR="\\",nr.InputDefinition=ji,nr.FixedDefinition=oc,He.MaskedPattern=nr;class Zi extends nr{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{to:r=this.to||0,from:n=this.from||0,maxLength:a=this.maxLength||0,autofix:i=this.autofix,...s}=e;this.to=r,this.from=n,this.maxLength=Math.max(String(r).length,a),this.autofix=i;const u=String(this.from).padStart(this.maxLength,"0"),l=String(this.to).padStart(this.maxLength,"0");let o=0;for(;o<l.length&&l[o]===u[o];)++o;s.mask=l.slice(0,o).replace(/0/g,"\\0")+"0".repeat(this.maxLength-o),super._update(s)}get isComplete(){return super.isComplete&&!!this.value}boundaries(e){let r="",n="";const[,a,i]=e.match(/^(\D*)(\d*)(\D*)/)||[];return i&&(r="0".repeat(a.length)+i,n="9".repeat(a.length)+i),r=r.padEnd(this.maxLength,"0"),n=n.padEnd(this.maxLength,"9"),[r,n]}doPrepareChar(e,r){r===void 0&&(r={});let n;return[e,n]=super.doPrepareChar(e.replace(/\D/g,""),r),e||(n.skip=!this.isComplete),[e,n]}_appendCharRaw(e,r){if(r===void 0&&(r={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(e,r);const n=String(this.from).padStart(this.maxLength,"0"),a=String(this.to).padStart(this.maxLength,"0"),[i,s]=this.boundaries(this.value+e);return Number(s)<this.from?super._appendCharRaw(n[this.value.length],r):Number(i)>this.to?!r.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(n[this.value.length],r).aggregate(this._appendCharRaw(e,r)):super._appendCharRaw(a[this.value.length],r):super._appendCharRaw(e,r)}doValidate(e){const r=this.value;if(r.search(/[^0]/)===-1&&r.length<=this._matchFrom)return!0;const[a,i]=this.boundaries(r);return this.from<=Number(i)&&Number(a)<=this.to&&super.doValidate(e)}pad(e){const r=new ct;if(this.value.length===this.maxLength)return r;const n=this.value,a=this.maxLength-this.value.length;if(a){this.reset();for(let i=0;i<a;++i)r.aggregate(super._appendCharRaw("0",e));n.split("").forEach(i=>this._appendCharRaw(i))}return r}}He.MaskedRange=Zi;const j0="d{.}`m{.}`Y";class ln extends nr{static extractPatternOptions(e){const{mask:r,pattern:n,...a}=e;return{...a,mask:Nn(r)?r:n}}constructor(e){super(ln.extractPatternOptions({...ln.DEFAULTS,...e}))}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:r,pattern:n,blocks:a,...i}={...ln.DEFAULTS,...e},s=Object.assign({},ln.GET_DEFAULT_BLOCKS());e.min&&(s.Y.from=e.min.getFullYear()),e.max&&(s.Y.to=e.max.getFullYear()),e.min&&e.max&&s.Y.from===s.Y.to&&(s.m.from=e.min.getMonth()+1,s.m.to=e.max.getMonth()+1,s.m.from===s.m.to&&(s.d.from=e.min.getDate(),s.d.to=e.max.getDate())),Object.assign(s,this.blocks,a),super._update({...i,mask:Nn(r)?r:n,blocks:s})}doValidate(e){const r=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&r!=null&&(this.min==null||this.min<=r)&&(this.max==null||r<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}optionsIsChanged(e){return super.optionsIsChanged(ln.extractPatternOptions(e))}}ln.GET_DEFAULT_BLOCKS=()=>({d:{mask:Zi,from:1,to:31,maxLength:2},m:{mask:Zi,from:1,to:12,maxLength:2},Y:{mask:Zi,from:1900,to:9999}}),ln.DEFAULTS={...nr.DEFAULTS,mask:Date,pattern:j0,format:(t,e)=>{if(!t)return"";const r=String(t.getDate()).padStart(2,"0"),n=String(t.getMonth()+1).padStart(2,"0"),a=t.getFullYear();return[r,n,a].join(".")},parse:(t,e)=>{const[r,n,a]=t.split(".").map(Number);return new Date(a,n-1,r)}},He.MaskedDate=ln;class Xi extends rr{constructor(e){super({...Xi.DEFAULTS,...e}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),"mask"in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map(r=>{const{expose:n,...a}=ii(r),i=un({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...a}
1);return n&&(this.exposeMask=i),i}):[])}_appendCharRaw(e,r){r===void 0&&(r={});const n=this._applyDispatch(e,r);return this.currentMask&&n.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(r))),n}_applyDispatch(e,r,n){e===void 0&&(e=""),r===void 0&&(r={}),n===void 0&&(n="");const a=r.tail&&r._beforeTailState!=null?r._beforeTailState._value:this.value,i=this.rawInputValue,s=r.tail&&r._beforeTailState!=null?r._beforeTailState._rawInputValue:i,u=i.slice(s.length),l=this.currentMask,o=new ct,c=l?.state;return this.currentMask=this.doDispatch(e,{...r},n),this.currentMask&&(this.currentMask!==l?(this.currentMask.reset(),s&&(this.currentMask.append(s,{raw:!0}),o.tailShift=this.currentMask.value.length-a.length),u&&(o.tailShift+=this.currentMask.append(u,{raw:!0,tail:!0}).tailShift)):c&&(this.currentMask.state=c)),o}_appendPlaceholder(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){const r=new ct;return e&&r.aggregate(this._applyDispatch("",{},e)),r.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var r,n;return{...e,_beforeTailState:((r=e._beforeTailState)==null?void 0:r.currentMaskRef)===this.currentMask&&((n=e._beforeTailState)==null?void 0:n.currentMask)||e._beforeTailState}}doDispatch(e,r,n){return r===void 0&&(r={}),n===void 0&&(n=""),this.dispatch(e,this,r,n)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,r){r===void 0&&(r={});let[n,a]=super.doPrepare(e,r);if(this.currentMask){let i;[n,i]=super.doPrepare(n,this.currentMaskFlags(r)),a=a.aggregate(i)}return[n,a]}doPrepareChar(e,r){r===void 0&&(r={});let[n,a]=super.doPrepareChar(e,r);if(this.currentMask){let i;[n,i]=super.doPrepareChar(n,this.currentMaskFlags(r)),a=a.aggregate(i)}return[n,a]}reset(){var e;(e=this.currentMask)==null||e.reset(),this.compiledMasks.forEach(r=>r.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(e){if(this.exposeMask){this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,this._applyDispatch();return}let r=String(e);this.currentMask&&(this.currentMask.typedValue=e,r=this.currentMask.unmaskedValue),this.unmaskedValue=r}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return!!((e=this.currentMask)!=null&&e.isComplete)}get isFilled(){var e;return!!((e=this.currentMask)!=null&&e.isFilled)}remove(e,r){const n=new ct;return this.currentMask&&n.aggregate(this.currentMask.remove(e,r)).aggregate(this._applyDispatch()),n}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(r=>r.state),currentMaskRef:this.currentMask,currentMask:(e=this.currentMask)==null?void 0:e.state}}set state(e){const{compiledMasks:r,currentMaskRef:n,currentMask:a,...i}=e;r&&this.compiledMasks.forEach((s,u)=>s.state=r[u]),n!=null&&(this.currentMask=n,this.currentMask.state=a),super.state=i}extractInput(e,r,n){return this.currentMask?this.currentMask.extractInput(e,r,n):""}extractTail(e,r){return this.currentMask?this.currentMask.extractTail(e,r):super.extractTail(e,r)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,r){return this.currentMask?this.currentMask.nearestInputPos(e,r):super.nearestInputPos(e,r)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(e){this._autofix=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every((r,n)=>{if(!e[n])return;const{mask:a,...i}=e[n];return Hi(r,i)&&r.maskEquals(a)}):super.maskEquals(e)}typedValueEquals(e){var r;return!!((r=this.currentMask)!=null&&r.typedValueEquals(e))}}Xi.DEFAULTS={...rr.DEFAULTS,dispatch:(t,e,r,n)=>{if(!e.compiledMasks.length)return;const a=e.rawInputValue,i=e.compiledMasks.map((s,u)=>{const l=e.currentMask===s,o=l?s.displayValue.length:s.nearestInputPos(s.displayValue.length,Ue.FORCE_LEFT);return s.rawInputValue!==a?(s.reset(),s.append(a,{raw:!0})):l||s.remove(o),s.append(t,e.currentMaskFlags(r)),s.appendTail(n),{index:u,weight:s.rawInputValue.length,totalInputPositions:s.totalInputPositions(0,Math.max(o,s.nearestInputPos(s.displayValue.length,Ue.FORCE_LEFT)))}});return i.sort((s,u)=>u.weight-s.weight||u.totalInputPositions-s.totalInputPositions),e.compiledMasks[i[0].index]}},He.MaskedDynamic=Xi;class Ji extends nr{constructor(e){super({...Ji.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){const{enum:r,...n}=e;if(r){const a=r.map(u=>u.length),i=Math.min(...a),s=Math.max(...a)-i;n.mask="*".repeat(i),s&&(n.mask+="["+"*".repeat(s)+"]"),this.enum=r}super._update(n)}_appendCharRaw(e,r){r===void 0&&(r={});const n=Math.min(this.nearestInputPos(0,Ue.FORCE_RIGHT),this.value.length),a=this.enum.filter(i=>this.matchValue(i,this.unmaskedValue+e,n));
1if(a.length){a.length===1&&this._forEachBlocksInRange(0,this.value.length,(s,u)=>{const l=a[0][u];u>=this.value.length||l===s.value||(s.reset(),s._appendChar(l,r))});const i=super._appendCharRaw(a[0][this.value.length],r);return a.length===1&&a[0].slice(this.unmaskedValue.length).split("").forEach(s=>i.aggregate(super._appendCharRaw(s))),i}return new ct({skip:!this.isComplete})}extractTail(e,r){return e===void 0&&(e=0),r===void 0&&(r=this.displayValue.length),new Qr("",e)}remove(e,r){if(e===void 0&&(e=0),r===void 0&&(r=this.displayValue.length),e===r)return new ct;const n=Math.min(super.nearestInputPos(0,Ue.FORCE_RIGHT),this.value.length);let a;for(a=e;a>=0&&!(this.enum.filter(u=>this.matchValue(u,this.value.slice(n,a),n)).length>1);--a);const i=super.remove(a,r);return i.tailShift+=a-e,i}get isComplete(){return this.enum.indexOf(this.value)>=0}}Ji.DEFAULTS={...nr.DEFAULTS,matchValue:(t,e,r)=>t.indexOf(e,r)===r},He.MaskedEnum=Ji;class Z0 extends rr{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}He.MaskedFunction=Z0;var uc;class Ar extends rr{constructor(e){super({...Ar.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),r="\\d*",n=(this.scale?"("+Ho(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+r+n),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(Ho).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(Ho(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){const r=e.split(this.radix);return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),r.join(this.radix)}doPrepareChar(e,r){r===void 0&&(r={});const[n,a]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(r.input&&r.raw||!r.input&&!r.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),r);return e&&!n&&(a.skip=!0),n&&!this.allowPositive&&!this.value&&n!=="-"&&a.aggregate(this._appendChar("-")),[n,a]}_separatorsCount(e,r){r===void 0&&(r=!1);let n=0;for(let a=0;a<e;++a)this._value.indexOf(this.thousandsSeparator,a)===a&&(++n,r&&(e+=this.thousandsSeparator.length));return n}_separatorsCountFromSlice(e){return e===void 0&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,r,n){return e===void 0&&(e=0),r===void 0&&(r=this.displayValue.length),[e,r]=this._adjustRangeWithSeparators(e,r),this._removeThousandsSeparators(super.extractInput(e,r,n))}_appendCharRaw(e,r){r===void 0&&(r={});const n=r.tail&&r._beforeTailState?r._beforeTailState._value:this._value,a=this._separatorsCountFromSlice(n);this._value=this._removeThousandsSeparators(this.value);const i=this._value;this._value+=e;const s=this.number;let u=!isNaN(s),l=!1;if(u){let d;this.min!=null&&this.min<0&&this.number<this.min&&(d=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(d=this.max),d!=null&&(this.autofix?(this._value=this.format(d,this).replace(Ar.UNMASKED_RADIX,this.radix),l||(l=i===this._value&&!r.tail)):u=!1),u&&(u=!!this._value.match(this._numberRegExp))}let o;u?o=new ct({inserted:this._value.slice(i.length),rawInserted:l?"":e,skip:l}):(this._value=i,o=new ct),this._value=this._insertThousandsSeparators(this._value);const c=r.tail&&r._beforeTailState?r._beforeTailState._value:this._value,f=this._separatorsCountFromSlice(c);return o.tailShift+=(f-a)*this.thousandsSeparator.length,o}_findSeparatorAround(e){if(this.thousandsSeparator){const r=e-this.thousandsSeparator.length+1,n=this.value.indexOf(this.thousandsSeparator,r);if(n<=e)return n}return-1}_adjustRangeWithSeparators(e,r){const n=this._findSeparatorAround(e);n>=0&&(e=n);const a=this._findSeparatorAround(r);return a>=0&&(r=a+this.thousandsSeparator.length),[e,r]}remove(e,r){e===void 0&&(e=0),r===void 0&&(r=this.displayValue.length),[e,r]=this._adjustRangeWithSeparators(e,r);const n=this.value.slice(0,e),a=this.value.slice(r),i=this._separatorsCount(n.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(n+a));const s=this._separatorsCountFromSlice(n);return new ct({tailShift:(s-i)*this.thousandsSeparator.length})}nearestInputPos(e,r){if(!this.thousandsSeparator)return e;switch(r){case Ue.NONE:case Ue.LEFT:case Ue.FORCE_LEFT:{const n=this._findSeparatorAround(e-1);if(n>=0){const a=n+this.thousandsSeparator.length;if(e<a||this.value.length<=a||r===Ue.FORCE_LEFT)return n}break}case Ue.RIGHT:case Ue.FORCE_RIGHT:{const n=this._findSeparatorAround(e);if(n>=0)return n+this.thousandsSeparator.length}}return e}doCommit(){if(this.value){const e=this.number;let r=e;this.min!=null&&(r=Math.max(r,this.min)),this.max!=null&&(r=Math.min(r,this.max)),r!==e&&(this.unmaskedValue=this.format(r,this));let n=this.value;this.normalizeZeros&&(n=this._normalizeZeros(n)),this.padFractionalZeros&&this.scale>0&&(n=this._padFractionalZeros(n)),this._value=n}super.doCommit()}_normalizeZeros(e){const r=this._removeThousandsSeparators(e).split(this.radix);return r[0]=r[0].replace(/^(\D*)(0*)(\d*)/,(n,a,i,s)=>a+s),e.length&&!/\d$/.test(r[0])&&(r[0]=r[0]+"0"),r.length>1&&(r[1]=r[1].replace(/0*$/,""),r[1].length||(r.length=1)),this._insertThousandsSeparators(r.join(this.radix))}_padFractionalZeros(e){if(!e)return e;const r=e.split(this.radix);return r.length<2&&r.push(""),r[1]=r[1].padEnd(this.scale,"0"),r.join(this.radix)}doSkipInvalid(e,r,n){r===void 0&&(r={});const a=this.scale===0&&e!==this.thousandsSeparator&&(e===this.radix||e===Ar.
1UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,r,n)&&!a}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,Ar.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(e){this.rawInputValue=this.format(e,this).replace(Ar.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(e){return(super.typedValueEquals(e)||Ar.EMPTY_VALUES.includes(e)&&Ar.EMPTY_VALUES.includes(this.typedValue))&&!(e===0&&this.value==="")}}uc=Ar,Ar.UNMASKED_RADIX=".",Ar.EMPTY_VALUES=[...rr.EMPTY_VALUES,0],Ar.DEFAULTS={...rr.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[uc.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:t=>t.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},He.MaskedNumber=Ar;const Go={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function lc(t,e,r){e===void 0&&(e=Go.MASKED),r===void 0&&(r=Go.MASKED);const n=un(t);return a=>n.runIsolated(i=>(i[e]=a,i[r]))}function X0(t,e,r,n){return lc(e,r,n)(t)}He.PIPE_TYPE=Go,He.createPipe=lc,He.pipe=X0;class J0 extends nr{get repeatFrom(){var e;return(e=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?e:0}get repeatTo(){var e;return(e=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?e:1/0}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){var r,n,a;const{repeat:i,...s}=ii(e);this._blockOpts=Object.assign({},this._blockOpts,s);const u=un(this._blockOpts);this.repeat=(r=(n=i??u.repeat)!=null?n:this.repeat)!=null?r:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((a=this._blocks)==null?void 0:a.length)||0,this.repeatFrom)),blocks:{m:u},eager:u.eager,overwrite:u.overwrite,skipInvalid:u.skipInvalid,lazy:u.lazy,placeholderChar:u.placeholderChar,displayChar:u.displayChar})}_allocateBlock(e){if(e<this._blocks.length)return this._blocks[e];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(un(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(e,r){r===void 0&&(r={});const n=new ct;for(let l=(a=(i=this._mapPosToBlock(this.displayValue.length))==null?void 0:i.index)!=null?a:Math.max(this._blocks.length-1,0),o,c;o=(s=this._blocks[l])!=null?s:c=!c&&this._allocateBlock(l);++l){var a,i,s,u;const f=o._appendChar(e,{...r,_beforeTailState:(u=r._beforeTailState)==null||(u=u._blocks)==null?void 0:u[l]});if(f.skip&&c){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(n.aggregate(f),f.consumed)break}return n}_trimEmptyTail(e,r){var n,a;e===void 0&&(e=0);const i=Math.max(((n=this._mapPosToBlock(e))==null?void 0:n.index)||0,this.repeatFrom,0);let s;r!=null&&(s=(a=this._mapPosToBlock(r))==null?void 0:a.index),s==null&&(s=this._blocks.length-1);let u=0;for(let l=s;i<=l&&!this._blocks[l].unmaskedValue;--l,++u);u&&(this._blocks.splice(s-u+1,u),this.mask=this.mask.slice(u))}reset(){super.reset(),this._trimEmptyTail()}remove(e,r){e===void 0&&(e=0),r===void 0&&(r=this.displayValue.length);const n=super.remove(e,r);return this._trimEmptyTail(e,r),n}totalInputPositions(e,r){return e===void 0&&(e=0),r==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(e,r)}get state(){return super.state}set state(e){this._blocks.length=e._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=e}}He.RepeatBlock=J0;try{globalThis.IMask=He}catch{}//! moment.js 2//! version : 2.30.1 3//! authors : Tim Wood, Iskren Chernev, Moment.js contributors 4//! license : MIT 5//! momentjs.com 6var cc;function Be(){return cc.apply(null,arguments)}function Q0(t){cc=t}function Ur(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function Zn(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function yt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function jo(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var e;
vendor: 21,939 bytes, lines 6-9
6for(e in t)if(yt(t,e))return!1;return!0}function yr(t){return t===void 0}function cn(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function si(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function fc(t,e){var r=[],n,a=t.length;for(n=0;n<a;++n)r.push(e(t[n],n));return r}function _n(t,e){for(var r in e)yt(e,r)&&(t[r]=e[r]);return yt(e,"toString")&&(t.toString=e.toString),yt(e,"valueOf")&&(t.valueOf=e.valueOf),t}function Kr(t,e,r,n){return $c(t,e,r,n,!0).utc()}function K0(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function ut(t){return t._pf==null&&(t._pf=K0()),t._pf}var Zo;Array.prototype.some?Zo=Array.prototype.some:Zo=function(t){var e=Object(this),r=e.length>>>0,n;for(n=0;n<r;n++)if(n in e&&t.call(this,e[n],n,e))return!0;return!1};function Xo(t){var e=null,r=!1,n=t._d&&!isNaN(t._d.getTime());if(n&&(e=ut(t),r=Zo.call(e.parsedDateParts,function(a){return a!=null}),n=e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&r),t._strict&&(n=n&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(t))t._isValid=n;else return n;return t._isValid}function Qi(t){var e=Kr(NaN);return t!=null?_n(ut(e),t):ut(e).userInvalidated=!0,e}var dc=Be.momentProperties=[],Jo=!1;function Qo(t,e){var r,n,a,i=dc.length;if(yr(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),yr(e._i)||(t._i=e._i),yr(e._f)||(t._f=e._f),yr(e._l)||(t._l=e._l),yr(e._strict)||(t._strict=e._strict),yr(e._tzm)||(t._tzm=e._tzm),yr(e._isUTC)||(t._isUTC=e._isUTC),yr(e._offset)||(t._offset=e._offset),yr(e._pf)||(t._pf=ut(e)),yr(e._locale)||(t._locale=e._locale),i>0)for(r=0;r<i;r++)n=dc[r],a=e[n],yr(a)||(t[n]=a);return t}function oi(t){Qo(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Jo===!1&&(Jo=!0,Be.updateOffset(this),Jo=!1)}function zr(t){return t instanceof oi||t!=null&&t._isAMomentObject!=null}function mc(t){Be.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+t)}function Tr(t,e){var r=!0;return _n(function(){if(Be.deprecationHandler!=null&&Be.deprecationHandler(null,t),r){var n=[],a,i,s,u=arguments.length;for(i=0;i<u;i++){if(a="",typeof arguments[i]=="object"){a+=` 7[`+i+"] ";for(s in arguments[0])yt(arguments[0],s)&&(a+=s+": "+arguments[0][s]+", ");a=a.slice(0,-2)}else a=arguments[i];n.push(a)}mc(t+` 8Arguments: `+Array.prototype.slice.call(n).join("")+` 9`+new Error().stack),r=!1}return e.apply(this,arguments)},e)}var hc={};function pc(t,e){Be.deprecationHandler!=null&&Be.deprecationHandler(t,e),hc[t]||(mc(e),hc[t]=!0)}Be.suppressDeprecationWarnings=!1,Be.deprecationHandler=null;function en(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function e1(t){var e,r;for(r in t)yt(t,r)&&(e=t[r],en(e)?this[r]=e:this["_"+r]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Ko(t,e){var r=_n({},t),n;for(n in e)yt(e,n)&&(Zn(t[n])&&Zn(e[n])?(r[n]={},_n(r[n],t[n]),_n(r[n],e[n])):e[n]!=null?r[n]=e[n]:delete r[n]);for(n in t)yt(t,n)&&!yt(e,n)&&Zn(t[n])&&(r[n]=_n({},r[n]));return r}function eu(t){t!=null&&this.set(t)}var tu;Object.keys?tu=Object.keys:tu=function(t){var e,r=[];for(e in t)yt(t,e)&&r.push(e);return r};var t1={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function r1(t,e,r){var n=this._calendar[t]||this._calendar.sameElse;return en(n)?n.call(e,r):n}function tn(t,e,r){var n=""+Math.abs(t),a=e-n.length,i=t>=0;return(i?r?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+n}var ru=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Ki=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,nu={},ya={};function Ve(t,e,r,n){var a=n;typeof n=="string"&&(a=function(){return this[n]()}),t&&(ya[t]=a),e&&(ya[e[0]]=function(){return tn(a.apply(this,arguments),e[1],e[2])}),r&&(ya[r]=function(){return this.localeData().ordinal(a.apply(this,arguments),t)})}function n1(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function a1(t){var e=t.match(ru),r,n;for(r=0,n=e.length;r<n;r++)ya[e[r]]?e[r]=ya[e[r]]:e[r]=n1(e[r]);return function(a){var i="",s;for(s=0;s<n;s++)i+=en(e[s])?e[s].call(a,t):e[s];return i}}function es(t,e){return t.isValid()?(e=vc(e,t.localeData()),nu[e]=nu[e]||a1(e),nu[e](t)):t.localeData().invalidDate()}function vc(t,e){var r=5;function n(a){return e.longDateFormat(a)||a}for(Ki.lastIndex=0;r>=0&&Ki.test(t);)t=t.replace(Ki,n),Ki.lastIndex=0,r-=1;return t}var i1={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function s1(t){var e=this._longDateFormat[t],r=this._longDateFormat[t.toUpperCase()];return e||!r?e:(this._longDateFormat[t]=r.match(ru).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[t])}var o1="Invalid date";function u1(){return this._invalidDate}var l1="%d",c1=/\d{1,2}/;function f1(t){return this._ordinal.replace("%d",t)}var d1={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function m1(t,e,r,n){var a=this._relativeTime[r];return en(a)?a(t,e,r,n):a.replace(/%d/i,t)}function h1(t,e){var r=this._relativeTime[t>0?"future":"past"];return en(r)?r(e):r.replace(/%s/i,e)}var gc={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Fr(t){return typeof t=="string"?gc[t]||gc[t.toLowerCase()]:void 0}function au(t){var e={},r,n;for(n in t)yt(t,n)&&(r=Fr(n),r&&(e[r]=t[n]));return e}var p1={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function v1(t){var e=[],r;for(r in t)yt(t,r)&&e.push({unit:r,priority:p1[r]});return e.sort(function(n,a){return n.priority-a.priority}),e}var yc=/\d/,Sr=/\d\d/,bc=/\d{3}/,iu=/\d{4}/,ts=/[+-]?\d{6}/,Ot=/\d\d?/,wc=/\d\d\d\d?/,xc=/\d\d\d\d\d\d?/,rs=/\d{1,3}/,su=/\d{1,4}/,ns=/[+-]?\d{1,6}/,ba=/\d+/,as=/[+-]?\d+/,g1=/Z|[+-]\d\d:?\d\d/gi,is=/Z|[+-]\d\d(?::?\d\d)?/gi,y1=/[+-]?\d+(\.\d{1,3})?/,ui=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,wa=/^[1-9]\d?/,ou=/^([1-9]\d|\d)/,ss;ss={};function Re(t,e,r){ss[t]=en(e)?e:function(n,a){return n&&r?r:e}}function b1(t,e){return yt(ss,t)?ss[t](e._strict,e._locale):new RegExp(w1(t))}function w1(t){return fn(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,r,n,a,i){return r||n||a||i}))}function fn(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Or(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function mt(t){var e=+t,r=0;return e!==0&&isFinite(e)&&(r=Or(e)),r}var uu={};function Nt(t,e){var r,n=e,a;for(typeof t=="string"&&(t=[t]),cn(e)&&(n=function(i,s){s[e]=mt(i)}),a=t.length,r=0;r<a;r++)uu[t[r]]=n}function li(t,e){Nt(t,function(r,n,a,i){a._w=a._w||{},e(r,a._w,a,i)})}function x1(t,e,r){e!=null&&yt(uu,t)&&uu[t](e,r._a,r,t)}function os(t){return t%4===0&&t%100!==0||t%400===0}var ar=0,dn=1,rn=2,Vt=3,Yr=4,mn=5,Xn=6,D1=7,E1=8;Ve("Y",0,0,function(){var t=this.year();return t<=9999?tn(t,4):"+"+t}),Ve(0,["YY",2],0,function(){return this.year()%100}),Ve(0,["YYYY",4],0,"year"),Ve(0,["YYYYY",5],0,"year"),Ve(0,["YYYYYY",6,!0],0,"year"),Re("Y",as),Re("YY",Ot,Sr),Re("YYYY",su,iu),Re("YYYYY",ns,ts),Re("YYYYYY",ns,ts),Nt(["YYYYY","YYYYYY"],ar),Nt("YYYY",function(t,e){e[ar]=t.length===2?Be.parseTwoDigitYear(t):mt(t)}),Nt("YY",function(t,e){e[ar]=Be.parseTwoDigitYear(t)}),Nt("Y",function(t,e){e[ar]=parseInt(t,10)});function ci(t){return os(t)?366:365}Be.parseTwoDigitYear=function(t){return mt(t)+(mt(t)>68?1900:2e3)};var Dc=xa("FullYear",!0);function A1(){return os(this.year())}function xa(t,e){return function(r){return r!=null?(Ec(this,t,r),Be.updateOffset(this,e),this):fi(this,t)}}function fi(t,e){if(!t.isValid())return NaN;var r=t._d,n=t._isUTC;switch(e){case"Milliseconds":return n?r.getUTCMilliseconds():r.getMilliseconds();case"Seconds":return n?r.getUTCSeconds():r.getSeconds();case"Minutes":return n?r.getUTCMinutes():r.getMinutes();case"Hours":return n?r.getUTCHours():r.getHours();case"Date":return n?r.getUTCDate():r.getDate();case"Day":return n?r.getUTCDay():r.getDay();case"Month":return n?r.getUTCMonth():r.getMonth();case"FullYear":return n?r.getUTCFullYear():r.getFullYear();default:return NaN}}function Ec(t,e,r){var n,a,i,s,u;if(!(!t.isValid()||isNaN(r))){switch(n=t._d,a=t._isUTC,e){case"Milliseconds":return void(a?n.setUTCMilliseconds(r):n.setMilliseconds(r));case"Seconds":return void(a?n.setUTCSeconds(r):n.setSeconds(r));case"Minutes":return void(a?n.setUTCMinutes(r):n.setMinutes(r));case"Hours":return void(a?n.setUTCHours(r):n.setHours(r));case"Date":return void(a?n.setUTCDate(r):n.setDate(r));case"FullYear":break;default:return}i=r,s=t.month(),u=t.date(),u=u===29&&s===1&&!os(i)?28:u,a?n.setUTCFullYear(i,s,u):n.setFullYear(i,s,u)}}function S1(t){return t=Fr(t),en(this[t])?this[t]():this}function N1(t,e){if(typeof t=="object"){t=au(t);var r=v1(t),n,a=r.length;for(n=0;n<a;n++)this[r[n].unit](t[r[n].unit])}else if(t=Fr(t),en(this[t]))return this[t](e);return this}function _1(t,e){return(t%e+e)%e}var Ut;Array.prototype.indexOf?Ut=Array.prototype.indexOf:Ut=function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};function lu(t,e){if(isNaN(t)||isNaN(e))return NaN;var r=_1(e,12);return t+=(e-r)/12,r===1?os(t)?29:28:31-r%7%2}Ve("M",["MM",2],"Mo",function(){return this.month()+1}),Ve("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),Ve("MMMM",0,0,function(t){return this.localeData().months(this,t)}),Re("M",Ot,wa),Re("MM",Ot,Sr),Re("MMM",function(t,e){return e.monthsShortRegex(t)}),Re("MMMM",function(t,e){return e.monthsRegex(t)}),Nt(["M","MM"],function(t,e){e[dn]=mt(t)-1}),Nt(["MMM","MMMM"],function(t,e,r,n){var a=r._locale.monthsParse(t,n,r._strict);a!=null?e[dn]=a:ut(r).invalidMonth=t});var C1="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Ac="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Sc=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,M1=ui,T1=ui;function F1(t,e){return t?Ur(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||Sc).test(e)?"format":"standalone"][t.month()]:Ur(this._months)?this._months:this._months.standalone}function O1(t,e){return t?Ur(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[Sc.test(e)?"format":"standalone"][t.month()]:Ur(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function B1(t,e,r){var n,a,i,s=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)i=Kr([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(i,"").toLocaleLowerCase();return r?e==="MMM"?(a=Ut.call(this._shortMonthsParse,s),a!==-1?a:null):(a=Ut.call(this._longMonthsParse,s),a!==-1?a:null):e==="MMM"?(a=Ut.call(this._shortMonthsParse,s),a!==-1?a:(a=Ut.call(this._longMonthsParse,s),a!==-1?a:null)):(a=Ut.call(this._longMonthsParse,s),a!==-1?a:(a=Ut.call(this._shortMonthsParse,s),a!==-1?a:null))}function k1(t,e,r){var n,a,i;if(this._monthsParseExact)return B1.call(this,t,e,r);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(a=Kr([2e3,n]),r&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),!r&&!this._monthsParse[n]&&(i="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[n]=new RegExp(i.replace(".",""),"i")),r&&e==="MMMM"&&this._longMonthsParse[n].test(t))return n;if(r&&e==="MMM"&&this._shortMonthsParse[n].test(t))return n;if(!r&&this._monthsParse[n].test(t))return n}}function Nc(t,e){if(!t.isValid())return t;if(typeof e=="string"){if(/^\d+$/.test(e))e=mt(e);else if(e=t.localeData().monthsParse(e),!cn(e))return t}var r=e,n=t.date();return n=n<29?n:Math.min(n,lu(t.year(),r)),t._isUTC?t._d.setUTCMonth(r,n):t._d.setMonth(r,n),t}function _c(t){return t!=null?(Nc(this,t),Be.updateOffset(this,!0),this):fi(this,"Month")}function I1(){return lu(this.year(),this.month())}function L1(t){return this._monthsParseExact?(yt(this,"_monthsRegex")||Cc.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(yt(this,"_monthsShortRegex")||(this._monthsShortRegex=M1),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function R1(t){return this._monthsParseExact?(yt(this,"_monthsRegex")||Cc.call(this),t?this._monthsStrictRegex:this._monthsRegex):(yt(this,"_monthsRegex")||(this._monthsRegex=T1),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function Cc(){function t(l,o){return o.length-l.length}var e=[],r=[],n=[],a,i,s,u;for(a=0;a<12;a++)i=Kr([2e3,a]),s=fn(this.monthsShort(i,"")),u=fn(this.months(i,"")),e.push(s),r.push(u),n.push(u),n.push(s);e.sort(t),r.sort(t),n.sort(t),this._monthsRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function $1(t,e,r,n,a,i,s){var u;return t<100&&t>=0?(u=new Date(t+400,e,r,n,a,i,s),isFinite(u.getFullYear())&&u.setFullYear(t)):u=new Date(t,e,r,n,a,i,s),u}function di(t){var e,r;return t<100&&t>=0?(r=Array.prototype.slice.call(arguments),r[0]=t+400,e=new Date(Date.UTC.apply(null,r)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function us(t,e,r){var n=7+e-r,a=(7+di(t,0,n).getUTCDay()-e)%7;return-a+n-1}function Mc(t,e,r,n,a){var i=(7+r-n)%7,s=us(t,n,a),u=1+7*(e-1)+i+s,l,o;return u<=0?(l=t-1,o=ci(l)+u):u>ci(t)?(l=t+1,o=u-ci(t)):(l=t,o=u),{year:l,dayOfYear:o}}function mi(t,e,r){var n=us(t.year(),e,r),a=Math.floor((t.dayOfYear()-n-1)/7)+1,i,s;return a<1?(s=t.year()-1,i=a+hn(s,e,r)):a>hn(t.year(),e,r)?(i=a-hn(t.year(),e,r),s=t.year()+1):(s=t.year(),i=a),{week:i,year:s}}function hn(t,e,r){var n=us(t,e,r),a=us(t+1,e,r);return(ci(t)-n+a)/7}Ve("w",["ww",2],"wo","week"),Ve("W",["WW",2],"Wo","isoWeek"),Re("w",Ot,wa),Re("ww",Ot,Sr),Re("W",Ot,wa),Re("WW",Ot,Sr),li(["w","ww","W","WW"],function(t,e,r,n){e[n.substr(0,1)]=mt(t)});function P1(t){return mi(t,this._week.dow,this._week.doy).week}var q1={dow:0,doy:6};function U1(){return this._week.dow}function z1(){return this._week.doy}function Y1(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function V1(t){var e=mi(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}Ve("d",0,"do","day"),Ve("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),Ve("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),Ve("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),Ve("e",0,0,"weekday"),Ve("E",0,0,"isoWeekday"),Re("d",Ot),Re("e",Ot),Re("E",Ot),Re("dd",function(t,e){return e.weekdaysMinRegex(t)}),Re("ddd",function(t,e){return e.weekdaysShortRegex(t)}),Re("dddd",function(t,e){return e.weekdaysRegex(t)}),li(["dd","ddd","dddd"],function(t,e,r,n){var a=r._locale.weekdaysParse(t,n,r._strict);a!=null?e.d=a:ut(r).invalidWeekday=t}),li(["d","e","E"],function(t,e,r,n){e[n]=mt(t)});function H1(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function W1(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function cu(t,e){return t.slice(e,7).concat(t.slice(0,e))}var G1="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Tc="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),j1="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Z1=ui,X1=ui,J1=ui;function Q1(t,e){var r=Ur(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?cu(r,this._week.dow):t?r[t.day()]:r}function K1(t){return t===!0?cu(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function ey(t){return t===!0?cu(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function ty(t,e,r){var n,a,i,s=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)i=Kr([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(i,"").toLocaleLowerCase();return r?e==="dddd"?(a=Ut.call(this._weekdaysParse,s),a!==-1?a:null):e==="ddd"?(a=Ut.call(this._shortWeekdaysParse,s),a!==-1?a:null):(a=Ut.call(this._minWeekdaysParse,s),a!==-1?a:null):e==="dddd"?(a=Ut.call(this._weekdaysParse,s),a!==-1||(a=Ut.call(this._shortWeekdaysParse,s),a!==-1)?a:(a=Ut.call(this._minWeekdaysParse,s),a!==-1?a:null)):e==="ddd"?(a=Ut.call(this._shortWeekdaysParse,s),a!==-1||(a=Ut.call(this._weekdaysParse,s),a!==-1)?a:(a=Ut.call(this._minWeekdaysParse,s),a!==-1?a:null)):(a=Ut.call(this._minWeekdaysParse,s),a!==-1||(a=Ut.call(this._weekdaysParse,s),a!==-1)?a:(a=Ut.call(this._shortWeekdaysParse,s),a!==-1?a:null))}function ry(t,e,r){var n,a,i;if(this._weekdaysParseExact)return ty.call(this,t,e,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(a=Kr([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(i="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[n]=new RegExp(i.replace(".",""),"i")),r&&e==="dddd"&&this._fullWeekdaysParse[n].test(t))return n;if(r&&e==="ddd"&&this._shortWeekdaysParse[n].test(t))return n;if(r&&e==="dd"&&this._minWeekdaysParse[n].test(t))return n;if(!r&&this._weekdaysParse[n].test(t))return n}}function ny(t){if(!this.isValid())return t!=null?this:NaN;var e=fi(this,"Day");return t!=null?(t=H1(t,this.localeData()),this.add(t-e,"d")):e}function ay(t){if(!this.isValid())return t!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return t==null?e:this.add(t-e,"d")}function iy(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=W1(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function sy(t){return this._weekdaysParseExact?(yt(this,"_weekdaysRegex")||fu.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(yt(this,"_weekdaysRegex")||(this._weekdaysRegex=Z1),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function oy(t){return this._weekdaysParseExact?(yt(this,"_weekdaysRegex")||fu.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(yt(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=X1),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function uy(t){return this._weekdaysParseExact?(yt(this,"_weekdaysRegex")||fu.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(yt(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=J1),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function fu(){function t(c,f){return f.length-c.length}var e=[],r=[],n=[],a=[],i,s,u,l,o;for(i=0;i<7;i++)s=Kr([2e3,1]).day(i),u=fn(this.weekdaysMin(s,"")),l=fn(this.weekdaysShort(s,"")),o=fn(this.weekdays(s,"")),e.push(u),r.push(l),n.push(o),a.push(u),a.push(l),a.push(o);e.sort(t),r.sort(t),n.sort(t),a.sort(t),this._weekdaysRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function du(){return this.hours()%12||12}function ly(){return this.hours()||24}Ve("H",["HH",2],0,"hour"),Ve("h",["hh",2],0,du),Ve("k",["kk",2],0,ly),Ve("hmm",0,0,function(){return""+du.apply(this)+tn(this.minutes(),2)}
vendor: 14,536 bytes, line 9
9),Ve("hmmss",0,0,function(){return""+du.apply(this)+tn(this.minutes(),2)+tn(this.seconds(),2)}),Ve("Hmm",0,0,function(){return""+this.hours()+tn(this.minutes(),2)}),Ve("Hmmss",0,0,function(){return""+this.hours()+tn(this.minutes(),2)+tn(this.seconds(),2)});function Fc(t,e){Ve(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}Fc("a",!0),Fc("A",!1);function Oc(t,e){return e._meridiemParse}Re("a",Oc),Re("A",Oc),Re("H",Ot,ou),Re("h",Ot,wa),Re("k",Ot,wa),Re("HH",Ot,Sr),Re("hh",Ot,Sr),Re("kk",Ot,Sr),Re("hmm",wc),Re("hmmss",xc),Re("Hmm",wc),Re("Hmmss",xc),Nt(["H","HH"],Vt),Nt(["k","kk"],function(t,e,r){var n=mt(t);e[Vt]=n===24?0:n}),Nt(["a","A"],function(t,e,r){r._isPm=r._locale.isPM(t),r._meridiem=t}),Nt(["h","hh"],function(t,e,r){e[Vt]=mt(t),ut(r).bigHour=!0}),Nt("hmm",function(t,e,r){var n=t.length-2;e[Vt]=mt(t.substr(0,n)),e[Yr]=mt(t.substr(n)),ut(r).bigHour=!0}),Nt("hmmss",function(t,e,r){var n=t.length-4,a=t.length-2;e[Vt]=mt(t.substr(0,n)),e[Yr]=mt(t.substr(n,2)),e[mn]=mt(t.substr(a)),ut(r).bigHour=!0}),Nt("Hmm",function(t,e,r){var n=t.length-2;e[Vt]=mt(t.substr(0,n)),e[Yr]=mt(t.substr(n))}),Nt("Hmmss",function(t,e,r){var n=t.length-4,a=t.length-2;e[Vt]=mt(t.substr(0,n)),e[Yr]=mt(t.substr(n,2)),e[mn]=mt(t.substr(a))});function cy(t){return(t+"").toLowerCase().charAt(0)==="p"}var fy=/[ap]\.?m?\.?/i,dy=xa("Hours",!0);function my(t,e,r){return t>11?r?"pm":"PM":r?"am":"AM"}var Bc={calendar:t1,longDateFormat:i1,invalidDate:o1,ordinal:l1,dayOfMonthOrdinalParse:c1,relativeTime:d1,months:C1,monthsShort:Ac,week:q1,weekdays:G1,weekdaysMin:j1,weekdaysShort:Tc,meridiemParse:fy},It={},hi={},pi;function hy(t,e){var r,n=Math.min(t.length,e.length);for(r=0;r<n;r+=1)if(t[r]!==e[r])return r;return n}function kc(t){return t&&t.toLowerCase().replace("_","-")}function py(t){for(var e=0,r,n,a,i;e<t.length;){for(i=kc(t[e]).split("-"),r=i.length,n=kc(t[e+1]),n=n?n.split("-"):null;r>0;){if(a=ls(i.slice(0,r).join("-")),a)return a;if(n&&n.length>=r&&hy(i,n)>=r-1)break;r--}e++}return pi}function vy(t){return!!(t&&t.match("^[^/\\\\]*$"))}function ls(t){var e=null,r;if(It[t]===void 0&&typeof module<"u"&&module&&module.exports&&vy(t))try{e=pi._abbr,r=require,r("./locale/"+t),Cn(e)}catch{It[t]=null}return It[t]}function Cn(t,e){var r;return t&&(yr(e)?r=pn(t):r=mu(t,e),r?pi=r:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),pi._abbr}function mu(t,e){if(e!==null){var r,n=Bc;if(e.abbr=t,It[t]!=null)pc("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=It[t]._config;else if(e.parentLocale!=null)if(It[e.parentLocale]!=null)n=It[e.parentLocale]._config;else if(r=ls(e.parentLocale),r!=null)n=r._config;else return hi[e.parentLocale]||(hi[e.parentLocale]=[]),hi[e.parentLocale].push({name:t,config:e}),null;return It[t]=new eu(Ko(n,e)),hi[t]&&hi[t].forEach(function(a){mu(a.name,a.config)}),Cn(t),It[t]}else return delete It[t],null}function gy(t,e){if(e!=null){var r,n,a=Bc;It[t]!=null&&It[t].parentLocale!=null?It[t].set(Ko(It[t]._config,e)):(n=ls(t),n!=null&&(a=n._config),e=Ko(a,e),n==null&&(e.abbr=t),r=new eu(e),r.parentLocale=It[t],It[t]=r),Cn(t)}else It[t]!=null&&(It[t].parentLocale!=null?(It[t]=It[t].parentLocale,t===Cn()&&Cn(t)):It[t]!=null&&delete It[t]);return It[t]}function pn(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return pi;if(!Ur(t)){if(e=ls(t),e)return e;t=[t]}return py(t)}function yy(){return tu(It)}function hu(t){var e,r=t._a;return r&&ut(t).overflow===-2&&(e=r[dn]<0||r[dn]>11?dn:r[rn]<1||r[rn]>lu(r[ar],r[dn])?rn:r[Vt]<0||r[Vt]>24||r[Vt]===24&&(r[Yr]!==0||r[mn]!==0||r[Xn]!==0)?Vt:r[Yr]<0||r[Yr]>59?Yr:r[mn]<0||r[mn]>59?mn:r[Xn]<0||r[Xn]>999?Xn:-1,ut(t)._overflowDayOfYear&&(e<ar||e>rn)&&(e=rn),ut(t)._overflowWeeks&&e===-1&&(e=D1),ut(t)._overflowWeekday&&e===-1&&(e=E1),ut(t).overflow=e),t}var by=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,wy=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,xy=/Z|[+-]\d\d(?::?\d\d)?/,cs=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],pu=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Dy=/^\/?Date\((-?\d+)/i,Ey=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Ay={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Ic(t){var e,r,n=t._i,a=by.exec(n)||wy.exec(n),i,s,u,l,o=cs.length,c=pu.length;if(a){for(ut(t).iso=!0,e=0,r=o;e<r;e++)if(cs[e][1].exec(a[1])){s=cs[e][0],i=cs[e][2]!==!1;break}if(s==null){t._isValid=!1;return}if(a[3]){for(e=0,r=c;e<r;e++)if(pu[e][1].exec(a[3])){u=(a[2]||" ")+pu[e][0];break}if(u==null){t._isValid=!1;return}}if(!i&&u!=null){t._isValid=!1;return}if(a[4])if(xy.exec(a[4]))l="Z";else{t._isValid=!1;return}t._f=s+(u||"")+(l||""),gu(t)}else t._isValid=!1}function Sy(t,e,r,n,a,i){var s=[Ny(t),Ac.indexOf(e),parseInt(r,10),parseInt(n,10),parseInt(a,10)];return i&&s.push(parseInt(i,10)),s}function Ny(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function _y(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Cy(t,e,r){if(t){var n=Tc.indexOf(t),a=new Date(e[0],e[1],e[2]).getDay();if(n!==a)return ut(r).weekdayMismatch=!0,r._isValid=!1,!1}return!0}function My(t,e,r){if(t)return Ay[t];if(e)return 0;var n=parseInt(r,10),a=n%100,i=(n-a)/100;return i*60+a}function Lc(t){var e=Ey.exec(_y(t._i)),r;if(e){if(r=Sy(e[4],e[3],e[2],e[5],e[6],e[7]),!Cy(e[1],r,t))return;t._a=r,t._tzm=My(e[8],e[9],e[10]),t._d=di.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),ut(t).rfc2822=!0}else t._isValid=!1}function Ty(t){var e=Dy.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(Ic(t),t._isValid===!1)delete t._isValid;else return;if(Lc(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:Be.createFromInputFallback(t)}Be.createFromInputFallback=Tr("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))});function Da(t,e,r){return t??e??r}function Fy(t){var e=new Date(Be.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function vu(t){var e,r,n=[],a,i,s;if(!t._d){for(a=Fy(t),t._w&&t._a[rn]==null&&t._a[dn]==null&&Oy(t),t._dayOfYear!=null&&(s=Da(t._a[ar],a[ar]),(t._dayOfYear>ci(s)||t._dayOfYear===0)&&(ut(t)._overflowDayOfYear=!0),r=di(s,0,t._dayOfYear),t._a[dn]=r.getUTCMonth(),t._a[rn]=r.getUTCDate()),e=0;e<3&&t._a[e]==null;++e)t._a[e]=n[e]=a[e];for(;e<7;e++)t._a[e]=n[e]=t._a[e]==null?e===2?1:0:t._a[e];t._a[Vt]===24&&t._a[Yr]===0&&t._a[mn]===0&&t._a[Xn]===0&&(t._nextDay=!0,t._a[Vt]=0),t._d=(t._useUTC?di:$1).apply(null,n),i=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Vt]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==i&&(ut(t).weekdayMismatch=!0)}}function Oy(t){var e,r,n,a,i,s,u,l,o;e=t._w,e.GG!=null||e.W!=null||e.E!=null?(i=1,s=4,r=Da(e.GG,t._a[ar],mi(Bt(),1,4).year),n=Da(e.W,1),a=Da(e.E,1),(a<1||a>7)&&(l=!0)):(i=t._locale._week.dow,s=t._locale._week.doy,o=mi(Bt(),i,s),r=Da(e.gg,t._a[ar],o.year),n=Da(e.w,o.week),e.d!=null?(a=e.d,(a<0||a>6)&&(l=!0)):e.e!=null?(a=e.e+i,(e.e<0||e.e>6)&&(l=!0)):a=i),n<1||n>hn(r,i,s)?ut(t)._overflowWeeks=!0:l!=null?ut(t)._overflowWeekday=!0:(u=Mc(r,n,a,i,s),t._a[ar]=u.year,t._dayOfYear=u.dayOfYear)}Be.ISO_8601=function(){},Be.RFC_2822=function(){};function gu(t){if(t._f===Be.ISO_8601){Ic(t);return}if(t._f===Be.RFC_2822){Lc(t);return}t._a=[],ut(t).empty=!0;var e=""+t._i,r,n,a,i,s,u=e.length,l=0,o,c;for(a=vc(t._f,t._locale).match(ru)||[],c=a.length,r=0;r<c;r++)i=a[r],n=(e.match(b1(i,t))||[])[0],n&&(s=e.substr(0,e.indexOf(n)),s.length>0&&ut(t).unusedInput.push(s),e=e.slice(e.indexOf(n)+n.length),l+=n.length),ya[i]?(n?ut(t).empty=!1:ut(t).unusedTokens.push(i),x1(i,n,t)):t._strict&&!n&&ut(t).unusedTokens.push(i);ut(t).charsLeftOver=u-l,e.length>0&&ut(t).unusedInput.push(e),t._a[Vt]<=12&&ut(t).bigHour===!0&&t._a[Vt]>0&&(ut(t).bigHour=void 0),ut(t).parsedDateParts=t._a.slice(0),ut(t).meridiem=t._meridiem,t._a[Vt]=By(t._locale,t._a[Vt],t._meridiem),o=ut(t).era,o!==null&&(t._a[ar]=t._locale.erasConvertYear(o,t._a[ar])),vu(t),hu(t)}function By(t,e,r){var n;return r==null?e:t.meridiemHour!=null?t.meridiemHour(e,r):(t.isPM!=null&&(n=t.isPM(r),n&&e<12&&(e+=12),!n&&e===12&&(e=0)),e)}function ky(t){var e,r,n,a,i,s,u=!1,l=t._f.length;if(l===0){ut(t).invalidFormat=!0,t._d=new Date(NaN);return}for(a=0;a<l;a++)i=0,s=!1,e=Qo({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[a],gu(e),Xo(e)&&(s=!0),i+=ut(e).charsLeftOver,i+=ut(e).unusedTokens.length*10,ut(e).score=i,u?i<n&&(n=i,r=e):(n==null||i<n||s)&&(n=i,r=e,s&&(u=!0));_n(t,r||e)}function Iy(t){if(!t._d){var e=au(t._i),r=e.day===void 0?e.date:e.day;t._a=fc([e.year,e.month,r,e.hour,e.minute,e.second,e.millisecond],function(n){return n&&parseInt(n,10)}),vu(t)}}function Ly(t){var e=new oi(hu(Rc(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Rc(t){var e=t._i,r=t._f;return t._locale=t._locale||pn(t._l),e===null||r===void 0&&e===""?Qi({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),zr(e)?new oi(hu(e)):(si(e)?t._d=e:Ur(r)?ky(t):r?gu(t):Ry(t),Xo(t)||(t._d=null),t))}function Ry(t){var e=t._i;yr(e)?t._d=new Date(Be.now()):si(e)?t._d=new Date(e.valueOf()):typeof e=="string"?Ty(t):Ur(e)?(t._a=fc(e.slice(0),function(r){return parseInt(r,10)}),vu(t)):Zn(e)?Iy(t):cn(e)?t._d=new Date(e):Be.createFromInputFallback(t)}function $c(t,e,r,n,a){var i={};return(e===!0||e===!1)&&(n=e,e=void 0),(r===!0||r===!1)&&(n=r,r=void 0),(Zn(t)&&jo(t)||Ur(t)&&t.length===0)&&(t=void 0),i._isAMomentObject=!0,i._useUTC=i._isUTC=a,i._l=r,i._i=t,i._f=e,i._strict=n,Ly(i)}function Bt(t,e,r,n){return $c(t,e,r,n,!1)}var $y=Tr("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Bt.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:Qi()}),Py=Tr("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Bt.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:Qi()});function Pc(t,e){var r,n;if(e.length===1&&Ur(e[0])&&(e=e[0]),!e.length)return Bt();for(r=e[0],n=1;n<e.length;++n)(!e[n].isValid()||e[n][t](r))&&(r=e[n]);return r}function qy(){var t=[].slice.call(arguments,0);return Pc("isBefore",t)}function Uy(){var t=[].slice.call(arguments,0);return Pc("isAfter",t)}var zy=function(){return Date.now?Date.now():+new Date},vi=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Yy(t){var e,r=!1,n,a=vi.length;for(e in t)if(yt(t,e)&&!(Ut.call(vi,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(n=0;n<a;++n)if(t[vi[n]]){if(r)return!1;parseFloat(t[vi[n]])!==mt(t[vi[n]])&&(r=!0)}return!0}function Vy(){return this._isValid}function Hy(){return Vr(NaN)}function fs(t){var e=au(t),r=e.year||0,n=e.quarter||0,a=e.month||0,i=e.week||e.isoWeek||0,s=e.day||0,u=e.hour||0,l=e.minute||0,o=e.second||0,c=e.millisecond||0;this._isValid=Yy(e),this._milliseconds=+c+o*1e3+l*6e4+u*1e3*60*60,this._days=+s+i*7,this._months=+a+n*3+r*12,this._data={},this._locale=pn(),this._bubble()}function ds(t){return t instanceof fs}function yu(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function Wy(t,e,r){var n=Math.min(t.length,e.length),a=Math.abs(t.length-e.length),i=0,s;for(s=0;s<n;s++)mt(t[s])!==mt(e[s])&&i++;return i+a}function qc(t,e){Ve(t,0,0,function(){var r=this.utcOffset(),n="+";return r<0&&(r=-r,n="-"),n+tn(~~(r/60),2)+e+tn(~~r%60,2)})}qc("Z",":"),qc("ZZ",""),Re("Z",is),Re("ZZ",is),Nt(["Z","ZZ"],function(t,e,r){r._useUTC=!0,r._tzm=bu(is,t)});var Gy=/([\+\-]|\d\d)/gi;function bu(t,e){var r=(e||"").match(t),n,a,i;return r===null?null:(n=r[r.length-1]||[],a=(n+"").match(Gy)||["-",0,0],i=+(a[1]*60)+mt(a[2]),i===0?0:a[0]==="+"?i:-i)}function wu(t,e){var r,n;return e._isUTC?(r=e.clone(),n=(zr(t)||si(t)?t.valueOf():Bt(t).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+n),Be.updateOffset(r,!1),r):Bt(t).local()}function xu(t){return-Math.round(t._d.getTimezoneOffset())}Be.updateOffset=function(){};function jy(t,e,r){var n=this._offset||0,a;if(!this.isValid())return t!=null?this:NaN;if(t!=null){if(typeof t=="string"){if(t=bu(is,t),t===null)return this}else Math.abs(t)<16&&!r&&(t=t*60);return!this._isUTC&&e&&(a=xu(this)),this._offset=t,this._isUTC=!0,a!=null&&this.add(a,"m"),n!==t&&(!e||this._changeInProgress?Vc(this,Vr(t-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,Be.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?n:xu(this)}function Zy(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Xy(t){return this.utcOffset(0,t)}function Jy(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(xu(this),"m")),this}function Qy(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=bu(g1,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function Ky(t){return this.isValid()?(t=t?Bt(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function eb(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}
vendor: 21,998 bytes, line 9
9function tb(){if(!yr(this._isDSTShifted))return this._isDSTShifted;var t={},e;return Qo(t,this),t=Rc(t),t._a?(e=t._isUTC?Kr(t._a):Bt(t._a),this._isDSTShifted=this.isValid()&&Wy(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function rb(){return this.isValid()?!this._isUTC:!1}function nb(){return this.isValid()?this._isUTC:!1}function Uc(){return this.isValid()?this._isUTC&&this._offset===0:!1}var ab=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,ib=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Vr(t,e){var r=t,n=null,a,i,s;return ds(t)?r={ms:t._milliseconds,d:t._days,M:t._months}:cn(t)||!isNaN(+t)?(r={},e?r[e]=+t:r.milliseconds=+t):(n=ab.exec(t))?(a=n[1]==="-"?-1:1,r={y:0,d:mt(n[rn])*a,h:mt(n[Vt])*a,m:mt(n[Yr])*a,s:mt(n[mn])*a,ms:mt(yu(n[Xn]*1e3))*a}):(n=ib.exec(t))?(a=n[1]==="-"?-1:1,r={y:Jn(n[2],a),M:Jn(n[3],a),w:Jn(n[4],a),d:Jn(n[5],a),h:Jn(n[6],a),m:Jn(n[7],a),s:Jn(n[8],a)}):r==null?r={}:typeof r=="object"&&("from"in r||"to"in r)&&(s=sb(Bt(r.from),Bt(r.to)),r={},r.ms=s.milliseconds,r.M=s.months),i=new fs(r),ds(t)&&yt(t,"_locale")&&(i._locale=t._locale),ds(t)&&yt(t,"_isValid")&&(i._isValid=t._isValid),i}Vr.fn=fs.prototype,Vr.invalid=Hy;function Jn(t,e){var r=t&&parseFloat(t.replace(",","."));return(isNaN(r)?0:r)*e}function zc(t,e){var r={};return r.months=e.month()-t.month()+(e.year()-t.year())*12,t.clone().add(r.months,"M").isAfter(e)&&--r.months,r.milliseconds=+e-+t.clone().add(r.months,"M"),r}function sb(t,e){var r;return t.isValid()&&e.isValid()?(e=wu(e,t),t.isBefore(e)?r=zc(t,e):(r=zc(e,t),r.milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function Yc(t,e){return function(r,n){var a,i;return n!==null&&!isNaN(+n)&&(pc(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=r,r=n,n=i),a=Vr(r,n),Vc(this,a,t),this}}function Vc(t,e,r,n){var a=e._milliseconds,i=yu(e._days),s=yu(e._months);t.isValid()&&(n=n??!0,s&&Nc(t,fi(t,"Month")+s*r),i&&Ec(t,"Date",fi(t,"Date")+i*r),a&&t._d.setTime(t._d.valueOf()+a*r),n&&Be.updateOffset(t,i||s))}var ob=Yc(1,"add"),ub=Yc(-1,"subtract");function Hc(t){return typeof t=="string"||t instanceof String}function lb(t){return zr(t)||si(t)||Hc(t)||cn(t)||fb(t)||cb(t)||t===null||t===void 0}function cb(t){var e=Zn(t)&&!jo(t),r=!1,n=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],a,i,s=n.length;for(a=0;a<s;a+=1)i=n[a],r=r||yt(t,i);return e&&r}function fb(t){var e=Ur(t),r=!1;return e&&(r=t.filter(function(n){return!cn(n)&&Hc(t)}).length===0),e&&r}function db(t){var e=Zn(t)&&!jo(t),r=!1,n=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],a,i;for(a=0;a<n.length;a+=1)i=n[a],r=r||yt(t,i);return e&&r}function mb(t,e){var r=t.diff(e,"days",!0);return r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse"}function hb(t,e){arguments.length===1&&(arguments[0]?lb(arguments[0])?(t=arguments[0],e=void 0):db(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var r=t||Bt(),n=wu(r,this).startOf("day"),a=Be.calendarFormat(this,n)||"sameElse",i=e&&(en(e[a])?e[a].call(this,r):e[a]);return this.format(i||this.localeData().calendar(a,this,Bt(r)))}function pb(){return new oi(this)}function vb(t,e){var r=zr(t)?t:Bt(t);return this.isValid()&&r.isValid()?(e=Fr(e)||"millisecond",e==="millisecond"?this.valueOf()>r.valueOf():r.valueOf()<this.clone().startOf(e).valueOf()):!1}function gb(t,e){var r=zr(t)?t:Bt(t);return this.isValid()&&r.isValid()?(e=Fr(e)||"millisecond",e==="millisecond"?this.valueOf()<r.valueOf():this.clone().endOf(e).valueOf()<r.valueOf()):!1}function yb(t,e,r,n){var a=zr(t)?t:Bt(t),i=zr(e)?e:Bt(e);return this.isValid()&&a.isValid()&&i.isValid()?(n=n||"()",(n[0]==="("?this.isAfter(a,r):!this.isBefore(a,r))&&(n[1]===")"?this.isBefore(i,r):!this.isAfter(i,r))):!1}function bb(t,e){var r=zr(t)?t:Bt(t),n;return this.isValid()&&r.isValid()?(e=Fr(e)||"millisecond",e==="millisecond"?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(e).valueOf()<=n&&n<=this.clone().endOf(e).valueOf())):!1}function wb(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function xb(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function Db(t,e,r){var n,a,i;if(!this.isValid())return NaN;if(n=wu(t,this),!n.isValid())return NaN;switch(a=(n.utcOffset()-this.utcOffset())*6e4,e=Fr(e),e){case"year":i=ms(this,n)/12;break;case"month":i=ms(this,n);break;case"quarter":i=ms(this,n)/3;break;case"second":i=(this-n)/1e3;break;case"minute":i=(this-n)/6e4;break;case"hour":i=(this-n)/36e5;break;case"day":i=(this-n-a)/864e5;break;case"week":i=(this-n-a)/6048e5;break;default:i=this-n}return r?i:Or(i)}function ms(t,e){if(t.date()<e.date())return-ms(e,t);var r=(e.year()-t.year())*12+(e.month()-t.month()),n=t.clone().add(r,"months"),a,i;return e-n<0?(a=t.clone().add(r-1,"months"),i=(e-n)/(n-a)):(a=t.clone().add(r+1,"months"),i=(e-n)/(a-n)),-(r+i)||0}Be.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",Be.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Eb(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Ab(t){if(!this.isValid())return null;var e=t!==!0,r=e?this.clone().utc():this;return r.year()<0||r.year()>9999?es(r,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):en(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",es(r,"Z")):es(r,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Sb(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="",r,n,a,i;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),r="["+t+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a="-MM-DD[T]HH:mm:ss.SSS",i=e+'[")]',this.format(r+n+a+i)}function Nb(t){t||(t=this.isUtc()?Be.defaultFormatUtc:Be.defaultFormat);var e=es(this,t);return this.localeData().postformat(e)}function _b(t,e){return this.isValid()&&(zr(t)&&t.isValid()||Bt(t).isValid())?Vr({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Cb(t){return this.from(Bt(),t)}function Mb(t,e){return this.isValid()&&(zr(t)&&t.isValid()||Bt(t).isValid())?Vr({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Tb(t){return this.to(Bt(),t)}function Wc(t){var e;return t===void 0?this._locale._abbr:(e=pn(t),e!=null&&(this._locale=e),this)}var Gc=Tr("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function jc(){return this._locale}var hs=1e3,Ea=60*hs,ps=60*Ea,Zc=(365*400+97)*24*ps;function Aa(t,e){return(t%e+e)%e}function Xc(t,e,r){return t<100&&t>=0?new Date(t+400,e,r)-Zc:new Date(t,e,r).valueOf()}function Jc(t,e,r){return t<100&&t>=0?Date.UTC(t+400,e,r)-Zc:Date.UTC(t,e,r)}function Fb(t){var e,r;if(t=Fr(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?Jc:Xc,t){case"year":e=r(this.year(),0,1);break;case"quarter":e=r(this.year(),this.month()-this.month()%3,1);break;case"month":e=r(this.year(),this.month(),1);break;case"week":e=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=r(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=Aa(e+(this._isUTC?0:this.utcOffset()*Ea),ps);break;case"minute":e=this._d.valueOf(),e-=Aa(e,Ea);break;case"second":e=this._d.valueOf(),e-=Aa(e,hs);break}return this._d.setTime(e),Be.updateOffset(this,!0),this}function Ob(t){var e,r;if(t=Fr(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?Jc:Xc,t){case"year":e=r(this.year()+1,0,1)-1;break;case"quarter":e=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=r(this.year(),this.month()+1,1)-1;break;case"week":e=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=ps-Aa(e+(this._isUTC?0:this.utcOffset()*Ea),ps)-1;break;case"minute":e=this._d.valueOf(),e+=Ea-Aa(e,Ea)-1;break;case"second":e=this._d.valueOf(),e+=hs-Aa(e,hs)-1;break}return this._d.setTime(e),Be.updateOffset(this,!0),this}function Bb(){return this._d.valueOf()-(this._offset||0)*6e4}function kb(){return Math.floor(this.valueOf()/1e3)}function Ib(){return new Date(this.valueOf())}function Lb(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function Rb(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function $b(){return this.isValid()?this.toISOString():null}function Pb(){return Xo(this)}function qb(){return _n({},ut(this))}function Ub(){return ut(this).overflow}function zb(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Ve("N",0,0,"eraAbbr"),Ve("NN",0,0,"eraAbbr"),Ve("NNN",0,0,"eraAbbr"),Ve("NNNN",0,0,"eraName"),Ve("NNNNN",0,0,"eraNarrow"),Ve("y",["y",1],"yo","eraYear"),Ve("y",["yy",2],0,"eraYear"),Ve("y",["yyy",3],0,"eraYear"),Ve("y",["yyyy",4],0,"eraYear"),Re("N",Du),Re("NN",Du),Re("NNN",Du),Re("NNNN",Kb),Re("NNNNN",ew),Nt(["N","NN","NNN","NNNN","NNNNN"],function(t,e,r,n){var a=r._locale.erasParse(t,n,r._strict);a?ut(r).era=a:ut(r).invalidEra=t}),Re("y",ba),Re("yy",ba),Re("yyy",ba),Re("yyyy",ba),Re("yo",tw),Nt(["y","yy","yyy","yyyy"],ar),Nt(["yo"],function(t,e,r,n){var a;r._locale._eraYearOrdinalRegex&&(a=t.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?e[ar]=r._locale.eraYearOrdinalParse(t,a):e[ar]=parseInt(t,10)});function Yb(t,e){var r,n,a,i=this._eras||pn("en")._eras;for(r=0,n=i.length;r<n;++r){switch(typeof i[r].since){case"string":a=Be(i[r].since).startOf("day"),i[r].since=a.valueOf();break}switch(typeof i[r].until){case"undefined":i[r].until=1/0;break;case"string":a=Be(i[r].until).startOf("day").valueOf(),i[r].until=a.valueOf();break}}return i}function Vb(t,e,r){var n,a,i=this.eras(),s,u,l;for(t=t.toUpperCase(),n=0,a=i.length;n<a;++n)if(s=i[n].name.toUpperCase(),u=i[n].abbr.toUpperCase(),l=i[n].narrow.toUpperCase(),r)switch(e){case"N":case"NN":case"NNN":if(u===t)return i[n];break;case"NNNN":if(s===t)return i[n];break;case"NNNNN":if(l===t)return i[n];break}else if([s,u,l].indexOf(t)>=0)return i[n]}function Hb(t,e){var r=t.since<=t.until?1:-1;return e===void 0?Be(t.since).year():Be(t.since).year()+(e-t.offset)*r}function Wb(){var t,e,r,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t)if(r=this.clone().startOf("day").valueOf(),n[t].since<=r&&r<=n[t].until||n[t].until<=r&&r<=n[t].since)return n[t].name;return""}function Gb(){var t,e,r,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t)if(r=this.clone().startOf("day").valueOf(),n[t].since<=r&&r<=n[t].until||n[t].until<=r&&r<=n[t].since)return n[t].narrow;return""}function jb(){var t,e,r,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t)if(r=this.clone().startOf("day").valueOf(),n[t].since<=r&&r<=n[t].until||n[t].until<=r&&r<=n[t].since)return n[t].abbr;return""}function Zb(){var t,e,r,n,a=this.localeData().eras();for(t=0,e=a.length;t<e;++t)if(r=a[t].since<=a[t].until?1:-1,n=this.clone().startOf("day").valueOf(),a[t].since<=n&&n<=a[t].until||a[t].until<=n&&n<=a[t].since)return(this.year()-Be(a[t].since).year())*r+a[t].offset;return this.year()}function Xb(t){return yt(this,"_erasNameRegex")||Eu.call(this),t?this._erasNameRegex:this._erasRegex}function Jb(t){return yt(this,"_erasAbbrRegex")||Eu.call(this),t?this._erasAbbrRegex:this._erasRegex}function Qb(t){return yt(this,"_erasNarrowRegex")||Eu.call(this),t?this._erasNarrowRegex:this._erasRegex}function Du(t,e){return e.erasAbbrRegex(t)}function Kb(t,e){return e.erasNameRegex(t)}function ew(t,e){return e.erasNarrowRegex(t)}function tw(t,e){return e._eraYearOrdinalRegex||ba}function Eu(){var t=[],e=[],r=[],n=[],a,i,s,u,l,o=this.eras();for(a=0,i=o.length;a<i;++a)s=fn(o[a].name),u=fn(o[a].abbr),l=fn(o[a].narrow),e.push(s),t.push(u),r.push(l),n.push(s),n.push(u),n.push(l);this._erasRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+r.join("|")+")","i")}Ve(0,["gg",2],0,function(){return this.weekYear()%100}),Ve(0,["GG",2],0,function(){return this.isoWeekYear()%100});function vs(t,e){Ve(0,[t,t.length],0,e)}vs("gggg","weekYear"),vs("ggggg","weekYear"),vs("GGGG","isoWeekYear"),vs("GGGGG","isoWeekYear"),Re("G",as),Re("g",as),Re("GG",Ot,Sr),Re("gg",Ot,Sr),Re("GGGG",su,iu),Re("gggg",su,iu),Re("GGGGG",ns,ts),Re("ggggg",ns,ts),li(["gggg","ggggg","GGGG","GGGGG"],function(t,e,r,n){e[n.substr(0,2)]=mt(t)}),li(["gg","GG"],function(t,e,r,n){e[n]=Be.parseTwoDigitYear(t)});function rw(t){return Qc.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function nw(t){return Qc.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function aw(){return hn(this.year(),1,4)}function iw(){return hn(this.isoWeekYear(),1,4)}function sw(){var t=this.localeData()._week;return hn(this.year(),t.dow,t.doy)}function ow(){var t=this.localeData()._week;return hn(this.weekYear(),t.dow,t.doy)}function Qc(t,e,r,n,a){var i;return t==null?mi(this,n,a).year:(i=hn(t,n,a),e>i&&(e=i),uw.call(this,t,e,r,n,a))}function uw(t,e,r,n,a){var i=Mc(t,e,r,n,a),s=di(i.year,0,i.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}Ve("Q",0,"Qo","quarter"),Re("Q",yc),Nt("Q",function(t,e){e[dn]=(mt(t)-1)*3});function lw(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}Ve("D",["DD",2],"Do","date"),Re("D",Ot,wa),Re("DD",Ot,Sr),Re("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),Nt(["D","DD"],rn),Nt("Do",function(t,e){e[rn]=mt(t.match(Ot)[0])});var Kc=xa("Date",!0);Ve("DDD",["DDDD",3],"DDDo","dayOfYear"),Re("DDD",rs),Re("DDDD",bc),Nt(["DDD","DDDD"],function(t,e,r){r._dayOfYear=mt(t)});function cw(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}Ve("m",["mm",2],0,"minute"),Re("m",Ot,ou),Re("mm",Ot,Sr),Nt(["m","mm"],Yr);var fw=xa("Minutes",!1);Ve("s",["ss",2],0,"second"),Re("s",Ot,ou),Re("ss",Ot,Sr),Nt(["s","ss"],mn);var dw=xa("Seconds",!1);Ve("S",0,0,function(){return~~(this.millisecond()/100)}),Ve(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Ve(0,["SSS",3],0,"millisecond"),Ve(0,["SSSS",4],0,function(){return this.millisecond()*10}),Ve(0,["SSSSS",5],0,function(){return this.millisecond()*100}),Ve(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),Ve(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),Ve(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),Ve(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Re("S",rs,yc),Re("SS",rs,Sr),Re("SSS",rs,bc);var Mn,ef;for(Mn="SSSS";Mn.length<=9;Mn+="S")Re(Mn,ba);function mw(t,e){e[Xn]=mt(("0."+t)*1e3)}for(Mn="S";Mn.length<=9;Mn+="S")Nt(Mn,mw);ef=xa("Milliseconds",!1),Ve("z",0,0,"zoneAbbr"),Ve("zz",0,0,"zoneName");function hw(){return this._isUTC?"UTC":""}function pw(){return this._isUTC?"Coordinated Universal Time":""}var _e=oi.prototype;_e.add=ob,_e.calendar=hb,_e.clone=pb,_e.diff=Db,_e.endOf=Ob,_e.format=Nb,_e.from=_b,_e.fromNow=Cb,_e.to=Mb,_e.toNow=Tb,_e.get=S1,_e.invalidAt=Ub,_e.isAfter=vb,_e.isBefore=gb,_e.isBetween=yb,_e.isSame=bb,_e.isSameOrAfter=wb,_e.isSameOrBefore=xb,_e.isValid=Pb,_e.lang=Gc,_e.locale=Wc,_e.localeData=jc,_e.max=Py,_e.min=$y,_e.parsingFlags=qb,_e.set=N1,_e.startOf=Fb,_e.subtract=ub,_e.toArray=Lb,_e.toObject=Rb,_e.toDate=Ib,_e.toISOString=Ab,_e.inspect=Sb,typeof Symbol<"u"&&Symbol.for!=null&&(_e[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),_e.toJSON=$b,_e.toString=Eb,_e.unix=kb,_e.valueOf=Bb,_e.creationData=zb,_e.eraName=Wb,_e.eraNarrow=Gb,_e.eraAbbr=jb,_e.eraYear=Zb,_e.year=Dc,_e.isLeapYear=A1,_e.weekYear=rw,_e.isoWeekYear=nw,_e.quarter=_e.quarters=lw,_e.month=_c,_e.daysInMonth=I1,_e.week=_e.weeks=Y1,_e.isoWeek=_e.isoWeeks=V1,_e.weeksInYear=sw,_e.weeksInWeekYear=ow,_e.isoWeeksInYear=aw,_e.isoWeeksInISOWeekYear=iw,_e.date=Kc,_e.day=_e.days=ny,_e.weekday=ay,_e.isoWeekday=iy,_e.dayOfYear=cw,_e.hour=_e.hours=dy,_e.minute=_e.minutes=fw,_e.second=_e.seconds=dw,_e.millisecond=_e.milliseconds=ef,_e.utcOffset=jy,_e.utc=Xy,_e.local=Jy,_e.parseZone=Qy,_e.hasAlignedHourOffset=Ky,_e.isDST=eb,_e.isLocal=rb,_e.isUtcOffset=nb,_e.isUtc=Uc,_e.isUTC=Uc,_e.zoneAbbr=hw,_e.zoneName=pw,_e.dates=Tr("dates accessor is deprecated. Use date instead.",Kc),_e.months=Tr("months accessor is deprecated. Use month instead",_c),_e.years=Tr("years accessor is deprecated. Use year instead",Dc),_e.zone=Tr("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Zy),_e.isDSTShifted=Tr("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",tb);function vw(t){return Bt(t*1e3)}function gw(){return Bt.apply(null,arguments).parseZone()}function tf(t){return t}var bt=eu.prototype;bt.calendar=r1,bt.longDateFormat=s1,bt.invalidDate=u1,bt.ordinal=f1,bt.preparse=tf,bt.postformat=tf,bt.relativeTime=m1,bt.pastFuture=h1,bt.set=e1,bt.eras=Yb,bt.erasParse=Vb,bt.erasConvertYear=Hb,bt.erasAbbrRegex=Jb,bt.erasNameRegex=Xb,bt.erasNarrowRegex=Qb,bt.months=F1,bt.monthsShort=O1,bt.monthsParse=k1,bt.monthsRegex=R1,bt.monthsShortRegex=L1,bt.week=P1,bt.firstDayOfYear=z1,bt.firstDayOfWeek=U1,bt.weekdays=Q1,bt.weekdaysMin=ey,bt.weekdaysShort=K1,bt.weekdaysParse=ry,bt.weekdaysRegex=sy,bt.weekdaysShortRegex=oy,bt.weekdaysMinRegex=uy,bt.isPM=cy,bt.meridiem=my;function gs(t,e,r,n){var a=pn(),i=Kr().set(n,e);return a[r](i,t)}function rf(t,e,r){if(cn(t)&&(e=t,t=void 0),t=t||"",e!=null)return gs(t,e,r,"month");var n,a=[];for(n=0;n<12;n++)a[n]=gs(t,n,r,"month");return a}function Au(t,e,r,n){typeof t=="boolean"?(cn(e)&&(r=e,e=void 0),e=e||""):(e=t,r=e,t=!1,cn(e)&&(r=e,e=void 0),e=e||"");var a=pn(),i=t?a._week.dow:0,s,u=[];if(r!=null)return gs(e,(r+i)%7,n,"day");for(s=0;s<7;s++)u[s]=gs(e,(s+i)%7,n,"day");return u}function yw(t,e){return rf(t,e,"months")}function bw(t,e){return rf(t,e,"monthsShort")}function ww(t,e,r){return Au(t,e,r,"weekdays")}function xw(t,e,r){return Au(t,e,r,"weekdaysShort")}function Dw(t,e,r){return Au(t,e,r,"weekdaysMin")}Cn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,r=mt(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+r}}),Be.lang=Tr("moment.lang is deprecated. Use moment.locale instead.",Cn),Be.langData=Tr("moment.langData is deprecated. Use moment.localeData instead.",pn);var vn=Math.abs;function Ew(){var t=this._data;return this._milliseconds=vn(this._milliseconds),this._days=vn(this._days),this._months=vn(this._months),t.milliseconds=vn(t.milliseconds),t.seconds=vn(t.seconds),t.minutes=vn(t.minutes),t.hours=vn(t.hours),t.months=vn(t.months),t.years=vn(t.years),this}function nf(t,e,r,n){var a=Vr(e,r);return t._milliseconds+=n*a._milliseconds,t._days+=n*a._days,t._months+=n*a._months,t._bubble()}function Aw(t,e){return nf(this,t,e,1)}function Sw(t,e){return nf(this,t,e,-1)}function af(t){return t<0?Math.floor(t):Math.ceil(t)}function Nw(){var t=this._milliseconds,e=this._days,r=this._months,n=this._data,a,i,s,u,l;return t>=0&&e>=0&&r>=0||t<=0&&e<=0&&r<=0||(t+=af(Su(r)+e)*864e5,e=0,r=0),n.milliseconds=t%1e3,a=Or(t/1e3),n.seconds=a%60,i=Or(a/60),n.minutes=i%60,s=Or(i/60),n.hours=s%24,e+=Or(s/24),l=Or(sf(e)),r+=l,e-=af(Su(l)),u=Or(r/12),r%=12,n.days=e,n.months=r,n.years=u,this}function sf(t){return t*4800/146097}function Su(t){return t*146097/4800}function _w(t){if(!this.isValid())return NaN;var e,r,n=this._milliseconds;if(t=Fr(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+n/864e5,r=this._months+sf(e),t){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(e=this._days+Math.round(Su(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return e*24+n/36e5;case"minute":return e*1440+n/6e4;case"second":return e*86400+n/1e3;case"millisecond":return Math.floor(e*864e5)+n;default:throw new Error("Unknown unit "+t)}}function gn(t){return function(){return this.as(t)}}var of=gn("ms"),Cw=gn("s"),Mw=gn("m"),Tw=gn("h"),Fw=gn("d"),Ow=gn("w"),Bw=gn("M"),kw=gn("Q"),Iw=gn("y"),Lw=of;function Rw(){return Vr(this)}function $w(t){return t=Fr(t),this.isValid()?this[t+"s"]():NaN}function Qn(t){return function(){return this.isValid()?this._data[t]:NaN}}var Pw=Qn("milliseconds"),qw=Qn("seconds"),Uw=Qn("minutes"),zw=Qn("hours"),Yw=Qn("days"),Vw=Qn("months"),Hw=Qn("years");function Ww(){return Or(this.days()/7)}var yn=Math.round,Sa={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Gw(t,e,r,n,a){return a.relativeTime(e||1,!!r,t,n)}function jw(t,e,r,n){var a=Vr(t).abs(),i=yn(a.as("s")),s=yn(a.as("m")),u=yn(a.as("h")),l=yn(a.as("d")),o=yn(a.as("M")),c=yn(a.as("w")),f=yn(a.as("y")),d=i<=r.ss&&["s",i]||i<r.s&&["ss",i]||s<=1&&["m"]||s<r.m&&["mm",s]||u<=1&&["h"]||u<r.h&&["hh",u]||l<=1&&["d"]||l<r.d&&["dd",l];
9return r.w!=null&&(d=d||c<=1&&["w"]||c<r.w&&["ww",c]),d=d||o<=1&&["M"]||o<r.M&&["MM",o]||f<=1&&["y"]||["yy",f],d[2]=e,d[3]=+t>0,d[4]=n,Gw.apply(null,d)}function Zw(t){return t===void 0?yn:typeof t=="function"?(yn=t,!0):!1}function Xw(t,e){return Sa[t]===void 0?!1:e===void 0?Sa[t]:(Sa[t]=e,t==="s"&&(Sa.ss=e-1),!0)}function Jw(t,e){if(!this.isValid())return this.localeData().invalidDate();var r=!1,n=Sa,a,i;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(r=t),typeof e=="object"&&(n=Object.assign({},Sa,e),e.s!=null&&e.ss==null&&(n.ss=e.s-1)),a=this.localeData(),i=jw(this,!r,n,a),r&&(i=a.pastFuture(+this,i)),a.postformat(i)}var Nu=Math.abs;function Na(t){return(t>0)-(t<0)||+t}function ys(){if(!this.isValid())return this.localeData().invalidDate();var t=Nu(this._milliseconds)/1e3,e=Nu(this._days),r=Nu(this._months),n,a,i,s,u=this.asSeconds(),l,o,c,f;return u?(n=Or(t/60),a=Or(n/60),t%=60,n%=60,i=Or(r/12),r%=12,s=t?t.toFixed(3).replace(/\.?0+$/,""):"",l=u<0?"-":"",o=Na(this._months)!==Na(u)?"-":"",c=Na(this._days)!==Na(u)?"-":"",f=Na(this._milliseconds)!==Na(u)?"-":"",l+"P"+(i?o+i+"Y":"")+(r?o+r+"M":"")+(e?c+e+"D":"")+(a||n||t?"T":"")+(a?f+a+"H":"")+(n?f+n+"M":"")+(t?f+s+"S":"")):"P0D"}var gt=fs.prototype;gt.isValid=Vy,gt.abs=Ew,gt.add=Aw,gt.subtract=Sw,gt.as=_w,gt.asMilliseconds=of,gt.asSeconds=Cw,gt.asMinutes=Mw,gt.asHours=Tw,gt.asDays=Fw,gt.asWeeks=Ow,gt.asMonths=Bw,gt.asQuarters=kw,gt.asYears=Iw,gt.valueOf=Lw,gt._bubble=Nw,gt.clone=Rw,gt.get=$w,gt.milliseconds=Pw,gt.seconds=qw,gt.minutes=Uw,gt.hours=zw,gt.days=Yw,gt.weeks=Ww,gt.months=Vw,gt.years=Hw,gt.humanize=Jw,gt.toISOString=ys,gt.toString=ys,gt.toJSON=ys,gt.locale=Wc,gt.localeData=jc,gt.toIsoString=Tr("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ys),gt.lang=Gc,Ve("X",0,0,"unix"),Ve("x",0,0,"valueOf"),Re("x",as),Re("X",y1),Nt("X",function(t,e,r){r._d=new Date(parseFloat(t)*1e3)}),Nt("x",function(t,e,r){r._d=new Date(mt(t))});//! moment.js 10Be.version="2.30.1",Q0(Bt),Be.fn=_e,Be.min=qy,Be.max=Uy,Be.now=zy,Be.utc=Kr,Be.unix=vw,Be.months=yw,Be.isDate=si,Be.locale=Cn,Be.invalid=Qi,Be.duration=Vr,Be.isMoment=zr,Be.weekdays=ww,Be.parseZone=gw,Be.localeData=pn,Be.isDuration=ds,Be.monthsShort=bw,Be.weekdaysMin=Dw,Be.defineLocale=mu,Be.updateLocale=gy,Be.locales=yy,Be.weekdaysShort=xw,Be.normalizeUnits=Fr,Be.relativeTimeRounding=Zw,Be.relativeTimeThreshold=Xw,Be.calendarFormat=mb,Be.prototype=_e,Be.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};function gi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Qw(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var r=function n(){var a=!1;try{a=this instanceof n}catch{}return a?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,a.get?a:{enumerable:!0,get:function(){return t[n]}})}),r}var _u={exports:{}},uf;function Kw(){return uf||(uf=1,function(t,e){(function(r){t.exports=r()})(function(){var r=["decimals","thousand","mark","prefix","suffix","encoder","decoder","negativeBefore","negative","edit","undo"];function n(h){return h.split("").reverse().join("")}function a(h,p){return h.substring(0,p.length)===p}function i(h,p){return h.slice(-1*p.length)===p}function s(h,p,g){if((h[p]||h[g])&&h[p]===h[g])throw new Error(p)}function u(h){return typeof h=="number"&&isFinite(h)}function l(h,p){return h=h.toString().split("e"),h=Math.round(+(h[0]+"e"+(h[1]?+h[1]+p:p))),h=h.toString().split("e"),(+(h[0]+"e"+(h[1]?+h[1]-p:-p))).toFixed(p)}function o(h,p,g,v,D,y,x,w,b,A,S,E){var N=E,_,C,O,I="",k="";return y&&(E=y(E)),u(E)?(h!==!1&&parseFloat(E.toFixed(h))===0&&(E=0),E<0&&(_=!0,E=Math.abs(E)),h!==!1&&(E=l(E,h)),E=E.toString(),E.indexOf(".")!==-1?(C=E.split("."),O=C[0],g&&(I=g+C[1])):O=E,p&&(O=n(O).match(/.{1,3}/g),O=n(O.join(n(p)))),_&&w&&(k+=w),v&&(k+=v),_&&b&&(k+=b),k+=O,k+=I,D&&(k+=D),A&&(k=A(k,N)),k):!1}function c(h,p,g,v,D,y,x,w,b,A,S,E){var N,_="";
10return S&&(E=S(E)),!E||typeof E!="string"||(w&&a(E,w)&&(E=E.replace(w,""),N=!0),v&&a(E,v)&&(E=E.replace(v,"")),b&&a(E,b)&&(E=E.replace(b,""),N=!0),D&&i(E,D)&&(E=E.slice(0,-1*D.length)),p&&(E=E.split(p).join("")),g&&(E=E.replace(g,".")),N&&(_+="-"),_+=E,_=_.replace(/[^0-9\.\-.]/g,""),_==="")||(_=Number(_),x&&(_=x(_)),!u(_))?!1:_}function f(h){var p,g,v,D={};for(h.suffix===void 0&&(h.suffix=h.postfix),p=0;p<r.length;p+=1)if(g=r[p],v=h[g],v===void 0)g==="negative"&&!D.negativeBefore?D[g]="-":g==="mark"&&D.thousand!=="."?D[g]=".":D[g]=!1;else if(g==="decimals")if(v>=0&&v<8)D[g]=v;else throw new Error(g);else if(g==="encoder"||g==="decoder"||g==="edit"||g==="undo")if(typeof v=="function")D[g]=v;else throw new Error(g);else if(typeof v=="string")D[g]=v;else throw new Error(g);return s(D,"mark","thousand"),s(D,"prefix","negative"),s(D,"prefix","negativeBefore"),D}function d(h,p,g){var v,D=[];for(v=0;v<r.length;v+=1)D.push(h[r[v]]);return D.push(g),p.apply("",D)}function m(h){if(!(this instanceof m))return new m(h);typeof h=="object"&&(h=f(h),this.to=function(p){return d(h,o,p)},this.from=function(p){return d(h,c,p)})}return m})}(_u)),_u.exports}var ex=Kw();const tx=gi(ex);var Tn;(function(t){t.Range="range",t.Steps="steps",t.Positions="positions",t.Count="count",t.Values="values"})(Tn||(Tn={}));var dr;(function(t){t[t.None=-1]="None",t[t.NoValue=0]="NoValue",t[t.LargeValue=1]="LargeValue",t[t.SmallValue=2]="SmallValue"})(dr||(dr={}));function rx(t){return bs(t)&&typeof t.from=="function"}function bs(t){return typeof t=="object"&&typeof t.to=="function"}function lf(t){t.parentElement.removeChild(t)}function Cu(t){return t!=null}function cf(t){t.preventDefault()}function nx(t){return t.filter(function(e){return this[e]?!1:this[e]=!0},{})}function ax(t,e){return Math.round(t/e)*e}function ix(t,e){var r=t.getBoundingClientRect(),n=t.ownerDocument,a=n.documentElement,i=mf(n);return/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(i.x=0),e?r.top+i.y-a.clientTop:r.left+i.x-a.clientLeft}function Hr(t){return typeof t=="number"&&!isNaN(t)&&isFinite(t)}function ff(t,e,r){r>0&&(ir(t,e),setTimeout(function(){xs(t,e)},r))}function df(t){return Math.max(Math.min(t,100),0)}function ws(t){return Array.isArray(t)?t:[t]}function sx(t){t=String(t);var e=t.split(".");return e.length>1?e[1].length:0}function ir(t,e){t.classList&&!/\s/.test(e)?t.classList.add(e):t.className+=" "+e}function xs(t,e){t.classList&&!/\s/.test(e)?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function ox(t,e){return t.classList?t.classList.contains(e):new RegExp("\\b"+e+"\\b").test(t.className)}function mf(t){var e=window.pageXOffset!==void 0,r=(t.compatMode||"")==="CSS1Compat",n=e?window.pageXOffset:r?t.documentElement.scrollLeft:t.body.scrollLeft,a=e?window.pageYOffset:r?t.documentElement.scrollTop:t.body.scrollTop;return{x:n,y:a}}function ux(){return window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"}}function lx(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e)}catch{}return t}function cx(){return window.CSS&&CSS.supports&&CSS.supports("touch-action","none")}function Mu(t,e){return 100/(e-t)}function Tu(t,e,r){return e*100/(t[r+1]-t[r])}function fx(t,e){return Tu(t,t[0]<0?e+Math.abs(t[0]):e-t[0],0)}function dx(t,e){return e*(t[1]-t[0])/100+t[0]}function yi(t,e){for(var r=1;t>=e[r];)r+=1;return r}function mx(t,e,r){if(r>=t.slice(-1)[0])return 100;var n=yi(r,t),a=t[n-1],i=t[n],s=e[n-1],u=e[n];return s+fx([a,i],r)/Mu(s,u)}function hx(t,e,r){if(r>=100)return t.slice(-1)[0];var n=yi(r,e),a=t[n-1],i=t[n],s=e[n-1],u=e[n];return dx([a,i],(r-s)*Mu(s,u))}function px(t,e,r,n){if(n===100)return n;var a=yi(n,t),i=t[a-1],s=t[a];return r?n-i>(s-i)/2?s:i:e[a-1]?t[a-1]+ax(n-t[a-1],e[a-1]):n}var hf=function(){function t(e,r,n){this.xPct=[],this.xVal=[],this.xSteps=[],this.xNumSteps=[],this.xHighestCompleteStep=[],this.xSteps=[n||!1],this.xNumSteps=[!1],this.snap=r;var a,i=[];for(Object.keys(e).forEach(function(s){i.push([ws(e[s]),s])}),i.sort(function(s,u){return s[0][0]-u[0][0]}),a=0;a<i.length;
10a++)this.handleEntryPoint(i[a][1],i[a][0]);for(this.xNumSteps=this.xSteps.slice(0),a=0;a<this.xNumSteps.length;a++)this.handleStepPoint(a,this.xNumSteps[a])}return t.prototype.getDistance=function(e){for(var r=[],n=0;n<this.xNumSteps.length-1;n++)r[n]=Tu(this.xVal,e,n);return r},t.prototype.getAbsoluteDistance=function(e,r,n){var a=0;if(e<this.xPct[this.xPct.length-1])for(;e>this.xPct[a+1];)a++;else e===this.xPct[this.xPct.length-1]&&(a=this.xPct.length-2);!n&&e===this.xPct[a+1]&&a++,r===null&&(r=[]);var i,s=1,u=r[a],l=0,o=0,c=0,f=0;for(n?i=(e-this.xPct[a])/(this.xPct[a+1]-this.xPct[a]):i=(this.xPct[a+1]-e)/(this.xPct[a+1]-this.xPct[a]);u>0;)l=this.xPct[a+1+f]-this.xPct[a+f],r[a+f]*s+100-i*100>100?(o=l*i,s=(u-100*i)/r[a+f],i=1):(o=r[a+f]*l/100*s,s=0),n?(c=c-o,this.xPct.length+f>=1&&f--):(c=c+o,this.xPct.length-f>=1&&f++),u=r[a+f]*s;return e+c},t.prototype.toStepping=function(e){return e=mx(this.xVal,this.xPct,e),e},t.prototype.fromStepping=function(e){return hx(this.xVal,this.xPct,e)},t.prototype.getStep=function(e){return e=px(this.xPct,this.xSteps,this.snap,e),e},t.prototype.getDefaultStep=function(e,r,n){var a=yi(e,this.xPct);return(e===100||r&&e===this.xPct[a-1])&&(a=Math.max(a-1,1)),(this.xVal[a]-this.xVal[a-1])/n},t.prototype.getNearbySteps=function(e){var r=yi(e,this.xPct);return{stepBefore:{startValue:this.xVal[r-2],step:this.xNumSteps[r-2],highestStep:this.xHighestCompleteStep[r-2]},thisStep:{startValue:this.xVal[r-1],step:this.xNumSteps[r-1],highestStep:this.xHighestCompleteStep[r-1]},stepAfter:{startValue:this.xVal[r],step:this.xNumSteps[r],highestStep:this.xHighestCompleteStep[r]}}},t.prototype.countStepDecimals=function(){var e=this.xNumSteps.map(sx);return Math.max.apply(null,e)},t.prototype.hasNoSize=function(){return this.xVal[0]===this.xVal[this.xVal.length-1]},t.prototype.convert=function(e){return this.getStep(this.toStepping(e))},t.prototype.handleEntryPoint=function(e,r){var n;if(e==="min"?n=0:e==="max"?n=100:n=parseFloat(e),!Hr(n)||!Hr(r[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");this.xPct.push(n),this.xVal.push(r[0]);var a=Number(r[1]);n?this.xSteps.push(isNaN(a)?!1:a):isNaN(a)||(this.xSteps[0]=a),this.xHighestCompleteStep.push(0)},t.prototype.handleStepPoint=function(e,r){if(r){if(this.xVal[e]===this.xVal[e+1]){this.xSteps[e]=this.xHighestCompleteStep[e]=this.xVal[e];return}this.xSteps[e]=Tu([this.xVal[e],this.xVal[e+1]],r,0)/Mu(this.xPct[e],this.xPct[e+1]);var n=(this.xVal[e+1]-this.xVal[e])/this.xNumSteps[e],a=Math.ceil(Number(n.toFixed(3))-1),i=this.xVal[e]+this.xNumSteps[e]*a;this.xHighestCompleteStep[e]=i}},t}(),pf={to:function(t){return t===void 0?"":t.toFixed(2)},from:Number},vf={target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",touchArea:"touch-area",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",connects:"connects",ltr:"ltr",rtl:"rtl",textDirectionLtr:"txt-dir-ltr",textDirectionRtl:"txt-dir-rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"},Fn={tooltips:".__tooltips",aria:".__aria"};function vx(t,e){if(!Hr(e))throw new Error("noUiSlider: 'step' is not numeric.");t.singleStep=e}function gx(t,e){if(!Hr(e))throw new Error("noUiSlider: 'keyboardPageMultiplier' is not numeric.");t.keyboardPageMultiplier=e}function yx(t,e){if(!Hr(e))throw new Error("noUiSlider: 'keyboardMultiplier' is not numeric.");t.keyboardMultiplier=e}function bx(t,e){if(!Hr(e))throw new Error("noUiSlider: 'keyboardDefaultStep' is not numeric.");t.keyboardDefaultStep=e}function wx(t,e){if(typeof e!="object"||Array.isArray(e))throw new Error("noUiSlider: 'range' is not an object.");if(e.min===void 0||e.max===void 0)throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");t.spectrum=new hf(e,t.snap||!1,t.singleStep)}function xx(t,e){if(e=ws(e),!Array.isArray(e)||!e.length)throw new Error("noUiSlider: 'start' option is incorrect.");t.handles=e.length,t.start=e}function Dx(t,e){if(typeof e!="boolean")throw new Error("noUiSlider: 'snap' option must be a boolean.");t.snap=e}function Ex(t,e){if(typeof e!="boolean")throw new Error("noUiSlider: 'animate' option must be a boolean.");t.animate=e}function Ax(t,e){if(typeof e!="number")throw new Error("noUiSlider: 'animationDuration' option must be a number.");t.animationDuration=e}function gf(t,e){var r=[!1],n;
10if(e==="lower"?e=[!0,!1]:e==="upper"&&(e=[!1,!0]),e===!0||e===!1){for(n=1;n<t.handles;n++)r.push(e);r.push(!1)}else{if(!Array.isArray(e)||!e.length||e.length!==t.handles+1)throw new Error("noUiSlider: 'connect' option doesn't match handle count.");r=e}t.connect=r}function Sx(t,e){switch(e){case"horizontal":t.ort=0;break;case"vertical":t.ort=1;break;default:throw new Error("noUiSlider: 'orientation' option is invalid.")}}function yf(t,e){if(!Hr(e))throw new Error("noUiSlider: 'margin' option must be numeric.");e!==0&&(t.margin=t.spectrum.getDistance(e))}function Nx(t,e){if(!Hr(e))throw new Error("noUiSlider: 'limit' option must be numeric.");if(t.limit=t.spectrum.getDistance(e),!t.limit||t.handles<2)throw new Error("noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.")}function _x(t,e){var r;if(!Hr(e)&&!Array.isArray(e))throw new Error("noUiSlider: 'padding' option must be numeric or array of exactly 2 numbers.");if(Array.isArray(e)&&!(e.length===2||Hr(e[0])||Hr(e[1])))throw new Error("noUiSlider: 'padding' option must be numeric or array of exactly 2 numbers.");if(e!==0){for(Array.isArray(e)||(e=[e,e]),t.padding=[t.spectrum.getDistance(e[0]),t.spectrum.getDistance(e[1])],r=0;r<t.spectrum.xNumSteps.length-1;r++)if(t.padding[0][r]<0||t.padding[1][r]<0)throw new Error("noUiSlider: 'padding' option must be a positive number(s).");var n=e[0]+e[1],a=t.spectrum.xVal[0],i=t.spectrum.xVal[t.spectrum.xVal.length-1];if(n/(i-a)>1)throw new Error("noUiSlider: 'padding' option must not exceed 100% of the range.")}}function Cx(t,e){switch(e){case"ltr":t.dir=0;break;case"rtl":t.dir=1;break;default:throw new Error("noUiSlider: 'direction' option was not recognized.")}}function Mx(t,e){if(typeof e!="string")throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var r=e.indexOf("tap")>=0,n=e.indexOf("drag")>=0,a=e.indexOf("fixed")>=0,i=e.indexOf("snap")>=0,s=e.indexOf("hover")>=0,u=e.indexOf("unconstrained")>=0,l=e.indexOf("invert-connects")>=0,o=e.indexOf("drag-all")>=0,c=e.indexOf("smooth-steps")>=0;if(a){if(t.handles!==2)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");yf(t,t.start[1]-t.start[0])}if(l&&t.handles!==2)throw new Error("noUiSlider: 'invert-connects' behaviour must be used with 2 handles");if(u&&(t.margin||t.limit))throw new Error("noUiSlider: 'unconstrained' behaviour cannot be used with margin or limit");t.events={tap:r||i,drag:n,dragAll:o,smoothSteps:c,fixed:a,snap:i,hover:s,unconstrained:u,invertConnects:l}}function Tx(t,e){if(e!==!1)if(e===!0||bs(e)){t.tooltips=[];for(var r=0;r<t.handles;r++)t.tooltips.push(e)}else{if(e=ws(e),e.length!==t.handles)throw new Error("noUiSlider: must pass a formatter for all handles.");e.forEach(function(n){if(typeof n!="boolean"&&!bs(n))throw new Error("noUiSlider: 'tooltips' must be passed a formatter or 'false'.")}),t.tooltips=e}}function Fx(t,e){if(e.length!==t.handles)throw new Error("noUiSlider: must pass a attributes for all handles.");t.handleAttributes=e}function Ox(t,e){if(!bs(e))throw new Error("noUiSlider: 'ariaFormat' requires 'to' method.");t.ariaFormat=e}function Bx(t,e){if(!rx(e))throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods.");t.format=e}function kx(t,e){if(typeof e!="boolean")throw new Error("noUiSlider: 'keyboardSupport' option must be a boolean.");t.keyboardSupport=e}function Ix(t,e){t.documentElement=e}function Lx(t,e){if(typeof e!="string"&&e!==!1)throw new Error("noUiSlider: 'cssPrefix' must be a string or `false`.");t.cssPrefix=e}function Rx(t,e){if(typeof e!="object")throw new Error("noUiSlider: 'cssClasses' must be an object.");typeof t.cssPrefix=="string"?(t.cssClasses={},Object.keys(e).forEach(function(r){t.cssClasses[r]=t.cssPrefix+e[r]})):t.cssClasses=e}function bf(t){var e={margin:null,limit:null,padding:null,animate:!0,animationDuration:300,ariaFormat:pf,format:pf},r={step:{r:!1,t:vx},keyboardPageMultiplier:{r:!1,t:gx},keyboardMultiplier:{r:!1,t:yx},keyboardDefaultStep:{r:!1,t:bx},start:{r:!0,t:xx},connect:{r:!0,t:gf},direction:{r:!0,t:Cx},snap:{r:!1,t:Dx},animate:{r:!1,t:Ex},animationDuration:{r:!1,t:Ax},range:{r:!0,t:wx},orientation:{r:!1,t:Sx},margin:{r:!1,t:yf},limit:{r:!1,t:Nx},padding:{r:!1,t:_x},behaviour:{r:!0,t:Mx},ariaFormat:{r:!1,t:Ox},format:{r:!1,t:Bx},tooltips:{r:!1,t:Tx},keyboardSupport:{r:!0,t:kx},documentElement:{r:!1,t:Ix},cssPrefix:{r:!0,t:Lx}
10,cssClasses:{r:!0,t:Rx},handleAttributes:{r:!1,t:Fx}},n={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal",keyboardSupport:!0,cssPrefix:"noUi-",cssClasses:vf,keyboardPageMultiplier:5,keyboardMultiplier:1,keyboardDefaultStep:10};t.format&&!t.ariaFormat&&(t.ariaFormat=t.format),Object.keys(r).forEach(function(l){if(!Cu(t[l])&&n[l]===void 0){if(r[l].r)throw new Error("noUiSlider: '"+l+"' is required.");return}r[l].t(e,Cu(t[l])?t[l]:n[l])}),e.pips=t.pips;var a=document.createElement("div"),i=a.style.msTransform!==void 0,s=a.style.transform!==void 0;e.transformRule=s?"transform":i?"msTransform":"webkitTransform";var u=[["left","top"],["right","bottom"]];return e.style=u[e.dir][e.ort],e}function $x(t,e,r){var n=ux(),a=cx(),i=a&&lx(),s=t,u,l,o,c,f,d,m=e.spectrum,h=[],p=[],g=[],v=0,D={},y=!1,x=t.ownerDocument,w=e.documentElement||x.documentElement,b=x.body,A=x.dir==="rtl"||e.ort===1?0:100;function S(F,$){var G=x.createElement("div");return $&&ir(G,$),F.appendChild(G),G}function E(F,$){var G=S(F,e.cssClasses.origin),ie=S(G,e.cssClasses.handle);if(S(ie,e.cssClasses.touchArea),ie.setAttribute("data-handle",String($)),e.keyboardSupport&&(ie.setAttribute("tabindex","0"),ie.addEventListener("keydown",function(ge){return Me(ge,$)})),e.handleAttributes!==void 0){var me=e.handleAttributes[$];Object.keys(me).forEach(function(ge){ie.setAttribute(ge,me[ge])})}return ie.setAttribute("role","slider"),ie.setAttribute("aria-orientation",e.ort?"vertical":"horizontal"),$===0?ir(ie,e.cssClasses.handleLower):$===e.handles-1&&ir(ie,e.cssClasses.handleUpper),G.handle=ie,G}function N(F,$){return $?S(F,e.cssClasses.connect):!1}function _(F,$){l=S($,e.cssClasses.connects),o=[],c=[],c.push(N(l,F[0]));for(var G=0;G<e.handles;G++)o.push(E($,G)),g[G]=G,c.push(N(l,F[G+1]))}function C(F){ir(F,e.cssClasses.target),e.dir===0?ir(F,e.cssClasses.ltr):ir(F,e.cssClasses.rtl),e.ort===0?ir(F,e.cssClasses.horizontal):ir(F,e.cssClasses.vertical);var $=getComputedStyle(F).direction;return $==="rtl"?ir(F,e.cssClasses.textDirectionRtl):ir(F,e.cssClasses.textDirectionLtr),S(F,e.cssClasses.base)}function O(F,$){return!e.tooltips||!e.tooltips[$]?!1:S(F.firstChild,e.cssClasses.tooltip)}function I(){return s.hasAttribute("disabled")}function k(F){var $=o[F];return $.hasAttribute("disabled")}function M(F){F!=null?(o[F].setAttribute("disabled",""),o[F].handle.removeAttribute("tabindex")):(s.setAttribute("disabled",""),o.forEach(function($){$.handle.removeAttribute("tabindex")}))}function H(F){F!=null?(o[F].removeAttribute("disabled"),o[F].handle.setAttribute("tabindex","0")):(s.removeAttribute("disabled"),o.forEach(function($){$.removeAttribute("disabled"),$.handle.setAttribute("tabindex","0")}))}function q(){d&&(ue("update"+Fn.tooltips),d.forEach(function(F){F&&lf(F)}),d=null)}function z(){q(),d=o.map(O),Y("update"+Fn.tooltips,function(F,$,G){if(!(!d||!e.tooltips)&&d[$]!==!1){var ie=F[$];e.tooltips[$]!==!0&&(ie=e.tooltips[$].to(G[$])),d[$].innerHTML=ie}})}function X(){ue("update"+Fn.aria),Y("update"+Fn.aria,function(F,$,G,ie,me){g.forEach(function(ge){var ye=o[ge],Ae=Z(p,ge,0,!0,!0,!0),Ce=Z(p,ge,100,!0,!0,!0),Oe=me[ge],Ge=String(e.ariaFormat.to(G[ge]));Ae=m.fromStepping(Ae).toFixed(1),Ce=m.fromStepping(Ce).toFixed(1),Oe=m.fromStepping(Oe).toFixed(1),ye.children[0].setAttribute("aria-valuemin",Ae),ye.children[0].setAttribute("aria-valuemax",Ce),ye.children[0].setAttribute("aria-valuenow",Oe),ye.children[0].setAttribute("aria-valuetext",Ge)})})}function te(F){if(F.mode===Tn.Range||F.mode===Tn.Steps)return m.xVal;if(F.mode===Tn.Count){if(F.values<2)throw new Error("noUiSlider: 'values' (>= 2) required for mode 'count'.");for(var $=F.values-1,G=100/$,ie=[];$--;)ie[$]=$*G;return ie.push(100),B(ie,F.stepped)}return F.mode===Tn.Positions?B(F.values,F.stepped):F.mode===Tn.Values?F.stepped?F.values.map(function(me){return m.fromStepping(m.getStep(m.toStepping(me)))}):F.values:[]}function B(F,$){return F.map(function(G){return m.fromStepping($?m.getStep(G):G)})}function j(F){function $(Oe,Ge){return Number((Oe+Ge).toFixed(7))}var G=te(F),ie={},me=m.xVal[0],ge=m.xVal[m.xVal.length-1],ye=!1,Ae=!1,Ce=0;return G=nx(G.slice().sort(function(Oe,Ge){return Oe-Ge})),G[0]!==me&&(G.unshift(me),ye=!0),G[G.length-1]!==ge&&(G.push(ge),Ae=!0),G.forEach(function(Oe,Ge){var ht,rt,Mt,kt=Oe,qt=G[Ge+1],$t,fa,da,ma,ei,ha,ti,ri=F.mode===Tn.Steps;for(ri&&(ht=m.xNumSteps[Ge]),ht||(ht=qt-kt),qt===void 0&&(qt=kt),ht=Math.max(ht,1e-7),rt=kt;rt<=qt;rt=$(rt,ht)){for($t=m.toStepping(rt),fa=$t-Ce,ei=fa/(F.density||1),ha=Math.round(ei),ti=fa/ha,Mt=1;Mt<=ha;Mt+=1)da=Ce+Mt*ti,ie[da.toFixed(5)]=[m.fromStepping(da),0];ma=G.indexOf(rt)>-1?dr.LargeValue:ri?dr.SmallValue:dr.NoValue,!Ge&&ye&&rt!==qt&&(ma=0),rt===qt&&Ae||(ie[$t.toFixed(5)]=[rt,ma]),Ce=$t}}),ie}function R(F,$,G){var ie,me,ge=x.createElement("div"),ye=(ie={}
10,ie[dr.None]="",ie[dr.NoValue]=e.cssClasses.valueNormal,ie[dr.LargeValue]=e.cssClasses.valueLarge,ie[dr.SmallValue]=e.cssClasses.valueSub,ie),Ae=(me={},me[dr.None]="",me[dr.NoValue]=e.cssClasses.markerNormal,me[dr.LargeValue]=e.cssClasses.markerLarge,me[dr.SmallValue]=e.cssClasses.markerSub,me),Ce=[e.cssClasses.valueHorizontal,e.cssClasses.valueVertical],Oe=[e.cssClasses.markerHorizontal,e.cssClasses.markerVertical];ir(ge,e.cssClasses.pips),ir(ge,e.ort===0?e.cssClasses.pipsHorizontal:e.cssClasses.pipsVertical);function Ge(rt,Mt){var kt=Mt===e.cssClasses.value,qt=kt?Ce:Oe,$t=kt?ye:Ae;return Mt+" "+qt[e.ort]+" "+$t[rt]}function ht(rt,Mt,kt){if(kt=$?$(Mt,kt):kt,kt!==dr.None){var qt=S(ge,!1);qt.className=Ge(kt,e.cssClasses.marker),qt.style[e.style]=rt+"%",kt>dr.NoValue&&(qt=S(ge,!1),qt.className=Ge(kt,e.cssClasses.value),qt.setAttribute("data-value",String(Mt)),qt.style[e.style]=rt+"%",qt.innerHTML=String(G.to(Mt)))}}return Object.keys(F).forEach(function(rt){ht(rt,F[rt][0],F[rt][1])}),ge}function oe(){f&&(lf(f),f=null)}function se(F){oe();var $=j(F),G=F.filter,ie=F.format||{to:function(me){return String(Math.round(me))}};return f=s.appendChild(R($,G,ie)),f}function le(){var F=u.getBoundingClientRect(),$="offset"+["Width","Height"][e.ort];return e.ort===0?F.width||u[$]:F.height||u[$]}function P(F,$,G,ie){var me=function(ye){var Ae=W(ye,ie.pageOffset,ie.target||$);if(!Ae||I()&&!ie.doNotReject||ox(s,e.cssClasses.tap)&&!ie.doNotReject||F===n.start&&Ae.buttons!==void 0&&Ae.buttons>1||ie.hover&&Ae.buttons)return!1;i||Ae.preventDefault(),Ae.calcPoint=Ae.points[e.ort],G(Ae,ie)},ge=[];return F.split(" ").forEach(function(ye){$.addEventListener(ye,me,i?{passive:!0}:!1),ge.push([ye,me])}),ge}function W(F,$,G){var ie=F.type.indexOf("touch")===0,me=F.type.indexOf("mouse")===0,ge=F.type.indexOf("pointer")===0,ye=0,Ae=0;if(F.type.indexOf("MSPointer")===0&&(ge=!0),F.type==="mousedown"&&!F.buttons&&!F.touches)return!1;if(ie){var Ce=function(ht){var rt=ht.target;return rt===G||G.contains(rt)||F.composed&&F.composedPath().shift()===G};if(F.type==="touchstart"){var Oe=Array.prototype.filter.call(F.touches,Ce);if(Oe.length>1)return!1;ye=Oe[0].pageX,Ae=Oe[0].pageY}else{var Ge=Array.prototype.find.call(F.changedTouches,Ce);if(!Ge)return!1;ye=Ge.pageX,Ae=Ge.pageY}}return $=$||mf(x),(me||ge)&&(ye=F.clientX+$.x,Ae=F.clientY+$.y),F.pageOffset=$,F.points=[ye,Ae],F.cursor=me||ge,F}function J(F){var $=F-ix(u,e.ort),G=$*100/le();return G=df(G),e.dir?100-G:G}function re(F){var $=100,G=!1;return o.forEach(function(ie,me){if(!k(me)){var ge=p[me],ye=Math.abs(ge-F),Ae=ye===100&&$===100,Ce=ye<$,Oe=ye<=$&&F>ge;(Ce||Oe||Ae)&&(G=me,$=ye)}}),G}function ae(F,$){F.type==="mouseout"&&F.target.nodeName==="HTML"&&F.relatedTarget===null&&fe(F,$)}function he(F,$){if(navigator.appVersion.indexOf("MSIE 9")===-1&&F.buttons===0&&$.buttonsProperty!==0)return fe(F,$);var G=(e.dir?-1:1)*(F.calcPoint-$.startCalcPoint),ie=G*100/$.baseSize;ne(G>0,ie,$.locations,$.handleNumbers,$.connect)}function fe(F,$){$.handle&&(xs($.handle,e.cssClasses.active),v-=1),$.listeners.forEach(function(G){w.removeEventListener(G[0],G[1])}),v===0&&(xs(s,e.cssClasses.drag),we(),F.cursor&&(b.style.cursor="",b.removeEventListener("selectstart",cf))),e.events.smoothSteps&&($.handleNumbers.forEach(function(G){xe(G,p[G],!0,!0,!1,!1)}),$.handleNumbers.forEach(function(G){L("update",G)})),$.handleNumbers.forEach(function(G){L("change",G),L("set",G),L("end",G)})}function De(F,$){if(!$.handleNumbers.some(k)){var G;if($.handleNumbers.length===1){var ie=o[$.handleNumbers[0]];G=ie.children[0],v+=1,ir(G,e.cssClasses.active)}F.stopPropagation();var me=[],ge=P(n.move,w,he,{target:F.target,handle:G,connect:$.connect,listeners:me,startCalcPoint:F.calcPoint,baseSize:le(),pageOffset:F.pageOffset,handleNumbers:$.handleNumbers,buttonsProperty:F.buttons,locations:p.slice()}),ye=P(n.end,w,fe,{target:F.target,handle:G,listeners:me,doNotReject:!0,handleNumbers:$.handleNumbers}),Ae=P("mouseout",w,ae,{target:F.target,handle:G,listeners:me,doNotReject:!0,handleNumbers:$.handleNumbers});me.push.apply(me,ge.concat(ye,Ae)),F.cursor&&(b.style.cursor=getComputedStyle(F.target).cursor,o.length>
101&&ir(s,e.cssClasses.drag),b.addEventListener("selectstart",cf,!1)),$.handleNumbers.forEach(function(Ce){L("start",Ce)})}}function Te(F){F.stopPropagation();var $=J(F.calcPoint),G=re($);G!==!1&&(e.events.snap||ff(s,e.cssClasses.tap,e.animationDuration),xe(G,$,!0,!0),we(),L("slide",G,!0),L("update",G,!0),e.events.snap?De(F,{handleNumbers:[G]}):(L("change",G,!0),L("set",G,!0)))}function Ie(F){var $=J(F.calcPoint),G=m.getStep($),ie=m.fromStepping(G);Object.keys(D).forEach(function(me){me.split(".")[0]==="hover"&&D[me].forEach(function(ge){ge.call(V,ie)})})}function Me(F,$){if(I()||k($))return!1;var G=["Left","Right"],ie=["Down","Up"],me=["PageDown","PageUp"],ge=["Home","End"];e.dir&&!e.ort?G.reverse():e.ort&&!e.dir&&(ie.reverse(),me.reverse());var ye=F.key.replace("Arrow",""),Ae=ye===me[0],Ce=ye===me[1],Oe=ye===ie[0]||ye===G[0]||Ae,Ge=ye===ie[1]||ye===G[1]||Ce,ht=ye===ge[0],rt=ye===ge[1];if(!Oe&&!Ge&&!ht&&!rt)return!0;F.preventDefault();var Mt;if(Ge||Oe){var kt=Oe?0:1,qt=T($),$t=qt[kt];if($t===null)return!1;$t===!1&&($t=m.getDefaultStep(p[$],Oe,e.keyboardDefaultStep)),Ce||Ae?$t*=e.keyboardPageMultiplier:$t*=e.keyboardMultiplier,$t=Math.max($t,1e-7),$t=(Oe?-1:1)*$t,Mt=h[$]+$t}else rt?Mt=e.spectrum.xVal[e.spectrum.xVal.length-1]:Mt=e.spectrum.xVal[0];return xe($,m.toStepping(Mt),!0,!0),L("slide",$),L("update",$),L("change",$),L("set",$),!1}function Le(F){F.fixed||o.forEach(function($,G){P(n.start,$.children[0],De,{handleNumbers:[G]})}),F.tap&&P(n.start,u,Te,{}),F.hover&&P(n.move,u,Ie,{hover:!0}),F.drag&&c.forEach(function($,G){if(!($===!1||G===0||G===c.length-1)){var ie=o[G-1],me=o[G],ge=[$],ye=[ie,me],Ae=[G-1,G];ir($,e.cssClasses.draggable),F.fixed&&(ge.push(ie.children[0]),ge.push(me.children[0])),F.dragAll&&(ye=o,Ae=g),ge.forEach(function(Ce){P(n.start,Ce,De,{handles:ye,handleNumbers:Ae,connect:$})})}})}function Y(F,$){D[F]=D[F]||[],D[F].push($),F.split(".")[0]==="update"&&o.forEach(function(G,ie){L("update",ie)})}function ee(F){return F===Fn.aria||F===Fn.tooltips}function ue(F){var $=F&&F.split(".")[0],G=$?F.substring($.length):F;Object.keys(D).forEach(function(ie){var me=ie.split(".")[0],ge=ie.substring(me.length);(!$||$===me)&&(!G||G===ge)&&(!ee(ge)||G===ge)&&delete D[ie]})}function L(F,$,G){Object.keys(D).forEach(function(ie){var me=ie.split(".")[0];F===me&&D[ie].forEach(function(ge){ge.call(V,h.map(e.format.to),$,h.slice(),G||!1,p.slice(),V)})})}function Z(F,$,G,ie,me,ge,ye){var Ae;return o.length>1&&!e.events.unconstrained&&(ie&&$>0&&(Ae=m.getAbsoluteDistance(F[$-1],e.margin,!1),G=Math.max(G,Ae)),me&&$<o.length-1&&(Ae=m.getAbsoluteDistance(F[$+1],e.margin,!0),G=Math.min(G,Ae))),o.length>1&&e.limit&&(ie&&$>0&&(Ae=m.getAbsoluteDistance(F[$-1],e.limit,!1),G=Math.min(G,Ae)),me&&$<o.length-1&&(Ae=m.getAbsoluteDistance(F[$+1],e.limit,!0),G=Math.max(G,Ae))),e.padding&&($===0&&(Ae=m.getAbsoluteDistance(0,e.padding[0],!1),G=Math.max(G,Ae)),$===o.length-1&&(Ae=m.getAbsoluteDistance(100,e.padding[1],!0),G=Math.min(G,Ae))),ye||(G=m.getStep(G)),G=df(G),G===F[$]&&!ge?!1:G}function K(F,$){var G=e.ort;return(G?$:F)+", "+(G?F:$)}function ne(F,$,G,ie,me){var ge=G.slice(),ye=ie[0],Ae=e.events.smoothSteps,Ce=[!F,F],Oe=[F,!F];ie=ie.slice(),F&&ie.reverse(),ie.length>1?ie.forEach(function(ht,rt){var Mt=Z(ge,ht,ge[ht]+$,Ce[rt],Oe[rt],!1,Ae);Mt===!1?$=0:($=Mt-ge[ht],ge[ht]=Mt)}):Ce=Oe=[!0];var Ge=!1;ie.forEach(function(ht,rt){Ge=xe(ht,G[ht]+$,Ce[rt],Oe[rt],!1,Ae)||Ge}),Ge&&(ie.forEach(function(ht){L("update",ht),L("slide",ht)}),me!=null&&L("drag",ye))}function ce(F,$){return e.dir?100-F-$:F}function pe(F,$){p[F]=$,h[F]=m.fromStepping($);var G=ce($,0)-A,ie="translate("+K(G+"%","0")+")";if(o[F].style[e.transformRule]=ie,e.events.invertConnects&&p.length>1){var me=p.every(function(ge,ye,Ae){return ye===0||ge>=Ae[ye-1]});if(y!==!me){Ze();return}}Ne(F),Ne(F+1),y&&(Ne(F-1),Ne(F+2))}function we(){g.forEach(function(F){var $=p[F]>50?-1:1,G=3+(o.length+$*F);o[F].style.zIndex=String(G)})}function xe(F,$,G,ie,me,ge){return me||($=Z(p,F,$,G,ie,!1,ge)),$===!1?!1:(pe(F,$),!0)}function Ne(F){if(c[F]){var $=p.slice();y&&$.sort(function(Ae,Ce){return Ae-Ce});var G=0,ie=100;F!==0&&(G=$[F-1]),F!==c.length-1&&(ie=$[F]);var me=ie-G,ge="translate("+K(ce(G,me)+"%","0")+")",ye="scale("+K(me/100,"1")+")";c[F].style[e.transformRule]=ge+" "+ye}}function Ee(F,$){return F===null||F===!1||F===void 0||(typeof F=="number"&&(F=String(F)),F=e.format.from(F),F!==!1&&(F=m.toStepping(F)),F===!1||isNaN(F))?p[$]:F}function st(F,$,G){var ie=ws(F),me=p[0]===void 0;
10$=$===void 0?!0:$,e.animate&&!me&&ff(s,e.cssClasses.tap,e.animationDuration),g.forEach(function(Ae){xe(Ae,Ee(ie[Ae],Ae),!0,!1,G)});var ge=g.length===1?0:1;if(me&&m.hasNoSize()&&(G=!0,p[0]=0,g.length>1)){var ye=100/(g.length-1);g.forEach(function(Ae){p[Ae]=Ae*ye})}for(;ge<g.length;++ge)g.forEach(function(Ae){xe(Ae,p[Ae],!0,!0,G)});we(),g.forEach(function(Ae){L("update",Ae),ie[Ae]!==null&&$&&L("set",Ae)})}function lt(F){st(e.start,F)}function We(F,$,G,ie){if(F=Number(F),!(F>=0&&F<g.length))throw new Error("noUiSlider: invalid handle number, got: "+F);xe(F,Ee($,F),!0,!0,ie),L("update",F),G&&L("set",F)}function Je(F){if(F===void 0&&(F=!1),F)return h.length===1?h[0]:h.slice(0);var $=h.map(e.format.to);return $.length===1?$[0]:$}function Ft(){for(ue(Fn.aria),ue(Fn.tooltips),Object.keys(e.cssClasses).forEach(function(F){xs(s,e.cssClasses[F])});s.firstChild;)s.removeChild(s.firstChild);delete s.noUiSlider}function T(F){var $=p[F],G=m.getNearbySteps($),ie=h[F],me=G.thisStep.step,ge=null;if(e.snap)return[ie-G.stepBefore.startValue||null,G.stepAfter.startValue-ie||null];me!==!1&&ie+me>G.stepAfter.startValue&&(me=G.stepAfter.startValue-ie),ie>G.thisStep.startValue?ge=G.thisStep.step:G.stepBefore.step===!1?ge=!1:ge=ie-G.stepBefore.highestStep,$===100?me=null:$===0&&(ge=null);var ye=m.countStepDecimals();return me!==null&&me!==!1&&(me=Number(me.toFixed(ye))),ge!==null&&ge!==!1&&(ge=Number(ge.toFixed(ye))),[ge,me]}function Q(){return g.map(T)}function de(F,$){var G=Je(),ie=["margin","limit","padding","range","animate","snap","step","format","pips","tooltips","connect"];ie.forEach(function(ge){F[ge]!==void 0&&(r[ge]=F[ge])});var me=bf(r);ie.forEach(function(ge){F[ge]!==void 0&&(e[ge]=me[ge])}),m=me.spectrum,e.margin=me.margin,e.limit=me.limit,e.padding=me.padding,e.pips?se(e.pips):oe(),e.tooltips?z():q(),p=[],st(Cu(F.start)?F.start:G,$),F.connect&&be()}function be(){for(;l.firstChild;)l.removeChild(l.firstChild);for(var F=0;F<=e.handles;F++)c[F]=N(l,e.connect[F]),Ne(F);Le({drag:e.events.drag,fixed:!0})}function Ze(){y=!y,gf(e,e.connect.map(function(F){return!F})),be()}function it(){u=C(s),_(e.connect,u),Le(e.events),st(e.start),e.pips&&se(e.pips),e.tooltips&&z(),X()}it();var V={destroy:Ft,steps:Q,on:Y,off:ue,get:Je,set:st,setHandle:We,reset:lt,disable:M,enable:H,__moveHandles:function(F,$,G){ne(F,$,p,G)},options:r,updateOptions:de,target:s,removePips:oe,removeTooltips:q,getPositions:function(){return p.slice()},getTooltips:function(){return d},getOrigins:function(){return o},pips:se};return V}function Px(t,e){if(!t||!t.nodeName)throw new Error("noUiSlider: create requires a single element, got: "+t);if(t.noUiSlider)throw new Error("noUiSlider: Slider was already initialized.");var r=bf(e),n=$x(t,r,e);return t.noUiSlider=n,n}const qx={__spectrum:hf,cssClasses:vf,create:Px};var Fu=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],_a={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(t){return typeof console<"u"&&console.warn(t)},getWeek:function(t){var e=new Date(t.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var r=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-r.getTime())/864e5-3+(r.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewB
vendor: 5,153 bytes, line 10
10ox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},bi={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(t){var e=t%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},br=function(t,e){return e===void 0&&(e=2),("000"+t).slice(e*-1)},Br=function(t){return t===!0?1:0};function wf(t,e){var r;return function(){var n=this,a=arguments;clearTimeout(r),r=setTimeout(function(){return t.apply(n,a)},e)}}var Ou=function(t){return t instanceof Array?t:[t]};function mr(t,e,r){if(r===!0)return t.classList.add(e);t.classList.remove(e)}function wt(t,e,r){var n=window.document.createElement(t);return e=e||"",r=r||"",n.className=e,r!==void 0&&(n.textContent=r),n}function Ds(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function xf(t,e){if(e(t))return t;if(t.parentNode)return xf(t.parentNode,e)}function Es(t,e){var r=wt("div","numInputWrapper"),n=wt("input","numInput "+t),a=wt("span","arrowUp"),i=wt("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?n.type="number":(n.type="text",n.pattern="\\d*"),e!==void 0)for(var s in e)n.setAttribute(s,e[s]);return r.appendChild(n),r.appendChild(a),r.appendChild(i),r}function Nr(t){try{if(typeof t.composedPath=="function"){var e=t.composedPath();return e[0]}return t.target}catch{return t.target}}var Bu=function(){},As=function(t,e,r){return r.months[e?"shorthand":"longhand"][t]},Ux={D:Bu,F:function(t,e,r){t.setMonth(r.months.longhand.indexOf(e))},G:function(t,e){t.setHours((t.getHours()>=12?12:0)+parseFloat(e))},H:function(t,e){t.setHours(parseFloat(e))},J:function(t,e){t.setDate(parseFloat(e))},K:function(t,e,r){t.setHours(t.getHours()%12+12*Br(new RegExp(r.amPM[1],"i").test(e)))},M:function(t,e,r){t.setMonth(r.months.shorthand.indexOf(e))},S:function(t,e){t.setSeconds(parseFloat(e))},U:function(t,e){return new Date(parseFloat(e)*1e3)},W:function(t,e,r){var n=parseInt(e),a=new Date(t.getFullYear(),0,2+(n-1)*7,0,0,0,0);return a.setDate(a.getDate()-a.getDay()+r.firstDayOfWeek),a},Y:function(t,e){t.setFullYear(parseFloat(e))},Z:function(t,e){return new Date(e)},d:function(t,e){t.setDate(parseFloat(e))},h:function(t,e){t.setHours((t.getHours()>=12?12:0)+parseFloat(e))},i:function(t,e){t.setMinutes(parseFloat(e))},j:function(t,e){t.setDate(parseFloat(e))},l:Bu,m:function(t,e){t.setMonth(parseFloat(e)-1)},n:function(t,e){t.setMonth(parseFloat(e)-1)},s:function(t,e){t.setSeconds(parseFloat(e))},u:function(t,e){return new Date(parseFloat(e))},w:Bu,y:function(t,e){t.setFullYear(2e3+parseFloat(e))}},Kn={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},wi={Z:function(t){return t.toISOString()},D:function(t,e,r){return e.weekdays.shorthand[wi.w(t,e,r)]},F:function(t,e,r){return As(wi.n(t,e,r)-1,!1,e)},G:function(t,e,r){return br(wi.h(t,e,r))},H:function(t){return br(t.getHours())},J:function(t,e){return e.ordinal!==void 0?t.getDate()+e.ordinal(t.getDate()):t.getDate()},K:function(t,e){return e.amPM[Br(t.getHours()>11)]},M:function(t,e){return As(t.getMonth(),!0,e)},S:function(t){return br(t.getSeconds())},U:function(t){return t.getTime()/1e3},W:function(t,e,r){return r.getWeek(t)},Y:function(t){return br(t.getFullYear(),4)},d:function(t){return br(t.getDate())},h:function(t){return t.getHours()%12?t.getHours()%12:12},i:function(t){return br(t.getMinutes())},j:function(t){return t.getDate()},l:function(t,e){return e.weekdays.longhand[t.getDay()]},m:function(t){return br(t.getMonth()+1)},n:function(t){return t.getMonth()+1},s:function(t){return t.getSeconds()},u:function(t){return t.getTime()},w:function(t){return t.getDay()},y:function(t){return String(t.getFullYear()).substring(2)}},Df=function(t){var e=t.config,r=e===void 0?_a:e,n=t.l10n,a=n===void 0?bi:n,i=t.isMobile,s=i===void 0?!1:i;return function(u,l,o){var c=o||a;return r.formatDate!==void 0&&!s?r.formatDate(u,l,c):l.split("").map(function(f,d,m){return wi[f]&&m[d-1]!=="\\"?wi[f](u,c,r):f!=="\\"?f:""}).join("")}},ku=function(t){var e=t.config,r=e===void 0?_a:e,n=t.l10n,a=n===void 0?bi:n;return function(i,s,u,l){if(!(i!==0&&!i)){var o=l||a,c,f=i;if(i instanceof Date)c=new Date(i.getTime());
vendor: 10,779 bytes, line 10
10else if(typeof i!="string"&&i.toFixed!==void 0)c=new Date(i);else if(typeof i=="string"){var d=s||(r||_a).dateFormat,m=String(i).trim();if(m==="today")c=new Date,u=!0;else if(r&&r.parseDate)c=r.parseDate(i,d);else if(/Z$/.test(m)||/GMT$/.test(m))c=new Date(i);else{for(var h=void 0,p=[],g=0,v=0,D="";g<d.length;g++){var y=d[g],x=y==="\\",w=d[g-1]==="\\"||x;if(Kn[y]&&!w){D+=Kn[y];var b=new RegExp(D).exec(i);b&&(h=!0)&&p[y!=="Y"?"push":"unshift"]({fn:Ux[y],val:b[++v]})}else x||(D+=".")}c=!r||!r.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),p.forEach(function(A){var S=A.fn,E=A.val;return c=S(c,E,o)||c}),c=h?c:void 0}}if(!(c instanceof Date&&!isNaN(c.getTime()))){r.errorHandler(new Error("Invalid date provided: "+f));return}return u===!0&&c.setHours(0,0,0,0),c}}};function _r(t,e,r){return r===void 0&&(r=!0),r!==!1?new Date(t.getTime()).setHours(0,0,0,0)-new Date(e.getTime()).setHours(0,0,0,0):t.getTime()-e.getTime()}var zx=function(t,e,r){return t>Math.min(e,r)&&t<Math.max(e,r)},Iu=function(t,e,r){return t*3600+e*60+r},Yx=function(t){var e=Math.floor(t/3600),r=(t-e*3600)/60;return[e,r,t-e*3600-r*60]},Vx={DAY:864e5};function Lu(t){var e=t.defaultHour,r=t.defaultMinute,n=t.defaultSeconds;if(t.minDate!==void 0){var a=t.minDate.getHours(),i=t.minDate.getMinutes(),s=t.minDate.getSeconds();e<a&&(e=a),e===a&&r<i&&(r=i),e===a&&r===i&&n<s&&(n=t.minDate.getSeconds())}if(t.maxDate!==void 0){var u=t.maxDate.getHours(),l=t.maxDate.getMinutes();e=Math.min(e,u),e===u&&(r=Math.min(l,r)),e===u&&r===l&&(n=t.maxDate.getSeconds())}return{hours:e,minutes:r,seconds:n}}typeof Object.assign!="function"&&(Object.assign=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(!t)throw TypeError("Cannot convert undefined or null to object");for(var n=function(u){u&&Object.keys(u).forEach(function(l){return t[l]=u[l]})},a=0,i=e;a<i.length;a++){var s=i[a];n(s)}return t});var sr=function(){return sr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},sr.apply(this,arguments)},Ef=function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),a=0,e=0;e<r;e++)for(var i=arguments[e],s=0,u=i.length;s<u;s++,a++)n[a]=i[s];return n},Hx=300;function Wx(t,e){var r={config:sr(sr({},_a),zt.defaultConfig),l10n:bi};r.parseDate=ku({config:r.config,l10n:r.l10n}),r._handlers=[],r.pluginElements=[],r.loadedPlugins=[],r._bind=p,r._setHoursFromDate=d,r._positionCalendar=Le,r.changeMonth=te,r.changeYear=le,r.clear=B,r.close=j,r.onMouseOver=ae,r._createElement=wt,r.createDay=b,r.destroy=R,r.isEnabled=P,r.jumpToDate=D,r.updateValue=be,r.open=fe,r.redraw=ue,r.set=ne,r.setDate=pe,r.toggle=lt;function n(){r.utils={getDaysInMonth:function(V,F){return V===void 0&&(V=r.currentMonth),F===void 0&&(F=r.currentYear),V===1&&(F%4===0&&F%100!==0||F%400===0)?29:r.l10n.daysInMonth[V]}}}function a(){r.element=r.input=t,r.isOpen=!1,Te(),Me(),Ne(),xe(),n(),r.isMobile||w(),v(),(r.selectedDates.length||r.config.noCalendar)&&(r.config.enableTime&&d(r.config.noCalendar?r.latestSelectedDateObj:void 0),be(!1)),u();var V=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!r.isMobile&&V&&Le(),We("onReady")}function i(){var V;return((V=r.calendarContainer)===null||V===void 0?void 0:V.getRootNode()).activeElement||document.activeElement}function s(V){return V.bind(r)}function u(){var V=r.config;V.weekNumbers===!1&&V.showMonths===1||V.noCalendar!==!0&&window.requestAnimationFrame(function(){if(r.calendarContainer!==void 0&&(r.calendarContainer.style.visibility="hidden",r.calendarContainer.style.display="block"),r.daysContainer!==void 0){var F=(r.days.offsetWidth+1)*V.showMonths;r.daysContainer.style.width=F+"px",r.calendarContainer.style.width=F+(r.weekWrapper!==void 0?r.weekWrapper.offsetWidth:0)+"px",r.calendarContainer.style.removeProperty("visibility"),r.calendarContainer.style.removeProperty("display")}})}function l(V){if(r.selectedDates.length===0){var F=r.config.minDate===void 0||_r(new Date,r.config.minDate)>=0?new Date:new Date(r.config.minDate.getTime()),$=Lu(r.config);F.setHours($.hours,$.minutes,$.seconds,F.getMilliseconds()),r.selectedDates=[F],r.latestSelectedDateObj=F}V!==void 0&&V.type!=="blur"&&it(V);var G=r._input.value;f(),be(),r._input.value!==G&&r._debouncedChange()}function o(V,F){return V%12+12*Br(F===r.l10n.amPM[1])}function c(V){switch(V%24){case 0:case 12:return 12;default:return V%12}}function f(){if(!(r.hourElement===void 0||r.minuteElement===void 0)){var V=(parseInt(r.hourElement.value.slice(-2),10)||0)%24,F=(parseInt(r.minuteElement.value,10)||0)%60,$=r.secondElement!==void 0?(parseInt(r.secondElement.value,10)||0)%60:0;r.amPM!==void 0&&(V=o(V,r.amPM.textContent));var G=r.config.minTime!==void 0||r.config.minDate&&r.minDateHasTime&&r.latestSelectedDateObj&&_r(r.latestSelectedDateObj,r.config.minDate,!0)===0,ie=r.config.maxTime!==void 0||r.config.maxDate&&r.maxDateHasTime&&r.latestSelectedDateObj&&_r(r.latestSelectedDateObj,r.config.maxDate,!0)===0;if(r.config.maxTime!==void 0&&r.config.minTime!==void 0&&r.config.minTime>r.config.maxTime){var me=Iu(r.config.minTime.getHours(),r.config.minTime.getMinutes(),r.config.minTime.getSeconds()),ge=Iu(r.config.maxTime.getHours(),r.config.maxTime.getMinutes(),r.config.maxTime.getSeconds()),ye=Iu(V,F,$);if(ye>ge&&ye<me){var Ae=Yx(me);V=Ae[0],F=Ae[1],$=Ae[2]}}else{if(ie){var Ce=r.config.maxTime!==void 0?r.config.maxTime:r.config.maxDate;V=Math.min(V,Ce.getHours()),V===Ce.getHours()&&(F=Math.min(F,Ce.getMinutes())),F===Ce.getMinutes()&&($=Math.min($,Ce.getSeconds()))}if(G){var Oe=r.config.minTime!==void 0?r.config.minTime:r.config.minDate;V=Math.max(V,Oe.getHours()),V===Oe.getHours()&&F<Oe.getMinutes()&&(F=Oe.getMinutes()),F===Oe.getMinutes()&&($=Math.max($,Oe.getSeconds()))}}m(V,F,$)}}function d(V){var F=V||r.latestSelectedDateObj;F&&F instanceof Date&&m(F.getHours(),F.getMinutes(),F.getSeconds())}function m(V,F,$){r.latestSelectedDateObj!==void 0&&r.latestSelectedDateObj.setHours(V%24,F,$||0,0),!(!r.hourElement||!r.minuteElement||r.isMobile)&&(r.hourElement.value=br(r.config.time_24hr?V:(12+V)%12+12*Br(V%12===0)),r.minuteElement.value=br(F),r.amPM!==void 0&&(r.amPM.textContent=r.l10n.amPM[Br(V>=12)]),r.secondElement!==void 0&&(r.secondElement.value=br($)))}function h(V){var F=Nr(V),$=parseInt(F.value)+(V.delta||0);($/1e3>1||V.key==="Enter"&&!/[^\d]/.test($.toString()))&&le($)}function p(V,F,$,G){if(F instanceof Array)return F.forEach(function(ie){return p(V,ie,$,G)});if(V instanceof Array)return V.forEach(function(ie){return p(ie,F,$,G)});V.addEventListener(F,$,G),r._handlers.push({remove:function(){return V.removeEventListener(F,$,G)}})}function g(){We("onChange")}function v(){if(r.config.wrap&&["open","close","toggle","clear"].forEach(function($){Array.prototype.forEach.call(r.element.querySelectorAll("[data-"+$+"]"),function(G){return p(G,"click",r[$])})}),r.isMobile){st();return}var V=wf(he,50);if(r._debouncedChange=wf(g,Hx),r.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&p(r.daysContainer,"mouseover",function($){r.config.mode==="range"&&ae(Nr($))}),p(r._input,"keydown",re),r.calendarContainer!==void 0&&p(r.calendarContainer,"keydown",re),!r.config.inline&&!r.config.static&&p(window,"resize",V),window.ontouchstart!==void 0?p(window.document,"touchstart",se):p(window.document,"mousedown",se),p(window.document,"focus",se,{capture:!0}),r.config.clickOpens===!0&&(p(r._input,"focus",r.open),p(r._input,"click",r.open)),r.daysContainer!==void 0&&(p(r.monthNav,"click",Ze),p(r.monthNav,["keyup","increment"],h),p(r.daysContainer,"click",Z)),r.timeContainer!==void 0&&r.minuteElement!==void 0&&r.hourElement!==void 0){var F=function($){return Nr($).select()};p(r.timeContainer,["increment"],l),p(r.timeContainer,"blur",l,{capture:!0}),p(r.timeContainer,"click",y),p([r.hourElement,r.minuteElement],["focus","click"],F),r.secondElement!==void 0&&p(r.secondElement,"focus",function(){return r.secondElement&&r.secondElement.select()}),r.amPM!==void 0&&p(r.amPM,"click",function($){l($)})}r.config.allowInput&&p(r._input,"blur",J)}function D(V,F){var $=V!==void 0?r.parseDate(V):r.latestSelectedDateObj||(r.config.minDate&&r.config.minDate>r.now?r.config.minDate:r.config.maxDate&&r.config.maxDate<r.now?r.config.maxDate:r.now),G=r.currentYear,ie=r.currentMonth;try{$!==void 0&&(r.currentYear=$.getFullYear(),r.currentMonth=$.getMonth())}catch(me){me.message="Invalid date supplied: "+$,r.config.errorHandler(me)}F&&r.currentYear!==G&&(We("onYearChange"),O()),F&&(r.currentYear!==G||r.currentMonth!==ie)&&We("onMonthChange"),r.redraw()}function y(V){var F=Nr(V);~F.className.indexOf("arrow")&&x(V,F.classList.contains("arrowUp")?1:-1)}function x(V,F,$){var G=V&&Nr(V),ie=$||G&&G.parentNode&&G.parentNode.firstChild,me=Je("increment");me.delta=F,ie&&ie.dispatchEvent(me)}function w(){var V=window.document.createDocumentFragment();if(r.calendarContainer=wt("div","flatpickr-calendar"),r.calendarContainer.tabIndex=-1,!r.config.noCalendar){if(V.appendChild(M()),r.innerContainer=wt("div","flatpickr-innerContainer"),r.config.weekNumbers){var F=X(),$=F.weekWrapper,G=F.weekNumbers;r.innerContainer.appendChild($),r.weekNumbers=G,r.weekWrapper=$}r.rContainer=wt("div","flatpickr-rContainer"),r.rContainer.appendChild(q()),r.daysContainer||(r.daysContainer=wt("div","flatpickr-days"),r.daysContainer.tabIndex=-1),C(),r.rContainer.appendChild(r.daysContainer),r.innerContainer.appendChild(r.rContainer),V.appendChild(r.innerContainer)}r.config.enableTime&&V.appendChild(H()),mr(r.calendarContainer,"rangeMode",r.config.mode==="range"),mr(r.calendarContainer,"animate",r.config.animate===!0),mr(r.calendarContainer,"multiMonth",r.config.showMonths>1),r.calendarContainer.appendChild(V);var ie=r.config.appendTo!==void 0&&r.config.appendTo.nodeType!==void 0;if((r.config.inline||r.config.static)&&(r.calendarContainer.classList.add(r.config.inline?"inline":"static"),r.config.inline&&(!ie&&r.element.parentNode?r.element.parentNode.insertBefore(r.calendarContainer,r._input.nextSibling):r.config.appendTo!==void 0&&r.config.appendTo.appendChild(r.calendarContainer)),r.config.static)){var me=wt("div","flatpickr-wrapper");r.element.parentNode&&r.element.parentNode.insertBefore(me,r.element),me.appendChild(r.element),r.altInput&&me.appendChild(r.altInput),me.appendChild(r.calendarContainer)}!r.config.static&&!r.config.inline&&(r.config.appendTo!==void 0?r.config.appendTo:window.document.body).appendChild(r.calendarContainer)}function b(V,F,$,G){var ie=P(F,!0),me=wt("span",V,F.getDate().toString());return me.dateObj=F,me.$i=G,me.setAttribute("aria-label",r.formatDate(F,r.config.ariaDateFormat)),V.indexOf("hidden")===-1&&_r(F,r.n
vendor: 4,164 bytes, line 10
10ow)===0&&(r.todayDateElem=me,me.classList.add("today"),me.setAttribute("aria-current","date")),ie?(me.tabIndex=-1,Ft(F)&&(me.classList.add("selected"),r.selectedDateElem=me,r.config.mode==="range"&&(mr(me,"startRange",r.selectedDates[0]&&_r(F,r.selectedDates[0],!0)===0),mr(me,"endRange",r.selectedDates[1]&&_r(F,r.selectedDates[1],!0)===0),V==="nextMonthDay"&&me.classList.add("inRange")))):me.classList.add("flatpickr-disabled"),r.config.mode==="range"&&T(F)&&!Ft(F)&&me.classList.add("inRange"),r.weekNumbers&&r.config.showMonths===1&&V!=="prevMonthDay"&&G%7===6&&r.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+r.config.getWeek(F)+"</span>"),We("onDayCreate",me),me}function A(V){V.focus(),r.config.mode==="range"&&ae(V)}function S(V){for(var F=V>0?0:r.config.showMonths-1,$=V>0?r.config.showMonths:-1,G=F;G!=$;G+=V)for(var ie=r.daysContainer.children[G],me=V>0?0:ie.children.length-1,ge=V>0?ie.children.length:-1,ye=me;ye!=ge;ye+=V){var Ae=ie.children[ye];if(Ae.className.indexOf("hidden")===-1&&P(Ae.dateObj))return Ae}}function E(V,F){for(var $=V.className.indexOf("Month")===-1?V.dateObj.getMonth():r.currentMonth,G=F>0?r.config.showMonths:-1,ie=F>0?1:-1,me=$-r.currentMonth;me!=G;me+=ie)for(var ge=r.daysContainer.children[me],ye=$-r.currentMonth===me?V.$i+F:F<0?ge.children.length-1:0,Ae=ge.children.length,Ce=ye;Ce>=0&&Ce<Ae&&Ce!=(F>0?Ae:-1);Ce+=ie){var Oe=ge.children[Ce];if(Oe.className.indexOf("hidden")===-1&&P(Oe.dateObj)&&Math.abs(V.$i-Ce)>=Math.abs(F))return A(Oe)}r.changeMonth(ie),N(S(ie),0)}function N(V,F){var $=i(),G=W($||document.body),ie=V!==void 0?V:G?$:r.selectedDateElem!==void 0&&W(r.selectedDateElem)?r.selectedDateElem:r.todayDateElem!==void 0&&W(r.todayDateElem)?r.todayDateElem:S(F>0?1:-1);ie===void 0?r._input.focus():G?E(ie,F):A(ie)}function _(V,F){for(var $=(new Date(V,F,1).getDay()-r.l10n.firstDayOfWeek+7)%7,G=r.utils.getDaysInMonth((F-1+12)%12,V),ie=r.utils.getDaysInMonth(F,V),me=window.document.createDocumentFragment(),ge=r.config.showMonths>1,ye=ge?"prevMonthDay hidden":"prevMonthDay",Ae=ge?"nextMonthDay hidden":"nextMonthDay",Ce=G+1-$,Oe=0;Ce<=G;Ce++,Oe++)me.appendChild(b("flatpickr-day "+ye,new Date(V,F-1,Ce),Ce,Oe));for(Ce=1;Ce<=ie;Ce++,Oe++)me.appendChild(b("flatpickr-day",new Date(V,F,Ce),Ce,Oe));for(var Ge=ie+1;Ge<=42-$&&(r.config.showMonths===1||Oe%7!==0);Ge++,Oe++)me.appendChild(b("flatpickr-day "+Ae,new Date(V,F+1,Ge%ie),Ge,Oe));var ht=wt("div","dayContainer");return ht.appendChild(me),ht}function C(){if(r.daysContainer!==void 0){Ds(r.daysContainer),r.weekNumbers&&Ds(r.weekNumbers);for(var V=document.createDocumentFragment(),F=0;F<r.config.showMonths;F++){var $=new Date(r.currentYear,r.currentMonth,1);$.setMonth(r.currentMonth+F),V.appendChild(_($.getFullYear(),$.getMonth()))}r.daysContainer.appendChild(V),r.days=r.daysContainer.firstChild,r.config.mode==="range"&&r.selectedDates.length===1&&ae()}}function O(){if(!(r.config.showMonths>1||r.config.monthSelectorType!=="dropdown")){var V=function(G){return r.config.minDate!==void 0&&r.currentYear===r.config.minDate.getFullYear()&&G<r.config.minDate.getMonth()?!1:!(r.config.maxDate!==void 0&&r.currentYear===r.config.maxDate.getFullYear()&&G>r.config.maxDate.getMonth())};r.monthsDropdownContainer.tabIndex=-1,r.monthsDropdownContainer.innerHTML="";for(var F=0;F<12;F++)if(V(F)){var $=wt("option","flatpickr-monthDropdown-month");$.value=new Date(r.currentYear,F).getMonth().toString(),$.textContent=As(F,r.config.shorthandCurrentMonth,r.l10n),$.tabIndex=-1,r.currentMonth===F&&($.selected=!0),r.monthsDropdownContainer.appendChild($)}}}function I(){var V=wt("div","flatpickr-month"),F=window.document.createDocumentFragment(),$;r.config.showMonths>1||r.config.monthSelectorType==="static"?$=wt("span","cur-month"):(r.monthsDropdownContainer=wt("select","flatpickr-monthDropdown-months"),r.monthsDropdownContainer.setAttribute("aria-label",r.l10n.monthAriaLabel),p(r.monthsDropdownContainer,"change",function(ge){var ye=Nr(ge),Ae=parseInt(ye.value,10);r.changeMonth(Ae-r.currentMonth),We("onMonthChange")}),O(),$=r.monthsDropdownContainer);var G=Es("cur-year",{tabindex:"-1"}),ie=G.getElementsByTagName("input")[0];
vendor: 4,204 bytes, line 10
10ie.setAttribute("aria-label",r.l10n.yearAriaLabel),r.config.minDate&&ie.setAttribute("min",r.config.minDate.getFullYear().toString()),r.config.maxDate&&(ie.setAttribute("max",r.config.maxDate.getFullYear().toString()),ie.disabled=!!r.config.minDate&&r.config.minDate.getFullYear()===r.config.maxDate.getFullYear());var me=wt("div","flatpickr-current-month");return me.appendChild($),me.appendChild(G),F.appendChild(me),V.appendChild(F),{container:V,yearElement:ie,monthElement:$}}function k(){Ds(r.monthNav),r.monthNav.appendChild(r.prevMonthNav),r.config.showMonths&&(r.yearElements=[],r.monthElements=[]);for(var V=r.config.showMonths;V--;){var F=I();r.yearElements.push(F.yearElement),r.monthElements.push(F.monthElement),r.monthNav.appendChild(F.container)}r.monthNav.appendChild(r.nextMonthNav)}function M(){return r.monthNav=wt("div","flatpickr-months"),r.yearElements=[],r.monthElements=[],r.prevMonthNav=wt("span","flatpickr-prev-month"),r.prevMonthNav.innerHTML=r.config.prevArrow,r.nextMonthNav=wt("span","flatpickr-next-month"),r.nextMonthNav.innerHTML=r.config.nextArrow,k(),Object.defineProperty(r,"_hidePrevMonthArrow",{get:function(){return r.__hidePrevMonthArrow},set:function(V){r.__hidePrevMonthArrow!==V&&(mr(r.prevMonthNav,"flatpickr-disabled",V),r.__hidePrevMonthArrow=V)}}),Object.defineProperty(r,"_hideNextMonthArrow",{get:function(){return r.__hideNextMonthArrow},set:function(V){r.__hideNextMonthArrow!==V&&(mr(r.nextMonthNav,"flatpickr-disabled",V),r.__hideNextMonthArrow=V)}}),r.currentYearElement=r.yearElements[0],Q(),r.monthNav}function H(){r.calendarContainer.classList.add("hasTime"),r.config.noCalendar&&r.calendarContainer.classList.add("noCalendar");var V=Lu(r.config);r.timeContainer=wt("div","flatpickr-time"),r.timeContainer.tabIndex=-1;var F=wt("span","flatpickr-time-separator",":"),$=Es("flatpickr-hour",{"aria-label":r.l10n.hourAriaLabel});r.hourElement=$.getElementsByTagName("input")[0];var G=Es("flatpickr-minute",{"aria-label":r.l10n.minuteAriaLabel});if(r.minuteElement=G.getElementsByTagName("input")[0],r.hourElement.tabIndex=r.minuteElement.tabIndex=-1,r.hourElement.value=br(r.latestSelectedDateObj?r.latestSelectedDateObj.getHours():r.config.time_24hr?V.hours:c(V.hours)),r.minuteElement.value=br(r.latestSelectedDateObj?r.latestSelectedDateObj.getMinutes():V.minutes),r.hourElement.setAttribute("step",r.config.hourIncrement.toString()),r.minuteElement.setAttribute("step",r.config.minuteIncrement.toString()),r.hourElement.setAttribute("min",r.config.time_24hr?"0":"1"),r.hourElement.setAttribute("max",r.config.time_24hr?"23":"12"),r.hourElement.setAttribute("maxlength","2"),r.minuteElement.setAttribute("min","0"),r.minuteElement.setAttribute("max","59"),r.minuteElement.setAttribute("maxlength","2"),r.timeContainer.appendChild($),r.timeContainer.appendChild(F),r.timeContainer.appendChild(G),r.config.time_24hr&&r.timeContainer.classList.add("time24hr"),r.config.enableSeconds){r.timeContainer.classList.add("hasSeconds");var ie=Es("flatpickr-second");r.secondElement=ie.getElementsByTagName("input")[0],r.secondElement.value=br(r.latestSelectedDateObj?r.latestSelectedDateObj.getSeconds():V.seconds),r.secondElement.setAttribute("step",r.minuteElement.getAttribute("step")),r.secondElement.setAttribute("min","0"),r.secondElement.setAttribute("max","59"),r.secondElement.setAttribute("maxlength","2"),r.timeContainer.appendChild(wt("span","flatpickr-time-separator",":")),r.timeContainer.appendChild(ie)}return r.config.time_24hr||(r.amPM=wt("span","flatpickr-am-pm",r.l10n.amPM[Br((r.latestSelectedDateObj?r.hourElement.value:r.config.defaultHour)>11)]),r.amPM.title=r.l10n.toggleTitle,r.amPM.tabIndex=-1,r.timeContainer.appendChild(r.amPM)),r.timeContainer}function q(){r.weekdayContainer?Ds(r.weekdayContainer):r.weekdayContainer=wt("div","flatpickr-weekdays");for(var V=r.config.showMonths;V--;){var F=wt("div","flatpickr-weekdaycontainer");r.weekdayContainer.appendChild(F)}return z(),r.weekdayContainer}function z(){if(r.weekdayContainer){var V=r.l10n.firstDayOfWeek,F=Ef(r.l10n.weekdays.shorthand);V>0&&V<F.length&&(F=Ef(F.splice(V,F.length),F.splice(0,V)));for(var $=r.config.showMonths;$--;)r.weekdayContainer.children[$].innerHTML=`
11 <span class='flatpickr-weekday'> 12 `+F.join("</span><span class='flatpickr-weekday'>")+` 13 </span> 14 `}}function X(){r.calendarContainer.classList.add("hasWeeks");var V=wt("div","flatpickr-weekwrapper");V.appendChild(wt("span","flatpickr-weekday",r.l10n.weekAbbreviation));var F=wt("div","flatpickr-weeks");return V.appendChild(F),{weekWrapper:V,weekNumbers:F}}function te(V,F){F===void 0&&(F=!0);var $=F?V:V-r.currentMonth;$<0&&r._hidePrevMonthArrow===!0||$>0&&r._hideNextMonthArrow===!0||(r.currentMonth+=$,(r.currentMonth<0||r.currentMonth>11)&&(r.currentYear+=r.currentMonth>11?1:-1,r.currentMonth=(r.currentMonth+12)%12,We("onYearChange"),O()),C(),We("onMonthChange"),Q())}function B(V,F){if(V===void 0&&(V=!0),F===void 0&&(F=!0),r.input.value="",r.altInput!==void 0&&(r.altInput.value=""),r.mobileInput!==void 0&&(r.mobileInput.value=""),r.selectedDates=[],r.latestSelectedDateObj=void 0,F===!0&&(r.currentYear=r._initialDate.getFullYear(),r.currentMonth=r._initialDate.getMonth()),r.config.enableTime===!0){var $=Lu(r.config),G=$.hours,ie=$.minutes,me=$.seconds;m(G,ie,me)}r.redraw(),V&&We("onChange")}function j(){r.isOpen=!1,r.isMobile||(r.calendarContainer!==void 0&&r.calendarContainer.classList.remove("open"),r._input!==void 0&&r._input.classList.remove("active")),We("onClose")}function R(){r.config!==void 0&&We("onDestroy");for(var V=r._handlers.length;V--;)r._handlers[V].remove();if(r._handlers=[],r.mobileInput)r.mobileInput.parentNode&&r.mobileInput.parentNode.removeChild(r.mobileInput),r.mobileInput=void 0;else if(r.calendarContainer&&r.calendarContainer.parentNode)if(r.config.static&&r.calendarContainer.parentNode){var F=r.calendarContainer.parentNode;if(F.lastChild&&F.removeChild(F.lastChild),F.parentNode){for(;F.firstChild;)F.parentNode.insertBefore(F.firstChild,F);F.parentNode.removeChild(F)}}else r.calendarContainer.parentNode.removeChild(r.calendarContainer);r.altInput&&(r.input.type="text",r.altInput.parentNode&&r.altInput.parentNode.removeChild(r.altInput),delete r.altInput),r.input&&(r.input.type=r.input._type,r.input.classList.remove("flatpickr-input"),r.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function($){try{delete r[$]}catch{}})}function oe(V){return r.calendarContainer.contains(V)}function se(V){if(r.isOpen&&!r.config.inline){var F=Nr(V),$=oe(F),G=F===r.input||F===r.altInput||r.element.contains(F)||V.path&&V.path.indexOf&&(~V.path.indexOf(r.input)||~V.path.indexOf(r.altInput)),ie=!G&&!$&&!oe(V.relatedTarget),me=!r.config.ignoredFocusElements.some(function(ge){return ge.contains(F)});ie&&me&&(r.config.allowInput&&r.setDate(r._input.value,!1,r.config.altInput?r.config.altFormat:r.config.dateFormat),r.timeContainer!==void 0&&r.minuteElement!==void 0&&r.hourElement!==void 0&&r.input.value!==""&&r.input.value!==void 0&&l(),r.close(),r.config&&r.config.mode==="range"&&r.selectedDates.length===1&&r.clear(!1))}}function le(V){if(!(!V||r.config.minDate&&V<r.config.minDate.getFullYear()||r.config.maxDate&&V>r.config.maxDate.getFullYear())){var F=V,$=r.currentYear!==F;r.currentYear=F||r.currentYear,r.config.maxDate&&r.currentYear===r.config.maxDate.getFullYear()?r.currentMonth=Math.min(r.config.maxDate.getMonth(),r.currentMonth):r.config.minDate&&r.currentYear===r.config.minDate.getFullYear()&&(r.currentMonth=Math.max(r.config.minDate.getMonth(),r.currentMonth)),$&&(r.redraw(),We("onYearChange"),O())}}function P(V,F){var $;F===void 0&&(F=!0);var G=r.parseDate(V,void 0,F);if(r.config.minDate&&G&&_r(G,r.config.minDate,F!==void 0?F:!r.minDateHasTime)<0||r.config.maxDate&&G&&_r(G,r.config.maxDate,F!==void 0?F:!r.maxDateHasTime)>0)return!1;if(!r.config.enable&&r.config.disable.length===0)return!0;
vendor: 6,329 bytes, line 14
14if(G===void 0)return!1;for(var ie=!!r.config.enable,me=($=r.config.enable)!==null&&$!==void 0?$:r.config.disable,ge=0,ye=void 0;ge<me.length;ge++){if(ye=me[ge],typeof ye=="function"&&ye(G))return ie;if(ye instanceof Date&&G!==void 0&&ye.getTime()===G.getTime())return ie;if(typeof ye=="string"){var Ae=r.parseDate(ye,void 0,!0);return Ae&&Ae.getTime()===G.getTime()?ie:!ie}else if(typeof ye=="object"&&G!==void 0&&ye.from&&ye.to&&G.getTime()>=ye.from.getTime()&&G.getTime()<=ye.to.getTime())return ie}return!ie}function W(V){return r.daysContainer!==void 0?V.className.indexOf("hidden")===-1&&V.className.indexOf("flatpickr-disabled")===-1&&r.daysContainer.contains(V):!1}function J(V){var F=V.target===r._input,$=r._input.value.trimEnd()!==de();F&&$&&!(V.relatedTarget&&oe(V.relatedTarget))&&r.setDate(r._input.value,!0,V.target===r.altInput?r.config.altFormat:r.config.dateFormat)}function re(V){var F=Nr(V),$=r.config.wrap?t.contains(F):F===r._input,G=r.config.allowInput,ie=r.isOpen&&(!G||!$),me=r.config.inline&&$&&!G;if(V.keyCode===13&&$){if(G)return r.setDate(r._input.value,!0,F===r.altInput?r.config.altFormat:r.config.dateFormat),r.close(),F.blur();r.open()}else if(oe(F)||ie||me){var ge=!!r.timeContainer&&r.timeContainer.contains(F);switch(V.keyCode){case 13:ge?(V.preventDefault(),l(),L()):Z(V);break;case 27:V.preventDefault(),L();break;case 8:case 46:$&&!r.config.allowInput&&(V.preventDefault(),r.clear());break;case 37:case 39:if(!ge&&!$){V.preventDefault();var ye=i();if(r.daysContainer!==void 0&&(G===!1||ye&&W(ye))){var Ae=V.keyCode===39?1:-1;V.ctrlKey?(V.stopPropagation(),te(Ae),N(S(1),0)):N(void 0,Ae)}}else r.hourElement&&r.hourElement.focus();break;case 38:case 40:V.preventDefault();var Ce=V.keyCode===40?1:-1;r.daysContainer&&F.$i!==void 0||F===r.input||F===r.altInput?V.ctrlKey?(V.stopPropagation(),le(r.currentYear-Ce),N(S(1),0)):ge||N(void 0,Ce*7):F===r.currentYearElement?le(r.currentYear-Ce):r.config.enableTime&&(!ge&&r.hourElement&&r.hourElement.focus(),l(V),r._debouncedChange());break;case 9:if(ge){var Oe=[r.hourElement,r.minuteElement,r.secondElement,r.amPM].concat(r.pluginElements).filter(function(rt){return rt}),Ge=Oe.indexOf(F);if(Ge!==-1){var ht=Oe[Ge+(V.shiftKey?-1:1)];V.preventDefault(),(ht||r._input).focus()}}else!r.config.noCalendar&&r.daysContainer&&r.daysContainer.contains(F)&&V.shiftKey&&(V.preventDefault(),r._input.focus());break}}if(r.amPM!==void 0&&F===r.amPM)switch(V.key){case r.l10n.amPM[0].charAt(0):case r.l10n.amPM[0].charAt(0).toLowerCase():r.amPM.textContent=r.l10n.amPM[0],f(),be();break;case r.l10n.amPM[1].charAt(0):case r.l10n.amPM[1].charAt(0).toLowerCase():r.amPM.textContent=r.l10n.amPM[1],f(),be();break}($||oe(F))&&We("onKeyDown",V)}function ae(V,F){if(F===void 0&&(F="flatpickr-day"),!(r.selectedDates.length!==1||V&&(!V.classList.contains(F)||V.classList.contains("flatpickr-disabled")))){for(var $=V?V.dateObj.getTime():r.days.firstElementChild.dateObj.getTime(),G=r.parseDate(r.selectedDates[0],void 0,!0).getTime(),ie=Math.min($,r.selectedDates[0].getTime()),me=Math.max($,r.selectedDates[0].getTime()),ge=!1,ye=0,Ae=0,Ce=ie;Ce<me;Ce+=Vx.DAY)P(new Date(Ce),!0)||(ge=ge||Ce>ie&&Ce<me,Ce<G&&(!ye||Ce>ye)?ye=Ce:Ce>G&&(!Ae||Ce<Ae)&&(Ae=Ce));var Oe=Array.from(r.rContainer.querySelectorAll("*:nth-child(-n+"+r.config.showMonths+") > ."+F));Oe.forEach(function(Ge){var ht=Ge.dateObj,rt=ht.getTime(),Mt=ye>0&&rt<ye||Ae>0&&rt>Ae;if(Mt){Ge.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(kt){Ge.classList.remove(kt)});return}else if(ge&&!Mt)return;["startRange","inRange","endRange","notAllowed"].forEach(function(kt){Ge.classList.remove(kt)}),V!==void 0&&(V.classList.add($<=r.selectedDates[0].getTime()?"startRange":"endRange"),G<$&&rt===G?Ge.classList.add("startRange"):G>$&&rt===G&&Ge.classList.add("endRange"),rt>=ye&&(Ae===0||rt<=Ae)&&zx(rt,G,$)&&Ge.classList.add("inRange"))})}}function he(){r.isOpen&&!r.config.static&&!r.config.inline&&Le()}function fe(V,F){if(F===void 0&&(F=r._positionElement),r.isMobile===!0){if(V){V.preventDefault();var $=Nr(V);$&&$.blur()}r.mobileInput!==void 0&&(r.mobileInput.focus(),r.mobileInput.click()),We("onOpen");return}else if(r._input.disabled||r.config.inline)return;var G=r.isOpen;r.isOpen=!0,G||(r.calendarContainer.classList.add("open"),r._input.classList.add("active"),We("onOpen"),Le(F)),r.config.enableTime===!0&&r.config.noCalendar===!0&&r.config.allowInput===!1&&(V===void 0||!r.timeContainer.contains(V.relatedTarget))&&setTimeout(function(){return r.hourElement.select()},50)}function De(V){return function(F){var $=r.config["_"+V+"Date"]=r.parseDate(F,r.config.dateFormat),G=r.config["_"+(V==="min"?"max":"min")+"Date"];$!==void 0&&(r[V==="min"?"minDateHasTime":"maxDateHasTime"]=$.getHours()>0||$.getMinutes()>0||$.getSeconds()>0),r.selectedDates&&(r.selectedDates=r.selectedDates.filter(function(ie){return P(ie)}),!r.selectedDates.length&&V==="min"&&d($),be()),r.daysContainer&&(ue(),$!==void 0?r.currentYearElement[V]=$.getFullYear().toString():r.currentYearElement.removeAttribute(V),r.currentYearElement.disabled=!!G&&$!==void 0&&G.getFullYear()===$.getFullYear())}}function Te(){var V=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],F=sr(sr({},JSON.parse(JSON.stringify(t.dataset||{}))),e),$={};r.config.parseDate=F.parseDate,r.config.formatDate=F.formatDate,Object.defineProperty(r.config,"enable",{get:function(){return r.config._enable},set:function(Oe){r.config._enable=we(Oe)}}),Object.defineProperty(r.config,"disable",{get:function(){return r.config._disable},set:function(Oe){r.config._disable=we(Oe)}});var G=F.mode==="time";if(!F.dateFormat&&(F.enableTime||G)){var ie=zt.defaultConfig.dateFormat||_a.dateFormat;$.dateFormat=F.noCalendar||G?"H:i"+(F.enableSeconds?":S":""):ie+" H:i"+(F.enableSeconds?":S":"")}if(F.altInput&&(F.enableTime||G)&&!F.altFormat){var me=zt.defaultConfig.altFormat||_a.altFormat;$.altFormat=F.noCalendar||G?"h:i"+(F.enableSeconds?":S K":" K"):me+(" h:i"+(F.enableSeconds?":S":"")+" K")}Object.defineProperty(r.config,"minDate",{get:function(){return r.config._minDate},set:De("min")}),Object.defineProperty(r.config,"maxDate",{get:function(){return r.config._maxDate},set:De("max")}
vendor: 6,150 bytes, line 14
14);var ge=function(Oe){return function(Ge){r.config[Oe==="min"?"_minTime":"_maxTime"]=r.parseDate(Ge,"H:i:S")}};Object.defineProperty(r.config,"minTime",{get:function(){return r.config._minTime},set:ge("min")}),Object.defineProperty(r.config,"maxTime",{get:function(){return r.config._maxTime},set:ge("max")}),F.mode==="time"&&(r.config.noCalendar=!0,r.config.enableTime=!0),Object.assign(r.config,$,F);for(var ye=0;ye<V.length;ye++)r.config[V[ye]]=r.config[V[ye]]===!0||r.config[V[ye]]==="true";Fu.filter(function(Oe){return r.config[Oe]!==void 0}).forEach(function(Oe){r.config[Oe]=Ou(r.config[Oe]||[]).map(s)}),r.isMobile=!r.config.disableMobile&&!r.config.inline&&r.config.mode==="single"&&!r.config.disable.length&&!r.config.enable&&!r.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var ye=0;ye<r.config.plugins.length;ye++){var Ae=r.config.plugins[ye](r)||{};for(var Ce in Ae)Fu.indexOf(Ce)>-1?r.config[Ce]=Ou(Ae[Ce]).map(s).concat(r.config[Ce]):typeof F[Ce]>"u"&&(r.config[Ce]=Ae[Ce])}F.altInputClass||(r.config.altInputClass=Ie().className+" "+r.config.altInputClass),We("onParseConfig")}function Ie(){return r.config.wrap?t.querySelector("[data-input]"):t}function Me(){typeof r.config.locale!="object"&&typeof zt.l10ns[r.config.locale]>"u"&&r.config.errorHandler(new Error("flatpickr: invalid locale "+r.config.locale)),r.l10n=sr(sr({},zt.l10ns.default),typeof r.config.locale=="object"?r.config.locale:r.config.locale!=="default"?zt.l10ns[r.config.locale]:void 0),Kn.D="("+r.l10n.weekdays.shorthand.join("|")+")",Kn.l="("+r.l10n.weekdays.longhand.join("|")+")",Kn.M="("+r.l10n.months.shorthand.join("|")+")",Kn.F="("+r.l10n.months.longhand.join("|")+")",Kn.K="("+r.l10n.amPM[0]+"|"+r.l10n.amPM[1]+"|"+r.l10n.amPM[0].toLowerCase()+"|"+r.l10n.amPM[1].toLowerCase()+")";var V=sr(sr({},e),JSON.parse(JSON.stringify(t.dataset||{})));V.time_24hr===void 0&&zt.defaultConfig.time_24hr===void 0&&(r.config.time_24hr=r.l10n.time_24hr),r.formatDate=Df(r),r.parseDate=ku({config:r.config,l10n:r.l10n})}function Le(V){if(typeof r.config.position=="function")return void r.config.position(r,V);if(r.calendarContainer!==void 0){We("onPreCalendarPosition");var F=V||r._positionElement,$=Array.prototype.reduce.call(r.calendarContainer.children,function(ri,$l){return ri+$l.offsetHeight},0),G=r.calendarContainer.offsetWidth,ie=r.config.position.split(" "),me=ie[0],ge=ie.length>1?ie[1]:null,ye=F.getBoundingClientRect(),Ae=window.innerHeight-ye.bottom,Ce=me==="above"||me!=="below"&&Ae<$&&ye.top>$,Oe=window.pageYOffset+ye.top+(Ce?-$-2:F.offsetHeight+2);if(mr(r.calendarContainer,"arrowTop",!Ce),mr(r.calendarContainer,"arrowBottom",Ce),!r.config.inline){var Ge=window.pageXOffset+ye.left,ht=!1,rt=!1;ge==="center"?(Ge-=(G-ye.width)/2,ht=!0):ge==="right"&&(Ge-=G-ye.width,rt=!0),mr(r.calendarContainer,"arrowLeft",!ht&&!rt),mr(r.calendarContainer,"arrowCenter",ht),mr(r.calendarContainer,"arrowRight",rt);var Mt=window.document.body.offsetWidth-(window.pageXOffset+ye.right),kt=Ge+G>window.document.body.offsetWidth,qt=Mt+G>window.document.body.offsetWidth;if(mr(r.calendarContainer,"rightMost",kt),!r.config.static)if(r.calendarContainer.style.top=Oe+"px",!kt)r.calendarContainer.style.left=Ge+"px",r.calendarContainer.style.right="auto";else if(!qt)r.calendarContainer.style.left="auto",r.calendarContainer.style.right=Mt+"px";else{var $t=Y();if($t===void 0)return;var fa=window.document.body.offsetWidth,da=Math.max(0,fa/2-G/2),ma=".flatpickr-calendar.centerMost:before",ei=".flatpickr-calendar.centerMost:after",ha=$t.cssRules.length,ti="{left:"+ye.left+"px;right:auto;}";mr(r.calendarContainer,"rightMost",!1),mr(r.calendarContainer,"centerMost",!0),$t.insertRule(ma+","+ei+ti,ha),r.calendarContainer.style.left=da+"px",r.calendarContainer.style.right="auto"}}}}function Y(){for(var V=null,F=0;F<document.styleSheets.length;F++){var $=document.styleSheets[F];if($.cssRules){try{$.cssRules}catch{continue}V=$;break}}return V??ee()}function ee(){var V=document.createElement("style");return document.head.appendChild(V),V.sheet}function ue(){r.config.noCalendar||r.isMobile||(O(),Q(),C())}function L(){r._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(r.close,0):r.close()}function Z(V){V.preventDefault(),V.stopPropagation();var F=function(Oe){return Oe.classList&&Oe.classList.contains("flatpickr-day")&&!Oe.classList.contains("flatpickr-disabled")&&!Oe.classList.contains("notAllowed")},$=xf(Nr(V),F);if($!==void 0){var G=$,ie=r.latestSelectedDateObj=new Date(G.dateObj.getTime()),me=(ie.getMonth()<r.currentMonth||ie.getMonth()>r.currentMonth+r.config.showMonths-1)&&r.config.mode!=="range";if(r.selectedDateElem=G,r.config.mode==="single")r.selectedDates=[ie];else if(r.config.mode==="multiple"){var ge=Ft(ie);ge?r.selectedDates.splice(parseInt(ge),1):r.selectedDates.push(ie)}else r.config.mode==="range"&&(r.selectedDates.length===2&&r.clear(!1,!1),r.latestSelectedDateObj=ie,r.selectedDates.push(ie),_r(ie,r.selectedDates[0],!0)!==0&&r.selectedDates.sort(function(Oe,Ge){return Oe.getTime()-Ge.getTime()}));if(f(),me){var ye=r.currentYear!==ie.getFullYear();r.currentYear=ie.getFullYear(),r.currentMonth=ie.getMonth(),ye&&(We("onYearChange"),O()),We("onMonthChange")}if(Q(),C(),be(),!me&&r.config.mode!=="range"&&r.config.showMonths===1?A(G):r.selectedDateElem!==void 0&&r.hourElement===void 0&&r.selectedDateElem&&r.selectedDateElem.focus(),r.hourElement!==void 0&&r.hourElement!==void 0&&r.hourElement.focus(),r.config.closeOnSelect){var Ae=r.config.mode==="single"&&!r.config.enableTime,Ce=r.config.mode==="range"&&r.selectedDates.length===2&&!r.config.enableTime;(Ae||Ce)&&L()}g()}}var K={locale:[Me,z],showMonths:[k,u,q],minDate:[D],maxDate:[D],positionElement:[Ee],clickOpens:[function(){r.config.clickOpens===!0?(p(r._input,"focus",r.open),p(r._input,"click",r.open)):(r._input.removeEventListener("focus",r.open),r._input.removeEventListener("click",r.open))}]};function ne(V,F){if(V!==null&&typeof V=="object"){Object.assign(r.config,V);for(var $ in V)K[$]!==void 0&&K[$].forEach(function(G){return G()})}
vendor: 8,062 bytes, line 14
14else r.config[V]=F,K[V]!==void 0?K[V].forEach(function(G){return G()}):Fu.indexOf(V)>-1&&(r.config[V]=Ou(F));r.redraw(),be(!0)}function ce(V,F){var $=[];if(V instanceof Array)$=V.map(function(G){return r.parseDate(G,F)});else if(V instanceof Date||typeof V=="number")$=[r.parseDate(V,F)];else if(typeof V=="string")switch(r.config.mode){case"single":case"time":$=[r.parseDate(V,F)];break;case"multiple":$=V.split(r.config.conjunction).map(function(G){return r.parseDate(G,F)});break;case"range":$=V.split(r.l10n.rangeSeparator).map(function(G){return r.parseDate(G,F)});break}else r.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(V)));r.selectedDates=r.config.allowInvalidPreload?$:$.filter(function(G){return G instanceof Date&&P(G,!1)}),r.config.mode==="range"&&r.selectedDates.sort(function(G,ie){return G.getTime()-ie.getTime()})}function pe(V,F,$){if(F===void 0&&(F=!1),$===void 0&&($=r.config.dateFormat),V!==0&&!V||V instanceof Array&&V.length===0)return r.clear(F);ce(V,$),r.latestSelectedDateObj=r.selectedDates[r.selectedDates.length-1],r.redraw(),D(void 0,F),d(),r.selectedDates.length===0&&r.clear(!1),be(F),F&&We("onChange")}function we(V){return V.slice().map(function(F){return typeof F=="string"||typeof F=="number"||F instanceof Date?r.parseDate(F,void 0,!0):F&&typeof F=="object"&&F.from&&F.to?{from:r.parseDate(F.from,void 0),to:r.parseDate(F.to,void 0)}:F}).filter(function(F){return F})}function xe(){r.selectedDates=[],r.now=r.parseDate(r.config.now)||new Date;var V=r.config.defaultDate||((r.input.nodeName==="INPUT"||r.input.nodeName==="TEXTAREA")&&r.input.placeholder&&r.input.value===r.input.placeholder?null:r.input.value);V&&ce(V,r.config.dateFormat),r._initialDate=r.selectedDates.length>0?r.selectedDates[0]:r.config.minDate&&r.config.minDate.getTime()>r.now.getTime()?r.config.minDate:r.config.maxDate&&r.config.maxDate.getTime()<r.now.getTime()?r.config.maxDate:r.now,r.currentYear=r._initialDate.getFullYear(),r.currentMonth=r._initialDate.getMonth(),r.selectedDates.length>0&&(r.latestSelectedDateObj=r.selectedDates[0]),r.config.minTime!==void 0&&(r.config.minTime=r.parseDate(r.config.minTime,"H:i")),r.config.maxTime!==void 0&&(r.config.maxTime=r.parseDate(r.config.maxTime,"H:i")),r.minDateHasTime=!!r.config.minDate&&(r.config.minDate.getHours()>0||r.config.minDate.getMinutes()>0||r.config.minDate.getSeconds()>0),r.maxDateHasTime=!!r.config.maxDate&&(r.config.maxDate.getHours()>0||r.config.maxDate.getMinutes()>0||r.config.maxDate.getSeconds()>0)}function Ne(){if(r.input=Ie(),!r.input){r.config.errorHandler(new Error("Invalid input element specified"));return}r.input._type=r.input.type,r.input.type="text",r.input.classList.add("flatpickr-input"),r._input=r.input,r.config.altInput&&(r.altInput=wt(r.input.nodeName,r.config.altInputClass),r._input=r.altInput,r.altInput.placeholder=r.input.placeholder,r.altInput.disabled=r.input.disabled,r.altInput.required=r.input.required,r.altInput.tabIndex=r.input.tabIndex,r.altInput.type="text",r.input.setAttribute("type","hidden"),!r.config.static&&r.input.parentNode&&r.input.parentNode.insertBefore(r.altInput,r.input.nextSibling)),r.config.allowInput||r._input.setAttribute("readonly","readonly"),Ee()}function Ee(){r._positionElement=r.config.positionElement||r._input}function st(){var V=r.config.enableTime?r.config.noCalendar?"time":"datetime-local":"date";r.mobileInput=wt("input",r.input.className+" flatpickr-mobile"),r.mobileInput.tabIndex=1,r.mobileInput.type=V,r.mobileInput.disabled=r.input.disabled,r.mobileInput.required=r.input.required,r.mobileInput.placeholder=r.input.placeholder,r.mobileFormatStr=V==="datetime-local"?"Y-m-d\\TH:i:S":V==="date"?"Y-m-d":"H:i:S",r.selectedDates.length>0&&(r.mobileInput.defaultValue=r.mobileInput.value=r.formatDate(r.selectedDates[0],r.mobileFormatStr)),r.config.minDate&&(r.mobileInput.min=r.formatDate(r.config.minDate,"Y-m-d")),r.config.maxDate&&(r.mobileInput.max=r.formatDate(r.config.maxDate,"Y-m-d")),r.input.getAttribute("step")&&(r.mobileInput.step=String(r.input.getAttribute("step"))),r.input.type="hidden",r.altInput!==void 0&&(r.altInput.type="hidden");try{r.input.parentNode&&r.input.parentNode.insertBefore(r.mobileInput,r.input.nextSibling)}catch{}p(r.mobileInput,"change",function(F){r.setDate(Nr(F).value,!1,r.mobileFormatStr),We("onChange"),We("onClose")})}function lt(V){if(r.isOpen===!0)return r.close();r.open(V)}function We(V,F){if(r.config!==void 0){var $=r.config[V];if($!==void 0&&$.length>0)for(var G=0;$[G]&&G<$.length;G++)$[G](r.selectedDates,r.input.value,r,F);V==="onChange"&&(r.input.dispatchEvent(Je("change")),r.input.dispatchEvent(Je("input")))}}function Je(V){var F=document.createEvent("Event");return F.initEvent(V,!0,!0),F}function Ft(V){for(var F=0;F<r.selectedDates.length;F++){var $=r.selectedDates[F];if($ instanceof Date&&_r($,V)===0)return""+F}return!1}function T(V){return r.config.mode!=="range"||r.selectedDates.length<2?!1:_r(V,r.selectedDates[0])>=0&&_r(V,r.selectedDates[1])<=0}function Q(){r.config.noCalendar||r.isMobile||!r.monthNav||(r.yearElements.forEach(function(V,F){var $=new Date(r.currentYear,r.currentMonth,1);$.setMonth(r.currentMonth+F),r.config.showMonths>1||r.config.monthSelectorType==="static"?r.monthElements[F].textContent=As($.getMonth(),r.config.shorthandCurrentMonth,r.l10n)+" ":r.monthsDropdownContainer.value=$.getMonth().toString(),V.value=$.getFullYear().toString()}),r._hidePrevMonthArrow=r.config.minDate!==void 0&&(r.currentYear===r.config.minDate.getFullYear()?r.currentMonth<=r.config.minDate.getMonth():r.currentYear<r.config.minDate.getFullYear()),r._hideNextMonthArrow=r.config.maxDate!==void 0&&(r.currentYear===r.config.maxDate.getFullYear()?r.currentMonth+1>r.config.maxDate.getMonth():r.currentYear>r.config.maxDate.getFullYear()))}function de(V){var F=V||(r.config.altInput?r.config.altFormat:r.config.dateFormat);return r.selectedDates.map(function($){return r.formatDate($,F)}).filter(function($,G,ie){return r.config.mode!=="range"||r.config.enableTime||ie.indexOf($)===G}).join(r.config.mode!=="range"?r.config.conjunction:r.l10n.rangeSeparator)}function be(V){V===void 0&&(V=!0),r.mobileInput!==void 0&&r.mobileFormatStr&&(r.mobileInput.value=r.latestSelectedDateObj!==void 0?r.formatDate(r.latestSelectedDateObj,r.mobileFormatStr):""),r.input.value=de(r.config.dateFormat),r.altInput!==void 0&&(r.altInput.value=de(r.config.altFormat)),V!==!1&&We("onValueUpdate")}function Ze(V){var F=Nr(V),$=r.prevMonthNav.contains(F),G=r.nextMonthNav.contains(F);$||G?te($?-1:1):r.yearElements.indexOf(F)>=0?F.select():F.classList.contains("arrowUp")?r.changeYear(r.currentYear+1):F.classList.contains("arrowDown")&&r.changeYear(r.currentYear-1)}function it(V){V.preventDefault();var F=V.type==="keydown",$=Nr(V),G=$;r.amPM!==void 0&&$===r.amPM&&(r.amPM.textContent=r.l10n.amPM[Br(r.amPM.textContent===r.l10n.amPM[0])]);var ie=parseFloat(G.getAttribute("min")),me=parseFloat(G.getAttribute("max")),ge=parseFloat(G.getAttribute("step")),ye=parseInt(G.value,10),Ae=V.delta||(F?V.which===38?1:-1:0),Ce=ye+ge*Ae;if(typeof G.value<"u"&&G.value.length===2){var Oe=G===r.hourElement,Ge=G===r.minuteElement;Ce<ie?(Ce=me+Ce+Br(!Oe)+(Br(Oe)&&Br(!r.amPM)),Ge&&x(void 0,-1,r.hourElement)):Ce>me&&(Ce=G===r.hourElement?Ce-me-Br(!r.amPM):ie,Ge&&x(void 0,1,r.hourElement)),r.amPM&&Oe&&(ge===1?Ce+ye===23:Math.abs(Ce-ye)>ge)&&(r.amPM.textContent=r.l10n.amPM[Br(r.amPM.textContent===r.l10n.amPM[0])]),G.value=br(Ce)}}return a(),r}function Ca(t,e){for(var r=Array.prototype.slice.call(t).filter(function(s){return s instanceof HTMLElement}),n=[],a=0;a<r.length;a++){var i=r[a];try{if(i.getAttribute("data-fp-omit")!==null)continue;i._flatpickr!==void 0&&(i._flatpickr.destroy(),i._flatpickr=void 0),i._flatpickr=Wx(i,e||{}),n.push(i._flatpickr)}catch(s){console.error(s)}}return n.length===1?n[0]:n}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(t){return Ca(this,t)},HTMLElement.prototype.flatpickr=function(t){return Ca([this],t)}
14);var zt=function(t,e){return typeof t=="string"?Ca(window.document.querySelectorAll(t),e):t instanceof Node?Ca([t],e):Ca(t,e)};zt.defaultConfig={},zt.l10ns={en:sr({},bi),default:sr({},bi)},zt.localize=function(t){zt.l10ns.default=sr(sr({},zt.l10ns.default),t)},zt.setDefaults=function(t){zt.defaultConfig=sr(sr({},zt.defaultConfig),t)},zt.parseDate=ku({}),zt.formatDate=Df({}),zt.compareDates=_r,typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(t){return Ca(this,t)}),Date.prototype.fp_incr=function(t){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof t=="string"?parseInt(t,10):t))},typeof window<"u"&&(window.flatpickr=zt);var xi={exports:{}},Gx=xi.exports,Af;function jx(){return Af||(Af=1,function(t,e){(function(r,n){n(e)})(Gx,function(r){var n=typeof window<"u"&&window.flatpickr!==void 0?window.flatpickr:{l10ns:{}},a={weekdays:{shorthand:["ÐÑ","Ðн","ÐÑ","СÑ","ЧÑ","ÐÑ","Сб"],longhand:["ÐоÑкÑеÑенÑе","ÐонеделÑник","ÐÑоÑник","СÑеда","ЧеÑвеÑг","ÐÑÑниÑа","СÑббоÑа"]},months:{shorthand:["Янв","Фев","ÐаÑÑ","ÐпÑ","Ðай","ÐÑнÑ","ÐÑлÑ","Ðвг","Сен","ÐкÑ","ÐоÑ","Ðек"],longhand:["ЯнваÑÑ","ФевÑалÑ","ÐаÑÑ","ÐпÑелÑ","Ðай","ÐÑнÑ","ÐÑлÑ","ÐвгÑÑÑ","СенÑÑбÑÑ","ÐкÑÑбÑÑ","ÐоÑбÑÑ","ÐекабÑÑ"]},firstDayOfWeek:1,ordinal:function(){return""},rangeSeparator:" â ",weekAbbreviation:"Ðед.",scrollTitle:"ÐÑокÑÑÑиÑе Ð´Ð»Ñ ÑвелиÑениÑ",toggleTitle:"ÐажмиÑе Ð´Ð»Ñ Ð¿ÐµÑеклÑÑениÑ",amPM:["ÐÐ","ÐÐ"],yearAriaLabel:"Ðод",time_24hr:!0};n.l10ns.ru=a;var i=n.l10ns;r.Russian=a,r.default=i,Object.defineProperty(r,"__esModule",{value:!0})})}(xi,xi.exports)),xi.exports}var Zx=jx(),Di={exports:{}},Xx=Di.exports,Sf;function Jx(){return Sf||(Sf=1,function(t,e){(function(r,n){n(e)})(Xx,function(r){var n={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(a){var i=a%100;if(i>3&&i<21)return"th";switch(i%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1};r.default=n,r.english=n,Object.defineProperty(r,"__esModule",{value:!0})})}(Di,Di.exports)),Di.exports}var Qx=Jx();function jt(){return jt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},jt.apply(null,arguments)}var Nf={relTol:1e-12,absTol:1e-15,matrix:"Matrix",number:"number",numberFallback:"number",precision:64,predictable:!1,randomSeed:null,legacySubset:!1};function hr(t,e){if(Ss(t,e))return t[e];throw typeof t[e]=="function"&&Ru(t,e)?new Error('Cannot access method "'+e+'" as a property'):new Error('No access to property "'+e+'"')}function Ma(t,e,r){if(Ss(t,e))return t[e]=r,r;throw new Error('No access to property "'+e+'"')}function Ss(t,e){return!eD(t)&&!Array.isArray(t)?!1:ke(tD,e)?!0:!(e in Object.prototype||e in Function.prototype)}function Kx(t,e){if(!Ru(t,e))throw new Error('No access to method "'+e+'"');return t[e]}function Ru(t,e){return t==null||typeof t[e]!="function"||ke(t,e)&&Object.getPrototypeOf&&e in Object.getPrototypeOf(t)?!1:ke(rD,e)?!0:!(e in Object.prototype||e in Function.prototype)}function eD(t){return typeof t=="object"&&t&&t.constructor===Object}var tD={length:!0,name:!0},rD={toString:!0,valueOf:!0,toLocaleString:!0};class Ns{constructor(e){this.wrappedObject=e,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).filter(e=>this.has(e)).values()}get(e){return hr(this.wrappedObject,e)}set(e,r){return Ma(this.wrappedObject,e,r),this}has(e){return Ss(this.wrappedObject,e)&&e in this.wrappedObject}entries(){return Cf(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var r of this.keys())e(this.get(r),r,this)}delete(e){Ss(this.wrappedObject,e)&&delete this.wrappedObject[e]}clear(){for(var e of this.keys())this.delete(e)}get size(){return Object.keys(this.wrappedObject).length}}class _f{constructor(e,r,n){this.a=e,this.b=r,this.bKeys=n,this[Symbol.iterator]=this.entries}get(e){return this.bKeys.has(e)?this.b.get(e):this.a.get(e)}set(e,r){return this.bKeys.has(e)?this.b.set(e,r):this.a.set(e,r),this}has(e){return this.b.has(e)||this.a.has(e)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return Cf(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var r of this.keys())e(this.get(r),r,this)}delete(e){return this.bKeys.has(e)?this.b.delete(e):this.a.delete(e)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}}function Cf(t,e){return{next:()=>{var r=t.next();return r.done?r:{value:e(r.value),done:!1}}}}function Ei(){return new Map}function Ta(t){if(!t)return Ei();if(ra(t))return t;if(ta(t))return new Ns(t);throw new Error("createMap can create maps from objects or Maps")}function nD(t){if(t instanceof Ns)return t.wrappedObject;var e={};for(var r of t.keys()){var n=t.get(r);Ma(e,r,n)}return e}function qe(t){return typeof t=="number"}function Qe(t){return!t||typeof t!="object"||typeof t.constructor!="function"?!1:t.isBigNumber===!0&&typeof t.constructor.prototype=="object"&&t.constructor.prototype.isBigNumber===!0||typeof t.constructor.isDecimal=="function"&&t.constructor.isDecimal(t)===!0}function Fa(t){return typeof t=="bigint"}function Wr(t){return t&&typeof t=="object"&&Object.getPrototypeOf(t).isComplex===!0||!1}function ea(t){return t&&typeof t=="object"&&Object.getPrototypeOf(t).isFraction===!0||!1}function pr(t){return t&&t.constructor.prototype.isUnit===!0||!1}function Rt(t){return typeof t=="string"}var Dt=Array.isArray;function ze(t){return t&&t.constructor.prototype.isMatrix===!0||!1}function wr(t){return Array.isArray(t)||ze(t)}function Ai(t){return t&&t.isDenseMatrix&&t.constructor.prototype.isMatrix===!0||!1}function On(t){return t&&t.isSparseMatrix&&t.constructor.prototype.isMatrix===!0||!1}function _s(t){return t&&t.constructor.prototype.isRange===!0||!1}function Si(t){return t&&t.constructor.prototype.isIndex===!0||!1}function Mf(t){return typeof t=="boolean"}function Tf(t){return t&&t.constructor.prototype.isResultSet===!0||!1}function $u(t){return t&&t.constructor.prototype.isHelp===!0||!1}function Pu(t){return typeof t=="function"}function Ff(t){return t instanceof Date}function Of(t){return t instanceof RegExp}function ta(t){return!!(t&&typeof t=="object"&&t.constructor===Object&&!Wr(t)&&!ea(t))}function ra(t){return t?t instanceof Map||t instanceof Ns||typeof t.set=="function"&&typeof t.get=="function"&&typeof t.keys=="function"&&typeof t.has=="function":!1}function aD(t){return ra(t)&&ra(t.a)&&ra(t.b)}function iD(t){return ra(t)&&ta(t.wrappedObject)}function Bf(t){return t===null}function kf(t){return t===void 0}function Bn(t){return t&&t.isAccessorNode===!0&&t.constructor.prototype.isNode===!0||!1}function Cr(t){return t&&t.isArrayNode===!0&&t.constructor.prototype.isNode===!0||!1}function If(t){return t&&t.isAssignmentNode===!0&&t.constructor.prototype.isNode===!0||!1}function Lf(t){return t&&t.isBlockNode===!0&&t.constructor.prototype.isNode===!0||!1}function Rf(t){return t&&t.isConditionalNode===!0&&t.constructor.prototype.isNode===!0||!1}function dt(t){return t&&t.isConstantNode===!0&&t.constructor.prototype.isNode===!0||!1}function qu(t){return dt(t)||Pt(t)&&t.args.length===1&&dt(t.args[0])&&"-+~".includes(t.op)}function Oa(t){return t&&t.isFunctionAssignmentNode===!0&&t.constructor.prototype.isNode===!0||!1}function bn(t){return t&&t.isFunctionNode===!0&&t.constructor.prototype.isNode===!0||!1}function na(t){return t&&t.isIndexNode===!0&&t.constructor.prototype.isNode===!0||!1}function xt(t){return t&&t.isNode===!0&&t.constructor.prototype.isNode===!0||!1}function Ni(t){return t&&t.isObjectNode===!0&&t.constructor.prototype.isNode===!0||!1}function Pt(t){return t&&t.isOperatorNode===!0&&t.constructor.prototype.isNode===!0||!1}function nn(t){return t&&t.isParenthesisNode===!0&&t.constructor.prototype.isNode===!0||!1}function $f(t){return t&&t.isRangeNode===!0&&t.constructor.prototype.isNode===!0||!1}function Pf(t){return t&&t.isRelationalNode===!0&&t.constructor.prototype.isNode===!0||!1}function Ht(t){return t&&t.isSymbolNode===!0&&t.constructor.prototype.isNode===!0||!1}function Uu(t){return t&&t.constructor.prototype.isChain===!0||!1}function Et(t){var e=typeof t;return e==="object"?t===null?"null":Qe(t)?"BigNumber":t.constructor&&t.constructor.name?t.constructor.name:"Object":e}function je(t){var e=typeof t;if(e==="number"||e==="bigint"||e==="string"||e==="boolean"||t===null||t===void 0)return t;if(typeof t.clone=="function")return t.clone();if(Array.isArray(t))return t.map(function(r){return je(r)});if(t instanceof Date)return new Date(t.valueOf());if(Qe(t))return t;if(ta(t))return sD(t,je);
14if(e==="function")return t;throw new TypeError("Cannot clone: unknown type of value (value: ".concat(t,")"))}function sD(t,e){var r={};for(var n in t)ke(t,n)&&(r[n]=e(t[n]));return r}function qf(t,e){for(var r in e)ke(e,r)&&(t[r]=e[r]);return t}function Uf(t,e){if(Array.isArray(e))throw new TypeError("Arrays are not supported by deepExtend");for(var r in e)if(ke(e,r)&&!(r in Object.prototype)&&!(r in Function.prototype))if(e[r]&&e[r].constructor===Object)t[r]===void 0&&(t[r]={}),t[r]&&t[r].constructor===Object?Uf(t[r],e[r]):t[r]=e[r];else{if(Array.isArray(e[r]))throw new TypeError("Arrays are not supported by deepExtend");t[r]=e[r]}return t}function wn(t,e){var r,n,a;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(n=0,a=t.length;n<a;n++)if(!wn(t[n],e[n]))return!1;return!0}else{if(typeof t=="function")return t===e;if(t instanceof Object){if(Array.isArray(e)||!(e instanceof Object))return!1;for(r in t)if(!(r in e)||!wn(t[r],e[r]))return!1;for(r in e)if(!(r in t))return!1;return!0}else return t===e}}function oD(t){var e={};return zf(t,e),e}function zf(t,e){for(var r in t)if(ke(t,r)){var n=t[r];typeof n=="object"&&n!==null?zf(n,e):e[r]=n}}function aa(t,e,r){var n=!0,a;Object.defineProperty(t,e,{get:function(){return n&&(a=r(),n=!1),a},set:function(s){a=s,n=!1},configurable:!0,enumerable:!0})}function ke(t,e){return t&&Object.hasOwnProperty.call(t,e)}function uD(t){return t&&typeof t.factory=="function"}function lD(t,e){for(var r={},n=0;n<e.length;n++){var a=e[n],i=t[a];i!==void 0&&(r[a]=i)}return r}var Yf=["Matrix","Array"],Vf=["number","BigNumber","bigint","Fraction"];function cD(t,e){function r(n){if(n){if(n.epsilon!==void 0){console.warn('Warning: The configuration option "epsilon" is deprecated. Use "relTol" and "absTol" instead.');var a=je(n);return a.relTol=n.epsilon,a.absTol=n.epsilon*.001,delete a.epsilon,r(a)}n.legacySubset===!0&&console.warn('Warning: The configuration option "legacySubset" is for compatibility only and might be deprecated
14in the future.');var i=je(t);Hf(n,"matrix",Yf),Hf(n,"number",Vf),Uf(t,n);var s=je(t),u=je(n);return e("config",s,i,u),s}else return je(t)}return r.MATRIX_OPTIONS=Yf,r.NUMBER_OPTIONS=Vf,Object.keys(Nf).forEach(n=>{Object.defineProperty(r,n,{get:()=>t[n],enumerable:!0,configurable:!0})}),r}function Hf(t,e,r){t[e]!==void 0&&!r.includes(t[e])&&console.warn('Warning: Unknown value "'+t[e]+'" for configuration option "'+e+'". Available options: '+r.map(n=>JSON.stringify(n)).join(", ")+".")}function Wf(){return!0}function kr(){return!1}function Ba(){}const Gf="Argument is not a typed-function.";function jf(){function t(L){return typeof L=="object"&&L!==null&&L.constructor===Object}const e=[{name:"number",test:function(L){return typeof L=="number"}},{name:"string",test:function(L){return typeof L=="string"}},{name:"boolean",test:function(L){return typeof L=="boolean"}},{name:"Function",test:function(L){return typeof L=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(L){return L instanceof Date}},{name:"RegExp",test:function(L){return L instanceof RegExp}},{name:"Object",test:t},{name:"null",test:function(L){return L===null}},{name:"undefined",test:function(L){return L===void 0}}],r={name:"any",test:Wf,isAny:!0};let n,a,i=0,s={createCount:0};function u(L){const Z=n.get(L);if(Z)return Z;let K='Unknown type "'+L+'"';const ne=L.toLowerCase();let ce;for(ce of a)if(ce.toLowerCase()===ne){K+='. Did you mean "'+ce+'" ?';break}throw new TypeError(K)}function l(L){let Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any";const K=Z?u(Z).index:a.length,ne=[];for(let pe=0;pe<L.length;++pe){if(!L[pe]||typeof L[pe].name!="string"||typeof L[pe].test!="function")throw new TypeError("Object with properties {name: string, test: function} expected");const we=L[pe].name;if(n.has(we))throw new TypeError('Duplicate type name "'+we+'"');ne.push(we),n.set(we,{name:we,test:L[pe].test,isAny:L[pe].isAny,index:K+pe,conversionsTo:[]})}const ce=a.slice(K);a=a.slice(0,K).concat(ne).concat(ce);for(let pe=K+ne.length;pe<a.length;++pe)n.get(a[pe]).index=pe}function o(){n=new Map,a=[],i=0,l([r],!1)}o(),l(e);function c(){let L;for(L of a)n.get(L).conversionsTo=[];i=0}function f(L){const Z=a.filter(K=>{const ne=n.get(K);return!ne.isAny&&ne.test(L)});return Z.length?Z:["any"]}function d(L){return L&&typeof L=="function"&&"_typedFunctionData"in L}function m(L,Z,K){if(!d(L))throw new TypeError(Gf);const ne=K&&K.exact,ce=Array.isArray(Z)?Z.join(","):Z,pe=x(ce),we=g(pe);if(!ne||we in L.signatures){const st=L._typedFunctionData.signatureMap.get(we);if(st)return st}const xe=pe.length;let Ne;if(ne){Ne=[];let st;for(st in L.signatures)Ne.push(L._typedFunctionData.signatureMap.get(st))}else Ne=L._typedFunctionData.signatures;for(let st=0;st<xe;++st){const lt=pe[st],We=[];let Je;for(Je of Ne){const Ft=S(Je.params,st);if(!(!Ft||lt.restParam&&!Ft.restParam)){if(!Ft.hasAny){const T=y(Ft);if(lt.types.some(Q=>!T.has(Q.name)))continue}We.push(Je)}}if(Ne=We,Ne.length===0)break}let Ee;for(Ee of Ne)if(Ee.params.length<=xe)return Ee;throw new TypeError("Signature not found (signature: "+(L.name||"unnamed")+"("+g(pe,", ")+"))")}function h(L,Z,K){return m(L,Z,K).implementation}function p(L,Z){const K=u(Z);if(K.test(L))return L;const ne=K.conversionsTo;if(ne.length===0)throw new Error("There are no conversions to "+Z+" defined.");for(let ce=0;ce<ne.length;ce++)if(u(ne[ce].from).test(L))return ne[ce].convert(L);throw new Error("Cannot convert "+L+" to "+Z)}function g(L){let Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:",";return L.map(K=>K.name).join(Z)}function v(L){const Z=L.indexOf("...")===0,ne=(Z?L.length>3?L.slice(3):"any":L).split("|").map(xe=>u(xe.trim()));let ce=!1,pe=Z?"...":"";return{types:ne.map(function(xe){return ce=xe.isAny||ce,pe+=xe.name+"|",{name:xe.name,typeIndex:xe.index,test:xe.test,isAny:xe.isAny,conversion:null,conversionIndex:-1}}),name:pe.slice(0,-1),hasAny:ce,hasConversion:!1,restParam:Z}}function D(L){const Z=L.types.map(we=>we.name),K=H(Z);let ne=L.hasAny,ce=L.name;const pe=K.map(function(we){const xe=u(we.from);return ne=xe.isAny||ne,ce+="|"+we.from,{name:we.from,typeIndex:xe.index,test:xe.test,isAny:xe.isAny,conversion:we,conversionIndex:we.index}});return{types:L.types.concat(pe),name:ce,hasAny:ne,hasConversion:pe.length>0,restParam:L.restParam}}function y(L){return L.typeSet||(L.typeSet=new Set,L.types.forEac
14h(Z=>L.typeSet.add(Z.name))),L.typeSet}function x(L){const Z=[];if(typeof L!="string")throw new TypeError("Signatures must be strings");const K=L.trim();if(K==="")return Z;const ne=K.split(",");for(let ce=0;ce<ne.length;++ce){const pe=v(ne[ce].trim());if(pe.restParam&&ce!==ne.length-1)throw new SyntaxError('Unexpected rest parameter "'+ne[ce]+'": only allowed for the last parameter');if(pe.types.length===0)return null;Z.push(pe)}return Z}function w(L){const Z=W(L);return Z?Z.restParam:!1}function b(L){if(!L||L.types.length===0)return Wf;if(L.types.length===1)return u(L.types[0].name).test;if(L.types.length===2){const Z=u(L.types[0].name).test,K=u(L.types[1].name).test;return function(ce){return Z(ce)||K(ce)}}else{const Z=L.types.map(function(K){return u(K.name).test});return function(ne){for(let ce=0;ce<Z.length;ce++)if(Z[ce](ne))return!0;return!1}}}function A(L){let Z,K,ne;if(w(L)){Z=P(L).map(b);const ce=Z.length,pe=b(W(L)),we=function(xe){for(let Ne=ce;Ne<xe.length;Ne++)if(!pe(xe[Ne]))return!1;return!0};return function(Ne){for(let Ee=0;Ee<Z.length;Ee++)if(!Z[Ee](Ne[Ee]))return!1;return we(Ne)&&Ne.length>=ce+1}}else return L.length===0?function(pe){return pe.length===0}:L.length===1?(K=b(L[0]),function(pe){return K(pe[0])&&pe.length===1}):L.length===2?(K=b(L[0]),ne=b(L[1]),function(pe){return K(pe[0])&&ne(pe[1])&&pe.length===2}):(Z=L.map(b),function(pe){for(let we=0;we<Z.length;we++)if(!Z[we](pe[we]))return!1;return pe.length===Z.length})}function S(L,Z){return Z<L.length?L[Z]:w(L)?W(L):null}function E(L,Z){const K=S(L,Z);return K?y(K):new Set}function N(L){return L.conversion===null||L.conversion===void 0}function _(L,Z){const K=new Set;return L.forEach(ne=>{const ce=E(ne.params,Z);let pe;for(pe of ce)K.add(pe)}),K.has("any")?["any"]:Array.from(K)}function C(L,Z,K){let ne,ce;const pe=L||"unnamed";let we=K,xe;for(xe=0;xe<Z.length;xe++){const lt=[];if(we.forEach(We=>{const Je=S(We.params,xe),Ft=b(Je);(xe<We.params.length||w(We.params))&&Ft(Z[xe])&<.push(We)}),lt.length===0){if(ce=_(we,xe),ce.length>0){const We=f(Z[xe]);return ne=new TypeError("Unexpected type of argument in function "+pe+" (expected: "+ce.join(" or ")+", actual: "+We.join(" | ")+", index: "+xe+")"),ne.data={category:"wrongType",fn:pe,index:xe,actual:We,expected:ce},ne}}else we=lt}const Ne=we.map(function(lt){return w(lt.params)?1/0:lt.params.length});if(Z.length<Math.min.apply(null,Ne))return ce=_(we,xe),ne=new TypeError("Too few arguments in function "+pe+" (expected: "+ce.join(" or ")+", index: "+Z.length+")"),ne.data={category:"tooFewArgs",fn:pe,index:Z.length,expected:ce},ne;const Ee=Math.max.apply(null,Ne);if(Z.length>Ee)return ne=new TypeError("Too many arguments in function "+pe+" (expected: "+Ee+", actual: "+Z.length+")"),ne.data={category:"tooManyArgs",fn:pe,index:Z.length,expectedLength:Ee},ne;const st=[];for(let lt=0;lt<Z.length;++lt)st.push(f(Z[lt]).join("|"));return ne=new TypeError('Arguments of type "'+st.join(", ")+'" do not match any of the defined signatures of function '+pe+"."),ne.data={category:"mismatch",actual:st},ne}function O(L){let Z=a.length+1;for(let K=0;K<L.types.length;K++)N(L.types[K])&&(Z=Math.min(Z,L.types[K].typeIndex));return Z}function I(L){let Z=i+1;for(let K=0;K<L.types.length;K++)N(L.types[K])||(Z=Math.min(Z,L.types[K].conversionIndex));return Z}function k(L,Z){if(L.hasAny){if(!Z.hasAny)return 1}else if(Z.hasAny)return-1;if(L.restParam){if(!Z.restParam)return 1}else if(Z.restParam)return-1;if(L.hasConversion){if(!Z.hasConversion)return 1}else if(Z.hasConversion)return-1;const K=O(L)-O(Z);if(K<0)return-1;if(K>0)return 1;const ne=I(L)-I(Z);return ne<0?-1:ne>0?1:0}function M(L,Z){const K=L.params,ne=Z.params,ce=W(K),pe=W(ne),we=w(K),xe=w(ne);if(we&&ce.hasAny){if(!xe||!pe.hasAny)return 1}else if(xe&&pe.hasAny)return-1;let Ne=0,Ee=0,st;for(st of K)st.hasAny&&++Ne,st.hasConversion&&++Ee;let lt=0,We=0;for(st of ne)st.hasAny&&++lt,st.hasConversion&&++We;if(Ne!==lt)return Ne-lt;if(we&&ce.hasConversion){if(!xe||!pe.hasConversion)return 1}else if(xe&&pe.hasConversion)return-1;if(Ee!==We)return Ee-We;if(we){if(!xe)return 1}else if(xe)return-1;const Je=(K.length-ne.length)*(we?-1:1);if(Je!==0)return Je;const Ft=[];let T=0;for(let de=0;de<K.length;++de){const be=k(K[de],ne[de]);Ft.push(be),T+=be}if(T!==0)return T;let Q;for(Q of Ft)if(Q!==0)return Q;return 0}function H(L){if(L.length===0)return[];const Z=L.map(u);L.length>1&&Z.sort((ce,pe)=>ce.index-pe.index);
14let K=Z[0].conversionsTo;if(L.length===1)return K;K=K.concat([]);const ne=new Set(L);for(let ce=1;ce<Z.length;++ce){let pe;for(pe of Z[ce].conversionsTo)ne.has(pe.from)||(K.push(pe),ne.add(pe.from))}return K}function q(L,Z){let K=Z;if(L.some(ce=>ce.hasConversion)){const ce=w(L),pe=L.map(z);K=function(){const xe=[],Ne=ce?arguments.length-1:arguments.length;for(let Ee=0;Ee<Ne;Ee++)xe[Ee]=pe[Ee](arguments[Ee]);return ce&&(xe[Ne]=arguments[Ne].map(pe[Ne])),Z.apply(this,xe)}}let ne=K;if(w(L)){const ce=L.length-1;ne=function(){return K.apply(this,J(arguments,0,ce).concat([J(arguments,ce)]))}}return ne}function z(L){let Z,K,ne,ce;const pe=[],we=[];switch(L.types.forEach(function(xe){xe.conversion&&(pe.push(u(xe.conversion.from).test),we.push(xe.conversion.convert))}),we.length){case 0:return function(Ne){return Ne};case 1:return Z=pe[0],ne=we[0],function(Ne){return Z(Ne)?ne(Ne):Ne};case 2:return Z=pe[0],K=pe[1],ne=we[0],ce=we[1],function(Ne){return Z(Ne)?ne(Ne):K(Ne)?ce(Ne):Ne};default:return function(Ne){for(let Ee=0;Ee<we.length;Ee++)if(pe[Ee](Ne))return we[Ee](Ne);return Ne}}}function X(L){function Z(K,ne,ce){if(ne<K.length){const pe=K[ne];let we=[];if(pe.restParam){const xe=pe.types.filter(N);xe.length<pe.types.length&&we.push({types:xe,name:"..."+xe.map(Ne=>Ne.name).join("|"),hasAny:xe.some(Ne=>Ne.isAny),hasConversion:!1,restParam:!0}),we.push(pe)}else we=pe.types.map(function(xe){return{types:[xe],name:xe.name,hasAny:xe.isAny,hasConversion:xe.conversion,restParam:!1}});return ae(we,function(xe){return Z(K,ne+1,ce.concat([xe]))})}else return[ce]}return Z(L,0,[])}function te(L,Z){const K=Math.max(L.length,Z.length);for(let xe=0;xe<K;xe++){const Ne=E(L,xe),Ee=E(Z,xe);let st=!1,lt;for(lt of Ee)if(Ne.has(lt)){st=!0;break}if(!st)return!1}const ne=L.length,ce=Z.length,pe=w(L),we=w(Z);return pe?we?ne===ce:ce>=ne:we?ne>=ce:ne===ce}function B(L){return L.map(Z=>Ie(Z)?De(Z.referToSelf.callback):Te(Z)?fe(Z.referTo.references,Z.referTo.callback):Z)}function j(L,Z,K){const ne=[];let ce;for(ce of L){let pe=K[ce];if(typeof pe!="number")throw new TypeError('No definition for referenced signature "'+ce+'"');if(pe=Z[pe],typeof pe!="function")return!1;ne.push(pe)}return ne}function R(L,Z,K){const ne=B(L),ce=new Array(ne.length).fill(!1);let pe=!0;for(;pe;){pe=!1;let we=!0;for(let xe=0;xe<ne.length;++xe){if(ce[xe])continue;const Ne=ne[xe];if(Ie(Ne))ne[xe]=Ne.referToSelf.callback(K),ne[xe].referToSelf=Ne.referToSelf,ce[xe]=!0,we=!1;else if(Te(Ne)){const Ee=j(Ne.referTo.references,ne,Z);Ee?(ne[xe]=Ne.referTo.callback.apply(this,Ee),ne[xe].referTo=Ne.referTo,ce[xe]=!0,we=!1):pe=!0}}if(we&&pe)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return ne}function oe(L){const Z=/\bthis(\(|\.signatures\b)/;Object.keys(L).forEach(K=>{const ne=L[K];if(Z.test(ne.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function se(L,Z){if(s.createCount++,Object.keys(Z).length===0)throw new SyntaxError("No signatures provided");s.warnAgainstDeprecatedThis&&oe(Z);const K=[],ne=[],ce={},pe=[];let we;for(we in Z){if(!Object.prototype.hasOwnProperty.call(Z,we))continue;const St=x(we);if(!St)continue;K.forEach(function(zi){if(te(zi,St))throw new TypeError('Conflicting signatures "'+g(zi)+'" and "'+g(St)+'".')}),K.push(St);const Er=ne.length;ne.push(Z[we]);const i$=St.map(D);let Po;for(Po of X(i$)){const zi=g(Po);pe.push({params:Po,name:zi,fn:Er}),Po.every(s$=>!s$.hasConversion)&&(ce[zi]=Er)}}pe.sort(M);const xe=R(ne,ce,Ui);let Ne;for(Ne in ce)Object.prototype.hasOwnProperty.call(ce,Ne)&&(ce[Ne]=xe[ce[Ne]]);const Ee=[],st=new Map;for(Ne of pe)st.has(Ne.name)||(Ne.fn=xe[Ne.fn],Ee.push(Ne),st.set(Ne.name,Ne));const lt=Ee[0]&&Ee[0].params.length<=2&&!w(Ee[0].params),We=Ee[1]&&Ee[1].params.length<=2&&!w(Ee[1].params),Je=Ee[2]&&Ee[2].params.length<=2&&!w(Ee[2].params),Ft=Ee[3]&&Ee[3].params.length<=2&&!w(Ee[3].params),T=Ee[4]&&Ee[4].params.length<=2&&!w(Ee[4].params),Q=Ee[5]&&Ee[5].params.length<=2&&!w(Ee[5].params),de=lt&&We&&Je&&Ft&&T&&Q;for(let St=0;St<Ee.length;++St)Ee[St].test=A(Ee[St].params);const be=lt?b(Ee[0].params[0]):kr,Ze=We?b(Ee[1].params[0]):kr,it=Je?b(Ee[2].params[0]):kr,V=Ft?b(Ee[3].params[0]):kr,F=T?b(Ee[4].params[0]):kr,$=Q?b(Ee[5].params[0]):kr,G=lt?b(Ee[0].params[1]):kr,ie=We?b(Ee[1].params[1]):kr,me=Je?b(Ee[2].params[1]):kr,ge=Ft?b(Ee[3].params[1]):kr,ye=T?b(Ee[4].params[1]):kr,Ae=Q?b(Ee[5].params[1]):kr;for(let St=0;St<Ee.length;++St)Ee[St].implementation=q(Ee[St].params,Ee[St].fn);const Ce=lt?Ee[0].implementation:Ba,Oe=We?Ee[1].implementation:Ba,Ge=Je?Ee[2].implementation:Ba,ht=Ft?Ee[3].implementation:Ba,rt=T?Ee[4].implementation:Ba,Mt=Q?Ee[5].implementation:Ba,kt=lt?Ee[0].params.length:-1,qt=We?Ee[1].params.length:-1,$t=Je?Ee[2].params.length:-1,fa=Ft?Ee[3].params.length:-1,da=T?Ee[4].params.length:-1,ma=Q?Ee[5].params.length:-1,ei=de?6:0,ha=Ee.length,ti=Ee.map(St=>St.test),ri=Ee.map(St=>St.implementation),$l=function(){for(let Er=ei;Er<ha;Er++)if(ti[Er](arguments))return ri[Er].apply(this,arguments);return s.onMismatch(L,arguments,Ee)};function Ui(St,Er){return arguments.length===kt&&be(St)&&G(Er)?Ce.apply(this,arguments):arguments.length===qt&&Ze(St)&&ie(Er)?Oe.apply(this,arguments):arguments.length===$t&&it(St)&&me(Er)?Ge.apply(this,arguments):arguments.length===fa&&V(St)&&ge(Er)?ht.apply(this,arguments):arguments.length===da&&F(St)&&ye(Er)?rt.apply(this,arguments):arguments.length===ma&&$(St)&&Ae(Er)?Mt.a
vendor: 14,445 bytes, line 14
14pply(this,arguments):$l.apply(this,arguments)}try{Object.defineProperty(Ui,"name",{value:L})}catch{}return Ui.signatures=ce,Ui._typedFunctionData={signatures:Ee,signatureMap:st},Ui}function le(L,Z,K){throw C(L,Z,K)}function P(L){return J(L,0,L.length-1)}function W(L){return L[L.length-1]}function J(L,Z,K){return Array.prototype.slice.call(L,Z,K)}function re(L,Z){for(let K=0;K<L.length;K++)if(Z(L[K]))return L[K]}function ae(L,Z){return Array.prototype.concat.apply([],L.map(Z))}function he(){const L=P(arguments).map(K=>g(x(K))),Z=W(arguments);if(typeof Z!="function")throw new TypeError("Callback function expected as last argument");return fe(L,Z)}function fe(L,Z){return{referTo:{references:L,callback:Z}}}function De(L){if(typeof L!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:L}}}function Te(L){return L&&typeof L.referTo=="object"&&Array.isArray(L.referTo.references)&&typeof L.referTo.callback=="function"}function Ie(L){return L&&typeof L.referToSelf=="object"&&typeof L.referToSelf.callback=="function"}function Me(L,Z){if(!L)return Z;if(Z&&Z!==L){const K=new Error("Function names do not match (expected: "+L+", actual: "+Z+")");throw K.data={actual:Z,expected:L},K}return L}function Le(L){let Z;for(const K in L)Object.prototype.hasOwnProperty.call(L,K)&&(d(L[K])||typeof L[K].signature=="string")&&(Z=Me(Z,L[K].name));return Z}function Y(L,Z){let K;for(K in Z)if(Object.prototype.hasOwnProperty.call(Z,K)){if(K in L&&Z[K]!==L[K]){const ne=new Error('Signature "'+K+'" is defined twice');throw ne.data={signature:K,sourceFunction:Z[K],destFunction:L[K]},ne}L[K]=Z[K]}}const ee=s;s=function(L){const Z=typeof L=="string",K=Z?1:0;let ne=Z?L:"";const ce={};for(let pe=K;pe<arguments.length;++pe){const we=arguments[pe];let xe={},Ne;if(typeof we=="function"?(Ne=we.name,typeof we.signature=="string"?xe[we.signature]=we:d(we)&&(xe=we.signatures)):t(we)&&(xe=we,Z||(Ne=Le(we))),Object.keys(xe).length===0){const Ee=new TypeError("Argument to 'typed' at index "+pe+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw Ee.data={index:pe,argument:we},Ee}Z||(ne=Me(ne,Ne)),Y(ce,xe)}return se(ne||"",ce)},s.create=jf,s.createCount=ee.createCount,s.onMismatch=le,s.throwMismatchError=le,s.createError=C,s.clear=o,s.clearConversions=c,s.addTypes=l,s._findType=u,s.referTo=he,s.referToSelf=De,s.convert=p,s.findSignature=m,s.find=h,s.isTypedFunction=d,s.warnAgainstDeprecatedThis=!0,s.addType=function(L,Z){let K="any";Z!==!1&&n.has("Object")&&(K="Object"),s.addTypes([L],K)};function ue(L){if(!L||typeof L.from!="string"||typeof L.to!="string"||typeof L.convert!="function")throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(L.to===L.from)throw new SyntaxError('Illegal to define conversion from "'+L.from+'" to itself.')}return s.addConversion=function(L){let Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{override:!1};ue(L);const K=u(L.to),ne=K.conversionsTo.find(ce=>ce.from===L.from);if(ne)if(Z&&Z.override)s.removeConversion({from:ne.from,to:L.to,convert:ne.convert});else throw new Error('There is already a conversion from "'+L.from+'" to "'+K.name+'"');K.conversionsTo.push({from:L.from,convert:L.convert,index:i++})},s.addConversions=function(L,Z){L.forEach(K=>s.addConversion(K,Z))},s.removeConversion=function(L){ue(L);const Z=u(L.to),K=re(Z.conversionsTo,ce=>ce.from===L.from);if(!K)throw new Error("Attempt to remove nonexistent conversion from "+L.from+" to "+L.to);if(K.convert!==L.convert)throw new Error("Conversion to remove does not match existing conversion");const ne=Z.conversionsTo.indexOf(K);Z.conversionsTo.splice(ne,1)},s.resolve=function(L,Z){if(!d(L))throw new TypeError(Gf);const K=L._typedFunctionData.signatures;for(let ne=0;ne<K.length;++ne)if(K[ne].test(Z))return K[ne];return null},s}const _i=jf();function U(t,e,r,n){function a(i){var s=lD(i,e.map(Zf));return fD(t,e,i),r(s)}return a.isFactory=!0,a.fn=t,a.dependencies=e.slice().sort(),n&&(a.meta=n),a}function Ci(t){return typeof t=="function"&&typeof t.fn=="string"&&Array.isArray(t.dependencies)}function fD(t,e,r){var n=e.filter(i=>!dD(i)).every(i=>r[i]!==void 0);if(!n){var a=e.filter(i=>r[i]===void 0);throw new Error('Cannot create function "'.concat(t,'", ')+"some dependencies are missing: ".concat(a.map(i=>'"'.concat(i,'"')).join(", "),"."))}}function dD(t){return t&&t[0]==="?"}function Zf(t){return t&&t[0]==="?"?t.slice(1):t}function $e(t){return typeof t=="boolean"?!0:isFinite(t)?t===Math.round(t):!1}function kn(t,e){if(e.number==="bigint")try{BigInt(t)}catch{return e.numberFallback}return e.number}var In=Math.sign||function(t){return t>0?1:t<0?-1:0},mD=Math.log2||function(e){return Math.log(e)/Math.LN2},hD=Math.log10||function(e){return Math.log(e)/Math.LN10},pD=Math.log1p||function(t){return Math.log(t+1)},vD=Math.cbrt||function(e){if(e===0)return e;var r=e<0,n;return r&&(e=-e),isFinite(e)?(n=Math.exp(Math.log(e)/3),n=(e/(n*n)+2*n)/3):n=e,r?-n:n},gD=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function zu(t,e,r){var n={2:"0b",8:"0o",16:"0x"},a=n[e],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(t>2**(r-1)-1||t<-(2**(r-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!$e(t))throw new Error("Value must be an integer");t<0&&(t=t+2**r),i="i".concat(r)}var s="";return t<0&&(t=-t,s="-"),"".concat(s).concat(a).concat(t.toString(e)).concat(i)}function ia(t,e){if(typeof e=="function")return e(t);if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity";if(isNaN(t))return"NaN";var{notation:r,precision:n,wordSize:a}=Xf(e);switch(r){case"fixed":return Jf(t,n);case"exponential":return Qf(t,n);case"engineering":return yD(t,n);case"bin":return zu(t,2,a);case"oct":return zu(t,8,a);case"hex":return zu(t,16,a);case"auto":return bD(t,n,e).replace(/((\.\d*?)(0+))($|e)/,function(){var i=arguments[2],s=arguments[4];return i!=="."?i+s:s});default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Xf(t){var e="auto",r,n;if(t!==void 0)if(qe(t))r=t;else if(Qe(t))r=t.toNumber();else if(ta(t))t.precision!==void 0&&(r=Kf(t.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),t.wordSize!==void 0&&(n=Kf(t.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),t.notation&&(e=t.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:e,precision:r,wordSize:n}}function Mi(t){var e=String(t).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!e)throw new SyntaxError("Invalid number "+t);var r=e[1],n=e[2],a=parseFloat(e[4]||"0"),i=n.indexOf(".");a+=i!==-1?i-1:n.length-1;var s=n.replace(".","").replace(/^0*/,function(u){return a-=u.length,""}).replace(/0*$/,"").split("").map(function(u){return parseInt(u)});return s.length===0&&(s.push(0),a++),{sign:r,coefficients:s,exponent:a}}function yD(t,e){if(isNaN(t)||!isFinite(t))return String(t);var r=Mi(t),n=Cs(r,e),a=n.exponent,i=n.coefficients,s=a%3===0?a:a<0?a-3-a%3:a-a%3;if(qe(e))for(;e>i.length||a-s+1>i.length;)i.push(0);else for(var u=Math.abs(a-s)-(i.length-1),l=0;l<u;l++)i.push(0);for(var o=Math.abs(a-s),c=1;o>0;)c++,o--;var f=i.slice(c).join(""),d=qe(e)&&f.length||f.match(/[1-9]/)?"."+f:"",m=i.slice(0,c).join("")+d+"e"+(a>=0?"+":"")+s.toString();return n.sign+m}function Jf(t,e){if(isNaN(t)||!isFinite(t))return String(t);var r=Mi(t),n=typeof e=="number"?Cs(r,r.exponent+1+e):r,a=n.coefficients,i=n.exponent+1,s=i+(e||0);return a.length<s&&(a=a.concat(ka(s-a.length))),i<0&&(a=ka(-i+1).concat(a),i=1),i<a.length&&a.splice(i,0,i===0?"0.":"."),n.sign+a.join("")}function Qf(t,e){if(isNaN(t)||!isFinite(t))return String(t);var r=Mi(t),n=e?Cs(r,e):r,a=n.coefficients,i=n.exponent;a.length<e&&(a=a.concat(ka(e-a.length)));var s=a.shift();return n.sign+s+(a.length>0?"."+a.join(""):"")+"e"+(i>=0?"+":"")+i}function bD(t,e,r){if(isNaN(t)||!isFinite(t))return String(t);var n=ed(r?.lowerExp,-3),a=ed(r?.upperExp,5),i=Mi(t),s=e?Cs(i,e):i;if(s.exponent<n||s.exponent>=a)return Qf(t,e);var u=s.coefficients,l=s.exponent;u.length<e&&(u=u.concat(ka(e-u.length))),u=u.concat(ka(l-u.length+1+(u.length<e?e-u.length:0))),u=ka(-l).concat(u);var o=l>0?l:0;return o<u.length-1&&u.splice(o+1,0,"."),s.sign+u.join("")}function Cs(t,e){for(var r={sign:t.sign,coefficients:t.coefficients,exponent:t.exponent},n=r.coefficients;e<=0;)n.unshift(0),r.exponent++,e++;if(n.length>e){var a=n.splice(e,n.length-e);if(a[0]>=5){var i=e-1;for(n[i]++;n[i]===10;)n.pop(),i===0&&(n.unshift(0),r.exponent++,i++),i--,n[i]++}}return r}function ka(t){for(var e=[],r=0;r<t;r++)e.push(0);return e}function wD(t){return t.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length}function Zt(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e-8,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(r<=0)throw new Error("Relative tolerance must be greater than 0");if(n<0)throw new Error("Absolute tolerance must be at least 0");return isNaN(t)||isNaN(e)?!1:!isFinite(t)||!isFinite(e)?t===e:t===e?!0:Math.abs(t-e)<=Math.max(r*Math.max(Math.abs(t),Math.abs(e)),n)}var xD=Math.acosh||function(t){return Math.log(Math.sqrt(t*t-1)+t)},DD=Math.asinh||function(t){return Math.log(Math.sqrt(t*t+1)+t)},ED=Math.atanh||function(t){return Math.log((1+t)/(1-t))/2},AD=Math.cosh||function(t){return(Math.exp(t)+Math.exp(-t))/2},SD=Math.sinh||function(t){return(Math.exp(t)-Math.exp(-t))/2},ND=Math.tanh||function(t){var e=Math.exp(2*t);return(e-1)/(e+1)};function _D(t,e){var r=!0,n=e>0?!0:e<0?!1:1/e===1/0;return r^n?-t:t}function Kf(t,e){if(qe(t))return t;if(Qe(t))return t.toNumber();e()}function ed(t,e){return qe(t)?t:Qe(t)?t.toNumber():e}var td=function(){return td=_i.create,_i},CD=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],MD=U("typed",CD,function(e){var{BigNumber:r,Complex:n,DenseMatrix:a,Fraction:i}=e,s=td();return s.clear(),s.addTypes([{name:"number",test:qe},{name:"Complex",test:Wr},{name:"BigNumber",test:Qe},{name:"bigint",test:Fa},{name:"Fraction",test:ea},{name:"Unit",test:pr},{name:"identifier",test:u=>Rt&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFB
14D3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC4\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u
140EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC4\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE4
140-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(u)},{name:"string",test:Rt},{name:"Chain",test:Uu},{name:"Array",test:Dt},{name:"Matrix",test:ze},{name:"DenseMatrix",test:Ai},{name:"SparseMatrix",test:On},{name:"Range",test:_s},{name:"Index",test:Si},{name:"boolean",test:Mf},{name:"ResultSet",test:Tf},{name:"Help",test:$u},{name:"function",test:Pu},{name:"Date",test:Ff},{name:"RegExp",test:Of},{name:"null",test:Bf},{name:"undefined",test:kf}
vendor: 6,188 bytes, lines 14-20
14,{name:"AccessorNode",test:Bn},{name:"ArrayNode",test:Cr},{name:"AssignmentNode",test:If},{name:"BlockNode",test:Lf},{name:"ConditionalNode",test:Rf},{name:"ConstantNode",test:dt},{name:"FunctionNode",test:bn},{name:"FunctionAssignmentNode",test:Oa},{name:"IndexNode",test:na},{name:"Node",test:xt},{name:"ObjectNode",test:Ni},{name:"OperatorNode",test:Pt},{name:"ParenthesisNode",test:nn},{name:"RangeNode",test:$f},{name:"RelationalNode",test:Pf},{name:"SymbolNode",test:Ht},{name:"Map",test:ra},{name:"Object",test:ta}]),s.addConversions([{from:"number",to:"BigNumber",convert:function(l){if(r||Ms(l),wD(l)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+l+"). Use function bignumber(x) to convert to BigNumber.");return new r(l)}},{from:"number",to:"Complex",convert:function(l){return n||Ts(l),new n(l,0)}},{from:"BigNumber",to:"Complex",convert:function(l){return n||Ts(l),new n(l.toNumber(),0)}},{from:"bigint",to:"number",convert:function(l){if(l>Number.MAX_SAFE_INTEGER)throw new TypeError("Cannot implicitly convert bigint to number: value exceeds the max safe integer value (value: "+l+")");return Number(l)}},{from:"bigint",to:"BigNumber",convert:function(l){return r||Ms(l),new r(l.toString())}},{from:"bigint",to:"Fraction",convert:function(l){return i||Fs(l),new i(l)}},{from:"Fraction",to:"BigNumber",convert:function(l){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(l){return n||Ts(l),new n(l.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(l){i||Fs(l);var o=new i(l);if(o.valueOf()!==l)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+l+"). Use function fraction(x) to convert to Fraction.");return o}},{from:"string",to:"number",convert:function(l){var o=Number(l);if(isNaN(o))throw new Error('Cannot convert "'+l+'" to a number');return o}},{from:"string",to:"BigNumber",convert:function(l){r||Ms(l);try{return new r(l)}catch{throw new Error('Cannot convert "'+l+'" to BigNumber')}}},{from:"string",to:"bigint",convert:function(l){try{return BigInt(l)}catch{throw new Error('Cannot convert "'+l+'" to BigInt')}}},{from:"string",to:"Fraction",convert:function(l){i||Fs(l);try{return new i(l)}catch{throw new Error('Cannot convert "'+l+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(l){n||Ts(l);try{return new n(l)}catch{throw new Error('Cannot convert "'+l+'" to Complex')}}},{from:"boolean",to:"number",convert:function(l){return+l}},{from:"boolean",to:"BigNumber",convert:function(l){return r||Ms(l),new r(+l)}},{from:"boolean",to:"bigint",convert:function(l){return BigInt(+l)}},{from:"boolean",to:"Fraction",convert:function(l){return i||Fs(l),new i(+l)}},{from:"boolean",to:"string",convert:function(l){return String(l)}},{from:"Array",to:"Matrix",convert:function(l){return a||TD(),new a(l)}},{from:"Matrix",to:"Array",convert:function(l){return l.valueOf()}}]),s.onMismatch=(u,l,o)=>{var c=s.createError(u,l,o);if(["wrongType","mismatch"].includes(c.data.category)&&l.length===1&&wr(l[0])&&o.some(d=>!d.params.includes(","))){var f=new TypeError("Function '".concat(u,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(u,")'."));throw f.data=c.data,f}throw c},s.onMismatch=(u,l,o)=>{var c=s.createError(u,l,o);if(["wrongType","mismatch"].includes(c.data.category)&&l.length===1&&wr(l[0])&&o.some(d=>!d.params.includes(","))){var f=new TypeError("Function '".concat(u,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(u,")'."));throw f.data=c.data,f}throw c},s});function Ms(t){throw new Error("Cannot convert value ".concat(t," into a BigNumber: no class 'BigNumber' provided"))}function Ts(t){throw new Error("Cannot convert value ".concat(t," into a Complex number: no class 'Complex' provided"))}function TD(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function Fs(t){throw new Error("Cannot convert value ".concat(t," into a Fraction, no class 'Fraction' provided."))}var FD="ResultSet",OD=[],BD=U(FD,OD,()=>{function t(e){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");this.entries=e||[]}return t.prototype.type="ResultSet",t.prototype.isResultSet=!0,t.prototype.valueOf=function(){return this.entries},t.prototype.toString=function(){return"["+this.entries.map(String).join(", ")+"]"},t.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},t.fromJSON=function(e){return new t(e.entries)},t},{isClass:!0});/*! 15 * decimal.js v10.6.0 16 * An arbitrary-precision Decimal type for JavaScript. 17 * https://github.com/MikeMcl/decimal.js 18 * Copyright (c) 2025 Michael Mclaughlin <[email protected]> 19 * MIT Licence 20 */var Ia=9e15,Ln=1e9,Yu="0123456789abcdef",Os="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Bs="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823
20066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Vu={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Ia,maxE:Ia,crypto:!1},rd,xn,tt=!0,ks="[DecimalError] ",Rn=ks+"Invalid argument: ",nd=ks+"Precision limit exceeded",ad=ks+"crypto unavailable",id="[object Decimal]",or=Math.floor,Wt=Math.pow,kD=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,ID=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,LD=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,sd=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Gr=1e7,Xe=7,RD=9007199254740991,$D=Os.length-1,Hu=Bs.length-1,Se={toStringTag:id};Se.absoluteValue=Se.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),Ye(t)},Se.ceil=function(){return Ye(new this.constructor(this),this.e+1,2)},Se.clampedTo=Se.clamp=function(t,e){var r,n=this,a=n.constructor;if(t=new a(t),e=new a(e),!t.s||!e.s)return new a(NaN);if(t.gt(e))throw Error(Rn+e);return r=n.cmp(t),r<0?t:n.cmp(e)>0?e:new a(n)},Se.comparedTo=Se.cmp=function(t){var e,r,n,a,i=this,s=i.d,u=(t=new i.constructor(t)).d,l=i.s,o=t.s;if(!s||!u)return!l||!o?NaN:l!==o?l:s===u?0:!s^l<0?1:-1;if(!s[0]||!u[0])return s[0]?l:u[0]?-o:0;if(l!==o)return l;if(i.e!==t.e)return i.e>t.e^l<0?1:-1;for(n=s.length,a=u.length,e=0,r=n<a?n:a;e<r;++e)if(s[e]!==u[e])return s[e]>u[e]^l<0?1:-1;return n===a?0:n>a^l<0?1:-1},Se.cosine=Se.cos=function(){var t,e,r=this,n=r.constructor;return r.d?r.d[0]?(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+Xe,n.rounding=1,r=PD(n,dd(n,r)),n.precision=t,n.rounding=e,Ye(xn==2||xn==3?r.neg():r,t,e,!0)):new n(1):new n(NaN)},Se.cubeRoot=Se.cbrt=function(){var t,e,r,n,a,i,s,u,l,o,c=this,f=c.constructor;if(!c.isFinite()||c.isZero())return new f(c);for(tt=!1,i=c.s*Wt(c.s*c,1/3),!i||Math.abs(i)==1/0?(r=er(c.d),t=c.e,(i=(t-r.length+1)%3)&&(r+=i==1||i==-2?"0":"00"),i=Wt(r,1/3),t=or((t+1)/3)-(t%3==(t<0?-1:2)),i==1/0?r="5e"+t:(r=i.toExponential(),r=r.slice(0,r.indexOf("e")+1)+t),n=new f(r),n.s=c.s):n=new f(i.toString()),s=(t=f.precision)+3;;)if(u=n,l=u.times(u).times(u),o=l.plus(c),n=Tt(o.plus(c).times(u),o.plus(l),s+2,1),er(u.d).slice(0,s)===(r=er(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!a&&r=="4999"){if(!a&&(Ye(u,t+1,0),u.times(u).times(u).eq(c))){n=u;break}s+=4,a=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(Ye(n,t+1,1),e=!n.times(n).times(n).eq(c));break}return tt=!0,Ye(n,t,f.rounding,e)},Se.decimalPlaces=Se.dp=function(){var t,e=this.d,r=NaN;if(e){if(t=e.length-1,r=(t-or(this.e/Xe))*Xe,t=e[t],t)for(;t%10==0;t/=10)r--;r<0&&(r=0)}return r},Se.dividedBy=Se.div=function(t){return Tt(this,new this.constructor(t))},Se.dividedToIntegerBy=Se.divToInt=function(t){var e=this,r=e.constructor;return Ye(Tt(e,new r(t),0,1,1),r.precision,r.rounding)},Se.equals=Se.eq=function(t){return this.cmp(t)===0},Se.floor=function(){return Ye(new this.constructor(this),this.e+1,3)},Se.greaterThan=Se.gt=function(t){return this.cmp(t)>0},Se.greaterThanOrEqualTo=Se.gte=function(t){var e=this.cmp(t);return e==1||e===0},Se.hyperbolicCosine=Se.cosh=function(){var t,e,r,n,a,i=this,s=i.constructor,u=new s(1);if(!i.isFinite())return new s(i.s?1/0:NaN);if(i.isZero())return u;r=s.precision,n=s.rounding,s.precision=r+Math.max(i.e,i.sd())+4,s.rounding=1,a=i.d.length,a<32?(t=Math.ceil(a/3),e=(1/Ps(4,t)).toString()):(t=16,e="2.3283064365386962890625e-10"),i=La(s,1,i.times(e),new s(1),!0);for(var l,o=t,c=new s(8);o--;)l=i.times(i),i=u.minus(l.times(c.minus(l.times(c))));return Ye(i,s.precision=r,s.rounding=n,!0)},Se.hyperbolicSine=Se.sinh=function(){var t,e,r,n,a=this,i=a.constructor;if(!a.isFinite()||a.isZero())return new i(a);if(e=i.precision,r=i.rounding,i.precision=e+Math.max(a.e,a.sd())+4,i.rounding=1,n=a.d.length,n<3)a=La(i,2,a,a,!0);else{t=1.4*Math.sqrt(n),t=t>16?16:t|0,a=a.times(1/Ps(5,t)),a=La(i,2,a,a,!0);for(var s,u=new i(5),l=new i(16),o=new i(20);t--;
vendor: 11,617 bytes, line 20
20)s=a.times(a),a=a.times(u.plus(s.times(l.times(s).plus(o))))}return i.precision=e,i.rounding=r,Ye(a,e,r,!0)},Se.hyperbolicTangent=Se.tanh=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+7,n.rounding=1,Tt(r.sinh(),r.cosh(),n.precision=t,n.rounding=e)):new n(r.s)},Se.inverseCosine=Se.acos=function(){var t=this,e=t.constructor,r=t.abs().cmp(1),n=e.precision,a=e.rounding;return r!==-1?r===0?t.isNeg()?sn(e,n,a):new e(0):new e(NaN):t.isZero()?sn(e,n+4,a).times(.5):(e.precision=n+6,e.rounding=1,t=new e(1).minus(t).div(t.plus(1)).sqrt().atan(),e.precision=n,e.rounding=a,t.times(2))},Se.inverseHyperbolicCosine=Se.acosh=function(){var t,e,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(t=n.precision,e=n.rounding,n.precision=t+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,tt=!1,r=r.times(r).minus(1).sqrt().plus(r),tt=!0,n.precision=t,n.rounding=e,r.ln()):new n(r)},Se.inverseHyperbolicSine=Se.asinh=function(){var t,e,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,tt=!1,r=r.times(r).plus(1).sqrt().plus(r),tt=!0,n.precision=t,n.rounding=e,r.ln())},Se.inverseHyperbolicTangent=Se.atanh=function(){var t,e,r,n,a=this,i=a.constructor;return a.isFinite()?a.e>=0?new i(a.abs().eq(1)?a.s/0:a.isZero()?a:NaN):(t=i.precision,e=i.rounding,n=a.sd(),Math.max(n,t)<2*-a.e-1?Ye(new i(a),t,e,!0):(i.precision=r=n-a.e,a=Tt(a.plus(1),new i(1).minus(a),r+t,1),i.precision=t+4,i.rounding=1,a=a.ln(),i.precision=t,i.rounding=e,a.times(.5))):new i(NaN)},Se.inverseSine=Se.asin=function(){var t,e,r,n,a=this,i=a.constructor;return a.isZero()?new i(a):(e=a.abs().cmp(1),r=i.precision,n=i.rounding,e!==-1?e===0?(t=sn(i,r+4,n).times(.5),t.s=a.s,t):new i(NaN):(i.precision=r+6,i.rounding=1,a=a.div(new i(1).minus(a.times(a)).sqrt().plus(1)).atan(),i.precision=r,i.rounding=n,a.times(2)))},Se.inverseTangent=Se.atan=function(){var t,e,r,n,a,i,s,u,l,o=this,c=o.constructor,f=c.precision,d=c.rounding;if(o.isFinite()){if(o.isZero())return new c(o);if(o.abs().eq(1)&&f+4<=Hu)return s=sn(c,f+4,d).times(.25),s.s=o.s,s}else{if(!o.s)return new c(NaN);if(f+4<=Hu)return s=sn(c,f+4,d).times(.5),s.s=o.s,s}for(c.precision=u=f+10,c.rounding=1,r=Math.min(28,u/Xe+2|0),t=r;t;--t)o=o.div(o.times(o).plus(1).sqrt().plus(1));for(tt=!1,e=Math.ceil(u/Xe),n=1,l=o.times(o),s=new c(o),a=o;t!==-1;)if(a=a.times(l),i=s.minus(a.div(n+=2)),a=a.times(l),s=i.plus(a.div(n+=2)),s.d[e]!==void 0)for(t=e;s.d[t]===i.d[t]&&t--;);return r&&(s=s.times(2<<r-1)),tt=!0,Ye(s,c.precision=f,c.rounding=d,!0)},Se.isFinite=function(){return!!this.d},Se.isInteger=Se.isInt=function(){return!!this.d&&or(this.e/Xe)>this.d.length-2},Se.isNaN=function(){return!this.s},Se.isNegative=Se.isNeg=function(){return this.s<0},Se.isPositive=Se.isPos=function(){return this.s>0},Se.isZero=function(){return!!this.d&&this.d[0]===0},Se.lessThan=Se.lt=function(t){return this.cmp(t)<0},Se.lessThanOrEqualTo=Se.lte=function(t){return this.cmp(t)<1},Se.logarithm=Se.log=function(t){var e,r,n,a,i,s,u,l,o=this,c=o.constructor,f=c.precision,d=c.rounding,m=5;if(t==null)t=new c(10),e=!0;else{if(t=new c(t),r=t.d,t.s<0||!r||!r[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(r=o.d,o.s<0||!r||!r[0]||o.eq(1))return new c(r&&!r[0]?-1/0:o.s!=1?NaN:r?0:1/0);if(e)if(r.length>1)i=!0;else{for(a=r[0];a%10===0;)a/=10;i=a!==1}if(tt=!1,u=f+m,s=Pn(o,u),n=e?Rs(c,u+10):Pn(t,u),l=Tt(s,n,u,1),Ti(l.d,a=f,d))do if(u+=10,s=Pn(o,u),n=e?Rs(c,u+10):Pn(t,u),l=Tt(s,n,u,1),!i){+er(l.d).slice(a+1,a+15)+1==1e14&&(l=Ye(l,f+1,0));break}while(Ti(l.d,a+=10,d));return tt=!0,Ye(l,f,d)},Se.minus=Se.sub=function(t){var e,r,n,a,i,s,u,l,o,c,f,d,m=this,h=m.constructor;if(t=new h(t),!m.d||!t.d)return!m.s||!t.s?t=new h(NaN):m.d?t.s=-t.s:t=new h(t.d||m.s!==t.s?m:NaN),t;if(m.s!=t.s)return t.s=-t.s,m.plus(t);if(o=m.d,d=t.d,u=h.precision,l=h.rounding,!o[0]||!d[0]){if(d[0])t.s=-t.s;else if(o[0])t=new h(m);else return new h(l===3?-0:0);return tt?Ye(t,u,l):t}if(r=or(t.e/Xe),c=or(m.e/Xe),o=o.slice(),i=c-r,i){for(f=i<0,f?(e=o,i=-i,s=d.length):(e=d,r=c,s=o.length),n=Math.max(Math.ceil(u/Xe),s)+2,i>n&&(i=n,e.length=1),e.reverse(),n=i;n--;)e.push(0);e.reverse()}else{for(n=o.length,s=d.length,f=n<s,f&&(s=n),n=0;n<s;n++)if(o[n]!=d[n]){f=o[n]<d[n];break}i=0}for(f&&(e=o,o=d,d=e,t.s=-t.s),s=o.length,n=d.length-s;n>0;--n)o[s++]=0;for(n=d.length;n>i;){if(o[--n]<d[n]){for(a=n;a&&o[--a]===0;)o[a]=Gr-1;--o[a],o[n]+=Gr}o[n]-=d[n]}for(;o[--s]===0;)o.pop();for(;o[0]===0;o.shift())--r;return o[0]?(t.d=o,t.e=Ls(o,r),tt?Ye(t,u,l):t):new h(l===3?-0:0)},Se.modulo=Se.mod=function(t){var e,r=this,n=r.constructor;return t=new n(t),!r.d||!t.s||t.d&&!t.d[0]?new n(NaN):!t.d||r.d&&!r.d[0]?Ye(new n(r),n.precision,n.rounding):(tt=!1,n.modulo==9?(e=Tt(r,t.abs(),0,3,1),e.s*=t.s):e=Tt(r,t,0,n.modulo,1),e=e.times(t),tt=!0,r.minus(e))},Se.naturalExponential=Se.exp=function(){return Wu(this)},Se.naturalLogarithm=Se.ln=function(){return Pn(this)},Se.negated=Se.neg=function(){var t=new this.constructor(this);return t.s=-t.s,Ye(t)},Se.plus=Se.add=function(t){var e,r,n,a,i,s,u,l,o,c,f=this,d=f.constructor;if(t=new d(t),!f.d||!t.d)return!f.s||!t.s?t=new d(NaN):f.d||(t=new d(t.d||f.s===t.s?f:NaN)),t;if(f.s!=t.s)return t.s=-t.s,f.minus(t);if(o=f.d,c=t.d,u=d.precision,l=d.rounding,!o[0]||!c[0])return c[0]||(t=new d(f)),tt?Ye(t,u,l):t;if(i=or(f.e/Xe),n=or(t.e/Xe),o=o.slice(),a=i-n,a){for(a<0?(r=o,a=-a,s=c.length):(r=c,n=i,s=o.length),i=Math.ceil(u/Xe),s=i>s?i+1:s+1,a>s&&(a=s,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(s=o.length,a=c.length,s-a<0&&(a=s,r=c,c=o,o=r),e=0;a;)e=(o[--a]=o[a]+c[a]+e)/Gr|0,o[a]%=Gr;for(e&&(o.unshift(e),++n),s=o.length;o[--s]==0;)o.pop();return t.d=o,t.e=Ls(o,n),tt?Ye(t,u,l):t},Se.precision=Se.sd=function(t){var e,r=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(Rn+t);return r.d?(e=od(r.d),t&&r.e+1>e&&(e=r.e+1)):e=NaN,e},Se.round=function(){var t=this,e=t.constructor;return Ye(new e(t),t.e+1,e.rounding)},Se.sine=Se.sin=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+Xe,n.rounding=1,r=UD(n,dd(n,r)),n.precision=t,n.rounding=e,Ye(xn>2?r.neg():r,t,e,!0)):new n(NaN)},Se.squareRoot=Se.sqrt=function(){var t,e,r,n,a,i,s=this,u=s.d,l=s.e,o=s.s,c=s.constructor;if(o!==1||!u||!u[0])return new c(!o||o<0&&(!u||u[0])?NaN:u?s:1/0);for(tt=!1,o=Math.sqrt(+s),o==0||o==1/0?(e=er(u),(e.length+l)%2==0&&(e+="0"),o=Math.sqrt(e),l=or((l+1)/2)-(l<0||l%2),o==1/0?e="5e"+l:(e=o.toExponential(),e=e.slice(0,e.indexOf("e")+1)+l),n=new c(e)):n=new c(o.toString()),r=(l=c.precision)+3;;)if(i=n,n=i.plus(Tt(s,i,r+2,1)).times(.5),er(i.d).slice(0,r)===(e=er(n.d)).slice(0,r))if(e=e.slice(r-3,r+1),e=="9999"||!a&&e=="4999"){if(!a&&(Ye(i,l+1,0),i.times(i).eq(s))){n=i;break}r+=4,a=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(Ye(n,l+1,1),t=!n.times(n).eq(s));break}return tt=!0,Ye(n,l,c.rounding,t)},Se.tangent=Se.tan=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+10,n.rounding=1,r=r.sin(),r.s=1,r=Tt(r,new n(1).minus(r.times(r)).sqrt(),t+10,0),n.precision=t,n.rounding=e,Ye(xn==2||xn==4?r.neg():r,t,e,!0)):new n(NaN)},Se.times=Se.mul=function(t){var e,r,n,a,i,s,u,l,o,c=this,f=c.constructor,d=c.d,m=(t=new f(t)).d;if(t.s*=c.s,!d||!d[0]||!m||!m[0])return new f(!t.s||d&&!d[0]&&!m||m&&!m[0]&&!d?NaN:!d||!m?t.s/0:t.s*0);for(r=or(c.e/Xe)+or(t.e/Xe),l=d.length,o=m.length,l<o&&(i=d,d=m,m=i,s=l,l=o,o=s),i=[],s=l+o,n=s;n--;)i.push(0);for(n=o;--n>=0;){for(e=0,a=l+n;a>n;)u=i[a]+m[n]*d[a-n-1]+e,i[a--]=u%Gr|0,e=u/Gr|0;i[a]=(i[a]+e)%Gr|0}for(;!i[--s];)i.pop();return e?++r:i.shift(),t.d=i,t.e=Ls(i,r),tt?Ye(t,f.precision,f.rounding):t},Se.toBinary=function(t,e){return Gu(this,2,t,e)},Se.toDecimalPlaces=Se.toDP=function(t,e){var r=this,n=r.constructor;return r=new n(r),t===void 0?r:(xr(t,0,Ln),e===void 0?e=n.rounding:xr(e,0,8),Ye(r,t+r.e+1,e))},Se.toExponential=function(t,e){var r,n=this,a=n.constructor;return t===void 0?r=an(n,!0):(xr(t,0,Ln),e===void 0?e=a.rounding:xr(e,0,8),n=Ye(new a(n),t+1,e),r=an(n,!0,t+1)),n.isNeg()&&!n.isZero()?"-"+r:r},Se.toFixed=function(t,e){var r,n,a=this,i=a.constructor;return t===void 0?r=an(a):(xr(t,0,Ln),e===void 0?e=i.rounding:xr(e,0,8),n=Ye(new i(a),t+a.e+1,e),r=an(n,!1,t+n.e+1)),a.isNeg()&&!a.isZero()?"-"+r:r},Se.toFraction=function(t){var e,r,n,a,i,s,u,l,o,c,f,d,m=this,h=m.d,p=m.constructor;if(!h)return new p(m);if(o=r=new p(1),n=l=new p(0),e=new p(n),i=e.e=od(h)-m.e-1,s=i%Xe,e.d[0]=Wt(10,s<0?Xe+s:s),t==null)t=i>0?e:o;else{if(u=new p(t),!u.isInt()||u.lt(o))throw Error(Rn+u);t=u.gt(e)?i>0?e:o:u}for(tt=!1,u=new p(er(h)),c=p.precision,p.precision=i=h.length*Xe*2;f=Tt(u,e,0,1,1),a=r.plus(f.times(n)),a.cmp(t)!=1;)r=n,n=a,a=o,o=l.plus(f.times(a)),l=a,a=e,e=u.minus(f.times(a)),u=a;return a=Tt(t.minus(r),n,0,1,1),l=l.plus(a.times(o)),r=r.plus(a.times(n)),l.s=o.s=m.s,d=Tt(o,n,i,1).minus(m).abs().cmp(Tt(l,r,i,1).minus(m).abs())<1?[o,n]:[l,r],p.precision=c,tt=!0,d},Se.toHexadecimal=Se.toHex=function(t,e){return Gu(this,16,t,e)},Se.toNearest=function(t,e){var r=this,n=r.constructor;if(r=new n(r),t==null){if(!r.d)return r;t=new n(1),e=n.rounding}else{if(t=new n(t),e===void 0?e=n.rounding:xr(e,0,8),!r.d)return t.s?r:t;if(!t.d)return t.s&&(t.s=r.s),t}return t.d[0]?(tt=!1,r=Tt(r,t,0,e,1).times(t),tt=!0,Ye(r)):(t.s=r.s,r=t),r},Se.toNumber=function(){return+this},Se.toOctal=function(t,e){return Gu(this,8,t,e)},Se.toPower=Se.pow=function(t){var e,r,n,a,i,s,u=this,l=u.constructor,o=+(t=new l(t));if(!u.d||!t.d||!u.d[0]||!t.d[0])return new l(Wt(+u,o));if(u=new l(u),u.eq(1))return u;if(n=l.precision,i=l.rounding,t.eq(1))return Ye(u,n,i);if(e=or(t.e/Xe),e>=t.d.length-1&&(r=o<0?-o:o)<=RD)return a=ud(l,u,r,n),t.s<0?new l(1).div(a):Ye(a,n,i);if(s=u.s,s<0){if(e<t.d.length-1)return new l(NaN);if((t.d[e]&1)==0&&(s=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=s,u}return r=Wt(+u,o),e=r==0||!isFinite(r)?or(o*(Math.log("0."+er(u.d))/Math.LN10+u.e+1)):new l(r+"").e,e>l.maxE+1||e<l.minE-1?new l(e>0?s/0:0):(tt=!1,l.rounding=u.s=1,r=Math.min(12,(e+"").length),a=Wu(t.times(Pn(u,n+r)),n),a.d&&(a=Ye(a,n+5,1),Ti(a.d,n,i)&&(e=n+10,a=Ye(Wu(t.times(Pn(u,e+r)),e),e+5,1),+er(a.d).slice(n+1,n+15)+1==1e14&&(a=Ye(a,n+1,0)))),a.s=s,tt=!0,l.rounding=i,Ye(a,n,i))},Se.toPrecision=function(t,e){var r,n=this,a=n.constructor;return t===void 0?r=an(n,n.e<=a.toExpNeg||n.e>=a.toExpPos):(xr(t,1,Ln),e===void 0?e=a.rounding:xr(e,0,8),n=Ye(new a(n),t,e),r=an(n,t<=n.e||n.e<=a.toExpNeg,t)),n.isNeg()&&!n.isZero()?"-"+r:r},Se.toSignificantDigits=Se.toSD=function(t,e){var r=this,n=r.constructor;return t===void 0?(t=n.precision,e=n.rounding):(xr(t,1,Ln),e===void 0?e=n.rounding:xr(e,0,8)),Ye(new n(r),t,e)},Se.toString=function(){var t=this,e=t.constructor,r=an(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+r:r},Se.truncated=Se.trunc=function(){return Ye(new this.constructor(this),this.e+1,1)},Se.valueOf=Se.toJSON=function(){var t=this,e=t.constructor,r=an(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+r:r};function er(t){var e,r,n,a=t.length-1,i="",s=t[0];if(a>0){for(i+=s,e=1;e<a;e++)n=t[e]+"",r=Xe-n.length,r&&(i+=$n(r)),i+=n;s=t[e],n=s+"",r=Xe-n.length,r&&(i+=$n(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return i+s}function xr(t,e,r){if(t!==~~t||t<e||t>r)throw Error(Rn+t)}function Ti(t,e,r,n){var a,i,s,u;for(i=t[0];i>=10;i/=10)--e;return--e<0?(e+=Xe,a=0):(a=Math.ceil((e+1)/Xe),e%=Xe),i=Wt(10,Xe-e),u=t[a]%i|0,n==null?e<3?(e==0?u=u/100|0:e==1&&(u=u/10|0),s=r<4&&u==99999||r>
vendor: 4,286 bytes, line 20
203&&u==49999||u==5e4||u==0):s=(r<4&&u+1==i||r>3&&u+1==i/2)&&(t[a+1]/i/100|0)==Wt(10,e-2)-1||(u==i/2||u==0)&&(t[a+1]/i/100|0)==0:e<4?(e==0?u=u/1e3|0:e==1?u=u/100|0:e==2&&(u=u/10|0),s=(n||r<4)&&u==9999||!n&&r>3&&u==4999):s=((n||r<4)&&u+1==i||!n&&r>3&&u+1==i/2)&&(t[a+1]/i/1e3|0)==Wt(10,e-3)-1,s}function Is(t,e,r){for(var n,a=[0],i,s=0,u=t.length;s<u;){for(i=a.length;i--;)a[i]*=e;for(a[0]+=Yu.indexOf(t.charAt(s++)),n=0;n<a.length;n++)a[n]>r-1&&(a[n+1]===void 0&&(a[n+1]=0),a[n+1]+=a[n]/r|0,a[n]%=r)}return a.reverse()}function PD(t,e){var r,n,a;if(e.isZero())return e;n=e.d.length,n<32?(r=Math.ceil(n/3),a=(1/Ps(4,r)).toString()):(r=16,a="2.3283064365386962890625e-10"),t.precision+=r,e=La(t,1,e.times(a),new t(1));for(var i=r;i--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return t.precision-=r,e}var Tt=function(){function t(n,a,i){var s,u=0,l=n.length;for(n=n.slice();l--;)s=n[l]*a+u,n[l]=s%i|0,u=s/i|0;return u&&n.unshift(u),n}function e(n,a,i,s){var u,l;if(i!=s)l=i>s?1:-1;else for(u=l=0;u<i;u++)if(n[u]!=a[u]){l=n[u]>a[u]?1:-1;break}return l}function r(n,a,i,s){for(var u=0;i--;)n[i]-=u,u=n[i]<a[i]?1:0,n[i]=u*s+n[i]-a[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,a,i,s,u,l){var o,c,f,d,m,h,p,g,v,D,y,x,w,b,A,S,E,N,_,C,O=n.constructor,I=n.s==a.s?1:-1,k=n.d,M=a.d;if(!k||!k[0]||!M||!M[0])return new O(!n.s||!a.s||(k?M&&k[0]==M[0]:!M)?NaN:k&&k[0]==0||!M?I*0:I/0);for(l?(m=1,c=n.e-a.e):(l=Gr,m=Xe,c=or(n.e/m)-or(a.e/m)),_=M.length,E=k.length,v=new O(I),D=v.d=[],f=0;M[f]==(k[f]||0);f++);if(M[f]>(k[f]||0)&&c--,i==null?(b=i=O.precision,s=O.rounding):u?b=i+(n.e-a.e)+1:b=i,b<0)D.push(1),h=!0;else{if(b=b/m+2|0,f=0,_==1){for(d=0,M=M[0],b++;(f<E||d)&&b--;f++)A=d*l+(k[f]||0),D[f]=A/M|0,d=A%M|0;h=d||f<E}else{for(d=l/(M[0]+1)|0,d>1&&(M=t(M,d,l),k=t(k,d,l),_=M.length,E=k.length),S=_,y=k.slice(0,_),x=y.length;x<_;)y[x++]=0;C=M.slice(),C.unshift(0),N=M[0],M[1]>=l/2&&++N;do d=0,o=e(M,y,_,x),o<0?(w=y[0],_!=x&&(w=w*l+(y[1]||0)),d=w/N|0,d>1?(d>=l&&(d=l-1),p=t(M,d,l),g=p.length,x=y.length,o=e(p,y,g,x),o==1&&(d--,r(p,_<g?C:M,g,l))):(d==0&&(o=d=1),p=M.slice()),g=p.length,g<x&&p.unshift(0),r(y,p,x,l),o==-1&&(x=y.length,o=e(M,y,_,x),o<1&&(d++,r(y,_<x?C:M,x,l))),x=y.length):o===0&&(d++,y=[0]),D[f++]=d,o&&y[0]?y[x++]=k[S]||0:(y=[k[S]],x=1);while((S++<E||y[0]!==void 0)&&b--);h=y[0]!==void 0}D[0]||D.shift()}if(m==1)v.e=c,rd=h;else{for(f=1,d=D[0];d>=10;d/=10)f++;v.e=f+c*m-1,Ye(v,u?i+v.e+1:i,s,h)}return v}}();function Ye(t,e,r,n){var a,i,s,u,l,o,c,f,d,m=t.constructor;e:if(e!=null){if(f=t.d,!f)return t;for(a=1,u=f[0];u>=10;u/=10)a++;if(i=e-a,i<0)i+=Xe,s=e,c=f[d=0],l=c/Wt(10,a-s-1)%10|0;else if(d=Math.ceil((i+1)/Xe),u=f.length,d>=u)if(n){for(;u++<=d;)f.push(0);c=l=0,a=1,i%=Xe,s=i-Xe+1}else break e;else{for(c=u=f[d],a=1;u>=10;u/=10)a++;i%=Xe,s=i-Xe+a,l=s<0?0:c/Wt(10,a-s-1)%10|0}if(n=n||e<0||f[d+1]!==void 0||(s<0?c:c%Wt(10,a-s-1)),o=r<4?(l||n)&&(r==0||r==(t.s<0?3:2)):l>5||l==5&&(r==4||n||r==6&&(i>0?s>0?c/Wt(10,a-s):0:f[d-1])%10&1||r==(t.s<0?8:7)),e<1||!f[0])return f.length=0,o?(e-=t.e+1,f[0]=Wt(10,(Xe-e%Xe)%Xe),t.e=-e||0):f[0]=t.e=0,t;if(i==0?(f.length=d,u=1,d--):(f.length=d+1,u=Wt(10,Xe-i),f[d]=s>0?(c/Wt(10,a-s)%Wt(10,s)|0)*u:0),o)for(;;)if(d==0){for(i=1,s=f[0];s>=10;s/=10)i++;for(s=f[0]+=u,u=1;s>=10;s/=10)u++;i!=u&&(t.e++,f[0]==Gr&&(f[0]=1));break}else{if(f[d]+=u,f[d]!=Gr)break;f[d--]=0,u=1}for(i=f.length;f[--i]===0;)f.pop()}return tt&&(t.e>m.maxE?(t.d=null,t.e=NaN):t.e<m.minE&&(t.e=0,t.d=[0])),t}function an(t,e,r){if(!t.isFinite())return fd(t);var n,a=t.e,i=er(t.d),s=i.length;return e?(r&&(n=r-s)>0?i=i.charAt(0)+"."+i.slice(1)+$n(n):s>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(t.e<0?"e":"e+")+t.e):a<0?(i="0."+$n(-a-1)+i,r&&(n=r-s)>0&&(i+=$n(n))):a>=s?(i+=$n(a+1-s),r&&(n=r-a-1)>0&&(i=i+"."+$n(n))):((n=a+1)<s&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-s)>0&&(a+1===s&&(i+="."),i+=$n(n))),i}function Ls(t,e){var r=t[0];for(e*=Xe;r>=10;r/=10)e++;return e}function Rs(t,e,r){if(e>$D)throw tt=!0,r&&(t.precision=r),Error(nd);return Ye(new t(Os),e,1,!0)}function sn(t,e,r){if(e>Hu)throw Error(nd);return Ye(new t(Bs),e,r,!0)}function od(t){var e=t.length-1,r=e*Xe+1;if(e=t[e],e){for(;e%10==0;e/=10)r--;for(e=t[0];e>=10;e/=10)r++}return r}function $n(t){for(var e="";t--;)e+="0";return e}function ud(t,e,r,n){var a,i=new t(1),s=Math.ceil(n/Xe+4);for(tt=!1;;
vendor: 6,007 bytes, line 20
20){if(r%2&&(i=i.times(e),md(i.d,s)&&(a=!0)),r=or(r/2),r===0){r=i.d.length-1,a&&i.d[r]===0&&++i.d[r];break}e=e.times(e),md(e.d,s)}return tt=!0,i}function ld(t){return t.d[t.d.length-1]&1}function cd(t,e,r){for(var n,a,i=new t(e[0]),s=0;++s<e.length;){if(a=new t(e[s]),!a.s){i=a;break}n=i.cmp(a),(n===r||n===0&&i.s===r)&&(i=a)}return i}function Wu(t,e){var r,n,a,i,s,u,l,o=0,c=0,f=0,d=t.constructor,m=d.rounding,h=d.precision;if(!t.d||!t.d[0]||t.e>17)return new d(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(e==null?(tt=!1,l=h):l=e,u=new d(.03125);t.e>-2;)t=t.times(u),f+=5;for(n=Math.log(Wt(2,f))/Math.LN10*2+5|0,l+=n,r=i=s=new d(1),d.precision=l;;){if(i=Ye(i.times(t),l,1),r=r.times(++c),u=s.plus(Tt(i,r,l,1)),er(u.d).slice(0,l)===er(s.d).slice(0,l)){for(a=f;a--;)s=Ye(s.times(s),l,1);if(e==null)if(o<3&&Ti(s.d,l-n,m,o))d.precision=l+=10,r=i=u=new d(1),c=0,o++;else return Ye(s,d.precision=h,m,tt=!0);else return d.precision=h,s}s=u}}function Pn(t,e){var r,n,a,i,s,u,l,o,c,f,d,m=1,h=10,p=t,g=p.d,v=p.constructor,D=v.rounding,y=v.precision;if(p.s<0||!g||!g[0]||!p.e&&g[0]==1&&g.length==1)return new v(g&&!g[0]?-1/0:p.s!=1?NaN:g?0:p);if(e==null?(tt=!1,c=y):c=e,v.precision=c+=h,r=er(g),n=r.charAt(0),Math.abs(i=p.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(t),r=er(p.d),n=r.charAt(0),m++;i=p.e,n>1?(p=new v("0."+r),i++):p=new v(n+"."+r.slice(1))}else return o=Rs(v,c+2,y).times(i+""),p=Pn(new v(n+"."+r.slice(1)),c-h).plus(o),v.precision=y,e==null?Ye(p,y,D,tt=!0):p;for(f=p,l=s=p=Tt(p.minus(1),p.plus(1),c,1),d=Ye(p.times(p),c,1),a=3;;){if(s=Ye(s.times(d),c,1),o=l.plus(Tt(s,new v(a),c,1)),er(o.d).slice(0,c)===er(l.d).slice(0,c))if(l=l.times(2),i!==0&&(l=l.plus(Rs(v,c+2,y).times(i+""))),l=Tt(l,new v(m),c,1),e==null)if(Ti(l.d,c-h,D,u))v.precision=c+=h,o=s=p=Tt(f.minus(1),f.plus(1),c,1),d=Ye(p.times(p),c,1),a=u=1;else return Ye(l,v.precision=y,D,tt=!0);else return v.precision=y,l;l=o,a+=2}}function fd(t){return String(t.s*t.s/0)}function $s(t,e){var r,n,a;for((r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),n=0;e.charCodeAt(n)===48;n++);for(a=e.length;e.charCodeAt(a-1)===48;--a);if(e=e.slice(n,a),e){if(a-=n,t.e=r=r-n-1,t.d=[],n=(r+1)%Xe,r<0&&(n+=Xe),n<a){for(n&&t.d.push(+e.slice(0,n)),a-=Xe;n<a;)t.d.push(+e.slice(n,n+=Xe));e=e.slice(n),n=Xe-e.length}else n-=a;for(;n--;)e+="0";t.d.push(+e),tt&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function qD(t,e){var r,n,a,i,s,u,l,o,c;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),sd.test(e))return $s(t,e)}else if(e==="Infinity"||e==="NaN")return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(ID.test(e))r=16,e=e.toLowerCase();else if(kD.test(e))r=2;else if(LD.test(e))r=8;else throw Error(Rn+e);for(i=e.search(/p/i),i>0?(l=+e.slice(i+1),e=e.substring(2,i)):e=e.slice(2),i=e.indexOf("."),s=i>=0,n=t.constructor,s&&(e=e.replace(".",""),u=e.length,i=u-i,a=ud(n,new n(r),i,i*2)),o=Is(e,r,Gr),c=o.length-1,i=c;o[i]===0;--i)o.pop();return i<0?new n(t.s*0):(t.e=Ls(o,c),t.d=o,tt=!1,s&&(t=Tt(t,a,u*4)),l&&(t=t.times(Math.abs(l)<54?Wt(2,l):qn.pow(2,l))),tt=!0,t)}function UD(t,e){var r,n=e.d.length;if(n<3)return e.isZero()?e:La(t,2,e,e);r=1.4*Math.sqrt(n),r=r>16?16:r|0,e=e.times(1/Ps(5,r)),e=La(t,2,e,e);for(var a,i=new t(5),s=new t(16),u=new t(20);r--;)a=e.times(e),e=e.times(i.plus(a.times(s.times(a).minus(u))));return e}function La(t,e,r,n,a){var i,s,u,l,o=t.precision,c=Math.ceil(o/Xe);for(tt=!1,l=r.times(r),u=new t(n);;){if(s=Tt(u.times(l),new t(e++*e++),o,1),u=a?n.plus(s):n.minus(s),n=Tt(s.times(l),new t(e++*e++),o,1),s=u.plus(n),s.d[c]!==void 0){for(i=c;s.d[i]===u.d[i]&&i--;);if(i==-1)break}i=u,u=n,n=s,s=i}return tt=!0,s.d.length=c+1,s}function Ps(t,e){for(var r=t;--e;)r*=t;return r}function dd(t,e){var r,n=e.s<0,a=sn(t,t.precision,1),i=a.times(.5);if(e=e.abs(),e.lte(i))return xn=n?4:1,e;if(r=e.divToInt(a),r.isZero())xn=n?3:2;else{if(e=e.minus(r.times(a)),e.lte(i))return xn=ld(r)?n?2:3:n?4:1,e;xn=ld(r)?n?1:4:n?3:2}return e.minus(a).abs()}function Gu(t,e,r,n){var a,i,s,u,l,o,c,f,d,m=t.constructor,h=r!==void 0;if(h?(xr(r,1,Ln),n===void 0?n=m.rounding:xr(n,0,8)):(r=m.precision,n=m.rounding),!t.isFinite())c=fd(t);else{for(c=an(t),s=c.indexOf("."),h?(a=2,e==16?r=r*4-3:e==8&&(r=r*3-2)):a=e,s>=0&&(c=c.replace(".",""),d=new m(1),d.e=c.length-s,d.d=Is(an(d),10,a),d.e=d.d.length),f=Is(c,10,a),i=l=f.length;f[--l]==0;)f.pop();if(!f[0])c=h?"0p+0":"0";else{if(s<0?i--:(t=new m(t),t.d=f,t.e=i,t=Tt(t,d,r,n,0,a),f=t.d,i=t.e,o=rd),s=f[r],u=a/2,o=o||f[r+1]!==void 0,o=n<4?(s!==void 0||o)&&(n===0||n===(t.s<0?3:2)):s>u||s===u&&(n===4||o||n===6&&f[r-1]&1||n===(t.s<0?8:7)),f.length=r,o)for(;++f[--r]>a-1;)f[r]=0,r||(++i,f.unshift(1));for(l=f.length;!f[l-1];--l);for(s=0,c="";s<l;s++)c+=Yu.charAt(f[s]);if(h){if(l>1)if(e==16||e==8){for(s=e==16?4:3,--l;l%s;l++)c+="0";for(f=Is(c,a,e),l=f.length;!f[l-1];--l);for(s=1,c="1.";s<l;s++)c+=Yu.charAt(f[s])}else c=c.charAt(0)+"."+c.slice(1);c=c+(i<0?"p":"p+")+i}else if(i<0){for(;++i;)c="0"+c;c="0."+c}else if(++i>l)for(i-=l;i--;)c+="0";else i<l&&(c=c.slice(0,i)+"."+c.slice(i))}c=(e==16?"0x":e==2?"0b":e==8?"0o":"")+c}return t.s<0?"-"+c:c}function md(t,e){if(t.length>e)return t.length=e,!0}function zD(t){return new this(t).abs()}function YD(t){return new this(t).acos()}function VD(t){return new this(t).acosh()}function HD(t,e){return new this(t).plus(e)}function WD(t){return new this(t).asin()}function GD(t){return new this(t).asinh()}function jD(t){return new this(t).atan()}function ZD(t){return new this(t).atanh()}function XD(t,e){t=new this(t),e=new this(e);var r,n=this.precision,a=this.rounding,i=n+4;return!t.s||!e.s?r=new this(NaN):!t.d&&!e.d?(r=sn(this,i,1).times(e.s>0?.25:.75),r.s=t.s):!e.d||t.isZero()?(r=e.s<0?sn(this,n,a):new this(0),r.s=t.s):!t.d||e.isZero()?(r=sn(this,i,1).times(.5),r.s=t.s):e.s<0?(this.precision=i,this.rounding=1,r=this.atan(Tt(t,e,i,1)),e=sn(this,i,1),this.precision=n,this.rounding=a,r=t.s<0?r.minu
vendor: 6,635 bytes, lines 20-21
20s(e):r.plus(e)):r=this.atan(Tt(t,e,i,1)),r}function JD(t){return new this(t).cbrt()}function QD(t){return Ye(t=new this(t),t.e+1,2)}function KD(t,e,r){return new this(t).clamp(e,r)}function eE(t){if(!t||typeof t!="object")throw Error(ks+"Object expected");var e,r,n,a=t.defaults===!0,i=["precision",1,Ln,"rounding",0,8,"toExpNeg",-Ia,0,"toExpPos",0,Ia,"maxE",0,Ia,"minE",-Ia,0,"modulo",0,9];for(e=0;e<i.length;e+=3)if(r=i[e],a&&(this[r]=Vu[r]),(n=t[r])!==void 0)if(or(n)===n&&n>=i[e+1]&&n<=i[e+2])this[r]=n;else throw Error(Rn+r+": "+n);if(r="crypto",a&&(this[r]=Vu[r]),(n=t[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(ad);else this[r]=!1;else throw Error(Rn+r+": "+n);return this}function tE(t){return new this(t).cos()}function rE(t){return new this(t).cosh()}function hd(t){var e,r,n;function a(i){var s,u,l,o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,pd(i)){o.s=i.s,tt?!i.d||i.e>a.maxE?(o.e=NaN,o.d=null):i.e<a.minE?(o.e=0,o.d=[0]):(o.e=i.e,o.d=i.d.slice()):(o.e=i.e,o.d=i.d?i.d.slice():i.d);return}if(l=typeof i,l==="number"){if(i===0){o.s=1/i<0?-1:1,o.e=0,o.d=[0];return}if(i<0?(i=-i,o.s=-1):o.s=1,i===~~i&&i<1e7){for(s=0,u=i;u>=10;u/=10)s++;tt?s>a.maxE?(o.e=NaN,o.d=null):s<a.minE?(o.e=0,o.d=[0]):(o.e=s,o.d=[i]):(o.e=s,o.d=[i]);return}if(i*0!==0){i||(o.s=NaN),o.e=NaN,o.d=null;return}return $s(o,i.toString())}if(l==="string")return(u=i.charCodeAt(0))===45?(i=i.slice(1),o.s=-1):(u===43&&(i=i.slice(1)),o.s=1),sd.test(i)?$s(o,i):qD(o,i);if(l==="bigint")return i<0?(i=-i,o.s=-1):o.s=1,$s(o,i.toString());throw Error(Rn+i)}if(a.prototype=Se,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=eE,a.clone=hd,a.isDecimal=pd,a.abs=zD,a.acos=YD,a.acosh=VD,a.add=HD,a.asin=WD,a.asinh=GD,a.atan=jD,a.atanh=ZD,a.atan2=XD,a.cbrt=JD,a.ceil=QD,a.clamp=KD,a.cos=tE,a.cosh=rE,a.div=nE,a.exp=aE,a.floor=iE,a.hypot=sE,a.ln=oE,a.log=uE,a.log10=cE,a.log2=lE,a.max=fE,a.min=dE,a.mod=mE,a.mul=hE,a.pow=pE,a.random=vE,a.round=gE,a.sign=yE,a.sin=bE,a.sinh=wE,a.sqrt=xE,a.sub=DE,a.sum=EE,a.tan=AE,a.tanh=SE,a.trunc=NE,t===void 0&&(t={}),t&&t.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<n.length;)t.hasOwnProperty(r=n[e++])||(t[r]=this[r]);return a.config(t),a}function nE(t,e){return new this(t).div(e)}function aE(t){return new this(t).exp()}function iE(t){return Ye(t=new this(t),t.e+1,3)}function sE(){var t,e,r=new this(0);for(tt=!1,t=0;t<arguments.length;)if(e=new this(arguments[t++]),e.d)r.d&&(r=r.plus(e.times(e)));else{if(e.s)return tt=!0,new this(1/0);r=e}return tt=!0,r.sqrt()}function pd(t){return t instanceof qn||t&&t.toStringTag===id||!1}function oE(t){return new this(t).ln()}function uE(t,e){return new this(t).log(e)}function lE(t){return new this(t).log(2)}function cE(t){return new this(t).log(10)}function fE(){return cd(this,arguments,-1)}function dE(){return cd(this,arguments,1)}function mE(t,e){return new this(t).mod(e)}function hE(t,e){return new this(t).mul(e)}function pE(t,e){return new this(t).pow(e)}function vE(t){var e,r,n,a,i=0,s=new this(1),u=[];if(t===void 0?t=this.precision:xr(t,1,Ln),n=Math.ceil(t/Xe),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));i<n;)a=e[i],a>=429e7?e[i]=crypto.getRandomValues(new Uint32Array(1))[0]:u[i++]=a%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);i<n;)a=e[i]+(e[i+1]<<8)+(e[i+2]<<16)+((e[i+3]&127)<<24),a>=214e7?crypto.randomBytes(4).copy(e,i):(u.push(a%1e7),i+=4);i=n/4}else throw Error(ad);else for(;i<n;)u[i++]=Math.random()*1e7|0;for(n=u[--i],t%=Xe,n&&t&&(a=Wt(10,Xe-t),u[i]=(n/a|0)*a);u[i]===0;i--)u.pop();if(i<0)r=0,u=[0];else{for(r=-1;u[0]===0;r-=Xe)u.shift();for(n=1,a=u[0];a>=10;a/=10)n++;n<Xe&&(r-=Xe-n)}return s.e=r,s.d=u,s}function gE(t){return Ye(t=new this(t),t.e+1,this.rounding)}function yE(t){return t=new this(t),t.d?t.d[0]?t.s:0*t.s:t.s||NaN}function bE(t){return new this(t).sin()}function wE(t){return new this(t).sinh()}function xE(t){return new this(t).sqrt()}function DE(t,e){return new this(t).sub(e)}function EE(){var t=0,e=arguments,r=new this(e[t]);for(tt=!1;r.s&&++t<e.length;)r=r.plus(e[t]);return tt=!0,Ye(r,this.precision,this.rounding)}function AE(t){return new this(t).tan()}function SE(t){return new this(t).tanh()}function NE(t){return Ye(t=new this(t),t.e+1,1)}Se[Symbol.for("nodejs.util.inspect.custom")]=Se.toString,Se[Symbol.toStringTag]="Decimal";var qn=Se.constructor=hd(Vu);Os=new qn(Os),Bs=new qn(Bs);var _E="BigNumber",CE=["?on","config"],ME=U(_E,CE,t=>{var{on:e,config:r}=t,n=qn.clone({precision:r.precision,modulo:qn.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(a){return new n(a.value)},e&&e("config",function(a,i){a.precision!==i.precision&&n.config({precision:a.precision})}),n},{isClass:!0});const ur=Math.cosh||function(t){return Math.abs(t)<1e-9?1-t:(Math.exp(t)+Math.exp(-t))*.5},Ir=Math.sinh||function(t){return Math.abs(t)<1e-9?t:(Math.exp(t)-Math.exp(-t))*.5},TE=function(t){const e=Math.PI/4;if(-e>t||t>e)return Math.cos(t)-1;const r=t*t;return r*(r*(r*(r*(r*(r*(r*(r/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},ju=function(t,e){return t=Math.abs(t),e=Math.abs(e),t<e&&([t,e]=[e,t]),t<1e8?Math.sqrt(t*t+e*e):(e/=t,t*Math.sqrt(1+e*e))},Ra=function(){throw SyntaxError("Invalid Param")};function Zu(t,e){const r=Math.abs(t),n=Math.abs(e);return t===0?Math.log(n):e===0?Math.log(r):r<3e3&&n<3e3?Math.log(t*t+e*e)*.5:(t=t*.5,e=e*.5,.5*Math.log(t*t+e*e)+Math.LN2)}const FE={re:0,im:0},sa=function(t,e){const r=FE;if(t==null)r.re=r.im=0;else if(e!==void 0)r.re=t,r.im=e;else switch(typeof t){case"object":if("im"in t&&"re"in t)r.re=t.re,r.im=t.im;else if("abs"in t&&"arg"in t){if(!isFinite(t.abs)&&isFinite(t.arg))return ve.INFINITY;r.re=t.abs*Math.cos(t.arg),r.im=t.abs*Math.sin(t.arg)}else if("r"in t&&"phi"in t){if(!isFinite(t.r)&&isFinite(t.phi))return ve.INFINITY;r.re=t.r*Math.cos(t.phi),r.im=t.r*Math.sin(t.phi)}else t.length===2?(r.re=t[0],r.im=t[1]):Ra();break;case"string":r.im=r.re=0;const n=t.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g);let a=1,i=0;n===null&&Ra();for(let s=0;s<n.length;s++){const u=n[s];u===" "||u===" "||u===` 21`||(u==="+"?a++:u==="-"?i++:u==="i"||u==="I"?(a+i===0&&Ra(),n[s+1]!==" "&&!isNaN(n[s+1]
21)?(r.im+=parseFloat((i%2?"-":"")+n[s+1]),s++):r.im+=parseFloat((i%2?"-":"")+"1"),a=i=0):((a+i===0||isNaN(u))&&Ra(),n[s+1]==="i"||n[s+1]==="I"?(r.im+=parseFloat((i%2?"-":"")+u),s++):r.re+=parseFloat((i%2?"-":"")+u),a=i=0))}a+i>0&&Ra();break;case"number":r.im=0,r.re=t;break;default:Ra()}return isNaN(r.re)||isNaN(r.im),r};function ve(t,e){if(!(this instanceof ve))return new ve(t,e);const r=sa(t,e);this.re=r.re,this.im=r.im}ve.prototype={re:0,im:0,sign:function(){const t=ju(this.re,this.im);return new ve(this.re/t,this.im/t)},add:function(t,e){const r=sa(t,e),n=this.isInfinite(),a=!(isFinite(r.re)&&isFinite(r.im));return n||a?n&&a?ve.NAN:ve.INFINITY:new ve(this.re+r.re,this.im+r.im)},sub:function(t,e){const r=sa(t,e),n=this.isInfinite(),a=!(isFinite(r.re)&&isFinite(r.im));return n||a?n&&a?ve.NAN:ve.INFINITY:new ve(this.re-r.re,this.im-r.im)},mul:function(t,e){const r=sa(t,e),n=this.isInfinite(),a=!(isFinite(r.re)&&isFinite(r.im)),i=this.re===0&&this.im===0,s=r.re===0&&r.im===0;return n&&s||a&&i?ve.NAN:n||a?ve.INFINITY:r.im===0&&this.im===0?new ve(this.re*r.re,0):new ve(this.re*r.re-this.im*r.im,this.re*r.im+this.im*r.re)},div:function(t,e){const r=sa(t,e),n=this.isInfinite(),a=!(isFinite(r.re)&&isFinite(r.im)),i=this.re===0&&this.im===0,s=r.re===0&&r.im===0;if(i&&s||n&&a)return ve.NAN;if(s||n)return ve.INFINITY;if(i||a)return ve.ZERO;if(r.im===0)return new ve(this.re/r.re,this.im/r.re);if(Math.abs(r.re)<Math.abs(r.im)){const u=r.re/r.im,l=r.re*u+r.im;return new ve((this.re*u+this.im)/l,(this.im*u-this.re)/l)}else{const u=r.im/r.re,l=r.im*u+r.re;return new ve((this.re+this.im*u)/l,(this.im-this.re*u)/l)}},pow:function(t,e){const r=sa(t,e),n=this.re===0&&this.im===0;if(r.re===0&&r.im===0)return ve.ONE;if(r.im===0){if(this.im===0&&this.re>0)return new ve(Math.pow(this.re,r.re),0);if(this.re===0)switch((r.re%4+4)%4){case 0:return new ve(Math.pow(this.im,r.re),0);case 1:return new ve(0,Math.pow(this.im,r.re));case 2:return new ve(-Math.pow(this.im,r.re),0);case 3:return new ve(0,-Math.pow(this.im,r.re))}}if(n&&r.re>0)return ve.ZERO;const i=Math.atan2(this.im,this.re),s=Zu(this.re,this.im);let u=Math.exp(r.re*s-r.im*i),l=r.im*s+r.re*i;return new ve(u*Math.cos(l),u*Math.sin(l))},sqrt:function(){const t=this.re,e=this.im;if(e===0)return t>=0?new ve(Math.sqrt(t),0):new ve(0,Math.sqrt(-t));const r=ju(t,e);let n=Math.sqrt(.5*(r+Math.abs(t))),a=Math.abs(e)/(2*n);return t>=0?new ve(n,e<0?-a:a):new ve(a,e<0?-n:n)},exp:function(){const t=Math.exp(this.re);return this.im===0?new ve(t,0):new ve(t*Math.cos(this.im),t*Math.sin(this.im))},expm1:function(){const t=this.re,e=this.im;return new ve(Math.expm1(t)*Math.cos(e)+TE(e),Math.exp(t)*Math.sin(e))},log:function(){const t=this.re,e=this.im;return e===0&&t>0?new ve(Math.log(t),0):new ve(Zu(t,e),Math.atan2(e,t))},abs:function(){return ju(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){const t=this.re,e=this.im;return new ve(Math.sin(t)*ur(e),Math.cos(t)*Ir(e))},cos:function(){const t=this.re,e=this.im;return new ve(Math.cos(t)*ur(e),-Math.sin(t)*Ir(e))},tan:function(){const t=2*this.re,e=2*this.im,r=Math.cos(t)+ur(e);return new ve(Math.sin(t)/r,Ir(e)/r)},cot:function(){const t=2*this.re,e=2*this.im,r=Math.cos(t)-ur(e);return new ve(-Math.sin(t)/r,Ir(e)/r)},sec:function(){const t=this.re,e=this.im,r=.5*ur(2*e)+.5*Math.cos(2*t);return new ve(Math.cos(t)*ur(e)/r,Math.sin(t)*Ir(e)/r)},csc:function(){const t=this.re,e=this.im,r=.5*ur(2*e)-.5*Math.cos(2*t);return new ve(Math.sin(t)*ur(e)/r,-Math.cos(t)*Ir(e)/r)},asin:function(){const t=this.re,e=this.im,r=new ve(e*e-t*t+1,-2*t*e).sqrt(),n=new ve(r.re-e,r.im+t).log();return new ve(n.im,-n.re)},acos:function(){const t=this.re,e=this.im,r=new ve(e*e-t*t+1,-2*t*e).sqrt(),n=new ve(r.re-e,r.im+t).log();return new ve(Math.PI/2-n.im,n.re)},atan:function(){const t=this.re,e=this.im;if(t===0){if(e===1)return new ve(0,1/0);if(e===-1)return new ve(0,-1/0)}const r=t*t+(1-e)*(1-e),n=new ve((1-e*e-t*t)/r,-2*t/r).log();return new ve(-.5*n.im,.5*n.re)},acot:function(){const t=this.re,e=this.im;if(e===0)return new ve(Math.atan2(1,t),0);const r=t*t+e*e;return r!==0?new ve(t/r,-e/r).atan():new ve(t!==0?t/0:0,e!==0?-e/0:0).atan()},asec:function(){const t=this.re,e=this.im;if(t===0&&e===0)return new ve(0,1/0);const r=t*t+e*e;return r!==0?new ve(t/r,-e/r).acos():new ve(t!==0?t/0:0,e!==0?-e/0:0).acos()},acsc:function(){const t=this.re,e=this.im;if(t===0&&e===0)return new ve(Math.PI/2,1/0);const r=t*t+e*e;return r!==0?new ve(t/r,-e/r).asin():new ve(t!==0?t/0:0,e!==0?-e/0:0).asin()},sinh:function(){const t=this.re,e=this.im;return new ve(Ir(t)*Math.cos(e),ur(t)*Math.sin(e))},cosh:function(){const t=this.re,e=this.im;return new ve(ur(t)*Math.cos(e),Ir(t)*Math.sin(e))},tanh:function(){const t=2*this.re,e=2*this.im,r=ur(t)+Math.cos(e);return new ve(Ir(t)/r,Math.sin(e)/r)},coth:function(){const t=2*this.re,e=2*this.im,r=ur(t)-Math.cos(e);return new ve(Ir(t)/r,-Math.sin(e)/r)},csch:function(){const t=this.re,e=this.im,r=Math.cos(2*e)-ur(2*t);return new ve(-2*Ir(t)*Math.cos(e)/r,2*ur(t)*Math.sin(e)/r)},sech:function(){const t=this.re,e=this.im,r=Math.cos(2*e)+ur(2*t);return new ve(2*ur(t)*Math.cos(e)/r,-2*Ir(t)*Math.sin(e)/r)},asinh:function(){let t=this.im;this.im=-this.re,this.re=t;const e=this.asin();return this.re=-this.im,this.im=t,t=e.re,e.re=-e.im,e.im=t,e},acosh:function(){const t=this.acos();if(t.im<=0){const e=t.re;
21t.re=-t.im,t.im=e}else{const e=t.im;t.im=-t.re,t.re=e}return t},atanh:function(){const t=this.re,e=this.im,r=t>1&&e===0,n=1-t,a=1+t,i=n*n+e*e,s=i!==0?new ve((a*n-e*e)/i,(e*n+a*e)/i):new ve(t!==-1?t/0:0,e!==0?e/0:0),u=s.re;return s.re=Zu(s.re,s.im)/2,s.im=Math.atan2(s.im,u)/2,r&&(s.im=-s.im),s},acoth:function(){const t=this.re,e=this.im;if(t===0&&e===0)return new ve(0,Math.PI/2);const r=t*t+e*e;return r!==0?new ve(t/r,-e/r).atanh():new ve(t!==0?t/0:0,e!==0?-e/0:0).atanh()},acsch:function(){const t=this.re,e=this.im;if(e===0)return new ve(t!==0?Math.log(t+Math.sqrt(t*t+1)):1/0,0);const r=t*t+e*e;return r!==0?new ve(t/r,-e/r).asinh():new ve(t!==0?t/0:0,e!==0?-e/0:0).asinh()},asech:function(){const t=this.re,e=this.im;if(this.isZero())return ve.INFINITY;const r=t*t+e*e;return r!==0?new ve(t/r,-e/r).acosh():new ve(t!==0?t/0:0,e!==0?-e/0:0).acosh()},inverse:function(){if(this.isZero())return ve.INFINITY;if(this.isInfinite())return ve.ZERO;const t=this.re,e=this.im,r=t*t+e*e;return new ve(t/r,-e/r)},conjugate:function(){return new ve(this.re,-this.im)},neg:function(){return new ve(-this.re,-this.im)}
21,ceil:function(t){return t=Math.pow(10,t||0),new ve(Math.ceil(this.re*t)/t,Math.ceil(this.im*t)/t)},floor:function(t){return t=Math.pow(10,t||0),new ve(Math.floor(this.re*t)/t,Math.floor(this.im*t)/t)},round:function(t){return t=Math.pow(10,t||0),new ve(Math.round(this.re*t)/t,Math.round(this.im*t)/t)},equals:function(t,e){const r=sa(t,e);return Math.abs(r.re-this.re)<=ve.EPSILON&&Math.abs(r.im-this.im)<=ve.EPSILON},clone:function(){return new ve(this.re,this.im)},toString:function(){let t=this.re,e=this.im,r="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(t)<ve.EPSILON&&(t=0),Math.abs(e)<ve.EPSILON&&(e=0),e===0?r+t:(t!==0?(r+=t,r+=" ",e<0?(e=-e,r+="-"):r+="+",r+=" "):e<0&&(e=-e,r+="-"),e!==1&&(r+=e),r+"i"))},toVector:function(){return[this.re,this.im]},valueOf:function(){return this.im===0?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return this.im===0&&this.re===0},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!this.isFinite()}},ve.ZERO=new ve(0,0),ve.ONE=new ve(1,0),ve.I=new ve(0,1),ve.PI=new ve(Math.PI,0),ve.E=new ve(Math.E,0),ve.INFINITY=new ve(1/0,1/0),ve.NAN=new ve(NaN,NaN),ve.EPSILON=1e-15;var OE="Complex",BE=[],kE=U(OE,BE,()=>(Object.defineProperty(ve,"name",{value:"Complex"}),ve.prototype.constructor=ve,ve.prototype.type="Complex",ve.prototype.isComplex=!0,ve.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},ve.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},ve.prototype.format=function(t){var e="",r=this.im,n=this.re,a=ia(this.re,t),i=ia(this.im,t),s=qe(t)?t:t?t.precision:null;if(s!==null){var u=Math.pow(10,-s);Math.abs(n/r)<u&&(n=0),Math.abs(r/n)<u&&(r=0)}return r===0?e=a:n===0?r===1?e="i":r===-1?e="-i":e=i+"i":r<0?r===-1?e=a+" - i":e=a+" - "+i.substring(1)+"i":r===1?e=a+" + i":e=a+" + "+i+"i",e},ve.fromPolar=function(t){switch(arguments.length){case 1:{var e=arguments[0];if(typeof e=="object")return ve(e);throw new TypeError("Input has to be an object with r and phi keys.")}case 2:{var r=arguments[0],n=arguments[1];if(qe(r)){if(pr(n)&&n.hasBase("ANGLE")&&(n=n.toNumber("rad")),qe(n))return new ve({r,phi:n});throw new TypeError("Phi is not a number nor an angle unit.")}else throw new TypeError("Radius r is not a number.")}default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},ve.prototype.valueOf=ve.prototype.toString,ve.fromJSON=function(t){return new ve(t)},ve.compare=function(t,e){return t.re>e.re?1:t.re<e.re?-1:t.im>e.im?1:t.im<e.im?-1:0},ve),{isClass:!0});typeof BigInt>"u"&&(BigInt=function(t){if(isNaN(t))throw new Error("");return t});const Pe=BigInt(0),ft=BigInt(1),Xt=BigInt(2),Fi=BigInt(3),$a=BigInt(5),Dr=BigInt(10);BigInt(Number.MAX_SAFE_INTEGER);const IE=2e3,Fe={s:ft,n:Pe,d:ft};function Dn(t,e){try{t=BigInt(t)}catch{throw Un()}return t*e}function jr(t){return typeof t=="bigint"?t:Math.floor(t)}function Lt(t,e){if(e===Pe)throw Xu();const r=Object.create(Lr.prototype);r.s=t<Pe?-ft:ft,t=t<Pe?-t:t;const n=oa(t,e);return r.n=t/n,r.d=e/n,r}const LE=[Xt*Xt,Xt,Xt*Xt,Xt,Xt*Xt,Xt*Fi,Xt,Xt*Fi];function Pa(t){const e=Object.create(null);if(t<=ft)return e[t]=ft,e;const r=n=>{e[n]=(e[n]||Pe)+ft};for(;t%Xt===Pe;)r(Xt),t/=Xt;for(;t%Fi===Pe;)r(Fi),t/=Fi;for(;t%$a===Pe;)r($a),t/=$a;for(let n=0,a=Xt+$a;a*a<=t;){for(;t%a===Pe;)r(a),t/=a;a+=LE[n],n=n+1&7}return t>ft&&r(t),e}const Jt=function(t,e){let r=Pe,n=ft,a=ft;if(t!=null)if(e!==void 0){if(typeof t=="bigint")r=t;else{if(isNaN(t))throw Un();if(t%1!==0)throw vd();r=BigInt(t)}if(typeof e=="bigint")n=e;else{if(isNaN(e))throw Un();if(e%1!==0)throw vd();n=BigInt(e)}a=r*n}else if(typeof t=="object"){if("d"in t&&"n"in t)r=BigInt(t.n),n=BigInt(t.d),"s"in t&&(r*=BigInt(t.s));else if(0 in t)r=BigInt(t[0]),1 in t&&(n=BigInt(t[1]));else if(typeof t=="bigint")r=t;else throw Un();a=r*n}else if(typeof t=="number"){if(isNaN(t))throw Un();if(t<0&&(a=-ft,t=-t),t%1===0)r=BigInt(t);else{let i=1,s=0,u=1,l=1,o=1,c=1e7;for(t>=1&&(i=10**Math.floor(1+Math.log10(t)),t/=i);u<=c&&o<=c;){let f=(s+l)/(u+o);if(t===f){u+o<=c?(r=s+l,n=u+o):o>u?(r=l,n=o):(r=s,n=u);break}else t>f?(s+=l,u+=o):(l+=s,o+=u),u>c?(r=l,n=o):(r=s,n=u)}r=BigInt(r)*BigInt(i),n=BigInt(n)}}else if(typeof t=="string"){let i=0,s=Pe,u=Pe,l=Pe,o=ft,c=ft,f=t.replace(/_/g,"").match(/\d+|./g);if(f===null)throw Un();if(f[i]==="-"?(a=-ft,i++):f[i]==="+"&&i++,f.length===i+1?u=Dn(f[i++],a):f[i+1]==="."||f[i]==="."?(f[i]!=="."&&(s=Dn(f[i++],a)),i++,(i+1===f.length||f[i+1]==="("&&f[i+3]===")"||f[i+1]==="'"&&f[i+3]==="'")&&(u=Dn(f[i],a),o=Dr**BigInt(f[i].length),i++),(f[i]==="("&&f[i+2]===")"||f[i]==="'"&&f[i+2]==="'")&&(l=Dn(f[i+1],a),c=Dr**BigInt(f[i+1].length)-ft,i+=3)):f[i+1]==="/"||f[i+1]===":"?(u=Dn(f[i],a),o=Dn(f[i+2],ft),i+=3):f[i+3]==="/"&&f[i+1]===" "&&(s=Dn(f[i],a),u=Dn(f[i+2],a),o=Dn(f[i+4],ft),i+=5),f.length<=i)n=o*c,a=r=l+n*s+c*u;else throw Un()}else if(typeof t=="bigint")r=t,a=t,n=ft;else throw Un();if(n===Pe)throw Xu();Fe.s=a<Pe?-ft:ft,Fe.n=r<Pe?-r:r,Fe.d=n<Pe?-n:n};function RE(t,e,r){let n=ft;for(;e>Pe;t=t*t%r,e>>=ft)e&ft&&(n=n*t%r);return n}function $E(t,e){for(;e%Xt===Pe;e/=Xt);for(;e%$a===Pe;e/=$a);if(e===ft)return Pe;let r=Dr%e,n=1;for(;r!==ft;n++)if(r=r*Dr%e,n>IE)return Pe;return BigInt(n)}function PE(t,e,r){let n=ft,a=RE(Dr,r,e);for(let i=0;i<300;i++){if(n===a)return BigInt(i);n=n*Dr%e,a=a*Dr%e}return 0}function oa(t,e){if(!t)return e;if(!e)return t;for(;;){if(t%=e,!t)return e;if(e%=t,!e)return t}}function Lr(t,e){if(Jt(t,e),this instanceof Lr)t=oa(Fe.d,Fe.n),this.s=Fe.s,this.n=Fe.n/t,this.d=Fe.d/t;else return Lt(Fe.s*Fe.n,Fe.d)}const Xu=function(){return new Error("Division by Zero")},Un=function(){return new Error("Invalid argument")},vd=function(){return new Error("Parameters must be integer")};Lr.prototype={s:ft,n:Pe,d:ft,abs:function(){return Lt(this.n,this.d)},neg:function(){return Lt(-this.s*this.n,this.d)},add:function(t,e){return Jt(t,e),Lt(this.s*this.n*Fe.d+Fe.s*this.d*Fe.n,this.d*Fe.d)},sub:function(t,e){return Jt(t,e),Lt(this.s*this.n*Fe.d-Fe.s*this.d*Fe.n,this.d*Fe.d)},mul:function(t,e){return Jt(t,e),Lt(this.s*Fe.s*this.n*Fe.n,this.d*Fe.d)},div:function(t,e){return Jt(t,e),Lt(this.s*Fe.s*this.n*Fe.d,this.d*Fe.n)},clone:function(){return Lt(this.s*this.n,this.d)},mod:function(t,e){if(t===void 0)return Lt(this.s*this.n%this.d,ft);if(Jt(t,e),Pe===Fe.n*this.d)throw Xu();return Lt(this.s*(Fe.d*this.n)%(Fe.n*this.d),Fe.d*this.d)},gcd:function(t,e){return Jt(t,e),Lt(oa(Fe.n,this.n)*oa(Fe.d,this.d),Fe.d*this.d)},lcm:function(t,e){return Jt(t,e),Fe.n===Pe&&this.n===Pe?Lt(Pe,ft):Lt(Fe.n*this.n,oa(Fe.n,this.n)*oa(Fe.d,this.d))},inverse:function(){return Lt(this.s*this.d,this.n)},pow:function(t,e){if(Jt(t,e),Fe.d===ft)return Fe.s<Pe?Lt((this.s*this.d)**Fe.n,this.n**Fe.n):Lt((this.s*this.n)**Fe.n,this.d**Fe.n);if(this.s<Pe)return null;let r=Pa(this.n),n=Pa(this.d),a=ft,i=ft;for(let s in r)if(s!=="1"){if(s==="0"){a=Pe;break}if(r[s]*=Fe.n,r[s]%Fe.d===Pe)r[s]/=Fe.d;else return null;a*=BigInt(s)**r[s]}for(let s in n)if(s!=="1"){if(n[s]*=Fe.n,n[s]%Fe.d===Pe)n[s]/=Fe.d;else return null;i*=BigInt(s)**n[s]}return Fe.s<Pe?Lt(i,a):Lt(a,i)},log:function(t,e){if(Jt(t,e),this.s<=Pe||Fe.s<=Pe)return null;const r=Object.create(null),n=Pa(Fe.n),a=Pa(Fe.d),i=Pa(this.n),s=Pa(this.d);for(const o in a)n[o]=(n[o]||Pe)-a[o];for(const o in s)i[o]=(i[o]||Pe)-s[o];for(const o in n)o!=="1"&&(r[o]=!0);for(const o in i)o!=="1"&&(r[o]=!0);let u=null,l=null;for(const o in r){const c=n[o]||Pe,f=i[o]||Pe;if(c===Pe){if(f!==Pe)return null;continue}let d=f,m=c;const h=oa(d,m);if(d/=h,m/=h,u===null&&l===null)u=d,l=m;else if(d*l!==u*m)return null}
21return u!==null&&l!==null?Lt(u,l):null},equals:function(t,e){return Jt(t,e),this.s*this.n*Fe.d===Fe.s*Fe.n*this.d},lt:function(t,e){return Jt(t,e),this.s*this.n*Fe.d<Fe.s*Fe.n*this.d},lte:function(t,e){return Jt(t,e),this.s*this.n*Fe.d<=Fe.s*Fe.n*this.d},gt:function(t,e){return Jt(t,e),this.s*this.n*Fe.d>Fe.s*Fe.n*this.d},gte:function(t,e){return Jt(t,e),this.s*this.n*Fe.d>=Fe.s*Fe.n*this.d},compare:function(t,e){Jt(t,e);let r=this.s*this.n*Fe.d-Fe.s*Fe.n*this.d;return(Pe<r)-(r<Pe)},ceil:function(t){return t=Dr**BigInt(t||0),Lt(jr(this.s*t*this.n/this.d)+(t*this.n%this.d>Pe&&this.s>=Pe?ft:Pe),t)},floor:function(t){return t=Dr**BigInt(t||0),Lt(jr(this.s*t*this.n/this.d)-(t*this.n%this.d>Pe&&this.s<Pe?ft:Pe),t)},round:function(t){return t=Dr**BigInt(t||0),Lt(jr(this.s*t*this.n/this.d)+this.s*((this.s>=Pe?ft:Pe)+Xt*(t*this.n%this.d)>this.d?ft:Pe),t)},roundTo:function(t,e){Jt(t,e);const r=this.n*Fe.d,n=this.d*Fe.n,a=r%n;let i=jr(r/n);return a+a>=n&&i++,Lt(this.s*i*Fe.n,Fe.d)},divisible:function(t,e){return Jt(t,e),Fe.n===Pe?!1:this.n*Fe.d%(Fe.n*this.d)===Pe},valueOf:function(){return Number(this.s*this.n)/Number(this.d)},toString:function(t=15){let e=this.n,r=this.d,n=$E(e,r),a=PE(e,r,n),i=this.s<Pe?"-":"";if(i+=jr(e/r),e%=r,e*=Dr,e&&(i+="."),n){for(let s=a;s--;)i+=jr(e/r),e%=r,e*=Dr;i+="(";for(let s=n;s--;)i+=jr(e/r),e%=r,e*=Dr;i+=")"}else for(let s=t;e&&s--;)i+=jr(e/r),e%=r,e*=Dr;return i},toFraction:function(t=!1){let e=this.n,r=this.d,n=this.s<Pe?"-":"";if(r===ft)n+=e;else{const a=jr(e/r);t&&a>Pe&&(n+=a,n+=" ",e%=r),n+=e,n+="/",n+=r}return n},toLatex:function(t=!1){let e=this.n,r=this.d,n=this.s<Pe?"-":"";if(r===ft)n+=e;else{const a=jr(e/r);t&&a>Pe&&(n+=a,e%=r),n+="\\frac{",n+=e,n+="}{",n+=r,n+="}"}return n},toContinued:function(){let t=this.n,e=this.d;const r=[];for(;e;){r.push(jr(t/e));const n=t%e;t=e,e=n}return r},simplify:function(t=.001){const e=BigInt(Math.ceil(1/t)),r=this.abs(),n=r.toContinued();for(let a=1;a<n.length;a++){let i=Lt(n[a-1],ft);for(let u=a-2;u>=0;u--)i=i.inverse().add(n[u]);let s=i.sub(r);if(s.n*e<s.d)return i.mul(this.s)}return this}};var qE="Fraction",UE=[],zE=U(qE,UE,()=>(Object.defineProperty(Lr,"name",{value:"Fraction"}),Lr.prototype.constructor=Lr,Lr.prototype.type="Fraction",Lr.prototype.isFraction=!0,Lr.prototype.toJSON=function(){return{mathjs:"Fraction",n:String(this.s*this.n),d:String(this.d)}},Lr.fromJSON=function(t){return new Lr(t)},Lr),{isClass:!0}),YE="Range",VE=[],HE=U(YE,VE,()=>{function t(e,r,n){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");var a=e!=null,i=r!=null,s=n!=null;if(a){if(Qe(e))e=e.toNumber();else if(typeof e!="number"&&!Fa(e))throw new TypeError("Parameter start must be a number or bigint")}if(i){if(Qe(r))r=r.toNumber();else if(typeof r!="number"&&!Fa(r))throw new TypeError("Parameter end must be a number or bigint")}if(s){if(Qe(n))n=n.toNumber();else if(typeof n!="number"&&!Fa(n))throw new TypeError("Parameter step must be a number or bigint")}if(this.start=a?parseFloat(e):0,this.end=i?parseFloat(r):0,this.step=s?parseFloat(n):1,s&&Zt(this.step,0))throw new Error("Step must not be zero")}return t.prototype.type="Range",t.prototype.isRange=!0,t.parse=function(e){if(typeof e!="string")return null;var r=e.split(":"),n=r.map(function(i){return parseFloat(i)}),a=n.some(function(i){return isNaN(i)});if(a)return null;switch(n.length){case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[2],n[1]);default:return null}},t.prototype.clone=function(){return new t(this.start,this.end,this.step)},t.prototype.size=function(){var e=0,r=this.start,n=this.step,a=this.end,i=a-r;return In(n)===In(i)?e=Math.ceil(i/n):i===0&&(e=0),isNaN(e)&&(e=0),[e]},t.prototype.min=function(){var e=this.size()[0];if(e>0)return this.step>0?this.start:this.start+(e-1)*this.step},t.prototype.max=function(){var e=this.size()[0];if(e>0)return this.step>0?this.start+(e-1)*this.step:this.start},t.prototype.forEach=function(e){var r=this.start,n=this.step,a=this.end,i=0;if(n>0)for(;r<a;)e(r,[i],this),r+=n,i++;else if(n<0)for(;r>a;)e(r,[i],this),r+=n,i++},t.prototype.map=function(e){var r=[];return this.forEach(function(n,a,i){r[a[0]]=e(n,a,i)}),r},t.prototype.toArray=function(){var e=[];return this.forEach(function(r,n){e[n[0]]=r}),e},t.prototype.valueOf=function(){return this.toArray()},t.prototype.format=function(e){var r=ia(this.start,e);return this.step!==1&&(r+=":"+ia(this.step,e)),r+=":"+ia(this.end,e),r},t.prototype.toString=function(){return this.format()},t.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},t.fromJSON=function(e){return new t(e.start,e.end,e.step)},t},{isClass:!0}),WE="Matrix",GE=[],jE=U(WE,GE,()=>{function t(){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator")}return t.prototype.type="Matrix",t.prototype.isMatrix=!0,t.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},t.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},t.prototype.create=function(e,r){throw new Error("Cannot invoke create on a Matrix interface")},t.prototype.subset=function(e,r,n){throw new Error("Cannot invoke subset on a Matrix interface")},t.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},t.prototype.set=function(e,r,n){throw new Error("Cannot invoke set on a Matrix interface")},t.prototype.resize=function(e,r){throw new Error("Cannot invoke resize on a Matrix interface")},t.prototype.reshape=function(e,r){throw new Error("Cannot invoke reshape on a Matrix interface")},t.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},t.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},t.prototype.map=function(e,r){throw new Error("Cannot invoke map on a Matrix interface")},t.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},t.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},t.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},t.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},t.prototype.format=function(e){throw new Error("Cannot invoke format on a Matrix interface")},t.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},t},{isClass:!0});function Ju(t,e,r){var n=t.constructor,a=new n(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(t.greaterThan(a.pow(r-1).sub(1))||t.lessThan(a.pow(r-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").
vendor: 10,467 bytes, line 21
21concat(r-1,"-1]"));if(!t.isInteger())throw new Error("Value must be an integer");t.lessThan(0)&&(t=t.add(a.pow(r))),i="i".concat(r)}switch(e){case 2:return"".concat(t.toBinary()).concat(i);case 8:return"".concat(t.toOctal()).concat(i);case 16:return"".concat(t.toHexadecimal()).concat(i);default:throw new Error("Base ".concat(e," not supported "))}}function ZE(t,e){if(typeof e=="function")return e(t);if(!t.isFinite())return t.isNaN()?"NaN":t.gt(0)?"Infinity":"-Infinity";var{notation:r,precision:n,wordSize:a}=Xf(e);switch(r){case"fixed":return JE(t,n);case"exponential":return gd(t,n);case"engineering":return XE(t,n);case"bin":return Ju(t,2,a);case"oct":return Ju(t,8,a);case"hex":return Ju(t,16,a);case"auto":{var i=yd(e?.lowerExp,-3),s=yd(e?.upperExp,5);if(t.isZero())return"0";var u,l=t.toSignificantDigits(n),o=l.e;return o>=i&&o<s?u=l.toFixed():u=gd(t,n),u.replace(/((\.\d*?)(0+))($|e)/,function(){var c=arguments[2],f=arguments[4];return c!=="."?c+f:f})}default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function XE(t,e){var r=t.e,n=r%3===0?r:r<0?r-3-r%3:r-r%3,a=t.mul(Math.pow(10,-n)),i=a.toPrecision(e);if(i.includes("e")){var s=t.constructor;i=new s(i).toFixed()}return i+"e"+(r>=0?"+":"")+n.toString()}function gd(t,e){return e!==void 0?t.toExponential(e-1):t.toExponential()}function JE(t,e){return t.toFixed(e)}function yd(t,e){return qe(t)?t:Qe(t)?t.toNumber():e}function QE(t,e){var r=t.length-e.length,n=t.length;return t.substring(r,n)===e}function ot(t,e){var r=KE(t,e);return e&&typeof e=="object"&&"truncate"in e&&r.length>e.truncate?r.substring(0,e.truncate-3)+"...":r}function KE(t,e){if(typeof t=="number")return ia(t,e);if(Qe(t))return ZE(t,e);if(eA(t))return!e||e.fraction!=="decimal"?"".concat(t.s*t.n,"/").concat(t.d):t.toString();if(Array.isArray(t))return wd(t,e);if(Rt(t))return qa(t);if(typeof t=="function")return t.syntax?String(t.syntax):"function";if(t&&typeof t=="object"){if(typeof t.format=="function")return t.format(e);if(t&&t.toString(e)!=={}.toString())return t.toString(e);var r=Object.keys(t).map(n=>qa(n)+": "+ot(t[n],e));return"{"+r.join(", ")+"}"}return String(t)}function qa(t){for(var e=String(t),r="",n=0;n<e.length;){var a=e.charAt(n);r+=a in bd?bd[a]:a,n++}return'"'+r+'"'}var bd={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"};function Rr(t){var e=String(t);return e=e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">"),e}function wd(t,e){if(Array.isArray(t)){for(var r="[",n=t.length,a=0;a<n;a++)a!==0&&(r+=", "),r+=wd(t[a],e);return r+="]",r}else return ot(t,e)}function eA(t){return t&&typeof t=="object"&&typeof t.s=="bigint"&&typeof t.n=="bigint"&&typeof t.d=="bigint"||!1}function Qu(t,e){if(!Rt(t))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+Et(t)+", index: 0)");if(!Rt(e))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+Et(e)+", index: 1)");return t===e?0:t>e?1:-1}function at(t,e,r){if(!(this instanceof at))throw new SyntaxError("Constructor must be called with the new operator");this.actual=t,this.expected=e,this.relation=r,this.message="Dimension mismatch ("+(Array.isArray(t)?"["+t.join(", ")+"]":t)+" "+(this.relation||"!=")+" "+(Array.isArray(e)?"["+e.join(", ")+"]":e)+")",this.stack=new Error().stack}at.prototype=new RangeError,at.prototype.constructor=RangeError,at.prototype.name="DimensionError",at.prototype.isDimensionError=!0;function $r(t,e,r){if(!(this instanceof $r))throw new SyntaxError("Constructor must be called with the new operator");this.index=t,arguments.length<3?(this.min=0,this.max=e):(this.min=e,this.max=r),this.min!==void 0&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":this.max!==void 0&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}$r.prototype=new RangeError,$r.prototype.constructor=RangeError,$r.prototype.name="IndexError",$r.prototype.isIndexError=!0;function Ke(t){for(var e=[];Array.isArray(t);)e.push(t.length),t=t[0];return e}function xd(t,e,r){var n,a=t.length;if(a!==e[r])throw new at(a,e[r]);if(r<e.length-1){var i=r+1;for(n=0;n<a;n++){var s=t[n];if(!Array.isArray(s))throw new at(e.length-1,e.length,"<");xd(t[n],e,i)}}else for(n=0;n<a;n++)if(Array.isArray(t[n]))throw new at(e.length+1,e.length,">")}function Dd(t,e){var r=e.length===0;if(r){if(Array.isArray(t))throw new at(t.length,0)}else xd(t,e,0)}function qs(t,e){var r=t.isMatrix?t._size:Ke(t),n=e._sourceSize;n.forEach((a,i)=>{if(a!==null&&a!==r[i])throw new at(a,r[i])})}function _t(t,e){if(t!==void 0){if(!qe(t)||!$e(t))throw new TypeError("Index must be an integer (value: "+t+")");if(t<0||typeof e=="number"&&t>=e)throw new $r(t,e)}}function Ua(t){for(var e=0;e<t._dimensions.length;++e){var r=t._dimensions[e];if(r._data&&Dt(r._data)){if(r._size[0]===0)return!0}else if(r.isRange){if(r.start===r.end)return!0}else if(Rt(r)&&r.length===0)return!0}return!1}function za(t,e,r){if(!Array.isArray(e))throw new TypeError("Array expected");if(e.length===0)throw new Error("Resizing to scalar is not supported");e.forEach(function(a){if(!qe(a)||!$e(a)||a<0)throw new TypeError("Invalid size, must contain positive integers (size: "+ot(e)+")")}),(qe(t)||Qe(t))&&(t=[t]);var n=r!==void 0?r:0;return Ku(t,e,0,n),t}function Ku(t,e,r,n){var a,i,s=t.length,u=e[r],l=Math.min(s,u);if(t.length=u,r<e.length-1){var o=r+1;for(a=0;a<l;a++)i=t[a],Array.isArray(i)||(i=[i],t[a]=i),Ku(i,e,o,n);for(a=l;a<u;a++)i=[],t[a]=i,Ku(i,e,o,n)}else{for(a=0;a<l;a++)for(;Array.isArray(t[a]);)t[a]=t[a][0];for(a=l;a<u;a++)t[a]=n}}function el(t,e){var r=pt(t,!0),n=r.length;if(!Array.isArray(t)||!Array.isArray(e))throw new TypeError("Array expected");if(e.length===0)throw new at(0,n,"!=");e=tl(e,n);var a=Ed(e);if(n!==a)throw new at(a,n,"!=");try{return tA(r,e)}catch(i){throw i instanceof at?new at(a,n,"!="):i}}function tl(t,e){var r=Ed(t),n=t.slice(),a=-1,i=t.indexOf(a),s=t.indexOf(a,i+1)>=0;if(s)throw new Error("More than one wildcard in sizes");var u=i>=0,l=e%r===0;if(u)if(l)n[i]=-e/r;else throw new Error("Could not replace wildcard, since "+e+" is no multiple of "+-r);return n}function Ed(t){return t.reduce((e,r)=>e*r,1)}function tA(t,e){for(var r=t,n,a=e.length-1;a>0;a--){var i=e[a];n=[];for(var s=r.length/i,u=0;u<s;u++)n.push(r.slice(u*i,(u+1)*i));r=n}return r}function Us(t,e){for(var r=Ke(t);Array.isArray(t)&&t.length===1;)t=t[0],r.shift();for(var n=r.length;r[n-1]===1;)n--;return n<r.length&&(t=Ad(t,n,0),r.length=n),t}function Ad(t,e,r){var n,a;if(r<e){var i=r+1;for(n=0,a=t.length;n<a;n++)t[n]=Ad(t[n],e,i)}else for(;Array.isArray(t);)t=t[0];return t}function Sd(t,e,r,n){var a=n||Ke(t);if(r)for(var i=0;i<r;i++)t=[t],a.unshift(1);for(t=Nd(t,e,0);a.length<e;)a.push(1);return t}function Nd(t,e,r){var n,a;if(Array.isArray(t)){var i=r+1;for(n=0,a=t.length;n<a;n++)t[n]=Nd(t[n],e,i)}else for(var s=r;s<e;s++)t=[t];return t}function pt(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!Array.isArray(t))return t;if(typeof e!="boolean")throw new TypeError("Boolean expected for second argument of flatten");var r=[];return e?a(t):n(t),r;function n(i){for(var s=0;s<i.length;s++){var u=i[s];Array.isArray(u)?n(u):r.push(u)}}function a(i){if(Array.isArray(i[0]))for(var s=0;s<i.length;s++)a(i[s]);else for(var u=0;u<i.length;u++)r.push(i[u])}}function zn(t,e){return Array.prototype.map.call(t,e)}function _d(t,e){Array.prototype.forEach.call(t,e)}function Cd(t,e){if(Ke(t).length!==1)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(t,e)}function Md(t,e){if(Ke(t).length!==1)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(t,r=>e.test(r))}function Td(t,e){return Array.prototype.join.call(t,e)}function Ya(t){if(!Array.isArray(t))throw new TypeError("Array input expected");if(t.length===0)return t;var e=[],r=0;e[0]={value:t[0],identifier:0};for(var n=1;n<t.length;n++)t[n]===t[n-1]?r++:r=0,e.push({value:t[n],identifier:r});return e}function zs(t){if(!Array.isArray(t))throw new TypeError("Array input expected");if(t.length===0)return t;for(var e=[],r=0;r<t.length;r++)e.push(t[r].value);return e}function Ys(t,e){for(var r,n=0,a=0;a<t.length;a++){var i=t[a],s=Array.isArray(i);if(a===0&&s&&(n=i.length),s&&i.length!==n)return;var u=s?Ys(i,e):e(i);if(r===void 0)r=u;else if(r!==u)return"mixed"}return r}function Fd(t,e,r,n){if(n<r){if(t.length!==e.length)throw new at(t.length,e.length);for(var a=[],i=0;i<t.length;i++)a[i]=Fd(t[i],e[i],r,n+1);return a}else return t.concat(e)}function Od(){var t=Array.prototype.slice.call(arguments,0,-1),e=Array.prototype.slice.call(arguments,-1);if(t.length===1)return t[0];if(t.length>1)return t.slice(1).reduce(function(r,n){return Fd(r,n,e,0)},t[0]);throw new Error("Wrong number of arguments in function concat")}function Vs(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=e.map(d=>d.length),a=Math.max(...n),i=new Array(a).fill(null),s=0;s<e.length;s++)for(var u=e[s],l=n[s],o=0;o<l;o++){var c=a-l+o;u[o]>i[c]&&(i[c]=u[o])}for(var f=0;f<e.length;f++)Bd(e[f],i);return i}function Bd(t,e){for(var r=e.length,n=t.length,a=0;a<n;a++){var i=r-n+a;if(t[a]<e[i]&&t[a]>1||t[a]>e[i])throw new Error("shape mismatch: mismatch is found in arg with shape (".concat(t,") not possible to broadcast dimension ").concat(n," with size ").concat(t[a]," to size ").concat(e[i]))}}function ua(t,e){var r=Ke(t);if(wn(r,e))return t;Bd(r,e);var n=Vs(r,e),a=n.length,i=[...Array(a-r.length).fill(1),...r],s=nA(t);r.length<a&&(s=el(s,i),r=Ke(s));for(var u=0;u<a;u++)r[u]<n[u]&&(s=rA(s,n[u],u),r=Ke(s));return s}function rA(t,e,r){return Od(...Array(e).fill(t),r)}function Hs(t,e){if(!Array.isArray(t))throw new Error("Array expected");var r=Ke(t);if(e.length!==r.length)throw new at(e.length,r.length);for(var n=0;n<e.length;n++)_t(e[n],r[n]);return e.reduce((a,i)=>a[i],t)}function rl(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(t.length===0)return[];if(r)return i(t);var n=[];return a(t,0);function a(s,u){if(Array.isArray(s)){for(var l=s.length,o=Array(l),c=0;c<l;c++)n[u]=c,o[c]=a(s[c],u+1);return o}else return e(s,n.slice(0,u),t)}
21function i(s){if(Array.isArray(s)){for(var u=s.length,l=Array(u),o=0;o<u;o++)l[o]=i(s[o]);return l}else return e(s)}}function kd(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(t.length===0)return;if(r){i(t);return}var n=[];a(t,0);function a(s,u){if(Array.isArray(s))for(var l=s.length,o=0;o<l;o++)n[u]=o,a(s[o],u+1);else e(s,n.slice(0,u),t)}function i(s){if(Array.isArray(s))for(var u=s.length,l=0;l<u;l++)i(s[l]);else e(s)}}function nA(t){return jt([],t)}function la(t,e,r,n){if(_i.isTypedFunction(t)){var a;if(n)a=1;else{var i=(e.isMatrix?e.size():Ke(e)).map(()=>0),s=e.isMatrix?e.get(i):Hs(e,i);a=sA(t,s,i,e)}var u;if(e.isMatrix&&e.dataType!=="mixed"&&e.dataType!==void 0){var l=aA(t,a);u=l!==void 0?l:t}else u=t;return a>=1&&a<=3?{isUnary:a===1,fn:function(){for(var c=arguments.length,f=new Array(c),d=0;d<c;d++)f[d]=arguments[d];return Id(u,f.slice(0,a),r,t.name)}}:{isUnary:!1,fn:function(){for(var c=arguments.length,f=new Array(c),d=0;d<c;d++)f[d]=arguments[d];return Id(u,f,r,t.name)}}}return n===void 0?{isUnary:iA(t),fn:t}:{isUnary:n,fn:t}}function aA(t,e){var r=[];if(Object.entries(t.signatures).forEach(n=>{var[a,i]=n;a.split(",").length===e&&r.push(i)}),r.length===1)return r[0]}function iA(t){if(t.length!==1)return!1;var e=t.toString();if(/arguments/.test(e))return!1;var r=e.match(/\(.*?\)/);return!/\.\.\./.test(r)}function sA(t,e,r,n){for(var a=[e,r,n],i=3;i>0;i--){var s=a.slice(0,i);if(_i.resolve(t,s)!==null)return i}}function Id(t,e,r,n){try{return t(...e)}catch(a){oA(a,e,r,n)}}function oA(t,e,r,n){var a;if(t instanceof TypeError&&((a=t.data)===null||a===void 0?void 0:a.category)==="wrongType"){var i=[];throw i.push("value: ".concat(Et(e[0]))),e.length>=2&&i.push("index: ".concat(Et(e[1]))),e.length>=3&&i.push("array: ".concat(Et(e[2]))),new TypeError("Function ".concat(r," cannot apply callback arguments ")+"".concat(n,"(").concat(i.join(", "),") at index ").concat(JSON.stringify(e[1])))}else throw new TypeError("Function ".concat(r," cannot apply callback arguments ")+"to function ".concat(n,": ").concat(t.message))}var uA="DenseMatrix",lA=["Matrix","config"],cA=U(uA,lA,t=>{var{Matrix:e,config:r}=t;function n(f,d){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(d&&!Rt(d))throw new Error("Invalid datatype: "+d);if(ze(f))f.type==="DenseMatrix"?(this._data=je(f._data),this._size=je(f._size),this._datatype=d||f._datatype):(this._data=f.toArray(),this._size=f.size(),this._datatype=d||f._datatype);else if(f&&Dt(f.data)&&Dt(f.size))this._data=f.data,this._size=f.size,Dd(this._data,this._size),this._datatype=d||f.datatype;else if(Dt(f))this._data=c(f),this._size=Ke(this._data),Dd(this._data,this._size),this._datatype=d;else{if(f)throw new TypeError("Unsupported type of data ("+Et(f)+")");this._data=[],this._size=[0],this._datatype=d}}n.prototype=new e,n.prototype.createDenseMatrix=function(f,d){return new n(f,d)},Object.defineProperty(n,"name",{value:"DenseMatrix"}),n.prototype.constructor=n,n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return Ys(this._data,Et)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(f,d){return new n(f,d)},n.prototype.subset=function(f,d,m){switch(arguments.length){case 1:return a(this,f);case 2:case 3:return s(this,f,d,m);default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.get=function(f){return Hs(this._data,f)},n.prototype.set=function(f,d,m){if(!Dt(f))throw new TypeError("Array expected");if(f.length<this._size.length)throw new at(f.length,this._size.length,"<");var h,p,g,v=f.map(function(y){return y+1});o(this,v,m);var D=this._data;for(h=0,p=f.length-1;h<p;h++)g=f[h],_t(g,D.length),D=D[g];return g=f[f.length-1],_t(g,D.length),D[g]=d,this};function a(f,d){if(!Si(d))throw new TypeError("Invalid index");var m=r.legacySubset?d.size().every(w=>w===1):d.isScalar();if(m)return f.get(d.min());var h=d.size();if(h.length!==f._size.length)throw new at(h.length,f._size.length);for(var p=d.min(),g=d.max(),v=0,D=f._size.length;v<D;v++)_t(p[v],f._size[v]),_t(g[v],f._size[v]);var y=new n,x=i(f._data,d);return y._size=x.size,y._datatype=f._datatype,y._data=x.data,r.legacySubset?y.reshape(d.size()):y}function i(f,d){var m=d.size().length-1,h=Array(m);return{data:p(f),size:h.filter(g=>g!==null)};function p(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,D=d.dimension(v);function y(x,w){return qe(x)?w(x):x.map(w).valueOf()}return qe(D)?h[v]=null:h[v]=D.size()[0],v<m?y(D,x=>(_t(x,g.length),p(g[x],v+1))):y(D,x=>(_t(x,g.length),g[x]))}}function s(f,d,m,h){if(!d||d.isIndex!==!0)throw new TypeError("Invalid index");var p=d.size(),g=d.isScalar(),v;if(ze(m)?(v=m.size(),m=m.valueOf()):v=Ke(m),g){if(v.length!==0)throw new TypeError("Scalar expected");f.set(d.min(),m,h)}else{if(!wn(v,p)){if(v.length===0)m=ua([m],p);else try{m=ua(m,p)}catch{}v=Ke(m)}if(p.length<f._size.length)throw new at(p.length,f._size.length,"<");if(v.length<p.length){for(var D=0,y=0;p[D]===1&&v[D]===1;)D++;for(;p[D]===1;)y++,D++;m=Sd(m,p.length,y,v)}if(!wn(p,v))throw new at(p,v,">");var x=d.max().map(function(w){return w+1});o(f,x,h),u(f._data,d,m)}return f}function u(f,d,m){var h=d.size().length-1;p(f,m);function p(g,v){var D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,y=d.dimension(D),x=(b,A)=>{_t(b,g.length),p(g[b],v[A[0]],D+1)},w=(b,A)=>{_t(b,g.length),g[b]=v[A[0]]};D<h?qe(y)?x(y,[0]):y.forEach(x):qe(y)?w(y,[0]):y.forEach(w)}}n.prototype.resize=function(f,d,m){if(!wr(f))throw new TypeError("Array or Matrix expected");var h=f.valueOf().map(g=>Array.isArray(g)&&g.length===1?g[0]:g),p=m?this.clone():this;return l(p,h,d)};function l(f,d,m){if(d.length===0){for(var h=f._data;Dt(h);)h=h[0];return h}return f._size=d.slice(0),f._data=za(f._data,f._size,m),f}n.prototype.reshape=function(f,d){var m=d?this.clone():this;m._data=el(m._data,f);var h=m._size.reduce((p,g)=>p*g);return m._size=tl(f,h),m};function o(f,d,m){for(var h=f._size.slice(0),p=!1;h.length<d.length;)h.push(0),p=!0;for(var g=0,v=d.length;g<v;g++)d[g]>h[g]&&(h[g]=d[g],p=!0);p&&l(f,h,m)}n.prototype.clone=function(){var f=new n({data:je(this._data),size:je(this._size),datatype:this._datatype});return f},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(f){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,m=this,h=m._size.length-1;if(h<0)return m.clone();var p=la(f,m,"map",d),g=p.fn,v=m.create(void 0,m._datatype);if(v._size=m._size,d||p.isUnary)return v._data=A(m._data),v;if(h===0){for(var D=m.valueOf(),y=Array(D.length),x=0;x<D.length;x++)y[x]=g(D[x],[x],m);return v._data=y,v}var w=[];return v._data=b(m._data),v;function b(S){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,N=Array(S.length);if(E<h)for(var _=0;_<S.length;_++)w[E]=_,N[_]=b(S[_],E+1);else for(var C=0;C<S.length;C++)w[E]=C,N[C]=g(S[C],w.slice(),m);return N}function A(S){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,N=Array(S.length);if(E<h)for(var _=0;_<S.length;_++)N[_]=A(S[_],E+1);else for(var C=0;C<S.length;C++)N[C]=g(S[C]);return N}},n.prototype.forEach=function(f){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,m=this,h=m._size.length-1;if(h<0)return;var p=la(f,m,"map",d),g=p.fn;if(d||p.isUnary){x(m._data);return}if(h===0){for(var v=0;v<m._data.length;v++)g(m._data[v],[v],m);return}var D=[];y(m._data);function y(w){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(b<h)for(var A=0;A<w.length;A++)D[b]=A,y(w[A],b+1);else for(var S=0;S<w.length;S++)D[b]=S,g(w[S],D.slice(),m)}function x(w){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(b<h)for(var A=0;A<w.length;A++)x(w[A],b+1);else for(var S=0;S<w.length;S++)g(w[S])}},n.prototype[Symbol.iterator]=function*(){var f=this._size.length-1;if(!(f<0)){if(f===0){for(var d=0;d<this._data.length;d++)yield{value:this._data[d],index:[d]};return}for(var m=Array(f+1).fill(0),h=this._size.reduce((y,x)=>y*x,1),p=0;p<h;p++){for(var g=this._data,v=0;v<f;v++)g=g[m[v]];yield{value:g[m[f]],index:m.slice()};for(var D=f;D>=0&&(m[D]++,!(m[D]<this._size[D]));D--)m[D]=0}}},n.prototype.rows=function(){var f=[],d=this.size();if(d.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");var m=this._data;for(var h of m)f.push(new n([h],this._datatype));return f},n.prototype.columns=function(){var f=this,d=[],m=this.size();if(m.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var h=this._data,p=function(D){var y=h.map(x=>[x[D]]);d.push(new n(y,f._datatype))},g=0;g<m[1];g++)p(g);return d},n.prototype.toArray=function(){return je(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(f){return ot(this._data,f)},n.prototype.toString=function(){return ot(this._data)},n.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(f){if(f){if(Qe(f)&&(f=f.toNumber()),!qe(f)||!$e(f))throw new TypeError("The parameter k must be an integer number")}else f=0;for(var d=f>0?f:0,m=f<0?-f:0,h=this._size[0],p=this._size[1],g=Math.min(h-m,p-d),v=[],D=0;D<g;D++)v[D]=this._data[D+m][D+d];return new n({data:v,size:[g],datatype:this._datatype})},n.diagonal=function(f,d,m,h){if(!Dt(f))throw new TypeError("Array expected, size parameter");if(f.length!==2)throw new Error("Only two dimensions matrix are supported");if(f=f.map(function(S){if(Qe(S)&&(S=S.toNumber()),!qe(S)||!$e(S)||S<1)throw new Error("Size values must be positive integers");return S}),m){if(Qe(m)&&(m=m.toNumber()),!qe(m)||!$e(m))throw new TypeError("The parameter k must be an integer number")}else m=0;var p=m>0?m:0,g=m<0?-m:0,v=f[0],D=f[1],y=Math.min(v-g,D-p),x;if(Dt(d)){if(d.length!==y)throw new Error("Invalid value array length");x=function(E){return d[E]}}else if(ze(d)){var w=d.size();if(w.length!==1||w[0]!==y)throw new Error("Invalid matrix length");x=function(E){return d.get([E])}}else x=function(){return d};h||(h=Qe(x(0))?x(0).mul(0):0);var b=[];if(f.length>0){b=za(b,f,h);for(var A=0;A<y;A++)b[A+g][A+p]=x(A)}return new n({data:b,size:[v,D]})},n.fromJSON=function(f){return new n(f)},n.prototype.swapRows=function(f,d){if(!qe(f)||!$e(f)||!qe(d)||!$e(d))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return _t(f,this._size[0]),_t(d,this._size[0]),n._swapRows(f,d,this._data),this},n._swapRows=function(f,d,m){var h=m[f];m[f]=m[d],m[d]=h};function c(f){return ze(f)?c(f.valueOf()):Dt(f)?f.map(c):f}return n},{isClass:!0}),Ld="clone",fA=["typed"],dA=U(Ld,fA,t=>{var{typed:e}=t;return e(Ld,{any:je})});function Rd(t){var e=t.length,r=t[0].length,n,a,i=[];for(a=0;a<r;a++){var s=[];for(n=0;n<e;n++)s.push(t[n][a]);i.push(s)}return i}function Va(t){for(var e=0;e<t.length;e++)if(wr(t[e]))return!0;return!1}function Yn(t,e){ze(t)?t.forEach(r=>e(r),!1,!0):kd(t,e,!0)}function nt(t,e,r){if(!r)return ze(t)?t.map(a=>e(a),!1,!0):rl(t,e,!0);var n=a=>a===0?a:e(a);return ze(t)?t.map(a=>n(a),!1,!0):rl(t,n,!0)}function Ws(t,e,r){var n=Array.isArray(t)?Ke(t):t.size();if(e<0||e>=n.length)throw new $r(e,n.length);return ze(t)?t.create(Gs(t.valueOf(),e,r),t.datatype()):Gs(t,e,r)}function Gs(t,e,r){var n,a,i,s;if(e<=0)if(Array.isArray(t[0])){for(s=Rd(t),a=[],n=0;n<s.length;n++)a[n]=Gs(s[n],e-1,r);return a}else{for(i=t[0],n=1;n<t.length;n++)i=r(i,t[n]);return i}else{for(a=[],n=0;n<t.length;n++)a[n]=Gs(t[n],e-1,r);return a}}function $d(t,e,r,n,a,i,s,u,l,o,c){var f=t._values,d=t._index,m=t._ptr,h,p,g,v;if(n)for(p=m[e],g=m[e+1],h=p;h<g;h++)v=d[h],r[v]!==i?(r[v]=i,s.push(v),n[v]=f[h]):(n[v]=u(n[v],f[h]),a[v]=i);else for(p=m[e],g=m[e+1],h=p;h<g;h++)v=d[h],r[v]!==i?(r[v]=i,s.push(v)):a[v]=i}var Pd="isInteger",mA=["typed"],hA=U(Pd,mA,t=>{var{typed:e}=t;return e(Pd,{number:$e,BigNumber:function(n){return n.isInt()},bigint:function(n){return!0},Fraction:function(n){return n.d===1n},"Array | Matrix":e.referToSelf(r=>n=>nt(n,r))})}),Zr="number",Ha="number, number";function qd(t){return Math.abs(t)}qd.signature=Zr;function Ud(t,e){return t+e}Ud.signature=Ha;function zd(t,e){return t-e}zd.signature=Ha;function Yd(t,e){return t*e}Yd.signature=Ha;function Vd(t){return-t}Vd.signature=Zr;function Hd(t){return t}Hd.signature=Zr;function Oi(t){return vD(t)}Oi.signature=Zr;function Wd(t){return t*t*t}Wd.signature=Zr;function Gd(t){return Math.exp(t)}Gd.signature=Zr;
vendor: 36,238 bytes, lines 21-23
21function jd(t){return gD(t)}jd.signature=Zr;function Zd(t,e){if(!$e(t)||!$e(e))throw new Error("Parameters in function lcm must be integer numbers");if(t===0||e===0)return 0;for(var r,n=t*e;e!==0;)r=e,e=t%r,t=r;return Math.abs(n/t)}Zd.signature=Ha;function Xd(t,e){return e?Math.log(t)/Math.log(e):Math.log(t)}function js(t){return hD(t)}js.signature=Zr;function nl(t){return mD(t)}nl.signature=Zr;function Jd(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,r=e<0;if(r&&(e=-e),e===0)throw new Error("Root must be non-zero");if(t<0&&Math.abs(e)%2!==1)throw new Error("Root must be odd when a is negative.");if(t===0)return r?1/0:0;if(!isFinite(t))return r?0:t;var n=Math.pow(Math.abs(t),1/e);return n=t<0?-n:n,r?1/n:n}function al(t){return In(t)}al.signature=Zr;function Qd(t){return t*t}Qd.signature=Zr;function Kd(t,e){var r,n,a,i=0,s=1,u=1,l=0;if(!$e(t)||!$e(e))throw new Error("Parameters in function xgcd must be integer numbers");for(;e;)n=Math.floor(t/e),a=t-n*e,r=i,i=s-n*i,s=r,r=u,u=l-n*u,l=r,t=e,e=a;var o;return t<0?o=[-t,-s,-l]:o=[t,t?s:0,l],o}Kd.signature=Ha;function em(t,e){return t*t<1&&e===1/0||t*t>1&&e===-1/0?0:Math.pow(t,e)}em.signature=Ha;function Bi(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!$e(e)||e<0||e>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(Jf(t,e))}var pA="number",Wa="number, number";function tm(t,e){if(!$e(t)||!$e(e))throw new Error("Integers expected in function bitAnd");return t&e}tm.signature=Wa;function rm(t){if(!$e(t))throw new Error("Integer expected in function bitNot");return~t}rm.signature=pA;function nm(t,e){if(!$e(t)||!$e(e))throw new Error("Integers expected in function bitOr");return t|e}nm.signature=Wa;function am(t,e){if(!$e(t)||!$e(e))throw new Error("Integers expected in function bitXor");return t^e}am.signature=Wa;function im(t,e){if(!$e(t)||!$e(e))throw new Error("Integers expected in function leftShift");return t<<e}im.signature=Wa;function sm(t,e){if(!$e(t)||!$e(e))throw new Error("Integers expected in function rightArithShift");return t>>e}sm.signature=Wa;function om(t,e){if(!$e(t)||!$e(e))throw new Error("Integers expected in function rightLogShift");return t>>>e}om.signature=Wa;function En(t,e){if(e<t)return 1;if(e===t)return e;var r=e+t>>1;return En(t,r)*En(r+1,e)}function um(t,e){if(!$e(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(!$e(e)||e<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=t-e,n=1,a=e<r?r+1:e+1,i=2,s=e<r?e:r,u=a;u<=t;++u)for(n*=u;i<=s&&n%i===0;)n/=i,++i;return i<=s&&(n/=En(i,s)),n}um.signature="number, number";var vA=Math.PI,gA=2*Math.PI,yA=Math.E,bA=1.618033988749895,wA="number",il="number, number";function lm(t){return!t}lm.signature=wA;function sl(t,e){return!!(t||e)}sl.signature=il;function ol(t,e){return!!t!=!!e}ol.signature=il;function ul(t,e){return!!(t&&e)}ul.signature=il;function Zs(t){var e;if($e(t))return t<=0?isFinite(t)?1/0:NaN:t>171?1/0:En(1,t-1);if(t<.5)return Math.PI/(Math.sin(Math.PI*t)*Zs(1-t));if(t>=171.35)return 1/0;if(t>85){var r=t*t,n=r*t,a=n*t,i=a*t;return Math.sqrt(2*Math.PI/t)*Math.pow(t/Math.E,t)*(1+1/(12*t)+1/(288*r)-139/(51840*n)-571/(2488320*a)+163879/(209018880*i)+5246819/(75246796800*i*t))}--t,e=Ga[0];for(var s=1;s<Ga.length;++s)e+=Ga[s]/(t+s);var u=t+cm+.5;return Math.sqrt(2*Math.PI)*Math.pow(u,t+.5)*Math.exp(-u)*e}Zs.signature="number";var cm=4.7421875,Ga=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],fm=.9189385332046728,xA=5,DA=7,dm=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];function Xs(t){if(t<0)return NaN;if(t===0)return 1/0;if(!isFinite(t))return t;if(t<.5)return Math.log(Math.PI/Math.sin(Math.PI*t))-Xs(1-t);t=t-1;for(var e=t+xA+.5,r=dm[0],n=DA-1;n>=1;n--)r+=dm[n]/(t+n);return fm+(t+.5)*Math.log(e)-e+Math.log(r)}Xs.signature="number";var lr="number";function mm(t){return xD(t)}mm.signature=lr;function hm(t){return Math.atan(1/t)}hm.signature=lr;function pm(t){return isFinite(t)?(Math.log((t+1)/t)+Math.log(t/(t-1)))/2:0}pm.signature=lr;function vm(t){return Math.asin(1/t)}vm.signature=lr;function gm(t){var e=1/t;return Math.log(e+Math.sqrt(e*e+1))}gm.signature=lr;function bm(t){return Math.acos(1/t)}bm.signature=lr;function wm(t){var e=1/t,r=Math.sqrt(e*e-1);return Math.log(r+e)}wm.signature=lr;function xm(t){return DD(t)}xm.signature=lr;function Dm(t){return ED(t)}Dm.signature=lr;function Em(t){return 1/Math.tan(t)}Em.signature=lr;function Am(t){var e=Math.exp(2*t);return(e+1)/(e-1)}Am.signature=lr;function Sm(t){return 1/Math.sin(t)}Sm.signature=lr;function Nm(t){return t===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(t)-Math.exp(-t)))*In(t)}Nm.signature=lr;function _m(t){return 1/Math.cos(t)}_m.signature=lr;function Cm(t){return 2/(Math.exp(t)+Math.exp(-t))}Cm.signature=lr;function Mm(t){return SD(t)}Mm.signature=lr;var ll="number";function Tm(t){return t<0}Tm.signature=ll;function Fm(t){return t>0}Fm.signature=ll;function Om(t){return Number.isNaN(t)}Om.signature=ll;function Pr(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e-9,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(r<=0)throw new Error("Relative tolerance must be greater than 0");if(n<0)throw new Error("Absolute tolerance must be at least 0");return t.isNaN()||e.isNaN()?!1:!t.isFinite()||!e.isFinite()?t.eq(e):t.eq(e)?!0:t.minus(e).abs().lte(t.constructor.max(t.constructor.max(t.abs(),e.abs()).mul(r),n))}var Bm="isNegative",EA=["typed","config"],AA=U(Bm,EA,t=>{var{typed:e,config:r}=t;return e(Bm,{number:n=>Zt(n,0,r.relTol,r.absTol)?!1:Tm(n),BigNumber:n=>Pr(n,new n.constructor(0),r.relTol,r.absTol)?!1:n.isNeg()&&!n.isZero()&&!n.isNaN(),bigint:n=>n<0n,Fraction:n=>n.s<0n,Unit:e.referToSelf(n=>a=>e.find(n,a.valueType())(a.value)),"Array | Matrix":e.referToSelf(n=>a=>nt(a,n))})}),km="isNumeric",SA=["typed"],NA=U(km,SA,t=>{var{typed:e}=t;return e(km,{"number | BigNumber | bigint | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":e.referToSelf(r=>n=>nt(n,r))})}),Im="hasNumericValue",_A=["typed","isNumeric"],CA=U(Im,_A,t=>{var{typed:e,isNumeric:r}=t;return e(Im,{boolean:()=>!0,string:function(a){return a.trim().length>0&&!isNaN(Number(a))},any:function(a){return r(a)}})}),Lm="isPositive",MA=["typed","config"],TA=U(Lm,MA,t=>{var{typed:e,config:r}=t;return e(Lm,{number:n=>Zt(n,0,r.relTol,r.absTol)?!1:Fm(n),BigNumber:n=>Pr(n,new n.constructor(0),r.relTol,r.absTol)?!1:!n.isNeg()&&!n.isZero()&&!n.isNaN(),bigint:n=>n>0n,Fraction:n=>n.s>0n&&n.n>0n,Unit:e.referToSelf(n=>a=>e.find(n,a.valueType())(a.value)),"Array | Matrix":e.referToSelf(n=>a=>nt(a,n))})}),Rm="isZero",FA=["typed","equalScalar"],OA=U(Rm,FA,t=>{var{typed:e,equalScalar:r}=t;return e(Rm,{"number | BigNumber | Complex | Fraction":n=>r(n,0),bigint:n=>n===0n,Unit:e.referToSelf(n=>a=>e.find(n,a.valueType())(a.value)),"Array | Matrix":e.referToSelf(n=>a=>nt(a,n))})}),$m="isNaN",BA=["typed"],kA=U($m,BA,t=>{var{typed:e}=t;return e($m,{number:Om,BigNumber:function(n){return n.isNaN()},bigint:function(n){return!1},Fraction:function(n){return!1},Complex:function(n){return n.isNaN()},Unit:function(n){return Number.isNaN(n.value)},"Array | Matrix":e.referToSelf(r=>n=>nt(n,r))})}),Pm="typeOf",IA=["typed"],LA=U(Pm,IA,t=>{var{typed:e}=t;return e(Pm,{any:Et})});function RA(t,e,r,n){return Zt(t.re,e.re,r,n)&&Zt(t.im,e.im,r,n)}var ja=U("compareUnits",["typed"],t=>{var{typed:e}=t;return{"Unit, Unit":e.referToSelf(r=>(n,a)=>{if(!n.equalBase(a))throw new Error("Cannot compare units with different base");return e.find(r,[n.valueType(),a.valueType()])(n.value,a.value)})}}),Js="equalScalar",$A=["typed","config"],PA=U(Js,$A,t=>{var{typed:e,config:r}=t,n=ja({typed:e});return e(Js,{"boolean, boolean":function(i,s){return i===s},"number, number":function(i,s){return Zt(i,s,r.relTol,r.absTol)},"BigNumber, BigNumber":function(i,s){return i.eq(s)||Pr(i,s,r.relTol,r.absTol)},"bigint, bigint":function(i,s){return i===s},"Fraction, Fraction":function(i,s){return i.equals(s)},"Complex, Complex":function(i,s){return RA(i,s,r.relTol,r.absTol)}},n)});U(Js,["typed","config"],t=>{var{typed:e,config:r}=t;return e(Js,{"number, number":function(a,i){return Zt(a,i,r.relTol,r.absTol)}})});var qA="SparseMatrix",UA=["typed","equalScalar","Matrix"],zA=U(qA,UA,t=>{var{typed:e,equalScalar:r,Matrix:n}=t;function a(p,g){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");if(g&&!Rt(g))throw new Error("Invalid datatype: "+g);if(ze(p))i(this,p,g);else if(p&&Dt(p.index)&&Dt(p.ptr)&&Dt(p.size))this._values=p.values,this._index=p.index,this._ptr=p.ptr,this._size=p.size,this._datatype=g||p.datatype;else if(Dt(p))s(this,p,g);else{if(p)throw new TypeError("Unsupported type of data ("+Et(p)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=g}}function i(p,g,v){g.type==="SparseMatrix"?(p._values=g._values?je(g._values):void 0,p._index=je(g._index),p._ptr=je(g._ptr),p._size=je(g._size),p._datatype=v||g._datatype):s(p,g.valueOf(),v||g._datatype)}function s(p,g,v){p._values=[],p._index=[],p._ptr=[],p._datatype=v;var D=g.length,y=0,x=r,w=0;if(Rt(v)&&(x=e.find(r,[v,v])||r,w=e.convert(0,v)),D>0){var b=0;do{p._ptr.push(p._index.length);for(var A=0;A<D;A++){var S=g[A];if(Dt(S)){if(b===0&&y<S.length&&(y=S.length),b<S.length){var E=S[b];x(E,w)||(p._values.push(E),p._index.push(A))}}else b===0&&y<1&&(y=1),x(S,w)||(p._values.push(S),p._index.push(A))}b++}while(b<y)}p._ptr.push(p._index.length),p._size=[D,y]}a.prototype=new n,a.prototype.createSparseMatrix=function(p,g){return new a(p,g)},Object.defineProperty(a,"name",{value:"SparseMatrix"}),a.prototype.constructor=a,a.prototype.type="SparseMatrix",a.prototype.isSparseMatrix=!0,a.prototype.getDataType=function(){return Ys(this._values,Et)},a.prototype.storage=function(){return"sparse"},a.prototype.datatype=function(){return this._datatype},a.prototype.create=function(p,g){return new a(p,g)},a.prototype.density=function(){var p=this._size[0],g=this._size[1];return p!==0&&g!==0?this._index.length/(p*g):0},a.prototype.subset=function(p,g,v){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return u(this,p);case 2:case 3:return l(this,p,g,v);default:throw new SyntaxError("Wrong number of arguments")}};function u(p,g){if(!Si(g))throw new TypeError("Invalid index");var v=g.isScalar();if(v)return p.get(g.min());var D=g.size();if(D.length!==p._size.length)throw new at(D.length,p._size.length);var y,x,w,b,A=g.min(),S=g.max();for(y=0,x=p._size.length;y<x;y++)_t(A[y],p._size[y]),_t(S[y],p._size[y]);var E=p._values,N=p._index,_=p._ptr,C=g.dimension(0),O=g.dimension(1),I=[],k=[];function M(te,B){k[te]=B[0],I[te]=!0}Number.isInteger(C)?M(C,[0]):C.forEach(M);var H=E?[]:void 0,q=[],z=[];function X(te){for(z.push(q.length),w=_[te],b=_[te+1];w<b;w++)y=N[w],I[y]===!0&&(q.push(k[y]),H&&H.push(E[w]))}return Number.isInteger(O)?X(O):O.forEach(X),z.push(q.length),new a({values:H,index:q,ptr:z,size:D,datatype:p._datatype})}function l(p,g,v,D){if(!g||g.isIndex!==!0)throw new TypeError("Invalid index");var y=g.size(),x=g.isScalar(),w;if(ze(v)?(w=v.size(),v=v.toArray()):w=Ke(v),x){if(w.length!==0)throw new TypeError("Scalar expected");p.set(g.min(),v,D)}else{if(y.length!==1&&y.length!==2)throw new at(y.length,p._size.length,"<");if(w.length<y.length){for(var b=0,A=0;y[b]===1&&w[b]===1;)b++;for(;y[b]===1;)A++,b++;v=Sd(v,y.length,A,w)}if(!wn(y,w))throw new at(y,w,">");if(y.length===1){var S=g.dimension(0);_(S,(C,O)=>{_t(C),p.set([C,0],v[O[0]],D)})}else{var E=g.dimension(0),N=g.dimension(1);_(E,(C,O)=>{_t(C),_(N,(I,k)=>{_t(I),p.set([C,I],v[O[0]][k[0]],D)})})}}return p;function _(C,O){qe(C)?O(C,[0]):C.forEach(O)}}a.prototype.get=function(p){if(!Dt(p))throw new TypeError("Array expected");if(p.length!==this._size.length)throw new at(p.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var g=p[0],v=p[1];_t(g,this._size[0]),_t(v,this._size[1]);var D=o(g,this._ptr[v],this._ptr[v+1],this._index);return D<this._ptr[v+1]&&this._index[D]===g?this._values[D]:0},a.prototype.set=function(p,g,v){if(!Dt(p))throw new TypeError("Array expected");if(p.length!==this._size.length)throw new at(p.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var D=p[0],y=p[1],x=this._size[0],w=this._size[1],b=r,A=0;Rt(this._datatype)&&(b=e.find(r,[this._datatype,this._datatype])||r,A=e.convert(0,this._datatype)),(D>x-1||y>w-1)&&(d(this,Math.max(D+1,x),Math.max(y+1,w),v),x=this._size[0],w=this._size[1]),_t(D,x),_t(y,w);var S=o(D,this._ptr[y],this._ptr[y+1],this._index);return S<this._ptr[y+1]&&this._index[S]===D?b(g,A)?c(S,y,this._values,this._index,this._ptr):this._values[S]=g:b(g,A)||f(S,D,y,g,this._values,this._index,this._ptr),this};function o(p,g,v,D){if(v-g===0)return v;for(var y=g;y<v;y++)if(D[y]===p)return y;return g}function c(p,g,v,D,y){v.splice(p,1),D.splice(p,1);for(var x=g+1;x<y.length;x++)y[x]--}function f(p,g,v,D,y,x,w){y.splice(p,0,D),x.splice(p,0,g);for(var b=v+1;b<w.length;b++)w[b]++}a.prototype.resize=function(p,g,v){if(!wr(p))throw new TypeError("Array or Matrix expected");var D=p.valueOf().map(x=>Array.isArray(x)&&x.length===1?x[0]:x);if(D.length!==2)throw new Error("Only two dimensions matrix are supported");D.forEach(function(x){if(!qe(x)||!$e(x)||x<0)throw new TypeError("Invalid size, must contain positive integers (size: "+ot(D)+")")});var y=v?this.clone():this;return d(y,D[0],D[1],g)};function d(p,g,v,D){var y=D||0,x=r,w=0;Rt(p._datatype)&&(x=e.find(r,[p._datatype,p._datatype])||r,w=e.convert(0,p._datatype),y=e.convert(y,p._datatype));var b=!x(y,w),A=p._size[0],S=p._size[1],E,N,_;if(v>S){for(N=S;N<v;N++)if(p._ptr[N]=p._values.length,b)for(E=0;E<A;E++)p._values.push(y),p._index.push(E);p._ptr[v]=p._values.length}else v<S&&(p._ptr.splice(v+1,S-v),p._values.splice(p._ptr[v],p._values.length),p._index.splice(p._ptr[v],p._index.length));if(S=v,g>A){if(b){var C=0;for(N=0;N<S;N++){p._ptr[N]=p._ptr[N]+C,_=p._ptr[N+1]+C;var O=0;for(E=A;E<g;E++,O++)p._values.splice(_+O,0,y),p._index.splice(_+O,0,E),C++}p._ptr[S]=p._values.length}}else if(g<A){var I=0;for(N=0;N<S;N++){p._ptr[N]=p._ptr[N]-I;var k=p._ptr[N],M=p._ptr[N+1]-I;for(_=k;_<M;_++)E=p._index[_],E>g-1&&(p._values.splice(_,1),p._index.splice(_,1),I++)}p._ptr[N]=p._values.length}return p._size[0]=g,p._size[1]=v,p}a.prototype.reshape=function(p,g){if(!Dt(p))throw new TypeError("Array expected");if(p.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");p.forEach(function(z){if(!qe(z)||!$e(z)||z<=-2||z===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+ot(p)+")")});var v=this._size[0]*this._size[1];p=tl(p,v);var D=p[0]*p[1];if(v!==D)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var y=g?this.clone():this;if(this._size[0]===p[0]&&this._size[1]===p[1])return y;for(var x=[],w=0;w<y._ptr.length;w++)for(var b=0;b<y._ptr[w+1]-y._ptr[w];b++)x.push(w);for(var A=y._values.slice(),S=y._index.slice(),E=0;E<y._index.length;E++){var N=S[E],_=x[E],C=N*y._size[1]+_;x[E]=C%p[1],S[E]=Math.floor(C/p[1])}y._values.length=0,y._index.length=0,y._ptr.length=p[1]+1,y._size=p.slice();for(var O=0;O<y._ptr.length;O++)y._ptr[O]=0;for(var I=0;I<A.length;I++){var k=S[I],M=x[I],H=A[I],q=o(k,y._ptr[M],y._ptr[M+1],y._index);f(q,k,M,H,y._values,y._index,y._ptr)}return y},a.prototype.clone=function(){var p=new a({values:this._values?je(this._values):void 0,index:je(this._index),ptr:je(this._ptr),size:je(this._size),datatype:this._datatype});return p},a.prototype.size=function(){return this._size.slice(0)},a.prototype.map=function(p,g){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var v=this,D=this._size[0],y=this._size[1],x=la(p,v,"map"),w=function(A,S,E){return x.fn(A,[S,E],v)};return m(this,0,D-1,0,y-1,w,g)};function m(p,g,v,D,y,x,w){var b=[],A=[],S=[],E=r,N=0;Rt(p._datatype)&&(E=e.find(r,[p._datatype,p._datatype])||r,N=e.convert(0,p._datatype));for(var _=function(j,R,oe){var se=x(j,R,oe);E(se,N)||(b.push(se),A.push(R))},C=D;C<=y;C++){S.push(b.length);var O=p._ptr[C],I=p._ptr[C+1];if(w)for(var k=O;k<I;k++){var M=p._index[k];M>=g&&M<=v&&_(p._values[k],M-g,C-D)}else{for(var H={},q=O;q<I;q++){var z=p._index[q];H[z]=p._values[q]}for(var X=g;X<=v;X++){var te=X in H?H[X]:0;_(te,X-g,C-D)}}}return S.push(b.length),new a({values:b,index:A,ptr:S,size:[v-g+1,y-D+1]})}a.prototype.forEach=function(p,g){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var v=this,D=this._size[0],y=this._size[1],x=la(p,v,"forEach"),w=0;w<y;w++){var b=this._ptr[w],A=this._ptr[w+1];if(g)for(var S=b;S<A;S++){var E=this._index[S];x.fn(this._values[S],[E,w],v)}else{for(var N={},_=b;_<A;_++){var C=this._index[_];N[C]=this._values[_]}for(var O=0;O<D;O++){var I=O in N?N[O]:0;x.fn(I,[O,w],v)}}}},a.prototype[Symbol.iterator]=function*(){if(!this._values)throw new Error("Cannot iterate a Pattern only matrix");for(var p=this._size[1],g=0;g<p;g++)for(var v=this._ptr[g],D=this._ptr[g+1],y=v;y<D;y++){var x=this._index[y];yield{value:this._values[y],index:[x,g]}}},a.prototype.toArray=function(){return h(this._values,this._index,this._ptr,this._size,!0)},a.prototype.valueOf=function(){return h(this._values,this._index,this._ptr,this._size,!1)};function h(p,g,v,D,y){var x=D[0],w=D[1],b=[],A,S;for(A=0;A<x;A++)for(b[A]=[],S=0;S<w;S++)b[A][S]=0;for(S=0;S<w;S++)for(var E=v[S],N=v[S+1],_=E;_<N;_++)A=g[_],b[A][S]=p?y?je(p[_]):p[_]:1;return b}return a.prototype.format=function(p){for(var g=this._size[0],v=this._size[1],D=this.density(),y="Sparse Matrix ["+ot(g,p)+" x "+ot(v,p)+"] density: "+ot(D,p)+` 22`,x=0;x<v;x++)for(var w=this._ptr[x],b=this._ptr[x+1],A=w;A<b;A++){var S=this._index[A];y+=` 23 (`+ot(S,p)+", "+ot(x,p)+") ==> "+(this._values?ot(this._values[A],p):"X")}return y},a.prototype.toString=function(){return ot(this.toArray())},a.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},a.prototype.diagonal=function(p){if(p){if(Qe(p)&&(p=p.toNumber()),!qe(p)||!$e(p))throw new TypeError("The parameter k must be an integer number")}else p=0;var g=p>0?p:0,v=p<0?-p:0,D=this._size[0],y=this._size[1],x=Math.min(D-v,y-g),w=[],b=[],A=[];A[0]=0;for(var S=g;S<y&&w.length<x;S++)for(var E=this._ptr[S],N=this._ptr[S+1],_=E;_<N;_++){var C=this._index[_];if(C===S-g+v){w.push(this._values[_]),b[w.length-1]=C-v;break}}return A.push(w.length),new a({values:w,index:b,ptr:A,size:[x,1]})},a.fromJSON=function(p){return new a(p)},a.diagonal=function(p,g,v,D,y){if(!Dt(p))throw new TypeError("Array expected, size parameter");if(p.length!==2)throw new Error("Only two dimensions matrix are supported");if(p=p.map(function(z){if(Qe(z)&&(z=z.toNumber()),!qe(z)||!$e(z)||z<1)throw new Error("Size values must be positive integers");return z}),v){if(Qe(v)&&(v=v.toNumber()),!qe(v)||!$e(v))throw new TypeError("The parameter k must be an integer number")}else v=0;var x=r,w=0;Rt(y)&&(x=e.find(r,[y,y])||r,w=e.convert(0,y));var b=v>0?v:0,A=v<0?-v:0,S=p[0],E=p[1],N=Math.min(S-A,E-b),_;if(Dt(g)){if(g.length!==N)throw new Error("Invalid value array length");_=function(X){return g[X]}}else if(ze(g)){var C=g.size();if(C.length!==1||C[0]!==N)throw new Error("Invalid matrix length");_=function(X){return g.get([X])}}else _=function(){return g};for(var O=[],I=[],k=[],M=0;M<E;M++){k.push(O.length);var H=M-b;if(H>=0&&H<N){var q=_(H);x(q,w)||(I.push(H+A),O.push(q))}}return k.push(O.length),new a({values:O,index:I,ptr:k,size:[S,E]})},a.prototype.swapRows=function(p,g){if(!qe(p)||!$e(p)||!qe(g)||!$e(g))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return _t(p,this._size[0]),_t(g,this._size[0]),a._swapRows(p,g,this._size[1],this._values,this._index,this._ptr),this},a._forEachRow=function(p,g,v,D,y){for(var x=D[p],w=D[p+1],b=x;b<w;b++)y(v[b],g[b])},a._swapRows=function(p,g,v,D,y,x){for(var w=0;w<v;w++){var b=x[w],A=x[w+1],S=o(p,b,A,y),E=o(g,b,A,y);if(S<A&&E<A&&y[S]===p&&y[E]===g){if(D){var N=D[S];D[S]=D[E],D[E]=N}continue}if(S<A&&y[S]===p&&(E>=A||y[E]!==g)){var _=D?D[S]:void 0;y.splice(E,0,g),D&&D.splice(E,0,_),y.splice(E<=S?S+1:S,1),D&&D.splice(E<=S?S+1:S,1);continue}if(E<A&&y[E]===g&&(S>=A||y[S]!==p)){var C=D?D[E]:void 0;y.splice(S,0,p),D&&D.splice(S,0,C),y.splice(S<=E?E+1:E,1),D&&D.splice(S<=E?E+1:E,1)}}},a},{isClass:!0}),YA="number",VA=["typed"];function HA(t){var e=t.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(e){var r={"0b":2,"0o":8,"0x":16}[e[1]],n=e[2],a=e[3];return{input:t,radix:r,integerPart:n,fractionalPart:a}}else return null}function WA(t){for(var e=parseInt(t.integerPart,t.radix),r=0,n=0;n<t.fractionalPart.length;n++){var a=parseInt(t.fractionalPart[n],t.radix);r+=a/Math.pow(t.radix,n+1)}var i=e+r;if(isNaN(i))throw new SyntaxError('String "'+t.input+'" is not a valid number');return i}var GA=U(YA,VA,t=>{var{typed:e}=t,r=e("number",{"":function(){return 0},number:function(a){return a},string:function(a){if(a==="NaN")return NaN;var i=HA(a);if(i)return WA(i);var s=0,u=a.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);u&&(s=Number(u[2]),a=u[1]);var l=Number(a);if(isNaN(l))throw new SyntaxError('String "'+a+'" is not a valid number');if(u){if(l>2**s-1)throw new SyntaxError('String "'.concat(a,'" is out of range'));l>=2**(s-1)&&(l=l-2**s)}return l},BigNumber:function(a){return a.toNumber()},bigint:function(a){return Number(a)},Fraction:function(a){return a.valueOf()},Unit:e.referToSelf(n=>a=>{var i=a.clone();return i.value=n(a.value),i}),null:function(a){return 0},"Unit, string | Unit":function(a,i){return a.toNumber(i)},"Array | Matrix":e.referToSelf(n=>a=>nt(a,n))});return r.fromJSON=function(n){return parseFloat(n.value)},r}),jA="bigint",ZA=["typed"],XA=U(jA,ZA,t=>{var{typed:e}=t,r=e("bigint",{"":function(){return 0n},bigint:function(a){return a},number:function(a){return BigInt(a.toFixed())},BigNumber:function(a){return BigInt(a.round().toString())},Fraction:function(a){return BigInt(a.valueOf().toFixed())},"string | boolean":function(a){return BigInt(a)},null:function(a){return 0n},"Array | Matrix":e.referToSelf(n=>a=>nt(a,n))});return r.fromJSON=function(n){return BigInt(n.value)},r}),qm="string",JA=["typed"],QA=U(qm,JA,t=>{var{typed:e}=t;return e(qm,{"":function(){return""},number:ia,null:function(n){return"null"},boolean:function(n){return n+""},string:function(n){return n},"Array | Matrix":e.referToSelf(r=>n=>nt(n,r)),any:function(n){return String(n)}})}),Um="boolean",KA=["typed"],eS=U(Um,KA,t=>{var{typed:e}=t;return e(Um,{"":function(){return!1},boolean:function(n){return n},number:function(n){return!!n},null:function(n){return!1},BigNumber:function(n){return!n.isZero()},string:function(n){var a=n.toLowerCase();if(a==="true")return!0;if(a==="false")return!1;var i=Number(n);if(n!==""&&!isNaN(i))return!!i;throw new Error('Cannot convert "'+n+'" to a boolean')},"Array | Matrix":e.referToSelf(r=>n=>nt(n,r))})}),tS="bignumber",rS=["typed","BigNumber"],nS=U(tS,rS,t=>{var{typed:e,BigNumber:r}=t;return e("bignumber",{"":function(){return new r(0)},number:function(a){return new r(a+"")},string:function(a){var i=a.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(i){var s=i[2],u=r(i[1]),l=new r(2).pow(Number(s));if(u.gt(l.sub(1)))throw new SyntaxError('String "'.concat(a,'" is out of range'));var o=new r(2).pow(Number(s)-1);return u.gte(o)?u.sub(l):u}return new r(a)},BigNumber:function(a){return a},bigint:function(a){return new r(a.toString())},Unit:e.referToSelf(n=>a=>{var i=a.clone();return i.value=n(a.value),i}),Fraction:function(a){return new r(String(a.n)).div(String(a.d)).times(String(a.s))},null:function(a){return new r(0)},"Array | Matrix":e.referToSelf(n=>a=>nt(a,n))})}),aS="complex",iS=["typed","Complex"],sS=U(aS,iS,t=>{var{typed:e,Complex:r}=t;return e("complex",{"":function(){return r.ZERO},number:function(a){return new r(a,0)},"number, number":function(a,i){return new r(a,i)},"BigNumber, BigNumber":function(a,i){return new r(a.toNumber(),i.toNumber())},Fraction:function(a){return new r(a.valueOf(),0)},Complex:function(a){return a.clone()},string:function(a){return r(a)},null:function(a){return r(0)},Object:function(a){if("re"in a&&"im"in a)return new r(a.re,a.im);if("r"in a&&"phi"in a||"abs"in a&&"arg"in a)return new r(a);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":e.referToSelf(n=>a=>nt(a,n))})}),oS="fraction",uS=["typed","Fraction"],lS=U(oS,uS,t=>{var{typed:e,Fraction:r}=t;return e("fraction",{number:function(a){if(!isFinite(a)||isNaN(a))throw new Error(a+" cannot be represented as a fraction");return new r(a)},string:function(a){return new r(a)},"number, number":function(a,i){return new r(a,i)},"bigint, bigint":function(a,i){return new r(a,i)},null:function(a){return new r(0)},BigNumber:function(a){return new r(a.toString())},bigint:function(a){return new r(a.toString())},Fraction:function(a){return a},Unit:e.referToSelf(n=>a=>{var i=a.clone();return i.value=n(a.value),i}),Object:function(a){return new r(a)},"Array | Matrix":e.referToSelf(n=>a=>nt(a,n))})}),zm="matrix",cS=["typed","Matrix","DenseMatrix","SparseMatrix"],fS=U(zm,cS,t=>{var{typed:e,Matrix:r,DenseMatrix:n,SparseMatrix:a}=t;return e(zm,{"":function(){return i([])},string:function(u){return i([],u)},"string, string":function(u,l){return i([],u,l)},Array:function(u){return i(u)},Matrix:function(u){return i(u,u.storage())},"Array | Matrix, string":i,"Array | Matrix, string, string":i});function i(s,u,l){if(u==="dense"||u==="default"||u===void 0)return new n(s,l);if(u==="sparse")return new a(s,l);throw new TypeError("Unknown matrix type "+JSON.stringify(u)+".")}}),Ym="matrixFromFunction",dS=["typed","matrix","isZero"],mS=U(Ym,dS,t=>{var{typed:e,matrix:r,isZero:n}=t;return e(Ym,{"Array | Matrix, function, string, string":function(s,u,l,o){return a(s,u,l,o)},"Array | Matrix, function, string":function(s,u,l){return a(s,u,l)},"Matrix, function":function(s,u){return a(s,u,"dense")},"Array, function":function(s,u){return a(s,u,"dense").toArray()},"Array | Matrix, string, function":function(s,u,l){return a(s,l,u)},"Array | Matrix, string, string, function":function(s,u,l,o){return a(s,o,u,l)}});function a(i,s,u,l){var o;return l!==void 0?o=r(u,l):o=r(u),o.resize(i),o.forEach(function(c,f){var d=s(f);n(d)||o.set(f,d)}),o}}),Vm="matrixFromRows",hS=["typed","matrix","flatten","size"],pS=U(Vm,hS,t=>{var{typed:e,matrix:r,flatten:n,size:a}=t;return e(Vm,{"...Array":function(l){return i(l)},"...Matrix":function(l){return r(i(l.map(o=>o.toArray())))}});function i(u){if(u.length===0)throw new TypeError("At least one row is needed to construct a matrix.");var l=s(u[0]),o=[];for(var c of u){var f=s(c);if(f!==l)throw new TypeError("The vectors had different length: "+(l|0)+" â "+(f|0));o.push(n(c))}return o}function s(u){var l=a(u);if(l.length===1)return l[0];if(l.length===2){if(l[0]===1)return l[1];if(l[1]===1)return l[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}}),Hm="matrixFromColumns",vS=["typed","matrix","flatten","size"],gS=U(Hm,vS,t=>{var{typed:e,matrix:r,flatten:n,size:a}=t;return e(Hm,{"...Array":function(l){return i(l)},"...Matrix":function(l){return r(i(l.map(o=>o.toArray())))}});function i(u){if(u.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var l=s(u[0]),o=[],c=0;c<l;c++)o[c]=[];for(var f of u){var d=s(f);if(d!==l)throw new TypeError("The vectors had different length: "+(l|0)+" â "+(d|0));for(var m=n(f),h=0;h<l;h++)o[h].push(m[h])}return o}function s(u){var l=a(u);if(l.length===1)return l[0];if(l.length===2){if(l[0]===1)return l[1];if(l[1]===1)return l[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}}),Wm="splitUnit",yS=["typed"],bS=U(Wm,yS,t=>{var{typed:e}=t;return e(Wm,{"Unit, Array":function(n,a){return n.splitUnit(a)}})}),Gm="unaryMinus",wS=["typed"],xS=U(Gm,wS,t=>{var{typed:e}=t;return e(Gm,{number:Vd,"Complex | BigNumber | Fraction":r=>r.neg(),bigint:r=>-r,Unit:e.referToSelf(r=>n=>{var a=n.clone();return a.value=e.find(r,a.valueType())(n.value),a}),"Array | Matrix":e.referToSelf(r=>n=>nt(n,r,!0))})}),jm="unaryPlus",DS=["typed","config","numeric"],ES=U(jm,DS,t=>{var{typed:e,config:r,numeric:n}=t;return e(jm,{number:Hd,Complex:function(i){return i},BigNumber:function(i){return i},bigint:function(i){return i},Fraction:function(i){return i},Unit:function(i){return i.clone()},"Array | Matrix":e.referToSelf(a=>i=>nt(i,a,!0)),boolean:function(i){return n(i?1:0,r.number)},string:function(i){return n(i,kn(i,r))}})}),Zm="abs",AS=["typed"],SS=U(Zm,AS,t=>{var{typed:e}=t;return e(Zm,{number:qd,"Complex | BigNumber | Fraction | Unit":r=>r.abs(),bigint:r=>r<0n?-r:r,"Array | Matrix":e.referToSelf(r=>n=>nt(n,r,!0))})}),Xm="mapSlices",NS=["typed","isInteger"],cl=U(Xm,NS,t=>{var{typed:e,isInteger:r}=t;return e(Xm,{"Array | Matrix, number | BigNumber, function":function(a,i,s){if(!r(i))throw new TypeError("Integer number expected for dimension");var u=Array.isArray(a)?Ke(a):a.size();if(i<0||i>=u.length)throw new $r(i,u.length);return ze(a)?a.create(Qs(a.valueOf(),i,s),a.datatype()):Qs(a,i,s)}})},{formerly:"apply"});function Qs(t,e,r){var n,a,i;if(e<=0)if(Array.isArray(t[0])){for(i=_S(t),a=[],n=0;n<i.length;n++)a[n]=Qs(i[n],e-1,r);return a}else return r(t);else{for(a=[],n=0;n<t.length;n++)a[n]=Qs(t[n],e-1,r);return a}}function _S(t){var e=t.length,r=t[0].length,n,a,i=[];for(a=0;a<r;a++){var s=[];for(n=0;n<e;n++)s.push(t[n][a]);i.push(s)}return i}var Jm="addScalar",CS=["typed"],MS=U(Jm,CS,t=>{var{typed:e}=t;return e(Jm,{"number, number":Ud,"Complex, Complex":function(n,a){return n.add(a)},"BigNumber, BigNumber":function(n,a){return n.plus(a)},"bigint, bigint":function(n,a){return n+a},"Fraction, Fraction":function(n,a){return n.add(a)},"Unit, Unit":e.referToSelf(r=>(n,a)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(a.value===null||a.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(a))throw new Error("Units do not match");var i=n.clone();return i.value=e.find(r,[i.valueType(),a.valueType()])(i.value,a.value),i.fixPrefix=!1,i})})}),Qm="subtractScalar",TS=["typed"],FS=U(Qm,TS,t=>{var{typed:e}=t;return e(Qm,{"number, number":zd,"Complex, Complex":function(n,a){return n.sub(a)},"BigNumber, BigNumber":function(n,a){return n.minus(a)},"bigint, bigint":function(n,a){return n-a},"Fraction, Fraction":function(n,a){return n.sub(a)},"Unit, Unit":e.referToSelf(r=>(n,a)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(a.value===null||a.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(a))throw new Error("Units do not match");var i=n.clone();return i.value=e.find(r,[i.valueType(),a.valueType()])(i.value,a.value),i.fixPrefix=!1,i})})}),Km="cbrt",OS=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],BS=U(Km,OS,t=>{var{config:e,typed:r,isNegative:n,unaryMinus:a,matrix:i,Complex:s,BigNumber:u,Fraction:l}=t;return r(Km,{number:Oi,Complex:o,"Complex, boolean":o,BigNumber:function(d){return d.cbrt()},Unit:c});function o(f,d){var m=f.arg()/3,h=f.abs(),p=new s(Oi(h),0).mul(new s(0,m).exp());if(d){var g=[p,new s(Oi(h),0).mul(new s(0,m+Math.PI*2/3).exp()),new s(Oi(h),0).mul(new s(0,m-Math.PI*2/3).exp())];return e.matrix==="Array"?g:i(g)}else return p}function c(f){if(f.value&&Wr(f.value)){var d=f.clone();return d.value=1,d=d.pow(1/3),d.value=o(f.value),d}else{var m=n(f.value);m&&(f.value=a(f.value));var h;Qe(f.value)?h=new u(1).div(3):ea(f.value)?h=new l(1,3):h=1/3;var p=f.pow(h);return m&&(p.value=a(p.value)),p}}}),kS="matAlgo11xS0s",IS=["typed","equalScalar"],tr=U(kS,IS,t=>{var{typed:e,equalScalar:r}=t;return function(a,i,s,u){var l=a._values,o=a._index,c=a._ptr,f=a._size,d=a._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var m=f[0],h=f[1],p,g=r,v=0,D=s;typeof d=="string"&&(p=d,g=e.find(r,[p,p]),v=e.convert(0,p),i=e.convert(i,p),D=e.find(s,[p,p]));for(var y=[],x=[],w=[],b=0;b<h;b++){w[b]=x.length;for(var A=c[b],S=c[b+1],E=A;E<S;E++){var N=o[E],_=u?D(i,l[E]):D(l[E],i);g(_,v)||(x.push(N),y.push(_))}}return w[h]=x.length,a.createSparseMatrix({values:y,index:x,ptr:w,size:[m,h],datatype:p})}}),LS="matAlgo12xSfs",RS=["typed","DenseMatrix"],Gt=U(LS,RS,t=>{var{typed:e,DenseMatrix:r}=t;return function(a,i,s,u){var l=a._values,o=a._index,c=a._ptr,f=a._size,d=a._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var m=f[0],h=f[1],p,g=s;typeof d=="string"&&(p=d,i=e.convert(i,p),g=e.find(s,[p,p]));for(var v=[],D=[],y=[],x=0;x<h;x++){for(var w=x+1,b=c[x],A=c[x+1],S=b;S<A;S++){var E=o[S];D[E]=l[S],y[E]=w}for(var N=0;N<m;N++)x===0&&(v[N]=[]),y[N]===w?v[N][x]=u?g(i,D[N]):g(D[N],i):v[N][x]=u?g(i,0):g(0,i)}return new r({data:v,size:[m,h],datatype:p})}}),$S="matAlgo14xDs",PS=["typed"],qr=U($S,PS,t=>{var{typed:e}=t;return function(a,i,s,u){var l=a._data,o=a._size,c=a._datatype,f,d=s;typeof c=="string"&&(f=c,i=e.convert(i,f),d=e.find(s,[f,f]));var m=o.length>0?r(d,0,o,o[0],l,i,u):[];return a.createDenseMatrix({data:m,size:je(o),datatype:f})};function r(n,a,i,s,u,l,o){var c=[];if(a===i.length-1)for(var f=0;f<s;f++)c[f]=o?n(l,u[f]):n(u[f],l);else for(var d=0;d<s;d++)c[d]=r(n,a+1,i,i[a+1],u[d],l,o);return c}}),fl="ceil",qS=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],US=new qn(10),zS=U(fl,["typed","config","round"],t=>{var{typed:e,config:r,round:n}=t;function a(i){var s=Math.ceil(i),u=n(i);return s===u?s:Zt(i,u,r.relTol,r.absTol)&&!Zt(i,s,r.relTol,r.absTol)?u:s}return e(fl,{number:a,"number, number":function(s,u){if(!$e(u))throw new RangeError("number of decimals in function ceil must be an integer");if(u<0||u>15)throw new RangeError("number of decimals in ceil number must be in range 0-15");var l=10**u;return a(s*l)/l}})}),YS=U(fl,qS,t=>{var{typed:e,config:r,round:n,matrix:a,equalScalar:i,zeros:s,DenseMatrix:u}=t,l=tr({typed:e,equalScalar:i}),o=Gt({typed:e,DenseMatrix:u}),c=qr({typed:e}),f=zS({typed:e,config:r,round:n});function d(m){var h=(v,D)=>Pr(v,D,r.relTol,r.absTol),p=m.ceil(),g=n(m);return p.eq(g)?p:h(m,g)&&!h(m,p)?g:p}return e("ceil",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(h){return h.ceil()},"Complex, number":function(h,p){return h.ceil(p)},"Complex, BigNumber":function(h,p){return h.ceil(p.toNumber())},BigNumber:d,"BigNumber, BigNumber":function(h,p){var g=US.pow(p);return d(h.mul(g)).div(g)},bigint:m=>m,"bigint, number":(m,h)=>m,"bigint, BigNumber":(m,h)=>m,Fraction:function(h){return h.ceil()},"Fraction, number":function(h,p){return h.ceil(p)},"Fraction, BigNumber":function(h,p){return h.ceil(p.toNumber())},"Unit, number, Unit":e.referToSelf(m=>function(h,p,g){var v=h.toNumeric(g);return g.multiply(m(v,p))}),"Unit, BigNumber, Unit":e.referToSelf(m=>(h,p,g)=>m(h,p.toNumber(),g)),"Array | Matrix, number | BigNumber, Unit":e.referToSelf(m=>(h,p,g)=>nt(h,v=>m(v,p,g),!0)),"Array | Matrix | Unit, Unit":e.referToSelf(m=>(h,p)=>m(h,0,p)),"Array | Matrix":e.referToSelf(m=>h=>nt(h,m,!0)),"Array, number | BigNumber":e.referToSelf(m=>(h,p)=>nt(h,g=>m(g,p),!0)),"SparseMatrix, number | BigNumber":e.referToSelf(m=>(h,p)=>
23l(h,p,m,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(m=>(h,p)=>c(h,p,m,!1)),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(m=>(h,p)=>c(a(p),h,m,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(m=>(h,p)=>i(h,0)?s(p.size(),p.storage()):p.storage()==="dense"?c(p,h,m,!0):o(p,h,m,!0))})}),eh="cube",VS=["typed"],HS=U(eh,VS,t=>{var{typed:e}=t;return e(eh,{number:Wd,Complex:function(n){return n.mul(n).mul(n)},BigNumber:function(n){return n.times(n).times(n)},bigint:function(n){return n*n*n},Fraction:function(n){return n.pow(3)},Unit:function(n){return n.pow(3)}})}),th="exp",WS=["typed"],GS=U(th,WS,t=>{var{typed:e}=t;return e(th,{number:Gd,Complex:function(n){return n.exp()},BigNumber:function(n){return n.exp()}})}),rh="expm1",jS=["typed","Complex"],ZS=U(rh,jS,t=>{var{typed:e,Complex:r}=t;return e(rh,{number:jd,Complex:function(a){var i=Math.exp(a.re);return new r(i*Math.cos(a.im)-1,i*Math.sin(a.im))},BigNumber:function(a){return a.exp().minus(1)}})}),dl="fix",XS=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],JS=U(dl,["typed","ceil","floor"],t=>{var{typed:e,ceil:r,floor:n}=t;return e(dl,{number:function(i){return i>0?n(i):r(i)},"number, number":function(i,s){return i>0?n(i,s):r(i,s)}})}),QS=U(dl,XS,t=>{var{typed:e,Complex:r,matrix:n,ceil:a,floor:i,equalScalar:s,zeros:u,DenseMatrix:l}=t,o=Gt({typed:e,DenseMatrix:l}),c=qr({typed:e}),f=JS({typed:e,ceil:a,floor:i});return e("fix",{number:f.signatures.number,"number, number | BigNumber":f.signatures["number,number"],Complex:function(m){return new r(m.re>0?Math.floor(m.re):Math.ceil(m.re),m.im>0?Math.floor(m.im):Math.ceil(m.im))},"Complex, number":function(m,h){return new r(m.re>0?i(m.re,h):a(m.re,h),m.im>0?i(m.im,h):a(m.im,h))},"Complex, BigNumber":function(m,h){var p=h.toNumber();return new r(m.re>0?i(m.re,p):a(m.re,p),m.im>0?i(m.im,p):a(m.im,p))},BigNumber:function(m){return m.isNegative()?a(m):i(m)},"BigNumber, number | BigNumber":function(m,h){return m.isNegative()?a(m,h):i(m,h)},bigint:d=>d,"bigint, number":(d,m)=>d,"bigint, BigNumber":(d,m)=>d,Fraction:function(m){return m.s<0n?m.ceil():m.floor()},"Fraction, number | BigNumber":function(m,h){return m.s<0n?a(m,h):i(m,h)},"Unit, number, Unit":e.referToSelf(d=>function(m,h,p){var g=m.toNumeric(p);return p.multiply(d(g,h))}),"Unit, BigNumber, Unit":e.referToSelf(d=>(m,h,p)=>d(m,h.toNumber(),p)),"Array | Matrix, number | BigNumber, Unit":e.referToSelf(d=>(m,h,p)=>nt(m,g=>d(g,h,p),!0)),"Array | Matrix | Unit, Unit":e.referToSelf(d=>(m,h)=>d(m,0,h)),"Array | Matrix":e.referToSelf(d=>m=>nt(m,d,!0)),"Array | Matrix, number | BigNumber":e.referToSelf(d=>(m,h)=>nt(m,p=>d(p,h),!0)),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(d=>(m,h)=>c(n(h),m,d,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(d=>(m,h)=>s(m,0)?u(h.size(),h.storage()):h.storage()==="dense"?c(h,m,d,!0):o(h,m,d,!0))})}),ml="floor",KS=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],e2=new qn(10),t2=U(ml,["typed","config","round"],t=>{var{typed:e,config:r,round:n}=t;function a(i){var s=Math.floor(i),u=n(i);return s===u?s:Zt(i,u,r.relTol,r.absTol)&&!Zt(i,s,r.relTol,r.absTol)?u:s}return e(ml,{number:a,"number, number":function(s,u){if(!$e(u))throw new RangeError("number of decimals in function floor must be an integer");if(u<0||u>15)throw new RangeError("number of decimals in floor number must be in range 0 - 15");var l=10**u;return a(s*l)/l}})}),nh=U(ml,KS,t=>{var{typed:e,config:r,round:n,matrix:a,equalScalar:i,zeros:s,DenseMatrix:u}=t,l=tr({typed:e,equalScalar:i}),o=Gt({typed:e,DenseMatrix:u}),c=qr({typed:e}),f=t2({typed:e,config:r,round:n});function d(m){var h=(v,D)=>Pr(v,D,r.relTol,r.absTol),p=m.floor(),g=n(m);return p.eq(g)?p:h(m,g)&&!h(m,p)?g:p}return e("floor",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(h){return h.floor()},"Complex, number":function(h,p){return h.floor(p)},"Complex, BigNumber":function(h,p){return h.floor(p.toNumber())},BigNumber:d,"BigNumber, BigNumber":function(h,p){var g=e2.pow(p);return d(h.mul(g)).div(g)},bigint:m=>m,"bigint, number":(m,h)=>m,"bigint, BigNumber":(m,h)=>m,Fraction:function(h){return h.floor()},"Fraction, number":function(h,p){return h.floor(p)},"Fraction, BigNumber":function(h,p){return h.floor(p.toNumber())},"Unit, number, Unit":e.referToSelf(m=>function(h,p,g){var v=h.toNumeric(g);return g.multiply(m(v,p))}),"Unit, BigNumber, Unit":e.referToSelf(m=>(h,p,g)=>m(h,p.toNumber(),g)),"Array | Matrix, number | BigNumber, Unit":e.referToSelf(m=>(h,p,g)=>nt(h,v=>m(v,p,g),!0)),"Array | Matrix | Unit, Unit":e.referToSelf(m=>(h,p)=>m(h,0,p)),"Array | Matrix":e.referToSelf(m=>h=>nt(h,m,!0)),"Array, number | BigNumber":e.referToSelf(m=>(h,p)=>nt(h,g=>m(g,p),!0)),"SparseMatrix, number | BigNumber":e.referToSelf(m=>(h,p)=>
vendor: 31,756 bytes, line 23
23l(h,p,m,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(m=>(h,p)=>c(h,p,m,!1)),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(m=>(h,p)=>c(a(p),h,m,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(m=>(h,p)=>i(h,0)?s(p.size(),p.storage()):p.storage()==="dense"?c(p,h,m,!0):o(p,h,m,!0))})}),r2="matAlgo02xDS0",n2=["typed","equalScalar"],Xr=U(r2,n2,t=>{var{typed:e,equalScalar:r}=t;return function(a,i,s,u){var l=a._data,o=a._size,c=a._datatype||a.getDataType(),f=i._values,d=i._index,m=i._ptr,h=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(o.length!==h.length)throw new at(o.length,h.length);if(o[0]!==h[0]||o[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+h+")");if(!f)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var g=o[0],v=o[1],D,y=r,x=0,w=s;typeof c=="string"&&c===p&&c!=="mixed"&&(D=c,y=e.find(r,[D,D]),x=e.convert(0,D),w=e.find(s,[D,D]));for(var b=[],A=[],S=[],E=0;E<v;E++){S[E]=A.length;for(var N=m[E],_=m[E+1],C=N;C<_;C++){var O=d[C],I=u?w(f[C],l[O][E]):w(l[O][E],f[C]);y(I,x)||(A.push(O),b.push(I))}}return S[v]=A.length,i.createSparseMatrix({values:b,index:A,ptr:S,size:[g,v],datatype:c===a._datatype&&p===i._datatype?D:void 0})}}),a2="matAlgo03xDSf",i2=["typed"],cr=U(a2,i2,t=>{var{typed:e}=t;return function(n,a,i,s){var u=n._data,l=n._size,o=n._datatype||n.getDataType(),c=a._values,f=a._index,d=a._ptr,m=a._size,h=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(l.length!==m.length)throw new at(l.length,m.length);if(l[0]!==m[0]||l[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+m+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var p=l[0],g=l[1],v,D=0,y=i;typeof o=="string"&&o===h&&o!=="mixed"&&(v=o,D=e.convert(0,v),y=e.find(i,[v,v]));for(var x=[],w=0;w<p;w++)x[w]=[];for(var b=[],A=[],S=0;S<g;S++){for(var E=S+1,N=d[S],_=d[S+1],C=N;C<_;C++){var O=f[C];b[O]=s?y(c[C],u[O][S]):y(u[O][S],c[C]),A[O]=E}for(var I=0;I<p;I++)A[I]===E?x[I][S]=b[I]:x[I][S]=s?y(D,u[I][S]):y(u[I][S],D)}return n.createDenseMatrix({data:x,size:[p,g],datatype:o===n._datatype&&h===a._datatype?v:void 0})}}),s2="matAlgo05xSfSf",o2=["typed","equalScalar"],Ks=U(s2,o2,t=>{var{typed:e,equalScalar:r}=t;return function(a,i,s){var u=a._values,l=a._index,o=a._ptr,c=a._size,f=a._datatype||a._data===void 0?a._datatype:a.getDataType(),d=i._values,m=i._index,h=i._ptr,p=i._size,g=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(c.length!==p.length)throw new at(c.length,p.length);if(c[0]!==p[0]||c[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+p+")");var v=c[0],D=c[1],y,x=r,w=0,b=s;typeof f=="string"&&f===g&&f!=="mixed"&&(y=f,x=e.find(r,[y,y]),w=e.convert(0,y),b=e.find(s,[y,y]));var A=u&&d?[]:void 0,S=[],E=[],N=A?[]:void 0,_=A?[]:void 0,C=[],O=[],I,k,M,H;for(k=0;k<D;k++){E[k]=S.length;var q=k+1;for(M=o[k],H=o[k+1];M<H;M++)I=l[M],S.push(I),C[I]=q,N&&(N[I]=u[M]);for(M=h[k],H=h[k+1];M<H;M++)I=m[M],C[I]!==q&&S.push(I),O[I]=q,_&&(_[I]=d[M]);if(A)for(M=E[k];M<S.length;){I=S[M];var z=C[I],X=O[I];if(z===q||X===q){var te=z===q?N[I]:w,B=X===q?_[I]:w,j=b(te,B);x(j,w)?S.splice(M,1):(A.push(j),M++)}}}return E[D]=S.length,a.createSparseMatrix({values:A,index:S,ptr:E,size:[v,D],datatype:f===a._datatype&&g===i._datatype?y:void 0})}}),u2="matAlgo13xDD",l2=["typed"],ah=U(u2,l2,t=>{var{typed:e}=t;return function(a,i,s){var u=a._data,l=a._size,o=a._datatype,c=i._data,f=i._size,d=i._datatype,m=[];if(l.length!==f.length)throw new at(l.length,f.length);for(var h=0;h<l.length;h++){if(l[h]!==f[h])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+f+")");m[h]=l[h]}var p,g=s;typeof o=="string"&&o===d&&(p=o,g=e.find(s,[p,p]));var v=m.length>0?r(g,0,m,m[0],u,c):[];return a.createDenseMatrix({data:v,size:m,datatype:p})};function r(n,a,i,s,u,l){var o=[];if(a===i.length-1)for(var c=0;c<s;c++)o[c]=n(u[c],l[c]);else for(var f=0;f<s;f++)o[f]=r(n,a+1,i,i[a+1],u[f],l[f]);return o}});function Qt(t,e){if(wn(t.size(),e.size()))return[t,e];var r=Vs(t.size(),e.size());return[t,e].map(n=>c2(n,r))}function c2(t,e){return wn(t.size(),e)?t:t.create(ua(t.valueOf(),e),t.datatype())}var f2="matrixAlgorithmSuite",d2=["typed","matrix"],Ct=U(f2,d2,t=>{var{typed:e,matrix:r}=t,n=ah({typed:e}),a=qr({typed:e});return function(s){var u=s.elop,l=s.SD||s.DS,o;u?(o={"DenseMatrix, DenseMatrix":(m,h)=>n(...Qt(m,h),u),"Array, Array":(m,h)=>n(...Qt(r(m),r(h)),u).valueOf(),"Array, DenseMatrix":(m,h)=>n(...Qt(r(m),h),u),"DenseMatrix, Array":(m,h)=>n(...Qt(m,r(h)),u)},s.SS&&(o["SparseMatrix, SparseMatrix"]=(m,h)=>s.SS(...Qt(m,h),u,!1)),s.DS&&(o["DenseMatrix, SparseMatrix"]=(m,h)=>s.DS(...Qt(m,h),u,!1),o["Array, SparseMatrix"]=(m,h)=>s.DS(...Qt(r(m),h),u,!1)),l&&(o["SparseMatrix, DenseMatrix"]=(m,h)=>l(...Qt(h,m),u,!0),o["SparseMatrix, Array"]=(m,h)=>l(...Qt(r(h),m),u,!0))):(o={"DenseMatrix, DenseMatrix":e.referToSelf(m=>(h,p)=>n(...Qt(h,p),m)),"Array, Array":e.referToSelf(m=>(h,p)=>n(...Qt(r(h),r(p)),m).valueOf()),"Array, DenseMatrix":e.referToSelf(m=>(h,p)=>n(...Qt(r(h),p),m)),"DenseMatrix, Array":e.referToSelf(m=>(h,p)=>n(...Qt(h,r(p)),m))},s.SS&&(o["SparseMatrix, SparseMatrix"]=e.referToSelf(m=>(h,p)=>s.SS(...Qt(h,p),m,!1))),s.DS&&(o["DenseMatrix, SparseMatrix"]=e.referToSelf(m=>(h,p)=>s.DS(...Qt(h,p),m,!1)),o["Array, SparseMatrix"]=e.referToSelf(m=>(h,p)=>s.DS(...Qt(r(h),p),m,!1))),l&&(o["SparseMatrix, DenseMatrix"]=e.referToSelf(m=>(h,p)=>l(...Qt(p,h),m,!0)),o["SparseMatrix, Array"]=e.referToSelf(m=>(h,p)=>l(...Qt(r(p),h),m,!0))));var c=s.scalar||"any",f=s.Ds||s.Ss;f&&(u?(o["DenseMatrix,"+c]=(m,h)=>a(m,h,u,!1),o[c+", DenseMatrix"]=(m,h)=>a(h,m,u,!0),o["Array,"+c]=(m,h)=>a(r(m),h,u,!1).valueOf(),o[c+", Array"]=(m,h)=>a(r(h),m,u,!0).valueOf()):(o["DenseMatrix,"+c]=e.referToSelf(m=>(h,p)=>a(h,p,m,!1)),o[c+", DenseMatrix"]=e.referToSelf(m=>(h,p)=>a(p,h,m,!0)),o["Array,"+c]=e.referToSelf(m=>(h,p)=>a(r(h),p,m,!1).valueOf()),o[c+", Array"]=e.referToSelf(m=>(h,p)=>a(r(p),h,m,!0).valueOf())));var d=s.sS!==void 0?s.sS:s.Ss;return u?(s.Ss&&(o["SparseMatrix,"+c]=(m,h)=>s.Ss(m,h,u,!1)),d&&(o[c+", SparseMatrix"]=(m,h)=>d(h,m,u,!0))):(s.Ss&&(o["SparseMatrix,"+c]=e.referToSelf(m=>(h,p)=>s.Ss(h,p,m,!1))),d&&(o[c+", SparseMatrix"]=e.referToSelf(m=>(h,p)=>d(p,h,m,!0)))),u&&u.signatures&&qf(o,u.signatures),o}}),ih="mod",m2=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],sh=U(ih,m2,t=>{var{typed:e,config:r,round:n,matrix:a,equalScalar:i,zeros:s,DenseMatrix:u,concat:l}=t,o=nh({typed:e,config:r,round:n,matrix:a,equalScalar:i,zeros:s,DenseMatrix:u}),c=Xr({typed:e,equalScalar:i}),f=cr({typed:e}),d=Ks({typed:e,equalScalar:i}),m=tr({typed:e,equalScalar:i}),h=Gt({typed:e,DenseMatrix:u}),p=Ct({typed:e,matrix:a,concat:l});return e(ih,{"number, number":g,"BigNumber, BigNumber":function(D,y){return y.isZero()?D:D.sub(y.mul(o(D.div(y))))},"bigint, bigint":function(D,y){if(y===0n)return D;if(D<0){var x=D%y;return x===0n?x:x+y}return D%y},"Fraction, Fraction":function(D,y){return y.equals(0)?D:D.sub(y.mul(o(D.div(y))))}},p({SS:d,DS:f,SD:c,Ss:m,sS:h}));function g(v,D){return D===0?v:v-D*o(v/D)}}),h2="matAlgo01xDSid",p2=["typed"],Vn=U(h2,p2,t=>{var{typed:e}=t;return function(n,a,i,s){var u=n._data,l=n._size,o=n._datatype||n.getDataType(),c=a._values,f=a._index,d=a._ptr,m=a._size,h=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(l.length!==m.length)throw new at(l.length,m.length);if(l[0]!==m[0]||l[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+m+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var p=l[0],g=l[1],v=typeof o=="string"&&o!=="mixed"&&o===h?o:void 0,D=v?e.find(i,[v,v]):i,y,x,w=[];for(y=0;y<p;y++)w[y]=[];var b=[],A=[];for(x=0;x<g;x++){for(var S=x+1,E=d[x],N=d[x+1],_=E;_<N;_++)y=f[_],b[y]=s?D(c[_],u[y][x]):D(u[y][x],c[_]),A[y]=S;for(y=0;y<p;y++)A[y]===S?w[y][x]=b[y]:w[y][x]=u[y][x]}return n.createDenseMatrix({data:w,size:[p,g],datatype:o===n._datatype&&h===a._datatype?v:void 0})}}),v2="matAlgo04xSidSid",g2=["typed","equalScalar"],hl=U(v2,g2,t=>{var{typed:e,equalScalar:r}=t;return function(a,i,s){var u=a._values,l=a._index,o=a._ptr,c=a._size,f=a._datatype||a._data===void 0?a._datatype:a.getDataType(),d=i._values,m=i._index,h=i._ptr,p=i._size,g=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(c.length!==p.length)throw new at(c.length,p.length);if(c[0]!==p[0]||c[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+p+")");var v=c[0],D=c[1],y,x=r,w=0,b=s;typeof f=="string"&&f===g&&f!=="mixed"&&(y=f,x=e.find(r,[y,y]),w=e.convert(0,y),b=e.find(s,[y,y]));var A=u&&d?[]:void 0,S=[],E=[],N=u&&d?[]:void 0,_=u&&d?[]:void 0,C=[],O=[],I,k,M,H,q;for(k=0;k<D;k++){E[k]=S.length;var z=k+1;for(H=o[k],q=o[k+1],M=H;M<q;M++)I=l[M],S.push(I),C[I]=z,N&&(N[I]=u[M]);for(H=h[k],q=h[k+1],M=H;M<q;M++)if(I=m[M],C[I]===z){if(N){var X=b(N[I],d[M]);x(X,w)?C[I]=null:N[I]=X}}else S.push(I),O[I]=z,_&&(_[I]=d[M]);if(N&&_)for(M=E[k];M<S.length;)I=S[M],C[I]===z?(A[M]=N[I],M++):O[I]===z?(A[M]=_[I],M++):S.splice(M,1)}return E[D]=S.length,a.createSparseMatrix({values:A,index:S,ptr:E,size:[v,D],datatype:f===a._datatype&&g===i._datatype?y:void 0})}}),y2="matAlgo10xSids",b2=["typed","DenseMatrix"],ca=U(y2,b2,t=>{var{typed:e,DenseMatrix:r}=t;return function(a,i,s,u){var l=a._values,o=a._index,c=a._ptr,f=a._size,d=a._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var m=f[0],h=f[1],p,g=s;typeof d=="string"&&(p=d,i=e.convert(i,p),g=e.find(s,[p,p]));for(var v=[],D=[],y=[],x=0;x<h;x++){for(var w=x+1,b=c[x],A=c[x+1],S=b;S<A;S++){var E=o[S];D[E]=l[S],y[E]=w}for(var N=0;N<m;N++)x===0&&(v[N]=[]),y[N]===w?v[N][x]=u?g(i,D[N]):g(D[N],i):v[N][x]=i}return new r({data:v,size:[m,h],datatype:p})}});function An(t,e,r,n){if(!(this instanceof An))throw new SyntaxError("Constructor must be called with the new operator");this.fn=t,this.count=e,this.min=r,this.max=n,this.message="Wrong number of arguments in function "+t+" ("+e+" provided, "+r+(n!=null?"-"+n:"")+" expected)",this.stack=new Error().stack}An.prototype=new Error,An.prototype.constructor=Error,An.prototype.name="ArgumentsError",An.prototype.isArgumentsError=!0;var oh="gcd",w2=["typed","config","round","matrix","equalScalar","zeros","BigNumber","DenseMatrix","concat"],pl="number | BigNumber | Fraction | Matrix | Array",x2="".concat(pl,", ").concat(pl,", ...").concat(pl);function uh(t){return!t.some(e=>Array.isArray(e))}var D2=U(oh,w2,t=>{var{typed:e,matrix:r,config:n,round:a,equalScalar:i,zeros:s,BigNumber:u,DenseMatrix:l,concat:o}=t,c=sh({typed:e,config:n,round:a,matrix:r,equalScalar:i,zeros:s,DenseMatrix:l,concat:o}),f=Vn({typed:e}),d=hl({typed:e,equalScalar:i}),m=ca({typed:e,DenseMatrix:l}),h=Ct({typed:e,matrix:r,concat:o});return e(oh,{"number, number":p,"BigNumber, BigNumber":g,"Fraction, Fraction":(v,D)=>v.gcd(D)},h({SS:d,DS:f,Ss:m}),{[x2]:e.referToSelf(v=>(D,y,x)=>{for(var w=v(D,y),b=0;b<x.length;b++)w=v(w,x[b]);return w}),Array:e.referToSelf(v=>D=>{if(D.length===1&&Array.isArray(D[0])&&uh(D[0]))return v(...D[0]);if(uh(D))return v(...D);throw new An("gcd() supports only 1d matrices!")}),Matrix:e.referToSelf(v=>D=>v(D.toArray()))});function p(v,D){if(!$e(v)||!$e(D))throw new Error("Parameters in function gcd must be integer numbers");for(var y;D!==0;)y=c(v,D),v=D,D=y;return v<0?-v:v}function g(v,D){if(!v.isInt()||!D.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var y=new u(0);!D.isZero();){var x=c(v,D);v=D,D=x}return v.lt(y)?v.neg():v}}),E2="matAlgo06xS0S0",A2=["typed","equalScalar"],eo=U(E2,A2,t=>{var{typed:e,equalScalar:r}=t;return function(a,i,s){var u=a._values,l=a._size,o=a._datatype||a._data===void 0?a._datatype:a.getDataType(),c=i._values,f=i._size,d=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==f.length)throw new at(l.length,f.length);if(l[0]!==f[0]||l[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+f+")");var m=l[0],h=l[1],p,g=r,v=0,D=s;typeof o=="string"&&o===d&&o!=="mixed"&&(p=o,g=e.find(r,[p,p]),v=e.convert(0,p),D=e.find(s,[p,p]));for(var y=u&&c?[]:void 0,x=[],w=[],b=y?[]:void 0,A=[],S=[],E=0;E<h;E++){w[E]=x.length;var N=E+1;if($d(a,E,A,b,S,N,x,D),$d(i,E,A,b,S,N,x,D),b)for(var _=w[E];_<x.length;){var C=x[_];if(S[C]===N){var O=b[C];g(O,v)?x.splice(_,1):(y.push(O),_++)}else x.splice(_,1)}else for(var I=w[E];I<x.length;){var k=x[I];S[k]!==N?x.splice(I,1):I++}}return w[h]=x.length,a.createSparseMatrix({values:y,index:x,ptr:w,size:[m,h],datatype:o===a._datatype&&d===i._datatype?p:void 0})}}),lh="lcm",S2=["typed","matrix","equalScalar","concat"],N2=U(lh,S2,t=>{var{typed:e,matrix:r,equalScalar:n,concat:a}=t,i=Xr({typed:e,equalScalar:n}),s=eo({typed:e,equalScalar:n}),u=tr({typed:e,equalScalar:n}),l=Ct({typed:e,matrix:r,concat:a}),o="number | BigNumber | Fraction | Matrix | Array",c={};return c["".concat(o,", ").concat(o,", ...").concat(o)]=e.referToSelf(d=>(m,h,p)=>{for(var g=d(m,h),v=0;v<p.length;v++)g=d(g,p[v]);return g}),e(lh,{"number, number":Zd,"BigNumber, BigNumber":f,"Fraction, Fraction":(d,m)=>d.lcm(m)},l({SS:s,DS:i,Ss:u}),c);function f(d,m){if(!d.isInt()||!m.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(d.isZero())return d;if(m.isZero())return m;for(var h=d.times(m);!m.isZero();){var p=m;m=d.mod(p),d=p}return h.div(d).abs()}});function vl(t,e,r,n){return function(a){if(a>0||r.predictable){if(a<=0)return NaN;var i=a.toString(16),s=i.substring(0,15);return t*(i.length-s.length)+e(+("0x"+s))}return n(a.toNumber())}}var ch="log10",_2=["typed","config","Complex"],C2=js(16),M2=U(ch,_2,t=>{var{typed:e,config:r,Complex:n}=t;function a(s){return s.log().div(Math.LN10)}function i(s){return a(new n(s,0))}return e(ch,{number:function(u){return u>=0||r.predictable?js(u):i(u)},bigint:vl(C2,js,r,i),Complex:a,BigNumber:function(u){return!u.isNegative()||r.predictable?u.log():i(u.toNumber())},"Array | Matrix":e.referToSelf(s=>u=>nt(u,s))})}),fh="log2",T2=["typed","config","Complex"],F2=U(fh,T2,t=>{var{typed:e,config:r,Complex:n}=t;function a(s){return i(new n(s,0))}return e(fh,{number:function(u){return u>=0||r.predictable?nl(u):a(u)},bigint:vl(4,nl,r,a),Complex:i,BigNumber:function(u){return!u.isNegative()||r.predictable?u.log(2):a(u.toNumber())},"Array | Matrix":e.referToSelf(s=>u=>nt(u,s))});function i(s){var u=Math.sqrt(s.re*s.re+s.im*s.im);return new n(Math.log2?Math.log2(u):Math.log(u)/Math.LN2,Math.atan2(s.im,s.re)/Math.LN2)}}),O2="multiplyScalar",B2=["typed"],k2=U(O2,B2,t=>{var{typed:e}=t;return e("multiplyScalar",{"number, number":Yd,"Complex, Complex":function(n,a){return n.mul(a)},"BigNumber, BigNumber":function(n,a){return n.times(a)},"bigint, bigint":function(n,a){return n*a},"Fraction, Fraction":function(n,a){return n.mul(a)},"number | Fraction | BigNumber | Complex, Unit":(r,n)=>n.multiply(r),"Unit, number | Fraction | BigNumber | Complex | Unit":(r,n)=>r.multiply(n)})}),dh="multiply",I2=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],L2=U(dh,I2,t=>{var{typed:e,matrix:r,addScalar:n,multiplyScalar:a,equalScalar:i,dot:s}=t,u=tr({typed:e,equalScalar:i}),l=qr({typed:e});function o(w,b){switch(w.length){case 1:switch(b.length){case 1:if(w[0]!==b[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(w[0]!==b[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+w[0]+") must match Matrix rows ("+b[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+b.length+" dimensions)")}break;case 2:switch(b.length){case 1:if(w[1]!==b[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+w[1]+") must match Vector length ("+b[0]+")");break;case 2:if(w[1]!==b[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+w[1]+") must match Matrix B rows ("+b[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+b.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+w.length+" dimensions)")}}function c(w,b,A){if(A===0)throw new Error("Cannot multiply two empty vectors");return s(w,b)}function f(w,b){if(b.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return d(w,b)}function d(w,b){var A=w._data,S=w._size,E=w._datatype||w.getDataType(),N=b._data,_=b._size,C=b._datatype||b.getDataType(),O=S[0],I=_[1],k,M=n,H=a;E&&C&&E===C&&typeof E=="string"&&E!=="mixed"&&(k=E,M=e.find(n,[k,k]),H=e.find(a,[k,k]));for(var q=[],z=0;z<I;z++){for(var X=H(A[0],N[0][z]),te=1;te<O;te++)X=M(X,H(A[te],N[te][z]));q[z]=X}return w.createDenseMatrix({data:q,size:[I],datatype:E===w._datatype&&C===b._datatype?k:void 0})}var m=e("_multiplyMatrixVector",{"DenseMatrix, any":p,"SparseMatrix, any":D}),h=e("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":g,"DenseMatrix, SparseMatrix":v,"SparseMatrix, DenseMatrix":y,"SparseMatrix, SparseMatrix":x});function p(w,b){var A=w._data,S=w._size,E=w._datatype||w.getDataType(),N=b._data,_=b._datatype||b.getDataType(),C=S[0],O=S[1],I,k=n,M=a;E&&_&&E===_&&typeof E=="string"&&E!=="mixed"&&(I=E,k=e.find(n,[I,I]),M=e.find(a,[I,I]));for(var H=[],q=0;q<C;q++){for(var z=A[q],X=M(z[0],N[0]),te=1;te<O;te++)X=k(X,M(z[te],N[te]));H[q]=X}return w.createDenseMatrix({data:H,size:[C],datatype:E===w._datatype&&_===b._datatype?I:void 0})}function g(w,b){var A=w._data,S=w._size,E=w._datatype||w.getDataType(),N=b._data,_=b._size,C=b._datatype||b.getDataType(),O=S[0],I=S[1],k=_[1],M,H=n,q=a;E&&C&&E===C&&typeof E=="string"&&E!=="mixed"&&E!=="mixed"&&(M=E,H=e.find(n,[M,M]),q=e.find(a,[M,M]));for(var z=[],X=0;X<O;X++){var te=A[X];z[X]=[];for(var B=0;B<k;B++){for(var j=q(te[0],N[0][B]),R=1;R<I;R++)j=H(j,q(te[R],N[R][B]));z[X][B]=j}}return w.createDenseMatrix({data:z,size:[O,k],datatype:E===w._datatype&&C===b._datatype?M:void 0})}function v(w,b){var A=w._data,S=w._size,E=w._datatype||w.getDataType(),N=b._values,_=b._index,C=b._ptr,O=b._size,I=b._datatype||b._data===void 0?b._datatype:b.getDataType();if(!N)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var k=S[0],M=O[1],H,q=n,z=a,X=i,te=0;E&&I&&E===I&&typeof E=="string"&&E!=="mixed"&&(H=E,q=e.find(n,[H,H]),z=e.find(a,[H,H]),X=e.find(i,[H,H]),te=e.convert(0,H));for(var B=[],j=[],R=[],oe=b.createSparseMatrix({values:B,index:j,ptr:R,size:[k,M],datatype:E===w._datatype&&I===b._datatype?H:void 0}),se=0;se<M;se++){R[se]=j.length;var le=C[se],P=C[se+1];if(P>le)for(var W=0,J=0;J<k;J++){for(var re=J+1,ae=void 0,he=le;he<P;he++){var fe=_[he];W!==re?(ae=z(A[J][fe],N[he]),W=re):ae=q(ae,z(A[J][fe],N[he]))}W===re&&!X(ae,te)&&(j.push(J),B.push(ae))}}return R[M]=j.length,oe}function D(w,b){var A=w._values,S=w._index,E=w._ptr,N=w._datatype||w._data===void 0?w._datatype:w.getDataType();if(!A)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var _=b._data,C=b._datatype||b.getDataType(),O=w._size[0],I=b._size[0],k=[],M=[],H=[],q,z=n,X=a,te=i,B=0;N&&C&&N===C&&typeof N=="string"&&N!=="mixed"&&(q=N,z=e.find(n,[q,q]),X=e.find(a,[q,q]),te=e.find(i,[q,q]),B=e.convert(0,q));var j=[],R=[];H[0]=0;for(var oe=0;oe<I;oe++){var se=_[oe];if(!te(se,B))for(var le=E[oe],P=E[oe+1],W=le;W<P;W++){var J=S[W];R[J]?j[J]=z(j[J],X(se,A[W])):(R[J]=!0,M.push(J),j[J]=X(se,A[W]))}}for(var re=M.length,ae=0;ae<re;ae++){var he=M[ae];k[ae]=j[he]}return H[1]=M.length,w.createSparseMatrix({values:k,index:M,ptr:H,size:[O,1],datatype:N===w._datatype&&C===b._datatype?q:void 0})}function y(w,b){var A=w._values,S=w._index,E=w._ptr,N=w._datatype||w._data===void 0?w._datatype:w.getDataType();if(!A)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var _=b._data,C=b._datatype||b.getDataType(),O=w._size[0],I=b._size[0],k=b._size[1],M,H=n,q=a,z=i,X=0;N&&C&&N===C&&typeof N=="string"&&N!=="mixed"&&(M=N,H=e.find(n,[M,M]),q=e.find(a,[M,M]),z=e.find(i,[M,M]),X=e.convert(0,M));for(var te=[],B=[],j=[],R=w.createSparseMatrix({values:te,index:B,ptr:j,size:[O,k],datatype:N===w._datatype&&C===b._datatype?M:void 0}),oe=[],se=[],le=0;le<k;le++){j[le]=B.length;for(var P=le+1,W=0;W<I;W++){var J=_[W][le];if(!z(J,X))for(var re=E[W],ae=E[W+1],he=re;he<ae;he++){var fe=S[he];se[fe]!==P?(se[fe]=P,B.push(fe),oe[fe]=q(J,A[he])):oe[fe]=H(oe[fe],q(J,A[he]))}}for(var De=j[le],Te=B.length,Ie=De;Ie<Te;Ie++){var Me=B[Ie];te[Ie]=oe[Me]}}return j[k]=B.length,R}function x(w,b){var A=w._values,S=w._index,E=w._ptr,N=w._datatype||w._data===void 0?w._datatype:w.getDataType(),_=b._values,C=b._index,O=b._ptr,I=b._datatype||b._data===void 0?b._datatype:b.getDataType(),k=w._size[0],M=b._size[1],H=A&&_,q,z=n,X=a;N&&I&&N===I&&typeof N=="string"&&N!=="mixed"&&(q=N,z=e.find(n,[q,q]),X=e.find(a,[q,q]));for(var te=H?[]:void 0,B=[],j=[],R=w.createSparseMatrix({values:te,index:B,ptr:j,size:[k,M],datatype:N===w._datatype&&I===b._datatype?q:void 0}),oe=H?[]:void 0,se=[],le,P,W,J,re,ae,he,fe,De=0;De<M;De++){j[De]=B.length;var Te=De+1;for(re=O[De],ae=O[De+1],J=re;J<ae;J++)if(fe=C[J],H)for(P=E[fe],W=E[fe+1],le=P;le<W;le++)he=S[le],se[he]!==Te?(se[he]=Te,B.push(he),oe[he]=X(_[J],A[le])):oe[he]=z(oe[he],X(_[J],A[le]));else for(P=E[fe],W=E[fe+1],le=P;le<W;le++)he=S[le],se[he]!==Te&&(se[he]=Te,B.push(he));if(H)for(var Ie=j[De],Me=B.length,Le=Ie;Le<Me;Le++){var Y=B[Le];te[Le]=oe[Y]}}return j[M]=B.length,R}return e(dh,a,{"Array, Array":e.referTo("Matrix, Matrix",w=>(b,A)=>{o(Ke(b),Ke(A));var S=w(r(b),r(A));return ze(S)?S.valueOf():S}),"Matrix, Matrix":function(b,A){var S=b.size(),E=A.size();return o(S,E),S.length===1?E.length===1?c(b,A,S[0]):f(b,A):E.length===1?m(b,A):h(b,A)},"Matrix, Array":e.referTo("Matrix,Matrix",w=>(b,A)=>w(b,r(A))),"Array, Matrix":e.referToSelf(w=>(b,A)=>w(r(b,A.storage()),A)),"SparseMatrix, any":function(b,A){return u(b,A,a,!1)},"DenseMatrix, any":function(b,A){return l(b,A,a,!1)},"any, SparseMatrix":function(b,A){return u(A,b,a,!0)},"any, DenseMatrix":function(b,A){return l(A,b,a,!0)},"Array, any":function(b,A){return l(r(b),A,a,!1).valueOf()},"any, Array":function(b,A){return l(r(A),b,a,!0).valueOf()},"any, any":a,"any, any, ...any":e.referToSelf(w=>(b,A,S)=>{for(var E=w(b,A),N=0;N<S.length;N++)E=w(E,S[N]);return E})})}),mh="nthRoot",R2=["typed","matrix","equalScalar","BigNumber","concat"],$2=U(mh,R2,t=>{var{typed:e,matrix:r,equalScalar:n,BigNumber:a,concat:i}=t,s=Vn({typed:e}),u=Xr({typed:e,equalScalar:n}),l=eo({typed:e,equalScalar:n}),o=tr({typed:e,equalScalar:n}),c=Ct({typed:e,matrix:r,concat:i});function f(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return e(mh,{number:Jd,"number, number":Jd,BigNumber:m=>d(m,new a(2)),"BigNumber, BigNumber":d,Complex:f,"Complex, number":f,Array:e.referTo("DenseMatrix,number",m=>h=>m(r(h),2).valueOf()),DenseMatrix:e.referTo("DenseMatrix,number",m=>h=>m(h,2)),SparseMatrix:e.referTo("SparseMatrix,number",m=>h=>m(h,2)),"SparseMatrix, SparseMatrix":e.referToSelf(m=>(h,p)=>{if(p.density()===1)return l(h,p,m);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":e.referToSelf(m=>(h,p)=>{if(p.density()===1)return s(h,p,m,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":e.referTo("DenseMatrix,SparseMatrix",m=>(h,p)=>m(r(h),p)),"number | BigNumber, SparseMatrix":e.referToSelf(m=>(h,p)=>{if(p.density()===1)return o(p,h,m,!0);throw new Error("Root must be non-zero")})},c({scalar:"number | BigNumber",SD:u,Ss:o,sS:!1}));function d(m,h){var p=a.precision,g=a.clone({precision:p+2}),v=new a(0),D=new g(1),y=h.isNegative();if(y&&(h=h.neg()),h.isZero())throw new Error("Root must be non-zero");if(m.isNegative()&&!h.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(m.isZero())return y?new g(1/0):0;if(!m.isFinite())return y?v:m;var x=m.abs().pow(D.div(h));return x=m.isNeg()?x.neg():x,new a((y?D.div(x):x).toPrecision(p))}}),hh="sign",P2=["typed","BigNumber","Fraction","complex"],q2=U(hh,P2,t=>{var{typed:e,BigNumber:r,complex:n,Fraction:a}=t;return e(hh,{number:al,Complex:function(s){return s.im===0?n(al(s.re)):s.sign()},BigNumber:function(s){return new r(s.cmp(0))},bigint:function(s){return s>0n?1n:s<0n?-1n:0n},Fraction:function(s){return s.n===0n?new a(0):new a(s.s)},"Array | Matrix":e.referToSelf(i=>s=>nt(s,i,!0)),Unit:e.referToSelf(i=>s=>{if(!s._isDerived()&&s.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return e.find(i,s.valueType())(s.value)})})}),U2="sqrt",z2=["config","typed","Complex"],Y2=U(U2,z2,t=>{var{config:e,typed:r,Complex:n}=t;return r("sqrt",{number:a,Complex:function(s){return s.sqrt()},BigNumber:function(s){return!s.isNegative()||e.predictable?s.sqrt():a(s.toNumber())},Unit:function(s){return s.pow(.5)}});function a(i){return isNaN(i)?NaN:i>=0||e.predictable?Math.sqrt(i):new n(i,0).sqrt()}}),ph="square",V2=["typed"],H2=U(ph,V2,t=>{var{typed:e}=t;return e(ph,{number:Qd,Complex:function(n){return n.mul(n)},BigNumber:function(n){return n.times(n)},bigint:function(n){return n*n},Fraction:function(n){return n.mul(n)},Unit:function(n){return n.pow(2)}})}),vh="subtract",W2=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],G2=U(vh,W2,t=>{var{typed:e,matrix:r,equalScalar:n,subtractScalar:a,unaryMinus:i,DenseMatrix:s,concat:u}=t,l=Vn({typed:e}),o=cr({typed:e}),c=Ks({typed:e,equalScalar:n}),f=ca({typed:e,DenseMatrix:s}),d=Gt({typed:e,DenseMatrix:s}),m=Ct({typed:e,matrix:r,concat:u});return e(vh,{"any, any":a},m({elop:a,SS:c,DS:l,SD:o,Ss:d,sS:f}))}),gh="xgcd",j2=["typed","config","matrix","BigNumber"],Z2=U(gh,j2,t=>{var{typed:e,config:r,matrix:n,BigNumber:a}=t;return e(gh,{"number, number":function(u,l){var o=Kd(u,l);return r.matrix==="Array"?o:n(o)},"BigNumber, BigNumber":i});function i(s,u){var l,o,c,f=new a(0),d=new a(1),m=f,h=d,p=d,g=f;if(!s.isInt()||!u.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!u.isZero();)o=s.div(u).floor(),c=s.mod(u),l=m,m=h.minus(o.times(m)),h=l,l=p,p=g.minus(o.times(p)),g=l,s=u,u=c;var v;return s.lt(f)?v=[s.neg(),h.neg(),g.neg()]:v=[s,s.isZero()?0:h,g],r.matrix==="Array"?v:n(v)}}),yh="invmod",X2=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],J2=U(yh,X2,t=>{var{typed:e,config:r,BigNumber:n,xgcd:a,equal:i,smaller:s,mod:u,add:l,isInteger:o}=t;return e(yh,{"number, number":c,"BigNumber, BigNumber":c});function c(f,d){if(!o(f)||!o(d))throw new Error("Parameters in function invmod must be integer numbers");if(f=u(f,d),i(d,0))throw new Error("Divisor must be non zero");var m=a(f,d);m=m.valueOf();var[h,p]=m;return i(h,n(1))?(p=u(p,d),s(p,n(0))&&(p=l(p,d)),p):NaN}}),Q2="matAlgo09xS0Sf",K2=["typed","equalScalar"],bh=U(Q2,K2,t=>{var{typed:e,equalScalar:r}=t;return function(a,i,s){var u=a._values,l=a._index,o=a._ptr,c=a._size,f=a._datatype||a._data===void 0?a._datatype:a.getDataType(),d=i._values,m=i._index,h=i._ptr,p=i._size,g=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(c.length!==p.length)throw new at(c.length,p.length);if(c[0]!==p[0]||c[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+p+")");var v=c[0],D=c[1],y,x=r,w=0,b=s;typeof f=="string"&&f===g&&f!=="mixed"&&(y=f,x=e.find(r,[y,y]),w=e.convert(0,y),b=e.find(s,[y,y]));var A=u&&d?[]:void 0,S=[],E=[],N=A?[]:void 0,_=[],C,O,I,k,M;for(O=0;O<D;O++){E[O]=S.length;var H=O+1;if(N)for(k=h[O],M=h[O+1],I=k;I<M;I++)C=m[I],_[C]=H,N[C]=d[I];for(k=o[O],M=o[O+1],I=k;I<M;I++)if(C=l[I],N){var q=_[C]===H?N[C]:w,z=b(u[I],q);x(z,w)||(S.push(C),A.push(z))}else S.push(C)}return E[D]=S.length,a.createSparseMatrix({values:A,index:S,ptr:E,size:[v,D],datatype:f===a._datatype&&g===i._datatype?y:void 0})}}),wh="dotMultiply",eN=["typed","matrix","equalScalar","multiplyScalar","concat"],tN=U(wh,eN,t=>{var{typed:e,matrix:r,equalScalar:n,multiplyScalar:a,concat:i}=t,s=Xr({typed:e,equalScalar:n}),u=bh({typed:e,equalScalar:n}),l=tr({typed:e,equalScalar:n}),o=Ct({typed:e,matrix:r,concat:i});return e(wh,o({elop:a,SS:u,DS:s,Ss:l}))});function rN(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function bitAnd");var r=t.constructor;if(t.isNaN()||e.isNaN())return new r(NaN);if(t.isZero()||e.eq(-1)||t.eq(e))return t;if(e.isZero()||t.eq(-1))return e;if(!t.isFinite()||!e.isFinite()){if(!t.isFinite()&&!e.isFinite())return t.isNegative()===e.isNegative()?t:new r(0);if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new r(0):e;if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new r(0):t}return gl(t,e,function(n,a){return n&a})}function ki(t){if(t.isFinite()&&!t.isInteger())throw new Error("Integer expected in function bitNot");var e=t.constructor,r=e.precision;e.config({precision:1e9});var n=t.plus(new e(1));return n.s=-n.s||null,e.config({precision:r}),n}function nN(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function bitOr");var r=t.constructor;if(t.isNaN()||e.isNaN())return new r(NaN);var n=new r(-1);return t.isZero()||e.eq(n)||t.eq(e)?e:e.isZero()||t.eq(n)?t:!t.isFinite()||!e.isFinite()?!t.isFinite()&&!t.isNegative()&&e.isNegative()||t.isNegative()&&!e.isNegative()&&!e.isFinite()?n:t.isNegative()&&e.isNegative()?t.isFinite()?t:e:t.isFinite()?e:t:gl(t,e,function(a,i){return a|i})}function gl(t,e,r){var n=t.constructor,a,i,s=+(t.s<0),u=+(e.s<0);if(s){a=to(ki(t));for(var l=0;l<a.length;++l)a[l]^=1}else a=to(t);if(u){i=to(ki(e));for(var o=0;o<i.length;++o)i[o]^=1}else i=to(e);var c,f,d;a.length<=i.length?(c=a,f=i,d=s):(c=i,f=a,d=u);var m=c.length,h=f.length,p=r(s,u)^1,g=new n(p^1),v=new n(1),D=new n(2),y=n.precision;for(n.config({precision:1e9});m>0;)r(c[--m],f[--h])===p&&(g=g.plus(v)),v=v.times(D);for(;h>0;)r(d,f[--h])===p&&(g=g.plus(v)),v=v.times(D);return n.config({precision:y}),p===0&&(g.s=-g.s),g}function to(t){for(var e=t.d,r=e[0]+"",n=1;n<e.length;++n){for(var a=e[n]+"",i=7-a.length;i--;)a="0"+a;r+=a}for(var s=r.length;r.charAt(s)==="0";)s--;var u=t.e,l=r.slice(0,s+1||1),o=l.length;if(u>0)if(++u>o)for(u-=o;u--;)l+="0";else u<o&&(l=l.slice(0,u)+"."+l.slice(u));for(var c=[0],f=0;f<l.length;){for(var d=c.length;d--;)c[d]*=10;c[0]+=parseInt(l.charAt(f++));for(var m=0;m<c.length;++m)c[m]>1&&((c[m+1]===null||c[m+1]===void 0)&&(c[m+1]=0),c[m+1]+=c[m]>>1,c[m]&=1)}return c.reverse()}function aN(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function bitXor");var r=t.constructor;if(t.isNaN()||e.isNaN())return new r(NaN);if(t.isZero())return e;if(e.isZero())return t;if(t.eq(e))return new r(0);var n=new r(-1);return t.eq(n)?ki(e):e.eq(n)?ki(t):!t.isFinite()||!e.isFinite()?!t.isFinite()&&!e.isFinite()?n:new r(t.isNegative()===e.isNegative()?1/0:-1/0):gl(t,e,function(a,i){return a^i})}function iN(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function leftShift");var r=t.constructor;return t.isNaN()||e.isNaN()||e.isNegative()&&!e.isZero()?new r(NaN):t.isZero()||e.isZero()?t:!t.isFinite()&&!e.isFinite()?new r(NaN):e.lt(55)?t.times(Math.pow(2,e.toNumber())+""):t.times(new r(2).pow(e))}function sN(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function rightArithShift");var r=t.constructor;return t.isNaN()||e.isNaN()||e.isNegative()&&!e.isZero()?new r(NaN):t.isZero()||e.isZero()?t:e.isFinite()?e.lt(55)?t.div(Math.pow(2,e.toNumber())+"").floor():t.div(new r(2).pow(e)).floor():t.
23isNegative()?new r(-1):t.isFinite()?new r(0):new r(NaN)}var xh="bitAnd",oN=["typed","matrix","equalScalar","concat"],Dh=U(xh,oN,t=>{var{typed:e,matrix:r,equalScalar:n,concat:a}=t,i=Xr({typed:e,equalScalar:n}),s=eo({typed:e,equalScalar:n}),u=tr({typed:e,equalScalar:n}),l=Ct({typed:e,matrix:r,concat:a});return e(xh,{"number, number":tm,"BigNumber, BigNumber":rN,"bigint, bigint":(o,c)=>o&c},l({SS:s,DS:i,Ss:u}))}),Eh="bitNot",uN=["typed"],lN=U(Eh,uN,t=>{var{typed:e}=t;return e(Eh,{number:rm,BigNumber:ki,bigint:r=>~r,"Array | Matrix":e.referToSelf(r=>n=>nt(n,r))})}),Ah="bitOr",cN=["typed","matrix","equalScalar","DenseMatrix","concat"],Sh=U(Ah,cN,t=>{var{typed:e,matrix:r,equalScalar:n,DenseMatrix:a,concat:i}=t,s=Vn({typed:e}),u=hl({typed:e,equalScalar:n}),l=ca({typed:e,DenseMatrix:a}),o=Ct({typed:e,matrix:r,concat:i});return e(Ah,{"number, number":nm,"BigNumber, BigNumber":nN,"bigint, bigint":(c,f)=>c|f},o({SS:u,DS:s,Ss:l}))}),fN="matAlgo07xSSf",dN=["typed","SparseMatrix"],on=U(fN,dN,t=>{var{typed:e,SparseMatrix:r}=t;return function(i,s,u){var l=i._size,o=i._datatype||i._data===void 0?i._datatype:i.getDataType(),c=s._size,f=s._datatype||s._data===void 0?s._datatype:s.getDataType();if(l.length!==c.length)throw new at(l.length,c.length);if(l[0]!==c[0]||l[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+c+")");var d=l[0],m=l[1],h,p=0,g=u;typeof o=="string"&&o===f&&o!=="mixed"&&(h=o,p=e.convert(0,h),g=e.find(u,[h,h]));for(var v=[],D=[],y=new Array(m+1).fill(0),x=[],w=[],b=[],A=[],S=0;S<m;S++){var E=S+1,N=0;n(i,S,b,x,E),n(s,S,A,w,E);for(var _=0;_<d;_++){var C=b[_]===E?x[_]:p,O=A[_]===E?w[_]:p,I=g(C,O);I!==0&&I!==!1&&(D.push(_),v.push(I),N++)}y[S+1]=y[S]+N}return new r({values:v,index:D,ptr:y,size:[d,m],datatype:o===i._datatype&&f===s._datatype?h:void 0})};function n(a,i,s,u,l){for(var o=a._values,c=a._index,f=a._ptr,d=f[i],m=f[i+1];d<m;d++){var h=c[d];s[h]=l,u[h]=o[d]}}}),Nh="bitXor",mN=["typed","matrix","DenseMatrix","concat","SparseMatrix"],hN=U(Nh,mN,t=>{var{typed:e,matrix:r,DenseMatrix:n,concat:a,SparseMatrix:i}=t,s=cr({typed:e}),u=on({typed:e,SparseMatrix:i}),l=Gt({typed:e,DenseMatrix:n}),o=Ct({typed:e,matrix:r,concat:a});return e(Nh,{"number, number":am,"BigNumber, BigNumber":aN,"bigint, bigint":(c,f)=>c^f},o({SS:u,DS:s,Ss:l}))}),_h="arg",pN=["typed"],vN=U(_h,pN,t=>{var{typed:e}=t;return e(_h,{number:function(n){return Math.atan2(0,n)},BigNumber:function(n){return n.constructor.atan2(0,n)},Complex:function(n){return n.arg()},"Array | Matrix":e.referToSelf(r=>n=>nt(n,r))})}),Ch="conj",gN=["typed"],yN=U(Ch,gN,t=>{var{typed:e}=t;return e(Ch,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.conjugate(),Unit:e.referToSelf(r=>n=>new n.constructor(r(n.toNumeric()),n.formatUnits())),"Array | Matrix":e.referToSelf(r=>n=>nt(n,r))})}),Mh="im",bN=["typed"],wN=U(Mh,bN,t=>{var{typed:e}=t;return e(Mh,{number:()=>0,"BigNumber | Fraction":r=>r.mul(0),Complex:r=>r.im,"Array | Matrix":e.referToSelf(r=>n=>nt(n,r))})}),Th="re",xN=["typed"],DN=U(Th,xN,t=>{var{typed:e}=t;return e(Th,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.re,"Array | Matrix":e.referToSelf(r=>n=>nt(n,r))})}),Fh="not",EN=["typed"],AN=U(Fh,EN,t=>{var{typed:e}=t;return e(Fh,{"null | undefined":()=>!0,number:lm,Complex:function(n){return n.re===0&&n.im===0},BigNumber:function(n){return n.isZero()||n.isNaN()},bigint:r=>!r,Unit:e.referToSelf(r=>n=>e.find(r,n.valueType())(n.value)),"Array | Matrix":e.referToSelf(r=>n=>nt(n,r))})}),Oh="nullish",SN=["typed","matrix","size","flatten","deepEqual"],Bh=U(Oh,SN,t=>{var{typed:e,matrix:r,size:n,flatten:a,deepEqual:i}=t,s=cr({typed:e}),u=qr({typed:e}),l=ah({typed:e});return e(Oh,{"number|bigint|Complex|BigNumber|Fraction|Unit|string|boolean|SparseMatrix, any":(o,c)=>o,"null, any":(o,c)=>c,"undefined, any":(o,c)=>c,"SparseMatrix, Array | Matrix":(o,c)=>{var f=n(o),d=n(c);if(i(f,d))return o;throw new at(f,d)},"DenseMatrix, DenseMatrix":e.referToSelf(o=>(c,f)=>l(c,f,o)),"DenseMatrix, SparseMatrix":e.referToSelf(o=>(c,f)=>
vendor: 5,842 bytes, line 23
23s(c,f,o,!1)),"DenseMatrix, Array":e.referToSelf(o=>(c,f)=>l(c,r(f),o)),"DenseMatrix, any":e.referToSelf(o=>(c,f)=>u(c,f,o,!1)),"Array, Array":e.referToSelf(o=>(c,f)=>l(r(c),r(f),o).valueOf()),"Array, DenseMatrix":e.referToSelf(o=>(c,f)=>l(r(c),f,o)),"Array, SparseMatrix":e.referToSelf(o=>(c,f)=>s(r(c),f,o,!1)),"Array, any":e.referToSelf(o=>(c,f)=>u(r(c),f,o,!1).valueOf())})}),kh="or",NN=["typed","matrix","equalScalar","DenseMatrix","concat"],Ih=U(kh,NN,t=>{var{typed:e,matrix:r,equalScalar:n,DenseMatrix:a,concat:i}=t,s=cr({typed:e}),u=Ks({typed:e,equalScalar:n}),l=Gt({typed:e,DenseMatrix:a}),o=Ct({typed:e,matrix:r,concat:i});return e(kh,{"number, number":sl,"Complex, Complex":function(f,d){return f.re!==0||f.im!==0||d.re!==0||d.im!==0},"BigNumber, BigNumber":function(f,d){return!f.isZero()&&!f.isNaN()||!d.isZero()&&!d.isNaN()},"bigint, bigint":sl,"Unit, Unit":e.referToSelf(c=>(f,d)=>c(f.value||0,d.value||0))},o({SS:u,DS:s,Ss:l}))}),Lh="xor",_N=["typed","matrix","DenseMatrix","concat","SparseMatrix"],CN=U(Lh,_N,t=>{var{typed:e,matrix:r,DenseMatrix:n,concat:a,SparseMatrix:i}=t,s=cr({typed:e}),u=on({typed:e,SparseMatrix:i}),l=Gt({typed:e,DenseMatrix:n}),o=Ct({typed:e,matrix:r,concat:a});return e(Lh,{"number, number":ol,"Complex, Complex":function(f,d){return(f.re!==0||f.im!==0)!=(d.re!==0||d.im!==0)},"bigint, bigint":ol,"BigNumber, BigNumber":function(f,d){return(!f.isZero()&&!f.isNaN())!=(!d.isZero()&&!d.isNaN())},"Unit, Unit":e.referToSelf(c=>(f,d)=>c(f.value||0,d.value||0))},o({SS:u,DS:s,Ss:l}))}),Rh="concat",MN=["typed","matrix","isInteger"],$h=U(Rh,MN,t=>{var{typed:e,matrix:r,isInteger:n}=t;return e(Rh,{"...Array | Matrix | number | BigNumber":function(i){var s,u=i.length,l=-1,o,c=!1,f=[];for(s=0;s<u;s++){var d=i[s];if(ze(d)&&(c=!0),qe(d)||Qe(d)){if(s!==u-1)throw new Error("Dimension must be specified as last argument");if(o=l,l=d.valueOf(),!n(l))throw new TypeError("Integer number expected for dimension");if(l<0||s>0&&l>o)throw new $r(l,o+1)}else{var m=je(d).valueOf(),h=Ke(m);if(f[s]=m,o=l,l=h.length-1,s>0&&l!==o)throw new at(o+1,l+1)}}if(f.length===0)throw new SyntaxError("At least one matrix expected");for(var p=f.shift();f.length;)p=Od(p,f.shift(),l);return c?r(p):p},"...string":function(i){return i.join("")}})}),Ph="column",TN=["typed","Index","matrix","range"],qh=U(Ph,TN,t=>{var{typed:e,Index:r,matrix:n,range:a}=t;return e(Ph,{"Matrix, number":i,"Array, number":function(u,l){return i(n(je(u)),l).valueOf()}});function i(s,u){if(s.size().length!==2)throw new Error("Only two dimensional matrix is supported");_t(u,s.size()[1]);var l=a(0,s.size()[0]),o=new r(l,[u]),c=s.subset(o);return ze(c)?c:n([[c]])}}),Uh="count",FN=["typed","size","prod"],ON=U(Uh,FN,t=>{var{typed:e,size:r,prod:n}=t;return e(Uh,{string:function(i){return i.length},"Matrix | Array":function(i){return n(r(i))}})}),zh="cross",BN=["typed","matrix","subtract","multiply"],kN=U(zh,BN,t=>{var{typed:e,matrix:r,subtract:n,multiply:a}=t;return e(zh,{"Matrix, Matrix":function(u,l){return r(i(u.toArray(),l.toArray()))},"Matrix, Array":function(u,l){return r(i(u.toArray(),l))},"Array, Matrix":function(u,l){return r(i(u,l.toArray()))},"Array, Array":i});function i(s,u){var l=Math.max(Ke(s).length,Ke(u).length);s=Us(s),u=Us(u);var o=Ke(s),c=Ke(u);if(o.length!==1||c.length!==1||o[0]!==3||c[0]!==3)throw new RangeError("Vectors with length 3 expected (Size A = ["+o.join(", ")+"], B = ["+c.join(", ")+"])");var f=[n(a(s[1],u[2]),a(s[2],u[1])),n(a(s[2],u[0]),a(s[0],u[2])),n(a(s[0],u[1]),a(s[1],u[0]))];return l>1?[f]:f}}),Yh="diag",IN=["typed","matrix","DenseMatrix","SparseMatrix"],LN=U(Yh,IN,t=>{var{typed:e,matrix:r,DenseMatrix:n,SparseMatrix:a}=t;return e(Yh,{Array:function(o){return i(o,0,Ke(o),null)},"Array, number":function(o,c){return i(o,c,Ke(o),null)},"Array, BigNumber":function(o,c){return i(o,c.toNumber(),Ke(o),null)},"Array, string":function(o,c){return i(o,0,Ke(o),c)},"Array, number, string":function(o,c,f){return i(o,c,Ke(o),f)},"Array, BigNumber, string":function(o,c,f){return i(o,c.toNumber(),Ke(o),f)},Matrix:function(o){return i(o,0,o.size(),o.storage())},"Matrix, number":function(o,c){return i(o,c,o.size(),o.storage())},"Matrix, BigNumber":function(o,c){return i(o,c.toNumber(),o.size(),o.storage())},"Matrix, string":function(o,c){return i(o,0,o.size(),c)},"Matrix, number, string":function(o,c,f){return i(o,c,o.size(),f)},"Matrix, BigNumber, string":function(o,c,f){return i(o,c.toNumber(),o.size(),f)}});function i(l,o,c,f){if(!$e(o))throw new TypeError("Second parameter in function diag must be an integer");var d=o>0?o:0,m=o<0?-o:0;switch(c.length){case 1:return s(l,o,f,c[0],m,d);case 2:return u(l,o,f,c,m,d)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function s(l,o,c,f,d,m){var h=[f+d,f+m];if(c&&c!=="sparse"&&c!=="dense")throw new TypeError("Unknown matrix type ".concat(c,'"'));var p=c==="sparse"?a.diagonal(h,l,o):n.diagonal(h,l,o);return c!==null?p:p.valueOf()}function u(l,o,c,f,d,m){if(ze(l)){var h=l.diagonal(o);return c!==null?c!==h.storage()?r(h,c):h:h.valueOf()}for(var p=Math.min(f[0]-d,f[1]-m),g=[],v=0;v<p;v++)g[v]=l[v+d][v+m];return c!==null?r(g):g}}),RN="filter",$N=["typed"],Vh=U(RN,$N,t=>{var{typed:e}=t;return e("filter",{"Array, function":Hh,"Matrix, function":function(n,a){return n.create(Hh(n.valueOf(),a),n.datatype())},"Array, RegExp":Md,"Matrix, RegExp":function(n,a){return n.create(Md(n.valueOf(),a),n.datatype())}})});function Hh(t,e){var r=la(e,t,"filter");return r.isUnary?Cd(t,r.fn):Cd(t,function(n,a,i){return r.fn(n,[a],i)})}var Wh="flatten",PN=["typed"],qN=U(Wh,PN,t=>{var{typed:e}=t;return e(Wh,{Array:function(n){return pt(n)},DenseMatrix:function(n){return n.create(pt(n.valueOf(),!0),n.datatype())},SparseMatrix:function(n){throw new TypeError("SparseMatrix is not supported by function flatten because it does not support
231D vectors. Convert to a DenseMatrix or Array first. Example: flatten(x.toArray())")}})}),yl="forEach",UN=["typed"],Gh=U(yl,UN,t=>{var{typed:e}=t;return e(yl,{"Array, function":zN,"Matrix, function":function(n,a){n.forEach(a)}})});function zN(t,e){var r=la(e,t,yl);kd(t,r.fn,r.isUnary)}var jh="getMatrixDataType",YN=["typed"],VN=U(jh,YN,t=>{var{typed:e}=t;return e(jh,{Array:function(n){return Ys(n,Et)},Matrix:function(n){return n.getDataType()}})}),Zh="identity",HN=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],WN=U(Zh,HN,t=>{var{typed:e,config:r,matrix:n,BigNumber:a,DenseMatrix:i,SparseMatrix:s}=t;return e(Zh,{"":function(){return r.matrix==="Matrix"?n([]):[]},string:function(c){return n(c)},"number | BigNumber":function(c){return l(c,c,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(c,f){return l(c,c,f)},"number | BigNumber, number | BigNumber":function(c,f){return l(c,f,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(c,f,d){return l(c,f,d)},Array:function(c){return u(c)},"Array, string":function(c,f){return u(c,f)},Matrix:function(c){return u(c.valueOf(),c.storage())},"Matrix, string":function(c,f){return u(c.valueOf(),f)}});function u(o,c){switch(o.length){case 0:return c?n(c):[];case 1:return l(o[0],o[0],c);case 2:return l(o[0],o[1],c);default:throw new Error("Vector containing two values expected")}}function l(o,c,f){var d=Qe(o)||Qe(c)?a:null;if(Qe(o)&&(o=o.toNumber()),Qe(c)&&(c=c.toNumber()),!$e(o)||o<1)throw new Error("Parameters in function identity must be positive integers");if(!$e(c)||c<1)throw new Error("Parameters in function identity must be positive integers");var m=d?new a(1):1,h=d?new d(0):0,p=[o,c];if(f){if(f==="sparse")return s.diagonal(p,m,0,h);if(f==="dense")return i.diagonal(p,m,0,h);throw new TypeError('Unknown matrix type "'.concat(f,'"'))}for(var g=za([],p,h),v=o<c?o:c,D=0;D<v;D++)g[D][D]=m;return g}}),Xh="kron",GN=["typed","matrix","multiplyScalar"],jN=U(Xh,GN,t=>{var{typed:e,matrix:r,multiplyScalar:n}=t;return e(Xh,{"Matrix, Matrix":function(u,l){return r(i(u.toArray(),l.toArray()))},"Matrix, Array":function(u,l){return r(i(u.toArray(),l))},"Array, Matrix":function(u,l){return r(i(u,l.toArray()))},"Array, Array":i});function a(s,u){return s.flatMap(l=>u.map(o=>n(l,o)))}function i(s,u){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1;if(l<0){var o=Ke(s).length,c=Ke(u).length;for(l=Math.max(o,c);o++<l;)s=[s];for(;c++<l;)u=[u]}return l===1?a(s,u):s.flatMap(f=>u.map(d=>i(f,d,l-1)))}}),bl="map",ZN=["typed"],Jh=U(bl,ZN,t=>{var{typed:e}=t;return e(bl,{"Array, function":u,"Matrix, function":function(o,c){return o.map(c)},"Array|Matrix, Array|Matrix, ...Array|Matrix|function":(l,o,c)=>r([l,o,...c.slice(0,c.length-1)],c[c.length-1])});function r(l,o){if(typeof o!="function")throw new Error("Last argument must be a callback function");var c=l[0].isMatrix,f=l.map(w=>w.isMatrix?w.size():Ke(w)),d=Vs(...f),m=l.length,h=c?(w,b)=>w.get(b):Hs,p=l.map((w,b)=>{var A=f[b].map(()=>0);return w.isMatrix?w.get(A):Hs(w,A)}),g=e.isTypedFunction(o)?s(o,p,d.map(()=>0),l):i(o,m);if(g<2){var v=a(g,o,null);return n(l,v)}var D=c?l.map(w=>w.isMatrix?w.create(ua(w.toArray(),d),w.datatype()):l[0].create(ua(w.valueOf(),d))):l.map(w=>w.isMatrix?ua(w.toArray(),d):ua(w,d)),y=a(g,o,D),x=(w,b)=>y([w,...D.slice(1).map(A=>h(A,b))],b);return c?D[0].map(x):u(D[0],x)}function n(l,o){var c=l[0],f=l.map(w=>w.isMatrix?w.valueOf():w),d=l.map(w=>w.isMatrix?w.size():Ke(w)),m=Vs(...d),h=d.map(w=>m.length-w.length),p=m.length-1,g=o.length>1,v=g?[]:null,D=x(f,0);if(c.isMatrix){var y=c.create();return y._data=D,y._size=m,y}else return D;function x(w){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,A=m[b],S=Array(A);if(b<p)for(var E=function(I){v&&(v[b]=I),S[I]=x(w.map((k,M)=>h[M]>b?k:k.length===1?k[0]:k[I]),b+1)},N=0;N<A;N++)E(N);else for(var _=function(I){v&&(v[b]=I),S[I]=o(w.map(k=>k.length===1?k[0]:k[I]),v?v.slice():void 0)},C=0;C<A;C++)_(C);return S}}function a(l,o,c){switch(l){case 0:return f=>o(...f);case 1:return(f,d)=>o(...f,d);case 2:return(f,d)=>o(...f,d,...c)}}function i(l,o){var c=l.toString();if(/arguments/.test(c))return 2;var f=c.match(/\(.*?\)/);return/\.\.\./.test(f)||l.length>
vendor: 56,299 bytes, line 23
23o+1?2:l.length===o+1?1:0}function s(l,o,c,f){return e.resolve(l,[...o,c,...f])!==null?2:e.resolve(l,[...o,c])!==null?1:(e.resolve(l,o)!==null,0)}function u(l,o){var c=la(o,l,bl);return rl(l,c.fn,c.isUnary)}}),Qh="diff",XN=["typed","matrix","subtract","number"],Kh=U(Qh,XN,t=>{var{typed:e,matrix:r,subtract:n,number:a}=t;return e(Qh,{"Array | Matrix":function(c){return ze(c)?r(s(c.toArray())):s(c)},"Array | Matrix, number":function(c,f){if(!$e(f))throw new RangeError("Dimension must be a whole number");return ze(c)?r(i(c.toArray(),f)):i(c,f)},"Array, BigNumber":e.referTo("Array,number",o=>(c,f)=>o(c,a(f))),"Matrix, BigNumber":e.referTo("Matrix,number",o=>(c,f)=>o(c,a(f)))});function i(o,c){if(ze(o)&&(o=o.toArray()),!Array.isArray(o))throw RangeError("Array/Matrix does not have that many dimensions");if(c>0){var f=[];return o.forEach(d=>{f.push(i(d,c-1))}),f}else{if(c===0)return s(o);throw RangeError("Cannot have negative dimension")}}function s(o){for(var c=[],f=o.length,d=1;d<f;d++)c.push(u(o[d-1],o[d]));return c}function u(o,c){ze(o)&&(o=o.toArray()),ze(c)&&(c=c.toArray());var f=Array.isArray(o),d=Array.isArray(c);if(f&&d)return l(o,c);if(!f&&!d)return n(c,o);throw TypeError("Cannot calculate difference between 1 array and 1 non-array")}function l(o,c){if(o.length!==c.length)throw RangeError("Not all sub-arrays have the same length");for(var f=[],d=o.length,m=0;m<d;m++)f.push(u(o[m],c[m]));return f}}),JN="ones",QN=["typed","config","matrix","BigNumber"],KN=U(JN,QN,t=>{var{typed:e,config:r,matrix:n,BigNumber:a}=t;return e("ones",{"":function(){return r.matrix==="Array"?i([]):i([],"default")},"...number | BigNumber | string":function(o){var c=o[o.length-1];if(typeof c=="string"){var f=o.pop();return i(o,f)}else return r.matrix==="Array"?i(o):i(o,"default")},Array:i,Matrix:function(o){var c=o.storage();return i(o.valueOf(),c)},"Array | Matrix, string":function(o,c){return i(o.valueOf(),c)}});function i(l,o){var c=s(l),f=c?new a(1):1;if(u(l),o){var d=n(o);return l.length>0?d.resize(l,f):d}else{var m=[];return l.length>0?za(m,l,f):m}}function s(l){var o=!1;return l.forEach(function(c,f,d){Qe(c)&&(o=!0,d[f]=c.toNumber())}),o}function u(l){l.forEach(function(o){if(typeof o!="number"||!$e(o)||o<0)throw new Error("Parameters in function ones must be positive integers")})}});function wl(){throw new Error('No "bignumber" implementation available')}function ep(){throw new Error('No "fraction" implementation available')}function e_(){throw new Error('No "matrix" implementation available')}var tp="range",t_=["typed","config","?matrix","?bignumber","equal","smaller","smallerEq","larger","largerEq","add","isZero","isPositive"],rp=U(tp,t_,t=>{var{typed:e,config:r,matrix:n,bignumber:a,smaller:i,smallerEq:s,larger:u,largerEq:l,add:o,isZero:c,isPositive:f}=t;return e(tp,{string:m,"string, boolean":m,number:function(v){throw new TypeError("Too few arguments to function range(): ".concat(v))},boolean:function(v){throw new TypeError("Unexpected type of argument 1 to function range(): ".concat(v,", number|bigint|BigNumber|Fraction"))},"number, number":function(v,D){return d(h(v,D,1,!1))},"number, number, number":function(v,D,y){return d(h(v,D,y,!1))},"number, number, boolean":function(v,D,y){return d(h(v,D,1,y))},"number, number, number, boolean":function(v,D,y,x){return d(h(v,D,y,x))},"bigint, bigint|number":function(v,D){return d(h(v,D,1n,!1))},"number, bigint":function(v,D){return d(h(BigInt(v),D,1n,!1))},"bigint, bigint|number, bigint|number":function(v,D,y){return d(h(v,D,BigInt(y),!1))},"number, bigint, bigint|number":function(v,D,y){return d(h(BigInt(v),D,BigInt(y),!1))},"bigint, bigint|number, boolean":function(v,D,y){return d(h(v,D,1n,y))},"number, bigint, boolean":function(v,D,y){return d(h(BigInt(v),D,1n,y))},"bigint, bigint|number, bigint|number, boolean":function(v,D,y,x){return d(h(v,D,BigInt(y),x))},"number, bigint, bigint|number, boolean":function(v,D,y,x){return d(h(BigInt(v),D,BigInt(y),x))},"BigNumber, BigNumber":function(v,D){var y=v.constructor;return d(h(v,D,new y(1),!1))},"BigNumber, BigNumber, BigNumber":function(v,D,y){return d(h(v,D,y,!1))},"BigNumber, BigNumber, boolean":function(v,D,y){var x=v.constructor;return d(h(v,D,new x(1),y))},"BigNumber, BigNumber, BigNumber, boolean":function(v,D,y,x){return d(h(v,D,y,x))},"Fraction, Fraction":function(v,D){return d(h(v,D,1,!1))},"Fraction, Fraction, Fraction":function(v,D,y){return d(h(v,D,y,!1))},"Fraction, Fraction, boolean":function(v,D,y){return d(h(v,D,1,y))},"Fraction, Fraction, Fraction, boolean":function(v,D,y,x){return d(h(v,D,y,x))},"Unit, Unit, Unit":function(v,D,y){return d(h(v,D,y,!1))},"Unit, Unit, Unit, boolean":function(v,D,y,x){return d(h(v,D,y,x))}});function d(g){return r.matrix==="Matrix"?n?n(g):e_():g}function m(g,v){var D=p(g);if(!D)throw new SyntaxError('String "'+g+'" is no valid range');return r.number==="BigNumber"?(a===void 0&&wl(),d(h(a(D.start),a(D.end),a(D.step)))):d(h(D.start,D.end,D.step,v))}function h(g,v,D,y){var x=[];if(c(D))throw new Error("Step must be non-zero");for(var w=f(D)?y?s:i:y?l:u,b=g;w(b,v);)x.push(b),b=o(b,D);return x}function p(g){var v=g.split(":"),D=v.map(function(x){return Number(x)}),y=D.some(function(x){return isNaN(x)});if(y)return null;switch(D.length){case 2:return{start:D[0],end:D[1],step:1};case 3:return{start:D[0],end:D[2],step:D[1]};default:return null}}}),np="reshape",r_=["typed","isInteger","matrix"],n_=U(np,r_,t=>{var{typed:e,isInteger:r}=t;return e(np,{"Matrix, Array":function(a,i){return a.reshape(i,!0)},"Array, Array":function(a,i){return i.forEach(function(s){if(!r(s))throw new TypeError("Invalid size for dimension: "+s)}),el(a,i)}})}),a_="resize",i_=["config","matrix"],s_=U(a_,i_,t=>{var{config:e,matrix:r}=t;return function(i,s,u){if(arguments.length!==2&&arguments.length!==3)throw new An("resize",arguments.length,2,3);if(ze(s)&&(s=s.valueOf()),Qe(s[0])&&(s=s.map(function(c){return Qe(c)?c.toNumber():c})),ze(i))return i.resize(s,u,!0);if(typeof i=="string")return n(i,s,u);var l=Array.isArray(i)?!1:e.matrix!=="Array";if(s.length===0){for(;Array.isArray(i);)i=i[0];return je(i)}else{Array.isArray(i)||(i=[i]),i=je(i);var o=za(i,s,u);return l?r(o):o}};function n(a,i,s){if(s!==void 0){if(typeof s!="string"||s.length!==1)throw new TypeError("Single character expected as defaultValue")}else s=" ";if(i.length!==1)throw new at(i.length,1);var u=i[0];if(typeof u!="number"||!$e(u))throw new TypeError("Invalid size, must contain positive integers (size: "+ot(i)+")");if(a.length>u)return a.substring(0,u);if(a.length<u){for(var l=a,o=0,c=u-a.length;o<c;o++)l+=s;return l}else return a}}),ap="rotate",o_=["typed","multiply","rotationMatrix"],u_=U(ap,o_,t=>{var{typed:e,multiply:r,rotationMatrix:n}=t;return e(ap,{"Array , number | BigNumber | Complex | Unit":function(s,u){a(s,2);var l=r(n(u),s);return l.toArray()},"Matrix , number | BigNumber | Complex | Unit":function(s,u){return a(s,2),r(n(u),s)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(s,u,l){a(s,3);var o=r(n(u,l),s);return o},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(s,u,l){return a(s,3),r(n(u,l),s)}});function a(i,s){var u=Array.isArray(i)?Ke(i):i.size();if(u.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(s));if(u.length===2&&u[1]!==1)throw new RangeError("Vector must be of dimensions 1x".concat(s));if(u[0]!==s)throw new RangeError("Vector must be of dimensions 1x".concat(s))}}),ip="rotationMatrix",l_=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],c_=U(ip,l_,t=>{var{typed:e,config:r,multiplyScalar:n,addScalar:a,unaryMinus:i,norm:s,BigNumber:u,matrix:l,DenseMatrix:o,SparseMatrix:c,cos:f,sin:d}=t;return e(ip,{"":function(){return r.matrix==="Matrix"?l([]):[]},string:function(y){return l(y)},"number | BigNumber | Complex | Unit":function(y){return m(y,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(y,x){return m(y,x)},"number | BigNumber | Complex | Unit, Array":function(y,x){var w=l(x);return h(w),v(y,w,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(y,x){h(x);var w=x.storage()||(r.matrix==="Matrix"?"dense":void 0);return v(y,x,w)},"number | BigNumber | Complex | Unit, Array, string":function(y,x,w){var b=l(x);return h(b),v(y,b,w)},"number | BigNumber | Complex | Unit, Matrix, string":function(y,x,w){return h(x),v(y,x,w)}});function m(D,y){var x=Qe(D),w=x?new u(-1):-1,b=f(D),A=d(D),S=[[b,n(w,A)],[A,b]];return g(S,y)}function h(D){var y=D.size();if(y.length<1||y[0]!==3)throw new RangeError("Vector must be of dimensions 1x3")}function p(D){return D.reduce((y,x)=>n(y,x))}function g(D,y){if(y){if(y==="sparse")return new c(D);if(y==="dense")return new o(D);throw new TypeError('Unknown matrix type "'.concat(y,'"'))}return D}function v(D,y,x){var w=s(y);if(w===0)throw new RangeError("Rotation around zero vector");var b=Qe(D)?u:null,A=b?new b(1):1,S=b?new b(-1):-1,E=b?new b(y.get([0])/w):y.get([0])/w,N=b?new b(y.get([1])/w):y.get([1])/w,_=b?new b(y.get([2])/w):y.get([2])/w,C=f(D),O=a(A,i(C)),I=d(D),k=a(C,p([E,E,O])),M=a(p([E,N,O]),p([S,_,I])),H=a(p([E,_,O]),p([N,I])),q=a(p([E,N,O]),p([_,I])),z=a(C,p([N,N,O])),X=a(p([N,_,O]),p([S,E,I])),te=a(p([E,_,O]),p([S,N,I])),B=a(p([N,_,O]),p([E,I])),j=a(C,p([_,_,O])),R=[[k,M,H],[q,z,X],[te,B,j]];return g(R,x)}}),sp="row",f_=["typed","Index","matrix","range"],op=U(sp,f_,t=>{var{typed:e,Index:r,matrix:n,range:a}=t;return e(sp,{"Matrix, number":i,"Array, number":function(u,l){return i(n(je(u)),l).valueOf()}});function i(s,u){if(s.size().length!==2)throw new Error("Only two dimensional matrix is supported");_t(u,s.size()[0]);var l=a(0,s.size()[1]),o=new r([u],l),c=s.subset(o);return ze(c)?c:n([[c]])}}),up="size",d_=["typed"],m_=U(up,d_,t=>{var{typed:e}=t;return e(up,{Matrix:r=>r.size(),Array:Ke,string:r=>[r.length],"number | Complex | BigNumber | Unit | boolean | null":r=>[]})}),lp="squeeze",h_=["typed"],p_=U(lp,h_,t=>{var{typed:e}=t;return e(lp,{Array:function(n){return Us(je(n))},Matrix:function(n){var a=Us(n.toArray());return Array.isArray(a)?n.create(a,n.datatype()):a},any:function(n){return je(n)}})}),cp="subset",v_=["typed","matrix","zeros","add"],fp=U(cp,v_,t=>{var{typed:e,matrix:r,zeros:n,add:a}=t;return e(cp,{"Matrix, Index":function(u,l){return Ua(l)?r():(qs(u,l),u.subset(l))},"Array, Index":e.referTo("Matrix, Index",function(s){return function(u,l){var o=s(r(u),l);return l.isScalar()?o:o.valueOf()}}),"Object, Index":y_,"string, Index":g_,"Matrix, Index, any, any":function(u,l,o,c){return Ua(l)?u:(qs(u,l),u.clone().subset(l,i(o,l),c))},"Array, Index, any, any":e.referTo("Matrix, Index, any, any",function(s){return function(u,l,o,c){var f=s(r(u),l,o,c);return f.isMatrix?f.valueOf():f}}),"Array, Index, any":e.referTo("Matrix, Index, any, any",function(s){return function(u,l,o){return s(r(u),l,o,void 0).valueOf()}}),"Matrix, Index, any":e.referTo("Matrix, Index, any, any",function(s){return function(u,l,o){return s(u,l,o,void 0)}}),"string, Index, string":dp,"string, Index, string, string":dp,"Object, Index, any":b_});function i(s,u){if(typeof s=="string")throw new Error("can't boradcast a string");if(u.isScalar())return s;var l=u.size();if(l.every(o=>o>0))try{return a(s,n(l))}catch{return s}else return s}});function g_(t,e){if(!Si(e))throw new TypeError("Index expected");if(Ua(e))return"";if(qs(Array.from(t),e),e.size().length!==1)throw new at(e.size().length,1);var r=t.length;_t(e.min()[0],r),_t(e.max()[0],r);var n=e.dimension(0),a="";function i(s){a+=t.charAt(s)}return Number.isInteger(n)?i(n):n.forEach(i),a}function dp(t,e,r,n){if(!e||e.isIndex!==!0)throw new TypeError("Index expected");if(Ua(e))return t;if(qs(Array.from(t),e),e.size().length!==1)throw new at(e.size().length,1);if(n!==void 0){if(typeof n!="string"||n.length!==1)throw new TypeError("Single character expected as defaultValue")}else n=" ";var a=e.dimension(0),i=Number.isInteger(a)?1:a.size()[0];if(i!==r.length)throw new at(a.size()[0],r.length);var s=t.length;_t(e.min()[0]),_t(e.max()[0]);for(var u=[],l=0;l<s;l++)u[l]=t.charAt(l);function o(d,m){u[d]=r.charAt(m[0])}if(Number.isInteger(a)?o(a,[0]):a.forEach(o),u.length>s)for(var c=s-1,f=u.length;c<f;c++)u[c]||(u[c]=n);return u.join("")}function y_(t,e){if(!Ua(e)){if(e.size().length!==1)throw new at(e.size(),1);var r=e.dimension(0);if(typeof r!="string")throw new TypeError("String expected as index to retrieve an object property");return hr(t,r)}}function b_(t,e,r){if(Ua(e))return t;if(e.size().length!==1)throw new at(e.size(),1);var n=e.dimension(0);if(typeof n!="string")throw new TypeError("String expected as index to retrieve an object property");var a=je(t);return Ma(a,n,r),a}var mp="transpose",w_=["typed","matrix"],x_=U(mp,w_,t=>{var{typed:e,matrix:r}=t;return e(mp,{Array:s=>n(r(s)).valueOf(),Matrix:n,any:je});function n(s){var u=s.size(),l;switch(u.length){case 1:l=s.clone();break;case 2:{var o=u[0],c=u[1];if(c===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+ot(u)+")");switch(s.storage()){case"dense":l=a(s,o,c);break;case"sparse":l=i(s,o,c);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+ot(u)+")")}return l}function a(s,u,l){for(var o=s._data,c=[],f,d=0;d<l;d++){f=c[d]=[];for(var m=0;m<u;m++)f[m]=je(o[m][d])}return s.createDenseMatrix({data:c,size:[l,u],datatype:s._datatype})}function i(s,u,l){for(var o=s._values,c=s._index,f=s._ptr,d=o?[]:void 0,m=[],h=[],p=[],g=0;g<u;g++)p[g]=0;var v,D,y;for(v=0,D=c.length;v<D;v++)p[c[v]]++;for(var x=0,w=0;w<u;w++)h.push(x),x+=p[w],p[w]=h[w];for(h.push(x),y=0;y<l;y++)for(var b=f[y],A=f[y+1],S=b;S<A;S++){var E=p[c[S]]++;m[E]=y,o&&(d[E]=je(o[S]))}return s.createSparseMatrix({values:d,index:m,ptr:h,size:[l,u],datatype:s._datatype})}}),hp="ctranspose",D_=["typed","transpose","conj"],E_=U(hp,D_,t=>{var{typed:e,transpose:r,conj:n}=t;return e(hp,{any:function(i){return n(r(i))}})}),pp="zeros",A_=["typed","config","matrix","BigNumber"],S_=U(pp,A_,t=>{var{typed:e,config:r,matrix:n,BigNumber:a}=t;return e(pp,{"":function(){return r.matrix==="Array"?i([]):i([],"default")},"...number | BigNumber | string":function(o){var c=o[o.length-1];if(typeof c=="string"){var f=o.pop();return i(o,f)}else return r.matrix==="Array"?i(o):i(o,"default")},Array:i,Matrix:function(o){var c=o.storage();return i(o.valueOf(),c)},"Array | Matrix, string":function(o,c){return i(o.valueOf(),c)}});function i(l,o){var c=s(l),f=c?new a(0):0;if(u(l),o){var d=n(o);return l.length>0?d.resize(l,f):d}else{var m=[];return l.length>0?za(m,l,f):m}}function s(l){var o=!1;return l.forEach(function(c,f,d){Qe(c)&&(o=!0,d[f]=c.toNumber())}),o}function u(l){l.forEach(function(o){if(typeof o!="number"||!$e(o)||o<0)throw new Error("Parameters in function zeros must be positive integers")})}}),vp="fft",N_=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],__=U(vp,N_,t=>{var{typed:e,matrix:r,addScalar:n,multiplyScalar:a,divideScalar:i,exp:s,tau:u,i:l,dotDivide:o,conj:c,pow:f,ceil:d,log2:m}=t;return e(vp,{Array:h,Matrix:function(y){return y.create(h(y.valueOf()),y.datatype())}});function h(D){var y=Ke(D);return y.length===1?v(D,y[0]):p(D.map(x=>h(x,y.slice(1))),0)}function p(D,y){var x=Ke(D);if(y!==0)return new Array(x[0]).fill(0).map((b,A)=>p(D[A],y-1));if(x.length===1)return v(D);function w(b){var A=Ke(b);return new Array(A[1]).fill(0).map((S,E)=>new Array(A[0]).fill(0).map((N,_)=>b[_][E]))}return w(p(w(D),1))}function g(D){for(var y=D.length,x=s(i(a(-1,a(l,u)),y)),w=[],b=1-y;b<y;b++)w.push(f(x,i(f(b,2),2)));for(var A=f(2,d(m(y+y-1))),S=[...new Array(y).fill(0).map((M,H)=>a(D[H],w[y-1+H])),...new Array(A-y).fill(0)],E=[...new Array(y+y-1).fill(0).map((M,H)=>i(1,w[H])),...new Array(A-(y+y-1)).fill(0)],N=v(S),_=v(E),C=new Array(A).fill(0).map((M,H)=>a(N[H],_[H])),O=o(c(h(c(C))),A),I=[],k=y-1;k<y+y-1;k++)I.push(a(O[k],w[k]));return I}function v(D){var y=D.length;if(y===1)return[D[0]];if(y%2===0){for(var x=[...v(D.filter((S,E)=>E%2===0)),...v(D.filter((S,E)=>E%2===1))],w=0;w<y/2;w++){var b=x[w],A=a(x[w+y/2],s(a(a(u,l),i(-w,y))));x[w]=n(b,A),x[w+y/2]=n(b,a(-1,A))}return x}else return g(D)}}),gp="ifft",C_=["typed","fft","dotDivide","conj"],M_=U(gp,C_,t=>{var{typed:e,fft:r,dotDivide:n,conj:a}=t;return e(gp,{"Array | Matrix":function(s){var u=ze(s)?s.size():Ke(s);return n(a(r(a(s))),u.reduce((l,o)=>l*o,1))}})});function Ii(t){"@babel/helpers - typeof";return Ii=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ii(t)}function T_(t,e){if(Ii(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ii(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function F_(t){var e=T_(t,"string");return Ii(e)=="symbol"?e:e+""}function Yt(t,e,r){return(e=F_(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yp(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function O_(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?yp(Object(r),!0).forEach(function(n){Yt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):yp(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var B_="solveODE",k_=["typed","add","subtract","multiply","divide","max","map","abs","isPositive","isNegative","larger","smaller","matrix","bignumber","unaryMinus"],I_=U(B_,k_,t=>{var{typed:e,add:r,subtract:n,multiply:a,divide:i,max:s,map:u,abs:l,isPositive:o,isNegative:c,larger:f,smaller:d,matrix:m,bignumber:h,unaryMinus:p}=t;function g(S){return function(E,N,_,C){var O=!(N.length===2&&(N.every(b)||N.every(pr)));if(O)throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var I=N[0],k=N[1],M=f(k,I),H=C.firstStep;if(H!==void 0&&!o(H))throw new Error('"firstStep" must be positive');var q=C.maxStep;if(q!==void 0&&!o(q))throw new Error('"maxStep" must be positive');var z=C.minStep;if(z&&c(z))throw new Error('"minStep" must be positive or zero');var X=[I,k,H,z,q].filter(L=>L!==void 0);if(!(X.every(b)||X.every(pr)))throw new Error('Inconsistent type of "t" dependant variables');for(var te=1,B=C.tol?C.tol:1e-4,j=C.minDelta?C.minDelta:.2,R=C.maxDelta?C.maxDelta:5,oe=C.maxIter?C.maxIter:1e4,se=[I,k,..._,q,z].some(Qe),[le,P,W,J]=se?[h(S.a),h(S.c),h(S.b),h(S.bp)]:[S.a,S.c,S.b,S.bp],re=H?M?H:p(H):i(n(k,I),te),ae=[I],he=[_],fe=n(W,J),De=0,Te=0,Ie=x(M),Me=w(M);Ie(ae[De],k);){var Le=[];re=Me(ae[De],k,re),Le.push(E(ae[De],he[De]));for(var Y=1;Y<P.length;++Y)Le.push(E(r(ae[De],a(P[Y],re)),r(he[De],a(re,le[Y],Le))));var ee=s(l(u(a(fe,Le),L=>pr(L)?L.value:L)));ee<B&&B/ee>1/4&&(ae.push(r(ae[De],re)),he.push(r(he[De],a(re,W,Le))),De++);var ue=.84*(B/ee)**(1/5);if(d(ue,j)?ue=j:f(ue,R)&&(ue=R),ue=se?h(ue):ue,re=a(re,ue),q&&f(l(re),q)?re=M?q:p(q):z&&d(l(re),z)&&(re=M?z:p(z)),Te++,Te>oe)throw new Error("Maximum number of iterations reached, try changing options")}return{t:ae,y:he}}}function v(S,E,N,_){var C=[[],[.5],[0,.75],[.2222222222222222,.3333333333333333,.4444444444444444]],O=[null,1/2,3/4,1],I=[2/9,1/3,4/9,0],k=[7/24,1/4,1/3,1/8],M={a:C,c:O,b:I,bp:k};return g(M)(S,E,N,_)}function D(S,E,N,_){var C=[[],[.2],[.075,.225],[.9777777777777777,-3.7333333333333334,3.5555555555555554],[2.9525986892242035,-11.595793324188385,9.822892851699436,-.2908093278463649],[2.8462752525252526,-10.757575757575758,8.906422717743473,.2784090909090909,-.2735313036020583],[.09114583333333333,0,.44923629829290207,.6510416666666666,-.322376179245283,.13095238095238096]],O=[null,1/5,3/10,4/5,8/9,1,1],I=[35/384,0,500/1113,125/192,-2187/6784,11/84,0],k=[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40],M={a:C,c:O,b:I,bp:k};return g(M)(S,E,N,_)}function y(S,E,N,_){var C=_.method?_.method:"RK45",O={RK23:v,RK45:D};if(C.toUpperCase()in O){var I=O_({},_);return delete I.method,O[C.toUpperCase()](S,E,N,I)}else{var k=Object.keys(O).map(H=>'"'.concat(H,'"')),M="".concat(k.slice(0,-1).join(", ")," and ").concat(k.slice(-1));throw new Error('Unavailable method "'.concat(C,'". Available methods are ').concat(M))}}function x(S){return S?d:f}function w(S){var E=S?f:d;return function(N,_,C){var O=r(N,C);return E(O,_)?n(_,N):C}}function b(S){return Qe(S)||qe(S)}function A(S,E,N,_){var C=y(S,E.toArray(),N.toArray(),_);return{t:m(C.t),y:m(C.y)}}return e("solveODE",{"function, Array, Array, Object":y,"function, Matrix, Matrix, Object":A,"function, Array, Array":(S,E,N)=>y(S,E,N,{}),"function, Matrix, Matrix":(S,E,N)=>A(S,E,N,{}),"function, Array, number | BigNumber | Unit":(S,E,N)=>{var _=y(S,E,[N],{});return{t:_.t,y:_.y.map(C=>C[0])}},"function, Matrix, number | BigNumber | Unit":(S,E,N)=>{var _=y(S,E.toArray(),[N],{});return{t:m(_.t),y:m(_.y.map(C=>C[0]))}},"function, Array, number | BigNumber | Unit, Object":(S,E,N,_)=>{var C=y(S,E,[N],_);return{t:C.t,y:C.y.map(O=>O[0])}},"function, Matrix, number | BigNumber | Unit, Object":(S,E,N,_)=>{var C=y(S,E.toArray(),[N],_);return{t:m(C.t),y:m(C.y.map(O=>O[0]))}}})}),L_="erf",R_=["typed"],$_=U(L_,R_,t=>{var{typed:e}=t;return e("name",{number:function(s){var u=Math.abs(s);return u>=U_?In(s):u<=P_?In(s)*r(u):u<=4?In(s)*(1-n(u)):In(s)*(1-a(u))},"Array | Matrix":e.referToSelf(i=>s=>nt(s,i))});function r(i){var s=i*i,u=Sn[0][4]*s,l=s,o;for(o=0;o<3;o+=1)u=(u+Sn[0][o])*s,l=(l+Za[0][o])*s;return i*(u+Sn[0][3])/(l+Za[0][3])}function n(i){var s=Sn[1][8]*i,u=i,l;for(l=0;l<7;l+=1)s=(s+Sn[1][l])*i,u=(u+Za[1][l])*i;var o=(s+Sn[1][7])/(u+Za[1][7]),c=parseInt(i*16)/16,f=(i-c)*(i+c);return Math.exp(-c*c)*Math.exp(-f)*o}function a(i){var s=1/(i*i),u=Sn[2][5]*s,l=s,o;for(o=0;o<4;o+=1)u=(u+Sn[2][o])*s,l=(l+Za[2][o])*s;var c=s*(u+Sn[2][4])/(l+Za[2][4]);c=(q_-c)/i,s=parseInt(i*16)/16;var f=(i-s)*(i+s);return Math.exp(-s*s)*Math.exp(-f)*c}}),P_=.46875,q_=.5641895835477563,Sn=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,21531153547440383e-24],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],Za=[[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]],U_=Math.pow(2,53),bp="zeta",z_=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],Y_=U(bp,z_,t=>{var{typed:e,config:r,multiply:n,pow:a,divide:i,factorial:s,equal:u,smallerEq:l,isNegative:o,gamma:c,sin:f,subtract:d,add:m,Complex:h,BigNumber:p,pi:g}=t;return e(bp,{number:b=>v(b,A=>A,()=>20),BigNumber:b=>v(b,A=>new p(A),()=>Math.abs(Math.log10(r.relTol))),Complex:D});function v(b,A,S){return u(b,0)?A(-.5):u(b,1)?A(NaN):isFinite(b)?y(b,A,S,E=>E):o(b)?A(NaN):A(1)}function D(b){return b.re===0&&b.im===0?new h(-.5):b.re===1?new h(NaN,NaN):b.re===1/0&&b.im===0?new h(1):b.im===1/0||b.re===-1/0?new h(NaN,NaN):y(b,A=>A,A=>Math.round(1.3*15+.9*Math.abs(A.im)),A=>A.re)}function y(b,A,S,E){var N=S(b);if(E(b)>-(N-1)/2)return w(b,A(N),A);var _=n(a(2,b),a(A(g),d(b,1)));return _=n(_,f(n(i(A(g),2),b))),_=n(_,c(d(1,b))),n(_,y(d(1,b),A,S,E))}function x(b,A){for(var S=b,E=b;l(E,A);E=m(E,1)){var N=i(n(s(m(A,d(E,1))),a(4,E)),n(s(d(A,E)),s(n(2,E))));S=m(S,N)}return n(A,S)}function w(b,A,S){for(var E=i(1,n(x(S(0),A),d(1,a(2,d(1,b))))),N=S(0),_=S(1);l(_,A);_=m(_,1))N=m(N,i(n((-1)**(_-1),x(_,A)),a(_,b)));return n(E,N)}}),wp="mode",V_=["typed","isNaN","isNumeric"],H_=U(wp,V_,t=>{var{typed:e,isNaN:r,isNumeric:n}=t;return e(wp,{"Array | Matrix":a,"...":function(s){return a(s)}});function a(i){i=pt(i.valueOf());var s=i.length;if(s===0)throw new Error("Cannot calculate mode of an empty array");for(var u={},l=[],o=0,c=0;c<i.length;c++){var f=i[c];if(n(f)&&r(f))throw new Error("Cannot calculate mode of an array containing NaN values");f in u||(u[f]=0),u[f]++,u[f]===o?l.push(f):u[f]>o&&(o=u[f],l=[f])}return l}});function vr(t,e,r){var n;return String(t).includes("Unexpected type")?(n=arguments.length>2?" (type: "+Et(r)+", value: "+JSON.stringify(r)+")":" (type: "+t.data.actual+")",new TypeError("Cannot calculate "+e+", unexpected type of argument"+n)):String(t).includes("complex numbers")?(n=arguments.length>2?" (type: "+Et(r)+", value: "+JSON.stringify(r)+")":"",new TypeError("Cannot calculate "+e+", no ordering relation is defined for complex numbers"+n)):t}var xp="prod",W_=["typed","config","multiplyScalar","numeric"],G_=U(xp,W_,t=>{var{typed:e,config:r,multiplyScalar:n,numeric:a}=t;return e(xp,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(u,l){throw new Error("prod(A, dim) is not yet supported")},"...":function(u){return i(u)}});function i(s){var u;if(Yn(s,function(l){try{u=u===void 0?l:n(u,l)}catch(o){throw vr(o,"prod",l)}}),typeof u=="string"&&(u=a(u,kn(u,r))),u===void 0)throw new Error("Cannot calculate prod of an empty array");return u}}),Dp="format",j_=["typed"],Z_=U(Dp,j_,t=>{var{typed:e}=t;return e(Dp,{any:ot,"any, Object | function | number | BigNumber":ot})}),Ep="bin",X_=["typed","format"],J_=U(Ep,X_,t=>{var{typed:e,format:r}=t;return e(Ep,{"number | BigNumber":function(a){return r(a,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(a,i){return r(a,{notation:"bin",wordSize:i})}})}),Ap="oct",Q_=["typed","format"],K_=U(Ap,Q_,t=>{var{typed:e,format:r}=t;return e(Ap,{"number | BigNumber":function(a){return r(a,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(a,i){return r(a,{notation:"oct",wordSize:i})}})}),Sp="hex",eC=["typed","format"],tC=U(Sp,eC,t=>{var{typed:e,format:r}=t;return e(Sp,{"number | BigNumber":function(a){return r(a,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(a,i){return r(a,{notation:"hex",wordSize:i})}})}),Np=/\$([\w.]+)/g,_p="print",rC=["typed"],Cp=U(_p,rC,t=>{var{typed:e}=t;return e(_p,{"string, Object | Array":Mp,"string, Object | Array, number | Object":Mp})});function Mp(t,e,r){return t.replace(Np,function(n,a){var i=a.split("."),s=e[i.shift()];for(s!==void 0&&s.isMatrix&&(s=s.toArray());i.length&&s!==void 0;){var u=i.shift();s=u?s[u]:s+"."}return s!==void 0?Rt(s)?s:ot(s,r):n})}var Tp="to",nC=["typed","matrix","concat"],aC=U(Tp,nC,t=>{var{typed:e,matrix:r,concat:n}=t,a=Ct({typed:e,matrix:r,concat:n});return e(Tp,{"Unit, Unit | string":(i,s)=>i.to(s)},a({Ds:!0}))}),Fp="toBest",iC=["typed"],sC=U(Fp,iC,t=>{var{typed:e}=t;return e(Fp,{Unit:r=>r.toBest(),"Unit, string":(r,n)=>r.toBest(n.split(",")),"Unit, string, Object":(r,n,a)=>r.toBest(n.split(","),a),"Unit, Array":(r,n)=>r.toBest(n),"Unit, Array, Object":(r,n,a)=>r.toBest(n,a)})}),Op="isPrime",oC=["typed"],uC=U(Op,oC,t=>{var{typed:e}=t;return e(Op,{number:function(n){if(n<=3)return n>1;if(n%2===0||n%3===0)return!1;for(var a=5;a*a<=n;a+=6)if(n%a===0||n%(a+2)===0)return!1;return!0},bigint:function(n){if(n<=3n)return n>1n;if(n%2n===0n||n%3n===0n)return!1;for(var a=5n;a*a<=n;a+=6n)if(n%a===0n||n%(a+2n)===0n)return!1;return!0},BigNumber:function(n){if(n.lte(3))return n.gt(1);if(n.mod(2).eq(0)||n.mod(3).eq(0))return!1;if(n.lt(Math.pow(2,32))){for(var a=n.toNumber(),i=5;i*i<=a;i+=6)if(a%i===0||a%(i+2)===0)return!1;return!0}function s(D,y,x){for(var w=1;!y.eq(0);)y.mod(2).eq(0)?(y=y.div(2),D=D.mul(D).mod(x)):(y=y.sub(1),w=D.mul(w).mod(x));return w}var u=n.constructor.clone({precision:n.toFixed(0).length*2});n=new u(n);for(var l=0,o=n.sub(1);o.mod(2).eq(0);)o=o.div(2),l+=1;var c=null;if(n.lt("3317044064679887385961981"))c=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter(D=>D<n);else{var f=Math.min(n.toNumber()-2,Math.floor(2*Math.pow(n.toFixed(0).length*Math.log(10),2)));c=[];for(var d=2;d<=f;d+=1)c.push(f)}for(var m=0;m<c.length;m+=1){var h=c[m],p=s(n.sub(n).add(h),o,n);if(!p.eq(1)){for(var g=0,v=p;!v.eq(n.sub(1));g+=1,v=v.mul(v).mod(n))if(g===l-1)return!1}}return!0},"Array | Matrix":e.referToSelf(r=>n=>nt(n,r))})}),lC="numeric",cC=["number","?bignumber","?fraction"],fC=U(lC,cC,t=>{var{number:e,bignumber:r,fraction:n}=t,a={string:!0,number:!0,BigNumber:!0,Fraction:!0},i={number:s=>e(s),BigNumber:r?s=>r(s):wl,bigint:s=>BigInt(s),Fraction:n?s=>n(s):ep};return function(u){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",o=arguments.length>2?arguments[2]:void 0;if(o!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var c=Et(u);if(!(c in a))throw new TypeError("Cannot convert "+u+' of type "'+c+'"; valid input types are '+Object.keys(a).join(", "));if(!(l in i))throw new TypeError("Cannot convert "+u+' to type "'+l+'"; valid output types are '+Object.keys(i).join(", "));return l===c?u:i[l](u)}}),Bp="divideScalar",dC=["typed","numeric"],mC=U(Bp,dC,t=>{var{typed:e,numeric:r}=t;return e(Bp,{"number, number":function(a,i){return a/i},"Complex, Complex":function(a,i){return a.div(i)},"BigNumber, BigNumber":function(a,i){return a.div(i)},"bigint, bigint":function(a,i){return a/i},"Fraction, Fraction":function(a,i){return a.div(i)},"Unit, number | Complex | Fraction | BigNumber | Unit":(n,a)=>n.divide(a),"number | Fraction | Complex | BigNumber, Unit":(n,a)=>a.divideInto(n)})}),kp="pow",hC=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],pC=U(kp,hC,t=>{var{typed:e,config:r,identity:n,multiply:a,matrix:i,inv:s,number:u,fraction:l,Complex:o}=t;return e(kp,{"number, number":c,"Complex, Complex":function(h,p){return h.pow(p)},"BigNumber, BigNumber":function(h,p){return p.isInteger()||h>=0||r.predictable?h.pow(p):new o(h.toNumber(),0).pow(p.toNumber(),0)},"bigint, bigint":(m,h)=>m**h,"Fraction, Fraction":function(h,p){var g=h.pow(p);if(g!=null)return g;if(r.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return c(h.valueOf(),p.valueOf())},"Array, number":f,"Array, BigNumber":function(h,p){return f(h,p.toNumber())},"Matrix, number":d,"Matrix, BigNumber":function(h,p){return d(h,p.toNumber())},"Unit, number | BigNumber":function(h,p){return h.pow(p)}});function c(m,h){if(r.predictable&&!$e(h)&&m<0)try{var p=l(h),g=u(p);if((h===g||Math.abs((h-g)/h)<1e-14)&&p.d%2n===1n)return(p.n%2n===0n?1:-1)*Math.pow(-m,h)}catch{}return r.predictable&&(m<-1&&h===1/0||m>-1&&m<0&&h===-1/0)?NaN:$e(h)||m>=0||r.predictable?em(m,h):m*m<1&&h===1/0||m*m>1&&h===-1/0?0:new o(m,0).pow(h,0)}function f(m,h){if(!$e(h))throw new TypeError("For A^b, b must be an integer (value is "+h+")");var p=Ke(m);if(p.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+p.length+" dimensions)");if(p[0]!==p[1])throw new Error("For A^b, A must be square (size is "+p[0]+"x"+p[1]+")");if(h<0)try{return f(s(m),-h)}catch(D){throw D.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+h+")"):D}for(var g=n(p[0]).valueOf(),v=m;h>=1;)(h&1)===1&&(g=a(v,g)),h>>=1,v=a(v,v);return g}function d(m,h){return i(f(m.valueOf(),h))}}),Xa="Number of decimals in function round must be an integer",Ip="round",vC=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],gC=U(Ip,vC,t=>{var{typed:e,config:r,matrix:n,equalScalar:a,zeros:i,BigNumber:s,DenseMatrix:u}=t,l=tr({typed:e,equalScalar:a}),o=Gt({typed:e,DenseMatrix:u}),c=qr({typed:e});function f(d){return Math.abs(Mi(d).exponent)}return e(Ip,{number:function(m){var h=Bi(m,f(r.relTol)),p=Zt(m,h,r.relTol,r.absTol)?h:m;return Bi(p)},"number, number":function(m,h){var p=f(r.relTol);if(h>=p)return Bi(m,h);var g=Bi(m,p),v=Zt(m,g,r.relTol,r.absTol)?g:m;return Bi(v,h)},"number, BigNumber":function(m,h){if(!h.isInteger())throw new TypeError(Xa);return new s(m).toDecimalPlaces(h.toNumber())},Complex:function(m){return m.round()},"Complex, number":function(m,h){if(h%1)throw new TypeError(Xa);return m.round(h)},"Complex, BigNumber":function(m,h){if(!h.isInteger())throw new TypeError(Xa);var p=h.toNumber();return m.round(p)},BigNumber:function(m){var h=new s(m).toDecimalPlaces(f(r.relTol)),p=Pr(m,h,r.relTol,r.absTol)?h:m;return p.toDecimalPlaces(0)},"BigNumber, BigNumber":function(m,h){if(!h.isInteger())throw new TypeError(Xa);var p=f(r.relTol);if(h>=p)return m.toDecimalPlaces(h.toNumber());var g=m.toDecimalPlaces(p),v=Pr(m,g,r.relTol,r.absTol)?g:m;return v.toDecimalPlaces(h.toNumber())},bigint:d=>d,"bigint, number":(d,m)=>d,"bigint, BigNumber":(d,m)=>d,Fraction:function(m){return m.round()},"Fraction, number":function(m,h){if(h%1)throw new TypeError(Xa);return m.round(h)},"Fraction, BigNumber":function(m,h){if(!h.isInteger())throw new TypeError(Xa);return m.round(h.toNumber())},"Unit, number, Unit":e.referToSelf(d=>function(m,h,p){var g=m.toNumeric(p);return p.multiply(d(g,h))}),"Unit, BigNumber, Unit":e.referToSelf(d=>(m,h,p)=>d(m,h.toNumber(),p)),"Array | Matrix, number | BigNumber, Unit":e.referToSelf(d=>(m,h,p)=>nt(m,g=>d(g,h,p),!0)),"Array | Matrix | Unit, Unit":e.referToSelf(d=>(m,h)=>d(m,0,h)),"Array | Matrix":e.referToSelf(d=>m=>nt(m,d,!0)),"SparseMatrix, number | BigNumber":e.referToSelf(d=>(m,h)=>l(m,h,d,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(d=>(m,h)=>c(m,h,d,!1)),"Array, number | BigNumber":e.referToSelf(d=>(m,h)=>c(n(m),h,d,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":e.referToSelf(d=>(m,h)=>a(m,0)?i(h.size(),h.storage()):o(h,m,d,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":e.referToSelf(d=>(m,h)=>a(m,0)?i(h.size(),h.storage()):c(h,m,d,!0)),"number | Complex | BigNumber | Fraction, Array":e.referToSelf(d=>(m,h)=>c(n(h),m,d,!0).valueOf())})}),Lp="log",yC=["config","typed","typeOf","divideScalar","Complex"],bC=Math.log(16),wC=U(Lp,yC,t=>{var{typed:e,typeOf:r,config:n,divideScalar:a,Complex:i}=t;function s(l){return l.log()}function u(l){return s(new i(l,0))}return e(Lp,{number:function(o){return o>=0||n.predictable?Xd(o):u(o)},bigint:vl(bC,Xd,n,u),Complex:s,BigNumber:function(o){return!o.isNegative()||n.predictable?o.ln():u(o.toNumber())},"any, any":e.referToSelf(l=>(o,c)=>{if(r(o)==="Fraction"&&r(c)==="Fraction"){var f=o.log(c);if(f!==null)return f}return a(l(o),l(c))})})}),Rp="log1p",xC=["typed","config","divideScalar","log","Complex"],DC=U(Rp,xC,t=>{var{typed:e,config:r,divideScalar:n,log:a,Complex:i}=t;return e(Rp,{number:function(l){return l>=-1||r.predictable?pD(l):s(new i(l,0))},Complex:s,BigNumber:function(l){var o=l.plus(1);return!o.isNegative()||r.predictable?o.ln():s(new i(l.toNumber(),0))},"Array | Matrix":e.referToSelf(u=>l=>nt(l,u)),"any, any":e.referToSelf(u=>(l,o)=>n(u(l),a(o)))});function s(u){var l=u.re+1;return new i(Math.log(Math.sqrt(l*l+u.im*u.im)),Math.atan2(u.im,l))}}),$p="nthRoots",EC=["config","typed","divideScalar","Complex"],AC=U($p,EC,t=>{var{typed:e,config:r,divideScalar:n,Complex:a}=t,i=[function(l){return new a(l,0)},function(l){return new a(0,l)},function(l){return new a(-l,0)},function(l){return new a(0,-l)}];function s(u,l){if(l<0)throw new Error("Root must be greater than zero");if(l===0)throw new Error("Root must be non-zero");if(l%1!==0)throw new Error("Root must be an integer");if(u===0||u.abs()===0)return[new a(0,0)];var o=typeof u=="number",c;(o||u.re===0||u.im===0)&&(o?c=2*+(u<0):u.im===0?c=2*+(u.re<0):c=2*+(u.im<0)+1);for(var f=u.arg(),d=u.abs(),m=[],h=Math.pow(d,1/l),p=0;p<l;p++){var g=(c+4*p)/l;if(g===Math.round(g)){m.push(i[g%4](h));continue}m.push(new a({r:h,phi:(f+2*Math.PI*p)/l}))}return m}return e($p,{Complex:function(l){return s(l,2)},"Complex, number":s})}),Pp="dotPow",SC=["typed","equalScalar","matrix","pow","DenseMatrix","concat","SparseMatrix"],NC=U(Pp,SC,t=>{var{typed:e,equalScalar:r,matrix:n,pow:a,DenseMatrix:i,concat:s,SparseMatrix:u}=t,l=cr({typed:e}),o=on({typed:e,SparseMatrix:u}),c=tr({typed:e,equalScalar:r}),f=Gt({typed:e,DenseMatrix:i}),d=Ct({typed:e,matrix:n,concat:s}),m={};for(var h in a.signatures)Object.prototype.hasOwnProperty.call(a.signatures,h)&&!h.includes("Matrix")&&!h.includes("Array")&&(m[h]=a.signatures[h]);var p=e(m);return e(Pp,d({elop:p,SS:o,DS:l,Ss:c,sS:f}))}),qp="dotDivide",_C=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat","SparseMatrix"],CC=U(qp,_C,t=>{var{typed:e,matrix:r,equalScalar:n,divideScalar:a,DenseMatrix:i,concat:s,SparseMatrix:u}=t,l=Xr({typed:e,equalScalar:n}),o=cr({typed:e}),c=on({typed:e,SparseMatrix:u}),f=tr({typed:e,equalScalar:n}),d=Gt({typed:e,DenseMatrix:i}),m=Ct({typed:e,matrix:r,concat:s});return e(qp,m({elop:a,SS:c,DS:o,SD:l,Ss:f,sS:d}))});function Li(t){var{DenseMatrix:e}=t;return function(n,a,i){var s=n.size();if(s.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+ot(s)+")");var u=s[0],l=s[1];if(u!==l)throw new RangeError("Matrix must be square (size: "+ot(s)+")");var o=[];if(ze(a)){var c=a.size(),f=a._data;if(c.length===1){if(c[0]!==u)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var d=0;d<u;d++)o[d]=[f[d]];return new e({data:o,size:[u,1],datatype:a._datatype})}if(c.length===2){if(c[0]!==u||c[1]!==1)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");if(Ai(a)){if(i){o=[];for(var m=0;m<u;m++)o[m]=[f[m][0]];return new e({data:o,size:[u,1],datatype:a._datatype})}return a}if(On(a)){for(var h=0;h<u;h++)o[h]=[0];for(var p=a._values,g=a._index,v=a._ptr,D=v[1],y=v[0];y<D;y++){var x=g[y];o[x][0]=p[y]}return new e({data:o,size:[u,1],datatype:a._datatype})}}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}if(Dt(a)){var w=Ke(a);if(w.length===1){if(w[0]!==u)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var b=0;b<u;b++)o[b]=[a[b]];return new e({data:o,size:[u,1]})}if(w.length===2){if(w[0]!==u||w[1]!==1)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var A=0;A<u;A++)o[A]=[a[A][0]];return new e({data:o,size:[u,1]})}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}}}var Up="lsolve",MC=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],TC=U(Up,MC,t=>{var{typed:e,matrix:r,divideScalar:n,multiplyScalar:a,subtractScalar:i,equalScalar:s,DenseMatrix:u}=t,l=Li({DenseMatrix:u});return e(Up,{"SparseMatrix, Array | Matrix":function(d,m){return c(d,m)},"DenseMatrix, Array | Matrix":function(d,m){return o(d,m)},"Array, Array | Matrix":function(d,m){var h=r(d),p=o(h,m);return p.valueOf()}});function o(f,d){d=l(f,d,!0);for(var m=d._data,h=f._size[0],p=f._size[1],g=[],v=f._data,D=0;D<p;D++){var y=m[D][0]||0,x=void 0;if(s(y,0))x=0;else{var w=v[D][D];if(s(w,0))throw new Error("Linear system cannot be solved since matrix is singular");x=n(y,w);for(var b=D+1;b<h;b++)m[b]=[i(m[b][0]||0,a(x,v[b][D]))]}g[D]=[x]}return new u({data:g,size:[h,1]})}function c(f,d){d=l(f,d,!0);for(var m=d._data,h=f._size[0],p=f._size[1],g=f._values,v=f._index,D=f._ptr,y=[],x=0;x<p;x++){var w=m[x][0]||0;if(s(w,0))y[x]=[0];else{for(var b=0,A=[],S=[],E=D[x],N=D[x+1],_=E;_<N;_++){var C=v[_];C===x?b=g[_]:C>x&&(A.push(g[_]),S.push(C))}if(s(b,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var O=n(w,b),I=0,k=S.length;I<k;I++){var M=S[I];m[M]=[i(m[M][0]||0,a(O,A[I]))]}y[x]=[O]}}return new u({data:y,size:[h,1]})}}),zp="usolve",FC=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],OC=U(zp,FC,t=>{var{typed:e,matrix:r,divideScalar:n,multiplyScalar:a,subtractScalar:i,equalScalar:s,DenseMatrix:u}=t,l=Li({DenseMatrix:u});return e(zp,{"SparseMatrix, Array | Matrix":function(d,m){return c(d,m)},"DenseMatrix, Array | Matrix":function(d,m){return o(d,m)},"Array, Array | Matrix":function(d,m){var h=r(d),p=o(h,m);return p.valueOf()}});function o(f,d){d=l(f,d,!0);for(var m=d._data,h=f._size[0],p=f._size[1],g=[],v=f._data,D=p-1;D>=0;D--){var y=m[D][0]||0,x=void 0;if(s(y,0))x=0;else{var w=v[D][D];if(s(w,0))throw new Error("Linear system cannot be solved since matrix is singular");x=n(y,w);for(var b=D-1;b>=0;b--)m[b]=[i(m[b][0]||0,a(x,v[b][D]))]}g[D]=[x]}return new u({data:g,size:[h,1]})}function c(f,d){d=l(f,d,!0);for(var m=d._data,h=f._size[0],p=f._size[1],g=f._values,v=f._index,D=f._ptr,y=[],x=p-1;x>=0;x--){var w=m[x][0]||0;if(s(w,0))y[x]=[0];else{for(var b=0,A=[],S=[],E=D[x],N=D[x+1],_=N-1;_>=E;_--){var C=v[_];C===x?b=g[_]:C<x&&(A.push(g[_]),S.push(C))}if(s(b,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var O=n(w,b),I=0,k=S.length;I<k;I++){var M=S[I];m[M]=[i(m[M][0],a(O,A[I]))]}y[x]=[O]}}return new u({data:y,size:[h,1]})}}),Yp="lsolveAll",BC=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],kC=U(Yp,BC,t=>{var{typed:e,matrix:r,divideScalar:n,multiplyScalar:a,subtractScalar:i,equalScalar:s,DenseMatrix:u}=t,l=Li({DenseMatrix:u});return e(Yp,{"SparseMatrix, Array | Matrix":function(d,m){return c(d,m)},"DenseMatrix, Array | Matrix":function(d,m){return o(d,m)},"Array, Array | Matrix":function(d,m){var h=r(d),p=o(h,m);return p.map(g=>g.valueOf())}});function o(f,d){for(var m=[l(f,d,!0)._data.map(S=>S[0])],h=f._data,p=f._size[0],g=f._size[1],v=0;v<g;v++)for(var D=m.length,y=0;y<D;y++){var x=m[y];if(s(h[v][v],0))if(s(x[v],0)){if(y===0){var b=[...x];b[v]=1;for(var A=v+1;A<g;A++)b[A]=i(b[A],h[A][v]);m.push(b)}}else{if(y===0)return[];m.splice(y,1),y-=1,D-=1}else{x[v]=n(x[v],h[v][v]);for(var w=v+1;w<g;w++)x[w]=i(x[w],a(x[v],h[w][v]))}}return m.map(S=>new u({data:S.map(E=>[E]),size:[p,1]}))}function c(f,d){for(var m=[l(f,d,!0)._data.map(te=>te[0])],h=f._size[0],p=f._size[1],g=f._values,v=f._index,D=f._ptr,y=0;y<p;y++)for(var x=m.length,w=0;w<x;w++){for(var b=m[w],A=[],S=[],E=D[y],N=D[y+1],_=0,C=E;C<N;C++){var O=v[C];O===y?_=g[C]:O>y&&(A.push(g[C]),S.push(O))}if(s(_,0))if(s(b[y],0)){if(w===0){var H=[...b];H[y]=1;for(var q=0,z=S.length;q<z;q++){var X=S[q];H[X]=i(H[X],A[q])}m.push(H)}}else{if(w===0)return[];m.splice(w,1),w-=1,x-=1}else{b[y]=n(b[y],_);for(var I=0,k=S.length;I<k;I++){var M=S[I];b[M]=i(b[M],a(b[y],A[I]))}}}return m.map(te=>new u({data:te.map(B=>[B]),size:[h,1]}))}}),Vp="usolveAll",IC=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],LC=U(Vp,IC,t=>{var{typed:e,matrix:r,divideScalar:n,multiplyScalar:a,subtractScalar:i,equalScalar:s,DenseMatrix:u}=t,l=Li({DenseMatrix:u});return e(Vp,{"SparseMatrix, Array | Matrix":function(d,m){return c(d,m)},"DenseMatrix, Array | Matrix":function(d,m){return o(d,m)},"Array, Array | Matrix":function(d,m){var h=r(d),p=o(h,m);return p.map(g=>g.valueOf())}});function o(f,d){for(var m=[l(f,d,!0)._data.map(S=>S[0])],h=f._data,p=f._size[0],g=f._size[1],v=g-1;v>=0;v--)for(var D=m.length,y=0;y<D;y++){var x=m[y];if(s(h[v][v],0))if(s(x[v],0)){if(y===0){var b=[...x];b[v]=1;for(var A=v-1;A>=0;A--)b[A]=i(b[A],h[A][v]);m.push(b)}}else{if(y===0)return[];m.splice(y,1),y-=1,D-=1}else{x[v]=n(x[v],h[v][v]);for(var w=v-1;w>=0;w--)x[w]=i(x[w],a(x[v],h[w][v]))}}return m.map(S=>new u({data:S.map(E=>[E]),size:[p,1]}))}function c(f,d){for(var m=[l(f,d,!0)._data.map(te=>te[0])],h=f._size[0],p=f._size[1],g=f._values,v=f._index,D=f._ptr,y=p-1;y>=0;y--)for(var x=m.length,w=0;w<x;w++){for(var b=m[w],A=[],S=[],E=D[y],N=D[y+1],_=0,C=N-1;C>=E;C--){var O=v[C];O===y?_=g[C]:O<y&&(A.push(g[C]),S.push(O))}if(s(_,0))if(s(b[y],0)){if(w===0){var H=[...b];H[y]=1;for(var q=0,z=S.length;q<z;q++){var X=S[q];H[X]=i(H[X],A[q])}m.push(H)}}else{if(w===0)return[];m.splice(w,1),w-=1,x-=1}else{b[y]=n(b[y],_);for(var I=0,k=S.length;I<k;I++){var M=S[I];b[M]=i(b[M],a(b[y],A[I]))}}}return m.map(te=>new u({data:te.map(B=>[B]),size:[h,1]}))}}),RC="matAlgo08xS0Sid",$C=["typed","equalScalar"],xl=U(RC,$C,t=>{var{typed:e,equalScalar:r}=t;return function(a,i,s){var u=a._values,l=a._index,o=a._ptr,c=a._size,f=a._datatype||a._data===void 0?a._datatype:a.getDataType(),d=i._values,m=i._index,h=i._ptr,p=i._size,g=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(c.length!==p.length)throw new at(c.length,p.length);if(c[0]!==p[0]||c[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+p+")");if(!u||!d)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var v=c[0],D=c[1],y,x=r,w=0,b=s;typeof f=="string"&&f===g&&f!=="mixed"&&(y=f,x=e.find(r,[y,y]),w=e.convert(0,y),b=e.find(s,[y,y]));for(var A=[],S=[],E=[],N=[],_=[],C,O,I,k,M=0;M<D;M++){E[M]=S.length;var H=M+1;for(O=o[M],I=o[M+1],C=O;C<I;C++)k=l[C],_[k]=H,N[k]=u[C],S.push(k);for(O=h[M],I=h[M+1],C=O;C<I;C++)k=m[C],_[k]===H&&(N[k]=b(N[k],d[C]));for(C=E[M];C<S.length;){k=S[C];var q=N[k];x(q,w)?S.splice(C,1):(A.push(q),C++)}}return E[D]=S.length,a.createSparseMatrix({values:A,index:S,ptr:E,size:[v,D],datatype:f===a._datatype&&g===i._datatype?y:void 0})}}),Dl=U("useMatrixForArrayScalar",["typed","matrix"],t=>{var{typed:e,matrix:r}=t;return{"Array, number":e.referTo("DenseMatrix, number",n=>(a,i)=>n(r(a),i).valueOf()),"Array, BigNumber":e.referTo("DenseMatrix, BigNumber",n=>(a,i)=>n(r(a),i).valueOf()),"number, Array":e.referTo("number, DenseMatrix",n=>(a,i)=>n(a,r(i)).valueOf()),"BigNumber, Array":e.referTo("BigNumber, DenseMatrix",n=>(a,i)=>n(a,r(i)).valueOf())}}),Hp="leftShift",PC=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],qC=U(Hp,PC,t=>{var{typed:e,matrix:r,equalScalar:n,zeros:a,DenseMatrix:i,concat:s}=t,u=Vn({typed:e}),l=Xr({typed:e,equalScalar:n}),o=xl({typed:e,equalScalar:n}),c=ca({typed:e,DenseMatrix:i}),f=tr({typed:e,equalScalar:n}),d=qr({typed:e}),m=Ct({typed:e,matrix:r,concat:s}),h=Dl({typed:e,matrix:r});return e(Hp,{"number, number":im,"BigNumber, BigNumber":iN,"bigint, bigint":(p,g)=>p<<g,"SparseMatrix, number | BigNumber":e.referToSelf(p=>(g,v)=>n(v,0)?g.clone():f(g,v,p,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(p=>(g,v)=>n(v,0)?g.clone():d(g,v,p,!1)),"number | BigNumber, SparseMatrix":e.referToSelf(p=>(g,v)=>n(g,0)?a(v.size(),v.storage()):c(v,g,p,!0)),"number | BigNumber, DenseMatrix":e.referToSelf(p=>(g,v)=>n(g,0)?a(v.size(),v.storage()):d(v,g,p,!0))},h,m({SS:o,DS:u,SD:l}))}),Wp="rightArithShift",UC=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],zC=U(Wp,UC,t=>{var{typed:e,matrix:r,equalScalar:n,zeros:a,DenseMatrix:i,concat:s}=t,u=Vn({typed:e}),l=Xr({typed:e,equalScalar:n}),o=xl({typed:e,equalScalar:n}),c=ca({typed:e,DenseMatrix:i}),f=tr({typed:e,equalScalar:n}),d=qr({typed:e}),m=Ct({typed:e,matrix:r,concat:s}),h=Dl({typed:e,matrix:r});return e(Wp,{"number, number":sm,"BigNumber, BigNumber":sN,"bigint, bigint":(p,g)=>p>>g,"SparseMatrix, number | BigNumber":e.referToSelf(p=>(g,v)=>n(v,0)?g.clone():f(g,v,p,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(p=>(g,v)=>n(v,0)?g.clone():d(g,v,p,!1)),"number | BigNumber, SparseMatrix":e.referToSelf(p=>(g,v)=>n(g,0)?a(v.size(),v.storage()):c(v,g,p,!0)),"number | BigNumber, DenseMatrix":e.referToSelf(p=>(g,v)=>n(g,0)?a(v.size(),v.storage()):d(v,g,p,!0))},h,m({SS:o,DS:u,SD:l}))}),Gp="rightLogShift",YC=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],VC=U(Gp,YC,t=>{var{typed:e,matrix:r,equalScalar:n,zeros:a,DenseMatrix:i,concat:s}=t,u=Vn({typed:e}),l=Xr({typed:e,equalScalar:n}),o=xl({typed:e,equalScalar:n}),c=ca({typed:e,DenseMatrix:i}),f=tr({typed:e,equalScalar:n}),d=qr({typed:e}),m=Ct({typed:e,matrix:r,concat:s}),h=Dl({typed:e,matrix:r});return e(Gp,{"number, number":om,"SparseMatrix, number | BigNumber":e.referToSelf(p=>(g,v)=>n(v,0)?g.clone():f(g,v,p,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(p=>(g,v)=>n(v,0)?g.clone():d(g,v,p,!1)),"number | BigNumber, SparseMatrix":e.referToSelf(p=>(g,v)=>n(g,0)?a(v.size(),v.storage()):c(v,g,p,!0)),"number | BigNumber, DenseMatrix":e.referToSelf(p=>(g,v)=>n(g,0)?a(v.size(),v.storage()):d(v,g,p,!0))},h,m({SS:o,DS:u,SD:l}))}),jp="and",HC=["typed","matrix","equalScalar","zeros","not","concat"],Zp=U(jp,HC,t=>{var{typed:e,matrix:r,equalScalar:n,zeros:a,not:i,concat:s}=t,u=Xr({typed:e,equalScalar:n}),l=eo({typed:e,equalScalar:n}),o=tr({typed:e,equalScalar:n}),c=qr({typed:e}),f=Ct({typed:e,matrix:r,concat:s});return e(jp,{"number, number":ul,"Complex, Complex":function(m,h){return(m.re!==0||m.im!==0)&&(h.re!==0||h.im!==0)},"BigNumber, BigNumber":function(m,h){return!m.isZero()&&!h.isZero()&&!m.isNaN()&&!h.isNaN()},"bigint, bigint":ul,"Unit, Unit":e.referToSelf(d=>(m,h)=>d(m.value||0,h.value||0)),"SparseMatrix, any":e.referToSelf(d=>(m,h)=>i(h)?a(m.size(),m.storage()):o(m,h,d,!1)),"DenseMatrix, any":e.referToSelf(d=>(m,h)=>i(h)?a(m.size(),m.storage()):c(m,h,d,!1)),"any, SparseMatrix":e.referToSelf(d=>(m,h)=>i(m)?a(m.size(),m.storage()):o(h,m,d,!0)),"any, DenseMatrix":e.referToSelf(d=>(m,h)=>i(m)?a(m.size(),m.storage()):c(h,m,d,!0)),"Array, any":e.referToSelf(d=>(m,h)=>d(r(m),h).valueOf()),"any, Array":e.referToSelf(d=>(m,h)=>d(m,r(h)).valueOf())},f({SS:l,DS:u}))}),ro="compare",WC=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],GC=U(ro,WC,t=>{var{typed:e,config:r,equalScalar:n,matrix:a,BigNumber:i,Fraction:s,DenseMatrix:u,concat:l}=t,o=cr({typed:e}),c=Ks({typed:e,equalScalar:n}),f=Gt({typed:e,DenseMatrix:u}),d=Ct({typed:e,matrix:a,concat:l}),m=ja({typed:e});return e(ro,jC({typed:e,config:r}),{"boolean, boolean":function(p,g){return p===g?0:p>g?1:-1},"BigNumber, BigNumber":function(p,g){return Pr(p,g,r.relTol,r.absTol)?new i(0):new i(p.cmp(g))},"bigint, bigint":function(p,g){return p===g?0n:p>g?1n:-1n},"Fraction, Fraction":function(p,g){return new s(p.compare(g))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},m,d({SS:c,DS:o,Ss:f}))}),jC=U(ro,["typed","config"],t=>{var{typed:e,config:r}=t;return e(ro,{"number, number":function(a,i){return Zt(a,i,r.relTol,r.absTol)?0:a>i?1:-1}})}),El,Xp;function ZC(){return Xp||(Xp=1,El=function t(e,r){var n=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,a=/(^[ ]*|[ ]*$)/g,i=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,s=/^0x[0-9a-f]+$/i,u=/^0/,l=function(y){return t.insensitive&&(""+y).toLowerCase()||""+y},o=l(e).replace(a,"")||"",c=l(r).replace(a,"")||"",f=o.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),d=c.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=parseInt(o.match(s),16)||f.length!==1&&o.match(i)&&Date.parse(o),h=parseInt(c.match(s),16)||m&&c.match(i)&&Date.parse(c)||null,p,g;if(h){if(m<h)return-1;if(m>h)return 1}for(var v=0,D=Math.max(f.length,d.length);v<D;v++){if(p=!(f[v]||"").match(u)&&parseFloat(f[v])||f[v]||0,g=!(d[v]||"").match(u)&&parseFloat(d[v])||d[v]||0,isNaN(p)!==isNaN(g))return isNaN(p)?1:-1;if(typeof p!=typeof g&&(p+="",g+=""),p<g)return-1;if(p>g)return 1}return 0}),El}var XC=ZC();const Ja=gi(XC);var Jp="compareNatural",JC=["typed","compare"],QC=U(Jp,JC,t=>{var{typed:e,compare:r}=t,n=r.signatures["boolean,boolean"];return e(Jp,{"any, any":a});function a(l,o){var c=Et(l),f=Et(o),d;if((c==="number"||c==="BigNumber"||c==="Fraction")&&(f==="number"||f==="BigNumber"||f==="Fraction"))return d=r(l,o),d.toString()!=="0"?d>0?1:-1:Ja(c,f);var m=["Array","DenseMatrix","SparseMatrix"];if(m.includes(c)||m.includes(f))return d=i(a,l,o),d!==0?d:Ja(c,f);if(c!==f)return Ja(c,f);if(c==="Complex")return KC(l,o);if(c==="Unit")return l.equalBase(o)?a(l.value,o.value):s(a,l.formatUnits(),o.formatUnits());if(c==="boolean")return n(l,o);if(c==="string")return Ja(l,o);if(c==="Object")return u(a,l,o);if(c==="null"||c==="undefined")return 0;throw new TypeError('Unsupported type of value "'+c+'"')}function i(l,o,c){return On(o)&&On(c)?s(l,o.toJSON().values,c.toJSON().values):On(o)?i(l,o.toArray(),c):On(c)?i(l,o,c.toArray()):Ai(o)?i(l,o.toJSON().data,c):Ai(c)?i(l,o,c.toJSON().data):Array.isArray(o)?Array.isArray(c)?s(l,o,c):i(l,o,[c]):i(l,[o],c)}function s(l,o,c){for(var f=0,d=Math.min(o.length,c.length);f<d;f++){var m=l(o[f],c[f]);if(m!==0)return m}return o.length>c.length?1:o.length<c.length?-1:0}function u(l,o,c){var f=Object.keys(o),d=Object.keys(c);f.sort(Ja),d.sort(Ja);var m=s(l,f,d);if(m!==0)return m;for(var h=0;h<f.length;h++){var p=l(o[f[h]],c[d[h]]);if(p!==0)return p}return 0}});function KC(t,e){return t.re>e.re?1:t.re<e.re?-1:t.im>e.im?1:t.im<e.im?-1:0}var Qp="compareText",eM=["typed","matrix","concat"];Qu.signature="any, any";var tM=U(Qp,eM,t=>{var{typed:e,matrix:r,concat:n}=t,a=Ct({typed:e,matrix:r,concat:n});return e(Qp,Qu,a({elop:Qu,Ds:!0}))}),no="equal",rM=["typed","matrix","equalScalar","DenseMatrix","concat","SparseMatrix"],nM=U(no,rM,t=>{var{typed:e,matrix:r,equalScalar:n,DenseMatrix:a,concat:i,SparseMatrix:s}=t,u=cr({typed:e}),l=on({typed:e,SparseMatrix:s}),o=Gt({typed:e,DenseMatrix:a}),c=Ct({typed:e,matrix:r,concat:i});return e(no,aM({typed:e,equalScalar:n}),c({elop:n,SS:l,DS:u,Ss:o}))}),aM=U(no,["typed","equalScalar"],t=>{var{typed:e,equalScalar:r}=t;return e(no,{"any, any":function(a,i){return a===null?i===null:i===null?a===null:a===void 0?i===void 0:i===void 0?a===void 0:r(a,i)}})}),Kp="equalText",iM=["typed","compareText","isZero"],sM=U(Kp,iM,t=>{var{typed:e,compareText:r,isZero:n}=t;return e(Kp,{"any, any":function(i,s){return n(r(i,s))}})}),ao="smaller",oM=["typed","config","bignumber","matrix","DenseMatrix","concat","SparseMatrix"],uM=U(ao,oM,t=>{var{typed:e,config:r,bignumber:n,matrix:a,DenseMatrix:i,concat:s,SparseMatrix:u}=t,l=cr({typed:e}),o=on({typed:e,SparseMatrix:u}),c=Gt({typed:e,DenseMatrix:i}),f=Ct({typed:e,matrix:a,concat:s}),d=ja({typed:e});function m(h,p){return h.lt(p)&&!Pr(h,p,r.relTol,r.absTol)}return e(ao,lM({typed:e,config:r}),{"boolean, boolean":(h,p)=>h<p,"BigNumber, BigNumber":m,"bigint, bigint":(h,p)=>h<p,"Fraction, Fraction":(h,p)=>h.compare(p)===-1,"Fraction, BigNumber":function(p,g){return m(n(p),g)},"BigNumber, Fraction":function(p,g){return m(p,n(g))},"Complex, Complex":function(p,g){throw new TypeError("No ordering relation is defined for complex numbers")}},d,f({SS:o,DS:l,Ss:c}))}),lM=U(ao,["typed","config"],t=>{var{typed:e,config:r}=t;return e(ao,{"number, number":function(a,i){return a<i&&!Zt(a,i,r.relTol,r.absTol)}})}),io="smallerEq",cM=["typed","config","matrix","DenseMatrix","concat","SparseMatrix"],fM=U(io,cM,t=>{var{typed:e,config:r,matrix:n,DenseMatrix:a,concat:i,SparseMatrix:s}=t,u=cr({typed:e}),l=on({typed:e,SparseMatrix:s}),o=Gt({typed:e,DenseMatrix:a}),c=Ct({typed:e,matrix:n,concat:i}),f=ja({typed:e});return e(io,dM({typed:e,config:r}),{"boolean, boolean":(d,m)=>d<=m,"BigNumber, BigNumber":function(m,h){return m.lte(h)||Pr(m,h,r.relTol,r.absTol)},"bigint, bigint":(d,m)=>d<=m,"Fraction, Fraction":(d,m)=>d.compare(m)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,c({SS:l,DS:u,Ss:o}))}),dM=U(io,["typed","config"],t=>{var{typed:e,config:r}=t;return e(io,{"number, number":function(a,i){return a<=i||Zt(a,i,r.relTol,r.absTol)}})}),so="larger",mM=["typed","config","bignumber","matrix","DenseMatrix","concat","SparseMatrix"],hM=U(so,mM,t=>{var{typed:e,config:r,bignumber:n,matrix:a,DenseMatrix:i,concat:s,SparseMatrix:u}=t,l=cr({typed:e}),o=on({typed:e,SparseMatrix:u}),c=Gt({typed:e,DenseMatrix:i}),f=Ct({typed:e,matrix:a,concat:s}),d=ja({typed:e});function m(h,p){return h.gt(p)&&!Pr(h,p,r.relTol,r.absTol)}return e(so,pM({typed:e,config:r}),{"boolean, boolean":(h,p)=>h>p,"BigNumber, BigNumber":m,"bigint, bigint":(h,p)=>h>p,"Fraction, Fraction":(h,p)=>h.compare(p)===1,"Fraction, BigNumber":function(p,g){return m(n(p),g)},"BigNumber, Fraction":function(p,g){return m(p,n(g))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for c
23omplex numbers")}},d,f({SS:o,DS:l,Ss:c}))}),pM=U(so,["typed","config"],t=>{var{typed:e,config:r}=t;return e(so,{"number, number":function(a,i){return a>i&&!Zt(a,i,r.relTol,r.absTol)}})}),oo="largerEq",vM=["typed","config","matrix","DenseMatrix","concat","SparseMatrix"],gM=U(oo,vM,t=>{var{typed:e,config:r,matrix:n,DenseMatrix:a,concat:i,SparseMatrix:s}=t,u=cr({typed:e}),l=on({typed:e,SparseMatrix:s}),o=Gt({typed:e,DenseMatrix:a}),c=Ct({typed:e,matrix:n,concat:i}),f=ja({typed:e});return e(oo,yM({typed:e,config:r}),{"boolean, boolean":(d,m)=>d>=m,"BigNumber, BigNumber":function(m,h){return m.gte(h)||Pr(m,h,r.relTol,r.absTol)},"bigint, bigint":function(m,h){return m>=h},"Fraction, Fraction":(d,m)=>d.compare(m)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,c({SS:l,DS:u,Ss:o}))}),yM=U(oo,["typed","config"],t=>{var{typed:e,config:r}=t;return e(oo,{"number, number":function(a,i){return a>=i||Zt(a,i,r.relTol,r.absTol)}})}),ev="deepEqual",bM=["typed","equal"],wM=U(ev,bM,t=>{var{typed:e,equal:r}=t;return e(ev,{"any, any":function(i,s){return n(i.valueOf(),s.valueOf())}});function n(a,i){if(Array.isArray(a))if(Array.isArray(i)){var s=a.length;if(s!==i.length)return!1;for(var u=0;u<s;u++)if(!n(a[u],i[u]))return!1;return!0}else return!1;else return Array.isArray(i)?!1:r(a,i)}}),uo="unequal",xM=["typed","config","equalScalar","matrix","DenseMatrix","concat","SparseMatrix"],DM=U(uo,xM,t=>{var{typed:e,config:r,equalScalar:n,matrix:a,DenseMatrix:i,concat:s,SparseMatrix:u}=t,l=cr({typed:e}),o=on({typed:e,SparseMatrix:u}),c=Gt({typed:e,DenseMatrix:i}),f=Ct({typed:e,matrix:a,concat:s});return e(uo,EM({typed:e,equalScalar:n}),f({elop:d,SS:o,DS:l,Ss:c}));function d(m,h){return!n(m,h)}}),EM=U(uo,["typed","equalScalar"],t=>{var{typed:e,equalScalar:r}=t;return e(uo,{"any, any":function(a,i){return a===null?i!==null:i===null?a!==null:a===void 0?i!==void 0:i===void 0?a!==void 0:!r(a,i)}})}),tv="partitionSelect",AM=["typed","isNumeric","isNaN","compare"],SM=U(tv,AM,t=>{var{typed:e,isNumeric:r,isNaN:n,compare:a}=t,i=a,s=(o,c)=>-a(o,c);return e(tv,{"Array | Matrix, number":function(c,f){return u(c,f,i)},"Array | Matrix, number, string":function(c,f,d){if(d==="asc")return u(c,f,i);if(d==="desc")return u(c,f,s);
vendor: 16,663 bytes, line 23
23throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":u});function u(o,c,f){if(!$e(c)||c<0)throw new Error("k must be a non-negative integer");if(ze(o)){var d=o.size();if(d.length>1)throw new Error("Only one dimensional matrices supported");return l(o.valueOf(),c,f)}if(Array.isArray(o))return l(o,c,f)}function l(o,c,f){if(c>=o.length)throw new Error("k out of bounds");for(var d=0;d<o.length;d++)if(r(o[d])&&n(o[d]))return o[d];for(var m=0,h=o.length-1;m<h;){for(var p=m,g=h,v=o[Math.floor(Math.random()*(h-m+1))+m];p<g;)if(f(o[p],v)>=0){var D=o[g];o[g]=o[p],o[p]=D,--g}else++p;f(o[p],v)>0&&--p,c<=p?h=p:m=p+1}return o[c]}}),rv="sort",NM=["typed","matrix","compare","compareNatural"],_M=U(rv,NM,t=>{var{typed:e,matrix:r,compare:n,compareNatural:a}=t,i=n,s=(c,f)=>-n(c,f);return e(rv,{Array:function(f){return l(f),f.sort(i)},Matrix:function(f){return o(f),r(f.toArray().sort(i),f.storage())},"Array, function":function(f,d){return l(f),f.sort(d)},"Matrix, function":function(f,d){return o(f),r(f.toArray().sort(d),f.storage())},"Array, string":function(f,d){return l(f),f.sort(u(d))},"Matrix, string":function(f,d){return o(f),r(f.toArray().sort(u(d)),f.storage())}});function u(c){if(c==="asc")return i;if(c==="desc")return s;if(c==="natural")return a;throw new Error('String "asc", "desc", or "natural" expected')}function l(c){if(Ke(c).length!==1)throw new Error("One dimensional array expected")}function o(c){if(c.size().length!==1)throw new Error("One dimensional matrix expected")}}),nv="max",CM=["typed","config","numeric","larger","isNaN"],av=U(nv,CM,t=>{var{typed:e,config:r,numeric:n,larger:a,isNaN:i}=t;return e(nv,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(o,c){return Ws(o,c.valueOf(),s)},"...":function(o){if(Va(o))throw new TypeError("Scalar values expected in function max");return u(o)}});function s(l,o){try{return a(l,o)?l:o}catch(c){throw vr(c,"max",o)}}function u(l){var o;if(Yn(l,function(c){try{(i(c)||o===void 0||a(c,o))&&(o=c)}catch(f){throw vr(f,"max",c)}}),o===void 0)throw new Error("Cannot calculate max of an empty array");return typeof o=="string"&&(o=n(o,kn(o,r))),o}}),iv="min",MM=["typed","config","numeric","smaller","isNaN"],sv=U(iv,MM,t=>{var{typed:e,config:r,numeric:n,smaller:a,isNaN:i}=t;return e(iv,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(o,c){return Ws(o,c.valueOf(),s)},"...":function(o){if(Va(o))throw new TypeError("Scalar values expected in function min");return u(o)}});function s(l,o){try{return a(l,o)?l:o}catch(c){throw vr(c,"min",o)}}function u(l){var o;if(Yn(l,function(c){try{(i(c)||o===void 0||a(c,o))&&(o=c)}catch(f){throw vr(f,"min",c)}}),o===void 0)throw new Error("Cannot calculate min of an empty array");return typeof o=="string"&&(o=n(o,kn(o,r))),o}}),TM="ImmutableDenseMatrix",FM=["smaller","DenseMatrix"],OM=U(TM,FM,t=>{var{smaller:e,DenseMatrix:r}=t;function n(a,i){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(i&&!Rt(i))throw new Error("Invalid datatype: "+i);if(ze(a)||Dt(a)){var s=new r(a,i);this._data=s._data,this._size=s._size,this._datatype=s._datatype,this._min=null,this._max=null}else if(a&&Dt(a.data)&&Dt(a.size))this._data=a.data,this._size=a.size,this._datatype=a.datatype,this._min=typeof a.min<"u"?a.min:null,this._max=typeof a.max<"u"?a.max:null;else{if(a)throw new TypeError("Unsupported type of data ("+Et(a)+")");this._data=[],this._size=[0],this._datatype=i,this._min=null,this._max=null}}return n.prototype=new r,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(a){switch(arguments.length){case 1:{var i=r.prototype.subset.call(this,a);return ze(i)?new n({data:i._data,size:i._size,datatype:i._datatype}):i}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},n.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},n.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},n.prototype.clone=function(){return new n({data:je(this._data),size:je(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(a){return new n(a)},n.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(this._min===null){var a=null;this.forEach(function(i){(a===null||e(i,a))&&(a=i)}),this._min=a!==null?a:void 0}return this._min},n.prototype.max=function(){if(this._max===null){var a=null;this.forEach(function(i){(a===null||e(a,i))&&(a=i)}),this._max=a!==null?a:void 0}return this._max},n},{isClass:!0}),BM="Index",kM=["ImmutableDenseMatrix","getMatrixDataType"],IM=U(BM,kM,t=>{var{ImmutableDenseMatrix:e,getMatrixDataType:r}=t;function n(){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var i=0,s=arguments.length;i<s;i++){var u=i<0||arguments.length<=i?void 0:arguments[i],l=Dt(u),o=ze(u),c=typeof u,f=null;if(_s(u))this._dimensions.push(u),this._isScalar=!1;else if(l||o){var d=void 0;this._isScalar=!1,r(u)==="boolean"?(l&&(d=a(ov(u).valueOf())),o&&(d=a(ov(u._data).valueOf())),f=u.valueOf().length):d=a(u.valueOf()),this._dimensions.push(d)}else if(c==="number")this._dimensions.push(u);else if(c==="bigint")this._dimensions.push(Number(u));else if(c==="string")this._dimensions.push(u);else throw new TypeError("Dimension must be an Array, Matrix, number, bigint, string, or Range");this._sourceSize.push(f)}}n.prototype.type="Index",n.prototype.isIndex=!0;function a(i){for(var s=0,u=i.length;s<u;s++)if(!qe(i[s])||!$e(i[s]))throw new TypeError("Index parameters must be positive integer numbers");var l=new e;return l._data=i,l._size=[i.length],l}return n.prototype.clone=function(){var i=new n;return i._dimensions=je(this._dimensions),i._isScalar=this._isScalar,i._sourceSize=this._sourceSize,i},n.create=function(i){var s=new n;return n.apply(s,i),s},n.prototype.size=function(){for(var i=[],s=0,u=this._dimensions.length;s<u;s++){var l=this._dimensions[s];i[s]=Rt(l)||qe(l)?1:l.size()[0]}return i},n.prototype.max=function(){for(var i=[],s=0,u=this._dimensions.length;s<u;s++){var l=this._dimensions[s];i[s]=Rt(l)||qe(l)?l:l.max()}return i},n.prototype.min=function(){for(var i=[],s=0,u=this._dimensions.length;s<u;s++){var l=this._dimensions[s];i[s]=Rt(l)||qe(l)?l:l.min()}return i},n.prototype.forEach=function(i){for(var s=0,u=this._dimensions.length;s<u;s++)i(this._dimensions[s],s,this)},n.prototype.dimension=function(i){var s;return qe(i)&&(s=this._dimensions[i])!==null&&s!==void 0?s:null},n.prototype.isObjectProperty=function(){return this._dimensions.length===1&&Rt(this._dimensions[0])},n.prototype.getObjectProperty=function(){return this.isObjectProperty()?this._dimensions[0]:null},n.prototype.isScalar=function(){return this._isScalar},n.prototype.toArray=function(){for(var i=[],s=0,u=this._dimensions.length;s<u;s++){var l=this._dimensions[s];i.push(Rt(l)||qe(l)?l:l.toArray())}return i},n.prototype.valueOf=n.prototype.toArray,n.prototype.toString=function(){for(var i=[],s=0,u=this._dimensions.length;s<u;s++){var l=this._dimensions[s];Rt(l)?i.push(JSON.stringify(l)):i.push(l.toString())}return"["+i.join(", ")+"]"},n.prototype.toJSON=function(){return{mathjs:"Index",dimensions:this._dimensions}},n.fromJSON=function(i){return n.create(i.dimensions)},n},{isClass:!0});function ov(t){var e=[];return t.forEach((r,n)=>{r&&e.push(n)}),e}var LM="FibonacciHeap",RM=["smaller","larger"],$M=U(LM,RM,t=>{var{smaller:e,larger:r}=t,n=1/Math.log((1+Math.sqrt(5))/2);function a(){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}a.prototype.type="FibonacciHeap",a.prototype.isFibonacciHeap=!0,a.prototype.insert=function(c,f){var d={key:c,value:f,degree:0};if(this._minimum){var m=this._minimum;d.left=m,d.right=m.right,m.right=d,d.right.left=d,e(c,m.key)&&(this._minimum=d)}else d.left=d,d.right=d,this._minimum=d;return this._size++,d},a.prototype.size=function(){return this._size},a.prototype.clear=function(){this._minimum=null,this._size=0},a.prototype.isEmpty=function(){return this._size===0},a.prototype.extractMinimum=function(){var c=this._minimum;if(c===null)return c;for(var f=this._minimum,d=c.degree,m=c.child;d>0;){var h=m.right;m.left.right=m.right,m.right.left=m.left,m.left=f,m.right=f.right,f.right=m,m.right.left=m,m.parent=null,m=h,d--}return c.left.right=c.right,c.right.left=c.left,c===c.right?f=null:(f=c.right,f=o(f,this._size)),this._size--,this._minimum=f,c},a.prototype.remove=function(c){this._minimum=i(this._minimum,c,-1),this.extractMinimum()};function i(c,f,d){f.key=d;var m=f.parent;return m&&e(f.key,m.key)&&(s(c,f,m),u(c,m)),e(f.key,c.key)&&(c=f),c}function s(c,f,d){f.left.right=f.right,f.right.left=f.left,d.degree--,d.child===f&&(d.child=f.right),d.degree===0&&(d.child=null),f.left=c,f.right=c.right,c.right=f,f.right.left=f,f.parent=null,f.mark=!1}function u(c,f){var d=f.parent;d&&(f.mark?(s(c,f,d),u(d)):f.mark=!0)}var l=function(f,d){f.left.right=f.right,f.right.left=f.left,f.parent=d,d.child?(f.left=d.child,f.right=d.child.right,d.child.right=f,f.right.left=f):(d.child=f,f.right=f,f.left=f),d.degree++,f.mark=!1};function o(c,f){var d=Math.floor(Math.log(f)*n)+1,m=new Array(d),h=0,p=c;if(p)for(h++,p=p.right;p!==c;)h++,p=p.right;for(var g;h>0;){for(var v=p.degree,D=p.right;g=m[v],!!g;){if(r(p.key,g.key)){var y=g;g=p,p=y}l(g,p),m[v]=null,v++}m[v]=p,p=D,h--}c=null;for(var x=0;x<d;x++)g=m[x],g&&(c?(g.left.right=g.right,g.right.left=g.left,g.left=c,g.right=c.right,c.right=g,g.right.left=g,e(g.key,c.key)&&(c=g)):c=g);return c}return a},{isClass:!0}),PM="Spa",qM=["addScalar","equalScalar","FibonacciHeap"],UM=U(PM,qM,t=>{var{addScalar:e,equalScalar:r,FibonacciHeap:n}=t;function a(){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return a.prototype.type="Spa",a.prototype.isSpa=!0,a.prototype.set=function(i,s){if(this._values[i])this._values[i].value=s;else{var u=this._heap.insert(i,s);this._values[i]=u}},a.prototype.get=function(i){var s=this._values[i];return s?s.value:0},a.prototype.accumulate=function(i,s){var u=this._values[i];u?u.value=e(u.value,s):(u=this._heap.insert(i,s),this._values[i]=u)},a.prototype.forEach=function(i,s,u){var l=this._heap,o=this._values,c=[],f=l.extractMinimum();for(f&&c.push(f);f&&f.key<=s;)f.key>=i&&(r(f.value,0)||u(f.key,f.value,this)),f=l.extractMinimum(),f&&c.push(f);for(var d=0;d<c.length;d++){var m=c[d];f=l.insert(m.key,m.value),o[f.key]=f}},a.prototype.swap=function(i,s){var u=this._values[i],l=this._values[s];if(!u&&l)u=this._heap.insert(i,l.value),this._heap.remove(l),this._values[i]=u,this._values[s]=void 0;else if(u&&!l)l=this._heap.insert(s,u.value),this._heap.remove(u),this._values[s]=l,this._values[i]=void 0;else if(u&&l){var o=u.value;u.value=l.value,l.value=o}},a},{isClass:!0});function zM(t){var e=0,r=1,n=Object.create(null),a=Object.create(null),i=0,s=function(l){var o=a[l];if(o&&(delete n[o],delete a[l],--e,r===o)){if(!e){i=0,r=1;return}for(;!Object.prototype.hasOwnProperty.call(n,++r););}};return t=Math.abs(t),{hit:function(l){var o=a[l],c=++i;if(n[c]=l,a[l]=c,!o)return++e,e<=t?void 0:(l=n[r],s(l),l);if(delete n[o],r===o)for(;!Object.prototype.hasOwnProperty.call(n,++r););},delete:s,clear:function(){e=i=0,r=1,n=Object.create(null),a=Object.create(null)}}}function Ri(t){var{hasher:e,limit:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return r=r??Number.POSITIVE_INFINITY,e=e??JSON.stringify,function n(){typeof n.cache!="object"&&(n.cache={values:new Map,lru:zM(r||Number.POSITIVE_INFINITY)});for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];var s=e(a);if(n.cache.values.has(s))return n.cache.lru.hit(s),n.cache.values.get(s);var u=t.apply(t,a);return n.cache.values.set(s,u),n.cache.values.delete(n.cache.lru.hit(s)),u}}var YM=Ri(function(t){return new t(1).exp()},{hasher:lo}),VM=Ri(function(t){return new t(1).plus(new t(5).sqrt()).div(2)},{hasher:lo}),Al=Ri(function(t){return t.acos(-1)},{hasher:lo}),HM=Ri(function(t){return Al(t).times(2)},{hasher:lo});function lo(t){return t[0].precision}function uv(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function Sl(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?uv(Object(r),!0).forEach(function(n){Yt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):uv(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var WM="Unit",GM=["?on","config","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","abs","fix","round","equal","isNumeric","format","toBest","number","Complex","BigNumber","Fraction"],jM=U(WM,GM,t=>{var{on:e,config:r,addScalar:n,subtractScalar:a,multiplyScalar:i,divideScalar:s,pow:u,abs:l,fix:o,round:c,equal:f,isNumeric:d,format:m,toBest:h,number:p,Complex:g,BigNumber:v,Fraction:D}=t,y=p;function x(Y,ee){if(!(this instanceof x))throw new Error("Constructor must be called with the new operator");if(!(Y==null||d(Y)||Wr(Y)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,ee===void 0)this.units=[],this.dimensions=j.map(L=>0);else if(typeof ee=="string"){var ue=x.parse(ee);this.units=ue.units,this.dimensions=ue.dimensions}else if(pr(ee)&&ee.value===null)this.fixPrefix=ee.fixPrefix,this.skipAutomaticSimplification=ee.skipAutomaticSimplification,this.dimensions=ee.dimensions.slice(0),this.units=ee.units.map(L=>jt({},L));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(Y)}Object.defineProperty(x,"name",{value:"Unit"}),x.prototype.constructor=x,x.prototype.type="Unit",x.prototype.isUnit=!0;var w,b,A;function S(){for(;A===" "||A===" ";)_()}function E(Y){return Y>="0"&&Y<="9"||Y==="."}function N(Y){return Y>="0"&&Y<="9"}function _(){b++,A=w.charAt(b)}function C(Y){b=Y,A=w.charAt(b)}function O(){var Y="",ee=b;if(A==="+"?_():A==="-"&&(Y+=A,_()),!E(A))return C(ee),null;if(A==="."){if(Y+=A,_(),!N(A))return C(ee),null}else{for(;N(A);)Y+=A,_();A==="."&&(Y+=A,_())}for(;N(A);)Y+=A,_();if(A==="E"||A==="e"){var ue="",L=b;if(ue+=A,_(),(A==="+"||A==="-")&&(ue+=A,_()),!N(A))return C(L),Y;for(Y=Y+ue;N(A);)Y+=A,_()}return Y}function I(){for(var Y="";N(A)||x.isValidAlpha(A);)Y+=A,_();var ee=Y.charAt(0);return x.isValidAlpha(ee)?Y:null}function k(Y){return A===Y?(_(),Y):null}x.parse=function(Y,ee){if(ee=ee||{},w=Y,b=-1,A="",typeof w!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var ue=new x;ue.units=[];var L=1,Z=!1;_(),S();var K=O(),ne=null;if(K){if(r.number==="BigNumber")ne=new v(K);else if(r.number==="Fraction")try{ne=new D(K)}catch{ne=parseFloat(K)}else ne=parseFloat(K);S(),k("*")?(L=1,Z=!0):k("/")&&(L=-1,Z=!0)}for(var ce=[],pe=1;;){for(S();A==="(";)ce.push(L),pe*=L,L=1,_(),S();var we=void 0;if(A){var xe=A;if(we=I(),we===null)throw new SyntaxError('Unexpected "'+xe+'" in "'+w+'" at index '+b.toString())}else break;var Ne=M(we);if(Ne===null)throw new SyntaxError('Unit "'+we+'" not found.');var Ee=L*pe;if(S(),k("^")){S();var st=O();if(st===null)throw new SyntaxError('In "'+Y+'", "^" must be followed by a floating-point number');Ee*=st}ue.units.push({unit:Ne.unit,prefix:Ne.prefix,power:Ee});for(var lt=0;lt<j.length;lt++)ue.dimensions[lt]+=(Ne.unit.dimensions[lt]||0)*Ee;for(S();A===")";){if(ce.length===0)throw new SyntaxError('Unmatched ")" in "'+w+'" at index '+b.toString());pe/=ce.pop(),_(),S()}if(Z=!1,k("*")?(L=1,Z=!0):k("/")?(L=-1,Z=!0):L=1,Ne.unit.base){var We=Ne.unit.base.key;re.auto[We]={unit:Ne.unit,prefix:Ne.prefix}}}if(S(),A)throw new SyntaxError('Could not parse: "'+Y+'"');if(Z)throw new SyntaxError('Trailing characters: "'+Y+'"');if(ce.length!==0)throw new SyntaxError('Unmatched "(" in "'+w+'"');if(ue.units.length===0&&!ee.allowNoUnits)throw new SyntaxError('"'+Y+'" contains
23no units');return ue.value=ne!==void 0?ue._normalize(ne):null,ue},x.prototype.clone=function(){var Y=new x;Y.fixPrefix=this.fixPrefix,Y.skipAutomaticSimplification=this.skipAutomaticSimplification,Y.value=je(this.value),Y.dimensions=this.dimensions.slice(0),Y.units=[];for(var ee=0;ee<this.units.length;ee++){Y.units[ee]={};for(var ue in this.units[ee])ke(this.units[ee],ue)&&(Y.units[ee][ue]=this.units[ee][ue])}return Y},x.prototype.valueType=function(){return Et(this.value)},x.prototype._isDerived=function(){return this.units.length===0?!1:this.units.length>1||Math.abs(this.units[0].power-1)>1e-15},x.prototype._normalize=function(Y){if(Y==null||this.units.length===0)return Y;for(var ee=Y,ue=x._getNumberConverter(Et(Y)),L=0;L<this.units.length;L++){var Z=ue(this.units[L].unit.value),K=ue(this.units[L].prefix.value),ne=ue(this.units[L].power);ee=i(ee,u(i(Z,K),ne))}return ee},x.prototype._denormalize=function(Y,ee){if(Y==null||this.units.length===0)return Y;for(var ue=Y,L=x._getNumberConverter(Et(Y)),Z=0;Z<this.units.length;Z++){var K=L(this.units[Z].unit.value),ne=L(this.units[Z].prefix.value),ce=L(this.units[Z].power);ue=s(ue,u(i(K,ne),ce))}return ue};var M=Ri(Y=>{if(ke(P,Y)){var ee=P[Y],ue=ee.prefixes[""];return{unit:ee,prefix:ue}}for(var L in P)if(ke(P,L)&&QE(Y,L)){var Z=P[L],K=Y.length-L.length,ne=Y.substring(0,K),ce=ke(Z.prefixes,ne)?Z.prefixes[ne]:void 0;if(ce!==void 0)return{unit:Z,prefix:ce}}return null},{hasher:Y=>Y[0],limit:100});x.isValuelessUnit=function(Y){return M(Y)!==null},x.prototype.hasBase=function(Y){if(typeof Y=="string"&&(Y=R[Y]),!Y)return!1;for(var ee=0;ee<j.length;ee++)if(Math.abs((this.dimensions[ee]||0)-(Y.dimensions[ee]||0))>1e-12)return!1;return!0},x.prototype.equalBase=function(Y){for(var ee=0;ee<j.length;ee++)if(Math.abs((this.dimensions[ee]||0)-(Y.dimensions[ee]||0))>1e-12)return!1;return!0},x.prototype.equals=function(Y){return this.equalBase(Y)&&f(this.value,Y.value)},x.prototype.multiply=function(Y){for(var ee=this.clone(),ue=pr(Y)?Y:new x(Y),L=0;L<j.length;L++)ee.dimensions[L]=(this.dimensions[L]||0)+(ue.dimensions[L]||0);for(var Z=0;Z<ue.units.length;Z++){var K=Sl({},ue.units[Z]);ee.units.push(K)}if(this.value!==null||ue.value!==null){var ne=this.value===null?this._normalize(q(ue.value)):this.value,ce=ue.value===null?ue._normalize(q(this.value)):ue.value;ee.value=i(ne,ce)}else ee.value=null;return pr(Y)&&(ee.skipAutomaticSimplification=!1),H(ee)},x.prototype.divideInto=function(Y){return new x(Y).divide(this)},x.prototype.divide=function(Y){for(var ee=this.clone(),ue=pr(Y)?Y:new x(Y),L=0;L<j.length;L++)ee.dimensions[L]=(this.dimensions[L]||0)-(ue.dimensions[L]||0);for(var Z=0;Z<ue.units.length;Z++){var K=Sl(Sl({},ue.units[Z]),{},{power:-ue.units[Z].power});ee.units.push(K)}if(this.value!==null||ue.value!==null){var ne=this.value===null?this._normalize(q(ue.value)):this.value,ce=ue.value===null?ue._normalize(q(this.value)):ue.value;ee.value=s(ne,ce)}else ee.value=null;return pr(Y)&&(ee.skipAutomaticSimplification=!1),H(ee)},x.prototype.pow=function(Y){for(var ee=this.clone(),ue=0;ue<j.length;ue++)ee.dimensions[ue]=(this.dimensions[ue]||0)*Y;for(var L=0;L<ee.units.length;L++)ee.units[L].power*=Y;return ee.value!==null?ee.value=u(ee.value,Y):ee.value=null,ee.skipAutomaticSimplification=!1,H(ee)};function H(Y){return Y.equalBase(R.NONE)&&Y.value!==null&&!r.predictable?Y.value:Y}function q(Y){var ee=x._getNumberConverter(Et(Y));return ee(1)}x.prototype.abs=function(){var Y=this.clone();if(Y.value!==null)if(Y._isDerived()||Y.units.length===0||Y.units[0].unit.offset===0)Y.value=l(Y.value);else{var ee=Y._numberConverter(),ue=ee(Y.units[0].unit.value),L=ee(Y.units[0].unit.offset),Z=i(ue,L);Y.value=a(l(n(Y.value,Z)),Z)}for(var K in Y.units)(Y.units[K].unit.name==="VA"||Y.units[K].unit.name==="VAR")&&(Y.units[K].unit=P.W);return Y},x.prototype.to=function(Y){var ee=this.value===null?this._normalize(1):this.value,ue;if(typeof Y=="string")ue=x.parse(Y);else if(pr(Y))ue=Y.clone();else throw new Error("String or Unit expected as parameter");if(!this.equalBase(ue))throw new Error("Units do not match ('".concat(ue.toString(),"' != '").concat(this.toString(),"')"));if(ue.value!==null)throw new Error("Cannot convert to a unit with a value");if(this.value===null||this._isDerived()||this.units.length===0||ue.units.length===0||this.units[0].unit.offset===ue.units[0].unit.offset)ue.value=je(ee);else{var L=x._getNumberConverter(Et(ee)),Z=this.units[0].unit.value,K=this.units[0].unit.offset,ne=i(Z,K),ce=ue.units[0].unit.value,pe=ue.units[0].unit.offset,we=i(ce,pe);ue.value=n(ee,L(a(ne,we)))}return ue.fixPrefix=!0,ue.skipAutomaticSimplification=!0,ue},x.prototype.toNumber=function(Y){return y(this.toNumeric(Y))},x.prototype.toNumeric=function(Y){var ee;return Y?ee=this.to(Y):ee=this.clone(),ee._isDerived()||ee.units.length===0?ee._denormalize(ee.value):ee._denormalize(ee.value,ee.units[0].prefix.value)},x.prototype.toString=function(){return this.format()},x.prototype.toJSON=function(){return{mathjs:"Unit",value:this._denormalize(this.value),unit:this.units.length>0?this.formatUnits():null,fixPrefix:this.fixPrefix}},x.fromJSON=function(Y){var ee,ue=new x(Y.value,(ee=Y.unit)!==null&&ee!==void 0?ee:void 0);return ue.fixPrefix=Y.fixPrefix||!1,ue},x.prototype.valueOf=x.prototype.toString,x.prototype.simplify=function(){var Y=this.clone(),ee=[],ue;for(var L in ae)if(ke(ae,L)&&Y.hasBase(R[L])){ue=L;break}if(ue==="NONE")Y.units=[];else{var Z;if(ue&&ke(ae,ue)&&(Z=ae[ue]),Z)Y.units=[{unit:Z.unit,prefix:Z.prefix,power:1}];else{for(var K=!1,ne=0;ne<j.length;ne++){var ce=j[ne];Math.abs(Y.dimensions[ne]||0)>1e-12&&(ke(ae,ce)?ee.push({unit:ae[ce].unit,prefix:ae[ce].prefix,power:Y.dimensions[ne]||0}):K=!0)}ee.length<Y.units.length&&!K&&(Y.units=ee)}}return Y},x.prototype.toSI=function(){for(var Y=this.clone(),ee=[],ue=0;ue<j.length;ue++){var L=j[ue];if(Math.abs(Y.dimensions[ue]||0)>1e-12)if(ke(re.si,L))ee.push({unit:re.si[L].unit,prefix:re.si[L].prefix,power:Y.dimensions[ue]||0});else throw new Error("Cannot express custom unit "+L+" in SI units")}return Y.units=ee,Y.fixPrefix=!0,Y.skipAutomaticSimplification=!0,this.value!==null?(Y.value=null,this.to(Y)):Y},x.prototype.formatUnits=function(){for(var Y="",ee="",ue=0,L=0,Z=0;Z<this.units.length;Z++)this.units[Z].power>0?(ue++,Y+=" "+this.units[Z].prefix.name+this.units[Z].unit.name,Math.abs(this.units[Z].power-1)>1e-15&&(Y+="^"+this.units[Z].power)):this.units[Z].power<0&&L++;if(L>0)for(var K=0;K<this.units.length;K++)this.units[K].power<0&&(ue>0?(ee+=" "+this.units[K].prefix.name+this.units[K].unit.name,Math.abs(this.units[K].power+1)>1e-15&&(ee+="^"+-this.units[K].power)):(ee+=" "+this.units[K].prefix.name+this.units[K].unit.name,ee+="^"+this.units[K].power));Y=Y.substr(1),ee=ee.substr(1),ue>1&&L>0&&(Y="("+Y+")"),L>1&&ue>0&&(ee="("+ee+")");var ne=Y;return ue>0&&L>0&&(ne+=" / "),ne+=ee,ne},x.prototype.toBest=function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Y&&!Array.isArray(Y))throw new Error("Invalid unit type. Expected string or Unit.");var ue=this.units[0].unit.prefixes;if(Y&&Y.length>0){var L=Y.map(ne=>{var ce=null;if(typeof ne=="string"){if(ce=x.parse(ne),!ce)throw new Error("Invalid unit type. Expected compatible string or Unit.")}else if(!pr(ne))throw new Error("Invalid unit type. Expected compatible string or Unit.");ce===null&&(ce=ne.clone());try{return this.to(ce.formatUnits()),ce}catch{throw new Error("Invalid unit type. Expected compatible string or Unit.")}}),Z=L.map(ne=>ne.units[0].prefix);this.units[0].unit.prefixes=Z.reduce((ne,ce)=>(ne[ce.name]=ce,ne),{}),this.units[0].prefix=Z[0]}var K=z(this,ee).simp;return this.units[0].unit.prefixes=ue,K.fixPrefix=!0,K},x.prototype.format=function(Y){var{simp:ee,valueStr:ue,unitStr:L}=z(this,Y),Z=ue;return ee.value&&Wr(ee.value)&&(Z="("+Z+")"),L.length>0&&Z.length>0&&(Z+=" "),Z+=L,Z};function z(Y){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ue=Y.skipAutomaticSimplification||Y.value===null?Y.clone():Y.simplify();X(ue),te(ue,ee.offset);var L=ue._denormalize(ue.value),Z=ue.value!==null?m(L,ee||{}):"",K=ue.formatUnits();return{simp:ue,valueStr:Z,unitStr:K}}function X(Y){var ee=!1;typeof Y.value<"u"&&Y.value!==null&&Wr(Y.value)&&(ee=Math.abs(Y.value.re)<1e-14);for(var ue in Y.units)ke(Y.units,ue)&&Y.units[ue].unit&&(Y.units[ue].unit.name==="VA"&&ee?Y.units[ue].unit=P.VAR:Y.units[ue].unit.name==="VAR"&&!ee&&(Y.units[ue].unit=P.VA))}function te(Y,ee){Y.units.length===1&&!Y.fixPrefix&&Math.abs(Y.units[0].power-Math.round(Y.units[0].power))<1e-14&&(Y.units[0].prefix=Y._bestPrefix(ee))}x.prototype._bestPrefix=function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1.2;if(this.units.length!==1)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var ee=this.value!==null?l(this.value):0,ue=l(this.units[0].unit.value),L=this.units[0].prefix;if(ee===0)return L;var Z=this.units[0].power,K=Math.log(ee/Math.pow(L.value*ue,Z))/Math.LN10-Y;if(K>-2.200001&&K<1.800001)return L;K=Math.abs(K);var ne=this.units[0].unit.prefixes;for(var ce in ne)if(ke(ne,ce)){var pe=ne[ce];if(pe.scientific){var we=Math.abs(Math.log(ee/Math.pow(pe.value*ue,Z))/Math.LN10-Y);(we<K||we===K&&pe.name.length<L.name.length)&&(L=pe,K=we)}}return L},x.prototype.splitUnit=function(Y){for(var ee=this.clone(),ue=[],L=0;L<Y.length&&(ee=ee.to(Y[L]),L!==Y.length-1);L++){var Z=ee.toNumeric(),K=c(Z),ne=void 0,ce=f(K,Z);ce?ne=K:ne=o(ee.toNumeric());var pe=new x(ne,Y[L].toString());ue.push(pe),ee=a(ee,pe)}for(var we=0,xe=0;xe<ue.length;xe++)we=n(we,ue[xe].value);return f(we,this.value)&&(ee.value=0),ue.push(ee),ue};var B={NONE:{"":{name:"",value:1,scientific:!0}},SHORT:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:10,scientific:!1},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},R:{name:"R",value:1e27,scientific:!0},Q:{name:"Q",value:1e30,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}
vendor: 6,858 bytes, line 23
23,r:{name:"r",value:1e-27,scientific:!0},q:{name:"q",value:1e-30,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},ronna:{name:"ronna",value:1e27,scientific:!0},quetta:{name:"quetta",value:1e30,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},ronto:{name:"ronto",value:1e-27,scientific:!0},quecto:{name:"quecto",value:1e-30,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},R:{name:"R",value:1e54,scientific:!0},Q:{name:"Q",value:1e60,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},r:{name:"r",value:1e-54,scientific:!0},q:{name:"q",value:1e-60,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},R:{name:"R",value:1e81,scientific:!0},Q:{name:"Q",value:1e90,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},r:{name:"r",value:1e-81,scientific:!0},q:{name:"q",value:1e-90,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}}};B.SHORTLONG=jt({},B.SHORT,B.LONG),B.BINARY_SHORT=jt({},B.BINARY_SHORT_SI,B.BINARY_SHORT_IEC),B.BINARY_LONG=jt({},B.BINARY_LONG_SI,B.BINARY_LONG_IEC);var j=["MASS","LENGTH","TIME","CURRENT","TEMPERATURE","LUMINOUS_INTENSITY","AMOUNT_OF_SUBSTANCE","ANGLE","BIT"],R={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(var oe in R)ke(R,oe)&&(R[oe].key=oe);var se={},le={name:"",base:se,value:1,offset:0,dimensions:j.map(Y=>0)},P={meter:{name:"meter",base:R.LENGTH,prefixes:B.LONG,value:1,offset:0},inch:{name:"inch",base:R.LENGTH,prefixes:B.NONE,value:.0254,offset:0},foot:{name:"foot",base:R.LENGTH,prefixes:B.NONE,value:.3048,offset:0},yard:{name:"yard",base:R.LENGTH,prefixes:B.NONE,value:.9144,offset:0},mile:{name:"mile",base:R.LENGTH,prefixes:B.NONE,value:1609.344,offset:0},link:{name:"link",base:R.LENGTH,prefixes:B.NONE,value:.201168,offset:0}
23,rod:{name:"rod",base:R.LENGTH,prefixes:B.NONE,value:5.0292,offset:0},chain:{name:"chain",base:R.LENGTH,prefixes:B.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:R.LENGTH,prefixes:B.NONE,value:1e-10,offset:0},m:{name:"m",base:R.LENGTH,prefixes:B.SHORT,value:1,offset:0},in:{name:"in",base:R.LENGTH,prefixes:B.NONE,value:.0254,offset:0},ft:{name:"ft",base:R.LENGTH,prefixes:B.NONE,value:.3048,offset:0},yd:{name:"yd",base:R.LENGTH,prefixes:B.NONE,value:.9144,offset:0},mi:{name:"mi",base:R.LENGTH,prefixes:B.NONE,value:1609.344,offset:0},li:{name:"li",base:R.LENGTH,prefixes:B.NONE,value:.201168,offset:0},rd:{name:"rd",base:R.LENGTH,prefixes:B.NONE,value:5.02921,offset:0},ch:{name:"ch",base:R.LENGTH,prefixes:B.NONE,value:20.1168,offset:0},mil:{name:"mil",base:R.LENGTH,prefixes:B.NONE,value:254e-7,offset:0},m2:{name:"m2",base:R.SURFACE,prefixes:B.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:R.SURFACE,prefixes:B.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:R.SURFACE,prefixes:B.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:R.SURFACE,prefixes:B.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:R.SURFACE,prefixes:B.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:R.SURFACE,prefixes:B.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:R.SURFACE,prefixes:B.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:R.SURFACE,prefixes:B.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:R.SURFACE,prefixes:B.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:R.SURFACE,prefixes:B.NONE,value:1e4,offset:0},m3:{name:"m3",base:R.VOLUME,prefixes:B.CUBIC,value:1,offset:0},L:{name:"L",base:R.VOLUME,prefixes:B.SHORT,value:.001,offset:0},l:{name:"l",base:R.VOLUME,prefixes:B.SHORT,value:.001,offset:0},litre:{name:"litre",base:R.VOLUME,prefixes:B.LONG,value:.001,offset:0},cuin:{name:"cuin",base:R.VOLUME,prefixes:B.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:R.VOLUME,prefixes:B.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:R.VOLUME,prefixes:B.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:R.VOLUME,prefixes:B.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:R.VOLUME,prefixes:B.NONE,value:15e-6,offset:0},drop:{name:"drop",base:R.VOLUME,prefixes:B.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:R.VOLUME,prefixes:B.NONE,value:5e-8,offset:0},minim:{name:"minim",base:R.VOLUME,prefixes:B.NONE,value:61611519921875e-21,offset:0},fluiddram:{name:"fluiddram",base:R.VOLUME,prefixes:B.NONE,value:36966911953125e-19,offset:0},fluidounce:{name:"fluidounce",base:R.VOLUME,prefixes:B.NONE,value:295735295625e-16,offset:0},gill:{name:"gill",base:R.VOLUME,prefixes:B.NONE,value:.00011829411825,offset:0},cc:{name:"cc",base:R.VOLUME,prefixes:B.NONE,value:1e-6,offset:0},cup:{name:"cup",base:R.VOLUME,prefixes:B.NONE,value:.0002365882365,offset:0},pint:{name:"pint",base:R.VOLUME,prefixes:B.NONE,value:.000473176473,offset:0},quart:{name:"quart",base:R.VOLUME,prefixes:B.NONE,value:.000946352946,offset:0},gallon:{name:"gallon",base:R.VOLUME,prefixes:B.NONE,value:.003785411784,offset:0},beerbarrel:{name:"beerbarrel",base:R.VOLUME,prefixes:B.NONE,value:.117347765304,offset:0},oilbarrel:{name:"oilbarrel",base:R.VOLUME,prefixes:B.NONE,value:.158987294928,offset:0},hogshead:{name:"hogshead",base:R.VOLUME,prefixes:B.NONE,value:.238480942392,offset:0},g:{name:"g",base:R.MASS,prefixes:B.SHORT,value:.001,offset:0},gram:{name:"gram",base:R.MASS,prefixes:B.LONG,value:.001,offset:0},ton:{name:"ton",base:R.MASS,prefixes:B.SHORT,value:907.18474,offset:0},t:{name:"t",base:R.MASS,prefixes:B.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:R.MASS,prefixes:B.LONG,value:1e3,offset:0},grain:{name:"grain",base:R.MASS,prefixes:B.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:R.MASS,prefixes:B.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:R.MASS,prefixes:B.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:R.MASS,prefixes:B.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:R.MASS,prefixes:B.NONE,value:45.359237,offset:0},stick:{name:"stick",base:R.MASS,prefixes:B.NONE,value:.115,offset:0},stone:{name:"stone",base:R.MASS,prefixes:B.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:R.MASS,prefixes:B.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:R.MASS,prefixes:B.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:R.MASS,prefixes:B.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:R.MASS,prefixes:B.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:R.MASS,prefixes:B.NONE,value:45.359237,offset:0}
23,s:{name:"s",base:R.TIME,prefixes:B.SHORT,value:1,offset:0},min:{name:"min",base:R.TIME,prefixes:B.NONE,value:60,offset:0},h:{name:"h",base:R.TIME,prefixes:B.NONE,value:3600,offset:0},second:{name:"second",base:R.TIME,prefixes:B.LONG,value:1,offset:0},sec:{name:"sec",base:R.TIME,prefixes:B.LONG,value:1,offset:0},minute:{name:"minute",base:R.TIME,prefixes:B.NONE,value:60,offset:0},hour:{name:"hour",base:R.TIME,prefixes:B.NONE,value:3600,offset:0},day:{name:"day",base:R.TIME,prefixes:B.NONE,value:86400,offset:0},week:{name:"week",base:R.TIME,prefixes:B.NONE,value:7*86400,offset:0},month:{name:"month",base:R.TIME,prefixes:B.NONE,value:2629800,offset:0},year:{name:"year",base:R.TIME,prefixes:B.NONE,value:31557600,offset:0},decade:{name:"decade",base:R.TIME,prefixes:B.NONE,value:315576e3,offset:0},century:{name:"century",base:R.TIME,prefixes:B.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:R.TIME,prefixes:B.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:R.FREQUENCY,prefixes:B.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:R.FREQUENCY,prefixes:B.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:R.ANGLE,prefixes:B.SHORT,value:1,offset:0},radian:{name:"radian",base:R.ANGLE,prefixes:B.LONG,value:1,offset:0},deg:{name:"deg",base:R.ANGLE,prefixes:B.SHORT,value:null,offset:0},degree:{name:"degree",base:R.ANGLE,prefixes:B.LONG,value:null,offset:0},grad:{name:"grad",base:R.ANGLE,prefixes:B.SHORT,value:null,offset:0},gradian:{name:"gradian",base:R.ANGLE,prefixes:B.LONG,value:null,offset:0},cycle:{name:"cycle",base:R.ANGLE,prefixes:B.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:R.ANGLE,prefixes:B.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:R.ANGLE,prefixes:B.NONE,value:null,offset:0},A:{name:"A",base:R.CURRENT,prefixes:B.SHORT,value:1,offset:0},ampere:{name:"ampere",base:R.CURRENT,prefixes:B.LONG,value:1,offset:0}
23,K:{name:"K",base:R.TEMPERATURE,prefixes:B.SHORT,value:1,offset:0},degC:{name:"degC",base:R.TEMPERATURE,prefixes:B.SHORT,value:1,offset:273.15},degF:{name:"degF",base:R.TEMPERATURE,prefixes:B.SHORT,value:new D(5,9),offset:459.67},degR:{name:"degR",base:R.TEMPERATURE,prefixes:B.SHORT,value:new D(5,9),offset:0},kelvin:{name:"kelvin",base:R.TEMPERATURE,prefixes:B.LONG,value:1,offset:0},celsius:{name:"celsius",base:R.TEMPERATURE,prefixes:B.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:R.TEMPERATURE,prefixes:B.LONG,value:new D(5,9),offset:459.67},rankine:{name:"rankine",base:R.TEMPERATURE,prefixes:B.LONG,value:new D(5,9),offset:0},mol:{name:"mol",base:R.AMOUNT_OF_SUBSTANCE,prefixes:B.SHORT,value:1,offset:0},mole:{name:"mole",base:R.AMOUNT_OF_SUBSTANCE,prefixes:B.LONG,value:1,offset:0},cd:{name:"cd",base:R.LUMINOUS_INTENSITY,prefixes:B.SHORT,value:1,offset:0},candela:{name:"candela",base:R.LUMINOUS_INTENSITY,prefixes:B.LONG,value:1,offset:0},N:{name:"N",base:R.FORCE,prefixes:B.SHORT,value:1,offset:0},newton:{name:"newton",base:R.FORCE,prefixes:B.LONG,value:1,offset:0},dyn:{name:"dyn",base:R.FORCE,prefixes:B.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:R.FORCE,prefixes:B.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:R.FORCE,prefixes:B.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:R.FORCE,prefixes:B.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:R.FORCE,prefixes:B.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:R.FORCE,prefixes:B.NONE,value:9.80665,offset:0},J:{name:"J",base:R.ENERGY,prefixes:B.SHORT,value:1,offset:0},joule:{name:"joule",base:R.ENERGY,prefixes:B.LONG,value:1,offset:0},erg:{name:"erg",base:R.ENERGY,prefixes:B.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:R.ENERGY,prefixes:B.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:R.ENERGY,prefixes:B.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:R.ENERGY,prefixes:B.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:R.ENERGY,prefixes:B.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:R.POWER,prefixes:B.SHORT,value:1,offset:0},watt:{name:"watt",base:R.POWER,prefixes:B.LONG,value:1,offset:0},hp:{name:"hp",base:R.POWER,prefixes:B.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:R.POWER,prefixes:B.SHORT,value:g.I,offset:0},VA:{name:"VA",base:R.POWER,prefixes:B.SHORT,value:1,offset:0},Pa:{name:"Pa",base:R.PRESSURE,prefixes:B.SHORT,value:1,offset:0},psi:{name:"psi",base:R.PRESSURE,prefixes:B.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:R.PRESSURE,prefixes:B.NONE,value:101325,offset:0},bar:{name:"bar",base:R.PRESSURE,prefixes:B.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:R.PRESSURE,prefixes:B.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:R.PRESSURE,prefixes:B.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:R.PRESSURE,prefixes:B.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:R.PRESSURE,prefixes:B.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:R.ELECTRIC_CHARGE,prefixes:B.LONG,value:1,offset:0},C:{name:"C",base:R.ELECTRIC_CHARGE,prefixes:B.SHORT,value:1,offset:0},farad:{name:"farad",base:R.ELECTRIC_CAPACITANCE,prefixes:B.LONG,value:1,offset:0},F:{name:"F",base:R.ELECTRIC_CAPACITANCE,prefixes:B.SHORT,value:1,offset:0},volt:{name:"volt",base:R.ELECTRIC_POTENTIAL,prefixes:B.LONG,value:1,offset:0},V:{name:"V",base:R.ELECTRIC_POTENTIAL,prefixes:B.SHORT,value:1,offset:0},ohm:{name:"ohm",base:R.ELECTRIC_RESISTANCE,prefixes:B.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:R.ELECTRIC_INDUCTANCE,prefixes:B.LONG,value:1,offset:0},H:{name:"H",base:R.ELECTRIC_INDUCTANCE,prefixes:B.SHORT,value:1,offset:0},siemens:{name:"siemens",base:R.ELECTRIC_CONDUCTANCE,prefixes:B.LONG,value:1,offset:0},S:{name:"S",base:R.ELECTRIC_CONDUCTANCE,prefixes:B.SHORT,value:1,offset:0},weber:{name:"weber",base:R.MAGNETIC_FLUX,prefixes:B.LONG,value:1,offset:0},Wb:{name:"Wb",base:R.MAGNETIC_FLUX,prefixes:B.SHORT,value:1,offset:0},tesla:{name:"tesla",base:R.MAGNETIC_FLUX_DENSITY,prefixes:B.LONG,value:1,offset:0},T:{name:"T",base:R.MAGNETIC_FLUX_DENSITY,prefixes:B.SHORT,value:1,offset:0},b:{name:"b",base:R.BIT,prefixes:B.BINARY_SHORT,value:1,offset:0}
vendor: 42,607 bytes, lines 23-25
23,bits:{name:"bits",base:R.BIT,prefixes:B.BINARY_LONG,value:1,offset:0},B:{name:"B",base:R.BIT,prefixes:B.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:R.BIT,prefixes:B.BINARY_LONG,value:8,offset:0}},W={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fldr:"fluiddram",fluiddrams:"fluiddram",floz:"fluidounce",fluidounces:"fluidounce",gi:"gill",gills:"gill",cp:"cup",cups:"cup",pt:"pint",pints:"pint",qt:"quart",quarts:"quart",gal:"gallon",gallons:"gallon",bbl:"beerbarrel",beerbarrels:"beerbarrel",obl:"oilbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function J(Y){if(Y.number==="BigNumber"){var ee=Al(v);P.rad.value=new v(1),P.deg.value=ee.div(180),P.grad.value=ee.div(200),P.cycle.value=ee.times(2),P.arcsec.value=ee.div(648e3),P.arcmin.value=ee.div(10800)}else P.rad.value=1,P.deg.value=Math.PI/180,P.grad.value=Math.PI/200,P.cycle.value=Math.PI*2,P.arcsec.value=Math.PI/648e3,P.arcmin.value=Math.PI/10800;P.radian.value=P.rad.value,P.degree.value=P.deg.value,P.gradian.value=P.grad.value}J(r),e&&e("config",function(Y,ee){Y.number!==ee.number&&J(Y)});var re={si:{NONE:{unit:le,prefix:B.NONE[""]},LENGTH:{unit:P.m,prefix:B.SHORT[""]},MASS:{unit:P.g,prefix:B.SHORT.k},TIME:{unit:P.s,prefix:B.SHORT[""]},CURRENT:{unit:P.A,prefix:B.SHORT[""]},TEMPERATURE:{unit:P.K,prefix:B.SHORT[""]},LUMINOUS_INTENSITY:{unit:P.cd,prefix:B.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:P.mol,prefix:B.SHORT[""]},ANGLE:{unit:P.rad,prefix:B.SHORT[""]},BIT:{unit:P.bits,prefix:B.SHORT[""]},FORCE:{unit:P.N,prefix:B.SHORT[""]},ENERGY:{unit:P.J,prefix:B.SHORT[""]},POWER:{unit:P.W,prefix:B.SHORT[""]},PRESSURE:{unit:P.Pa,prefix:B.SHORT[""]},ELECTRIC_CHARGE:{unit:P.C,prefix:B.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:P.F,prefix:B.SHORT[""]},ELECTRIC_POTENTIAL:{unit:P.V,prefix:B.SHORT[""]},ELECTRIC_RESISTANCE:{unit:P.ohm,prefix:B.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:P.H,prefix:B.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:P.S,prefix:B.SHORT[""]},MAGNETIC_FLUX:{unit:P.Wb,prefix:B.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:P.T,prefix:B.SHORT[""]},FREQUENCY:{unit:P.Hz,prefix:B.SHORT[""]}}};re.cgs=JSON.parse(JSON.stringify(re.si)),re.cgs.LENGTH={unit:P.m,prefix:B.SHORT.c},re.cgs.MASS={unit:P.g,prefix:B.SHORT[""]},re.cgs.FORCE={unit:P.dyn,prefix:B.SHORT[""]},re.cgs.ENERGY={unit:P.erg,prefix:B.NONE[""]},re.us=JSON.parse(JSON.stringify(re.si)),re.us.LENGTH={unit:P.ft,prefix:B.NONE[""]},re.us.MASS={unit:P.lbm,prefix:B.NONE[""]},re.us.TEMPERATURE={unit:P.degF,prefix:B.NONE[""]},re.us.FORCE={unit:P.lbf,prefix:B.NONE[""]},re.us.ENERGY={unit:P.BTU,prefix:B.BTU[""]},re.us.POWER={unit:P.hp,prefix:B.NONE[""]},re.us.PRESSURE={unit:P.psi,prefix:B.NONE[""]},re.auto=JSON.parse(JSON.stringify(re.si));var ae=re.auto;x.setUnitSystem=function(Y){if(ke(re,Y))ae=re[Y];else throw new Error("Unit system "+Y+" does not exist. Choices are: "+Object.keys(re).join(", "))},x.getUnitSystem=function(){for(var Y in re)if(ke(re,Y)&&re[Y]===ae)return Y},x.typeConverters={BigNumber:function(ee){return ee!=null&&ee.isFraction?new v(String(ee.n)).div(String(ee.d)).times(String(ee.s)):new v(ee+"")},Fraction:function(ee){return new D(ee)},Complex:function(ee){return ee},number:function(ee){return ee!=null&&ee.isFraction?p(ee):ee}},x.prototype._numberConverter=function(){var Y=x.typeConverters[this.valueType()];if(Y)return Y;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},x._getNumberConverter=function(Y){if(!x.typeConverters[Y])throw new TypeError('Unsupported type "'+Y+'"');return x.typeConverters[Y]};for(var he in P)if(ke(P,he)){var fe=P[he];fe.dimensions=fe.base.dimensions}for(var De in W)if(ke(W,De)){var Te=P[W[De]],Ie={};for(var Me in Te)ke(Te,Me)&&(Ie[Me]=Te[Me]);Ie.name=De,P[De]=Ie}x.isValidAlpha=function(ee){return/^[a-zA-Z]$/.test(ee)};function Le(Y){for(var ee=0;ee<Y.length;ee++){if(A=Y.charAt(ee),ee===0&&!x.isValidAlpha(A))throw new Error('Invalid unit name (must begin with alpha character): "'+Y+'"');if(ee>0&&!(x.isValidAlpha(A)||N(A)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+Y+'"')}}return x.createUnit=function(Y,ee){if(typeof Y!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(ee&&ee.override){for(var ue in Y)if(ke(Y,ue)&&x.deleteUnit(ue),Y[ue].aliases)for(var L=0;L<Y[ue].aliases.length;L++)x.deleteUnit(Y[ue].aliases[L])}var Z;for(var K in Y)ke(Y,K)&&(Z=x.createUnitSingle(K,Y[K]));return Z},x.createUnitSingle=function(Y,ee){if((typeof ee>"u"||ee===null)&&(ee={}),typeof Y!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(ke(P,Y))throw new Error('Cannot create unit "'+Y+'": a unit with that name already exists');Le(Y);var ue=null,L=[],Z=0,K,ne,ce;if(ee&&ee.type==="Unit")ue=ee.clone();else if(typeof ee=="string")ee!==""&&(K=ee);else if(typeof ee=="object")K=ee.definition,ne=ee.prefixes,Z=ee.offset,ce=ee.baseName,ee.aliases&&(L=ee.aliases.valueOf());else throw new TypeError('Cannot create unit "'+Y+'" from "'+ee.toString()+'": expecting "string" or "Unit" or "Object"');if(L){for(var pe=0;pe<L.length;pe++)if(ke(P,L[pe]))throw new Error('Cannot create alias "'+L[pe]+'": a unit with that name already exists')}if(K&&typeof K=="string"&&!ue)try{ue=x.parse(K,{allowNoUnits:!0})}catch(Ze){throw Ze.message='Could not create unit "'+Y+'" from "'+K+'": '+Ze.message,Ze}else K&&K.type==="Unit"&&(ue=K.clone());L=L||[],Z=Z||0,ne&&ne.toUpperCase?ne=B[ne.toUpperCase()]||B.NONE:ne=B.NONE;var we={};if(ue){we={name:Y,value:ue.value,dimensions:ue.dimensions.slice(0),prefixes:ne,offset:Z};var st=!1;for(var lt in R)if(ke(R,lt)){for(var We=!0,Je=0;Je<j.length;Je++)if(Math.abs((we.dimensions[Je]||0)-(R[lt].dimensions[Je]||0))>1e-12){We=!1;break}if(We){st=!0,we.base=R[lt];break}}if(!st){ce=ce||Y+"_STUFF";var Ft={dimensions:ue.dimensions.slice(0)};Ft.key=ce,R[ce]=Ft,ae[ce]={unit:we,prefix:B.NONE[""]},we.base=R[ce]}}else{if(ce=ce||Y+"_STUFF",j.indexOf(ce)>=0)throw new Error('Cannot create new base unit "'+Y+'": a base unit with that name already exists (and cannot be overridden)');j.push(ce);for(var xe in R)ke(R,xe)&&(R[xe].dimensions[j.length-1]=0);for(var Ne={dimensions:[]},Ee=0;Ee<j.length;Ee++)Ne.dimensions[Ee]=0;Ne.dimensions[j.length-1]=1,Ne.key=ce,R[ce]=Ne,we={name:Y,value:1,dimensions:R[ce].dimensions.slice(0),prefixes:ne,offset:Z,base:R[ce]},ae[ce]={unit:we,prefix:B.NONE[""]}}x.UNITS[Y]=we;for(var T=0;T<L.length;T++){var Q=L[T],de={};for(var be in we)ke(we,be)&&(de[be]=we[be]);de.name=Q,x.UNITS[Q]=de}return delete M.cache,new x(null,Y)},x.deleteUnit=function(Y){delete x.UNITS[Y],delete M.cache},x.PREFIXES=B,x.BASE_DIMENSIONS=j,x.BASE_UNITS=R,x.UNIT_SYSTEMS=re,x.UNITS=P,x},{isClass:!0}),lv="unit",ZM=["typed","Unit"],XM=U(lv,ZM,t=>{var{typed:e,Unit:r}=t;return e(lv,{Unit:function(a){return a.clone()},string:function(a){return r.isValuelessUnit(a)?new r(null,a):r.parse(a,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(a,i){return new r(a,i)},"number | BigNumber | Fraction":function(a){return new r(a)},"Array | Matrix":e.referToSelf(n=>a=>nt(a,n))})}),cv="sparse",JM=["typed","SparseMatrix"],QM=U(cv,JM,t=>{var{typed:e,SparseMatrix:r}=t;return e(cv,{"":function(){return new r([])},string:function(a){return new r([],a)},"Array | Matrix":function(a){return new r(a)},"Array | Matrix, string":function(a,i){return new r(a,i)}})}),fv="createUnit",KM=["typed","Unit"],eT=U(fv,KM,t=>{var{typed:e,Unit:r}=t;return e(fv,{"Object, Object":function(a,i){return r.createUnit(a,i)},Object:function(a){return r.createUnit(a,{})},"string, Unit | string | Object, Object":function(a,i,s){var u={};return u[a]=i,r.createUnit(u,s)},"string, Unit | string | Object":function(a,i){var s={};return s[a]=i,r.createUnit(s,{})},string:function(a){var i={};return i[a]={},r.createUnit(i,{})}})}),dv="acos",tT=["typed","config","Complex"],rT=U(dv,tT,t=>{var{typed:e,config:r,Complex:n}=t;return e(dv,{number:function(i){return i>=-1&&i<=1||r.predictable?Math.acos(i):new n(i,0).acos()},Complex:function(i){return i.acos()},BigNumber:function(i){return i.acos()}})}),mv="acosh",nT=["typed","config","Complex"],aT=U(mv,nT,t=>{var{typed:e,config:r,Complex:n}=t;return e(mv,{number:function(i){return i>=1||r.predictable?mm(i):i<=-1?new n(Math.log(Math.sqrt(i*i-1)-i),Math.PI):new n(i,0).acosh()},Complex:function(i){return i.acosh()},BigNumber:function(i){return i.acosh()}})}),hv="acot",iT=["typed","BigNumber"],sT=U(hv,iT,t=>{var{typed:e,BigNumber:r}=t;return e(hv,{number:hm,Complex:function(a){return a.acot()},BigNumber:function(a){return new r(1).div(a).atan()}})}),pv="acoth",oT=["typed","config","Complex","BigNumber"],uT=U(pv,oT,t=>{var{typed:e,config:r,Complex:n,BigNumber:a}=t;return e(pv,{number:function(s){return s>=1||s<=-1||r.predictable?pm(s):new n(s,0).acoth()},Complex:function(s){return s.acoth()},BigNumber:function(s){return new a(1).div(s).atanh()}})}),vv="acsc",lT=["typed","config","Complex","BigNumber"],cT=U(vv,lT,t=>{var{typed:e,config:r,Complex:n,BigNumber:a}=t;return e(vv,{number:function(s){return s<=-1||s>=1||r.predictable?vm(s):new n(s,0).acsc()},Complex:function(s){return s.acsc()},BigNumber:function(s){return new a(1).div(s).asin()}})}),gv="acsch",fT=["typed","BigNumber"],dT=U(gv,fT,t=>{var{typed:e,BigNumber:r}=t;return e(gv,{number:gm,Complex:function(a){return a.acsch()},BigNumber:function(a){return new r(1).div(a).asinh()}})}),yv="asec",mT=["typed","config","Complex","BigNumber"],hT=U(yv,mT,t=>{var{typed:e,config:r,Complex:n,BigNumber:a}=t;return e(yv,{number:function(s){return s<=-1||s>=1||r.predictable?bm(s):new n(s,0).asec()},Complex:function(s){return s.asec()},BigNumber:function(s){return new a(1).div(s).acos()}})}),bv="asech",pT=["typed","config","Complex","BigNumber"],vT=U(bv,pT,t=>{var{typed:e,config:r,Complex:n,BigNumber:a}=t;return e(bv,{number:function(s){if(s<=1&&s>=-1||r.predictable){var u=1/s;if(u>0||r.predictable)return wm(s);var l=Math.sqrt(u*u-1);return new n(Math.log(l-u),Math.PI)}return new n(s,0).asech()},Complex:function(s){return s.asech()},BigNumber:function(s){return new a(1).div(s).acosh()}})}),wv="asin",gT=["typed","config","Complex"],yT=U(wv,gT,t=>{var{typed:e,config:r,Complex:n}=t;return e(wv,{number:function(i){return i>=-1&&i<=1||r.predictable?Math.asin(i):new n(i,0).asin()},Complex:function(i){return i.asin()},BigNumber:function(i){return i.asin()}})}),bT="asinh",wT=["typed"],xT=U(bT,wT,t=>{var{typed:e}=t;return e("asinh",{number:xm,Complex:function(n){return n.asinh()},BigNumber:function(n){return n.asinh()}})}),DT="atan",ET=["typed"],AT=U(DT,ET,t=>{var{typed:e}=t;return e("atan",{number:function(n){return Math.atan(n)},Complex:function(n){return n.atan()},BigNumber:function(n){return n.atan()}})}),xv="atan2",ST=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],NT=U(xv,ST,t=>{var{typed:e,matrix:r,equalScalar:n,BigNumber:a,DenseMatrix:i,concat:s}=t,u=Xr({typed:e,equalScalar:n}),l=cr({typed:e}),o=bh({typed:e,equalScalar:n}),c=tr({typed:e,equalScalar:n}),f=Gt({typed:e,DenseMatrix:i}),d=Ct({typed:e,matrix:r,concat:s});return e(xv,{"number, number":Math.atan2,"BigNumber, BigNumber":(m,h)=>a.atan2(m,h)},d({scalar:"number | BigNumber",SS:o,DS:l,SD:u,Ss:c,sS:f}))}),Dv="atanh",_T=["typed","config","Complex"],CT=U(Dv,_T,t=>{var{typed:e,config:r,Complex:n}=t;return e(Dv,{number:function(i){return i<=1&&i>=-1||r.predictable?Dm(i):new n(i,0).atanh()},Complex:function(i){return i.atanh()},BigNumber:function(i){return i.atanh()}})}),Qa=U("trigUnit",["typed"],t=>{var{typed:e}=t;return{Unit:e.referToSelf(r=>n=>{if(!n.hasBase(n.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return e.find(r,n.valueType())(n.value)})}}),Ev="cos",MT=["typed"],TT=U(Ev,MT,t=>{var{typed:e}=t,r=Qa({typed:e});return e(Ev,{number:Math.cos,"Complex | BigNumber":n=>n.cos()},r)}),Av="cosh",FT=["typed"],OT=U(Av,FT,t=>{var{typed:e}=t;return e(Av,{number:AD,"Complex | BigNumber":r=>r.cosh()})}),Sv="cot",BT=["typed","BigNumber"],kT=U(Sv,BT,t=>{var{typed:e,BigNumber:r}=t,n=Qa({typed:e});return e(Sv,{number:Em,Complex:a=>a.cot(),BigNumber:a=>new r(1).div(a.tan())},n)}),Nv="coth",IT=["typed","BigNumber"],LT=U(Nv,IT,t=>{var{typed:e,BigNumber:r}=t;return e(Nv,{number:Am,Complex:n=>n.coth(),BigNumber:n=>new r(1).div(n.tanh())})}),_v="csc",RT=["typed","BigNumber"],$T=U(_v,RT,t=>{var{typed:e,BigNumber:r}=t,n=Qa({typed:e});return e(_v,{number:Sm,Complex:a=>a.csc(),BigNumber:a=>new r(1).div(a.sin())},n)}),Cv="csch",PT=["typed","BigNumber"],qT=U(Cv,PT,t=>{var{typed:e,BigNumber:r}=t;return e(Cv,{number:Nm,Complex:n=>n.csch(),BigNumber:n=>new r(1).div(n.sinh())})}),Mv="sec",UT=["typed","BigNumber"],zT=U(Mv,UT,t=>{var{typed:e,BigNumber:r}=t,n=Qa({typed:e});return e(Mv,{number:_m,Complex:a=>a.sec(),BigNumber:a=>new r(1).div(a.cos())},n)}),Tv="sech",YT=["typed","BigNumber"],VT=U(Tv,YT,t=>{var{typed:e,BigNumber:r}=t;return e(Tv,{number:Cm,Complex:n=>n.sech(),BigNumber:n=>new r(1).div(n.cosh())})}),Fv="sin",HT=["typed"],WT=U(Fv,HT,t=>{var{typed:e}=t,r=Qa({typed:e});return e(Fv,{number:Math.sin,"Complex | BigNumber":n=>n.sin()},r)}),Ov="sinh",GT=["typed"],jT=U(Ov,GT,t=>{var{typed:e}=t;return e(Ov,{number:Mm,"Complex | BigNumber":r=>r.sinh()})}),Bv="tan",ZT=["typed"],XT=U(Bv,ZT,t=>{var{typed:e}=t,r=Qa({typed:e});return e(Bv,{number:Math.tan,"Complex | BigNumber":n=>n.tan()},r)}),JT="tanh",QT=["typed"],KT=U(JT,QT,t=>{var{typed:e}=t;return e("tanh",{number:ND,"Complex | BigNumber":r=>r.tanh()})}),kv="setCartesian",eF=["typed","size","subset","compareNatural","Index","DenseMatrix"],tF=U(kv,eF,t=>{var{typed:e,size:r,subset:n,compareNatural:a,Index:i,DenseMatrix:s}=t;return e(kv,{"Array | Matrix, Array | Matrix":function(l,o){var c=[];if(n(r(l),new i(0))!==0&&n(r(o),new i(0))!==0){var f=pt(Array.isArray(l)?l:l.toArray()).sort(a),d=pt(Array.isArray(o)?o:o.toArray()).sort(a);c=[];for(var m=0;m<f.length;m++)for(var h=0;h<d.length;h++)c.push([f[m],d[h]])}return Array.isArray(l)&&Array.isArray(o)?c:new s(c)}})}),Iv="setDifference",rF=["typed","size","subset","compareNatural","Index","DenseMatrix"],nF=U(Iv,rF,t=>{var{typed:e,size:r,subset:n,compareNatural:a,Index:i,DenseMatrix:s}=t;return e(Iv,{"Array | Matrix, Array | Matrix":function(l,o){var c;if(n(r(l),new i(0))===0)c=[];else{if(n(r(o),new i(0))===0)return pt(l.toArray());var f=Ya(pt(Array.isArray(l)?l:l.toArray()).sort(a)),d=Ya(pt(Array.isArray(o)?o:o.toArray()).sort(a));c=[];for(var m,h=0;h<f.length;h++){m=!1;for(var p=0;p<d.length;p++)if(a(f[h].value,d[p].value)===0&&f[h].identifier===d[p].identifier){m=!0;break}m||c.push(f[h])}}return Array.isArray(l)&&Array.isArray(o)?zs(c):new s(zs(c))}})}),Lv="setDistinct",aF=["typed","size","subset","compareNatural","Index","DenseMatrix"],iF=U(Lv,aF,t=>{var{typed:e,size:r,subset:n,compareNatural:a,Index:i,DenseMatrix:s}=t;return e(Lv,{"Array | Matrix":function(l){var o;if(n(r(l),new i(0))===0)o=[];else{var c=pt(Array.isArray(l)?l:l.toArray()).sort(a);o=[],o.push(c[0]);for(var f=1;f<c.length;f++)a(c[f],c[f-1])!==0&&o.push(c[f])}return Array.isArray(l)?o:new s(o)}})}),Rv="setIntersect",sF=["typed","size","subset","compareNatural","Index","DenseMatrix"],oF=U(Rv,sF,t=>{var{typed:e,size:r,subset:n,compareNatural:a,Index:i,DenseMatrix:s}=t;return e(Rv,{"Array | Matrix, Array | Matrix":function(l,o){var c;if(n(r(l),new i(0))===0||n(r(o),new i(0))===0)c=[];else{var f=Ya(pt(Array.isArray(l)?l:l.toArray()).sort(a)),d=Ya(pt(Array.isArray(o)?o:o.toArray()).sort(a));c=[];for(var m=0;m<f.length;m++)for(var h=0;h<d.length;h++)if(a(f[m].value,d[h].value)===0&&f[m].identifier===d[h].identifier){c.push(f[m]);break}}return Array.isArray(l)&&Array.isArray(o)?zs(c):new s(zs(c))}})}),$v="setIsSubset",uF=["typed","size","subset","compareNatural","Index"],lF=U($v,uF,t=>{var{typed:e,size:r,subset:n,compareNatural:a,Index:i}=t;return e($v,{"Array | Matrix, Array | Matrix":function(u,l){if(n(r(u),new i(0))===0)return!0;if(n(r(l),new i(0))===0)return!1;for(var o=Ya(pt(Array.isArray(u)?u:u.toArray()).sort(a)),c=Ya(pt(Array.isArray(l)?l:l.toArray()).sort(a)),f,d=0;d<o.length;d++){f=!1;for(var m=0;m<c.length;m++)if(a(o[d].value,c[m].value)===0&&o[d].identifier===c[m].identifier){f=!0;break}if(f===!1)return!1}return!0}})}),Pv="setMultiplicity",cF=["typed","size","subset","compareNatural","Index"],fF=U(Pv,cF,t=>{var{typed:e,size:r,subset:n,compareNatural:a,Index:i}=t;return e(Pv,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(u,l){if(n(r(l),new i(0))===0)return 0;for(var o=pt(Array.isArray(l)?l:l.toArray()),c=0,f=0;f<o.length;f++)a(o[f],u)===0&&c++;return c}})}),qv="setPowerset",dF=["typed","size","subset","compareNatural","Index"],mF=U(qv,dF,t=>{var{typed:e,size:r,subset:n,compareNatural:a,Index:i}=t;return e(qv,{"Array | Matrix":function(o){if(n(r(o),new i(0))===0)return[];for(var c=pt(Array.isArray(o)?o:o.toArray()).sort(a),f=[],d=0;d.toString(2).length<=c.length;)f.push(s(c,d.toString(2).split("").reverse())),d++;return u(f)}});function s(l,o){for(var c=[],f=0;f<o.length;f++)o[f]==="1"&&c.push(l[f]);return c}function u(l){for(var o=[],c=l.length-1;c>0;c--)for(var f=0;f<c;f++)l[f].length>l[f+1].length&&(o=l[f],l[f]=l[f+1],l[f+1]=o);return l}}),Uv="setSize",hF=["typed","compareNatural"],pF=U(Uv,hF,t=>{var{typed:e,compareNatural:r}=t;return e(Uv,{"Array | Matrix":function(a){return Array.isArray(a)?pt(a).length:pt(a.toArray()).length},"Array | Matrix, boolean":function(a,i){if(i===!1||a.length===0)return Array.isArray(a)?pt(a).length:pt(a.toArray()).length;for(var s=pt(Array.isArray(a)?a:a.toArray()).sort(r),u=1,l=1;l<s.length;l++)r(s[l],s[l-1])!==0&&u++;return u}})}),zv="setSymDifference",vF=["typed","size","concat","subset","setDifference","Index"],gF=U(zv,vF,t=>{var{typed:e,size:r,concat:n,subset:a,setDifference:i,Index:s}=t;return e(zv,{"Array | Matrix, Array | Matrix":function(l,o){if(a(r(l),new s(0))===0)return pt(o);if(a(r(o),new s(0))===0)return pt(l);var c=pt(l),f=pt(o);return n(i(c,f),i(f,c))}})}),Yv="setUnion",yF=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],bF=U(Yv,yF,t=>{var{typed:e,size:r,concat:n,subset:a,setIntersect:i,setSymDifference:s,Index:u}=t;return e(Yv,{"Array | Matrix, Array | Matrix":function(o,c){if(a(r(o),new u(0))===0)return pt(c);if(a(r(c),new u(0))===0)return pt(o);var f=pt(o),d=pt(c);return n(s(f,d),i(f,d))}})}),Vv="add",wF=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],xF=U(Vv,wF,t=>{var{typed:e,matrix:r,addScalar:n,equalScalar:a,DenseMatrix:i,SparseMatrix:s,concat:u}=t,l=Vn({typed:e}),o=hl({typed:e,equalScalar:a}),c=ca({typed:e,DenseMatrix:i}),f=Ct({typed:e,matrix:r,concat:u});return e(Vv,{"any, any":n,"any, any, ...any":e.referToSelf(d=>(m,h,p)=>{for(var g=d(m,h),v=0;v<p.length;v++)g=d(g,p[v]);return g})},f({elop:n,DS:l,SS:o,Ss:c}))}),Hv="hypot",DF=["typed","abs","addScalar","divideScalar","multiplyScalar","sqrt","smaller","isPositive"],EF=U(Hv,DF,t=>{var{typed:e,abs:r,addScalar:n,divideScalar:a,multiplyScalar:i,sqrt:s,smaller:u,isPositive:l}=t;return e(Hv,{"... number | BigNumber":o,Array:o,Matrix:c=>o(pt(c.toArray(),!0))});function o(c){for(var f=0,d=0,m=0;m<c.length;m++){if(Wr(c[m]))throw new TypeError("Unexpected type of argument to hypot");var h=r(c[m]);u(d,h)?(f=i(f,i(a(d,h),a(d,h))),f=n(f,1),d=h):f=n(f,l(h)?i(a(h,d),a(h,d)):h)}return i(d,s(f))}}),Wv="norm",AF=["typed","abs","add","pow","conj","sqrt","multiply","equalScalar","larger","smaller","matrix","ctranspose","eigs"],SF=U(Wv,AF,t=>{var{typed:e,abs:r,add:n,pow:a,conj:i,sqrt:s,multiply:u,equalScalar:l,larger:o,smaller:c,matrix:f,ctranspose:d,eigs:m}=t;return e(Wv,{number:Math.abs,Complex:function(S){return S.abs()},BigNumber:function(S){return S.abs()},boolean:function(S){return Math.abs(S)},Array:function(S){return b(f(S),2)},Matrix:function(S){return b(S,2)},"Array, number | BigNumber | string":function(S,E){return b(f(S),E)},"Matrix, number | BigNumber | string":function(S,E){return b(S,E)}});function h(A){var S=0;return A.forEach(function(E){var N=r(E);o(N,S)&&(S=N)},!0),S}function p(A){var S;return A.forEach(function(E){var N=r(E);(!S||c(N,S))&&(S=N)},!0),S||0}function g(A,S){if(S===Number.POSITIVE_INFINITY||S==="inf")return h(A);if(S===Number.NEGATIVE_INFINITY||S==="-inf")return p(A);if(S==="fro")return b(A,2);if(typeof S=="number"&&!isNaN(S)){if(!l(S,0)){var E=0;return A.forEach(function(N){E=n(a(r(N),S),E)},!0),a(E,1/S)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function v(A){var S=0;return A.forEach(function(E,N){S=n(S,u(E,i(E)))}),r(s(S))}function D(A){var S=[],E=0;return A.forEach(function(N,_){var C=_[1],O=n(S[C]||0,r(N));o(O,E)&&(E=O),S[C]=O},!0),E}function y(A){var S=A.size();if(S[0]!==S[1])throw new RangeError("Invalid matrix dimensions");var E=d(A),N=u(E,A),_=m(N).values.toArray(),C=_[_.length-1];return r(s(C))}function x(A){var S=[],E=0;return A.forEach(function(N,_){var C=_[0],O=n(S[C]||0,r(N));o(O,E)&&(E=O),S[C]=O},!0),E}function w(A,S){if(S===1)return D(A);if(S===Number.POSITIVE_INFINITY||S==="inf")return x(A);if(S==="fro")return v(A);if(S===2)return y(A);throw new Error("Unsupported parameter value "+S)}function b(A,S){var E=A.size();if(E.length===1)return g(A,S);if(E.length===2){if(E[0]&&E[1])return w(A,S);throw new RangeError("Invalid matrix dimensions")}}}),Gv="dot",NF=["typed","addScalar","multiplyScalar","conj","size"],_F=U(Gv,NF,t=>{var{typed:e,addScalar:r,multiplyScalar:n,conj:a,size:i}=t;return e(Gv,{"Array | DenseMatrix, Array | DenseMatrix":u,"SparseMatrix, SparseMatrix":l});function s(o,c){var f=i(o),d=i(c),m,h;if(f.length===1)m=f[0];else if(f.length===2&&f[1]===1)m=f[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+f.join(", ")+")");if(d.length===1)h=d[0];else if(d.length===2&&d[1]===1)h=d[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+d.join(", ")+")");if(m!==h)throw new RangeError("Vectors must have equal length ("+m+" != "+h+")");if(m===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return m}function u(o,c){var f=s(o,c),d=ze(o)?o._data:o,m=ze(o)?o._datatype||o.getDataType():void 0,h=ze(c)?c._data:c,p=ze(c)?c._datatype||c.getDataType():void 0,g=i(o).length===2,v=i(c).length===2,D=r,y=n;if(m&&p&&m===p&&typeof m=="string"&&m!=="mixed"){var x=m;D=e.find(r,[x,x]),y=e.find(n,[x,x])}if(!g&&!v){for(var w=y(a(d[0]),h[0]),b=1;b<f;b++)w=D(w,y(a(d[b]),h[b]));return w}if(!g&&v){for(var A=y(a(d[0]),h[0][0]),S=1;S<f;S++)A=D(A,y(a(d[S]),h[S][0]));return A}if(g&&!v){for(var E=y(a(d[0][0]),h[0]),N=1;N<f;N++)E=D(E,y(a(d[N][0]),h[N]));return E}if(g&&v){for(var _=y(a(d[0][0]),h[0][0]),C=1;C<f;C++)_=D(_,y(a(d[C][0]),h[C][0]));return _}}function l(o,c){s(o,c);for(var f=o._index,d=o._values,m=c._index,h=c._values,p=0,g=r,v=n,D=0,y=0;D<f.length&&y<m.length;){var x=f[D],w=m[y];if(x<w){D++;continue}if(x>w){y++;continue}x===w&&(p=g(p,v(d[D],h[y])),D++,y++)}return p}}),CF="trace",MF=["typed","matrix","add"],TF=U(CF,MF,t=>{var{typed:e,matrix:r,add:n}=t;return e("trace",{Array:function(u){return a(r(u))},SparseMatrix:i,DenseMatrix:a,any:je});function a(s){var u=s._size,l=s._data;switch(u.length){case 1:if(u[0]===1)return je(l[0]);throw new RangeError("Matrix must be square (size: "+ot(u)+")");case 2:{var o=u[0],c=u[1];if(o===c){for(var f=0,d=0;d<o;d++)f=n(f,l[d][d]);return f}else throw new RangeError("Matrix must be square (size: "+ot(u)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+ot(u)+")")}}function i(s){var u=s._values,l=s._index,o=s._ptr,c=s._size,f=c[0],d=c[1];if(f===d){var m=0;if(u.length>0)for(var h=0;h<d;h++)for(var p=o[h],g=o[h+1],v=p;v<g;v++){var D=l[v];if(D===h){m=n(m,u[v]);break}if(D>h)break}return m}throw new RangeError("Matrix must be square (size: "+ot(c)+")")}}),jv="index",FF=["typed","Index"],OF=U(jv,FF,t=>{var{typed:e,Index:r}=t;return e(jv,{"...number | string | BigNumber | Range | Array | Matrix":function(a){var i=a.map(function(u){return Qe(u)?u.toNumber():Dt(u)||ze(u)?u.map(function(l){return Qe(l)?l.toNumber():l}):u}),s=new r;return r.apply(s,i),s}})}),Zv=new Set(["end"]),BF="Node",kF=["mathWithTransform"],IF=U(BF,kF,t=>{var{mathWithTransform:e}=t;function r(a){for(var i of[...Zv])if(a.has(i))throw new Error('Scope contains an illegal symbol, "'+i+'" is a reserved keyword')}class n{get type(){return"Node"}get isNode(){return!0}evaluate(i){return this.compile().evaluate(i)}compile(){var i=this._compile(e,{}),s={},u=null;function l(o){var c=Ta(o);return r(c),i(c,s,u)}return{evaluate:l}}_compile(i,s){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(i){throw new Error("Cannot run forEach on a Node interface")}map(i){throw new Error("Cannot run map on a Node interface")}_ifNode(i){if(!xt(i))throw new TypeError("Callback function must return a Node");return i}traverse(i){i(this,null,null);function s(u,l){u.forEach(function(o,c,f){l(o,c,f),s(o,l)})}s(this,i)}transform(i){function s(u,l,o){var c=i(u,l,o);return c!==u?c:u.map(s)}return s(this,null,null)}filter(i){var s=[];return this.traverse(function(u,l,o){i(u,l,o)&&s.push(u)}),s}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(i){return i.cloneDeep()})}equals(i){return i?this.type===i.type&&wn(this,i):!1}toString(i){var s=this._getCustomString(i);return typeof s<"u"?s:this._toString(i)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(i){var s=this._getCustomString(i);return typeof s<"u"?s:this._toHTML(i)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(i){var s=this._getCustomString(i);return typeof s<"u"?s:this._toTex(i)}_toTex(i){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(i){if(i&&typeof i=="object")switch(typeof i.handler){case"object":case"undefined":return;case"function":return i.handler(this,i);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}return n},{isClass:!0,isNode:!0});function gr(t){return t&&t.isIndexError?new $r(t.index+1,t.min+1,t.max!==void 0?t.max+1:void 0):t}function Xv(t){var{subset:e}=t;return function(n,a){try{if(Array.isArray(n))return e(n,a);if(n&&typeof n.subset=="function")return n.subset(a);if(typeof n=="string")return e(n,a);if(typeof n=="object"){if(!a.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return hr(n,a.getObjectProperty())}else throw new TypeError("Cannot apply index: unsupported type of object")}catch(i){throw gr(i)}}}var co="AccessorNode",LF=["subset","Node"],RF=U(co,LF,t=>{var{subset:e,Node:r}=t,n=Xv({subset:e});function a(s){return!(Bn(s)||Cr(s)||dt(s)||bn(s)||Ni(s)||nn(s)||Ht(s))}class i extends r{constructor(u,l){if(super(),!xt(u))throw new TypeError('Node expected for parameter "object"');if(!na(l))throw new TypeError('IndexNode expected for parameter "index"');this.object=u,this.index=l}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return co}get isAccessorNode(){return!0}_compile(u,l){var o=this.object._compile(u,l),c=this.index._compile(u,l);if(this.index.isObjectProperty()){var f=this.index.getObjectProperty();return function(m,h,p){return hr(o(m,h,p),f)}}else return function(m,h,p){var g=o(m,h,p),v=c(m,h,g);return n(g,v)}}forEach(u){u(this.object,"object",this),u(this.index,"index",this)}map(u){return new i(this._ifNode(u(this.object,"object",this)),this._ifNode(u(this.index,"index",this)))}clone(){return new i(this.object,this.index)}_toString(u){var l=this.object.toString(u);return a(this.object)&&(l="("+l+")"),l+this.index.toString(u)}_toHTML(u){var l=this.object.toHTML(u);return a(this.object)&&(l='<span class="math-parenthesis math-round-parenthesis">(</span>'+l+'<span class="math-parenthesis math-round-parenthesis">)</span>'),l+this.index.toHTML(u)}_toTex(u){var l=this.object.toTex(u);return a(this.object)&&(l="\\left(' + object + '\\right)"),l+this.index.toTex(u)}toJSON(){return{mathjs:co,object:this.object,index:this.index}}static fromJSON(u){return new i(u.object,u.index)}}return Yt(i,"name",co),i},{isClass:!0,isNode:!0}),fo="ArrayNode",$F=["Node"],PF=U(fo,$F,t=>{var{Node:e}=t;class r extends e{constructor(a){if(super(),this.items=a||[],!Array.isArray(this.items)||!this.items.every(xt))throw new TypeError("Array containing Nodes expected")}get type(){return fo}get isArrayNode(){return!0}_compile(a,i){var s=zn(this.items,function(o){return o._compile(a,i)}),u=a.config.matrix!=="Array";if(u){var l=a.matrix;return function(c,f,d){return l(zn(s,function(m){return m(c,f,d)}))}}else return function(c,f,d){return zn(s,function(m){return m(c,f,d)})}}forEach(a){for(var i=0;i<this.items.length;i++){var s=this.items[i];a(s,"items["+i+"]",this)}}map(a){for(var i=[],s=0;s<this.items.length;s++)i[s]=this._ifNode(a(this.items[s],"items["+s+"]",this));return new r(i)}clone(){return new r(this.items.slice(0))}_toString(a){var i=this.items.map(function(s){return s.toString(a)});return"["+i.join(", ")+"]"}toJSON(){return{mathjs:fo,items:this.items}}static fromJSON(a){return new r(a.items)}_toHTML(a){var i=this.items.map(function(s){return s.toHTML(a)});return'<span class="math-parenthesis math-square-parenthesis">[</span>'+i.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'}_toTex(a){function i(s,u){var l=s.some(Cr)&&!s.every(Cr),o=u||l,c=o?"&":"\\\\",f=s.map(function(d){return d.items?i(d.items,!u):d.toTex(a)}).join(c);return l||!o||o&&!u?"\\begin{bmatrix}"+f+"\\end{bmatrix}":f}return i(this.items,!1)}}return Yt(r,"name",fo),r},{isClass:!0,isNode:!0});function qF(t){var{subset:e,matrix:r}=t;return function(a,i,s){try{if(Array.isArray(a)){var u=r(a).subset(i,s).valueOf();return u.forEach((l,o)=>{a[o]=l}),a}else{if(a&&typeof a.subset=="function")return a.subset(i,s);if(typeof a=="string")return e(a,i,s);if(typeof a=="object"){if(!i.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return Ma(a,i.getObjectProperty(),s),a}else throw new TypeError("Cannot apply index: unsupported type of object")}}catch(l){throw gr(l)}}}var Jr=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:nullish":{op:"??",associativity:"left",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function mo(t,e){if(!e||e!=="auto")return t;for(var r=t;nn(r);)r=r.content;return r}function At(t,e,r,n){var a=t;e!=="keep"&&(a=t.getContent());for(var i=a.getIdentifier(),s=null,u=0;u<Jr.length;u++)if(i in Jr[u]){s=u;break}if(i==="OperatorNode:multiply"&&a.implicit&&r!=="show"){var l=mo(a.args[0],e);!(dt(l)&&n&&n.getIdentifier()==="OperatorNode:divide"&&qu(mo(n.args[0],e)))&&!(l.getIdentifier()==="OperatorNode:divide"&&qu(mo(l.args[0],e))&&dt(mo(l.args[1])))&&(s+=1)}return s}function $i(t,e){var r=t;e!=="keep"&&(r=t.getContent());var n=r.getIdentifier(),a=At(r,e);if(a===null)return null;var i=Jr[a][n];if(ke(i,"associativity")){if(i.associativity==="left")return"left";if(i.associativity==="right")return"right";throw Error("'"+n+"' has the invalid associativity '"+i.associativity+"'.")}return null}function Nl(t,e,r){var n=r!=="keep"?t.getContent():t,a=r!=="keep"?t.getContent():e,i=n.getIdentifier(),s=a.getIdentifier(),u=At(n,r);if(u===null)return null;var l=Jr[u][i];if(ke(l,"associativeWith")&&l.associativeWith instanceof Array){for(var o=0;o<l.associativeWith.length;o++)if(l.associativeWith[o]===s)return!0;return!1}return null}function UF(t){var e="OperatorNode:"+t;for(var r of Jr)if(e in r)return r[e].op;return null}var ho="AssignmentNode",zF=["subset","?matrix","Node"],YF=U(ho,zF,t=>{var{subset:e,matrix:r,Node:n}=t,a=Xv({subset:e}),i=qF({subset:e,matrix:r});function s(l,o,c){o||(o="keep");var f=At(l,o,c),d=At(l.value,o,c);return o==="all"||d!==null&&d<=f}class u extends n{constructor(o,c,f){if(super(),this.object=o,this.index=f?c:null,this.value=f||c,!Ht(o)&&!Bn(o))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(Ht(o)&&o.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!na(this.index))throw new TypeError('IndexNode expected as "index"');if(!xt(this.value))throw new TypeError('Node expected as "value"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return ho}get isAssignmentNode(){return!0}_compile(o,c){var f=this.object._compile(o,c),d=this.index?this.index._compile(o,c):null,m=this.value._compile(o,c),h=this.object.name;if(this.index)if(this.index.isObjectProperty()){var p=this.index.getObjectProperty();return function(x,w,b){var A=f(x,w,b),S=m(x,w,b);return Ma(A,p,S),S}}else{if(Ht(this.object))return function(x,w,b){var A=f(x,w,b),S=m(x,w,b),E=d(x,w,A);return x.set(h,i(A,E,S)),S};var g=this.object.object._compile(o,c);if(this.object.index.isObjectProperty()){var v=this.object.index.getObjectProperty();return function(x,w,b){var A=g(x,w,b),S=hr(A,v),E=d(x,w,S),N=m(x,w,b);return Ma(A,v,i(S,E,N)),N}}else{var D=this.object.index._compile(o,c);return function(x,w,b){var A=g(x,w,b),S=D(x,w,A),E=a(A,S),N=d(x,w,E),_=m(x,w,b);return i(A,S,i(E,N,_)),_}}}else{if(!Ht(this.object))throw new TypeError("SymbolNode expected as object");return function(x,w,b){var A=m(x,w,b);return x.set(h,A),A}}}forEach(o){o(this.object,"object",this),this.index&&o(this.index,"index",this),o(this.value,"value",this)}map(o){var c=this._ifNode(o(this.object,"object",this)),f=this.index?this._ifNode(o(this.index,"index",this)):null,d=this._ifNode(o(this.value,"value",this));return new u(c,f,d)}clone(){return new u(this.object,this.index,this.value)}_toString(o){var c=this.object.toString(o),f=this.index?this.index.toString(o):"",d=this.value.toString(o);return s(this,o&&o.parenthesis,o&&o.implicit)&&(d="("+d+")"),c+f+" = "+d}toJSON(){return{mathjs:ho,object:this.object,index:this.index,value:this.value}}static fromJSON(o){return new u(o.object,o.index,o.value)}_toHTML(o){var c=this.object.toHTML(o),f=this.index?this.index.toHTML(o):"",d=this.value.toHTML(o);return s(this,o&&o.parenthesis,o&&o.implicit)&&(d='<span class="math-paranthesis math-round-parenthesis">(</span>'+d+'<span class="math-paranthesis math-round-parenthesis">)</span>'),c+f+'<span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+d}_toTex(o){var c=this.object.toTex(o),f=this.index?this.index.toTex(o):"",d=this.value.toTex(o);return s(this,o&&o.parenthesis,o&&o.implicit)&&(d="\\left(".concat(d,"\\right)")),c+f+"="+d}}return Yt(u,"name",ho),u},{isClass:!0,isNode:!0}),po="BlockNode",VF=["ResultSet","Node"],HF=U(po,VF,t=>{var{ResultSet:e,Node:r}=t;class n extends r{constructor(i){if(super(),!Array.isArray(i))throw new Error("Array expected");this.blocks=i.map(function(s){var u=s&&s.node,l=s&&s.visible!==void 0?s.visible:!0;if(!xt(u))throw new TypeError('Property "node" must be a Node');if(typeof l!="boolean")throw new TypeError('Property "visible" must be a boolean');return{node:u,visible:l}})}get type(){return po}get isBlockNode(){return!0}_compile(i,s){var u=zn(this.blocks,function(l){return{evaluate:l.node._compile(i,s),visible:l.visible}});return function(o,c,f){var d=[];return _d(u,function(h){var p=h.evaluate(o,c,f);h.visible&&d.push(p)}),new e(d)}}forEach(i){for(var s=0;s<this.blocks.length;s++)i(this.blocks[s].node,"blocks["+s+"].node",this)}map(i){for(var s=[],u=0;u<this.blocks.length;u++){var l=this.blocks[u],o=this._ifNode(i(l.node,"blocks["+u+"].node",this));s[u]={node:o,visible:l.visible}}return new n(s)}clone(){var i=this.blocks.map(function(s){return{node:s.node,visible:s.visible}});return new n(i)}_toString(i){return this.blocks.map(function(s){return s.node.toString(i)+(s.visible?"":";")}).join(` 24`)}toJSON(){return{mathjs:po,blocks:this.blocks}}static fromJSON(i){return new n(i.blocks)}_toHTML(i){return this.blocks.map(function(s){return s.node.toHTML(i)+(s.visible?"":'<span class="math-separator">;</span>')}).join('<span class="math-separator"><br /></span>')}_toTex(i){return this.blocks.map(function(s){return s.node.toTex(i)+(s.visible?"":";")}).join(`\\;\\; 25`)}}return Yt(n,"name",po),n},{isClass:!0,isNode:!0}),vo="ConditionalNode",WF=["Node"],GF=U(vo,WF,t=>{var{Node:e}=t;function r(a){if(typeof a=="number"||typeof a=="boolean"||typeof a=="string")return!!a;if(a){if(Qe(a))return!a.isZero();if(Wr(a))return!!(a.re||a.im);if(pr(a))return!!a.value}if(a==null)return!1;throw new TypeError('Unsupported type of condition "'+Et(a)+'"')}class n extends e{constructor(i,s,u){if(super(),!xt(i))throw new TypeError("Parameter condition must be a Node");if(!xt(s))throw new TypeError("Parameter trueExpr must be a Node");if(!xt(u))throw new TypeError("Parameter falseExpr must be a Node");this.condition=i,this.trueExpr=s,this.falseExpr=u}get type(){return vo}get isConditionalNode(){return!0}_compile(i,s){var u=this.condition._compile(i,s),l=this.trueExpr._compile(i,s),o=this.falseExpr._compile(i,s);return function(f,d,m){return r(u(f,d,m))?l(f,d,m):o(f,d,m)}}forEach(i){i(this.condition,"condition",this),i(this.trueExpr,"trueExpr",this),i(this.falseExpr,"falseExpr",this)}map(i){return new n(this._ifNode(i(this.condition,"condition",this)),this._ifNode(i(this.trueExpr,"trueExpr",this)),this._ifNode(i(this.falseExpr,"falseExpr",this)))}clone(){return new n(this.condition,this.trueExpr,this.falseExpr)}_toString(i){var s=i&&i.parenthesis?i.parenthesis:"keep",u=At(this,s,i&&i.implicit),l=this.condition.toString(i),o=At(this.condition,s,i&&i.implicit);(s==="all"||this.condition.type==="OperatorNode"||o!==null&&o<=u)&&(l="("+l+")");var c=this.trueExpr.toString(i),f=At(this.trueExpr,s,i&&i.implicit);(s==="all"||this.trueExpr.type==="OperatorNode"||f!==null&&f<=u)&&(c="("+c+")");var d=this.falseExpr.toString(i),m=At(this.falseExpr,s,i&&i.implicit);return(s==="all"||this.falseExpr.type==="OperatorNode"||m!==null&&m<=u)&&(d="("+d+")"),l+" ? "+c+" : "+d}toJSON(){return{mathjs:vo,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(i){return new n(i.condition,i.trueExpr,i.falseExpr)}_toHTML(i){var s=i&&i.parenthesis?i.parenthesis:"keep",u=At(this,s,i&&i.implicit),l=this.condition.toHTML(i),o=At(this.condition,s,i&&i.implicit);(s==="all"||this.condition.type==="OperatorNode"||o!==null&&o<=u)&&(l='<span class="math-parenthesis math-round-parenthesis">(</span>'+l+'<span class="math-parenthesis math-round-parenthesis">)</span>');var c=this.trueExpr.toHTML(i),f=At(this.trueExpr,s,i&&i.implicit);(s==="all"||this.trueExpr.type==="OperatorNode"||f!==null&&f<=u)&&(c='<span class="math-parenthesis math-round-parenthesis">(</span>
25'+c+'<span class="math-parenthesis math-round-parenthesis">)</span>');var d=this.falseExpr.toHTML(i),m=At(this.falseExpr,s,i&&i.implicit);return(s==="all"||this.falseExpr.type==="OperatorNode"||m!==null&&m<=u)&&(d='<span class="math-parenthesis math-round-parenthesis">(</span>'+d+'<span class="math-parenthesis math-round-parenthesis">)</span>'),l+'<span class="math-operator math-conditional-operator">?</span>'+c+'<span class="math-operator math-conditional-operator">:</span>'+d}_toTex(i){return"\\begin{cases} {"+this.trueExpr.toTex(i)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(i)+"}\\\\{"+this.falseExpr.toTex(i)+"}, &\\quad{\\text{otherwise}}\\end{cases}"}}return Yt(n,"name",vo),n},{isClass:!0,isNode:!0}),_l,Jv;function jF(){if(Jv)return _l;Jv=1;var t=Object.assign||function(a){for(var i=1;i<arguments.length;i++){var s=arguments[i];for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(a[u]=s[u])}return a},e={"{":"\\{","}":"\\}","\\":"\\textbackslash{}","#":"\\#",$:"\\$","%":"\\%","&":"\\&","^":"\\textasciicircum{}",_:"\\_","~":"\\textasciitilde{}"},r={"â":"\\--","â":"\\---"," ":"~"," ":"\\qquad{}","\r\n":"\\newline{}","\n":"\\newline{}"},n=function(i,s){return t({},i,s)};return _l=function(a){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.preserveFormatting,u=s===void 0?!1:s,l=i.escapeMapFn,o=l===void 0?n:l,c=String(a),f="",d=o(t({},e),u?t({},r):{}),m=Object.keys(d),h=function(){var g=!1;m.forEach(function(v,D){g||c.length>=v.length&&c.slice(0,v.length)===v&&(f+=d[m[D]],c=c.slice(v.length,c.length),g=!0)}),g||(f+=c.slice(0,1),c=c.slice(1,c.length))};c;)h();return f},_l}var ZF=jF();const XF=gi(ZF);var Cl={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{?}"},vt={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"},Qv={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(vt.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(vt.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(vt.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(vt.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(vt.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},fraction:{2:"\\frac{${args[0]}}{${args[1]}}"},gcd:"\\gcd\\left(${args}\\right)",hypot:"\\hypot\\left(${args}\\right)",log:{1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},log10:{1:"\\log_{10}\\left(${args[0]}\\right)"},log1p:{1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},log2:"\\log_{2}\\left(${args[0]}\\right)",mod:{2:"\\left(${args[0]}".concat(vt.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(vt.multiply,"${args[1]}\\right)")},norm:{1:"\\left\\|${args[0]}\\right\\|",2:void 0},nthRoot:{2:"\\sqrt[${args[1]}]{${args[0]}}"}
vendor: 4,583 bytes, line 25
25,nthRoots:{2:"\\{y : y^${args[1]} = {${args[0]}}\\}"},pow:{2:"\\left(${args[0]}\\right)".concat(vt.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(vt.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(vt.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(vt.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(vt.bitAnd,"${args[1]}\\right)")},bitNot:{1:vt.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(vt.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(vt.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(vt.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(vt.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(vt.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(vt.and,"${args[1]}\\right)")},not:{1:vt.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(vt.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(vt.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(vt.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(vt.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(vt.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(vt.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(vt.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(vt.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(vt.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(vt.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(vt.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(vt.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(vt.to,"${args[1]}\\right)")},numeric:function(e,r){return e.args[0].toTex()},number:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:"0",1:"\\left(${args[0]}\\right)"},bigint:{0:"0",1:"\\left(${args[0]}\\right)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}
25\\right)+".concat(Cl.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)"}},JF="\\mathrm{${name}}\\left(${args}\\right)",Kv={deg:"^\\circ"};function Ml(t){return XF(t,{preserveFormatting:!0})}function eg(t,e){return e=typeof e>"u"?!1:e,e?ke(Kv,t)?Kv[t]:"\\mathrm{"+Ml(t)+"}":ke(Cl,t)?Cl[t]:Ml(t)}var go="ConstantNode",QF=["Node"],KF=U(go,QF,t=>{var{Node:e}=t;class r extends e{constructor(a){super(),this.value=a}get type(){return go}get isConstantNode(){return!0}_compile(a,i){var s=this.value;return function(){return s}}forEach(a){}map(a){return this.clone()}clone(){return new r(this.value)}_toString(a){return ot(this.value,a)}_toHTML(a){var i=this._toString(a);switch(Et(this.value)){case"number":case"bigint":case"BigNumber":case"Fraction":return'<span class="math-number">'+i+"</span>";case"string":return'<span class="math-string">'+i+"</span>";case"boolean":return'<span class="math-boolean">'+i+"</span>";case"null":return'<span class="math-null-symbol">'+i+"</span>";case"undefined":return'<span class="math-undefined">'+i+"</span>";default:return'<span class="math-symbol">'+i+"</span>"}}toJSON(){return{mathjs:go,value:this.value}}static fromJSON(a){return new r(a.value)}_toTex(a){var i=this._toString(a),s=Et(this.value);switch(s){case"string":return"\\mathtt{"+Ml(i)+"}";case"number":case"BigNumber":{var u=s==="BigNumber"?this.value.isFinite():isFinite(this.value);if(!u)return this.value.valueOf()<0?"-\\infty":"\\infty";var l=i.toLowerCase().indexOf("e");return l!==-1?i.substring(0,l)+"\\cdot10^{"+i.substring(l+1)+"}":i}case"bigint":return i.toString();case"Fraction":return this.value.toLatex();default:return i}}}return Yt(r,"name",go),r},{isClass:!0,isNode:!0}),yo="FunctionAssignmentNode",e3=["typed","Node"],t3=U(yo,e3,t=>{var{typed:e,Node:r}=t;function n(i,s,u){var l=At(i,s,u),o=At(i.expr,s,u);return s==="all"||o!==null&&o<=l}class a extends r{constructor(s,u,l){if(super(),typeof s!="string")throw new TypeError('String expected for parameter "name"');
vendor: 17,754 bytes, lines 25-26
25if(!Array.isArray(u))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!xt(l))throw new TypeError('Node expected for parameter "expr"');if(Zv.has(s))throw new Error('Illegal function name, "'+s+'" is a reserved keyword');var o=new Set;for(var c of u){var f=typeof c=="string"?c:c.name;if(o.has(f))throw new Error('Duplicate parameter name "'.concat(f,'"'));o.add(f)}this.name=s,this.params=u.map(function(d){return d&&d.name||d}),this.types=u.map(function(d){return d&&d.type||"any"}),this.expr=l}get type(){return yo}get isFunctionAssignmentNode(){return!0}_compile(s,u){var l=Object.create(u);_d(this.params,function(p){l[p]=!0});var o=this.expr,c=o._compile(s,l),f=this.name,d=this.params,m=Td(this.types,","),h=f+"("+Td(this.params,", ")+")";return function(g,v,D){var y={};y[m]=function(){for(var w=Object.create(v),b=0;b<d.length;b++)w[d[b]]=arguments[b];return c(g,w,D)};var x=e(f,y);return x.syntax=h,x.expr=o.toString(),g.set(f,x),x}}forEach(s){s(this.expr,"expr",this)}map(s){var u=this._ifNode(s(this.expr,"expr",this));return new a(this.name,this.params.slice(0),u)}clone(){return new a(this.name,this.params.slice(0),this.expr)}_toString(s){var u=s&&s.parenthesis?s.parenthesis:"keep",l=this.expr.toString(s);return n(this,u,s&&s.implicit)&&(l="("+l+")"),this.name+"("+this.params.join(", ")+") = "+l}toJSON(){var s=this.types;return{mathjs:yo,name:this.name,params:this.params.map(function(u,l){return{name:u,type:s[l]}}),expr:this.expr}}static fromJSON(s){return new a(s.name,s.params,s.expr)}_toHTML(s){for(var u=s&&s.parenthesis?s.parenthesis:"keep",l=[],o=0;o<this.params.length;o++)l.push('<span class="math-symbol math-parameter">'+Rr(this.params[o])+"</span>");var c=this.expr.toHTML(s);return n(this,u,s&&s.implicit)&&(c='<span class="math-parenthesis math-round-parenthesis">(</span>'+c+'<span class="math-parenthesis math-round-parenthesis">)</span>'),'<span class="math-function">'+Rr(this.name)+'</span><span class="math-parenthesis math-round-parenthesis">(</span>'+l.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>'+c}_toTex(s){var u=s&&s.parenthesis?s.parenthesis:"keep",l=this.expr.toTex(s);return n(this,u,s&&s.implicit)&&(l="\\left(".concat(l,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(eg).join(",")+"\\right)="+l}}return Yt(a,"name",yo),a},{isClass:!0,isNode:!0}),bo="IndexNode",r3=["Node","size"],n3=U(bo,r3,t=>{var{Node:e,size:r}=t;class n extends e{constructor(i,s){if(super(),this.dimensions=i,this.dotNotation=s||!1,!Array.isArray(i)||!i.every(xt))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}get type(){return bo}get isIndexNode(){return!0}_compile(i,s){var u=zn(this.dimensions,function(o,c){var f=o.filter(h=>h.isSymbolNode&&h.name==="end").length>0;if(f){var d=Object.create(s);d.end=!0;var m=o._compile(i,d);return function(p,g,v){if(!ze(v)&&!Dt(v)&&!Rt(v))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+Et(v));var D=r(v),y=Object.create(g);return y.end=D[c],m(p,y,v)}}else return o._compile(i,s)}),l=hr(i,"index");return function(c,f,d){var m=zn(u,function(h){return h(c,f,d)});return l(...m)}}forEach(i){for(var s=0;s<this.dimensions.length;s++)i(this.dimensions[s],"dimensions["+s+"]",this)}map(i){for(var s=[],u=0;u<this.dimensions.length;u++)s[u]=this._ifNode(i(this.dimensions[u],"dimensions["+u+"]",this));return new n(s,this.dotNotation)}clone(){return new n(this.dimensions.slice(0),this.dotNotation)}isObjectProperty(){return this.dimensions.length===1&&dt(this.dimensions[0])&&typeof this.dimensions[0].value=="string"}getObjectProperty(){return this.isObjectProperty()?this.dimensions[0].value:null}_toString(i){return this.dotNotation?"."+this.getObjectProperty():"["+this.dimensions.join(", ")+"]"}toJSON(){return{mathjs:bo,dimensions:this.dimensions,dotNotation:this.dotNotation}}static fromJSON(i){return new n(i.dimensions,i.dotNotation)}_toHTML(i){for(var s=[],u=0;u<this.dimensions.length;u++)s[u]=this.dimensions[u].toHTML();return this.dotNotation?'<span class="math-operator math-accessor-operator">.</span><span class="math-symbol math-property">'+Rr(this.getObjectProperty())+"</span>":'<span class="math-parenthesis math-square-parenthesis">[</span>'+s.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'}_toTex(i){var s=this.dimensions.map(function(u){return u.toTex(i)});return this.dotNotation?"."+this.getObjectProperty():"_{"+s.join(",")+"}"}}return Yt(n,"name",bo),n},{isClass:!0,isNode:!0}),wo="ObjectNode",a3=["Node"],i3=U(wo,a3,t=>{var{Node:e}=t;class r extends e{constructor(a){if(super(),this.properties=a||{},a&&(typeof a!="object"||!Object.keys(a).every(function(i){return xt(a[i])})))throw new TypeError("Object containing Nodes expected")}get type(){return wo}get isObjectNode(){return!0}_compile(a,i){var s={};for(var u in this.properties)if(ke(this.properties,u)){var l=qa(u),o=JSON.parse(l),c=hr(this.properties,u);s[o]=c._compile(a,i)}return function(d,m,h){var p={};for(var g in s)ke(s,g)&&(p[g]=s[g](d,m,h));return p}}forEach(a){for(var i in this.properties)ke(this.properties,i)&&a(this.properties[i],"properties["+qa(i)+"]",this)}map(a){var i={};for(var s in this.properties)ke(this.properties,s)&&(i[s]=this._ifNode(a(this.properties[s],"properties["+qa(s)+"]",this)));return new r(i)}clone(){var a={};for(var i in this.properties)ke(this.properties,i)&&(a[i]=this.properties[i]);return new r(a)}_toString(a){var i=[];for(var s in this.properties)ke(this.properties,s)&&i.push(qa(s)+": "+this.properties[s].toString(a));return"{"+i.join(", ")+"}"}toJSON(){return{mathjs:wo,properties:this.properties}}static fromJSON(a){return new r(a.properties)}_toHTML(a){var i=[];for(var s in this.properties)ke(this.properties,s)&&i.push('<span class="math-symbol math-property">'+Rr(s)+'</span><span class="math-operator math-assignment-operator math-property-assignment-operator math-binary-operator">:</span>'+this.properties[s].toHTML(a));return'<span class="math-parenthesis math-curly-parenthesis">{</span>'+i.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-curly-parenthesis">}</span>'}_toTex(a){var i=[];for(var s in this.properties)ke(this.properties,s)&&i.push("\\mathbf{"+s+":} & "+this.properties[s].toTex(a)+"\\\\");var u="\\left\\{\\begin{array}{ll}"+i.join(` 26`)+"\\end{array}\\right\\}";return u}}return Yt(r,"name",wo),r},{isClass:!0,isNode:!0});function Pi(t,e){return new _f(t,new Ns(e),new Set(Object.keys(e)))}var xo="OperatorNode",s3=["Node"],o3=U(xo,s3,t=>{var{Node:e}=t;function r(i,s){var u=i;if(s==="auto")for(;nn(u);)u=u.content;return dt(u)?!0:Pt(u)?r(u.args[0],s):!1}function n(i,s,u,l,o){var c=At(i,s,u),f=$i(i,s);if(s==="all"||l.length>2&&i.getIdentifier()!=="OperatorNode:add"&&i.getIdentifier()!=="OperatorNode:multiply")return l.map(function(N){switch(N.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});var d;switch(l.length){case 0:d=[];break;case 1:{var m=At(l[0],s,u,i);if(o&&m!==null){var h,p;if(s==="keep"?(h=l[0].getIdentifier(),p=i.getIdentifier()):(h=l[0].getContent().getIdentifier(),p=i.getContent().getIdentifier()),Jr[c][p].latexLeftParens===!1){d=[!1];break}if(Jr[m][h].latexParens===!1){d=[!1];break}}if(m===null){d=[!1];break}if(m<=c){d=[!0];break}d=[!1]}break;case 2:{var g,v=At(l[0],s,u,i),D=Nl(i,l[0],s);v===null?g=!1:v===c&&f==="right"&&!D||v<c?g=!0:g=!1;var y,x=At(l[1],s,u,i),w=Nl(i,l[1],s);if(x===null?y=!1:x===c&&f==="left"&&!w||x<c?y=!0:y=!1,o){var b,A,S;s==="keep"?(b=i.getIdentifier(),A=i.args[0].getIdentifier(),S=i.args[1].getIdentifier()):(b=i.getContent().getIdentifier(),A=i.args[0].getContent().getIdentifier(),S=i.args[1].getContent().getIdentifier()),v!==null&&(Jr[c][b].latexLeftParens===!1&&(g=!1),Jr[v][A].latexParens===!1&&(g=!1)),x!==null&&(Jr[c][b].latexRightParens===!1&&(y=!1),Jr[x][S].latexParens===!1&&(y=!1))}d=[g,y]}break;default:(i.getIdentifier()==="OperatorNode:add"||i.getIdentifier()==="OperatorNode:multiply")&&(d=l.map(function(N){var _=At(N,s,u,i),C=Nl(i,N,s),O=$i(N,s);return _===null?!1:c===_&&f===O&&!C?!0:_<c}));break}if(l.length>=2&&i.getIdentifier()==="OperatorNode:multiply"&&i.implicit&&s!=="all"&&u==="hide")for(var E=1;E<d.length;++E)r(l[E],s)&&!d[E-1]&&(s!=="keep"||!nn(l[E-1]))&&(d[E]=!0);return d}class a extends e{constructor(s,u,l,o,c){if(super(),typeof s!="string")throw new TypeError('string expected for parameter "op"');if(typeof u!="string")throw new TypeError('string expected for parameter "fn"');if(!Array.isArray(l)||!l.every(xt))throw new TypeError('Array containing Nodes expected for parameter "args"');this.implicit=o===!0,this.isPercentage=c===!0,this.op=s,this.fn=u,this.args=l||[]}get type(){return xo}get isOperatorNode(){return!0}_compile(s,u){if(typeof this.fn!="string"||!Ru(s,this.fn))throw s[this.fn]?new Error('No access to function "'+this.fn+'"'):new Error("Function "+this.fn+' missing in provided namespace "math"');var l=hr(s,this.fn),o=zn(this.args,function(h){return h._compile(s,u)});if(typeof l=="function"&&l.rawArgs===!0){var c=this.args;return function(p,g,v){return l(c,s,Pi(p,g))}}else if(o.length===1){var f=o[0];return function(p,g,v){return l(f(p,g,v))}}else if(o.length===2){var d=o[0],m=o[1];return function(p,g,v){return l(d(p,g,v),m(p,g,v))}}else return function(p,g,v){return l.apply(null,zn(o,function(D){return D(p,g,v)}))}}forEach(s){for(var u=0;u<this.args.length;u++)s(this.args[u],"args["+u+"]",this)}map(s){for(var u=[],l=0;l<this.args.length;l++)u[l]=this._ifNode(s(this.args[l],"args["+l+"]",this));return new a(this.op,this.fn,u,this.implicit,this.isPercentage)}clone(){return new a(this.op,this.fn,this.args.slice(0),this.implicit,this.isPercentage)}isUnary(){return this.args.length===1}isBinary(){return this.args.length===2}_toString(s){var u=s&&s.parenthesis?s.parenthesis:"keep",l=s&&s.implicit?s.implicit:"hide",o=this.args,c=n(this,u,l,o,!1);if(o.length===1){var f=$i(this,u),d=o[0].toString(s);c[0]&&(d="("+d+")");var m=/[a-zA-Z]+/.test(this.op);return f==="right"?this.op+(m?" ":"")+d:f==="left"?d+(m?" ":"")+this.op:d+this.op}else if(o.length===2){var h=o[0].toString(s),p=o[1].toString(s);return c[0]&&(h="("+h+")"),c[1]&&(p="("+p+")"),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&l==="hide"?h+" "+p:h+" "+this.op+" "+p}else if(o.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var g=o.map(function(v,D){return v=v.toString(s),c[D]&&(v="("+v+")"),v});return this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&l==="hide"?g.join(" "):g.join(" "+this.op+" ")}else return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:xo,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(s){return new a(s.op,s.fn,s.args,s.implicit,s.isPercentage)}_toHTML(s){var u=s&&s.parenthesis?s.parenthesis:"keep",l=s&&s.implicit?s.implicit:"hide",o=this.args,c=n(this,u,l,o,!1);if(o.length===1){var f=$i(this,u),d=o[0].toHTML(s);return c[0]&&(d='<span class="math-parenthesis math-round-parenthesis">(</span>'+d+'<span class="math-parenthesis math-round-parenthesis">)</span>'),f==="right"?'<span class="math-operator math-unary-operator math-lefthand-unary-operator">'+Rr(this.op)+"</span>"+d:d+'<span class="math-operator math-unary-operator math-righthand-unary-operator">'+Rr(this.op)+"</span>"}else if(o.length===2){var m=o[0].toHTML(s),h=o[1].toHTML(s);return c[0]&&(m='<span class="math-parenthesis math-round-parenthesis">(</span>'+m+'<span class="math-parenthesis math-round-parenthesis">)</span>'),c[1]&&(h='<span class="math-parenthesis math-round-parenthesis">(</span>'+h+'<span class="math-parenthesis math-round-parenthesis">)</span>'),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&l==="hide"?m+'<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'+h:m+'<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Rr(this.op)+"</span>"+h}else{var p=o.map(function(g,v){return g=g.toHTML(s),c[v]&&(g='<span class="math-parenthesis math-round-parenthesis">(</span>'+g+'<span class="math-parenthesis math-round-parenthesis">)</span>'),g});return o.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")?this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&l==="hide"?p.join('<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'):p.join('<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Rr(this.op)+"</span>"):'<span class="math-function">'+Rr(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+p.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'}}_toTex(s){var u=s&&s.parenthesis?s.parenthesis:"keep",l=s&&s.implicit?s.implicit:"hide",o=this.args,c=n(this,u,l,o,!0),f=vt[this.fn];if(f=typeof f>"u"?this.op:f,o.length===1){var d=$i(this,u),m=o[0].toTex(s);return c[0]&&(m="\\left(".concat(m,"\\right)")),d==="right"?f+m:m+f}else if(o.length===2){var h=o[0],p=h.toTex(s);c[0]&&(p="\\left(".concat(p,"\\right)"));var g=o[1],v=g.toTex(s);c[1]&&(v="\\left(".concat(v,"\\right)"));var D;switch(u==="keep"?D=h.getIdentifier():D=h.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return f+"{"+p+"}{"+v+"}";case"OperatorNode:pow":switch(p="{"+p+"}",v="{"+v+"}",D){case"ConditionalNode":case"OperatorNode:divide":p="\\left(".concat(p,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&l==="hide")return p+"~"+v}return p+f+v}else if(o.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var y=o.map(function(x,w){return x=x.toTex(s),c[w]&&(x="\\left(".concat(x,"\\right)")),x});return this.getIdentifier()==="OperatorNode:multiply"&&this.implicit&&l==="hide"?y.join("~"):y.join(f)}else return"\\mathrm{"+this.fn+"}\\left("+o.map(function(x){return x.toTex(s)}).join(",")+"\\right)"}getIdentifier(){return this.type+":"+this.fn}}return Yt(a,"name",xo),a},{isClass:!0,isNode:!0}),Do="ParenthesisNode",u3=["Node"],l3=U(Do,u3,t=>{var{Node:e}=t;class r extends e{constructor(a){if(super(),!xt(a))throw new TypeError('Node expected for parameter "content"');this.content=a}get type(){return Do}get isParenthesisNode(){return!0}_compile(a,i){return this.content._compile(a,i)}getContent(){return this.content.getContent()}forEach(a){a(this.content,"content",this)}map(a){var i=a(this.content,"content",this);return new r(i)}clone(){return new r(this.content)}_toString(a){return!a||a&&!a.parenthesis||a&&a.parenthesis==="keep"?"("+this.content.toString(a)+")":this.content.toString(a)}toJSON(){return{mathjs:Do,content:this.content}}static fromJSON(a){return new r(a.content)}_toHTML(a){return!a||a&&!a.parenthesis||a&&a.parenthesis==="keep"?'<span class="math-parenthesis math-round-parenthesis">(</span>'+this.content.toHTML(a)+'<span class="math-parenthesis math-round-parenthesis">)</span>':this.content.toHTML(a)}_toTex(a){return!a||a&&!a.parenthesis||a&&a.parenthesis==="keep"?"\\left(".concat(this.content.toTex(a),"\\right)"):this.content.toTex(a)}}return Yt(r,"name",Do),r},{isClass:!0,isNode:!0}),Eo="RangeNode",c3=["Node"],f3=U(Eo,c3,t=>{var{Node:e}=t;function r(a,i,s){var u=At(a,i,s),l={},o=At(a.start,i,s);if(l.start=o!==null&&o<=u||i==="all",a.step){var c=At(a.step,i,s);l.step=c!==null&&c<=u||i==="all"}var f=At(a.end,i,s);return l.end=f!==null&&f<=u||i==="all",l}class n extends e{constructor(i,s,u){if(super(),!xt(i))throw new TypeError("Node expected");if(!xt(s))throw new TypeError("Node expected");if(u&&!xt(u))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=i,this.end=s,this.step=u||null}get type(){return Eo}get isRangeNode(){return!0}needsEnd(){var i=this.filter(function(s){return Ht(s)&&s.name==="end"});return i.length>0}_compile(i,s){var u=i.range,l=this.start._compile(i,s),o=this.end._compile(i,s);if(this.step){var c=this.step._compile(i,s);return function(d,m,h){return u(l(d,m,h),o(d,m,h),c(d,m,h))}}else return function(d,m,h){return u(l(d,m,h),o(d,m,h))}}forEach(i){i(this.start,"start",this),i(this.end,"end",this),this.step&&i(this.step,"step",this)}map(i){return new n(this._ifNode(i(this.start,"start",this)),this._ifNode(i(this.end,"end",this)),this.step&&this._ifNode(i(this.step,"step",this)))}clone(){return new n(this.start,this.end,this.step&&this.step)}_toString(i){var s=i&&i.parenthesis?i.parenthesis:"keep",u=r(this,s,i&&i.implicit),l,o=this.start.toString(i);if(u.start&&(o="("+o+")"),l=o,this.step){var c=this.step.toString(i);u.step&&(c="("+c+")"),l+=":"+c}var f=this.end.toString(i);return u.end&&(f="("+f+")"),l+=":"+f,l}toJSON(){return{mathjs:Eo,start:this.start,end:this.end,step:this.step}}static fromJSON(i){return new n(i.start,i.end,i.step)}_toHTML(i){var s=i&&i.parenthesis?i.parenthesis:"keep",u=r(this,s,i&&i.implicit),l,o=this.start.toHTML(i);if(u.start&&(o='<span class="math-parenthesis math-round-parenthesis">(</span>'+o+'<span class="math-parenthesis math-round-parenthesis">)</span>'),l=o,this.step){var c=this.step.toHTML(i);u.step&&(c='<span class="math-parenthesis math-round-parenthesis">(</span>'+c+'<span class="math-parenthesis math-round-parenthesis">)</span>
26'),l+='<span class="math-operator math-range-operator">:</span>'+c}var f=this.end.toHTML(i);return u.end&&(f='<span class="math-parenthesis math-round-parenthesis">(</span>'+f+'<span class="math-parenthesis math-round-parenthesis">)</span>'),l+='<span class="math-operator math-range-operator">:</span>'+f,l}_toTex(i){var s=i&&i.parenthesis?i.parenthesis:"keep",u=r(this,s,i&&i.implicit),l=this.start.toTex(i);if(u.start&&(l="\\left(".concat(l,"\\right)")),this.step){var o=this.step.toTex(i);u.step&&(o="\\left(".concat(o,"\\right)")),l+=":"+o}var c=this.end.toTex(i);return u.end&&(c="\\left(".concat(c,"\\right)")),l+=":"+c,l}}return Yt(n,"name",Eo),n},{isClass:!0,isNode:!0}),Ao="RelationalNode",d3=["Node"],m3=U(Ao,d3,t=>{var{Node:e}=t,r={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class n extends e{constructor(i,s){if(super(),!Array.isArray(i))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(s))throw new TypeError("Parameter params must be an array");if(i.length!==s.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=i,this.params=s}get type(){return Ao}get isRelationalNode(){return!0}_compile(i,s){var u=this,l=this.params.map(o=>o._compile(i,s));return function(c,f,d){for(var m,h=l[0](c,f,d),p=0;p<u.conditionals.length;p++){m=h,h=l[p+1](c,f,d);var g=hr(i,u.conditionals[p]);if(!g(m,h))return!1}return!0}}forEach(i){this.params.forEach((s,u)=>i(s,"params["+u+"]",this),this)}map(i){return new n(this.conditionals.slice(),this.params.map((s,u)=>this._ifNode(i(s,"params["+u+"]",this)),this))}clone(){return new n(this.conditionals,this.params)}_toString(i){for(var s=i&&i.parenthesis?i.parenthesis:"keep",u=At(this,s,i&&i.implicit),l=this.params.map(function(f,d){var m=At(f,s,i&&i.implicit);return s==="all"||m!==null&&m<=u?"("+f.toString(i)+")":f.toString(i)}),o=l[0],c=0;c<this.conditionals.length;c++)o+=" "+r[this.conditionals[c]],o+=" "+l[c+1];return o}toJSON(){return{mathjs:Ao,conditionals:this.conditionals,params:this.params}}static fromJSON(i){return new n(i.conditionals,i.params)}_toHTML(i){for(var s=i&&i.parenthesis?i.parenthesis:"keep",u=At(this,s,i&&i.implicit),l=this.params.map(function(f,d){var m=At(f,s,i&&i.implicit);return s==="all"||m!==null&&m<=u?'<span class="math-parenthesis math-round-parenthesis">(</span>'+f.toHTML(i)+'<span class="math-parenthesis math-round-parenthesis">)</span>':f.toHTML(i)}),o=l[0],c=0;c<this.conditionals.length;c++)o+='<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Rr(r[this.conditionals[c]])+"</span>"+l[c+1];return o}_toTex(i){for(var s=i&&i.parenthesis?i.parenthesis:"keep",u=At(this,s,i&&i.implicit),l=this.params.map(function(f,d){var m=At(f,s,i&&i.implicit);return s==="all"||m!==null&&m<=u?"\\left("+f.toTex(i)+"\right)":f.toTex(i)}),o=l[0],c=0;c<this.conditionals.length;c++)o+=vt[this.conditionals[c]]+l[c+1];return o}}return Yt(n,"name",Ao),n},{isClass:!0,isNode:!0}),h3="SymbolNode",p3=["math","?Unit","Node"],v3=U(h3,p3,t=>{var{math:e,Unit:r,Node:n}=t;function a(s){return r?r.isValuelessUnit(s):!1}class i extends n{constructor(u){if(super(),typeof u!="string")throw new TypeError('String expected for parameter "name"');this.name=u}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(u,l){var o=this.name;if(l[o]===!0)return function(f,d,m){return hr(d,o)};if(o in u)return function(f,d,m){return f.has(o)?f.get(o):hr(u,o)};var c=a(o);return function(f,d,m){return f.has(o)?f.get(o):c?new r(null,o):i.onUndefinedSymbol(o)}}forEach(u){}map(u){return this.clone()}static onUndefinedSymbol(u){throw new Error("Undefined symbol "+u)}clone(){return new i(this.name)}_toString(u){return this.name}_toHTML(u){var l=Rr(this.name);return l==="true"||l==="false"?'<span class="math-symbol math-boolean">'+l+"</span>":l==="i"?'<span class="math-symbol math-imaginary-symbol">'+l+"</span>":l==="Infinity"?'<span class="math-symbol math-infinity-symbol">'+l+"</span>":l==="NaN"?'<span class="math-symbol math-nan-symbol">'+l+"</span>":l==="null"?'<span class="math-symbol math-null-symbol">'+l+"</span>":l==="undefined"?'<span class="math-symbol math-undefined-symbol">'+l+"</span>":'<span class="math-symbol">'+l+"</span>"}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(u){return new i(u.name)}_toTex(u){var l=!1;typeof e[this.name]>"u"&&a(this.name)&&(l=!0);var o=eg(this.name,l);return o[0]==="\\"?o:" "+o}}return i},{isClass:!0,isNode:!0}),So="FunctionNode",g3=["math","Node","SymbolNode"],y3=U(So,g3,t=>{var e,{math:r,Node:n,SymbolNode:a}=t,i=l=>ot(l,{truncate:78});function s(l,o,c){for(var f="",d=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,m=0,h;(h=d.exec(l))!==null;)if(f+=l.substring(m,h.index),m=h.index,h[0]==="$$")f+="$",m++;else{m+=h[0].length;var p=o[h[1]];if(!p)throw new ReferenceError("Template: Property "+h[1]+" does not exist.");if(h[2]===void 0)switch(typeof p){case"string":f+=p;break;case"object":if(xt(p))f+=p.toTex(c);else if(Array.isArray(p))f+=p.map(function(g,v){if(xt(g))return g.toTex(c);throw new TypeError("Template: "+h[1]+"["+v+"] is not a Node.")}).join(",");else throw new TypeError("Template: "+h[1]+" has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: "+h[1]+" has to be a Node, String or array of Nodes")}else if(xt(p[h[2]]&&p[h[2]]))f+=p[h[2]].toTex(c);else throw new TypeError("Template: "+h[1]+"["+h[2]+"] is not a Node.")}return f+=l.slice(m),f}
vendor: 17,092 bytes, lines 26-36
26class u extends n{constructor(o,c){if(super(),typeof o=="string"&&(o=new a(o)),!xt(o))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(c)||!c.every(xt))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=o,this.args=c||[]}get name(){return this.fn.name||""}get type(){return So}get isFunctionNode(){return!0}_compile(o,c){var f=this.args.map(S=>S._compile(o,c));if(Ht(this.fn)){var d=this.fn.name;if(c[d]){var v=this.args;return function(E,N,_){var C=hr(N,d);if(typeof C!="function")throw new TypeError("Argument '".concat(d,"' was not a function; received: ").concat(i(C)));if(C.rawArgs)return C(v,o,Pi(E,N));var O=f.map(I=>I(E,N,_));return C.apply(C,O)}}else{var m=d in o?hr(o,d):void 0,h=typeof m=="function"&&m.rawArgs===!0,p=S=>{var E;if(S.has(d))E=S.get(d);else if(d in o)E=hr(o,d);else return u.onUndefinedFunction(d);if(typeof E=="function")return E;throw new TypeError("'".concat(d,`' is not a function; its value is: 27 `).concat(i(E)))};if(h){var g=this.args;return function(E,N,_){var C=p(E);if(C.rawArgs===!0)return C(g,o,Pi(E,N));var O=f.map(I=>I(E,N,_));return C(...O)}}else switch(f.length){case 0:return function(E,N,_){var C=p(E);return C()};case 1:return function(E,N,_){var C=p(E),O=f[0];return C(O(E,N,_))};case 2:return function(E,N,_){var C=p(E),O=f[0],I=f[1];return C(O(E,N,_),I(E,N,_))};default:return function(E,N,_){var C=p(E),O=f.map(I=>I(E,N,_));return C(...O)}}}}else if(Bn(this.fn)&&na(this.fn.index)&&this.fn.index.isObjectProperty()){var D=this.fn.object._compile(o,c),y=this.fn.index.getObjectProperty(),x=this.args;return function(E,N,_){var C=D(E,N,_),O=Kx(C,y);if(O!=null&&O.rawArgs)return O(x,o,Pi(E,N));var I=f.map(k=>k(E,N,_));return O.apply(C,I)}}else{var w=this.fn.toString(),b=this.fn._compile(o,c),A=this.args;return function(E,N,_){var C=b(E,N,_);if(typeof C!="function")throw new TypeError("Expression '".concat(w,"' did not evaluate to a function; value is:")+` 28 `.concat(i(C)));if(C.rawArgs)return C(A,o,Pi(E,N));var O=f.map(I=>I(E,N,_));return C.apply(C,O)}}}forEach(o){o(this.fn,"fn",this);for(var c=0;c<this.args.length;c++)o(this.args[c],"args["+c+"]",this)}map(o){for(var c=this._ifNode(o(this.fn,"fn",this)),f=[],d=0;d<this.args.length;d++)f[d]=this._ifNode(o(this.args[d],"args["+d+"]",this));return new u(c,f)}clone(){return new u(this.fn,this.args.slice(0))}toString(o){var c,f=this.fn.toString(o);return o&&typeof o.handler=="object"&&ke(o.handler,f)&&(c=o.handler[f](this,o)),typeof c<"u"?c:super.toString(o)}_toString(o){var c=this.args.map(function(d){return d.toString(o)}),f=Oa(this.fn)?"("+this.fn.toString(o)+")":this.fn.toString(o);return f+"("+c.join(", ")+")"}toJSON(){return{mathjs:So,fn:this.fn,args:this.args}}_toHTML(o){var c=this.args.map(function(f){return f.toHTML(o)});return'<span class="math-function">'+Rr(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+c.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'}toTex(o){var c;return o&&typeof o.handler=="object"&&ke(o.handler,this.name)&&(c=o.handler[this.name](this,o)),typeof c<"u"?c:super.toTex(o)}_toTex(o){var c=this.args.map(function(m){return m.toTex(o)}),f;Qv[this.name]&&(f=Qv[this.name]),r[this.name]&&(typeof r[this.name].toTex=="function"||typeof r[this.name].toTex=="object"||typeof r[this.name].toTex=="string")&&(f=r[this.name].toTex);var d;switch(typeof f){case"function":d=f(this,o);break;case"string":d=s(f,this,o);break;case"object":switch(typeof f[c.length]){case"function":d=f[c.length](this,o);break;case"string":d=s(f[c.length],this,o);break}}return typeof d<"u"?d:s(JF,this,o)}getIdentifier(){return this.type+":"+this.name}}return e=u,Yt(u,"name",So),Yt(u,"onUndefinedFunction",function(l){throw new Error("Undefined function "+l)}),Yt(u,"fromJSON",function(l){return new e(l.fn,l.args)}),u},{isClass:!0,isNode:!0}),tg="parse",b3=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],w3=U(tg,b3,t=>{var{typed:e,numeric:r,config:n,AccessorNode:a,ArrayNode:i,AssignmentNode:s,BlockNode:u,ConditionalNode:l,ConstantNode:o,FunctionAssignmentNode:c,FunctionNode:f,IndexNode:d,ObjectNode:m,OperatorNode:h,ParenthesisNode:p,RangeNode:g,RelationalNode:v,SymbolNode:D}=t,y=e(tg,{string:function(Q){return te(Q,{})},"Array | Matrix":function(Q){return x(Q,{})},"string, Object":function(Q,de){var be=de.nodes!==void 0?de.nodes:{};return te(Q,be)},"Array | Matrix, Object":x});function x(T){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},de=Q.nodes!==void 0?Q.nodes:{};return nt(T,function(be){if(typeof be!="string")throw new TypeError("String expected");return te(be,de)})}var w={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},b={",":!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,">>>":!0},A={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},S={true:!0,false:!1,null:null,undefined:void 0},E=["NaN","Infinity"],N={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:` 29`,r:"\r",t:" "};function _(){return{extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:w.NULL,nestingLevel:0,conditionalLevel:null}}function C(T,Q){return T.expression.substr(T.index,Q)}function O(T){return C(T,1)}function I(T){T.index++}function k(T){return T.expression.charAt(T.index-1)}function M(T){return T.expression.charAt(T.index+1)}function H(T){for(T.tokenType=w.NULL,T.token="",T.comment="";;){if(O(T)==="#")for(;O(T)!==` 30`&&O(T)!=="";)T.comment+=O(T),I(T);if(y.isWhitespace(O(T),T.nestingLevel))I(T);else break}if(O(T)===""){T.tokenType=w.DELIMITER;return}if(O(T)===` 31`&&!T.nestingLevel){T.tokenType=w.DELIMITER,T.token=O(T),I(T);return}var Q=O(T),de=C(T,2),be=C(T,3);if(be.length===3&&b[be]){T.tokenType=w.DELIMITER,T.token=be,I(T),I(T),I(T);return}if(de.length===2&&b[de]){T.tokenType=w.DELIMITER,T.token=de,I(T),I(T);return}if(b[Q]){T.tokenType=w.DELIMITER,T.token=Q,I(T);return}if(y.isDigitDot(Q)){T.tokenType=w.NUMBER;var Ze=C(T,2);if(Ze==="0b"||Ze==="0o"||Ze==="0x"){for(T.token+=O(T),I(T),T.token+=O(T),I(T);y.isAlpha(O(T),k(T),M(T))||y.isDigit(O(T));)T.token+=O(T),I(T);if(O(T)===".")for(T.token+=".",I(T);y.isAlpha(O(T),k(T),M(T))||y.isDigit(O(T));)T.token+=O(T),I(T);else if(O(T)==="i")for(T.token+="i",I(T);y.isDigit(O(T));)T.token+=O(T),I(T);return}if(O(T)==="."){if(T.token+=O(T),I(T),!y.isDigit(O(T))){T.tokenType=w.DELIMITER;return}}else{for(;y.isDigit(O(T));)T.token+=O(T),I(T);y.isDecimalMark(O(T),M(T))&&(T.token+=O(T),I(T))}for(;y.isDigit(O(T));)T.token+=O(T),I(T);if(O(T)==="E"||O(T)==="e"){if(y.isDigit(M(T))||M(T)==="-"||M(T)==="+"){if(T.token+=O(T),I(T),(O(T)==="+"||O(T)==="-")&&(T.token+=O(T),I(T)),!y.isDigit(O(T)))throw Je(T,'Digit expected, got "'+O(T)+'"');for(;y.isDigit(O(T));)T.token+=O(T),I(T);if(y.isDecimalMark(O(T),M(T)))throw Je(T,'Digit expected, got "'+O(T)+'"')}else if(y.isDecimalMark(M(T),T.expression.charAt(T.index+2)))throw I(T),Je(T,'Digit expected, got "'+O(T)+'"')}return}if(y.isAlpha(O(T),k(T),M(T))){for(;y.isAlpha(O(T),k(T),M(T))||y.isDigit(O(T));)T.token+=O(T),I(T);ke(A,T.token)?T.tokenType=w.DELIMITER:T.tokenType=w.SYMBOL;return}for(T.tokenType=w.UNKNOWN;O(T)!=="";)T.token+=O(T),I(T);throw Je(T,'Syntax error in part "'+T.token+'"')}function q(T){do H(T);while(T.token===` 32`)}function z(T){T.nestingLevel++}function X(T){T.nestingLevel--}y.isAlpha=function(Q,de,be){return y.isValidLatinOrGreek(Q)||y.isValidMathSymbol(Q,be)||y.isValidMathSymbol(de,Q)},y.isValidLatinOrGreek=function(Q){return/^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(Q)},y.isValidMathSymbol=function(Q,de){return/^[\uD835]$/.test(Q)&&/^[\uDC00-\uDFFF]$/.test(de)&&/^[^\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(de)},y.isWhitespace=function(Q,de){return Q===" "||Q===" "||Q==="Â "||Q===` 33`&&de>0},y.isDecimalMark=function(Q,de){return Q==="."&&de!=="/"&&de!=="*"&&de!=="^"},y.isDigitDot=function(Q){return Q>="0"&&Q<="9"||Q==="."},y.isDigit=function(Q){return Q>="0"&&Q<="9"};function te(T,Q){var de=_();jt(de,{expression:T,extraNodes:Q}),H(de);var be=B(de);if(de.token!=="")throw de.tokenType===w.DELIMITER?Ft(de,"Unexpected operator "+de.token):Je(de,'Unexpected part "'+de.token+'"');return be}function B(T){var Q,de=[],be;for(T.token!==""&&T.token!==` 34`&&T.token!==";"&&(Q=j(T),T.comment&&(Q.comment=T.comment));T.token===` 35`||T.token===";";)de.length===0&&Q&&(be=T.token!==";",de.push({node:Q,visible:be})),H(T),T.token!==` 36`&&T.token!==";"&&T.token!==""&&(Q=j(T),T.comment&&(Q.comment=T.comment),be=T.token!==";",de.push({node:Q,visible:be}));return de.length>0?new u(de):(Q||(Q=new o(void 0),T.comment&&(Q.comment=T.comment)),Q)}function j(T){var Q,de,be,Ze,it=R(T);if(T.token==="="){if(Ht(it))return Q=it.name,q(T),be=j(T),new s(new D(Q),be);if(Bn(it))return q(T),be=j(T),new s(it.object,it.index,be);if(bn(it)&&Ht(it.fn)&&(Ze=!0,de=[],Q=it.name,it.args.forEach(function(V,F){Ht(V)?de[F]=V.name:Ze=!1}),Ze))return q(T),be=j(T),new c(Q,de,be);throw Je(T,"Invalid left hand side of assignment operator =")}return it}function R(T){for(var Q=oe(T);T.token==="?";){var de=T.conditionalLevel;T.conditionalLevel=T.nestingLevel,q(T);var be=Q,Ze=j(T);if(T.token!==":")throw Je(T,"False part of conditional expression expected");T.conditionalLevel=null,q(T);var it=j(T);Q=new l(be,Ze,it),T.conditionalLevel=de}return Q}function oe(T){for(var Q=se(T);T.token==="or";)q(T),Q=new h("or","or",[Q,se(T)]);return Q}function se(T){for(var Q=le(T);T.token==="xor";)q(T),Q=new h("xor","xor",[Q,le(T)]);return Q}function le(T){for(var Q=P(T);T.token==="and";)q(T),Q=new h("and","and",[Q,P(T)]);return Q}function P(T){for(var Q=W(T);T.token==="|";)q(T),Q=new h("|","bitOr",[Q,W(T)]);return Q}function W(T){for(var Q=J(T);T.token==="^|";)q(T),Q=new h("^|","bitXor",[Q,J(T)]);return Q}function J(T){for(var Q=re(T);T.token==="&";)q(T),Q=new h("&","bitAnd",[Q,re(T)]);return Q}function re(T){for(var Q=[ae(T)],de=[],be={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};ke(be,T.token);){var Ze={name:T.token,fn:be[T.token]};de.push(Ze),q(T),Q.push(ae(T))}return Q.length===1?Q[0]:Q.length===2?new h(de[0].name,de[0].fn,Q):new v(de.map(it=>it.fn),Q)}function ae(T){var Q,de,be,Ze;Q=he(T);for(var it={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};ke(it,T.token);)de=T.token,be=it[de],q(T),Ze=[Q,he(T)],Q=new h(de,be,Ze);return Q}function he(T){var Q,de,be,Ze;Q=fe(T);for(var it={to:"to",in:"to"};ke(it,T.token);)de=T.token,be=it[de],q(T),de==="in"&&"])},;".includes(T.token)?Q=new h("*","multiply",[Q,new D("in")],!0):(Ze=[Q,fe(T)],Q=new h(de,be,Ze));return Q}function fe(T){var Q,de=[];if(T.token===":"?Q=new o(1):Q=De(T),T.token===":"&&T.conditionalLevel!==T.nestingLevel){for(de.push(Q);T.token===":"&&de.length<3;)q(T),T.token===")"||T.token==="]"||T.token===","||T.token===""?de.push(new D("end")):de.push(De(T));de.length===3?Q=new g(de[0],de[2],de[1]):Q=new g(de[0],de[1])}return Q}function De(T){var Q,de,be,Ze;Q=Te(T);for(var it={"+":"add","-":"subtract"};ke(it,T.token);){de=T.token,be=it[de],q(T);var V=Te(T);V.isPercentage?Ze=[Q,new h("*","multiply",[Q,V])]:Ze=[Q,V],Q=new h(de,be,Ze)}return Q}function Te(T){var Q,de,be,Ze;Q=Ie(T),de=Q;for(var it={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide","%":"mod",mod:"mod"};ke(it,T.token);)be=T.token,Ze=it[be],q(T),de=Ie(T),Q=new h(be,Ze,[Q,de]);return Q}function Ie(T){var Q,de;for(Q=Me(T),de=Q;T.tokenType===w.SYMBOL||T.token==="in"&&dt(Q)||T.token==="in"&&Pt(Q)&&Q.fn==="unaryMinus"&&dt(Q.args[0])||T.tokenType===w.NUMBER&&!dt(de)&&(!Pt(de)||de.op==="!")||T.token==="(";)de=Me(T),Q=new h("*","multiply",[Q,de],!0);return Q}function Me(T){for(var Q=Le(T),de=Q,be=[];T.token==="/"&&qu(de);)if(be.push(jt({},T)),q(T),T.tokenType===w.NUMBER)if(be.push(jt({},T)),q(T),T.tokenType===w.SYMBOL||T.token==="("||T.token==="in")jt(T,be.pop()),be.pop(),de=Le(T),Q=new h("/","divide",[Q,de]);else{be.pop(),jt(T,be.pop());break}else{jt(T,be.pop());break}return Q}function Le(T){var Q=Y(T);if(T.token==="%"){var de=jt({},T);q(T);try{Y(T),jt(T,de)}catch{Q=new h("/","divide",[Q,new o(100)],!1,!0)}}return Q}function Y(T){var Q,de,be,Ze={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return ke(Ze,T.token)?(be=Ze[T.token],Q=T.token,q(T),de=[Y(T)],new h(Q,be,de)):ee(T)}function ee(T){var Q,de,be,Ze;return Q=ue(T),(T.token==="^"||T.token===".^")&&(de=T.token,be=de==="^"?"pow":"dotPow",q(T),Ze=[Q,Y(T)],Q=new h(de,be,Ze)),Q}function ue(T){for(var Q=L(T);T.token==="??";)q(T),Q=new h("??","nullish",[Q,L(T)]);return Q}function L(T){var Q,de,be,Ze;Q=Z(T);for(var it={"!":"factorial","'":"ctranspose"};ke(it,T.token);)de=T.token,be=it[de],H(T),Ze=[Q],Q=new h(de,be,Ze),Q=ne(T,Q);return Q}function Z(T){var Q=[];if(T.tokenType===w.SYMBOL&&ke(T.extraNodes,T.token)){var de=T.extraNodes[T.token];if(H(T),T.token==="("){if(Q=[],z(T),H(T),T.token!==")")for(Q.push(j(T));T.token===",";)H(T),Q.push(j(T));if(T.token!==")")throw Je(T,"Parenthesis ) expected");X(T),H(T)}return new de(Q)}return K(T)}function K(T){var Q,de;return T.tokenType===w.SYMBOL||T.tokenType===w.DELIMITER&&T.token in A?(de=T.token,H(T),ke(S,de)?Q=new o(S[de]):E.includes(de)?Q=new o(r(de,"number")):Q=new D(de),Q=ne(T,Q),Q):ce(T)}function ne(T,Q,de){for(var be;T.token==="("||T.token==="["||T.token===".";)if(be=[],T.token==="(")if(Ht(Q)||Bn(Q)){if(z(T),H(T),T.token!==")")for(be.push(j(T));T.token===",";)H(T),be.push(j(T));if(T.token!==")")throw Je(T,"Parenthesis ) expected");X(T),H(T),Q=new f(Q,be)}else return Q;else if(T.token==="["){if(z(T),H(T),T.token!=="]")for(be.push(j(T));T.token===",";)H(T),be.push(j(T));if(T.token!=="]")throw Je(T,"Parenthesis ] expected");X(T),H(T),Q=new a(Q,new d(be))}else{H(T);var Ze=T.tokenType===w.SYMBOL||T.tokenType===w.DELIMITER&&T.token in A;if(!Ze)throw Je(T,"Property name expected after dot");be.push(new o(T.token)),H(T);var it=!0;Q=new a(Q,new d(be,it))}return Q}function ce(T){var Q,de;return T.token==='"'||T.token==="'"?(de=pe(T,T.token),Q=new o(de),Q=ne(T,Q),Q):we(T)}function pe(T,Q){for(var de="";O(T)!==""&&O(T)!==Q;)if(O(T)==="\\"){I(T);var be=O(T),Ze=N[be];if(Ze!==void 0)de+=Ze,T.index+=1;else if(be==="u"){var it=T.expression.slice(T.index+1,T.index+5);if(/^[0-9A-Fa-f]{4}$/.test(it))de+=String.fromCharCode(parseInt(it,16)),T.index+=5;else throw Je(T,"Invalid unicode character \\u".concat(it))}else throw Je(T,"Bad escape character \\".concat(be))}else de+=O(T),I(T);if(H(T),T.token!==Q)throw Je(T,"End of string ".concat(Q," expected"));return H(T),de}function we(T){var Q,de,be,Ze;if(T.token==="["){if(z(T),H(T),T.token!=="]"){var it=xe(T);if(T.token===";"){for(be=1,de=[it];T.token===";";)H(T),T.token!=="]"&&(de[be]=xe(T),be++);if(T.token!=="]")throw Je(T,"End of matrix ] expected");X(T),H(T),Ze=de[0].items.length;for(var V=1;V<be;V++)if(de[V].items.length!==Ze)throw Ft(T,"Column dimensions mismatch ("+de[V].items.length+" !== "+Ze+")");Q=new i(de)}else{if(T.token!=="]")throw Je(T,"End of matrix ] expected");X(T),H(T),Q=it}}else X(T),H(T),Q=new i([]);return ne(T,Q)}return Ne(T)}function xe(T){for(var Q=[j(T)],de=1;T.token===",";)H(T),T.token!=="]"&&T.token!==";"&&(Q[de]=j(T),de++);return new i(Q)}function Ne(T){if(T.token==="{"){z(T);var Q,de={};do if(H(T),T.token!=="}"){if(T.token==='"'||T.token==="'")Q=pe(T,T.token);else if(T.tokenType===w.SYMBOL||T.tokenType===w.DELIMITER&&T.token in A)Q=T.token,H(T);else throw Je(T,"Symbol or string expected as object key");if(T.token!==":")throw Je(T,"Colon : expected after object key");H(T),de[Q]=j(T)}while(T.token===",");if(T.token!=="}")throw Je(T,"Comma , or bracket } expected after object value");X(T),H(T);var be=new m(de);return be=ne(T,be),be}return Ee(T)}function Ee(T){var Q;if(T.tokenType===w.NUMBER){Q=T.token,H(T);var de=kn(Q,n),be=r(Q,de);return new o(be)}return st(T)}function st(T){var Q;if(T.token==="("){if(z(T),H(T),Q=j(T),T.token!==")")throw Je(T,"Parenthesis ) expected");return X(T),H(T),Q=new p(Q),Q=ne(T,Q),Q}return lt(T)}function lt(T){throw T.token===""?Je(T,"Unexpected end of expression"):Je(T,"Value expected")}function We(T){return T.index-T.token.length+1}function Je(T,Q){var de=We(T),be=new SyntaxError(Q+" (char "+de+")");return be.char=de,be}function Ft(T,Q){var de=We(T),be=new SyntaxError(Q+" (char "+de+")");return be.char=de,be}return e.addConversion({from:"string",to:"Node",convert:y}),y}),rg="compile",x3=["typed","parse"],D3=U(rg,x3,t=>{var{typed:e,parse:r}=t;return e(rg,{string:function(a){return r(a).compile()},"Array | Matrix":function(a){return nt(a,function(i){return r(i).compile()})}})}),ng="evaluate",E3=["typed","parse"],A3=U(ng,E3,t=>{var{typed:e,parse:r}=t;
36return e(ng,{string:function(a){var i=Ei();return r(a).compile().evaluate(i)},"string, Map | Object":function(a,i){return r(a).compile().evaluate(i)},"Array | Matrix":function(a){var i=Ei();return nt(a,function(s){return r(s).compile().evaluate(i)})},"Array | Matrix, Map | Object":function(a,i){return nt(a,function(s){return r(s).compile().evaluate(i)})}})}),S3="Parser",N3=["evaluate","parse"],_3=U(S3,N3,t=>{var{evaluate:e,parse:r}=t;function n(){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:Ei(),writable:!1})}n.prototype.type="Parser",n.prototype.isParser=!0,n.prototype.evaluate=function(i){return e(i,this.scope)},n.prototype.get=function(i){if(this.scope.has(i))return this.scope.get(i)},n.prototype.getAll=function(){return nD(this.scope)},n.prototype.getAllAsMap=function(){return this.scope};function a(i){if(i.length===0)return!1;for(var s=0;s<i.length;s++){var u=i.charAt(s-1),l=i.charAt(s),o=i.charAt(s+1),c=r.isAlpha(l,u,o)||s>0&&r.isDigit(l);if(!c)return!1}return!0}return n.prototype.set=function(i,s){if(!a(i))throw new Error("Invalid variable name: '".concat(i,"'. Variable names must follow the specified rules."));return this.scope.set(i,s),s},n.prototype.remove=function(i){this.scope.delete(i)},n.prototype.clear=function(){this.scope.clear()},n.prototype.toJSON=function(){var i={mathjs:"Parser",variables:{},functions:{}};for(var[s,u]of this.scope)if(Pu(u)){if(!C3(u))throw new Error("Cannot serialize external function ".concat(s));i.functions[s]="".concat(u.syntax," = ").concat(u.expr)}else i.variables[s]=u;return i},n.fromJSON=function(i){var s=new n;return Object.entries(i.variables).forEach(u=>{var[l,o]=u;return s.set(l,o)}),Object.entries(i.functions).forEach(u=>{var[l,o]=u;return s.evaluate(o)}),s},n},{isClass:!0});function C3(t){return typeof t=="function"&&typeof t.syntax=="string"&&typeof t.expr=="string"}var ag="parser",M3=["typed","Parser"],T3=U(ag,M3,t=>{var{typed:e,Parser:r}=t;return e(ag,{"":function(){return new r}})}),ig="lup",F3=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],O3=U(ig,F3,t=>{var{typed:e,matrix:r,abs:n,addScalar:a,divideScalar:i,multiplyScalar:s,subtractScalar:u,larger:l,equalScalar:o,unaryMinus:c,DenseMatrix:f,SparseMatrix:d,Spa:m}=t;return e(ig,{DenseMatrix:function(v){return h(v)},SparseMatrix:function(v){return p(v)},Array:function(v){var D=r(v),y=h(D);return{L:y.L.valueOf(),U:y.U.valueOf(),p:y.p}}});function h(g){var v=g._size[0],D=g._size[1],y=Math.min(v,D),x=je(g._data),w=[],b=[v,y],A=[],S=[y,D],E,N,_,C=[];for(E=0;E<v;E++)C[E]=E;for(N=0;N<D;N++){if(N>0)for(E=0;E<v;E++){var O=Math.min(E,N),I=0;for(_=0;_<O;_++)I=a(I,s(x[E][_],x[_][N]));x[E][N]=u(x[E][N],I)}var k=N,M=0,H=0;for(E=N;E<v;E++){var q=x[E][N],z=n(q);l(z,M)&&(k=E,M=z,H=q)}if(N!==k&&(C[N]=[C[k],C[k]=C[N]][0],f._swapRows(N,k,x)),N<v)for(E=N+1;E<v;E++){var X=x[E][N];o(X,0)||(x[E][N]=i(x[E][N],H))}}for(N=0;N<D;N++)for(E=0;E<v;E++){if(N===0&&(E<D&&(A[E]=[]),w[E]=[]),E<N){E<D&&(A[E][N]=x[E][N]),N<v&&(w[E][N]=0);continue}if(E===N){E<D&&(A[E][N]=x[E][N]),N<v&&(w[E][N]=1);continue}E<D&&(A[E][N]=0),N<v&&(w[E][N]=x[E][N])}var te=new f({data:w,size:b}),B=new f({data:A,size:S}),j=[];for(E=0,y=C.length;E<y;E++)j[C[E]]=E;return{L:te,U:B,p:j,toString:function(){return"L: "+this.L.toString()+` 37U: `+this.U.toString()+` 38P: `+this.p}}}function p(g){var v=g._size[0],D=g._size[1],y=Math.min(v,D),x=g._values,w=g._index,b=g._ptr,A=[],S=[],E=[],N=[v,y],_=[],C=[],O=[],I=[y,D],k,M,H,q=[],z=[];for(k=0;k<v;k++)q[k]=k,z[k]=k;var X=function(j,R){var oe=z[j],se=z[R];q[oe]=R,q[se]=j,z[j]=se,z[R]=oe},te=function(){var j=new m;M<v&&(E.push(A.length),A.push(1),S.push(M)),O.push(_.length);var R=b[M],oe=b[M+1];for(H=R;H<oe;H++)k=w[H],j.set(q[k],x[H]);M>0&&j.forEach(0,M-1,function(W,J){d._forEachRow(W,A,S,E,function(re,ae){re>W&&j.accumulate(re,c(s(ae,J)))})});var se=M,le=j.get(M),P=n(le);j.forEach(M+1,v-1,function(W,J){var re=n(J);l(re,P)&&(se=W,P=re,le=J)}),M!==se&&(d._swapRows(M,se,N[1],A,S,E),d._swapRows(M,se,I[1],_,C,O),j.swap(M,se),X(M,se)),j.forEac
vendor: 16,831 bytes, lines 38-64
38h(0,v-1,function(W,J){W<=M?(_.push(J),C.push(W)):(J=i(J,le),o(J,0)||(A.push(J),S.push(W)))})};for(M=0;M<D;M++)te();return O.push(_.length),E.push(A.length),{L:new d({values:A,index:S,ptr:E,size:N}),U:new d({values:_,index:C,ptr:O,size:I}),p:q,toString:function(){return"L: "+this.L.toString()+` 39U: `+this.U.toString()+` 40P: `+this.p}}}}),sg="qr",B3=["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtractScalar","complex"],k3=U(sg,B3,t=>{var{typed:e,matrix:r,zeros:n,identity:a,isZero:i,equal:s,sign:u,sqrt:l,conj:o,unaryMinus:c,addScalar:f,divideScalar:d,multiplyScalar:m,subtractScalar:h,complex:p}=t;return jt(e(sg,{DenseMatrix:function(x){return v(x)},SparseMatrix:function(x){return D()},Array:function(x){var w=r(x),b=v(w);return{Q:b.Q.valueOf(),R:b.R.valueOf()}}}),{_denseQRimpl:g});function g(y){var x=y._size[0],w=y._size[1],b=a([x],"dense"),A=b._data,S=y.clone(),E=S._data,N,_,C,O=n([x],"");for(C=0;C<Math.min(w,x);++C){var I=E[C][C],k=c(s(I,0)?1:u(I)),M=o(k),H=0;for(N=C;N<x;N++)H=f(H,m(E[N][C],o(E[N][C])));var q=m(k,l(H));if(!i(q)){var z=h(I,q);for(O[C]=1,N=C+1;N<x;N++)O[N]=d(E[N][C],z);var X=c(o(d(z,q))),te=void 0;for(_=C;_<w;_++){for(te=0,N=C;N<x;N++)te=f(te,m(o(O[N]),E[N][_]));for(te=m(te,X),N=C;N<x;N++)E[N][_]=m(h(E[N][_],m(O[N],te)),M)}for(N=0;N<x;N++){for(te=0,_=C;_<x;_++)te=f(te,m(A[N][_],O[_]));for(te=m(te,X),_=C;_<x;++_)A[N][_]=d(h(A[N][_],m(te,o(O[_]))),M)}}}return{Q:b,R:S,toString:function(){return"Q: "+this.Q.toString()+` 41R: `+this.R.toString()}}}function v(y){var x=g(y),w=x.R._data;if(y._data.length>0)for(var b=w[0][0].type==="Complex"?p(0):0,A=0;A<w.length;++A)for(var S=0;S<A&&S<(w[0]||[]).length;++S)w[A][S]=b;return x}function D(y){throw new Error("qr not implemented for sparse matrices yet")}});function I3(t,e,r,n){t._values;for(var a=t._index,i=t._ptr,s=t._size,u=t._datatype,l=s[0],o=s[1],c=null,f=[],d=[],m=0,h=0;h<o;h++){d[h]=m;for(var p=r?r[h]:h,g=i[p],v=i[p+1],D=g;D<v;D++){var y=a[D];f[m]=y,m++}}return d[o]=m,t.createSparseMatrix({values:c,index:f,ptr:d,size:[l,o],datatype:u})}function og(t,e,r,n,a,i,s){var u=0;for(r[s]=t;u>=0;){var l=r[s+u],o=r[n+l];o===-1?(u--,i[e++]=l):(r[n+l]=r[a+o],++u,r[s+u]=o)}return e}function L3(t,e){if(!t)return null;var r=0,n,a=[],i=[],s=0,u=e,l=2*e;for(n=0;n<e;n++)i[s+n]=-1;for(n=e-1;n>=0;n--)t[n]!==-1&&(i[u+n]=i[s+t[n]],i[s+t[n]]=n);for(n=0;n<e;n++)t[n]===-1&&(r=og(n,r,i,s,u,a,l));return a}function R3(t,e){if(!t)return null;var r=t._index,n=t._ptr,a=t._size,i=a[0],s=a[1],u=[],l=[],o=0,c=s,f,d;for(f=0;f<i;f++)l[c+f]=-1;for(var m=0;m<s;m++){u[m]=-1,l[o+m]=-1;for(var h=n[m],p=n[m+1],g=h;g<p;g++){var v=r[g];for(f=l[c+v];f!==-1&&f<m;f=d)d=l[o+f],l[o+f]=m,d===-1&&(u[f]=m);l[c+v]=m}}return u}function $3(t,e,r){for(var n=t._values,a=t._index,i=t._ptr,s=t._size,u=s[1],l=0,o=0;o<u;o++){var c=i[o];for(i[o]=l;c<i[o+1];c++)e(a[c],o,n?n[c]:1,r)&&(a[l]=a[c],n&&(n[l]=n[c]),l++)}return i[u]=l,a.splice(l,a.length-l),n&&n.splice(l,n.length-l),l}function Hn(t){return-t-2}var P3="csAmd",q3=["add","multiply","transpose"],U3=U(P3,q3,t=>{var{add:e,multiply:r,transpose:n}=t;return function(c,f){if(!f||c<=0||c>3)return null;var d=f._size,m=d[0],h=d[1],p=0,g=Math.max(16,10*Math.sqrt(h));g=Math.min(h-2,g);var v=a(c,f,m,h,g);$3(v,l,null);for(var D=v._index,y=v._ptr,x=y[h],w=[],b=[],A=0,S=h+1,E=2*(h+1),N=3*(h+1),_=4*(h+1),C=5*(h+1),O=6*(h+1),I=7*(h+1),k=w,M=i(h,y,b,A,N,k,E,I,S,O,_,C),H=s(h,y,b,C,_,O,g,S,N,k,E),q=0,z,X,te,B,j,R,oe,se,le,P,W,J,re,ae,he,fe;H<h;){for(te=-1;q<h&&(te=b[N+q])===-1;q++);b[E+te]!==-1&&(k[b[E+te]]=-1),b[N+q]=b[E+te];var De=b[_+te],Te=b[S+te];H+=Te;var Ie=0;b[S+te]=-Te;var Me=y[te],Le=De===0?Me:x,Y=Le;for(B=1;B<=De+1;B++){for(B>De?(R=te,oe=Me,se=b[A+te]-De):(R=D[Me++],oe=y[R],se=b[A+R]),j=1;j<=se;j++)z=D[oe++],!((le=b[S+z])<=0)&&(Ie+=le,b[S+z]=-le,D[Y++]=z,b[E+z]!==-1&&(k[b[E+z]]=k[z]),k[z]!==-1?b[E+k[z]]=b[E+z]:b[N+b[C+z]]=b[E+z]);R!==te&&(y[R]=Hn(te),b[O+R]=0)}for(De!==0&&(x=Y),b[C+te]=Ie,y[te]=Le,b[A+te]=Y-Le,b[_+te]=-2,M=u(M,p,b,O,h),P=Le;P<Y;P++)if(z=D[P],!((W=b[_+z])<=0)){le=-b[S+z];var ee=M-le;for(Me=y[z],J=y[z]+W-1;Me<=J;Me++)R=D[Me],b[O+R]>=M?b[O+R]-=le:b[O+R]!==0&&(b[O+R]=b[C+R]+ee)}for(P=Le;P<Y;P++){for(z=D[P],J=y[z],re=J+b[_+z]-1,ae=J,he=0,fe=0,Me=J;Me<=re;Me++)if(R=D[Me],b[O+R]!==0){var ue=b[O+R]-M;ue>0?(fe+=ue,D[ae++]=R,he+=R):(y[R]=Hn(te),b[O+R]=0)}b[_+z]=ae-J+1;var L=ae,Z=J+b[A+z];for(Me=re+1;Me<Z;Me++){X=D[Me];var K=b[S+X];K<=0||(fe+=K,D[ae++]=X,he+=X)}fe===0?(y[z]=Hn(te),le=-b[S+z],Ie-=le,Te+=le,H+=le,b[S+z]=0,b[_+z]=-1):(b[C+z]=Math.min(b[C+z],fe),D[ae]=D[L],D[L]=D[J],D[J]=te,b[A+z]=ae-J+1,he=(he<0?-he:he)%h,b[E+z]=b[I+he],b[I+he]=z,k[z]=he)}for(b[C+te]=Ie,p=Math.max(p,Ie),M=u(M+p,p,b,O,h),P=Le;P<Y;P++)if(z=D[P],!(b[S+z]>=0))for(he=k[z],z=b[I+he],b[I+he]=-1;z!==-1&&b[E+z]!==-1;z=b[E+z],M++){for(se=b[A+z],W=b[_+z],Me=y[z]+1;Me<=y[z]+se-1;Me++)b[O+D[Me]]=M;var ne=z;for(X=b[E+z];X!==-1;){var ce=b[A+X]===se&&b[_+X]===W;for(Me=y[X]+1;ce&&Me<=y[X]+se-1;Me++)b[O+D[Me]]!==M&&(ce=0);ce?(y[X]=Hn(z),b[S+z]+=b[S+X],b[S+X]=0,b[_+X]=-1,X=b[E+X],b[E+ne]=X):(ne=X,X=b[E+X])}}for(Me=Le,P=Le;P<Y;P++)z=D[P],!((le=-b[S+z])<=0)&&(b[S+z]=le,fe=b[C+z]+Ie-le,fe=Math.min(fe,h-H-le),b[N+fe]!==-1&&(k[b[N+fe]]=z),b[E+z]=b[N+fe],k[z]=-1,b[N+fe]=z,q=Math.min(q,fe),b[C+z]=fe,D[Me++]=z);b[S+te]=Te,(b[A+te]=Me-Le)===0&&(y[te]=-1,b[O+te]=0),De!==0&&(x=Me)}for(z=0;z<h;z++)y[z]=Hn(y[z]);for(X=0;X<=h;X++)b[N+X]=-1;for(X=h;X>=0;X--)b[S+X]>0||(b[E+X]=b[N+y[X]],b[N+y[X]]=X);for(R=h;R>=0;R--)b[S+R]<=0||y[R]!==-1&&(b[E+R]=b[N+y[R]],b[N+y[R]]=R);for(te=0,z=0;z<=h;z++)y[z]===-1&&(te=og(z,te,b,N,E,w,O));return w.splice(w.length-1,1),w};function a(o,c,f,d,m){var h=n(c);if(o===1&&d===f)return e(c,h);if(o===2){for(var p=h._index,g=h._ptr,v=0,D=0;D<f;D++){var y=g[D];if(g[D]=v,!(g[D+1]-y>m))for(var x=g[D+1];y<x;y++)p[v++]=p[y]}return g[f]=v,c=n(h),r(h,c)}return r(h,c)}function i(o,c,f,d,m,h,p,g,v,D,y,x){for(var w=0;w<o;w++)f[d+w]=c[w+1]-c[w];f[d+o]=0;for(var b=0;b<=o;b++)f[m+b]=-1,h[b]=-1,f[p+b]=-1,f[g+b]=-1,f[v+b]=1,f[D+b]=1,f[y+b]=0,f[x+b]=f[d+b];var A=u(0,0,f,D,o);return f[y+o]=-2,c[o]=-1,f[D+o]=0,A}function s(o,c,f,d,m,h,p,g,v,D,y){for(var x=0,w=0;w<o;w++){var b=f[d+w];if(b===0)f[m+w]=-2,x++,c[w]=-1,f[h+w]=0;else if(b>p)f[g+w]=0,f[m+w]=-1,x++,c[w]=Hn(o),f[g+o]++;else{var A=f[v+b];A!==-1&&(D[A]=w),f[y+w]=f[v+b],f[v+b]=w}}return x}function u(o,c,f,d,m){if(o<2||o+c<0){for(var h=0;h<m;h++)f[d+h]!==0&&(f[d+h]=1);o=2}return o}function l(o,c){return o!==c}});function z3(t,e,r,n,a,i,s){var u,l,o=0,c;if(t<=e||r[n+e]<=r[a+t])return-1;r[a+t]=r[n+e];var f=r[i+t];if(r[i+t]=e,f===-1)o=1,c=t;else{for(o=2,c=f;c!==r[s+c];c=r[s+c]);for(u=f;u!==c;u=l)l=r[s+u],r[s+u]=c}return{jleaf:o,q:c}}var Y3="csCounts",V3=["transpose"],H3=U(Y3,V3,t=>{var{transpose:e}=t;return function(r,n,a,i){if(!r||!n||!a)return null;var s=r._size,u=s[0],l=s[1],o,c,f,d,m,h,p,g=4*l+(i?l+u+1:0),v=[],D=0,y=l,x=2*l,w=3*l,b=4*l,A=5*l+1;for(f=0;f<g;f++)v[f]=-1;var S=[],E=e(r),N=E._index,_=E._ptr;for(f=0;f<l;f++)for(c=a[f],S[c]=v[w+c]===-1?1:0;c!==-1&&v[w+c]===-1;c=n[c])v[w+c]=f;if(i){for(f=0;f<l;f++)v[a[f]]=f;for(o=0;o<u;o++){for(f=l,h=_[o],p=_[o+1],m=h;m<p;m++)f=Math.min(f,v[N[m]]);v[A+o]=v[b+f],v[b+f]=o}}for(o=0;o<l;o++)v[D+o]=o;for(f=0;f<l;f++){for(c=a[f],n[c]!==-1&&S[n[c]]--,d=i?v[b+f]:c;d!==-1;d=i?v[A+d]:-1)for(m=_[d];m<_[d+1];m++){o=N[m];var C=z3(o,c,v,w,y,x,D);C.jleaf>=1&&S[c]++,C.jleaf===2&&S[C.q]--}n[c]!==-1&&(v[D+c]=n[c])}for(c=0;c<l;c++)n[c]!==-1&&(S[n[c]]+=S[c]);return S}}),W3="csSqr",G3=["add","multiply","transpose"],j3=U(W3,G3,t=>{var{add:e,multiply:r,transpose:n}=t,a=U3({add:e,multiply:r,transpose:n}),i=H3({transpose:n});return function(l,o,c){var f=o._ptr,d=o._size,m=d[1],h,p={};if(p.q=a(l,o),l&&!p.q)return null;if(c){var g=l?I3(o,null,p.q):o;p.parent=R3(g);var v=L3(p.parent,m);if(p.cp=i(g,p.parent,v,1),g&&p.parent&&p.cp&&s(g,p))for(p.unz=0,h=0;h<m;h++)p.unz+=p.cp[h]}else p.unz=4*f[m]+m,p.lnz=p.unz;return p};function s(u,l){var o=u._ptr,c=u._index,f=u._size,d=f[0],m=f[1];l.pinv=[],l.leftmost=[];var h=l.parent,p=l.pinv,g=l.leftmost,v=[],D=0,y=d,x=d+m,w=d+2*m,b,A,S,E,N;for(A=0;A<m;A++)v[y+A]=-1,v[x+A]=-1,v[w+A]=0;for(b=0;b<d;b++)g[b]=-1;for(A=m-1;A>=0;A--)for(E=o[A],N=o[A+1],S=E;S<N;S++)g[c[S]]=A;for(b=d-1;b>=0;b--)p[b]=-1,A=g[b],A!==-1&&(v[w+A]++===0&&(v[x+A]=b),v[D+b]=v[y+A],v[y+A]=b);for(l.lnz=0,l.m2=d,A=0;A<m;A++)if(b=v[y+A],l.lnz++,b<0&&(b=l.m2++),p[b]=A,!(--w[A]<=0)){l.lnz+=v[w+A];var _=h[A];_!==-1&&(v[w+_]===0&&(v[x+_]=v[x+A]),v[D+v[x+A]]=v[y+_],v[y+_]=v[D+b],v[w+_]+=v[w+A])}for(b=0;b<d;b++)p[b]<0&&(p[b]=A++);return!0}});function Tl(t,e){return t[e]<0}function ug(t,e){t[e]=Hn(t[e])}function lg(t){return t<0?Hn(t):t}function Z3(t,e,r,n,a){var i=e._index,s=e._ptr,u=e._size,l=u[1],o,c,f,d=0;for(n[0]=t;d>=0;){t=n[d];var m=a?a[t]:t;Tl(s,t)||(ug(s,t),n[l+d]=m<0?0:lg(s[m]));var h=1;for(c=n[l+d],f=m<0?0:lg(s[m+1]);c<f;c++)if(o=i[c],!Tl(s,o)){n[l+d]=c,n[++d]=o,h=0;break}h&&(d--,n[--r]=t)}return r}function X3(t,e,r,n,a){var i=t._ptr,s=t._size,u=e._index,l=e._ptr,o=s[1],c,f,d,m=o;for(f=l[r],d=l[r+1],c=f;c<d;c++){var h=u[c];Tl(i,h)||(m=Z3(h,t,m,n,a))}for(c=m;c<o;c++)ug(i,n[c]);return m}var J3="csSpsolve",Q3=["divideScalar","multiply","subtract"],K3=U(J3,Q3,t=>{var{divideScalar:e,multiply:r,subtract:n}=t;return function(i,s,u,l,o,c,f){var d=i._values,m=i._index,h=i._ptr,p=i._size,g=p[1],v=s._values,D=s._index,y=s._ptr,x,w,b,A,S=X3(i,s,u,l,c);for(x=S;x<g;x++)o[l[x]]=0;for(w=y[u],b=y[u+1],x=w;x<b;x++)o[D[x]]=v[x];for(var E=S;E<g;E++){var N=l[E],_=c?c[N]:N;if(!(_<0))for(w=h[_],b=h[_+1],o[N]=e(o[N],d[f?w:b-1]),x=f?w+1:w,A=f?b:b-1;x<A;x++){var C=m[x];o[C]=n(o[C],r(d[x],o[N]))}}return S}}),eO="csLu",tO=["abs","divideScalar","multiply","subtract","larger","largerEq","SparseMatrix"],rO=U(eO,tO,t=>{var{abs:e,divideScalar:r,multiply:n,subtract:a,larger:i,largerEq:s,SparseMatrix:u}=t,l=K3({divideScalar:r,multiply:n,subtract:a});return function(c,f,d){if(!c)return null;var m=c._size,h=m[1],p,g=100,v=100;f&&(p=f.q,g=f.lnz||g,v=f.unz||v);var D=[],y=[],x=[],w=new u({values:D,index:y,ptr:x,size:[h,h]}),b=[],A=[],S=[],E=new u({values:b,index:A,ptr:S,size:[h,h]}),N=[],_,C,O=[],I=[];for(_=0;_<h;_++)O[_]=0,N[_]=-1,x[_+1]=0;g=0,v=0;for(var k=0;k<h;k++){x[k]=g,S[k]=v;var M=p?p[k]:k,H=l(w,c,M,I,O,N,1),q=-1,z=-1;for(C=H;C<h;C++)if(_=I[C],N[_]<0){var X=e(O[_]);i(X,z)&&(z=X,q=_)}else A[v]=N[_],b[v++]=O[_];if(q===-1||z<=0)return null;N[M]<0&&s(e(O[M]),n(z,d))&&(q=M);var te=O[q];for(A[v]=k,b[v++]=te,N[q]=k,y[g]=q,D[g++]=1,C=H;C<h;C++)_=I[C],N[_]<0&&(y[g]=_,D[g++]=r(O[_],te)),O[_]=0}for(x[h]=g,S[h]=v,C=0;C<g;C++)y[C]=N[y[C]];return D.splice(g,D.length-g),y.splice(g,y.length-g),b.splice(v,b.length-v),A.splice(v,A.length-v),{L:w,U:E,pinv:N}}}),cg="slu",nO=["typed","abs","add","multiply","transpose","divideScalar","subtract","larger","largerEq","SparseMatrix"],aO=U(cg,nO,t=>{var{typed:e,abs:r,add:n,multiply:a,transpose:i,divideScalar:s,subtract:u,larger:l,largerEq:o,SparseMatrix:c}=t,f=j3({add:n,multiply:a,transpose:i}),d=rO({abs:r,divideScalar:s,multiply:a,subtract:u,larger:l,largerEq:o,SparseMatrix:c});return e(cg,{"SparseMatrix, number, number":function(h,p,g){if(!$e(p)||p<0||p>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(g<0||g>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var v=f(p,h,!1),D=d(h,v,g);return{L:D.L,U:D.U,p:D.pinv,q:v.q,toString:function(){return"L: "+this.L.toString()+` 42U: `+this.U.toString()+` 43p: `+this.p.toString()+(this.q?` 44q: `+this.q.toString():"")+` 45`}}}})});function fg(t,e){var r,n=e.length,a=[];if(t)for(r=0;r<n;r++)a[t[r]]=e[r];else for(r=0;r<n;r++)a[r]=e[r];return a}var dg="lusolve",iO=["typed","matrix","lup","slu","usolve","lsolve","DenseMatrix"],sO=U(dg,iO,t=>{var{typed:e,matrix:r,lup:n,slu:a,usolve:i,lsolve:s,DenseMatrix:u}=t,l=Li({DenseMatrix:u});return e(dg,{"Array, Array | Matrix":function(d,m){d=r(d);var h=n(d),p=c(h.L,h.U,h.p,null,m);return p.valueOf()},"DenseMatrix, Array | Matrix":function(d,m){var h=n(d);return c(h.L,h.U,h.p,null,m)},"SparseMatrix, Array | Matrix":function(d,m){var h=n(d);return c(h.L,h.U,h.p,null,m)},"SparseMatrix, Array | Matrix, number, number":function(d,m,h,p){var g=a(d,h,p);return c(g.L,g.U,g.p,g.q,m)},"Object, Array | Matrix":function(d,m){return c(d.L,d.U,d.p,d.q,m)}});function o(f){if(ze(f))return f;if(Dt(f))return r(f);throw new TypeError("Invalid Matrix LU decomposition")}function c(f,d,m,h,p){f=o(f),d=o(d),m&&(p=l(f,p,!0),p._data=fg(m,p._data));var g=s(f,p),v=i(d,g);return h&&(v._data=fg(h,v._data)),v}}),mg="polynomialRoot",oO=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],uO=U(mg,oO,t=>{var{typed:e,isZero:r,equalScalar:n,add:a,subtract:i,multiply:s,divide:u,sqrt:l,unaryMinus:o,cbrt:c,typeOf:f,im:d,re:m}=t;return e(mg,{"number|Complex, ...number|Complex":(h,p)=>{for(var g=[h,...p];g.length>0&&r(g[g.length-1]);)g.pop();if(g.length<2)throw new RangeError("Polynomial [".concat(h,", ").concat(p,"] must have a non-zero non-constant coefficient"));switch(g.length){case 2:return[o(u(g[0],g[1]))];case 3:{var[v,D,y]=g,x=s(2,y),w=s(D,D),b=s(4,y,v);if(n(w,b))return[u(o(D),x)];var A=l(i(w,b));return[u(i(A,D),x),u(i(o(A),D),x)]}case 4:{var[S,E,N,_]=g,C=o(s(3,_)),O=s(N,N),I=s(3,_,E),k=a(s(2,N,N,N),s(27,_,_,S)),M=s(9,_,N,E);if(n(O,I)&&n(k,M))return[u(N,C)];var H=i(O,I),q=i(k,M),z=a(s(18,_,N,E,S),s(N,N,E,E)),X=a(s(4,N,N,N,S),s(4,_,E,E,E),s(27,_,_,S,S));if(n(z,X))return[u(i(s(4,_,N,E),a(s(9,_,_,S),s(N,N,N))),s(_,H)),u(i(s(9,_,S),s(N,E)),s(2,H))];var te;n(O,I)?te=q:te=u(a(q,l(i(s(q,q),s(4,H,H,H)))),2);var B=!0,j=c(te,B).toArray().map(R=>u(a(N,R,u(H,R)),C));return j.map(R=>f(R)==="Complex"&&n(m(R),m(R)+d(R))?m(R):R)}default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(g))}}})}),lO="Help",cO=["evaluate"],fO=U(lO,cO,t=>{var{evaluate:e}=t;function r(n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!n)throw new Error('Argument "doc" missing');this.doc=n}return r.prototype.type="Help",r.prototype.isHelp=!0,r.prototype.toString=function(){var n=this.doc||{},a=` 46`;if(n.name&&(a+="Name: "+n.name+` 47 48`),n.category&&(a+="Category: "+n.category+` 49 50`),n.description&&(a+=`Description: 51 `+n.description+` 52 53`),n.syntax&&(a+=`Syntax: 54 `+n.syntax.join(` 55 `)+` 56 57`),n.examples){a+=`Examples: 58`;for(var i=!1,s=e("config()"),u={config:f=>(i=!0,e("config(newConfig)",{newConfig:f}))},l=0;l<n.examples.length;l++){var o=n.examples[l];a+=" "+o+` 59`;var c=void 0;try{c=e(o,u)}catch(f){c=f}c!==void 0&&!$u(c)&&(a+=" "+ot(c,{precision:14})+` 60`)}a+=` 61`,i&&e("config(originalConfig)",{originalConfig:s})}return n.mayThrow&&n.mayThrow.length&&(a+="Throws: "+n.mayThrow.join(", ")+` 62 63`),n.seealso&&n.seealso.length&&(a+="See also: "+n.seealso.join(", ")+` 64`),a},r.prototype.toJSON=function(){var n=je(this.doc);return n.mathjs="Help",n},r.fromJSON=function(n){var a={};return Object.keys(n).filter(i=>i!=="mathjs").forEach(i=>{a[i]=n[i]}),new r(a)},r.prototype.valueOf=r.prototype.toString,r},{isClass:!0}),dO="Chain",mO=["?on","math","typed"],hO=U(dO,mO,t=>{var{on:e,math:r,typed:n}=t;function a(o){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");Uu(o)?this.value=o.value:this.value=o}a.prototype.type="Chain",a.prototype.isChain=!0,a.prototype.done=function(){return this.value},a.prototype.valueOf=function(){return this.value},a.prototype.toString=function(){return ot(this.value)},a.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},a.fromJSON=function(o){return new a(o.value)};function i(o,c){typeof c=="function"&&(a.prototype[o]=u(c))}function s(o,c){aa(a.prototype,o,function(){var d=c();if(typeof d=="function")return u(d)})}function u(o){return function(){if(arguments.length===0)return new a(o(this.value));for(var c=[this.value],f=0;f<arguments.length;f++)c[f+1]=arguments[f];if(n.isTypedFunction(o)){var d=n.resolve(o,c);if(d.params.length===1)throw new Error("chain function "+o.name+" cannot match rest parameter between chain value and additional arguments.");return new a(d.implementation.apply(o,c))}return new a(o.apply(o,c))}}a.createProxy=function(o,c){if(typeof o=="string")i(o,c);else{var f=function(h){ke(o,h)&&l[h]===void 0&&s(h,()=>o[h])};for(var d in o)f(d)}};var l={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return a.createProxy(r),e&&e("import",function(o,c,f){f||s(o,c)}),a},{isClass:!0}),hg={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"]},pO={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]}
64,vO={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:[]},gO={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:[]},yO={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]},bO={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]},wO={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:[]},xO={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:[]},DO={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]},EO={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]},AO={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:[]},pg={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"]},SO={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:[]},NO={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]},_O={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"]},CO={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]},MO={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]},TO={name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","bigint","complex","fraction","index","matrix","string","unit"]},FO={name:"bigint",category:"Construction",syntax:["bigint(x)"],description:"Create a bigint, an integer with an arbitrary number of digits, from a number or string.",examples:["123123123123123123 # a large number will lose digits",'bigint("123123123123123123")','bignumber(["1", "3", "5"])'],seealso:["boolean","bignumber","number","complex","fraction","index","matrix","string","unit"]},OO={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"]},BO={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"]},kO={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"]},IO={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,de
64n)","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"]},LO={name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[1:2, 1:2] = 1","B = [1, 2, 3]","B[B>1 and B<3]"],seealso:["bignumber","boolean","complex","matrix","number","range","string","unit"]},RO={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"]},$O={name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","bigint","boolean","complex","fraction","index","matrix","string","unit"]},PO={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"]},qO={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"]},UO={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"]},zO={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"]},YO={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:[]},VO={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:[]},HO={name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })',"double(2)",'double("hello")'],seealso:[]},WO={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"]},GO={name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leaf
64Count("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]},jO={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"]},ZO={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"]},XO={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"]},JO={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"]},QO={name:"polynomialRoot",category:"Algebra",syntax:["x=polynomialRoot(-6, 3)","x=polynomialRoot(4, -4, 1)","x=polynomialRoot(-8, 12, -6, 1)"],description:"Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.",examples:["a = polynomialRoot(-6, 11, -6, 1)"],seealso:["cbrt","sqrt"]},KO={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"]},eB={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"]},tB={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"]},rB={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"]},nB={name:"simplifyConstant",category:"Algebra",syntax:["simplifyConstant(expr)","simplifyConstant(expr, options)"],description:"Replace constant subexpressions of node with their values.",examples:['simplifyConstant("(3-3)*x")','simplifyConstant(parse("z-cos(tau/8)"))'],seealso:["simplify","simplifyCore","evaluate"]},aB={name:"simplifyCore",category:"Algebra",syntax:["simplifyCore(node)"],description:"Perform simple one-pass simplifications on an expression tree.",examples:['simplifyCore(parse("0*x"))','simplifyCore(parse("(x+0)*2"))'],seealso:["simplify","simplifyConstant","evaluate"]},iB={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"]}
64,sB={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"]},oB={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"]},uB={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"]},lB={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]},cB={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"]},fB={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"]},dB={name:"ceil",category:"Arithmetic",syntax:["ceil(x)","ceil(x, n)","ceil(unit, valuelessUnit)","ceil(unit, n, valuelessUnit)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)","ceil(3.241cm, cm)","ceil(3.241cm, 2, cm)"],seealso:["floor","fix","round"]},mB={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"]},hB={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"]},pB={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"]},vB={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"]},gB={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"]},yB={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"]},bB={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"]},wB={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"]},xB={name:"fix",category:"Arithmetic",syntax:["fix(x)","fix(x, n)","fix(unit, valuelessUnit)","fix(unit, n, valuelessUnit)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)","fix(3.241cm, cm)","fix(3.241cm, 2, cm)"],seealso:["ceil","floor","round"]},DB={name:"floor",category:"Arithmetic",syntax:["floor(x)","floor(x, n)","floor(unit, valuelessUnit)","floor(unit, n, valuelessUnit)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)","floor(3.241cm, cm)","floor(3.241cm, 2, cm)"],seealso:["ceil","fix","round"]},EB={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"]},AB={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenuse of a list with values.",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]},SB={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)","invmod(7, 13)","invmod(15151, 15122)"],seealso:["gcd","xgcd"]},NB={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"]},_B={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"]},CB={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"]},MB={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"]},TB={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"]},FB={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:["divi
64de"]},OB={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"]},BB={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")']},kB={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"]},IB={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"]},LB={name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)","pow([[1, 2], [4, 3]], 2)","pow([[1, 2], [4, 3]], -1)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]},RB={name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)","round(unit, valuelessUnit)","round(unit, n, valuelessUnit)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)","round(3.241cm, 2, cm)","round([3.2, 3.8, -4.7])"],seealso:["ceil","floor","fix"]},$B={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>0, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]},PB={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"]}
64,qB={name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.",examples:["sqrtm([[33, 24], [48, 57]])"],seealso:["sqrt","abs","square","multiply"]},UB={name:"sylvester",category:"Algebra",syntax:["sylvester(A,B,C)"],description:"Solves the real-valued Sylvester equation AX+XB=C for X",examples:["sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])","A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]","sylvester(A, B, C)"],seealso:["schur","lyap"]},zB={name:"schur",category:"Algebra",syntax:["schur(A)"],description:"Performs a real Schur decomposition of the real matrix A = UTU'",examples:["schur([[1, 0], [-4, 3]])","A = [[1, 0], [-4, 3]]","schur(A)"],seealso:["lyap","sylvester"]},YB={name:"lyap",category:"Algebra",syntax:["lyap(A,Q)"],description:"Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P",examples:["lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])","A = [[-2, 0], [1, -4]]","Q = [[3, 1], [1, 3]]","lyap(A,Q)"],seealso:["schur","sylvester"]},VB={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"]},HB={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"]},WB={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"]},GB={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]},jB={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"]},ZB={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"]},XB={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"]},JB={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"]},QB={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"]},KB={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
64<< 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]},e4={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"]},t4={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"]},r4={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"]},n4={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"]},a4={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"]},i4={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"]},s4={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"]},o4={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"]},u4={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"]},l4={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"]},c4={name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate(expression, scope)","evaluate([expr1, expr2, expr3, ...])","evaluate([expr1, expr2, expr3, ...], scope)"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(16)")','evaluate("2 inch to cm")','evaluate("sin(x * pi)", { "x": 1/2 })','evaluate(["width=2", "height=4","width*height"])'],seealso:["parser","parse","compile"]},f4={name:"parser",category:"Expression",syntax:["parser()"],description:"Create a parser object that keeps a context of variables and their values, allowing the evaluation of expressions in that context.",examples:["myParser = parser()",'myParser.evaluate("sqrt(3^2 + 4^2)")','myParser.set("x", 3)','myParser.evaluate("y = x + 3")','myParser.evaluate(["y = x + 3", "y = y + 1"])','myParser.get("y")'],seealso:["evaluate","parse","compile"]},d4={name:"parse",category:"Expression",syntax:["parse(expr)","parse(expr, options)","parse([expr1, expr2, expr3, ...])","parse([expr1, expr2, expr3, ...], options)"],description:"Parse an expression. Returns a node tree, which can be evaluated by invoking node.evaluate() or transformed into a functional object via node.compile().",examples:['node1 = parse("sqrt(3^2 + 4^2)")',"node1.evaluate()","code1 = node1.compile()","code1.evaluate()","scope = {a: 3, b: 4}",'node2 = parse("a * b")',"node2.evaluate(scope)","code2 = node2.compile()","code2.evaluate(scope)"],seealso:["parser","evaluate","compile"]},m4={name:"compile",category:"Expression",syntax:["compile(expr) ","compile([expr1, expr2, expr3, ...])"],description:"Parse and compile an expression. Returns a an object with a function evaluate([scope]) to evaluate the compiled expression.",examples:['code1 = compile("sqrt(3^2 + 4^2)")',"code1.evaluate() ",'code2 = compile("a * b")',"code2.evaluate({a: 3, b: 4})"],seealso:["parser","parse","evaluate"]},h4={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]},p4={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:[]},v4={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:[]},g4={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"]},y4={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"]},b4={name:"nullish",category:"Logical",syntax:["x ?? y","nullish(x, y)"],description:"Nullish coalescing operator. Returns the right-hand operand when the left-hand operand is null or undefined, and otherwise returns the left-hand operand.",examples:["null ?? 42","undefined ?? 42","0 ?? 42","false ?? 42","null ?? undefined ?? 42"],seealso:["and","or","not"]},w4={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"]},x4={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"]},D4={name:"mapSlices",category:"Matrix",syntax:["mapSlices(A, dim, callback)"],description:"Generate a matrix one dimension less than A by applying c
64allback to each slice of A along dimension dim.",examples:["A = [[1, 2], [3, 4]]","mapSlices(A, 1, sum)","mapSlices(A, 2, prod)"],seealso:["map","forEach"]},E4={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"]},A4={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"]},S4={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"]},N4={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"]},_4={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","one
64s","range","size","squeeze","subset","trace","zeros"]},C4={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"]},M4={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"]},T4={name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicate the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["A = [1, 2, 4, 7, 0]","diff(A)","diff(A, 1)","B = [[1, 2], [3, 4]]","diff(B)","diff(B, 1)","diff(B, 2)","diff(B, bignumber(2))","diff([[1, 2], matrix([3, 4])], 2)"],seealso:["subtract","partitionSelect"]},F4={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"]},O4={name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and optionally eigenvectors of a square matrix",examples:["eigs([[5, 2.3], [2.3, 1]])","eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })"],seealso:["inv"]},B4={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"]},k4={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"]},I4={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"]},L4={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"]},R4={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","
64inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},$4={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"]},P4={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"]},q4={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"]},U4={name:"map",category:"Matrix",syntax:["map(x, callback)","map(x, y, ..., callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array or the matrices/arrays.",examples:["map([1, 2, 3], square)","map([1, 2], [3, 4], f(a,b) = a + b)"],seealso:["filter","forEach"]},z4={name:"matrixFromColumns",category:"Matrix",syntax:["matrixFromColumns(...arr)","matrixFromColumns(row1, row2)","matrixFromColumns(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual columns.",examples:["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromRows","matrixFromFunction","zeros"]},Y4={name:"matrixFromFunction",category:"Matrix",syntax:["matrixFromFunction(size, fn)","matrixFromFunction(size, fn, format)","matrixFromFunction(size, fn, format, datatype)","matrixFromFunction(size, format, fn)","matrixFromFunction(size, format, datatype, fn
64)"],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"]},V4={name:"matrixFromRows",category:"Matrix",syntax:["matrixFromRows(...arr)","matrixFromRows(row1, row2)","matrixFromRows(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual rows.",examples:["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromColumns","matrixFromFunction","zeros"]},H4={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"]},W4={name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1, compareText)',"arr = [5, 2, 1]","partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]","arr","partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]","arr"],seealso:["sort"]},G4={name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"range(1m, 1m, 3m)","a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","one
64s","size","squeeze","subset","trace","transpose","zeros"]},j4={name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])","reshape([1, 2, 3, 4], [-1, 2])"],seealso:["size","squeeze","resize"]},Z4={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"]},X4={name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]},J4={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"]},Q4={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"]},K4={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","one
64s","range","squeeze","subset","trace","transpose","zeros"]},ek={name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"], "natural")',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]},tk={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"]},rk={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","one
64s","range","size","squeeze","trace","transpose","zeros"]},nk={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"]},ak={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"]},ik={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"]},sk={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional Fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]},ok={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse Fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]},uk={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"]},lk={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"]},ck={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"]},fk={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"]},dk={name:"lgamma",category:"Probability",syntax:["lgamma(n)"],description:"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.",examples:["lgamma(4)","lgamma(1/2)","lgamma(i)","lgamma(complex(1.1, 2))"],seealso:["gamma"]},mk={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:[]},hk={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"]},pk={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"]},vk={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"]},gk={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"]},yk={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"]},bk={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"]},wk={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"]},xk={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"]},Dk={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"]},Ek={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"]},Ak={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"]},Sk={name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not. Comparing a value with NaN returns false.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]},Nk={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 >
64 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]},_k={name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not. Comparing a value with NaN returns false.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]},Ck={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"]},Mk={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"]},Tk={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"]},Fk={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"]},Ok={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"]},Bk={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"]},kk={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"]},Ik={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"]},Lk={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"]},Rk={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"]},$k={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"]},Pk={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"]},qk={name:"zpk2tf",category:"Signal",syntax:["zpk2tf(z, p, k)"],description:"Compute the transfer function of a zero-pole-gain model.",examples:["zpk2tf([1, 2], [-1, -2], 1)","zpk2tf([1, 2], [-1, -2])","zpk2tf([1 - 3i, 2 + 2i], [-1, -2])"],seealso:[]},Uk={name:"freqz",category:"Signal",syntax:["freqz(b, a)","freqz(b, a, w)"],description:"Calculates the frequency response of a filter given its numerator and denominator coefficients.",examples:["freqz([1, 2], [1, 2, 3])","freqz([1, 2], [1, 2, 3], [0, 1])","freqz([1, 2], [1, 2, 3], 512)"],seealso:[]},zk={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:[]},Yk={name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemann's Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]},Vk={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"]},Hk={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values. If any NaN values are found, the function yields the last NaN in the input.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]},Wk={name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dimension)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]},Gk={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"]},jk={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values. If any NaN values are found, the function yields the last NaN in the input.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]},Zk={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"]},Xk={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"]},Jk={name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:`Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber. 65 66In 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"]},Qk={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, dimension)","std(A, normalization)","std(A, dimension, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]},Kk={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"]},eI={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","variance"]},tI={name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, dimension)","variance(A, normalization)","variance(A, dimension, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]},rI={name:"corr",category:"Statistics",syntax:["corr(A,B)"],description:"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.",examples:["corr([2, 4, 6, 8],[1, 2, 3, 6])","corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))"],seealso:["max","mean","min","median","min","prod","std","sum"]}
66,nI={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"]},aI={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"]},iI={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"]},sI={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the inverse hyperbolic tangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]},oI={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"]},uI={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the inverse hyperbolic cosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]},lI={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"]},cI={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]},fI={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"]},dI={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"]},mI={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"]},hI={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"]},pI={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"]},vI={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"]},gI={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]},yI={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"]},bI={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"]},wI={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"]},xI={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"]},DI={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"]},EI={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"]},AI={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"]},SI={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]},NI={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"]},_I={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"]},CI={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:[]},MI={name:"toBest",category:"Units",syntax:["toBest(x)","toBest(x, unitList)","toBest(x, unitList, options)"],description:"Converts to the most appropriate display unit.",examples:['toBest(unit(5000, "m"))','toBest(unit(3500000, "W"))','toBest(unit(0.000000123, "A"))','toBest(unit(10, "m"), "cm")','toBest(unit(10, "m"), "mm,km", {offset: 1.5})'],seealso:[]},TI={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]},FI={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:[]},OI={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"]},BI={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"]},kI={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]},II={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"]},LI={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"]},RI={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"]},$I={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"]},PI={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"]}
66,qI={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"]},UI={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"]},zI={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "bigint")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","bigint","fraction","bignumber","string","format"]},YI={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]},VI={name:"print",category:"Utils",syntax:["print(template, values)","print(template, values, precision)"],description:"Interpolate values into a string template.",examples:['print("Lucy is $age years old", {age: 5})','print("The value of pi is $pi", {pi: pi}, 3)','print("Hello, $user.name!", {user: {name: "John"}})','print("Values: $1, $2, $3", [6, 9, 4])'],seealso:["format"]},HI={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"]},WI={name:"solveODE",category:"Numeric",syntax:["solveODE(func, tspan, y0)","solveODE(func, tspan, y0, options)"],description:"Numerical Integration of Ordinary Differential Equations.",examples:["f(t,y) = y","tspan = [0, 4]","solveODE(f, tspan, 1)","solveODE(f, tspan, [1, 2])",'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'],seealso:["derivative","simplifyCore"]},GI={bignumber:TO,bigint:FO,boolean:OO,complex:BO,createUnit:kO,fraction:IO,index:LO,matrix:RO,number:$O,sparse:PO,splitUnit:qO,string:UO,unit:zO,e:hg,E:hg,false:pO,i:vO,Infinity:gO,LN2:bO,LN10:yO,LOG2E:xO,LOG10E:wO,NaN:DO,null:EO,pi:pg,PI:pg,phi:AO,SQRT1_2:SO,SQRT2:NO,tau:_O,true:CO,version:MO,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"]}
66,coulomb:{description:"Coulomb's constant. Deprecated in favor of coulombConstant",examples:["coulombConstant"]},coulombConstant:{description:"Coulomb's constant",examples:["coulombConstant"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Bohr magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Bohr radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:WO,lsolve:jO,lsolveAll:ZO,lup:XO,lusolve:JO,leafCount:GO,polynomialRoot:QO,resolve:tB,simplify:rB,simplifyConstant:nB,simplifyCore:aB,symbolicEqual:sB,rationalize:eB,slu:iB,usolve:oB,usolveAll:uB,qr:KO,abs:lB,add:cB,cbrt:fB,ceil:dB,cube:mB,divide:hB,dotDivide:pB,dotMultiply:vB,dotPow:gB,exp:yB,expm:bB,expm1:wB,fix:xB,floor:DB,gcd:EB,hypot:AB,lcm:NB,log:_B,log2:TB,log1p:MB,log10:CB,mod:FB,multiply:OB,norm:BB,nthRoot:kB,nthRoots:IB,pow:LB,round:RB,sign:$B,sqrt:PB,sqrtm:qB,square:VB,subtract:HB,unaryMinus:WB,unaryPlus:GB,xgcd:jB,invmod:SB,bitAnd:ZB,bitNot:XB,bitOr:JB,bitXor:QB,leftShift:KB,rightArithShift:e4,rightLogShift:t4,bellNumbers:r4,catalan:n4,composition:a4,stirlingS2:i4,config:YO,import:VO,typed:HO,arg:s4,conj:o4,re:l4,im:u4,evaluate:c4,help:h4,parse:d4,parser:f4,compile:m4,distance:p4,intersect:v4,and:g4,not:y4,nullish:b4,or:w4,xor:x4,mapSlices:D4,concat:A4,count:S4,cross:N4,column:E4,ctranspose:_4,det:C4,diag:M4,diff:T4,dot:F4,getMatrixDataType:L4,identity:R4,filter:B4,flatten:k4,forEach:I4,inv:$4,pinv:P4,eigs:O4,kron:q4,matrixFromFunction:Y4,matrixFromRows:V4,matrixFromColumns:z4,map:U4,ones:H4,partitionSelect:W4,range:G4,resize:Z4,reshape:j4,rotate:X4,rotationMatrix:J4,row:Q4,size:K4,sort:ek,squeeze:tk,subset:rk,trace:nk,transpose:ak,zeros:ik,fft:sk,ifft:ok,sylvester:UB,schur:zB,lyap:YB,solveODE:WI,combinations:uk,combinationsWithRep:lk,factorial:ck,gamma:fk,kldivergence:mk,lgamma:dk,multinomial:hk,permutations:pk,pickRandom:vk,random:gk,randomInt:yk,compare:bk,compareNatural:wk,compareText:xk,deepEqual:Dk,equal:Ek,equalText:Ak,larger:Sk,largerEq:Nk,smaller:_k,smallerEq:Ck,unequal:Mk,setCartesian:Tk,setDifference:Fk,setDistinct:Ok,setIntersect:Bk,setIsSubset:kk,setMultiplicity:Ik,setPowerset:Lk,setSize:Rk,setSymDifference:$k,setUnion:Pk,zpk2tf:qk,freqz:Uk,erf:zk,zeta:Yk,cumsum:Kk,mad:Vk,max:Hk,mean:Wk,median:Gk,min:jk,mode:Zk,prod:Xk,quantileSeq:Jk,std:Qk,sum:eI,variance:tI,corr:rI,acos:nI,acosh:aI,acot:iI,acoth:sI,acsc:oI,acsch:uI,asec:lI,asech:cI,asin:fI,asinh:dI,atan:mI,atanh:pI,atan2:hI,cos:vI,cosh:gI,cot:yI,coth:bI,csc:wI,csch:xI,sec:D
vendor: 45,776 bytes, line 66
66I,sech:EI,sin:AI,sinh:SI,tan:NI,tanh:_I,to:CI,toBest:MI,clone:FI,format:OI,bin:TI,oct:YI,hex:kI,isNaN:LI,isInteger:II,isNegative:RI,isNumeric:$I,hasNumericValue:BI,isPositive:PI,isPrime:qI,isZero:UI,print:VI,typeOf:HI,numeric:zI},vg="help",jI=["typed","mathWithTransform","Help"],ZI=U(vg,jI,t=>{var{typed:e,mathWithTransform:r,Help:n}=t;return e(vg,{any:function(i){var s,u=i;if(typeof i!="string"){for(s in r)if(ke(r,s)&&i===r[s]){u=s;break}}var l=hr(GI,u);if(!l){var o=typeof u=="function"?u.name:u;throw new Error('No documentation found on "'+o+'"')}return new n(l)}})}),gg="chain",XI=["typed","Chain"],JI=U(gg,XI,t=>{var{typed:e,Chain:r}=t;return e(gg,{"":function(){return new r},any:function(a){return new r(a)}})}),yg="det",QI=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],KI=U(yg,QI,t=>{var{typed:e,matrix:r,subtractScalar:n,multiply:a,divideScalar:i,isZero:s,unaryMinus:u}=t;return e(yg,{any:function(c){return je(c)},"Array | Matrix":function(c){var f;switch(ze(c)?f=c.size():Array.isArray(c)?(c=r(c),f=c.size()):f=[],f.length){case 0:return je(c);case 1:if(f[0]===1)return je(c.valueOf()[0]);if(f[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+ot(f)+")");case 2:{var d=f[0],m=f[1];if(d===m)return l(c.clone().valueOf(),d);if(m===0)return 1;throw new RangeError("Matrix must be square (size: "+ot(f)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+ot(f)+")")}}});function l(o,c,f){if(c===1)return je(o[0][0]);if(c===2)return n(a(o[0][0],o[1][1]),a(o[1][0],o[0][1]));for(var d=!1,m=new Array(c).fill(0).map((A,S)=>S),h=0;h<c;h++){var p=m[h];if(s(o[p][h])){var g=void 0;for(g=h+1;g<c;g++)if(!s(o[m[g]][h])){p=m[g],m[g]=m[h],m[h]=p,d=!d;break}if(g===c)return o[p][h]}for(var v=o[p][h],D=h===0?1:o[m[h-1]][h-1],y=h+1;y<c;y++)for(var x=m[y],w=h+1;w<c;w++)o[x][w]=i(n(a(o[x][w],v),a(o[x][h],o[p][w])),D)}var b=o[m[c-1]][c-1];return d?u(b):b}}),bg="inv",e5=["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],t5=U(bg,e5,t=>{var{typed:e,matrix:r,divideScalar:n,addScalar:a,multiply:i,unaryMinus:s,det:u,identity:l,abs:o}=t;return e(bg,{"Array | Matrix":function(d){var m=ze(d)?d.size():Ke(d);switch(m.length){case 1:if(m[0]===1)return ze(d)?r([n(1,d.valueOf()[0])]):[n(1,d[0])];throw new RangeError("Matrix must be square (size: "+ot(m)+")");case 2:{var h=m[0],p=m[1];if(h===p)return ze(d)?r(c(d.valueOf(),h,p),d.storage()):c(d,h,p);throw new RangeError("Matrix must be square (size: "+ot(m)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+ot(m)+")")}},any:function(d){return n(1,d)}});function c(f,d,m){var h,p,g,v,D;if(d===1){if(v=f[0][0],v===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,v)]]}else if(d===2){var y=u(f);if(y===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(f[1][1],y),n(s(f[0][1]),y)],[n(s(f[1][0]),y),n(f[0][0],y)]]}else{var x=f.concat();for(h=0;h<d;h++)x[h]=x[h].concat();for(var w=l(d).valueOf(),b=0;b<m;b++){var A=o(x[b][b]),S=b;for(h=b+1;h<d;)o(x[h][b])>A&&(A=o(x[h][b]),S=h),h++;if(A===0)throw Error("Cannot calculate inverse, determinant is zero");h=S,h!==b&&(D=x[b],x[b]=x[h],x[h]=D,D=w[b],w[b]=w[h],w[h]=D);var E=x[b],N=w[b];for(h=0;h<d;h++){var _=x[h],C=w[h];if(h!==b){if(_[b]!==0){for(g=n(s(_[b]),E[b]),p=b;p<m;p++)_[p]=a(_[p],i(g,E[p]));for(p=0;p<m;p++)C[p]=a(C[p],i(g,N[p]))}}else{for(g=E[b],p=b;p<m;p++)_[p]=n(_[p],g);for(p=0;p<m;p++)C[p]=n(C[p],g)}}}return w}}}),wg="pinv",r5=["typed","matrix","inv","deepEqual","equal","dotDivide","dot","ctranspose","divideScalar","multiply","add","Complex"],n5=U(wg,r5,t=>{var{typed:e,matrix:r,inv:n,deepEqual:a,equal:i,dotDivide:s,dot:u,ctranspose:l,divideScalar:o,multiply:c,add:f,Complex:d}=t;return e(wg,{"Array | Matrix":function(y){var x=ze(y)?y.size():Ke(y);switch(x.length){case 1:return v(y)?l(y):x[0]===1?n(y):s(l(y),u(y,y));case 2:{if(v(y))return l(y);var w=x[0],b=x[1];if(w===b)try{return n(y)}catch(A){if(!(A instanceof Error&&A.message.match(/Cannot calculate inverse, determinant is zero/)))throw A}return ze(y)?r(m(y.valueOf(),w,b),y.storage()):m(y,w,b)}default:throw new RangeError("Matrix must be two dimensional (size: "+ot(x)+")")}},any:function(y){return i(y,0)?je(y):o(1,y)}});function m(D,y,x){var{C:w,F:b}=p(D,y,x),A=c(n(c(l(w),w)),l(w)),S=c(l(b),n(c(b,l(b))));return c(S,A)}function h(D,y,x){for(var w=je(D),b=0,A=0;A<y;A++){if(x<=b)return w;for(var S=A;g(w[S][b]);)if(S++,y===S&&(S=A,b++,x===b))return w;[w[S],w[A]]=[w[A],w[S]];for(var E=w[A][b],N=0;N<x;N++)w[A][N]=s(w[A][N],E);for(var _=0;_<y;_++)if(_!==A){E=w[_][b];for(var C=0;C<x;C++)w[_][C]=f(w[_][C],c(-1,c(E,w[A][C])))}b++}return w}function p(D,y,x){var w=h(D,y,x),b=D.map((S,E)=>S.filter((N,_)=>_<y&&!g(u(w[_],w[_])))),A=w.filter((S,E)=>!g(u(w[E],w[E])));return{C:b,F:A}}function g(D){return i(f(D,d(1,1)),f(0,d(1,1)))}function v(D){return a(f(D,d(1,1)),f(c(D,0),d(1,1)))}});function a5(t){var{addScalar:e,subtract:r,flatten:n,multiply:a,multiplyScalar:i,divideScalar:s,sqrt:u,abs:l,bignumber:o,diag:c,size:f,reshape:d,inv:m,qr:h,usolve:p,usolveAll:g,equal:v,complex:D,larger:y,smaller:x,matrixFromColumns:w,dot:b}=t;function A(B,j,R,oe){var se=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,le=S(B,j,R,oe,se);E(B,j,R,oe,se,le);var{values:P,C:W}=N(B,j,R,oe,se);if(se){var J=_(B,j,W,le,P,R,oe);return{values:P,eigenvectors:J}}return{values:P}}function S(B,j,R,oe,se){var le=oe==="BigNumber",P=oe==="Complex",W=le?o(0):0,J=le?o(1):P?D(1):1,re=le?o(1):1,ae=le?o(10):2,he=i(ae,ae),fe;se&&(fe=Array(j).fill(J));for(var De=!1;!De;){De=!0;for(var Te=0;Te<j;Te++){for(var Ie=W,Me=W,Le=0;Le<j;Le++)Te!==Le&&(Ie=e(Ie,l(B[Le][Te])),Me=e(Me,l(B[Te][Le])));if(!v(Ie,0)&&!v(Me,0)){for(var Y=re,ee=Ie,ue=s(Me,ae),L=i(Me,ae);x(ee,ue);)ee=i(ee,he),Y=i(Y,ae);for(;y(ee,L);)ee=s(ee,he),Y=s(Y,ae);var Z=x(s(e(ee,Me),Y),i(e(Ie,Me),.95));if(Z){De=!1;for(var K=s(1,Y),ne=0;ne<j;ne++)Te!==ne&&(B[Te][ne]=i(B[Te][ne],K),B[ne][Te]=i(B[ne][Te],Y));se&&(fe[Te]=i(fe[Te],K))}}}}return se?c(fe):null}function E(B,j,R,oe,se,le){var P=oe==="BigNumber",W=oe==="Complex",J=P?o(0):W?D(0):0;P&&(R=o(R));for(var re=0;re<j-2;re++){for(var ae=0,he=J,fe=re+1;fe<j;fe++){var De=B[fe][re];x(l(he),l(De))&&(he=De,ae=fe)}if(!x(l(he),R)){if(ae!==re+1){var Te=B[ae];B[ae]=B[re+1],B[re+1]=Te;for(var Ie=0;Ie<j;Ie++){var Me=B[Ie][ae];B[Ie][ae]=B[Ie][re+1],B[Ie][re+1]=Me}if(se){var Le=le[ae];le[ae]=le[re+1],le[re+1]=Le}}for(var Y=re+2;Y<j;Y++){var ee=s(B[Y][re],he);if(ee!==0){for(var ue=0;ue<j;ue++)B[Y][ue]=r(B[Y][ue],i(ee,B[re+1][ue]));for(var L=0;L<j;L++)B[L][re+1]=e(B[L][re+1],i(ee,B[L][Y]));if(se)for(var Z=0;Z<j;Z++)le[Y][Z]=r(le[Y][Z],i(ee,le[re+1][Z]))}}}}return le}function N(B,j,R,oe,se){var le=oe==="BigNumber",P=oe==="Complex",W=le?o(1):P?D(1):1;le&&(R=o(R));for(var J=je(B),re=[],ae=j,he=[],fe=se?c(Array(j).fill(W)):void 0,De=se?c(Array(ae).fill(W)):void 0,Te=0;Te<=100;){Te+=1;for(var Ie=J[ae-1][ae-1],Me=0;Me<ae;Me++)J[Me][Me]=r(J[Me][Me],Ie);var{Q:Le,R:Y}=h(J);J=a(Y,Le);for(var ee=0;ee<ae;ee++)J[ee][ee]=e(J[ee][ee],Ie);if(se&&(De=a(De,Le)),ae===1||x(l(J[ae-1][ae-2]),R)){Te=0,re.push(J[ae-1][ae-1]),se&&(he.unshift([[1]]),I(De,j),fe=a(fe,De),ae>1&&(De=c(Array(ae-1).fill(W)))),ae-=1,J.pop();for(var ue=0;ue<ae;ue++)J[ue].pop()}else if(ae===2||x(l(J[ae-2][ae-3]),R)){Te=0;var L=C(J[ae-2][ae-2],J[ae-2][ae-1],J[ae-1][ae-2],J[ae-1][ae-1]);re.push(...L),se&&(he.unshift(O(J[ae-2][ae-2],J[ae-2][ae-1],J[ae-1][ae-2],J[ae-1][ae-1],L[0],L[1],R,oe)),I(De,j),fe=a(fe,De),ae>2&&(De=c(Array(ae-2).fill(W)))),ae-=2,J.pop(),J.pop();for(var Z=0;Z<ae;Z++)J[Z].pop(),J[Z].pop()}if(ae===0)break}if(re.sort((ce,pe)=>+r(l(ce),l(pe))),Te>100){var K=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+re.join(", "));throw K.values=re,K.vectors=[],K}var ne=se?a(fe,k(he,j)):void 0;return{values:re,C:ne}}function _(B,j,R,oe,se,le,P){var W=m(R),J=a(W,B,R),re=P==="BigNumber",ae=P==="Complex",he=re?o(0):ae?D(0):0,fe=re?o(1):ae?D(1):1,De=[],Te=[];for(var Ie of se){var Me=M(De,Ie,v);Me===-1?(De.push(Ie),Te.push(1)):Te[Me]+=1}for(var Le=[],Y=De.length,ee=Array(j).fill(he),ue=c(Array(j).fill(fe)),L=function(){var ne=De[Z],ce=r(J,a(ne,ue)),pe=g(ce,ee);for(pe.shift();pe.length<Te[Z];){var we=H(ce,j,pe,le,P);if(we===null)break;pe.push(we)}var xe=a(m(oe),R);pe=pe.map(Ne=>a(xe,Ne)),Le.push(...pe.map(Ne=>({value:ne,vector:n(Ne)})))},Z=0;Z<Y;Z++)L();return Le}function C(B,j,R,oe){var se=e(B,oe),le=r(i(B,oe),i(j,R)),P=i(se,.5),W=i(u(r(i(se,se),i(4,le))),.5);return[e(P,W),r(P,W)]}function O(B,j,R,oe,se,le,P,W){var J=W==="BigNumber",re=W==="Complex",ae=J?o(0):re?D(0):0,he=J?o(1):re?D(1):1;if(x(l(R),P))return[[he,ae],[ae,he]];if(y(l(r(se,le)),P))return[[r(se,oe),r(le,oe)],[R,R]];var fe=r(B,se),De=r(oe,se);return x(l(j),P)&&x(l(De),P)?[[fe,he],[R,ae]]:[[j,ae],[De,he]]}function I(B,j){for(var R=0;R<B.length;R++)B[R].push(...Array(j-B[R].length).fill(0));for(var oe=B.length;oe<j;oe++)B.push(Array(j).fill(0)),B[oe][oe]=1;return B}function k(B,j){for(var R=[],oe=0;oe<j;oe++)R[oe]=Array(j).fill(0);var se=0;for(var le of B){for(var P=le.length,W=0;W<P;W++)for(var J=0;J<P;J++)R[se+W][se+J]=le[W][J];se+=P}return R}function M(B,j,R){for(var oe=0;oe<B.length;oe++)if(R(B[oe],j))return oe;return-1}function H(B,j,R,oe,se){for(var le=se==="BigNumber"?o(1e3):1e3,P,W=0;W<5;++W){P=q(j,R,se);try{P=p(B,P)}catch{continue}if(y(X(P),le))break}if(W>=5)return null;for(W=0;;){var J=p(B,P);if(x(X(z(P,[J])),oe))break;if(++W>=10)return null;P=te(J)}return P}function q(B,j,R){var oe=R==="BigNumber",se=R==="Complex",le=Array(B).fill(0).map(P=>2*Math.random()-1);return oe&&(le=le.map(P=>o(P))),se&&(le=le.map(P=>D(P))),le=z(le,j),te(le,R)}function z(B,j){var R=f(B);for(var oe of j)oe=d(oe,R),B=r(B,a(s(b(oe,B),b(oe,oe)),oe));return B}function X(B){return l(u(b(B,B)))}function te(B,j){var R=j==="BigNumber",oe=j==="Complex",se=R?o(1):oe?D(1):1;return a(s(se,X(B)),B)}return A}function i5(t){var{config:e,addScalar:r,subtract:n,abs:a,atan:i,cos:s,sin:u,multiplyScalar:l,inv:o,bignumber:c,multiply:f,add:d}=t;function m(E,N){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.relTol,C=arguments.length>3?arguments[3]:void 0,O=arguments.length>4?arguments[4]:void 0;if(C==="number")return h(E,_,O);if(C==="BigNumber")return p(E,_,O);throw TypeError("Unsupported data type: "+C)}function h(E,N,_){var C=E.length,O=Math.abs(N/C),I,k;if(_){k=new Array(C);for(var M=0;M<C;M++)k[M]=Array(C).fill(0),k[M][M]=1}for(var H=b(E);Math.abs(H[1])>=Math.abs(O);){var q=H[0][0],z=H[0][1];I=g(E[q][q],E[z][z],E[q][z]),E=w(E,I,q,z),_&&(k=D(k,I,q,z)),H=b(E)}for(var X=Array(C).fill(0),te=0;te<C;te++)X[te]=E[te][te];return S(je(X),k,_)}function p(E,N,_){var C=E.length,O=a(N/C),I,k;if(_){k=new Array(C);for(var M=0;M<C;M++)k[M]=Array(C).fill(0),k[M][M]=1}for(var H=A(E);a(H[1])>=a(O);){var q=H[0][0],z=H[0][1];I=v(E[q][q],E[z][z],E[q][z]),E=x(E,I,q,z),_&&(k=y(k,I,q,z)),H=A(E)}for(var X=Array(C).fill(0),te=0;te<C;te++)X[te]=E[te][te];return S(je(X),k,_)}function g(E,N,_){var C=N-E;return Math.abs(C)<=e.relTol?Math.PI/4:.5*Math.atan(2*_/(N-E))}function v(E,N,_){var C=n(N,E);return a(C)<=e.relTol?c(-1).acos().div(4):l(.5,i(f(2,_,o(C))))}function D(E,N,_,C){for(var O=E.length,I=Math.cos(N),k=Math.sin(N),M=Array(O).fill(0),H=Array(O).fill(0),q=0;q<O;q++)M[q]=I*E[q][_]-k*E[q][C],H[q]=k*E[q][_]+I*E[q][C];for(var z=0;z<O;z++)E[z][_]=M[z],E[z][C]=H[z];return E}function y(E,N,_,C){for(var O=E.length,I=s(N),k=u(N),M=Array(O).fill(c(0)),H=Array(O).fill(c(0)),q=0;q<O;q++)M[q]=n(l(I,E[q][_]),l(k,E[q][C])),H[q]=r(l(k,E[q][_]),l(I,E[q][C]));for(var z=0;z<O;z++)E[z][_]=M[z],E[z][C]=H[z];return E}function x(E,N,_,C){for(var O=E.length,I=c(s(N)),k=c(u(N)),M=l(I,I),H=l(k,k),q=Array(O).fill(c(0)),z=Array(O).fill(c(0)),X=f(c(2),I,k,E[_][C]),te=r(n(l(M,E[_][_]),X),l(H,E[C][C])),B=d(l(H,E[_][_]),X,l(M,E[C][C])),j=0;j<O;j++)q[j]=n(l(I,E[_][j]),l(k,E[C][j])),z[j]=r(l(k,E[_][j]),l(I,E[C][j]));E[_][_]=te,E[C][C]=B,E[_][C]=c(0),E[C][_]=c(0);for(var R=0;R<O;R++)R!==_&&R!==C&&(E[_][R]=q[R],E[R][_]=q[R],E[C][R]=z[R],E[R][C]=z[R]);return E}function w(E,N,_,C){for(var O=E.length,I=Math.cos(N),k=Math.sin(N),M=I*I,H=k*k,q=Array(O).fill(0),z=Array(O).fill(0),X=M*E[_][_]-2*I*k*E[_][C]+H*E[C][C],te=H*E[_][_]+2*I*k*E[_][C]+M*E[C][C],B=0;B<O;B++)q[B]=I*E[_][B]-k*E[C][B],z[B]=k*E[_][B]+I*E[C][B];E[_][_]=X,E[C][C]=te,E[_][C]=0,E[C][_]=0;for(var j=0;j<O;j++)j!==_&&j!==C&&(E[_][j]=q[j],E[j][_]=q[j],E[C][j]=z[j],E[j][C]=z[j]);return E}function b(E){for(var N=E.length,_=0,C=[0,1],O=0;O<N;O++)for(var I=O+1;I<N;I++)Math.abs(_)<Math.abs(E[O][I])&&(_=Math.abs(E[O][I]),C=[O,I]);return[C,_]}function A(E){for(var N=E.length,_=0,C=[0,1],O=0;O<N;O++)for(var I=O+1;I<N;I++)a(_)<a(E[O][I])&&(_=a(E[O][I]),C=[O,I]);return[C,_]}function S(E,N,_){var C=E.length,O=Array(C),I;if(_){I=Array(C);for(var k=0;k<C;k++)I[k]=Array(C)}for(var M=0;M<C;M++){for(var H=0,q=E[0],z=0;z<E.length;z++)a(E[z])<a(q)&&(H=z,q=E[H]);if(O[M]=E.splice(H,1)[0],_)for(var X=0;X<C;X++)I[M][X]=N[X][H],N[X].splice(H,1)}if(!_)return{values:O};var te=I.map((B,j)=>({value:O[j],vector:B}));return{values:O,eigenvectors:te}}return m}var s5="eigs",o5=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],u5=U(s5,o5,t=>{var{config:e,typed:r,matrix:n,addScalar:a,subtract:i,equal:s,abs:u,atan:l,cos:o,sin:c,multiplyScalar:f,divideScalar:d,inv:m,bignumber:h,multiply:p,add:g,larger:v,column:D,flatten:y,number:x,complex:w,sqrt:b,diag:A,size:S,reshape:E,qr:N,usolve:_,usolveAll:C,im:O,re:I,smaller:k,matrixFromColumns:M,dot:H}=t,q=i5({config:e,addScalar:a,subtract:i,abs:u,atan:l,cos:o,sin:c,multiplyScalar:f,inv:m,bignumber:h,multiply:p,add:g}),z=a5({addScalar:a,subtract:i,multiply:p,multiplyScalar:f,flatten:y,divideScalar:d,sqrt:b,abs:u,bignumber:h,diag:A,size:S,reshape:E,qr:N,inv:m,usolve:_,usolveAll:C,equal:s,complex:w,larger:v,smaller:k,matrixFromColumns:M,dot:H});return r("eigs",{Array:function(le){return X(n(le))},"Array, number|BigNumber":function(le,P){return X(n(le),{precision:P})},"Array, Object"(se,le){return X(n(se),le)},Matrix:function(le){return X(le,{matricize:!0})},"Matrix, number|BigNumber":function(le,P){return X(le,{precision:P,matricize:!0})},"Matrix, Object":function(le,P){var W={matricize:!0};return jt(W,P),X(le,W)}});function X(se){var le,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W="eigenvectors"in P?P.eigenvectors:!0,J=(le=P.precision)!==null&&le!==void 0?le:e.relTol,re=te(se,J,W);return P.matricize&&(re.values=n(re.values),W&&(re.eigenvectors=re.eigenvectors.map(ae=>{var{value:he,vector:fe}=ae;return{value:he,vector:n(fe)}}))),W&&Object.defineProperty(re,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),re}function te(se,le,P){var W=se.toArray(),J=se.size();if(J.length!==2||J[0]!==J[1])throw new RangeError("Matrix must be square (size: ".concat(ot(J),")"));var re=J[0];if(j(W,re,le)&&(R(W,re),B(W,re,le))){var ae=oe(se,W,re);return q(W,re,le,ae,P)}var he=oe(se,W,re);return z(W,re,le,he,P)}function B(se,le,P){for(var W=0;W<le;W++)for(var J=W;J<le;J++)if(v(h(u(i(se[W][J],se[J][W]))),P))return!1;return!0}function j(se,le,P){for(var W=0;W<le;W++)for(var J=0;J<le;J++)if(v(h(u(O(se[W][J]))),P))return!1;return!0}function R(se,le){for(var P=0;P<le;P++)for(var W=0;W<le;W++)se[P][W]=I(se[P][W])}function oe(se,le,P){var W=se.datatype();if(W==="number"||W==="BigNumber"||W==="Complex")return W;for(var J=!1,re=!1,ae=!1,he=0;he<P;he++)for(var fe=0;fe<P;fe++){var De=le[he][fe];if(qe(De)||ea(De))J=!0;else if(Qe(De))re=!0;else if(Wr(De))ae=!0;else throw TypeError("Unsupported type in Matrix: "+Et(De))}if(re&&ae&&console.warn("Complex BigNumbers not supported, this operation will lose precission."),ae){for(var Te=0;Te<P;Te++)for(var Ie=0;Ie<P;Ie++)le[Te][Ie]=w(le[Te][Ie]);return"Complex"}if(re){for(var Me=0;Me<P;Me++)for(var Le=0;Le<P;Le++)le[Me][Le]=h(le[Me][Le]);return"BigNumber"}if(J){for(var Y=0;Y<P;Y++)for(var ee=0;ee<P;ee++)le[Y][ee]=x(le[Y][ee]);return"number"}else throw TypeError("Matrix contains unsupported types only.")}}),xg="expm",l5=["typed","abs","add","identity","inv","multiply"],c5=U(xg,l5,t=>{var{typed:e,abs:r,add:n,identity:a,inv:i,multiply:s}=t;return e(xg,{Matrix:function(f){var d=f.size();if(d.length!==2||d[0]!==d[1])throw new RangeError("Matrix must be square (size: "+ot(d)+")");for(var m=d[0],h=1e-15,p=u(f),g=l(p,h),v=g.q,D=g.j,y=s(f,Math.pow(2,-D)),x=a(m),w=a(m),b=1,A=y,S=-1,E=1;E<=v;E++)E>1&&(A=s(A,y),S=-S),b=b*(v-E+1)/((2*v-E+1)*E),x=n(x,s(b,A)),w=n(w,s(b*S,A));for(var N=s(i(w),x),_=0;_<D;_++)N=s(N,N);return On(f)?f.createSparseMatrix(N):N}});function u(c){for(var f=c.size()[0],d=0,m=0;m<f;m++){for(var h=0,p=0;p<f;p++)h+=r(c.get([m,p]));d=Math.max(h,d)}return d}function l(c,f){for(var d=30,m=0;m<d;m++)for(var h=0;h<=m;h++){var p=m-h;if(o(c,h,p)<f)return{q:h,j:p}}throw new Error("Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)")}function o(c,f,d){for(var m=1,h=2;h<=f;h++)m*=h;for(var p=m,g=f+1;g<=2*f;g++)p*=g;var v=p*(2*f+1);return 8*Math.pow(c/Math.pow(2,d),2*f)*m*m/(p*v)}}),Dg="sqrtm",f5=["typed","abs","add","multiply","map","sqrt","subtract","inv","size","max","identity"],d5=U(Dg,f5,t=>{var{typed:e,abs:r,add:n,multiply:a,map:i,sqrt:s,subtract:u,inv:l,size:o,max:c,identity:f}=t,d=1e3,m=1e-6;function h(p){var g,v=0,D=p,y=f(o(p));do{var x=D;if(D=a(.5,n(x,l(y))),y=a(.5,n(y,l(x))),g=c(r(u(D,x))),g>m&&++v>d)throw new Error("computing square root of matrix: iterative method could not converge")}while(g>m);return D}return e(Dg,{"Array | Matrix":function(g){var v=ze(g)?g.size():Ke(g);switch(v.length){case 1:if(v[0]===1)return i(g,s);throw new RangeError("Matrix must be square (size: "+ot(v)+")");case 2:{var D=v[0],y=v[1];if(D===y)return h(g);throw new RangeError("Matrix must be square (size: "+ot(v)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+ot(v)+")")}}})}),Eg="sylvester",m5=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],h5=U(Eg,m5,t=>{var{typed:e,schur:r,matrixFromColumns:n,matrix:a,multiply:i,range:s,concat:u,transpose:l,index:o,subset:c,add:f,subtract:d,identity:m,lusolve:h,abs:p,config:g}=t;return e(Eg,{"Matrix, Matrix, Matrix":v,"Array, Matrix, Matrix":function(y,x,w){return v(a(y),x,w)},"Array, Array, Matrix":function(y,x,w){return v(a(y),a(x),w)},"Array, Matrix, Array":function(y,x,w){return v(a(y),x,a(w))},"Matrix, Array, Matrix":function(y,x,w){return v(y,a(x),w)},"Matrix, Array, Array":function(y,x,w){return v(y,a(x),a(w))},"Matrix, Matrix, Array":function(y,x,w){return v(y,x,a(w))},"Array, Array, Array":function(y,x,w){return v(a(y),a(x),a(w)).toArray()}});function v(D,y,x){for(var w=y.size()[0],b=D.size()[0],A=r(D),S=A.T,E=A.U,N=r(i(-1,y)),_=N.T,C=N.U,O=i(i(l(E),x),C),I=s(0,b),k=[],M=(he,fe)=>u(he,fe,1),H=(he,fe)=>u(he,fe,0),q=0;q<w;q++)if(q<w-1&&p(c(_,o(q+1,q)))>1e-5){for(var z=H(c(O,o(I,[q])),c(O,o(I,[q+1]))),X=0;X<q;X++)z=f(z,H(i(k[X],c(_,o(X,q))),i(k[X],c(_,o(X,q+1)))));var te=i(m(b),i(-1,c(_,o(q,q)))),B=i(m(b),i(-1,c(_,o(q+1,q)))),j=i(m(b),i(-1,c(_,o(q,q+1)))),R=i(m(b),i(-1,c(_,o(q+1,q+1)))),oe=H(M(f(S,te),B),M(j,f(S,R))),se=h(oe,z);k[q]=se.subset(o(s(0,b),[0])),k[q+1]=se.subset(o(s(b,2*b),[0])),q++}else{for(var le=c(O,o(I,[q])),P=0;P<q;P++)le=f(le,i(k[P],c(_,o(P,q))));var W=c(_,o(q,q)),J=d(S,i(W,m(b)));k[q]=h(J,le)}var re=a(n(...k)),ae=i(E,i(re,l(C)));return ae}}),Ag="schur",p5=["typed","matrix","identity","multiply","qr","norm","subtract"],v5=U(Ag,p5,t=>{var{typed:e,matrix:r,identity:n,multiply:a,qr:i,norm:s,subtract:u}=t;return e(Ag,{Array:function(c){var f=l(r(c));return{U:f.U.valueOf(),T:f.T.valueOf()}},Matrix:function(c){return l(c)}});function l(o){var c=o.size()[0],f=o,d=n(c),m=0,h;do{h=f;var p=i(f),g=p.Q,v=p.R;if(f=a(v,g),d=a(d,g),m++>100)break}while(s(u(f,h))>1e-4);return{U:d,T:f}}}),Sg="lyap",g5=["typed","matrix","sylvester","multiply","transpose"],y5=U(Sg,g5,t=>{var{typed:e,matrix:r,sylvester:n,multiply:a,transpose:i}=t;return e(Sg,{"Matrix, Matrix":function(u,l){return n(u,i(u),a(-1,l))},"Array, Matrix":function(u,l){return n(r(u),i(r(u)),a(-1,l))},"Matrix, Array":function(u,l){return n(u,i(r(u)),r(a(-1,l)))},"Array, Array":function(u,l){return n(r(u),i(r(u)),r(a(-1,l))).toArray()}})}),b5="divide",w5=["typed","matrix","multiply","equalScalar","divideScalar","inv"],x5=U(b5,w5,t=>{var{typed:e,matrix:r,multiply:n,equalScalar:a,divideScalar:i,inv:s}=t,u=tr({typed:e,equalScalar:a}),l=qr({typed:e});return e("divide",qf({"Array | Matrix, Array | Matrix":function(c,f){return n(c,s(f))},"DenseMatrix, any":function(c,f){return l(c,f,i,!1)},"SparseMatrix, any":function(c,f){return u(c,f,i,!1)},"Array, any":function(c,f){return l(r(c),f,i,!1).valueOf()},"any, Array | Matrix":function(c,f){return n(c,s(f))}},i.signatures))}),Ng="distance",D5=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],E5=U(Ng,D5,t=>{var{typed:e,addScalar:r,subtractScalar:n,multiplyScalar:a,divideScalar:i,deepEqual:s,sqrt:u,abs:l}=t;return e(Ng,{"Array, Array, Array":function(w,b,A){if(w.length===2&&b.length===2&&A.length===2){if(!c(w))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!c(b))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!c(A))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(s(b,A))throw new TypeError("LinePoint1 should not be same with LinePoint2");var S=n(A[1],b[1]),E=n(b[0],A[0]),N=n(a(A[0],b[1]),a(b[0],A[1]));return g(w[0],w[1],S,E,N)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(w,b,A){if(Object.keys(w).length===2&&Object.keys(b).length===2&&Object.keys(A).length===2){if(!c(w))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!c(b))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!c(A))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(s(h(b),h(A)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in w&&"pointY"in w&&"lineOnePtX"in b&&"lineOnePtY"in b&&"lineTwoPtX"in A&&"lineTwoPtY"in A){var S=n(A.lineTwoPtY,b.lineOnePtY),E=n(b.lineOnePtX,A.lineTwoPtX),N=n(a(A.lineTwoPtX,b.lineOnePtY),a(b.lineOnePtX,A.lineTwoPtY));return g(w.pointX,w.pointY,S,E,N)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(w,b){if(w.length===2&&b.length===3){if(!c(w))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!f(b))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return g(w[0],w[1],b[0],b[1],b[2])}else if(w.length===3&&b.length===6){if(!f(w))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!m(b))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return v(w[0],w[1],w[2],b[0],b[1],b[2],b[3],b[4],b[5])}else if(w.length===b.length&&w.length>0){if(!d(w))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!d(b))throw new TypeError("All values of an array should be numbers or BigNumbers");return D(w,b)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(w,b){if(Object.keys(w).length===2&&Object.keys(b).length===3){if(!c(w))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!f(b))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in w&&"pointY"in w&&"xCoeffLine"in b&&"yCoeffLine"in b&&"constant"in b)return g(w.pointX,w.pointY,b.xCoeffLine,b.yCoeffLine,b.constant);throw new TypeError("Key names do not match")}else if(Object.keys(w).length===3&&Object.keys(b).length===6){if(!f(w))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!m(b))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in w&&"pointY"in w&&"x0"in b&&"y0"in b&&"z0"in b&&"a"in b&&"b"in b&&"c"in b)return v(w.pointX,w.pointY,w.pointZ,b.x0,b.y0,b.z0,b.a,b.b,b.c);throw new TypeError("Key names do not match")}else if(Object.keys(w).length===2&&Object.keys(b).length===2){if(!c(w))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!c(b))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in w&&"pointOneY"in w&&"pointTwoX"in b&&"pointTwoY"in b)return D([w.pointOneX,w.pointOneY],[b.pointTwoX,b.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(w).length===3&&Object.keys(b).length===3){if(!f(w))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!f(b))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in w&&"pointOneY"in w&&"pointOneZ"in w&&"pointTwoX"in b&&"pointTwoY"in b&&"pointTwoZ"in b)return D([w.pointOneX,w.pointOneY,w.pointOneZ],[b.pointTwoX,b.pointTwoY,b.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(w){if(!p(w))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return y(w)}});function o(x){return typeof x=="number"||Qe(x)}function c(x){return x.constructor!==Array&&(x=h(x)),o(x[0])&&o(x[1])}function f(x){return x.constructor!==Array&&(x=h(x)),o(x[0])&&o(x[1])&&o(x[2])}function d(x){return Array.isArray(x)||(x=h(x)),x.every(o)}function m(x){return x.constructor!==Array&&(x=h(x)),o(x[0])&&o(x[1])&&o(x[2])&&o(x[3])&&o(x[4])&&o(x[5])}function h(x){for(var w=Object.keys(x),b=[],A=0;A<w.length;A++)b.push(x[w[A]]);return b}function p(x){if(x[0].length===2&&o(x[0][0])&&o(x[0][1])){if(x.some(w=>w.length!==2||!o(w[0])||!o(w[1])))return!1}else if(x[0].length===3&&o(x[0][0])&&o(x[0][1])&&o(x[0][2])){if(x.some(w=>w.length!==3||!o(w[0])||!o(w[1])||!o(w[2])))return!1}else return!1;return!0}function g(x,w,b,A,S){var E=l(r(r(a(b,x),a(A,w)),S)),N=u(r(a(b,b),a(A,A)));return i(E,N)}function v(x,w,b,A,S,E,N,_,C){var O=[n(a(n(S,w),C),a(n(E,b),_)),n(a(n(E,b),N),a(n(A,x),C)),n(a(n(A,x),_),a(n(S,w),N))];O=u(r(r(a(O[0],O[0]),a(O[1],O[1])),a(O[2],O[2])));var I=u(r(r(a(N,N),a(_,_)),a(C,C)));return i(O,I)}function D(x,w){for(var b=x.length,A=0,S=0,E=0;E<b;E++)S=n(x[E],w[E]),A=r(a(S,S),A);return u(A)}function y(x){for(var w=[],b=[],A=[],S=0;S<x.length-1;S++)for(var E=S+1;E<x.length;E++)x[0].length===2?(b=[x[S][0],x[S][1]],A=[x[E][0],x[E][1]]):x[0].length===3&&(b=[x[S][0],x[S][1],x[S][2]],A=[x[E][0],x[E][1],x[E][2]]),w.push(D(b,A));return w}}),A5="intersect",S5=["typed","config","abs","add","addScalar","matrix","multiply","multiplyScalar","divideScalar","subtract","smaller","equalScalar","flatten","isZero","isNumeric"],N5=U(A5,S5,t=>{var{typed:e,config:r,abs:n,add:a,addScalar:i,matrix:s,multiply:u,multiplyScalar:l,divideScalar:o,subtract:c,smaller:f,equalScalar:d,flatten:m,isZero:h,isNumeric:p}=t;return e("intersect",{"Array, Array, Array":g,"Array, Array, Array, Array":v,"Matrix, Matrix, Matrix":function(_,C,O){var I=g(_.valueOf(),C.valueOf(),O.valueOf());return I===null?null:s(I)},"Matrix, Matrix, Matrix, Matrix":function(_,C,O,I){var k=v(_.valueOf(),C.valueOf(),O.valueOf(),I.valueOf());return k===null?null:s(k)}});function g(N,_,C){if(N=D(N),_=D(_),C=D(C),!x(N))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!x(_))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!w(C))throw new TypeError("Array with 4 numbers expected as third argument");return E(N[0],N[1],N[2],_[0],_[1],_[2],C[0],C[1],C[2],C[3])}function v(N,_,C,O){if(N=D(N),_=D(_),C=D(C),O=D(O),N.length===2){if(!y(N))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!y(_))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!y(C))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!y(O))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return b(N,_,C,O)}else if(N.length===3){if(!x(N))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!x(_))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!x(C))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!x(O))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return S(N[0],N[1],N[2],_[0],_[1],_[2],C[0],C[1],C[2],O[0],O[1],O[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function D(N){return N.length===1?N[0]:N.length>1&&Array.isArray(N[0])&&N.every(_=>Array.isArray(_)&&_.length===1)?m(N):N}function y(N){return N.length===2&&p(N[0])&&p(N[1])}function x(N){return N.length===3&&p(N[0])&&p(N[1])&&p(N[2])}function w(N){return N.length===4&&p(N[0])&&p(N[1])&&p(N[2])&&p(N[3])}function b(N,_,C,O){var I=N,k=C,M=c(I,_),H=c(k,O),q=c(l(M[0],H[1]),l(H[0],M[1]));if(h(q)||f(n(q),r.relTol))return null;var z=l(H[0],I[1]),X=l(H[1],I[0]),te=l(H[0],k[1]),B=l(H[1],k[0]),j=o(i(c(c(z,X),te),B),q);return a(u(M,j),I)}function A(N,_,C,O,I,k,M,H,q,z,X,te){var B=l(c(N,_),c(C,O)),j=l(c(I,k),c(M,H)),R=l(c(q,z),c(X,te));return i(i(B,j),R)}function S(N,_,C,O,I,k,M,H,q,z,X,te){var B=A(N,M,z,M,_,H,X,H,C,q,te,q),j=A(z,M,O,N,X,H,I,_,te,q,k,C),R=A(N,M,O,N,_,H,I,_,C,q,k,C),oe=A(z,M,z,M,X,H,X,H,te,q,te,q),se=A(O,N,O,N,I,_,I,_,k,C,k,C),le=c(l(B,j),l(R,oe)),P=c(l(se,oe),l(j,j));if(h(P))return null;var W=o(le,P),J=o(i(B,l(W,j)),oe),re=i(N,l(W,c(O,N))),ae=i(_,l(W,c(I,_))),he=i(C,l(W,c(k,C))),fe=i(M,l(J,c(z,M))),De=i(H,l(J,c(X,H))),Te=i(q,l(J,c(te,q)));return d(re,fe)&&d(ae,De)&&d(he,Te)?[re,ae,he]:null}function E(N,_,C,O,I,k,M,H,q,z){var X=l(N,M),te=l(O,M),B=l(_,H),j=l(I,H),R=l(C,q),oe=l(k,q),se=c(c(c(z,X),B),R),le=c(c(c(i(i(te,j),oe),X),B),R),P=o(se,le),W=i(N,l(P,c(O,N))),J=i(_,l(P,c(I,_))),re=i(C,l(P,c(k,C)));return[W,J,re]}}),_g="sum",_5=["typed","config","add","numeric"],Cg=U(_g,_5,t=>{var{typed:e,config:r,add:n,numeric:a}=t;return e(_g,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":s,"...":function(l){if(Va(l))throw new TypeError("Scalar values expected in function sum");return i(l)}});function i(u){var l;return Yn(u,function(o){try{l=l===void 0?o:n(l,o)}catch(c){throw vr(c,"sum",o)}}),l===void 0&&(l=a(0,r.number)),typeof l=="string"&&(l=a(l,kn(l,r))),l}function s(u,l){try{var o=Ws(u,l,n);return o}catch(c){throw vr(c,"sum")}}}),No="cumsum",C5=["typed","add","unaryPlus"],Mg=U(No,C5,t=>{var{typed:e,add:r,unaryPlus:n}=t;return e(No,{Array:a,Matrix:function(o){return o.create(a(o.valueOf(),o.datatype()))},"Array, number | BigNumber":s,"Matrix, number | BigNumber":function(o,c){return o.create(s(o.valueOf(),c),o.datatype())},"...":function(o){if(Va(o))throw new TypeError("All values expected to be scalar in function cumsum");return a(o)}});function a(l){try{return i(l)}catch(o){throw vr(o,No)}}function i(l){if(l.length===0)return[];for(var o=[n(l[0])],c=1;c<l.length;++c)o.push(r(o[c-1],l[c]));return o}function s(l,o){var c=Ke(l);if(o<0||o>=c.length)throw new $r(o,c.length);try{return u(l,o)}catch(f){throw vr(f,No)}}function u(l,o){var c,f,d;if(o<=0){var m=l[0][0];if(Array.isArray(m)){for(d=Rd(l),f=[],c=0;c<d.length;c++)f[c]=u(d[c],o-1);return f}else return i(l)}else{for(f=[],c=0;c<l.length;c++)f[c]=u(l[c],o-1);return f}}}),Tg="mean",M5=["typed","add","divide"],Fg=U(Tg,M5,t=>{var{typed:e,add:r,divide:n}=t;return e(Tg,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":a,"...":function(u){if(Va(u))throw new TypeError("Scalar values expected in function mean");return i(u)}});function a(s,u){try{var l=Ws(s,u,r),o=Array.isArray(s)?Ke(s):s.size();return n(l,o[u])}catch(c){throw vr(c,"mean")}}function i(s){var u,l=0;if(Yn(s,function(o){try{u=u===void 0?o:r(u,o),l++}catch(c){throw vr(c,"mean",o)}}),l===0)throw new Error("Cannot calculate the mean of an empty array");return n(u,l)}}),Og="median",T5=["typed","add","divide","compare","partitionSelect"],F5=U(Og,T5,t=>{var{typed:e,add:r,divide:n,compare:a,partitionSelect:i}=t;function s(o){try{o=pt(o.valueOf());var c=o.length;if(c===0)throw new Error("Cannot calculate median of an empty array");if(c%2===0){for(var f=c/2-1,d=i(o,f+1),m=o[f],h=0;h<f;++h)a(o[h],m)>0&&(m=o[h]);return l(m,d)}else{var p=i(o,(c-1)/2);return u(p)}}catch(g){throw vr(g,"median")}}var u=e({"number | BigNumber | Complex | Unit":function(c){return c}}),l=e({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(c,f){return n(r(c,f),2)}});return e(Og,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(c,f){throw new Error("median(A, dim) is not yet supported")},"...":function(c){if(Va(c))throw new TypeError("Scalar values expected in function median");return s(c)}})}),Bg="mad",O5=["typed","abs","map","median","subtract"],B5=U(Bg,O5,t=>{var{typed:e,abs:r,map:n,median:a,subtract:i}=t;return e(Bg,{"Array | Matrix":s,"...":function(l){return s(l)}});function s(u){if(u=pt(u.valueOf()),u.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var l=a(u);return a(n(u,function(o){return r(i(o,l))}))}catch(o){throw o instanceof TypeError&&o.message.includes("median")?new TypeError(o.message.replace("median","mad")):vr(o,"mad")}}}),Fl="unbiased",kg="variance",k5=["typed","add","subtract","multiply","divide","mapSlices","isNaN"],Ig=U(kg,k5,t=>{var{typed:e,add:r,subtract:n,multiply:a,divide:i,mapSlices:s,isNaN:u}=t;return e(kg,{"Array | Matrix":function(f){return l(f,Fl)},"Array | Matrix, string":l,"Array | Matrix, number | BigNumber":function(f,d){return o(f,d,Fl)},"Array | Matrix, number | BigNumber, string":o,"...":function(f){return l(f,Fl)}});function l(c,f){var d,m=0;if(c.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(Yn(c,function(g){try{d=d===void 0?g:r(d,g),m++}catch(v){throw vr(v,"variance",g)}}),m===0)throw new Error("Cannot calculate variance of an empty array");var h=i(d,m);if(d=void 0,Yn(c,function(g){var v=n(g,h);d=d===void 0?a(v,v):r(d,a(v,v))}),u(d))return d;switch(f){case"uncorrected":return i(d,m);case"biased":return i(d,m+1);case"unbiased":{var p=Qe(d)?d.mul(0):0;return m===1?p:i(d,m-1)}default:throw new Error('Unknown normalization "'+f+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function o(c,f,d){try{if(c.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return s(c,f,m=>l(m,d))}catch(m){throw vr(m,"variance")}}}),Lg="quantileSeq",I5=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger","mapSlices"],Rg=U(Lg,I5,t=>{var{typed:e,bignumber:r,add:n,subtract:a,divide:i,multiply:s,partitionSelect:u,compare:l,isInteger:o,smaller:c,smallerEq:f,larger:d,mapSlices:m}=t;return e(Lg,{"Array | Matrix, number | BigNumber":(D,y)=>p(D,y,!1),"Array | Matrix, number | BigNumber, number":(D,y,x)=>h(D,y,!1,x,p),"Array | Matrix, number | BigNumber, boolean":p,"Array | Matrix, number | BigNumber, boolean, number":(D,y,x,w)=>h(D,y,x,w,p),"Array | Matrix, Array | Matrix":(D,y)=>g(D,y,!1),"Array | Matrix, Array | Matrix, number":(D,y,x)=>h(D,y,!1,x,g),"Array | Matrix, Array | Matrix, boolean":g,"Array | Matrix, Array | Matrix, boolean, number":(D,y,x,w)=>h(D,y,x,w,g)});function h(D,y,x,w,b){return m(D,w,A=>b(A,y,x))}function p(D,y,x){var w,b=D.valueOf();if(c(y,0))throw new Error("N/prob must be non-negative");if(f(y,1))return qe(y)?v(b,y,x):r(v(b,y,x));if(d(y,1)){if(!o(y))throw new Error("N must be a positive integer");if(d(y,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var A=n(y,1);w=[];for(var S=0;c(S,y);S++){var E=i(S+1,A);w.push(v(b,E,x))}return qe(y)?w:r(w)}}function g(D,y,x){for(var w=D.valueOf(),b=y.valueOf(),A=[],S=0;S<b.length;++S)A.push(v(w,b[S],x));return A}function v(D,y,x){var w=pt(D),b=w.length;if(b===0)throw new Error("Cannot calculate quantile of an empty sequence");var A=qe(y)?y*(b-1):y.times(b-1),S=qe(y)?Math.floor(A):A.floor().toNumber(),E=qe(y)?A%1:A.minus(S);if(o(A))return x?w[A]:u(w,qe(y)?A:A.valueOf());var N,_;if(x)N=w[S],_=w[S+1];else{_=u(w,S+1),N=w[S];for(var C=0;C<S;++C)l(w[C],N)>0&&(N=w[C])}return n(s(N,a(1,E)),s(_,E))}}),$g="std",L5=["typed","map","sqrt","variance"],Pg=U($g,L5,t=>{var{typed:e,map:r,sqrt:n,variance:a}=t;return e($g,{"Array | Matrix":i,"Array | Matrix, string":i,"Array | Matrix, number | BigNumber":i,"Array | Matrix, number | BigNumber, string":i,"...":function(u){return i(u)}});function i(s,u){if(s.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var l=a.apply(null,arguments);return wr(l)?r(l,n):n(l)}catch(o){throw o instanceof TypeError&&o.message.includes(" variance")?new TypeError(o.message.replace(" variance"," std")):o}}}),qg="corr",R5=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],$5=U(qg,R5,t=>{var{typed:e,matrix:r,sqrt:n,sum:a,add:i,subtract:s,multiply:u,pow:l,divide:o}=t;return e(qg,{"Array, Array":function(m,h){return c(m,h)},"Matrix, Matrix":function(m,h){var p=c(m.toArray(),h.toArray());return Array.isArray(p)?r(p):p}});function c(d,m){var h=[];if(Array.isArray(d[0])&&Array.isArray(m[0])){if(d.length!==m.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var p=0;p<d.length;p++){if(d[p].length!==m[p].length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");h.push(f(d[p],m[p]))}return h}else{if(d.length!==m.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");return f(d,m)}}function f(d,m){var h=d.length,p=a(d),g=a(m),v=d.reduce((b,A,S)=>i(b,u(A,m[S])),0),D=a(d.map(b=>l(b,2))),y=a(m.map(b=>l(b,2))),x=s(u(h,v),u(p,g)),w=n(u(s(u(h,D),l(p,2)),s(u(h,y),l(g,2))));return o(x,w)}}),Ug="combinations",P5=["typed"],q5=U(Ug,P5,t=>{var{typed:e}=t;return e(Ug,{"number, number":um,"BigNumber, BigNumber":function(n,a){var i=n.constructor,s,u,l=n.minus(a),o=new i(1);if(!zg(n)||!zg(a))throw new TypeError("Positive integer value expected in function combinations");if(a.gt(n))throw new TypeError("k must be less than n in function combinations");if(s=o,a.lt(l))for(u=o;u.lte(l);u=u.plus(o))s=s.times(a.plus(u)).dividedBy(u);else for(u=o;u.lte(a);u=u.plus(o))s=s.times(l.plus(u)).dividedBy(u);return s}})});function zg(t){return t.isInteger()&&t.gte(0)}var Yg="combinationsWithRep",U5=["typed"],z5=U(Yg,U5,t=>{var{typed:e}=t;return e(Yg,{"number, number":function(n,a){if(!$e(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!$e(a)||a<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(n<1)throw new TypeError("k must be less than or equal to n + k - 1");if(a<n-1){var i=En(n,n+a-1);return i/En(1,a)}var s=En(a+1,n+a-1);return s/En(1,n-1)},"BigNumber, BigNumber":function(n,a){var i=n.constructor,s,u,l=new i(1),o=n.minus(l);if(!Vg(n)||!Vg(a))throw new TypeError("Positive integer value expected in function combinationsWithRep");if(n.lt(l))throw new TypeError("k must be less than or equal to n + k - 1 in function combinationsWithRep");if(s=l,a.lt(o))for(u=l;u.lte(o);u=u.plus(l))s=s.times(a.plus(u)).dividedBy(u);else for(u=l;u.lte(a);u=u.plus(l))s=s.times(o.plus(u)).dividedBy(u);return s}})});function Vg(t){return t.isInteger()&&t.gte(0)}var Hg="gamma",Y5=["typed","config","multiplyScalar","pow","BigNumber","Complex"],V5=U(Hg,Y5,t=>{var{typed:e,config:r,multiplyScalar:n,pow:a,BigNumber:i,Complex:s}=t;function u(o){if(o.im===0)return Zs(o.re);if(o.re<.5){var c=new s(1-o.re,-o.im),f=new s(Math.PI*o.re,Math.PI*o.im);return new s(Math.PI).div(f.sin()).div(u(c))}o=new s(o.re-1,o.im);for(var d=new s(Ga[0],0),m=1;m<Ga.length;++m){var h=new s(Ga[m],0);d=d.add(h.div(o.add(m)))}var p=new s(o.re+cm+.5,o.im),g=Math.sqrt(2*Math.PI),v=p.pow(o.add(.5)),D=p.neg().exp();return d.mul(g).mul(v).mul(D)}return e(Hg,{number:Zs,Complex:u,BigNumber:function(c){if(c.isInteger())return c.isNegative()||c.isZero()?new i(1/0):l(c.minus(1));if(!c.isFinite())return new i(c.isNegative()?NaN:1/0);throw new Error("Integer BigNumber expected")}});function l(o){if(o<8)return new i([1,1,2,6,24,120,720,5040][o]);var c=r.precision+(Math.log(o.toNumber())|0),f=i.clone({precision:c});if(o%2===1)return o.times(l(new i(o-1)));for(var d=o,m=new f(o),h=o.toNumber();d>2;)d-=2,h+=d,m=m.times(h);return new i(m.toPrecision(i.precision))}}),Wg="lgamma",H5=["Complex","typed"],W5=U(Wg,H5,t=>{var{Complex:e,typed:r}=t,n=7,a=7,i=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return r(Wg,{number:Xs,Complex:s,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function s(o){var c=6.283185307179586,f=1.1447298858494002,d=.1;if(o.isNaN())return new e(NaN,NaN);if(o.im===0)return new e(Xs(o.re),0);if(o.re>=n||Math.abs(o.im)>=a)return u(o);if(o.re<=d){var m=_D(c,o.im)*Math.floor(.5*o.re+.25),h=o.mul(Math.PI).sin().log(),p=s(new e(1-o.re,-o.im));return new e(f,m).sub(h).sub(p)}else return o.im>=0?l(o):l(o.conjugate()).conjugate()}function u(o){for(var c=o.sub(.5).mul(o.log()).sub(o).add(fm),f=new e(1,0).div(o),d=f.div(o),m=i[0],h=i[1],p=2*d.re,g=d.re*d.re+d.im*d.im,v=2;v<8;v++){var D=h;h=-g*m+i[v],m=p*m+D}var y=f.mul(d.mul(m).add(h));return c.add(y)}function l(o){var c=0,f=0,d=o;for(o=o.add(1);o.re<=n;){d=d.mul(o);var m=d.im<0?1:0;m!==0&&f===0&&c++,f=m,o=o.add(1)}return u(o).sub(d.log()).sub(new e(0,c*2*Math.PI*1))}}),Gg="factorial",G5=["typed","gamma"],j5=U(Gg,G5,t=>{var{typed:e,gamma:r}=t;return e(Gg,{number:function(a){if(a<0)throw new Error("Value must be non-negative");return r(a+1)},BigNumber:function(a){if(a.isNegative())throw new Error("Value must be non-negative");return r(a.plus(1))},"Array | Matrix":e.referToSelf(n=>a=>nt(a,n))})}),jg="kldivergence",Z5=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],X5=U(jg,Z5,t=>{var{typed:e,matrix:r,divide:n,sum:a,multiply:i,map:s,dotDivide:u,log:l,isNumeric:o}=t;return e(jg,{"Array, Array":function(d,m){return c(r(d),r(m))},"Matrix, Array":function(d,m){return c(d,r(m))},"Array, Matrix":function(d,m){return c(r(d),m)},"Matrix, Matrix":function(d,m){return c(d,m)}});function c(f,d){var m=d.size().length,h=f.size().length;if(m>1)throw new Error("first object must be one dimensional");if(h>1)throw new Error("second object must be one dimensional");if(m!==h)throw new Error("Length of two vectors must be equal");var p=a(f);if(p===0)throw new Error("Sum of elements in first object must be non zero");var g=a(d);if(g===0)throw new Error("Sum of elements in second object must be non zero");var v=n(f,a(f)),D=n(d,a(d)),y=a(i(v,s(u(v,D),x=>l(x))));return o(y)?y:Number.NaN}}),Zg="multinomial",J5=["typed","add","divide","multiply","factorial","isInteger","isPositive"],Q5=U(Zg,J5,t=>{var{typed:e,add:r,divide:n,multiply:a,factorial:i,isInteger:s,isPositive:u}=t;return e(Zg,{"Array | Matrix":function(o){var c=0,f=1;return Yn(o,function(d){if(!s(d)||!u(d))throw new TypeError("Positive integer value expected in function multinomial");c=r(c,d),f=a(f,i(d))}),n(i(c),f)}})}),Xg="permutations",K5=["typed","factorial"],e8=U(Xg,K5,t=>{var{typed:e,factorial:r}=t;return e(Xg,{"number | BigNumber":r,"number, number":function(a,i){if(!$e(a)||a<0)throw new TypeError("Positive integer value expected in function permutations");if(!$e(i)||i<0)throw new TypeError("Positive integer value expected in function permutations");if(i>a)throw new TypeError("second argument k must be less than or equal to first argument n");return En(a-i+1,a)},"BigNumber, BigNumber":function(a,i){var s,u;if(!Jg(a)||!Jg(i))throw new TypeError("Positive integer value expected in function permutations");if(i.gt(a))throw new TypeError("second argument k must be less than or equal to first argument n");var l=a.mul(0).add(1);for(s=l,u=a.minus(i).plus(1);u.lte(a);u=u.plus(1))s=s.times(u);return s}})});function Jg(t){return t.isInteger()&&t.gte(0)}var _o={exports:{}},t8=_o.exports,Qg;function r8(){return Qg||(Qg=1,function(t){(function(e,r,n){function a(l){var o=this,c=u();o.next=function(){var f=2091639*o.s0+o.c*23283064365386963e-26;return o.s0=o.s1,o.s1=o.s2,o.s2=f-(o.c=f|0)},o.c=1,o.s0=c(" "),o.s1=c(" "),o.s2=c(" "),o.s0-=c(l),o.s0<0&&(o.s0+=1),o.s1-=c(l),o.s1<0&&(o.s1+=1),o.s2-=c(l),o.s2<0&&(o.s2+=1),c=null}function i(l,o){return o.c=l.c,o.s0=l.s0,o.s1=l.s1,o.s2=l.s2,o}function s(l,o){var c=new a(l),f=o&&o.state,d=c.next;return d.int32=function(){return c.next()*4294967296|0},d.double=function(){return d()+(d()*2097152|0)*11102230246251565e-32},d.quick=d,f&&(typeof f=="object"&&i(f,c),d.state=function(){return i(c,{})}),d}function u(){var l=4022871197,o=function(c){c=String(c);for(var f=0;f<c.length;f++){l+=c.charCodeAt(f);var d=.02519603282416938*l;l=d>>>0,d-=l,d*=l,l=d>>>0,d-=l,l+=d*4294967296}return(l>>>0)*23283064365386963e-26};return o}
vendor: 4,193 bytes, line 66
66r&&r.exports?r.exports=s:this.alea=s})(t8,t)}(_o)),_o.exports}var Co={exports:{}},n8=Co.exports,Kg;function a8(){return Kg||(Kg=1,function(t){(function(e,r,n){function a(u){var l=this,o="";l.x=0,l.y=0,l.z=0,l.w=0,l.next=function(){var f=l.x^l.x<<11;return l.x=l.y,l.y=l.z,l.z=l.w,l.w^=l.w>>>19^f^f>>>8},u===(u|0)?l.x=u:o+=u;for(var c=0;c<o.length+64;c++)l.x^=o.charCodeAt(c)|0,l.next()}function i(u,l){return l.x=u.x,l.y=u.y,l.z=u.z,l.w=u.w,l}function s(u,l){var o=new a(u),c=l&&l.state,f=function(){return(o.next()>>>0)/4294967296};return f.double=function(){do var d=o.next()>>>11,m=(o.next()>>>0)/4294967296,h=(d+m)/(1<<21);while(h===0);return h},f.int32=o.next,f.quick=f,c&&(typeof c=="object"&&i(c,o),f.state=function(){return i(o,{})}),f}r&&r.exports?r.exports=s:this.xor128=s})(n8,t)}(Co)),Co.exports}var Mo={exports:{}},i8=Mo.exports,e0;function s8(){return e0||(e0=1,function(t){(function(e,r,n){function a(u){var l=this,o="";l.next=function(){var f=l.x^l.x>>>2;return l.x=l.y,l.y=l.z,l.z=l.w,l.w=l.v,(l.d=l.d+362437|0)+(l.v=l.v^l.v<<4^(f^f<<1))|0},l.x=0,l.y=0,l.z=0,l.w=0,l.v=0,u===(u|0)?l.x=u:o+=u;for(var c=0;c<o.length+64;c++)l.x^=o.charCodeAt(c)|0,c==o.length&&(l.d=l.x<<10^l.x>>>4),l.next()}function i(u,l){return l.x=u.x,l.y=u.y,l.z=u.z,l.w=u.w,l.v=u.v,l.d=u.d,l}function s(u,l){var o=new a(u),c=l&&l.state,f=function(){return(o.next()>>>0)/4294967296};return f.double=function(){do var d=o.next()>>>11,m=(o.next()>>>0)/4294967296,h=(d+m)/(1<<21);while(h===0);return h},f.int32=o.next,f.quick=f,c&&(typeof c=="object"&&i(c,o),f.state=function(){return i(o,{})}),f}r&&r.exports?r.exports=s:this.xorwow=s})(i8,t)}(Mo)),Mo.exports}var To={exports:{}},o8=To.exports,t0;function u8(){return t0||(t0=1,function(t){(function(e,r,n){function a(u){var l=this;l.next=function(){var c=l.x,f=l.i,d,m;return d=c[f],d^=d>>>7,m=d^d<<24,d=c[f+1&7],m^=d^d>>>10,d=c[f+3&7],m^=d^d>>>3,d=c[f+4&7],m^=d^d<<7,d=c[f+7&7],d=d^d<<13,m^=d^d<<9,c[f]=m,l.i=f+1&7,m};function o(c,f){var d,m=[];if(f===(f|0))m[0]=f;else for(f=""+f,d=0;d<f.length;++d)m[d&7]=m[d&7]<<15^f.charCodeAt(d)+m[d+1&7]<<13;for(;m.length<8;)m.push(0);for(d=0;d<8&&m[d]===0;++d);for(d==8?m[7]=-1:m[d],c.x=m,c.i=0,d=256;d>0;--d)c.next()}o(l,u)}function i(u,l){return l.x=u.x.slice(),l.i=u.i,l}function s(u,l){u==null&&(u=+new Date);var o=new a(u),c=l&&l.state,f=function(){return(o.next()>>>0)/4294967296};return f.double=function(){do var d=o.next()>>>11,m=(o.next()>>>0)/4294967296,h=(d+m)/(1<<21);while(h===0);return h},f.int32=o.next,f.quick=f,c&&(c.x&&i(c,o),f.state=function(){return i(o,{})}),f}r&&r.exports?r.exports=s:this.xorshift7=s})(o8,t)}(To)),To.exports}var Fo={exports:{}},l8=Fo.exports,r0;function c8(){return r0||(r0=1,function(t){(function(e,r,n){function a(u){var l=this;l.next=function(){var c=l.w,f=l.X,d=l.i,m,h;return l.w=c=c+1640531527|0,h=f[d+34&127],m=f[d=d+1&127],h^=h<<13,m^=m<<17,h^=h>>>15,m^=m>>>12,h=f[d]=h^m,l.i=d,h+(c^c>>>16)|0};function o(c,f){var d,m,h,p,g,v=[],D=128;for(f===(f|0)?(m=f,f=null):(f=f+"\0",m=0,D=Math.max(D,f.length)),h=0,p=-32;p<D;++p)f&&(m^=f.charCodeAt((p+32)%f.length)),p===0&&(g=m),m^=m<<10,m^=m>>>15,m^=m<<4,m^=m>>>13,p>=0&&(g=g+1640531527|0,d=v[p&127]^=m+g,h=d==0?h+1:0);for(h>=128&&(v[(f&&f.length||0)&127]=-1),h=127,p=4*128;p>0;--p)m=v[h+34&127],d=v[h=h+1&127],m^=m<<13,d^=d<<17,m^=m>>>15,d^=d>>>12,v[h]=m^d;c.w=g,c.X=v,c.i=h}o(l,u)}function i(u,l){return l.i=u.i,l.w=u.w,l.X=u.X.slice(),l}function s(u,l){u==null&&(u=+new Date);var o=new a(u),c=l&&l.state,f=function(){return(o.next()>>>0)/4294967296};return f.double=function(){do var d=o.next()>>>11,m=(o.next()>>>0)/4294967296,h=(d+m)/(1<<21);while(h===0);return h},f.int32=o.next,f.quick=f,c&&(c.X&&i(c,o),f.state=function(){return i(o,{})}),f}r&&r.exports?r.exports=s:this.xor4096=s})(l8,t)}(Fo)),Fo.exports}var Oo={exports:{}},f8=Oo.exports,n0;function d8(){return n0||(n0=1,function(t){(function(e,r,n){function a(u){var l=this,o="";l.next=function(){var f=l.b,d=l.c,m=l.d,h=l.a;return f=f<<25^f>>>7^d,d=d-m|0,m=m<<24^m>>>8^h,h=h-f|0,l.b=f=f<<20^f>>>12^d,l.c=d=d-m|0,l.d=m<<16^d>>>16^h,l.a=h-f|0},l.a=0,l.b=0,l.c=-1640531527,l.d=1367130551,u===Math.floor(u)?(l.a=u/4294967296|0,l.b=u|0):o+=u;for(var c=0;c<o.length+20;
vendor: 30,593 bytes, line 66
66c++)l.b^=o.charCodeAt(c)|0,l.next()}function i(u,l){return l.a=u.a,l.b=u.b,l.c=u.c,l.d=u.d,l}function s(u,l){var o=new a(u),c=l&&l.state,f=function(){return(o.next()>>>0)/4294967296};return f.double=function(){do var d=o.next()>>>11,m=(o.next()>>>0)/4294967296,h=(d+m)/(1<<21);while(h===0);return h},f.int32=o.next,f.quick=f,c&&(typeof c=="object"&&i(c,o),f.state=function(){return i(o,{})}),f}r&&r.exports?r.exports=s:this.tychei=s})(f8,t)}(Oo)),Oo.exports}var Bo={exports:{}};const m8=Qw(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var h8=Bo.exports,a0;function p8(){return a0||(a0=1,function(t){(function(e,r,n){var a=256,i=6,s=52,u="random",l=n.pow(a,i),o=n.pow(2,s),c=o*2,f=a-1,d;function m(x,w,b){var A=[];w=w==!0?{entropy:!0}:w||{};var S=v(g(w.entropy?[x,y(r)]:x??D(),3),A),E=new h(A),N=function(){for(var _=E.g(i),C=l,O=0;_<o;)_=(_+O)*a,C*=a,O=E.g(1);for(;_>=c;)_/=2,C/=2,O>>>=1;return(_+O)/C};return N.int32=function(){return E.g(4)|0},N.quick=function(){return E.g(4)/4294967296},N.double=N,v(y(E.S),r),(w.pass||b||function(_,C,O,I){return I&&(I.S&&p(I,E),_.state=function(){return p(E,{})}),O?(n[u]=_,C):_})(N,S,"global"in w?w.global:this==n,w.state)}function h(x){var w,b=x.length,A=this,S=0,E=A.i=A.j=0,N=A.S=[];for(b||(x=[b++]);S<a;)N[S]=S++;for(S=0;S<a;S++)N[S]=N[E=f&E+x[S%b]+(w=N[S])],N[E]=w;(A.g=function(_){for(var C,O=0,I=A.i,k=A.j,M=A.S;_--;)C=M[I=f&I+1],O=O*a+M[f&(M[I]=M[k=f&k+C])+(M[k]=C)];return A.i=I,A.j=k,O})(a)}function p(x,w){return w.i=x.i,w.j=x.j,w.S=x.S.slice(),w}function g(x,w){var b=[],A=typeof x,S;if(w&&A=="object")for(S in x)try{b.push(g(x[S],w-1))}catch{}return b.length?b:A=="string"?x:x+"\0"}function v(x,w){for(var b=x+"",A,S=0;S<b.length;)w[f&S]=f&(A^=w[f&S]*19)+b.charCodeAt(S++);return y(w)}function D(){try{var x;return d&&(x=d.randomBytes)?x=x(a):(x=new Uint8Array(a),(e.crypto||e.msCrypto).getRandomValues(x)),y(x)}catch{var w=e.navigator,b=w&&w.plugins;return[+new Date,e,b,e.screen,y(r)]}}function y(x){return String.fromCharCode.apply(0,x)}if(v(n.random(),r),t.exports){t.exports=m;try{d=m8}catch{}}else n["seed"+u]=m})(typeof self<"u"?self:h8,[],Math)}(Bo)),Bo.exports}var Ol,i0;function v8(){if(i0)return Ol;i0=1;var t=r8(),e=a8(),r=s8(),n=u8(),a=c8(),i=d8(),s=p8();return s.alea=t,s.xor128=e,s.xorwow=r,s.xorshift7=n,s.xor4096=a,s.tychei=i,Ol=s,Ol}var g8=v8();const s0=gi(g8);var y8=s0(Date.now());function Ka(t){var e;function r(a){e=a===null?y8:s0(String(a))}r(t);function n(){return e()}return n}var o0="pickRandom",b8=["typed","config","?on"],w8=U(o0,b8,t=>{var{typed:e,config:r,on:n}=t,a=Ka(r.randomSeed);return n&&n("config",function(s,u){s.randomSeed!==u.randomSeed&&(a=Ka(s.randomSeed))}),e(o0,{"Array | Matrix":function(u){return i(u,{})},"Array | Matrix, Object":function(u,l){return i(u,l)},"Array | Matrix, number":function(u,l){return i(u,{number:l})},"Array | Matrix, Array | Matrix":function(u,l){return i(u,{weights:l})},"Array | Matrix, Array | Matrix, number":function(u,l,o){return i(u,{number:o,weights:l})},"Array | Matrix, number, Array | Matrix":function(u,l,o){return i(u,{number:l,weights:o})}});function i(s,u){var{number:l,weights:o,elementWise:c=!0}=u,f=typeof l>"u";f&&(l=1);var d=ze(s)?s.create:ze(o)?o.create:null;s=s.valueOf(),o&&(o=o.valueOf()),c===!0&&(s=pt(s),o=pt(o));var m=0;if(typeof o<"u"){if(o.length!==s.length)throw new Error("Weights must have the same length as possibles");for(var h=0,p=o.length;h<p;h++){if(!qe(o[h])||o[h]<0)throw new Error("Weights must be an array of positive numbers");m+=o[h]}}for(var g=s.length,v=[],D;v.length<l;){if(typeof o>"u")D=s[Math.floor(a()*g)];else for(var y=a()*m,x=0,w=s.length;x<w;x++)if(y-=o[x],y<0){D=s[x];break}v.push(D)}return f?v[0]:d?d(v):v}});function Bl(t,e){var r=[];if(t=t.slice(0),t.length>1)for(var n=0,a=t.shift();n<a;n++)r.push(Bl(t,e));else for(var i=0,s=t.shift();i<s;i++)r.push(e());return r}var u0="random",x8=["typed","config","?on"],D8=U(u0,x8,t=>{var{typed:e,config:r,on:n}=t,a=Ka(r.randomSeed);return n&&n("config",function(u,l){u.randomSeed!==l.randomSeed&&(a=Ka(u.randomSeed))}),e(u0,{"":()=>s(0,1),number:u=>s(0,u),"number, number":(u,l)=>s(u,l),"Array | Matrix":u=>i(u,0,1),"Array | Matrix, number":(u,l)=>i(u,0,l),"Array | Matrix, number, number":(u,l,o)=>i(u,l,o)});function i(u,l,o){var c=Bl(u.valueOf(),()=>s(l,o));return ze(u)?u.create(c,"number"):c}function s(u,l){return u+a()*(l-u)}}),l0="randomInt",E8=["typed","config","log2","?on"],A8=U(l0,E8,t=>{var{typed:e,config:r,log2:n,on:a}=t,i=Ka(r.randomSeed);return a&&a("config",function(o,c){o.randomSeed!==c.randomSeed&&(i=Ka(o.randomSeed))}),e(l0,{"":()=>u(0,2),number:o=>u(0,o),"number, number":(o,c)=>u(o,c),bigint:o=>l(0n,o),"bigint, bigint":l,"Array | Matrix":o=>s(o,0,1),"Array | Matrix, number":(o,c)=>s(o,0,c),"Array | Matrix, number, number":(o,c,f)=>s(o,c,f)});function s(o,c,f){var d=Bl(o.valueOf(),()=>u(c,f));return ze(o)?o.create(d,"number"):d}function u(o,c){return Math.floor(o+i()*(c-o))}function l(o,c){var f=2n**30n,d=c-o;if(d<=f)return o+BigInt(u(0,Number(d)));for(var m=n(d),h=d;h>=d;){h=0n;for(var p=0;p<m;++p)h=2n*h+(i()<.5?0n:1n)}return o+h}}),c0="stirlingS2",S8=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],N8=U(c0,S8,t=>{var{typed:e,addScalar:r,subtractScalar:n,multiplyScalar:a,divideScalar:i,pow:s,factorial:u,combinations:l,isNegative:o,isInteger:c,number:f,bignumber:d,larger:m}=t,h=[],p=[];return e(c0,{"number | BigNumber, number | BigNumber":function(v,D){if(!c(v)||o(v)||!c(D)||o(D))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(m(D,v))throw new TypeError("k must be less than or equal to n in function stirlingS2");var y=!(qe(v)&&qe(D)),x=y?p:h,w=y?d:f,b=f(v),A=f(D);if(x[b]&&x[b].length>A)return x[b][A];for(var S=0;S<=b;++S)if(x[S]||(x[S]=[w(S===0?1:0)]),S!==0)for(var E=x[S],N=x[S-1],_=E.length;_<=S&&_<=A;++_)_===S?E[_]=1:E[_]=r(a(w(_),N[_]),N[_-1]);return x[b][A]}})}),f0="bellNumbers",_8=["typed","addScalar","isNegative","isInteger","stirlingS2"],C8=U(f0,_8,t=>{var{typed:e,addScalar:r,isNegative:n,isInteger:a,stirlingS2:i}=t;return e(f0,{"number | BigNumber":function(u){if(!a(u)||n(u))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var l=0,o=0;o<=u;o++)l=r(l,i(u,o));return l}})}),d0="catalan",M8=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],T8=U(d0,M8,t=>{var{typed:e,addScalar:r,divideScalar:n,multiplyScalar:a,combinations:i,isNegative:s,isInteger:u}=t;return e(d0,{"number | BigNumber":function(o){if(!u(o)||s(o))throw new TypeError("Non-negative integer value expected in function catalan");return n(i(a(o,2),o),r(o,1))}})}),m0="composition",F8=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],O8=U(m0,F8,t=>{var{typed:e,addScalar:r,combinations:n,isPositive:a,isNegative:i,isInteger:s,larger:u}=t;return e(m0,{"number | BigNumber, number | BigNumber":function(o,c){if(!s(o)||!a(o)||!s(c)||!a(c))throw new TypeError("Positive integer value expected in function composition");if(u(c,o))throw new TypeError("k must be less than or equal to n in function composition");return n(r(o,-1),r(c,-1))}})}),h0="leafCount",B8=["parse","typed"],k8=U(h0,B8,t=>{var{parse:e,typed:r}=t;function n(a){var i=0;return a.forEach(s=>{i+=n(s)}),i||1}return r(h0,{Node:function(i){return n(i)}})});function p0(t){return dt(t)||Pt(t)&&t.isUnary()&&dt(t.args[0])}function ko(t){return!!(dt(t)||(bn(t)||Pt(t))&&t.args.every(ko)||nn(t)&&ko(t.content))}function v0(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function kl(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?v0(Object(r),!0).forEach(function(n){Yt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v0(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var I8="simplifyUtil",L8=["FunctionNode","OperatorNode","SymbolNode"],Il=U(I8,L8,t=>{var{FunctionNode:e,OperatorNode:r,SymbolNode:n}=t,a=!0,i=!1,s="defaultF",u={add:{trivial:a,total:a,commutative:a,associative:a},unaryPlus:{trivial:a,total:a,commutative:a,associative:a},subtract:{trivial:i,total:a,commutative:i,associative:i},multiply:{trivial:a,total:a,commutative:a,associative:a},divide:{trivial:i,total:a,commutative:i,associative:i},paren:{trivial:a,total:a,commutative:a,associative:i},defaultF:{trivial:i,total:a,commutative:i,associative:i}},l={divide:{total:i},log:{total:i}},o={subtract:{total:i},abs:{trivial:a},log:{total:a}};function c(y,x){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:u,b=s;if(typeof y=="string"?b=y:Pt(y)?b=y.fn.toString():bn(y)?b=y.name:nn(y)&&(b="paren"),ke(w,b)){var A=w[b];if(ke(A,x))return A[x];if(ke(u,b))return u[b][x]}if(ke(w,s)){var S=w[s];return ke(S,x)?S[x]:u[s][x]}if(ke(u,b)){var E=u[b];if(ke(E,x))return E[x]}return u[s][x]}function f(y){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return c(y,"commutative",x)}function d(y){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return c(y,"associative",x)}function m(y,x){var w=kl({},y);for(var b in x)ke(y,b)?w[b]=kl(kl({},x[b]),y[b]):w[b]=x[b];return w}function h(y,x){if(!y.args||y.args.length===0)return y;y.args=p(y,x);for(var w=0;w<y.args.length;w++)h(y.args[w],x)}function p(y,x){var w,b=[],A=function(E){for(var N=0;N<E.args.length;N++){var _=E.args[N];Pt(_)&&w===_.op?A(_):b.push(_)}};return d(y,x)?(w=y.op,A(y),b):y.args}function g(y,x){if(!(!y.args||y.args.length===0)){for(var w=D(y),b=y.args.length,A=0;A<b;A++)g(y.args[A],x);if(b>2&&d(y,x)){for(var S=y.args.pop();y.args.length>0;)S=w([y.args.pop(),S]);y.args=S.args}}}function v(y,x){if(!(!y.args||y.args.length===0)){for(var w=D(y),b=y.args.length,A=0;A<b;A++)v(y.args[A],x);if(b>2&&d(y,x)){for(var S=y.args.shift();y.args.length>0;)S=w([S,y.args.shift()]);y.args=S.args}}}function D(y){return Pt(y)?function(x){try{return new r(y.op,y.fn,x,y.implicit)}catch(w){return console.error(w),[]}}:function(x){return new e(new n(y.name),x)}}return{createMakeNodeFunction:D,hasProperty:c,isCommutative:f,isAssociative:d,mergeContext:m,flatten:h,allChildren:p,unflattenr:g,unflattenl:v,defaultContext:u,realContext:l,positiveContext:o}}),R8="simplify",$8=["typed","parse","equal","resolve","simplifyConstant","simplifyCore","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode","replacer"],P8=U(R8,$8,t=>{var{typed:e,parse:r,equal:n,resolve:a,simplifyConstant:i,simplifyCore:s,AccessorNode:u,ArrayNode:l,ConstantNode:o,FunctionNode:c,IndexNode:f,ObjectNode:d,OperatorNode:m,ParenthesisNode:h,SymbolNode:p,replacer:g}=t,{hasProperty:v,isCommutative:D,isAssociative:y,mergeContext:x,flatten:w,unflattenr:b,unflattenl:A,createMakeNodeFunction:S,defaultContext:E,realContext:N,positiveContext:_}=Il({FunctionNode:c,OperatorNode:m,SymbolNode:p});e.addConversion({from:"Object",to:"Map",convert:Ta});var C=e("simplify",{Node:z,"Node, Map":(P,W)=>z(P,!1,W),"Node, Map, Object":(P,W,J)=>z(P,!1,W,J),"Node, Array":z,"Node, Array, Map":z,"Node, Array, Map, Object":z});e.removeConversion({from:"Object",to:"Map",convert:Ta}),C.defaultContext=E,C.realContext=N,C.positiveContext=_;function O(P){return P.transform(function(W){return nn(W)?O(W.content):W})}var I={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};C.rules=[s,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(cl*v) -> v * (-cl)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(cl*v) -> (-cl) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*cl) -> v * (-cl)",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:"-(n1/n2)",r:"-n1/n2"},{l:"-v",r:"v * (-1)"},{l:"(n1 + n2)*(-1)",r:"n1*(-1) + n2*(-1)",repeat:!0},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{s:"(n1*n2)^n3 -> n1^n3 * n2^n3",assuming:{multiply:{commutative:!0}}},{s:"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)",assuming:{multiply:{commutative:!1}}},{s:"(n ^ n1) ^ n2 -> n ^ (n1 * n2)",assuming:{divide:{total:!0}}},{l:" vd * ( vd * n1 + n2)",r:"vd^2 * n1 + vd * n2"},{s:" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{l:"n*n",r:"n^2"},{s:"n * n^n1 -> n^(n1+1)",assuming:{divide:{total:!0}}},{s:"n^n1 * n^n2 -> n^(n1+n2)",assuming:{divide:{total:!0}}},i,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"vd*n + vd",r:"vd*(n+1)"},{l:"n3*n1 + n3*n2",r:"n3*(n1+n2)"},{l:"n3^(-n4)*n1 + n3 * n2",r:"n3^(-n4)*(n1 + n3^(n4+1) *n2)"},{l:"n3^(-n4)*n1 + n3^n5 * n2",r:"n3^(-n4)*(n1 + n3^(n4+n5)*n2)"},{s:"n*vd + vd -> (n+1)*vd",assuming:{multiply:{commutative:!1}}},{s:"vd + n*vd -> (1+n)*vd",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{multiply:{commutative:!1}}},{s:"n^n1 * n -> n^(n1+1)",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{l:"n*cd + cd",r:"(n+1)*cd"},{s:"cd*n + cd -> cd*(n+1)",assuming:{multiply:{commutative:!1}}},{s:"cd + cd*n -> cd*(1+n)",assuming:{multiply:{commutative:!1}}},i,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"ce+ve -> ve+ce",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"vd*cd -> cd*vd",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n+-(n1)",r:"n-(n1)"},{s:"n*(n1^-1) -> n/n1",assuming:{multiply:{commutative:!0}}},{s:"n*n1^-n2 -> n/n1^n2",assuming:{multiply:{commutative:!0}}},{s:"n^-1 -> 1/n",assuming:{multiply:{commutative:!0}}},{l:"n^1",r:"n"},{s:"n*(n1/n2) -> (n*n1)/n2",assuming:{multiply:{associative:!0}}},{s:"n-(n1+n2) -> n-n1-n2",assuming:{addition:{associative:!0,commutative:!0}}},{l:"1*n",r:"n",imposeContext:{multiply:{commutative:!0}}},{s:"n1/(n2/n3) -> (n1*n3)/n2",assuming:{multiply:{associative:!0}}},{l:"n1/(-n2)",r:"-n1/n2"}];function k(P,W){var J={};if(P.s){var re=P.s.split("->");if(re.length===2)J.l=re[0],J.r=re[1];else throw SyntaxError("Could not parse rule: "+P.s)}else J.l=P.l,J.r=P.r;J.l=O(r(J.l)),J.r=O(r(J.r));for(var ae of["imposeContext","repeat","assuming"])ae in P&&(J[ae]=P[ae]);if(P.evaluate&&(J.evaluate=r(P.evaluate)),y(J.l,W)){var he=!D(J.l,W),fe;he&&(fe=q());var De=S(J.l),Te=q();J.expanded={},J.expanded.l=De([J.l,Te]),w(J.expanded.l,W),b(J.expanded.l,W),J.expanded.r=De([J.r,Te]),he&&(J.expandedNC1={},J.expandedNC1.l=De([fe,J.l]),J.expandedNC1.r=De([fe,J.r]),J.expandedNC2={},J.expandedNC2.l=De([fe,J.expanded.l]),J.expandedNC2.r=De([fe,J.expanded.r]))}return J}function M(P,W){for(var J=[],re=0;re<P.length;re++){var ae=P[re],he=void 0,fe=typeof ae;switch(fe){case"string":ae={s:ae};case"object":he=k(ae,W);break;case"function":he=ae;break;default:throw TypeError("Unsupported type of rule: "+fe)}J.push(he)}return J}var H=0;function q(){return new p("_p"+H++)}function z(P,W){var J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ei(),re=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},ae=re.consoleDebug;W=M(W||C.rules,re.context);var he=a(P,J);he=O(he);for(var fe={},De=he.toString({parenthesis:"all"});!fe[De];){fe[De]=!0,H=0;var Te=De;ae&&console.log("Working on: ",De);for(var Ie=0;Ie<W.length;Ie++){var Me="";if(typeof W[Ie]=="function"?(he=W[Ie](he,re),ae&&(Me=W[Ie].name)):(w(he,re.context),he=te(he,W[Ie],re.context),ae&&(Me="".concat(W[Ie].l.toString()," -> ").concat(W[Ie].r.toString()))),ae){var Le=he.toString({parenthesis:"all"});Le!==Te&&(console.log("Applying",Me,"produced",Le),Te=Le)}A(he,re.context)}De=he.toString({parenthesis:"all"})}return he}function X(P,W,J){var re=P;if(P)for(var ae=0;ae<P.length;++ae){var he=te(P[ae],W,J);he!==P[ae]&&(re===P&&(re=P.slice()),re[ae]=he)}return re}function te(P,W,J){if(W.assuming){for(var re in W.assuming)for(var ae in W.assuming[re])if(v(re,ae,J)!==W.assuming[re][ae])return P}var he=x(W.imposeContext,J),fe=P;if(fe instanceof m||fe instanceof c){var De=X(fe.args,W,J);De!==fe.args&&(fe=fe.clone(),fe.args=De)}else if(fe instanceof h){if(fe.content){var Te=te(fe.content,W,J);Te!==fe.content&&(fe=new h(Te))}}else if(fe instanceof l){var Ie=X(fe.items,W,J);Ie!==fe.items&&(fe=new l(Ie))}else if(fe instanceof u){var Me=fe.object;fe.object&&(Me=te(fe.object,W,J));var Le=fe.index;fe.index&&(Le=te(fe.index,W,J)),(Me!==fe.object||Le!==fe.index)&&(fe=new u(Me,Le))}else if(fe instanceof f){var Y=X(fe.dimensions,W,J);Y!==fe.dimensions&&(fe=new f(Y))}else if(fe instanceof d){var ee=!1,ue={};for(var L in fe.properties)ue[L]=te(fe.properties[L],W,J),ue[L]!==fe.properties[L]&&(ee=!0);ee&&(fe=new d(ue))}var Z=W.r,K=se(W.l,fe,he)[0];if(!K&&W.expanded&&(Z=W.expanded.r,K=se(W.expanded.l,fe,he)[0]),!K&&W.expandedNC1&&(Z=W.expandedNC1.r,K=se(W.expandedNC1.l,fe,he)[0],K||(Z=W.expandedNC2.r,K=se(W.expandedNC2.l,fe,he)[0])),K){var ne=fe.implicit;fe=Z.clone(),ne&&"implicit"in Z&&(fe.implicit=!0),fe=fe.transform(function(ce){return ce.isSymbolNode&&ke(K.placeholders,ce.name)?K.placeholders[ce.name].clone():ce})}return W.repeat&&fe!==P&&(fe=te(fe,W,J)),fe}function B(P,W){var J=[],re,ae,he=S(P);if(D(P,W))for(var fe=0;fe<P.args.length;fe++)ae=P.args.slice(0),ae.splice(fe,1),re=ae.length===1?ae[0]:he(ae),J.push(he([P.args[fe],re]));else for(var De=1;De<P.args.length;De++){var Te=P.args[0];De>1&&(Te=he(P.args.slice(0,De))),ae=P.args.slice(De),re=ae.length===1?ae[0]:he(ae),J.push(he([Te,re]))}return J}function j(P,W){var J={placeholders:{}};if(!P.placeholders&&!W.placeholders)return J;if(P.placeholders){if(!W.placeholders)return P}else return W;for(var re in P.placeholders)if(ke(P.placeholders,re)&&(J.placeholders[re]=P.placeholders[re],ke(W.placeholders,re)&&!le(P.placeholders[re],W.placeholders[re])))return null;for(var ae in W.placeholders)ke(W.placeholders,ae)&&(J.placeholders[ae]=W.placeholders[ae]);return J}function R(P,W){var J=[];if(P.length===0||W.length===0)return J;for(var re,ae=0;ae<P.length;ae++)for(var he=0;he<W.length;he++)re=j(P[ae],W[he]),re&&J.push(re);return J}function oe(P){if(P.length===0)return P;for(var W=P.reduce(R),J=[],re={},ae=0;ae<W.length;ae++){var he=JSON.stringify(W[ae],g);re[he]||(re[he]=!0,J.push(W[ae]))}return J}function se(P,W,J,re){var ae=[{placeholders:{}}];if(P instanceof m&&W instanceof m||P instanceof c&&W instanceof c){if(P instanceof m){if(P.op!==W.op||P.fn!==W.fn)return[]}else if(P instanceof c&&P.name!==W.name)return[];if(W.args.length===1&&P.args.length===1||!y(W,J)&&W.args.length===P.args.length||re){for(var he=[],fe=0;fe<P.args.length;fe++){var De=se(P.args[fe],W.args[fe],J);if(De.length===0)break;he.push(De)}if(he.length!==P.args.length){if(!D(W,J)||P.args.length===1)return[];if(P.args.length>2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var Te=se(P.args[0],W.args[1],J);if(Te.length===0)return[];var Ie=se(P.args[1],W.args[0],J);if(Ie.length===0)return[];he=[Te,Ie]}ae=oe(he)}else if(W.args.length>=2&&P.args.length===2){for(var Me=B(W,J),Le=[],Y=0;Y<Me.length;Y++){var ee=se(P,Me[Y],J,!0);Le=Le.concat(ee)}return Le}else{if(P.args.length>2)throw Error("Unexpected non-binary associative function: "+P.toString());return[]}}else if(P instanceof p){if(P.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(I[P.name]){if(P.name!==W.name)return[]}else switch(P.name[1]>="a"&&P.name[1]<="z"?P.name.substring(0,2):P.name[0]){case"n":case"_p":ae[0].placeholders[P.name]=W;break;case"c":case"cl":if(dt(W))ae[0].placeholders[P.name]=W;else return[];break;case"v":if(!dt(W))ae[0].placeholders[P.name]=W;else return[];break;case"vl":if(Ht(W))ae[0].placeholders[P.name]=W;else return[];break;case"cd":if(p0(W))ae[0].placeholders[P.name]=W;else return[];break;case"vd":if(!p0(W))ae[0].placeholders[P.name]=W;else return[];break;case"ce":if(ko(W))ae[0].placeholders[P.name]=W;else return[];break;case"ve":if(!ko(W))ae[0].placeholders[P.name]=W;else return[];break;default:throw new Error("Invalid symbol in rule: "+P.name)}}else if(P instanceof o){if(!n(P.value,W.value))return[]}else return[];return ae}function le(P,W){if(P instanceof o&&W instanceof o){if(!n(P.value,W.value))return!1}else if(P instanceof p&&W instanceof p){if(P.name!==W.name)return!1}else if(P instanceof m&&W instanceof m||P instanceof c&&W instanceof c){if(P instanceof m){if(P.op!==W.op||P.fn!==W.fn)return!1}else if(P instanceof c&&P.name!==W.name)return!1;if(P.args.length!==W.args.length)return!1;for(var J=0;J<P.args.length;J++)if(!le(P.args[J],W.args[J]))return!1}else return!1;return!0}return C}),q8="simplifyConstant",U8=["typed","config","mathWithTransform","matrix","?fraction","?bignumber","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode"],z8=U(q8,U8,t=>{var{typed:e,config:r,mathWithTransform:n,matrix:a,fraction:i,bignumber:s,AccessorNode:u,ArrayNode:l,ConstantNode:o,FunctionNode:c,IndexNode:f,ObjectNode:d,OperatorNode:m,SymbolNode:h}=t,{isCommutative:p,isAssociative:g,allChildren:v,createMakeNodeFunction:D}=Il({FunctionNode:c,OperatorNode:m,SymbolNode:h}),y=e("simplifyConstant",{Node:k=>A(I(k,{})),"Node, Object":function(M,H){return A(I(M,H))}});function x(k){return ea(k)?k.valueOf():k instanceof Array?k.map(x):ze(k)?a(x(k.valueOf())):k}function w(k,M,H){try{return n[k].apply(null,M)}catch{return M=M.map(x),E(n[k].apply(null,M),H)}}var b=e({Fraction:_,number:function(M){return M<0?N(new o(-M)):new o(M)},BigNumber:function(M){return M<0?N(new o(-M)):new o(M)},bigint:function(M){return M<0n?N(new o(-M)):new o(M)},Complex:function(M){throw new Error("Cannot convert Complex number to Node")},string:function(M){return new o(M)},Matrix:function(M){return new l(M.valueOf().map(H=>b(H)))}});function A(k){return xt(k)?k:b(k)}function S(k,M){var H=M&&M.exactFractions!==!1;if(H&&isFinite(k)&&i){var q=i(k),z=M&&typeof M.fractionsLimit=="number"?M.fractionsLimit:1/0;if(q.valueOf()===k&&q.n<z&&q.d<z)return q}return k}var E=e({"string, Object":function(M,H){var q=kn(M,r);if(q==="BigNumber")return s===void 0&&wl(),s(M);if(q==="bigint")return BigInt(M);if(q==="Fraction")return i===void 0&&ep(),i(M);var z=parseFloat(M);return S(z,H)},"Fraction, Object":function(M,H){return M},"BigNumber, Object":function(M,H){return M},"number, Object":function(M,H){return S(M,H)},"bigint, Object":function(M,H){return M},"Complex, Object":function(M,H){return M.im!==0?M:S(M.re,H)},"Matrix, Object":function(M,H){return a(S(M.valueOf()))},"Array, Object":function(M,H){return M.map(S)}});function N(k){return new m("-","unaryMinus",[k])}function _(k){var M=z=>r.number==="BigNumber"&&s?s(z):Number(z),H=k.s*k.n,q=H<0n?new m("-","unaryMinus",[new o(-M(H))]):new o(M(H));return k.d===1n?q:new m("/","divide",[q,new o(M(k.d))])}function C(k,M,H){if(!na(M))return new u(A(k),A(M));if(Cr(k)||ze(k)){for(var q=Array.from(M.dimensions);q.length>0;)if(dt(q[0])&&typeof q[0].value!="string"){var z=E(q.shift().value,H);Cr(k)?k=k.items[z-1]:(k=k.valueOf()[z-1],k instanceof Array&&(k=a(k)))}else if(q.length>1&&dt(q[1])&&typeof q[1].value!="string"){var X=E(q[1].value,H),te=[],B=Cr(k)?k.items:k.valueOf();for(var j of B)if(Cr(j))te.push(j.items[X-1]);else if(ze(k))te.push(j[X-1]);else break;if(te.length===B.length)Cr(k)?k=new l(te):k=a(te),q.splice(1,1);else break}else break;return q.length===M.dimensions.length?new u(A(k),M):q.length>0?(M=new f(q),new u(A(k),M)):k}if(Ni(k)&&M.dimensions.length===1&&dt(M.dimensions[0])){var R=M.dimensions[0].value;return R in k.properties?k.properties[R]:new o}return new u(A(k),M)}function O(k,M,H,q){var z=M.shift(),X=M.reduce((te,B)=>{if(!xt(B)){var j=te.pop();if(xt(j))return[j,B];try{return te.push(w(k,[j,B],q)),te}catch{te.push(j)}}te.push(A(te.pop()));var R=te.length===1?te[0]:H(te);return[H([R,A(B)])]},[z]);return X.length===1?X[0]:H([X[0],b(X[1])])}function I(k,M){switch(k.type){case"SymbolNode":return k;case"ConstantNode":switch(typeof k.value){case"number":return E(k.value,M);case"bigint":return E(k.value,M);case"string":return k.value;default:if(!isNaN(k.value))return E(k.value,M)}return k;case"FunctionNode":if(n[k.name]&&n[k.name].rawArgs)return k;{var H=["add","multiply"];if(!H.includes(k.name)){var q=k.args.map(re=>I(re,M));if(!q.some(xt))try{return w(k.name,q,M)}catch{}if(k.name==="size"&&q.length===1&&Cr(q[0])){for(var z=[],X=q[0];Cr(X);)z.push(X.items.length),X=X.items[0];return a(z)}return new c(k.name,q.map(A))}}case"OperatorNode":{var te=k.fn.toString(),B,j,R=D(k);if(Pt(k)&&k.isUnary())B=[I(k.args[0],M)],xt(B[0])?j=R(B):j=w(te,B,M);else if(g(k,M.context))if(B=v(k,M.context),B=B.map(re=>I(re,M)),p(te,M.context)){for(var oe=[],se=[],le=0;le<B.length;le++)xt(B[le])?se.push(B[le]):oe.push(B[le]);oe.length>1?(j=O(te,oe,R,M),se.unshift(j),j=O(te,se,R,M)):j=O(te,B,R,M)}else j=O(te,B,R,M);else B=k.args.map(re=>I(re,M)),j=O(te,B,R,M);return j}case"ParenthesisNode":return I(k.content,M);case"AccessorNode":return C(I(k.object,M),I(k.index,M),M);case"ArrayNode":{var P=k.items.map(re=>I(re,M));return P.some(xt)?new l(P.map(A)):a(P)}case"IndexNode":return new f(k.dimensions.map(re=>y(re,M)));case"ObjectNode":{var W={};for(var J in k.properties)W[J]=y(k.properties[J],M);return new d(W)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(k.type))}}return y}),g0="simplifyCore",Y8=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],V8=U(g0,Y8,t=>{var{typed:e,parse:r,equal:n,isZero:a,add:i,subtract:s,multiply:u,divide:l,pow:o,AccessorNode:c,ArrayNode:f,ConstantNode:d,FunctionNode:m,IndexNode:h,ObjectNode:p,OperatorNode:g,ParenthesisNode:v,SymbolNode:D}=t,y=new d(0),x=new d(1),w=new d(!0),b=new d(!1);function A(_){return Pt(_)&&["and","not","or"].includes(_.op)}var{hasProperty:S,isCommutative:E}=Il({FunctionNode:m,OperatorNode:g,SymbolNode:D});function N(_){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=C?C.context:void 0;if(S(_,"trivial",O)){if(bn(_)&&_.args.length===1)return N(_.args[0],C);var I=!1,k=0;if(_.forEach(se=>{++k,k===1&&(I=N(se,C))}),k===1)return I}var M=_;if(bn(M)){var H=UF(M.name);if(H){if(M.args.length>2&&S(M,"associative",O))for(;M.args.length>2;){var q=M.args.pop(),z=M.args.pop();M.args.push(new g(H,M.name,[q,z]))}M=new g(H,M.name,M.args)}else return new m(N(M.fn),M.args.map(se=>N(se,C)))}if(Pt(M)&&M.isUnary()){var X=N(M.args[0],C);if(M.op==="~"&&Pt(X)&&X.isUnary()&&X.op==="~"||M.op==="not"&&Pt(X)&&X.isUnary()&&X.op==="not"&&A(X.args[0]))return X.args[0];var te=!0;if(M.op==="-"&&Pt(X)&&(X.isBinary()&&X.fn==="subtract"&&(M=new g("-","subtract",[X.args[1],X.args[0]]),te=!1),X.isUnary()&&X.op==="-"))return X.args[0];if(te)return new g(M.op,M.fn,[X])}if(Pt(M)&&M.isBinary()){var B=N(M.args[0],C),j=N(M.args[1],C);if(M.op==="+"){if(dt(B)&&a(B.value))return j;if(dt(j)&&a(j.value))return B;Pt(j)&&j.isUnary()&&j.op==="-"&&(j=j.args[0],M=new g("-","subtract",[B,j]))}if(M.op==="-")return Pt(j)&&j.isUnary()&&j.op==="-"?N(new g("+","add",[B,j.args[0]]),C):dt(B)&&a(B.value)?N(new g("-","unaryMinus",[j])):dt(j)&&a(j.value)?B:new g(M.op,M.fn,[B,j]);if(M.op==="*"){if(dt(B)){if(a(B.value))return y;if(n(B.value,1))return j}if(dt(j)){if(a(j.value))return y;if(n(j.value,1))return B;if(E(M,O))return new g(M.op,M.fn,[j,B],M.implicit)}return new g(M.op,M.fn,[B,j],M.implicit)}if(M.op==="/")return dt(B)&&a(B.value)?y:dt(j)&&n(j.value,1)?B:new g(M.op,M.fn,[B,j]);if(M.op==="^"&&dt(j)){if(a(j.value))return x;if(n(j.value,1))return B}if(M.op==="and"){if(dt(B))if(B.value){if(A(j))return j;if(dt(j))return j.value?w:b}else return b;if(dt(j))if(j.value){if(A(B))return B}else return b}if(M.op==="or"){if(dt(B)){if(B.value)return w;if(A(j))return j}if(dt(j)){if(j.value)return w;if(A(B))return B}}return new g(M.op,M.fn,[B,j])}if(Pt(M))return new g(M.op,M.fn,M.args.map(se=>N(se,C)));if(Cr(M))return new f(M.items.map(se=>N(se,C)));if(Bn(M))return new c(N(M.object,C),N(M.index,C));if(na(M))return new h(M.dimensions.map(se=>N(se,C)));if(Ni(M)){var R={};for(var oe in M.properties)R[oe]=N(M.properties[oe],C);return new p(R)}return M}return e(g0,{Node:N,"Node,Object":N})}),H8="resolve",W8=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],G8=U(H8,W8,t=>{var{typed:e,parse:r,ConstantNode:n,FunctionNode:a,OperatorNode:i,ParenthesisNode:s}=t;function u(l,o){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!o)return l;if(Ht(l)){if(c.has(l.name)){var f=Array.from(c).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(f,"}"))}var d=o.get(l.name);if(xt(d)){var m=new Set(c);return m.add(l.name),u(d,o,m)}else return typeof d=="number"?r(String(d)):d!==void 0?new n(d):l}else if(Pt(l)){var h=l.args.map(function(g){return u(g,o,c)});return new i(l.op,l.fn,h,l.implicit)}else{if(nn(l))return new s(u(l.content,o,c));if(bn(l)){var p=l.args.map(function(g){return u(g,o,c)});return new a(l.name,p)}}return l.map(g=>u(g,o,c))}return e("resolve",{Node:u,"Node, Map | null | undefined":u,"Node, Object":(l,o)=>u(l,Ta(o)),"Array | Matrix":e.referToSelf(l=>o=>o.map(c=>l(c))),"Array | Matrix, null | undefined":e.referToSelf(l=>o=>o.map(c=>l(c))),"Array, Object":e.referTo("Array,Map",l=>(o,c)=>l(o,Ta(c))),"Matrix, Object":e.referTo("Matrix,Map",l=>(o,c)=>l(o,Ta(c))),"Array | Matrix, Map":e.referToSelf(l=>(o,c)=>o.map(f=>l(f,c)))})}),y0="symbolicEqual",j8=["parse","simplify","typed","OperatorNode"],Z8=U(y0,j8,t=>{var{parse:e,simplify:r,typed:n,OperatorNode:a}=t;function i(s,u){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=new a("-","subtract",[s,u]),c=r(o,{},l);return dt(c)&&!c.value}
66return n(y0,{"Node, Node":i,"Node, Node, Object":i})}),b0="derivative",X8=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],J8=U(b0,X8,t=>{var{typed:e,config:r,parse:n,simplify:a,equal:i,isZero:s,numeric:u,ConstantNode:l,FunctionNode:o,OperatorNode:c,ParenthesisNode:f,SymbolNode:d}=t;function m(x,w){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},A=new Map,S=w.name;function E(_){var C=A.get(_);if(C!==void 0)return C;var O=v(E,_,S);return A.set(_,O),O}var N=D(x,E);return b.simplify?a(N):N}function h(x){var w=n(x);if(!w.isSymbolNode)throw new TypeError("Invalid variable. "+"Cannot parse ".concat(JSON.stringify(x)," into a variable in function derivative"));return w}var p=e(b0,{"Node, SymbolNode":m,"Node, SymbolNode, Object":m,"Node, string":(x,w)=>m(x,h(w)),"Node, string, Object":(x,w,b)=>m(x,h(w),b)});p._simplify=!0,p.toTex=function(x){return g.apply(null,x.args)};var g=e("_derivTex",{"Node, SymbolNode":function(w,b){return dt(w)&&Et(w.value)==="string"?g(n(w.value).toString(),b.toString(),1):g(w.toTex(),b.toString(),1)},"Node, ConstantNode":function(w,b){if(Et(b.value)==="string")return g(w,n(b.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(w,b,A){return g(w.toString(),b.name,A.value)},"string, string, number":function(w,b,A){var S;return A===1?S="{d\\over d"+b+"}":S="{d^{"+A+"}\\over d"+b+"^{"+A+"}}",S+"\\left[".concat(w,"\\right]")}}),v=e("_isConst",{"function, ConstantNode, string":function(){return!0},"function, SymbolNode, string":function(w,b,A){return b.name!==A},"function, ParenthesisNode, string":function(w,b,A){return w(b.content,A)},"function, FunctionAssignmentNode, string":function(w,b,A){return b.params.includes(A)?w(b.expr,A):!0},"function, FunctionNode | OperatorNode, string":function(w,b,A){return b.args.every(S=>w(S,A))}}),D=e("_derivative",{"ConstantNode, function":function(){return y(0)},"SymbolNode, function":function(w,b){return b(w)?y(0):y(1)},"ParenthesisNode, function":function(w,b){return new f(D(w.content,b))},"FunctionAssignmentNode, function":function(w,b){return b(w)?y(0):D(w.expr,b)},"FunctionNode, function":function(w,b){if(b(w))return y(0);var A=w.args[0],S,E=!1,N=!1,_;switch(w.name){case"cbrt":E=!0,_=new c("*","multiply",[y(3),new c("^","pow",[A,new c("/","divide",[y(2),y(3)])])]);break;case"sqrt":case"nthRoot":if(w.args.length===1)E=!0,_=new c("*","multiply",[y(2),new o("sqrt",[A])]);else if(w.args.length===2)return S=new c("/","divide",[y(1),w.args[1]]),D(new c("^","pow",[A,S]),b);break;case"log10":S=y(10);case"log":if(!S&&w.args.length===1)_=A.clone(),E=!0;else if(w.args.length===1&&S||w.args.length===2&&b(w.args[1]))_=new c("*","multiply",[A.clone(),new o("log",[S||w.args[1]])]),E=!0;else if(w.args.length===2)return D(new c("/","divide",[new o("log",[A]),new o("log",[w.args[1]])]),b);break;case"pow":if(w.args.length===2)return D(new c("^","pow",[A,w.args[1]]),b);break;case"exp":_=new o("exp",[A.clone()]);break;case"sin":_=new o("cos",[A.clone()]);break;case"cos":_=new c("-","unaryMinus",[new o("sin",[A.clone()])]);break;case"tan":_=new c("^","pow",[new o("sec",[A.clone()]),y(2)]);break;case"sec":_=new c("*","multiply",[w,new o("tan",[A.clone()])]);break;case"csc":N=!0,_=new c("*","multiply",[w,new o("cot",[A.clone()])]);break;case"cot":N=!0,_=new c("^","pow",[new o("csc",[A.clone()]),y(2)]);break;case"asin":E=!0,_=new o("sqrt",[new c("-","subtract",[y(1),new c("^","pow",[A.clone(),y(2)])])]);break;case"acos":E=!0,N=!0,_=new o("sqrt",[new c("-","subtract",[y(1),new c("^","pow",[A.clone(),y(2)])])]);break;case"atan":E=!0,_=new c("+","add",[new c("^","pow",[A.clone(),y(2)]),y(1)]);break;case"asec":E=!0,_=new c("*","multiply",[new o("abs",[A.clone()]),new o("sqrt",[new c("-","subtract",[new c("^","pow",[A.clone(),y(2)]),y(1)])])]);break;case"acsc":E=!0,N=!0,_=new c("*","multiply",[new o("abs",[A.clone()]),new o("sqrt",[new c("-","subtract",[new c("^","pow",[A.clone(),y(2)]),y(1)])])]);break;case"acot":E=!0,N=!0,_=new c("+","add",[new c("^","pow",[A.clone(),y(2)]),y(1)]);break;case"sinh":_=new o("cosh",[A.clone()]);break;case"cosh":_=new o("sinh",[A.clone()]);break;case"tanh":_=new c("^","pow",[new o("sech",[A.clone()]),y(2)]);break;case"sech":N=!0,_=new c("*","multiply",[w,new o("tanh",[A.clone()])]);break;case"csch":N=!0,_=new c("*","multiply",[w,new o("coth",[A.clone()])]);break;case"coth":N=!0,_=new c("^","pow",[new o("csch",[A.clone()]),y(2)]);break;
vendor: 17,190 bytes, line 66
66case"asinh":E=!0,_=new o("sqrt",[new c("+","add",[new c("^","pow",[A.clone(),y(2)]),y(1)])]);break;case"acosh":E=!0,_=new o("sqrt",[new c("-","subtract",[new c("^","pow",[A.clone(),y(2)]),y(1)])]);break;case"atanh":E=!0,_=new c("-","subtract",[y(1),new c("^","pow",[A.clone(),y(2)])]);break;case"asech":E=!0,N=!0,_=new c("*","multiply",[A.clone(),new o("sqrt",[new c("-","subtract",[y(1),new c("^","pow",[A.clone(),y(2)])])])]);break;case"acsch":E=!0,N=!0,_=new c("*","multiply",[new o("abs",[A.clone()]),new o("sqrt",[new c("+","add",[new c("^","pow",[A.clone(),y(2)]),y(1)])])]);break;case"acoth":E=!0,N=!0,_=new c("-","subtract",[y(1),new c("^","pow",[A.clone(),y(2)])]);break;case"abs":_=new c("/","divide",[new o(new d("abs"),[A.clone()]),A.clone()]);break;case"gamma":default:throw new Error('Cannot process function "'+w.name+'" in derivative: the function is not supported, undefined, or the number of arguments passed to it are not supported')}var C,O;E?(C="/",O="divide"):(C="*",O="multiply");var I=D(A,b);return N&&(I=new c("-","unaryMinus",[I])),new c(C,O,[I,_])},"OperatorNode, function":function(w,b){if(b(w))return y(0);if(w.op==="+")return new c(w.op,w.fn,w.args.map(function(M){return D(M,b)}));if(w.op==="-"){if(w.isUnary())return new c(w.op,w.fn,[D(w.args[0],b)]);if(w.isBinary())return new c(w.op,w.fn,[D(w.args[0],b),D(w.args[1],b)])}if(w.op==="*"){var A=w.args.filter(function(M){return b(M)});if(A.length>0){var S=w.args.filter(function(M){return!b(M)}),E=S.length===1?S[0]:new c("*","multiply",S),N=A.concat(D(E,b));return new c("*","multiply",N)}return new c("+","add",w.args.map(function(M){return new c("*","multiply",w.args.map(function(H){return H===M?D(H,b):H.clone()}))}))}if(w.op==="/"&&w.isBinary()){var _=w.args[0],C=w.args[1];return b(C)?new c("/","divide",[D(_,b),C]):b(_)?new c("*","multiply",[new c("-","unaryMinus",[_]),new c("/","divide",[D(C,b),new c("^","pow",[C.clone(),y(2)])])]):new c("/","divide",[new c("-","subtract",[new c("*","multiply",[D(_,b),C.clone()]),new c("*","multiply",[_.clone(),D(C,b)])]),new c("^","pow",[C.clone(),y(2)])])}if(w.op==="^"&&w.isBinary()){var O=w.args[0],I=w.args[1];if(b(O))return dt(O)&&(s(O.value)||i(O.value,1))?y(0):new c("*","multiply",[w,new c("*","multiply",[new o("log",[O.clone()]),D(I.clone(),b)])]);if(b(I)){if(dt(I)){if(s(I.value))return y(0);if(i(I.value,1))return D(O,b)}var k=new c("^","pow",[O.clone(),new c("-","subtract",[I,y(1)])]);return new c("*","multiply",[I.clone(),new c("*","multiply",[D(O,b),k])])}return new c("*","multiply",[new c("^","pow",[O.clone(),I.clone()]),new c("+","add",[new c("*","multiply",[D(O,b),new c("/","divide",[I.clone(),O.clone()])]),new c("*","multiply",[D(I,b),new o("log",[O.clone()])])])])}throw new Error('Cannot process operator "'+w.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function y(x,w){return new l(u(x,kn(String(x),r)))}return p}),w0="rationalize",Q8=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],K8=U(w0,Q8,t=>{var{config:e,typed:r,equal:n,isZero:a,add:i,subtract:s,multiply:u,divide:l,pow:o,parse:c,simplifyConstant:f,simplifyCore:d,simplify:m,fraction:h,bignumber:p,mathWithTransform:g,matrix:v,AccessorNode:D,ArrayNode:y,ConstantNode:x,FunctionNode:w,IndexNode:b,ObjectNode:A,OperatorNode:S,SymbolNode:E,ParenthesisNode:N}=t;function _(M){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,z=O(),X=C(M,H,!0,z.firstRules),te=X.variables.length,B={exactFractions:!1},j={exactFractions:!0};if(M=X.expression,te>=1){M=I(M);var R,oe,se=!0,le=!1;M=m(M,z.firstRules,{},B);for(var P;oe=se?z.distrDivRules:z.sucDivRules,M=m(M,oe,{},j),se=!se,P=M.toString(),P!==R;)le=!0,R=P;le&&(M=m(M,z.firstRulesAgain,{},B)),M=m(M,z.finalRules,{},B)}var W=[],J={};return M.type==="OperatorNode"&&M.isBinary()&&M.op==="/"?(te===1&&(M.args[0]=k(M.args[0],W),M.args[1]=k(M.args[1])),q&&(J.numerator=M.args[0],J.denominator=M.args[1])):(te===1&&(M=k(M,W)),q&&(J.numerator=M,J.denominator=null)),q?(J.coefficients=W,J.variables=X.variables,J.expression=M,J):M}return r(w0,{Node:_,"Node, boolean":(M,H)=>_(M,{},H),"Node, Object":_,"Node, Object, boolean":_});function C(M,H,q,z){var X=[],te=m(M,z,H,{exactFractions:!1});q=!!q;var B="+-*"+(q?"/":"");R(te);var j={};return j.expression=te,j.variables=X,j;function R(oe){var se=oe.type;if(se==="FunctionNode")throw new Error("There is an unsolved function call");if(se==="OperatorNode")if(oe.op==="^"){if(oe.args[1].type!=="ConstantNode"||!$e(parseFloat(oe.args[1].value)))throw new Error("There is a non-integer exponent");R(oe.args[0])}else{if(!B.includes(oe.op))throw new Error("Operator "+oe.op+" invalid in polynomial expression");for(var le=0;le<oe.args.length;le++)R(oe.args[le])}else if(se==="SymbolNode"){var P=oe.name,W=X.indexOf(P);W===-1&&X.push(P)}else if(se==="ParenthesisNode")R(oe.content);else if(se!=="ConstantNode")throw new Error("type "+se+" is not allowed in polynomial expression")}}function O(){var M=[d,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},f,{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"}],H=[{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)"}],q=[{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)"}],z=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],X={};return X.firstRules=M.concat(H,z),X.distrDivRules=q,X.sucDivRules=z,X.firstRulesAgain=M.concat(H),X.finalRules=[d,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},f,{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))"}],X}function I(M,H,q){var z=M.type,X=arguments.length>1;if(z==="OperatorNode"&&M.isBinary()){var te=!1,B;if(M.op==="^"&&(M.args[0].type==="ParenthesisNode"||M.args[0].type==="OperatorNode")&&M.args[1].type==="ConstantNode"&&(B=parseFloat(M.args[1].value),te=B>=2&&$e(B)),te){if(B>2){var j=M.args[0],R=new S("^","pow",[M.args[0].cloneDeep(),new x(B-1)]);M=new S("*","multiply",[j,R])}else M=new S("*","multiply",[M.args[0],M.args[0].cloneDeep()]);X&&(q==="content"?H.content=M:H.args[q]=M)}}if(z==="ParenthesisNode")I(M.content,M,"content");else if(z!=="ConstantNode"&&z!=="SymbolNode")for(var oe=0;oe<M.args.length;oe++)I(M.args[oe],M,oe);if(!X)return M}function k(M,H){H===void 0&&(H=[]),H[0]=0;var q={};q.cte=1,q.oper="+",q.fire="";var z=0,X="";P(M,null,q),z=H.length-1;for(var te=!0,B,j=z;j>=0;j--)if(H[j]!==0){var R=new x(te?H[j]:Math.abs(H[j])),oe=H[j]<0?"-":"+";if(j>0){var se=new E(X);if(j>1){var le=new x(j);se=new S("^","pow",[se,le])}H[j]===-1&&te?R=new S("-","unaryMinus",[se]):Math.abs(H[j])===1?R=se:R=new S("*","multiply",[R,se])}te?B=R:oe==="+"?B=new S("+","add",[B,R]):B=new S("-","subtract",[B,R]),te=!1}if(te)return new x(0);return B;function P(W,J,re){var ae=W.type;if(ae==="FunctionNode")throw new Error("There is an unsolved function call");if(ae==="OperatorNode"){if(!"+-*^".includes(W.op))throw new Error("Operator "+W.op+" invalid");if(J!==null){if((W.fn==="unaryMinus"||W.fn==="pow")&&J.fn!=="add"&&J.fn!=="subtract"&&J.fn!=="multiply")throw new Error("Invalid "+W.op+" placing");if((W.fn==="subtract"||W.fn==="add"||W.fn==="multiply")&&J.fn!=="add"&&J.fn!=="subtract")throw new Error("Invalid "+W.op+" placing");if((W.fn==="subtract"||W.fn==="add"||W.fn==="unaryMinus")&&re.noFil!==0)throw new Error("Invalid "+W.op+" placing")}(W.op==="^"||W.op==="*")&&(re.fire=W.op);for(var he=0;he<W.args.length;he++)W.fn==="unaryMinus"&&(re.oper="-"),(W.op==="+"||W.fn==="subtract")&&(re.fire="",re.cte=1,re.oper=he===0?"+":W.op),re.noFil=he,P(W.args[he],W,re)}else if(ae==="SymbolNode"){if(W.name!==X&&X!=="")throw new Error("There is more than one variable");if(X=W.name,J===null){H[1]=1;return}if(J.op==="^"&&re.noFil!==0)throw new Error("In power the variable should be the first parameter");if(J.op==="*"&&re.noFil!==1)throw new Error("In multiply the variable should be the second parameter");(re.fire===""||re.fire==="*")&&(z<1&&(H[1]=0),H[1]+=re.cte*(re.oper==="+"?1:-1),z=Math.max(1,z))}else if(ae==="ConstantNode"){var fe=parseFloat(W.value);if(J===null){H[0]=fe;return}if(J.op==="^"){if(re.noFil!==1)throw new Error("Constant cannot be powered");if(!$e(fe)||fe<=0)throw new Error("Non-integer exponent is not allowed");for(var De=z+1;De<fe;De++)H[De]=0;fe>z&&(H[fe]=0),H[fe]+=re.cte*(re.oper==="+"?1:-1),z=Math.max(fe,z);return}re.cte=fe,re.fire===""&&(H[0]+=re.cte*(re.oper==="+"?1:-1))}else throw new Error("Type "+ae+" is not allowed")}}}),x0="zpk2tf",e6=["typed","add","multiply","Complex","number"],t6=U(x0,e6,t=>{var{typed:e,add:r,multiply:n,Complex:a,number:i}=t;return e(x0,{"Array,Array,number":function(o,c,f){return s(o,c,f)},"Array,Array":function(o,c){return s(o,c,1)},"Matrix,Matrix,number":function(o,c,f){return s(o.valueOf(),c.valueOf(),f)},"Matrix,Matrix":function(o,c){return s(o.valueOf(),c.valueOf(),1)}});function s(l,o,c){l.some(D=>D.type==="BigNumber")&&(l=l.map(D=>i(D))),o.some(D=>D.type==="BigNumber")&&(o=o.map(D=>i(D)));for(var f=[a(1,0)],d=[a(1,0)],m=0;m<l.length;m++){var h=l[m];typeof h=="number"&&(h=a(h,0)),f=u(f,[a(1,0),a(-h.re,-h.im)])}for(var p=0;p<o.length;p++){var g=o[p];typeof g=="number"&&(g=a(g,0)),d=u(d,[a(1,0),a(-g.re,-g.im)])}for(var v=0;v<f.length;v++)f[v]=n(f[v],c);return[f,d]}function u(l,o){for(var c=[],f=0;f<l.length+o.length-1;f++){c[f]=a(0,0);for(var d=0;d<l.length;d++)f-d>=0&&f-d<o.length&&(c[f]=r(c[f],n(l[d],o[f-d])))}return c}}),D0="freqz",r6=["typed","add","multiply","Complex","divide","matrix"],n6=U(D0,r6,t=>{var{typed:e,add:r,multiply:n,Complex:a,divide:i,matrix:s}=t;return e(D0,{"Array, Array":function(c,f){var d=l(512);return u(c,f,d)},"Array, Array, Array":function(c,f,d){return u(c,f,d)},"Array, Array, number":function(c,f,d){if(d<0)throw new Error("w must be a positive number");var m=l(d);return u(c,f,m)},"Matrix, Matrix":function(c,f){var d=l(512),{w:m,h}=u(c.valueOf(),f.valueOf(),d);return{w:s(m),h:s(h)}},"Matrix, Matrix, Matrix":function(c,f,d){var{h:m}=u(c.valueOf(),f.valueOf(),d.valueOf());return{h:s(m),w:s(d)}},"Matrix, Matrix, number":function(c,f,d){if(d<0)throw new Error("w must be a positive number");var m=l(d),{h}=u(c.valueOf(),f.valueOf(),m);return{h:s(h),w:s(m)}}});function u(o,c,f){for(var d=[],m=[],h=0;h<f.length;h++){for(var p=a(0,0),g=a(0,0),v=0;v<o.length;v++)p=r(p,n(o[v],a(Math.cos(-v*f[h]),Math.sin(-v*f[h]))));for(var D=0;D<c.length;D++)g=r(g,n(c[D],a(Math.cos(-D*f[h]),Math.sin(-D*f[h]))));d.push(p),m.push(g)}for(var y=[],x=0;x<d.length;x++)y.push(i(d[x],m[x]));return{h:y,w:f}}function l(o){for(var c=[],f=0;f<o;f++)c.push(f/o*Math.PI);return c}}),a6="reviver",i6=["classes"],s6=U(a6,i6,t=>{var{classes:e}=t;return function(n,a){var i=e[a&&a.mathjs];return i&&typeof i.fromJSON=="function"?i.fromJSON(a):a}}),o6="replacer",u6=[],l6=U(o6,u6,()=>function(e,r){return typeof r=="number"&&(!isFinite(r)||isNaN(r))?{mathjs:"number",value:String(r)}:typeof r=="bigint"?{mathjs:"bigint",value:String(r)}:r}),c6="15.0.0",f6=U("true",[],()=>!0),d6=U("false",[],()=>!1),m6=U("null",[],()=>null),h6=Mr("Infinity",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(1/0):1/0}),p6=Mr("NaN",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(NaN):NaN}),v6=Mr("pi",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?Al(r):vA}),g6=Mr("tau",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?HM(r):gA}),y6=Mr("e",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?YM(r):yA}),b6=Mr("phi",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?VM(r):bA}),w6=Mr("LN2",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(2).ln():Math.LN2}),x6=Mr("LN10",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(10).ln():Math.LN10}),D6=Mr("LOG2E",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(1).div(new r(2).ln()):Math.LOG2E}),E6=Mr("LOG10E",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(1).div(new r(10).ln()):Math.LOG10E}),A6=Mr("SQRT1_2",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r("0.5").sqrt():Math.SQRT1_2}),S6=Mr("SQRT2",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(2).sqrt():Math.SQRT2}),N6=Mr("i",["Complex"],t=>{var{Complex:e}=t;return e.I}),_6=U("PI",["pi"],t=>{var{pi:e}=t;return e}),C6=U("E",["e"],t=>{var{e}=t;return e}),M6=U("version",[],()=>c6);function Mr(t,e,r){return U(t,e,r,{recreateOnConfigChange:!0})}var T6=et("speedOfLight","299792458","m s^-1"),F6=et("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),O6=et("planckConstant","6.62607015e-34","J s"),B6=et("reducedPlanckConstant","1.0545718176461565e-34","J s"),k6=et("magneticConstant","1.25663706212e-6","N A^-2"),I6=et("electricConstant","8.8541878128e-12","F m^-1"),L6=et("vacuumImpedance","376.730313667","ohm"),R6=et("coulomb","8.987551792261171e9","N m^2 C^-2"),$6=et("coulombConstant","8.987551792261171e9","N m^2 C^-2"),P6=et("elementaryCharge","1.602176634e-19","C"),q6=et("bohrMagneton","9.2740100783e-24","J T^-1"),U6=et("conductanceQuantum","7.748091729863649e-5","S"),z6=et("inverseConductanceQuantum","12906.403729652257","ohm"),Y6=et("magneticFluxQuantum","2.0678338484619295e-15","Wb"),V6=et("nuclearMagneton","5.0507837461e-27","J T^-1"),H6=et("klitzing","25812.807459304513","ohm"),W6=et("bohrRadius","5.29177210903e-11","m"),G6=et("classicalElectronRadius","2.8179403262e-15","m"),j6=et("electronMass","9.1093837015e-31","kg"),Z6=et("fermiCoupling","1.1663787e-5","GeV^-2"),X6=Io("fineStructure",.0072973525693),J6=et("hartreeEnergy","4.3597447222071e-18","J"),Q6=et("protonMass","1.67262192369e-27","kg"),K6=et("deuteronMass","3.3435830926e-27","kg"),eL=et("neutronMass","1.6749271613e-27","kg"),tL=et("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),rL=et("rydberg","10973731.568160","m^-1"),nL=et("thomsonCrossSection","6.6524587321e-29","m^2"),aL=Io("weakMixingAngle",.2229),iL=Io("efimovFactor",22.7),sL=et("atomicMass","1.66053906660e-27","kg"),oL=et("avogadro","6.02214076e23","mol^-1"),uL=et("boltzmann","1.380649e-23","J K^-1"),lL=et("faraday","96485.33212331001","C mol^-1"),cL=et("firstRadiation","3.7417718521927573e-16","W m^2"),fL=et("loschmidt","2.686780111798444e25","m^-3"),dL=et("gasConstant","8.31446261815324","J K^-1 mol^-1"),mL=et("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),hL=et("molarVolume","0.022413969545014137","m^3 mol^-1"),pL=Io("sackurTetrode",-1.16487052358),vL=et("secondRadiation","0.014387768775039337","m K"),gL=et("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),yL=et("wienDisplacement","2.897771955e-3","m K"),bL=et("molarMass","0.99999999965e-3","kg mol^-1"),wL=et("molarMassC12","11.9999999958e-3","kg mol^-1"),xL=et("gravity","9.80665","m s^-2"),DL=et("planckLength","1.616255e-35","m"),EL=et("planckMass","2.176435e-8","kg"),AL=et("planckTime","5.391245e-44","s"),SL=et("planckCharge","1.87554603778e-18","C"),NL=et("planckTemperature","1.416785e+32","K");function et(t,e,r){var n=["config","Unit","BigNumber"];return U(t,n,a=>{var{config:i,Unit:s,BigNumber:u}=a,l=i.number==="BigNumber"?new u(e):parseFloat(e),o=new s(l,r);return o.fixPrefix=!0,o})}function Io(t,e){var r=["config","BigNumber"];return U(t,r,n=>{var{config:a,BigNumber:i}=n;return a.number==="BigNumber"?new i(e):e})}function E0(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function _L(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};
66e%2?E0(Object(r),!0).forEach(function(n){Yt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E0(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var CL="mapSlices",ML=["typed","isInteger"],TL=U(CL,ML,t=>{var{typed:e,isInteger:r}=t,n=cl({typed:e,isInteger:r});return e("mapSlices",{"...any":function(i){var s=i[1];qe(s)?i[1]=s-1:Qe(s)&&(i[1]=s.minus(1));try{return n.apply(null,i)}catch(u){throw gr(u)}}})},_L({isTransformFunction:!0},cl.meta)),FL="column",OL=["typed","Index","matrix","range"],BL=U(FL,OL,t=>{var{typed:e,Index:r,matrix:n,range:a}=t,i=qh({typed:e,Index:r,matrix:n,range:a});return e("column",{"...any":function(u){var l=u.length-1,o=u[l];qe(o)&&(u[l]=o-1);try{return i.apply(null,u)}catch(c){throw gr(c)}}})},{isTransformFunction:!0});function Ll(t,e,r){var n=t.filter(function(l){return Ht(l)&&!(l.name in e)&&!r.has(l.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+t+'"');var a=n.name,i=new Map,s=new _f(r,i,new Set([a])),u=t.compile();return function(o){return i.set(a,o),u.evaluate(s)}}var kL="transformCallback",IL=["typed"],Rl=U(kL,IL,t=>{var{typed:e}=t;return function(n,a){return e.isTypedFunction(n)?r(n,a):A0(n,n.length,a)};function r(n,a){var i=Object.fromEntries(Object.entries(n.signatures).map(s=>{var[u,l]=s,o=u.split(",").length;return e.isTypedFunction(l)?[u,r(l,a)]:[u,A0(l,o,a)]}));return typeof n.name=="string"?e(n.name,i):e(i)}});function A0(t,e,r){return e===r?t:e===r+1?function(){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];var s=a.slice(0,r),u=S0(a[r]);return t(...s,u)}:e>r+1?function(){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];var s=a.slice(0,r),u=S0(a[r]),l=a.slice(r+1);return t(...s,u,...l)}:t}function S0(t){return t.map(e=>e+1)}var LL="filter",RL=["typed"],$L=U(LL,RL,t=>{var{typed:e}=t;function r(a,i,s){var u=Vh({typed:e}),l=Rl({typed:e});if(a.length===0)return u();var o=a[0];if(a.length===1)return u(o);var c=a.length-1,f=a[c];return o&&(o=n(o,s)),f&&(Ht(f)||Oa(f)?f=n(f,s):f=Ll(f,i,s)),u(o,l(f,c))}r.rawArgs=!0;function n(a,i){return a.compile().evaluate(i)}return r},{isTransformFunction:!0}),PL="forEach",qL=["typed"],UL=U(PL,qL,t=>{var{typed:e}=t,r=Gh({typed:e}),n=Rl({typed:e});function a(s,u,l){if(s.length===0)return r();var o=s[0];if(s.length===1)return r(o);var c=s.length-1,f=s[c];return o&&(o=i(o,l)),f&&(Ht(f)||Oa(f)?f=i(f,l):f=Ll(f,u,l)),r(o,n(f,c))}a.rawArgs=!0;function i(s,u){return s.compile().evaluate(u)}return a},{isTransformFunction:!0}),zL="index",YL=["Index","getMatrixDataType"],VL=U(zL,YL,t=>{var{Index:e,getMatrixDataType:r}=t;return function(){for(var a=[],i=0,s=arguments.length;i<s;i++){var u=arguments[i];if(_s(u))u.start--,u.end-=u.step>0?0:2;else if(u&&u.isSet===!0)u=u.map(function(o){return o-1});else if(Dt(u)||ze(u))r(u)!=="boolean"&&(u=u.map(function(o){return o-1}));else if(qe(u)||Fa(u))u--;else if(Qe(u))u=u.toNumber()-1;else if(typeof u!="string")throw new TypeError("Dimension must be an Array, Matrix, number, bigint, string, or Range");a[i]=u}var l=new e;return e.apply(l,a),l}},{isTransformFunction:!0}),HL="map",WL=["typed"],GL=U(HL,WL,t=>{var{typed:e}=t,r=Jh({typed:e}),n=Rl({typed:e});function a(i,s,u){if(i.length===0)return r();if(i.length===1)return r(i[0]);var l=i.length-1,o=i.slice(0,l),c=i[l];return o=o.map(d=>f(d,u)),c&&(Ht(c)||Oa(c)?c=f(c,u):c=Ll(c,s,u)),r(...o,n(c,l));function f(d,m){return d.compile().evaluate(m)}}return a.rawArgs=!0,a},{isTransformFunction:!0});function jL(t){return qe(t)?t-1:Qe(t)?t.minus(1):t}function ZL(t){return qe(t)||Qe(t)}function Wn(t){if(t.length===2&&wr(t[0])){t=t.slice();var e=t[1];ZL(e)&&(t[1]=jL(e))}return t}var XL="max",JL=["typed","config","numeric","larger","isNaN"],QL=U(XL,JL,t=>{var{typed:e,config:r,numeric:n,larger:a,isNaN:i}=t,s=av({typed:e,config:r,numeric:n,larger:a,isNaN:i});return e("max",{"...any":function(l){l=Wn(l);try{return s.apply(null,l)}catch(o){throw gr(o)}}})},{isTransformFunction:!0}),KL="mean",eR=["typed","add","divide"],tR=U(KL,eR,t=>{var{typed:e,add:r,divide:n}=t,a=Fg({typed:e,add:r,divide:n});return e("mean",{"...any":function(s){s=Wn(s);try{return a.apply(null,s)}catch(u){throw gr(u)}}})},{isTransformFunction:!0}),rR="min",nR=["typed","config","numeric","smaller","isNaN"],aR=U(rR,nR,t=>{var{typed:e,config:r,numeric:n,smaller:a,isNaN:i}=t,s=sv({typed:e,config:r,numeric:n,smaller:a,isNaN:i});return e("min",{"...any":function(l){l=Wn(l);try{return s.apply(null,l)}catch(o){throw gr(o)}}})},{isTransformFunction:!0}),iR="range",sR=["typed","config","?matrix","?bignumber","equal","smaller","smallerEq","larger","largerEq","add","isZero","isPositive"],oR=U(iR,sR,t=>{var{typed:e,config:r,matrix:n,bignumber:a,equal:i,smaller:s,smallerEq:u,larger:l,largerEq:o,add:c,isZero:f,isPositive:d}=t,m=rp({typed:e,config:r,matrix:n,bignumber:a,equal:i,smaller:s,smallerEq:u,larger:l,largerEq:o,add:c,isZero:f,isPositive:d});return e("range",{"...any":function(p){var g=p.length-1,v=p[g];return typeof v!="boolean"&&p.push(!0),m.apply(null,p)}})},{isTransformFunction:!0}),uR="row",lR=["typed","Index","matrix","range"],cR=U(uR,lR,t=>{var{typed:e,Index:r,matrix:n,range:a}=t,i=op({typed:e,Index:r,matrix:n,range:a});return e("row",{"...any":function(u){var l=u.length-1,o=u[l];
vendor: 12,504 bytes, line 66
66qe(o)&&(u[l]=o-1);try{return i.apply(null,u)}catch(c){throw gr(c)}}})},{isTransformFunction:!0}),fR="subset",dR=["typed","matrix","zeros","add"],mR=U(fR,dR,t=>{var{typed:e,matrix:r,zeros:n,add:a}=t,i=fp({typed:e,matrix:r,zeros:n,add:a});return e("subset",{"...any":function(u){try{return i.apply(null,u)}catch(l){throw gr(l)}}})},{isTransformFunction:!0}),hR="concat",pR=["typed","matrix","isInteger"],vR=U(hR,pR,t=>{var{typed:e,matrix:r,isInteger:n}=t,a=$h({typed:e,matrix:r,isInteger:n});return e("concat",{"...any":function(s){var u=s.length-1,l=s[u];qe(l)?s[u]=l-1:Qe(l)&&(s[u]=l.minus(1));try{return a.apply(null,s)}catch(o){throw gr(o)}}})},{isTransformFunction:!0}),N0="diff",gR=["typed","matrix","subtract","number","bignumber"],yR=U(N0,gR,t=>{var{typed:e,matrix:r,subtract:n,number:a,bignumber:i}=t,s=Kh({typed:e,matrix:r,subtract:n,number:a,bignumber:i});return e(N0,{"...any":function(l){l=Wn(l);try{return s.apply(null,l)}catch(o){throw gr(o)}}})},{isTransformFunction:!0}),bR="std",wR=["typed","map","sqrt","variance"],xR=U(bR,wR,t=>{var{typed:e,map:r,sqrt:n,variance:a}=t,i=Pg({typed:e,map:r,sqrt:n,variance:a});return e("std",{"...any":function(u){u=Wn(u);try{return i.apply(null,u)}catch(l){throw gr(l)}}})},{isTransformFunction:!0}),_0="sum",DR=["typed","config","add","numeric"],ER=U(_0,DR,t=>{var{typed:e,config:r,add:n,numeric:a}=t,i=Cg({typed:e,config:r,add:n,numeric:a});return e(_0,{"...any":function(u){u=Wn(u);try{return i.apply(null,u)}catch(l){throw gr(l)}}})},{isTransformFunction:!0}),AR="quantileSeq",SR=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger","mapSlices"],NR=U(AR,SR,t=>{var{typed:e,bignumber:r,add:n,subtract:a,divide:i,multiply:s,partitionSelect:u,compare:l,isInteger:o,smaller:c,smallerEq:f,larger:d,mapSlices:m}=t,h=Rg({typed:e,bignumber:r,add:n,subtract:a,divide:i,multiply:s,partitionSelect:u,compare:l,isInteger:o,smaller:c,smallerEq:f,larger:d,mapSlices:m});return e("quantileSeq",{"Array | Matrix, number | BigNumber":h,"Array | Matrix, number | BigNumber, number":(g,v,D)=>h(g,v,p(D)),"Array | Matrix, number | BigNumber, boolean":h,"Array | Matrix, number | BigNumber, boolean, number":(g,v,D,y)=>h(g,v,D,p(y)),"Array | Matrix, Array | Matrix":h,"Array | Matrix, Array | Matrix, number":(g,v,D)=>h(g,v,p(D)),"Array | Matrix, Array | Matrix, boolean":h,"Array | Matrix, Array | Matrix, boolean, number":(g,v,D,y)=>h(g,v,D,p(y))});function p(g){return Wn([[],g])[1]}},{isTransformFunction:!0}),C0="cumsum",_R=["typed","add","unaryPlus"],CR=U(C0,_R,t=>{var{typed:e,add:r,unaryPlus:n}=t,a=Mg({typed:e,add:r,unaryPlus:n});return e(C0,{"...any":function(s){if(s.length===2&&wr(s[0])){var u=s[1];qe(u)?s[1]=u-1:Qe(u)&&(s[1]=u.minus(1))}try{return a.apply(null,s)}catch(l){throw gr(l)}}})},{isTransformFunction:!0}),M0="variance",MR=["typed","add","subtract","multiply","divide","mapSlices","isNaN"],TR=U(M0,MR,t=>{var{typed:e,add:r,subtract:n,multiply:a,divide:i,mapSlices:s,isNaN:u}=t,l=Ig({typed:e,add:r,subtract:n,multiply:a,divide:i,mapSlices:s,isNaN:u});return e(M0,{"...any":function(c){c=Wn(c);try{return l.apply(null,c)}catch(f){throw gr(f)}}})},{isTransformFunction:!0}),T0="print",FR=["typed","matrix","zeros","add"],OR=U(T0,FR,t=>{var{typed:e,matrix:r,zeros:n,add:a}=t,i=Cp({typed:e,matrix:r,zeros:n,add:a});return e(T0,{"string, Object | Array":function(l,o){return i(s(l),o)},"string, Object | Array, number | Object":function(l,o,c){return i(s(l),o,c)}});function s(u){return u.replace(Np,l=>{var o=l.slice(1).split("."),c=o.map(function(f){return!isNaN(f)&&f.length>0?parseInt(f)-1:f});return"$"+c.join(".")})}},{isTransformFunction:!0}),BR="and",kR=["typed","matrix","zeros","add","equalScalar","not","concat"],IR=U(BR,kR,t=>{var{typed:e,matrix:r,equalScalar:n,zeros:a,not:i,concat:s}=t,u=Zp({typed:e,matrix:r,equalScalar:n,zeros:a,not:i,concat:s});function l(o,c,f){var d=o[0].compile().evaluate(f);if(!wr(d)&&!u(d,!0))return!1;var m=o[1].compile().evaluate(f);return u(d,m)}return l.rawArgs=!0,l},{isTransformFunction:!0}),LR="or",RR=["typed","matrix","equalScalar","DenseMatrix","concat"],$R=U(LR,RR,t=>{var{typed:e,matrix:r,equalScalar:n,DenseMatrix:a,concat:i}=t,s=Ih({typed:e,matrix:r,equalScalar:n,DenseMatrix:a,concat:i});function u(l,o,c){var f=l[0].compile().evaluate(c);if(!wr(f)&&s(f,!1))return!0;var d=l[1].compile().evaluate(c);return s(f,d)}return u.rawArgs=!0,u},{isTransformFunction:!0}),PR="nullish",qR=["typed","matrix","size","flatten","deepEqual"],UR=U(PR,qR,t=>{var{typed:e,matrix:r,size:n,flatten:a,deepEqual:i}=t,s=Bh({typed:e,matrix:r,size:n,flatten:a,deepEqual:i});function u(l,o,c){var f=l[0].compile().evaluate(c);if(!wr(f)&&f!=null&&f!==void 0)return f;var d=l[1].compile().evaluate(c);return s(f,d)}return u.rawArgs=!0,u},{isTransformFunction:!0}),zR="bitAnd",YR=["typed","matrix","zeros","add","equalScalar","not","concat"],VR=U(zR,YR,t=>{var{typed:e,matrix:r,equalScalar:n,zeros:a,not:i,concat:s}=t,u=Dh({typed:e,matrix:r,equalScalar:n,zeros:a,not:i,concat:s});function l(o,c,f){var d=o[0].compile().evaluate(f);if(!wr(d)){if(isNaN(d))return NaN;if(d===0||d===!1)return 0}var m=o[1].compile().evaluate(f);return u(d,m)}return l.rawArgs=!0,l},{isTransformFunction:!0}),HR="bitOr",WR=["typed","matrix","equalScalar","DenseMatrix","concat"],GR=U(HR,WR,t=>{var{typed:e,matrix:r,equalScalar:n,DenseMatrix:a,concat:i}=t,s=Sh({typed:e,matrix:r,equalScalar:n,DenseMatrix:a,concat:i});function u(l,o,c){var f=l[0].compile().evaluate(c);if(!wr(f)){if(isNaN(f))return NaN;if(f===-1)return-1;if(f===!0)return 1}var d=l[1].compile().evaluate(c);return s(f,d)}return u.rawArgs=!0,u},{isTransformFunction:!0}),jR=Object.freeze(Object.defineProperty({__proto__:null,createAbs:SS,createAccessorNode:RF,createAcos:rT,createAcosh:aT,createAcot:sT,createAcoth:uT,createAcsc:cT,createAcsch:dT,createAdd:xF,createAddScalar:MS,createAnd:Zp,createAndTransform:IR,createArg:vN,createArrayNode:PF,createAsec:hT,createAsech:vT,createAsin:yT,createAsinh:xT,createAssignmentNode:YF,createAtan:AT,createAtan2:NT,createAtanh:CT,createAtomicMass:sL,createAvogadro:oL,createBellNumbers:C8,createBigNumberClass:ME,createBigint:XA,createBignumber:nS,createBin:J_,createBitAnd:Dh,createBitAndTransform:VR,createBitNot:lN,createBitOr:Sh,createBitOrTransform:GR,createBitXor:hN,createBlockNode:HF,createBohrMagneton:q6,createBohrRadius:W6,createBoltzmann:uL,createBoolean:eS,createCatalan:T8,createCbrt:BS,createCeil:YS,createChain:JI,createChainClass:hO,createClassicalElectronRadius:G6,createClone:dA,createColumn:qh,createColumnTransform:BL,createCombinations:q5,createCombinationsWithRep:z5,createCompare:GC,createCompareNatural:QC,createCompareText:tM,createCompile:D3,createComplex:sS,createComplexClass:kE,createComposition:O8,createConcat:$h,createConcatTransform:vR,createConditionalNode:GF,createConductanceQuantum:U6,createConj:yN,createConstantNode:KF,createCorr:$5,createCos:TT,createCosh:OT,createCot:kT,createCoth:LT,createCoulomb:R6,createCoulombConstant:$6,createCount:ON,createCreateUnit:eT,createCross:kN,createCsc:$T,createCsch:qT,createCtranspose:E_,createCube:HS,createCumSum:Mg,createCumSumTransform:CR,createDeepEqual:wM,createDenseMatrixClass:cA,createDerivative:J8,createDet:KI,createDeuteronMass:K6,createDiag:LN,createDiff:Kh,createDiffTransform:yR,createDistance:E5,createDivide:x5,createDivideScalar:mC,createDot:_F,createDotDivide:CC,createDotMultiply:tN,createDotPow:NC,createE:y6,createEfimovFactor:iL,createEigs:u5,createElectricConstant:I6,createElectronMass:j6,createElementaryCharge:P6,createEqual:nM,createEqualScalar:PA,createEqualText:sM,createErf:$_,createEvaluate:A3,createExp:GS,createExpm:c5,createExpm1:ZS,createFactorial:j5,createFalse:d6,createFaraday:lL,createFermiCoupling:Z6,createFft:__,createFibonacciHeapClass:$M,createFilter:Vh,createFilterTransform:$L,createFineStructure:X6,createFirstRadiation:cL,createFix:QS,createFlatten:qN,createFloor:nh,createForEach:Gh,createForEachTransform:UL,createFormat:Z_,createFraction:lS,createFractionClass:zE,createFreqz:n6,createFunctionAssignmentNode:t3,createFunctionNode:y3,createGamma:V5,createGasConstant:dL,createGcd:D2,createGetMatrixDataType:VN,createGravitationConstant:F6,createGravity:xL,createHartreeEnergy:J6,createHasNumericValue:CA,createHelp:ZI,createHelpClass:fO,createHex:tC,createHypot:EF,createI:N6,createIdentity:WN,createIfft:M_,createIm:wN,createImmutableDenseMatrixClass:OM,createIndex:OF,createIndexClass:IM,createIndexNode:n3,createIndexTransform:VL,createInfinity:h6,createIntersect:N5,createInv:t5,createInverseConductanceQuantum:z6,createInvmod:J2,createIsInteger:hA,createIsNaN:kA,createIsNegative:AA,createIsNumeric:NA,createIsPositive:TA,createIsPrime:uC,createIsZero:OA,createKldivergence:X5,createKlitzing:H6,createKron:jN,createLN10:x6,createLN2:w6,createLOG10E:E6,createLOG2E:D6,createLarger:hM,createLargerEq:gM,createLcm:N2,createLeafCount:k8,createLeftShift:qC,createLgamma:W5,createLog:wC,createLog10:M2,createLog1p:DC,createLog2:F2,createLoschmidt:fL,createLsolve:TC,createLsolveAll:kC,createLup:O3,createLusolve:sO,createLyap:y5,createMad:B5,createMagneticConstant:k6,createMagneticFluxQuantum:Y6,createMap:Jh,createMapSlices:cl,createMapSlicesTransform:TL,createMapTransform:GL,createMatrix:fS,createMatrixClass:jE,createMatrixFromColumns:gS,createMatrixFromFunction:mS,createMatrixFromRows:pS,createMax:av,createMaxTransform:QL,createMean:Fg,createMeanTransform:tR,createMedian:F5,createMin:sv,createMinTransform:aR,createMod:sh,createMode:H_,createMolarMass:bL,createMolarMassC12:wL,createMolarPlanckConstant:mL,createMolarVolume:hL,createMultinomial:Q5,createMultiply:L2,createMultiplyScalar:k2,createNaN:p6,createNeutronMass:eL,createNode:IF,createNorm:SF,createNot:AN,createNthRoot:$2,createNthRoots:AC,createNuclearMagneton:V6,createNull:m6,createNullish:Bh,createNullishTransform:UR,createNumber:GA,createNumeric:fC,createObjectNode:i3,createOct:K_,createOnes:KN,createOperatorNode:o3,createOr:Ih,createOrTransform:$R,createParenthesisNode:l3,createParse:w3,createParser:T3,createParserClass:_3,createPartitionSelect:SM,createPermutations:e8,createPhi:b6,createPi:v6,createPickRandom:w8,createPinv:n5,createPlanckCharge:SL,createPlanckConstant:O6,createPlanckLength:DL,createPlanckMass:EL,createPlanckTemperature:NL,createPlanckTime:AL,createPolynomialRoot:uO,createPow:pC,createPrint:Cp,createPrintTransform:OR,createProd:G_,createProtonMass:Q6,createQr:k3,createQuantileSeq:Rg,createQuantileSeqTransform:NR,createQuantumOfCirculation:tL,createRandom:D8,createRandomInt:A8,createRange:rp,createRangeClass:HE,createRangeNode:f3,createRangeTransform:oR,createRationalize:K8,createRe:DN,createReducedPlanckConstant:B6,createRelationalNode:m3,createReplacer:l6,createReshape:n_,createResize:s_,createResolve:G8,createResultSet:BD,createReviver:s6,createRightArithShift:zC,createRightLogShift:VC,createRotate:u_,createRotationMatrix:c_,createRound:gC,createRow:op,createRowTransform:cR,createRydberg:rL,createSQRT1_2:A6,createSQRT2:S6,createSackurTetrode:pL,createSchur:v5,createSec:zT,createSech:VT,createSecondRadiation:vL,createSetCartesian:tF,createSetDifference:nF,createSetDistinct:iF,createSetIntersect:oF,createSetIsSubset:lF,createSetMultiplicity:fF,createSetPowerset:mF,createSetSize:pF,createSetSymDifference:gF,createSetUnion:bF,createSign:q2,createSimplify:P8,createSimplifyConstant:z8,createSimplifyCore:V8,createSin:WT,createSinh:jT,createSize:m_,createSlu:aO,createSmaller:uM,createSmallerEq:fM,createSolveODE:I_,createSort:_M,createSpaClass:UM,createSparse:QM,createSparseMatrixClass:zA,createSpeedOfLight:T6,createSplitUnit:bS,createSqrt:Y2,createSqrtm:d5,createSquare:H2,createSqueeze:p_,createStd:Pg,createStdTransform:xR,createStefanBoltzmann:gL,createStirlingS2:N8,createString:QA,createSubset:fp,createSubsetTransform:mR,createSubtract:G2,createSubtractScalar:FS,createSum:Cg,createSumTransform:ER,createSylvester:h5,createSymbolNode:v3,createSymbolicEqual:Z8,createTan:XT,createTanh:KT,createTau:g6,createThomsonCrossSection:nL,createTo:aC,createToBest:sC,createTrace:TF,createTranspose:x_,createTrue:f6,createTypeOf:LA,createTyped:MD,createUnaryMinus:xS,createUnaryPlus:ES,createUnequal:DM,createUnitClass:jM,createUnitFunction:XM,createUppercaseE:C6,createUppercasePi:_6,createUsolve:OC,createUsolveAll:LC,createVacuumImpedance:L6,createVariance:Ig,createVarianceTransform:TR,createVersion:M6,createWeakMixingAngle:aL,createWienDisplacement:yL,createXgcd:Z2,createXor:CN,createZeros:S_,createZeta:Y_,createZ
66pk2tf:t6},Symbol.toStringTag,{value:"Module"})),Lo={exports:{}},F0;function ZR(){if(F0)return Lo.exports;F0=1;function t(){}return t.prototype={on:function(e,r,n){var a=this.e||(this.e={});return(a[e]||(a[e]=[])).push({fn:r,ctx:n}),this},once:function(e,r,n){var a=this;function i(){a.off(e,i),r.apply(n,arguments)}return i._=r,this.on(e,i,n)},emit:function(e){var r=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),a=0,i=n.length;for(a;a<i;a++)n[a].fn.apply(n[a].ctx,r);return this},off:function(e,r){var n=this.e||(this.e={}),a=n[e],i=[];if(a&&r)for(var s=0,u=a.length;s<u;s++)a[s].fn!==r&&a[s].fn._!==r&&i.push(a[s]);return i.length?n[e]=i:delete n[e],this}},Lo.exports=t,Lo.exports.TinyEmitter=t,Lo.exports}var XR=ZR();const JR=gi(XR);function QR(t){var e=new JR;return t.on=e.on.bind(e),t.off=e.off.bind(e),t.once=e.once.bind(e),t.emit=e.emit.bind(e),t}function KR(t,e,r,n){function a(v,D){var y=arguments.length;if(y!==1&&y!==2)throw new An("import",y,1,2);D||(D={});function x(S,E,N){if(Array.isArray(E))E.forEach(O=>x(S,O));else if(ta(E)||f(E))for(var _ in E)ke(E,_)&&x(S,E[_],_);else if(Ci(E)||N!==void 0){var C=Ci(E)?p(E)?E.fn+".transform":E.fn:N;if(ke(S,C)&&S[C]!==E&&!D.silent)throw new Error('Cannot import "'+C+'" twice');S[C]=E}else if(!D.silent)throw new TypeError("Factory, Object, or Array expected")}var w={};x(w,v);for(var b in w)if(ke(w,b)){var A=w[b];if(Ci(A))o(A,D);else if(c(A))i(b,A,D);else if(!D.silent)throw new TypeError("Factory, Object, or Array expected")}}function i(v,D,y){var x;if(y.wrap&&typeof D=="function"&&(D=l(D)),d(D)&&(D=t(v,{[D.signature]:D})),t.isTypedFunction(r[v])&&t.isTypedFunction(D)){y.override?D=t(v,D.signatures):D=t(r[v],D),r[v]=D,delete n[v],s(v,D),r.emit("import",v,function(){return D});return}var w=r[v]!==void 0,b=(x=r.Unit)===null||x===void 0?void 0:x.isValuelessUnit(v);if(!w&&!b||y.override){r[v]=D,delete n[v],s(v,D),r.emit("import",v,function(){return D});return}if(!y.silent)throw new Error('Cannot import "'+v+'": already exists')}function s(v,D){D&&typeof D.transform=="function"?(r.expression.transform[v]=D.transform,m(v)&&(r.expression.mathWithTransform[v]=D.transform)):(delete r.expression.transform[v],m(v)&&(r.expression.mathWithTransform[v]=D))}function u(v){delete r.expression.transform[v],m(v)?r.expression.mathWithTransform[v]=r[v]:delete r.expression.mathWithTransform[v]}function l(v){var D=function(){for(var x=[],w=0,b=arguments.length;w<b;w++){var A=arguments[w];x[w]=A&&A.valueOf()}return v.apply(r,x)};return v.transform&&(D.transform=v.transform),D}function o(v,D){var y,x,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:v.fn;if(w.includes("."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(w));var b=p(v)?r.expression.transform:r,A=w in r.expression.transform,S=ke(b,w)?b[w]:void 0,E=function(){var I={};v.dependencies.map(Zf).forEach(M=>{if(M.includes("."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(M));M==="math"?I.math=r:M==="mathWithTransform"?I.mathWithTransform=r.expression.mathWithTransform:M==="classes"?I.classes=r:I[M]=r[M]});var k=v(I);if(k&&typeof k.transform=="function")throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with export const path = "expression.transform"');if(S===void 0||D.override)return k;if(t.isTypedFunction(S)&&t.isTypedFunction(k))return t(S,k);if(D.silent)return S;throw new Error('Cannot import "'+w+'": already exists')},N=(y=(x=v.meta)===null||x===void 0?void 0:x.formerly)!==null&&y!==void 0?y:"",_=p(v)||h(v),C=r.expression.mathWithTransform;!v.meta||v.meta.lazy!==!1?(aa(b,w,E),N&&aa(b,N,E),S&&A?(u(w),N&&u(N)):_&&(aa(C,w,()=>b[w]),N&&aa(C,N,()=>b[w]))):(b[w]=E(),N&&(b[N]=b[w]),S&&A?(u(w),N&&u(N)):_&&(aa(C,w,()=>b[w]),N&&aa(C,N,()=>b[w]))),n[w]=v,r.emit("import",w,E)}function c(v){return typeof v=="function"||typeof v=="number"||typeof v=="string"||typeof v=="boolean"||v===null||pr(v)||Wr(v)||Qe(v)||ea(v)||ze(v)||Array.isArray(v)}function f(v){return typeof v=="object"&&v[Symbol.toStringTag]==="Module"}function d(v){return typeof v=="function"&&typeof v.signature=="string"}function m(v){return!ke(g,v)}
66function h(v){return!v.fn.includes(".")&&!ke(g,v.fn)&&(!v.meta||!v.meta.isClass)}function p(v){return v!==void 0&&v.meta!==void 0&&v.meta.isTransformFunction===!0||!1}var g={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return a}function O0(t,e){var r=jt({},Nf,e);if(typeof Object.create!="function")throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var n=QR({isNumber:qe,isComplex:Wr,isBigNumber:Qe,isBigInt:Fa,isFraction:ea,isUnit:pr,isString:Rt,isArray:Dt,isMatrix:ze,isCollection:wr,isDenseMatrix:Ai,isSparseMatrix:On,isRange:_s,isIndex:Si,isBoolean:Mf,isResultSet:Tf,isHelp:$u,isFunction:Pu,isDate:Ff,isRegExp:Of,isObject:ta,isMap:ra,isPartitionedMap:aD,isObjectWrappingMap:iD,isNull:Bf,isUndefined:kf,isAccessorNode:Bn,isArrayNode:Cr,isAssignmentNode:If,isBlockNode:Lf,isConditionalNode:Rf,isConstantNode:dt,isFunctionAssignmentNode:Oa,isFunctionNode:bn,isIndexNode:na,isNode:xt,isObjectNode:Ni,isOperatorNode:Pt,isParenthesisNode:nn,isRangeNode:$f,isRelationalNode:Pf,isSymbolNode:Ht,isChain:Uu});n.config=cD(r,n.emit),n.expression={transform:{},mathWithTransform:{config:n.config}};var a=[],i=[];function s(c){if(Ci(c))return c(n);var f=c[Object.keys(c)[0]];if(Ci(f))return f(n);if(!uD(c))throw console.warn("Factory object with properties `type`, `name`, and `factory` expected",c),new Error("Factory object with properties `type`, `name`, and `factory` expected");var d=a.indexOf(c),m;return d===-1?(c.math===!0?m=c.factory(n.type,r,s,n.typed,n):m=c.factory(n.type,r,s,n.typed),a.push(c),i.push(m)):m=i[d],m}var u={};function l(){for(var c=arguments.length,f=new Array(c),d=0;d<c;d++)f[d]=arguments[d];return n.typed.apply(n.typed,f)}l.isTypedFunction=_i.isTypedFunction;var o=KR(l,s,n,u);return n.import=o,n.on("config",()=>{Object.values(u).forEach(c=>{c&&c.meta&&c.meta.recreateOnConfigChange&&o(c,{override:!0})})}),n.create=O0.bind(null,t),n.factory=U,n.import(Object.values(oD(t))),n.ArgumentsError=An,n.DimensionError=at,n.IndexError=$r,n}const Ro=t=>{try{JSON.parse(t)}catch{return!1}return!0},e$=t=>{const e=t.querySelectorAll("script");for(let r=0;r<e.length;r++){const n=document.createElement("script");e[r].src?n.src=e[r].src:n.textContent=e[r].innerText,t.appendChild(n)}},B0=t=>{if(t=new RegExp("[?&]"+encodeURIComponent(t)+"=([^&]*)").exec(location.search))return decodeURIComponent(t[1])},qi=(t,e)=>{let r=!0;for(const[n,a]of Object.entries(e))a!=null&&(t+=r?`?${n}=${a}`:`&${n}=${a}`,r=!1);return t},t$=t=>{const e=document.getElementsByTagName("script");for(let r=e.length;r--;)if(e[r].src==t)return e[r];return!1},$o=t=>{const e=t.params?qi(t.url,t.params):t.url,r=t$(e);if(r)r.getAttribute("data-loaded")=="true"?t.callback():r.addEventListener("load",()=>{t.callback("load")},!1);else{const n=document.createElement("script");if(n.src=e,n.setAttribute("data-loaded","false"),n.addEventListener("load",()=>{n.setAttribute("data-loaded","true"),t.callback()},!1),t.attributes&&t.attributes.length>0)for(let a=0;a<t.attributes.length;a++)n.setAttribute(t.attributes[a].name,t.attributes[a].value);document.getElementsByTagName("head")[0].appendChild(n)}},Gn=t=>(t=parseFloat(t),t=t.toLocaleString("ru-RU",{maximumFractionDigits:2}),t=t.replace(",","."),t),fr=(t,e=document,r=!1,n={bubbles:!0,cancelable:!0})=>{r&&(n.detail=r);const a=new CustomEvent(t,n);e.dispatchEvent(a)},r$=t=>{const e=t.accept.split(",").map(r=>new RegExp(r.replace("*","[^\\/,]+")));return Array.prototype.every.call(t.files,function(n){return e.some(a=>a.test(n.type))})},n$=(t,e=1)=>{let r=0;e=e*1048576;for(let n=0;n<t.files.length;n++){const a=t.files.item(n);r=r+a.size}return r<=e},a$=(t,e=0)=>e==0?!0:t.files.length<=e;return class{language;quizs;sessid;user;module;dateFormat;constructor({language:t,quizs:e,sessid:r,user:n}){const a="atum.quiz",i=a.replace(".","_"),s=a.replace(".",":"),u=a.replace(".","");this.language=t,this.quizs=e,this.user=n,this.sessid=r,this.module={id:a,key:i,url:s,name:u,hide:u+"-hide",show:u+"-show",none:u+"-none",mail:u+"-mail",body:u+"-body",modal:u+"-modal",popup:u+"-popup",success:u+"-success",error:u+"-error",active:u+"-active",invalid:u+"-invalid",loading:u+"-loading",widget:u+"-window-widget"},this.dateFormat=["DD.MM.YYYY HH:mm","DD.MM.YYYY"];const l=window.atumquiz||{quizs:{}};window.atumquiz=l}fetch(t,e,r,n,a=void 0,i=null){const s=new FormData(a);for(const[u,l]of Object.entries(e))s.append(u,l);
66fetch(qi("/bitrix/services/main/ajax.php",{action:this.module.url+".api.index."+t,user:this.user}),{method:"POST",body:s,headers:{"X-Requested-With":"XMLHttpRequest","X-Bitrix-Csrf-Token":i??this.sessid}}).then(u=>u.json()).then(u=>{let l=!1;u.status=="error"&&Array.isArray(u.errors)&&u.errors.forEach(o=>{o.code==="invalid_csrf"&&o.customData.csrf&&(l=o.customData.csrf)}),l?this.fetch(t,e,r,n,a,l):r(u)}).catch(n)}setVideoCenter(t){if(t=t.querySelector(`.js-${this.module.name}-video`),t){const e=t.querySelector("iframe")?t.querySelector("iframe"):t.querySelector("video");e&&(e.style.width="100%",e.style.height="100%",e.style.transform="scale(1.6)"),t.hasAttribute("data-mobile")&&t.getAttribute("data-mobile")=="Y"&&(window.innerWidth>=575.98?t.hasAttribute("data-src")&&(t.querySelector("iframe")?t.querySelector("iframe").setAttribute("src",t.getAttribute("data-src")):(t.querySelector("video source").setAttribute("src",t.getAttribute("data-src")),t.querySelector("video").play()),t.removeAttribute("data-src")):t.hasAttribute("data-src")||(t.querySelector("iframe")?(t.setAttribute("data-src",t.querySelector("iframe").getAttribute("src")),t.querySelector("iframe").setAttribute("src","")):(t.setAttribute("data-src",t.querySelector("video source").getAttribute("src")),t.querySelector("video").pause(),t.querySelector("video source").setAttribute("src",""))))}}input(t,e){switch(t){case 1:const r=({target:c})=>{const f=c.closest(".js-form-other"),d=c.closest("[data-validate]");if(f){const m=f.querySelector(".js-form-other-input");m?(m.checked=c.value.length!="0"?c.value.length>0:!1,c.value===""?this.getDisabled(d,!0):(this.getDisabled(d),this.getInvalid(d))):console.error(`${this.module.name}[input][1][error]: Element ".js-form-other-input" not found`)}else console.error(`${this.module.name}[input][1][error]: Element ".js-form-other" not found`)},n=e.SELECTOR.querySelectorAll(".js-form-other-text");for(let c=0;c<n.length;c++)["input","change","cut","copy","paste"].forEach(f=>{n[c].addEventListener(f,r,!1)});break;case 2:const a=e.EVENT.target.closest(".js-form-img");if(a){const c=a.querySelector(".js-form-img-background");e.IMG?(e.IMG.URL&&(c.style.backgroundImage="url('"+e.IMG.URL+"')"),e.IMG.SIZE&&(c.style.backgroundSize=e.IMG.SIZE),e.IMG.POSITION&&(c.style.backgroundPosition=e.IMG.POSITION),e.IMG.COLOR&&(c.style.backgroundColor=e.IMG.COLOR),c.classList.add("img")):(c.style.backgroundImage=null,c.style.backgroundSize=null,c.style.backgroundPosition=null,c.style.backgroundColor=null,c.classList.contains("img")&&c.classList.remove("img"))}break;case 3:const i=e.EVENT.target;if(i){const c=i.closest(".js-form-file"),f=c.querySelector(".js-form-file-result"),d=c.querySelector(".js-form-file-error"),m=[];if(n$(i,Number(e.MAX))||m.push("SIZE"),a$(i,e.LIMIT)||m.push("LIMIT"),r$(i)||m.push("TYPE"),f.innerHTML="",d.innerHTML="",c.classList.contains(this.module.error)&&c.classList.remove(this.module.error),c.classList.contains(this.module.success)&&c.classList.remove(this.module.success),m.length>0){console.log(m),c.classList.add(this.module.error);const h=document.createElement("ul");m.forEach(p=>{const g=window.atumquiz.quizs[e.QUIZ_ID].message[e.MULTIPLE=="Y"?`ERROR_${p}_FILES`:`ERROR_${p}_FILE`],v=document.createElement("li");v.innerHTML=g.replace("{MAX}",e.MAX).replace("{LIMIT}",e.LIMIT),h.appendChild(v)}),d.appendChild(h)}else if(c.classList.add("success"),console.log(i.files),i.files.length>0){const h=document.createElement("div");h.classList.add(`${this.module.name}-row`,`${this.module.name}-row-cols-1`,`${this.module.name}-row-cols-md-2`,`${this.module.name}-row-cols-xl-3`),f.appendChild(h);for(const p of i.files){const g=document.createElement("div");g.classList.add(`${this.module.name}-col`),h.appendChild(g);const v=document.createElement("div");if(v.classList.add("file"),p.type){const D=p.type.split("/");v.setAttribute("data-type",D[0]),v.setAttribute("data-extension",D[1])}else v.setAttribute("data-type","other");v.setAttribute("title",p.name),v.textContent=p.name,g.appendChild(v)}}}break;case 4:const s=e.SELECTOR.querySelectorAll(".js-form-date");if(s.length)for(let c=0;c<s.length;c++){const f=s[c],d=f.querySelectorAll(".js-form-date-input");if(d.length)for(let m=0;m<d.length;m++){const h={};switch(f.getAttribute("data-calendar")){case"1":try{f.getAttribute("data-time")=="Y"?He(d[m],{mask:Date,pattern:this.dateFormat[0],lazy:!0,min:new Date(1970,0,1),max:new Date(9999,0,1),blocks:{DD:{mask:He.MaskedRange,from:1,to:31},MM:{mask:He.MaskedRange,from:1,to:12},YYYY:{mask:He.MaskedRange,from:1970,to:9999},HH:{mask:He.MaskedRange,from:0,to:23},mm:{mask:He.MaskedRange,from:0,to:59}},format:p=>Be(p).format(this.dateFormat[0]),parse:p=>Be(p,this.dateFormat[0])}):He(d[m],{mask:Date,pattern:this.dateFormat[1],lazy:!0,min:new Date(1970,0,1),max:new Date(9999,0,1),blocks:{DD:{mask:He.MaskedRange,from:1,to:31},MM:{mask:He.MaskedRange,from:1,to:12},YYYY:{mask:He.MaskedRange,from:1970,to:9999}},format:p=>Be(p).format(this.dateFormat[1]),parse:p=>Be(p,this.dateFormat[1])})}catch(p){console.error(`${this.module.name}[mask][error]: ${p}`)}break;
66case"2":h.static=!0,h.locale=this.language=="ru"?Zx.Russian:Qx.english,h.prevArrow='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 320 512"><path fill="currentColor" d="M224 480c-8.188 0-16.38-3.125-22.62-9.375l-192-192c-12.5-12.5-12.5-32.75 0-45.25l192-192c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L77.25 256l169.4 169.4c12.5 12.5 12.5 32.75 0 45.25C240.4 476.9 232.2 480 224 480z"/></svg>',h.nextArrow='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 320 512"><path fill="currentColor" d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"/></svg>',h.minuteIncrement=1,f.closest("[data-validate]").getAttribute("data-validate")=="Y"&&(d[m].classList.contains("END")?h.defaultDate=new Date(new Date().getTime()+24*60*60*1e3):h.defaultDate=new Date().getTime()),f.getAttribute("data-time")=="Y"?(h.enableTime=!0,h.dateFormat="d.m.Y H:i",h.time_24hr=!0):(h.enableTime=!1,h.dateFormat="d.m.Y"),zt(d[m],h);break}}}break;case 5:const u=e.SELECTOR.querySelectorAll(".js-form-range");if(u.length)for(let c=0;c<u.length;c++){const f=u[c],d=f.querySelector(".js-form-range-slider"),m={},h=f.querySelector('.js-form-range-number[data-input="from"]'),p=f.querySelector('.js-form-range-number[data-input="to"]');f.getAttribute("data-two")=="Y"?(m.start=[Number(f.getAttribute("data-from")??"0"),Number(f.getAttribute("data-to")??"100")],m.connect=!0):(m.start=Number(f.getAttribute("data-from")??"0"),m.connect="lower"),m.step=Number(f.getAttribute("data-step")??"1"),m.format=tx({decimals:0}),m.range={min:Number(f.getAttribute("data-min")??"0"),max:Number(f.getAttribute("data-max")??"100")},window.innerWidth<=576?m.pips={mode:"count",values:Number(f.getAttribute("data-pips-values-mobile")?f.getAttribute("data-pips-values-mobile"):"3"),density:Number(f.getAttribute("data-pips-density")?f.getAttribute("data-pips-density"):"4"),stepped:!0}:m.pips={mode:"count",values:Number(f.getAttribute("data-pips-values")?f.getAttribute("data-pips-values"):"6"),density:Number(f.getAttribute("data-pips-density")?f.getAttribute("data-pips-density"):"4"),stepped:!0},qx.create(d,m),d.noUiSlider.on("update",g=>{f.getAttribute("data-two")=="Y"?h&&p?(h.value=g[0],p.value=g[1]):console.error(`${this.module.name}[range][error]: input.js-form-range-number is missing`):h?h.value=g[0]:console.error(`${this.module.name}[range][error]: input.js-form-range-number is missing`)}),f.getAttribute("data-two")=="Y"?h&&p?(h.addEventListener("input",({target:g})=>{d.noUiSlider.set([g.value,null])}),p.addEventListener("input",({target:g})=>{d.noUiSlider.set([null,g.value])})):console.error(`${this.module.name}[range][error]: input.js-form-range-number is missing`):h?h.addEventListener("input",({target:g})=>{d.noUiSlider.set(g.value)}):console.error(`${this.module.name}[range][error]: input.js-form-range-number is missing`)}break;case 6:const l=e.SELECTOR.querySelectorAll(".js-form-rating");if(l.length)for(let c=0;c<l.length;c++){const f=l[c].querySelectorAll(".js-form-rating-label"),d=({target:m,type:h})=>{for(let p=0;p<f.length;p++){const g=m.classList.contains("js-form-rating-label")?m:m.closest(".js-form-rating-label");h=="mouseover"?g.getAttribute("data-value")>=p+1?f[p].classList.add(this.module.show):g.getAttribute("data-value")<=p+1&&f[p].classList.contains(this.module.show)&&f[p].classList.remove(`${this.module.show}`):h=="mouseout"&&f[p].classList.contains(this.module.show)?f[p].classList.remove(this.module.show):h=="click"&&(g.getAttribute("data-value")>=p+1?f[p].classList.add(this.module.active):g.getAttribute("data-value")<=p+1&&f[p].classList.contains(this.module.active)&&f[p].classList.remove(this.module.active))}};for(let m=0;m<f.length;m++)f[m].addEventListener("click",d),f[m].addEventListener("mouseover",d),f[m].addEventListener("mouseout",d)}break;case 7:try{const c=e.SELECTOR.querySelectorAll(`.js-${this.module.name}-inputmask`),f=m=>{switch(m){case"email":return/^\S*@?\S*$/}return m??""},d={h:/[0|1|3|4|5|6|7|9]/,L:/[A-Za-z0-9]/,C:/[Ð-Яа-Ñ0-9]/};
66c.forEach(m=>{m.hasAttribute("data-mask")&&m.getAttribute("data-mask")&&He(m,{definitions:d,mask:f(m.getAttribute("data-mask")),lazy:!0})})}catch(c){console.error(`${this.module.name}[input][mask][error]: ${c}`)}break;case 8:e.SELECT={},e.SELECT.EVENT=({target:c})=>{let f=c.closest(".js-form-select-other").querySelector(".js-form-select-other-text");for(let d of c.options)d.classList.contains("js-form-select-other-value")&&(d.selected?f.parentNode.classList.contains(this.module.none)&&f.parentNode.classList.remove(this.module.none):f.parentNode.classList.contains(this.module.none)||f.parentNode.classList.add(this.module.none))},e.SELECT.VALUE=e.SELECTOR.querySelectorAll(".js-form-select-other select");for(let c=0;c<e.SELECT.VALUE.length;c++)["change"].forEach(f=>{e.SELECT.VALUE[c].addEventListener(f,e.SELECT.EVENT,!1)});break;case 9:const o=e.SELECTOR.querySelectorAll(".js-maps");if(o.length>0)for(let c=0;c<o.length;c++)if(o[c].getAttribute("data-options")&&o[c].hasAttribute("data-options")){const f=JSON.parse(Vo.decode(o[c].getAttribute("data-options")));f.id&&f.type?(f.selector=e.SELECTOR,f.field=o[c],this.maps(f)):f.id?f.type&&console.error(`${this.module.name}[map][error]: undefined - type service`):console.error(`${this.module.name}[map][error][${f.type}]: undefined - id element`)}else console.error(`${this.module.name}[map][error]: undefined - data-options`);break}}metrika(t){if(t.SELECTOR.getAttribute("data-analytics")!==""&&t.SELECTOR.hasAttribute("data-analytics")){const r=JSON.parse(Vo.decode(t.SELECTOR.getAttribute("data-analytics"))),n=`${this.module.name}-${t.TYPE}_${t.QUIZ_ID}`;for(let[a,i]of Object.entries(r))if(i!="")switch(a){case"yandex":ym(i,"reachGoal",n);break;case"google":gtag("event",n,{event_category:"ATUMQUIZ",event_action:"Click",event_label:"NAME"});break;case"vk":VK.Goal(n);break;case"mail":var e=window._tmr||(window._tmr=[]);e.push({type:"reachGoal",id:i,goal:n});break}}}jsonLogic(t){t=t.querySelectorAll(".js-logic");const e={};if(t.length)for(let r=0;r<t.length;r++)e[t[r].getAttribute("data-name")]=t[r].getAttribute("data-logic");return JSON.stringify(e)}getDisabled(t,e=!1){const r=t.closest(".js-validate").querySelector(`.js-${this.module.name}-next`);r&&(e?r.setAttribute("disabled","disabled"):r.hasAttribute("disabled")&&r.removeAttribute("disabled"))}getInvalid(t){const e=t.closest(".js-validate").querySelector(".js-validate-alert"),r=t.closest(`.js-${this.module.name}-form`);
66t.classList.contains(this.module.invalid)&&t.classList.remove(this.module.invalid),e&&e.classList.contains(this.module.invalid)&&e.classList.remove(this.module.invalid),r&&r.querySelector(`.js-${this.module.mail}-error`)&&r.classList.contains(this.module.invalid)&&r.classList.remove(this.module.invalid)}validate({TYPE:t,FORM:e,QUIZ_ID:r,SELECTOR:n}){switch(t){case"submit":this.fetch("validate",{QUIZ_AJAX:"Y",QUIZ_ID:r,QUIZ_LOGIC:this.jsonLogic(e),URL:window.location.href},({status:a,data:i,errors:s})=>{const u=e.querySelectorAll("[data-validate]");if(u.length)for(let l=0;l<u.length;l++)u[l].classList.contains(this.module.invalid)&&u[l].classList.remove(this.module.invalid),u[l].closest(".js-validate").querySelector(".js-validate-alert")&&u[l].closest(".js-validate").querySelector(".js-validate-alert").classList.contains(this.module.invalid)&&u[l].closest(".js-validate").querySelector(".js-validate-alert").classList.remove(this.module.invalid);if(e.querySelector(`.js-${this.module.mail}-error`)&&e.querySelector(`.js-${this.module.mail}
66-error`).classList.contains(this.module.invalid)&&e.querySelector(`.js-${this.module.mail}-error`).classList.remove(this.module.invalid),a==="success")if(i.validate){fr(`${this.module.name}.form.validate`,e,{type:t,selector:n,quizId:r}),e.querySelector(`.js-${this.module.mail}-error`)&&e.querySelector(`.js-${this.module.mail}-error`).classList.add(this.module.invalid);let l;i.result.forEach(o=>{e.querySelector(`[name^="${o}"]`)&&(l=e.querySelector(`[name^="${o}"]`).closest("[data-validate]")),l&&(l.classList.add(this.module.invalid),l.closest(".js-validate").querySelector(".js-validate-alert")&&l.closest(".js-validate").querySelector(".js-validate-alert").classList.add(this.module.invalid))})}else this.form({FORM:e,QUIZ_ID:r});else{const l=Ro(s[0].message)?s[0].message:JSON.stringify(s[0].message);console.error(`${this.module.name}[validate][error]: ${l}`)}},a=>{console.error(`${this.module.name}[validate][error]: ${a}`)},e);break;case"questions":["field","form"].forEach(a=>{n.querySelectorAll(`.js-validate[data-page="${a}"]`).forEach(i=>{i.querySelectorAll("[data-validate]").forEach(s=>{let u,l;switch(s.getAttribute("data-validate")){case"form-1":case"form-2":case"form-3":case"form-4":u=()=>{s.querySelector("input")?s.querySelector("input").value!==""&&this.getInvalid(s):s.querySelector("textarea")&&s.querySelector("textarea").value!==""&&this.getInvalid(s)},u(),["input","change","cut","copy","paste"].forEach(f=>{s.querySelector("input")?s.querySelector("input").addEventListener(f,u,!1):s.querySelector("textarea")&&s.querySelector("textarea").addEventListener(f,u,!1)});break;case"form-5":u=()=>{s.querySelector("select")&&s.querySelector("select").value!==""&&this.getInvalid(s)},u(),s.querySelector("select")&&s.querySelector("select").addEventListener("change",u,!1);break;case"form-6":case"form-agreement":u=()=>{Array.from(s.querySelectorAll("input")).filter(d=>d.checked).length>0&&this.getInvalid(s)},s.querySelectorAll("input").forEach(f=>{switch(f.getAttribute("type")){case"radio":case"checkbox":f.addEventListener("change",()=>u(),!1);break}});break;case"field-1":case"field-2":case"field-3":case"field-12":case"field-13":case"field-14":case"field-16":case"field-17":case"field-18":u=()=>{if(Array.from(s.querySelectorAll("input")).filter(d=>d.checked).length>0){const d=s.querySelector(".js-form-other");d?d.value===""?this.getDisabled(s,!0):(this.getDisabled(s),this.getInvalid(s)):(this.getDisabled(s),this.getInvalid(s))}else this.getDisabled(s,!0)},l=({target:f})=>{Array.from(s.querySelectorAll("input:not(.js-form-other-input)")).filter(m=>m.checked).length==0&&(f.value!==""?(this.getDisabled(s),this.getInvalid(s)):this.getDisabled(s,!0))},s.querySelectorAll("input").forEach(f=>{switch(f.getAttribute("type")){case"radio":case"checkbox":f.addEventListener("change",u,!1);break;case"text":f.getAttribute("data-type")=="checkbox"&&["input","change","cut","copy","paste"].forEach(d=>{f.addEventListener(d,l,!1)});break}});break;case"field-4":u=()=>{s.querySelector("input")?s.querySelector("input").value!==""?(this.getDisabled(s),this.getInvalid(s)):this.getDisabled(s,!0):s.querySelector("textarea")&&(s.querySelector("textarea").value!==""?(this.getDisabled(s),this.getInvalid(s)):this.getDisabled(s,!0))},u(),["input","change","cut","copy","paste"].forEach(f=>{s.querySelector("input")?s.querySelector("input").addEventListener(f,u,!1):s.querySelector("textarea")&&s.querySelector("textarea").addEventListener(f,u,!1)});break;case"field-5":u=()=>{s.querySelector("select")&&(s.querySelector("select").value!==""?(this.getDisabled(s),this.getInvalid(s)):this.getDisabled(s,!0))},u(),s.querySelector("select")&&s.querySelector("select").addEventListener("change",()=>u(),!1),l=({target:f})=>{if(f.closest(".js-form-select-other")){const d=f.closest(".js-form-select-other").querySelector("select");d.options[d.selectedIndex].classList.contains("js-form-select-other-value")&&(f.value!==""?(this.getDisabled(s),this.getInvalid(s)):this.getDisabled(s,!0))}},n.querySelectorAll(".js-form-select-other-text").forEach(f=>{["input","change","cut","copy","paste"].forEach(d=>{f.addEventListener(d,l,!1)})});break;case"field-6":u=()=>{s.querySelector("input")&&(s.querySelector("input").value!==""?(this.getDisabled(s),this.getInvalid(s)):this.getDisabled(s,!0))},u(),["input","change"].forEach(f=>{s.querySelector("input").addEventListener(f,u,!1)});break;case"field-7":s.querySelectorAll("input.js-form-date-input").length&&(u=()=>{let f=0;const d=s.querySelectorAll("input.js-form-date-input"),m=s.querySelector(".js-form-date");for(let h=0;h<d.length;h++)m&&m.hasAttribute("data-time")?m.getAttribute("data-time")=="Y"?d[h].value.length==this.dateFormat[0].length&&f++:d[h].value.length==this.dateFormat[1].length&&f++:d[h].value!==""&&f++;d.length==f?(this.getDisabled(s),this.getInvalid(s)):this.getDisabled(s,!0)},u(),s.querySelectorAll("input.js-form-date-input").forEach(f=>{["input","change","cut","copy","paste"].forEach(d=>{f.addEventListener(d,()=>u(),!1)})}));break;case"field-8":s.querySelector(".js-form-range-slider").noUiSlider.on("update",()=>{this.getDisabled(s),this.getInvalid(s)});const o=s.querySelector('.js-form-range-number[data-input="from"]'),c=s.querySelector('.js-form-range-number[data-input="to"]');s.querySelector(".js-form-range").getAttribute("data-two")=="Y"?o&&c?(o.addEventListener("input",({target:f})=>{f.value!==""&&c.value!==""?(this.getDisabled(s),this.getInvalid(s)):this.getDisabled(s,!0)}),c.addEventListener("input",({target:f})=>{f.value!==""&&o.value!==""?(this.getDisabled(s),this.getInvalid(s)):this.getDisabled(s,!0)})):console.error(`${this.module.name}[range][error]: input.js-form-range-number is missing`):o?o.addEventListener("input",({target:f})=>{f.value!==""?(this.getDisabled(s),this.getInvalid(s)):this.getDisabled(s,!0)}):console.error(`${this.module.name}[range][error]: input.js-form-range-number is missing`);break;case"field-10":case"field-11":u=()=>{Array.from(s.querySelectorAll("input")).filter(d=>d.checked).length==s.querySelectorAll(".js-form-rating").length?(this.getDisabled(s),this.getInvalid(s)):this.getDisabled(s,!0)},u(),s.querySelectorAll("input").forEach(f=>{f.addEventListener("change",()=>u(),!1)});break;case"field-15":s.querySelector(".js-maps-result")&&(s.querySelector(".js-maps-result").value!==""?(this.getDisabled(s),this.getInvalid(s)):this.getDisabled(s,!0));break;case"field-9":case"N":this.getDisabled(s),this.getInvalid(s);break}})})});break}}send({FORM:t,QUIZ_ID:e,isVALIDATE:r,RESULT:n,ERROR:a}){this.fetch("send",{QUIZ_AJAX:"Y",QUIZ_ID:e,QUIZ_LOGIC:this.jsonLogic(t),QUIZ_VALIDATE:r,QUIZ_LETTER:typeof window.atumquiz.quizs[e].letter<"u"?JSON.stringify(window.atumquiz.quizs[e].letter):"",URL:window.location.href},({status:i,data:s,errors:u})=>
66{if(i==="success")s!==null&&(s.validate?(console.error(`${this.module.name}[form][error]: ${s.result}`),a&&a(s.result)):(this.metrika({SELECTOR:t,TYPE:"messengers",QUIZ_ID:e}),n&&n(s)));else{const l=Ro(u[0].message)?u[0].message:JSON.stringify(u[0].message);console.error(`${this.module.name}[form][error]: ${l}`),a&&a(l)}},i=>{console.error(`${this.module.name}[form][error]: ${i}`),a&&a(i)},t)}form({FORM:t,QUIZ_ID:e}){const r=t.querySelector(`.js-${this.module.mail}`),n=t.querySelector(`.js-${this.module.mail}-info`),a=t.querySelector(`.js-${this.module.mail}-body`);r&&r.classList.add(this.module.loading),n&&n.classList.add(this.module.active),a&&a.classList.contains(this.module.active)&&a.classList.remove(this.module.active),fr(`${this.module.name}.form.submit`,t,{quizId:e}),this.send({FORM:t,QUIZ_ID:e,isVALIDATE:"Y",RESULT:i=>{const s=t.querySelector(`.js-${this.module.mail}`),u=t.querySelector(`.js-${this.module.mail}-info`);window.atumquiz.quizs[e].letter={},i.result.application&&(window.atumquiz.quizs[e].letter.application=i.result.application),i.result.webForm&&(window.atumquiz.quizs[e].letter.webForm=i.result.webForm),s&&(s.classList.contains(this.module.loading)&&s.classList.remove(this.module.loading),s.classList.add(`${this.module.name}-success`)),u&&u.classList.add(this.module.active),fr(`${this.module.name}.form.success`,t,{posts:i.posts,result:i.result,quizId:e}),setTimeout(()=>{this.pages(t,"next",e,!1)},3e3)},ERROR:()=>{const i=t.querySelector(`.js-${this.module.mail}`),s=t.querySelector(`.js-${this.module.mail}-info`),u=t.querySelector(`.js-${this.module.mail}-body`);i&&(i.classList.contains(this.module.loading)&&i.classList.remove(this.module.loading),i.classList.add(this.module.error)),s&&s.classList.add(this.module.active),setTimeout(()=>{i&&i.classList.contains(this.module.error)&&i.classList.remove(this.module.error),s&&s.classList.contains(this.module.active)&&s.classList.remove(this.module.active),u&&u.classList.add(this.module.active)},1e4),fr(`${this.module.name}.form.error`,t,{quizId:e})}})}analytic({QUIZ_ID:t,ANALYTIC:e,ERROR:r}){this.fetch("analytic",{QUIZ_AJAX:"Y",QUIZ_ID:t,ANALYTIC:e,ERROR:r,URL:window.location.href},()=>{},n=>{console.error(`${this.module.name}[analytic][error]: ${n}`)})}setInput(t,e){const r=document.getElementById(t);r&&(r.value=e)}transition(t,e,r,n,a,i=!1){let s=0;switch(r){case"prev":s=n-1,fr(`${this.module.name}.page.prev.start`,e[s],{selector:t,pages:e,method:r,index:n,transition:s,quizId:a});break;case"next":s=n+1,fr(`${this.module.name}.page.next.start`,e[s],{selector:t,pages:e,method:r,index:n,transition:s,quizId:a});break}if(e[s])if(e[s].getAttribute("data-logic")=="Y"&&i)this.logic(t,r,e,a,s);else{const u=e[s].closest(`.js-${this.module.name}-form`);let l;switch(e.forEach(o=>{o.classList.contains(this.module.active)&&(l=o)}),l.classList.add(`${this.module.name}-start`,`${this.module.name}-`+r),e[s].classList.add(`${this.module.name}-end`,`${this.module.name}-`+r,this.module.active),setTimeout(()=>{switch(l.classList.remove(`${this.module.name}-start`,`${this.module.name}-`+r,this.module.active),e[s].classList.remove(`${this.module.name}-end`,`${this.module.name}-`+r),e[s].classList.add(this.module.active),e[s].getAttribute("data-item")){case"questions":e[s].hasAttribute("data-id")&&this.metrika({SELECTOR:u,TYPE:"question"+e[s].getAttribute("data-id"),QUIZ_ID:a});break;case"results":this.analytic({QUIZ_ID:a,ANALYTIC:5,ERROR:"N"}),this.metrika({SELECTOR:u,TYPE:"result",QUIZ_ID:a});break;case"form":this.analytic({QUIZ_ID:a,ANALYTIC:7,ERROR:"N"}),this.metrika({SELECTOR:u,TYPE:"form",QUIZ_ID:a});break;case"end":this.analytic({QUIZ_ID:a,ANALYTIC:8,ERROR:"N"}),this.metrika({SELECTOR:u,TYPE:"end",QUIZ_ID:a});break}switch(["input","textarea","select"].forEach(o=>{let c;switch(r){case"prev":c=e[n].getElementsByTagName(o),c.length&&Array.from(c).forEach(f=>{f.disabled=!0});break;case"next":c=e[s].getElementsByTagName(o),c.length&&Array.from(c).forEach(f=>{f.disabled=!1});break}}),r){case"prev":fr(`${this.module.name}.page.prev.end`,e[s],{selector:t,pages:e,method:r,index:n,transition:s,quizId:a});break;case"next":fr(`${this.module.name}.page.next.end`,e[s],{selector:t,pages:e,method:r,index:n,transition:s,quizId:a});break}e.forEach((o,c)=>{o.classList.contains(this.module.active)&&c!=s&&e[s].classList.remove(this.module.active)})},1e3),this.validate({TYPE:"questions",SELECTOR:t}),e[s].getAttribute("data-item")){case"results":this.formula(t,e[s],a);break}u.getAttribute("data-questions-send")=="Y"&&e[s].getAttribute("data-item")==u.getAttribute("data-questions-end")&&this.send({FORM:u,QUIZ_ID:a,isVALIDATE:"N"})}return!1}conditions(t,e,r){const n={lo:!1,display:e.display},a=this.fields(t,!1,r),i={};let s=0,u=0;if(a.QUESTION)for(const l of Object.keys(a.QUESTION)){const o=a.QUESTION[l];i[o.ID]=o}for(const l of Object.keys(e.questions)){const o=e.questions[l];let c,f=!1;if(i[l]){const d=i[l];let m=0,h=0;switch(++s,Number(o.type)){case 1:case 2:case 3:case 5:case 12:case 13:case 14:case 16:case 17:case 18:for(const g of o.value)if(++m,d.VALUE)if(Array.isArray(d.VALUE))for(const v of d.VALUE){const D=v.split("||");D[0]=="other"?D[0]==g&&D[1]!=""&&++h:v==g&&++h}else{const v=d.VALUE.split("||");v[0]=="other"?v[0]==g&&v[1]!=""&&++h:d.VALUE==g&&++h}o.lo&&Number(o.lo)==2?m==h&&(f=!0):h>0&&(f=!0);break;case 4:if(isFinite(d.VALUE)&&isFinite(o.value))m=1,Number(d.VALUE)==Number(o.value)&&++h;else for(const g of o.value.split(","))++m,new RegExp(g,"iu").test(d.VALUE)&&++h;Number(o.lo)==1?h>0&&(f=!0):h==0&&(f=!0);break;case 8:if(c=[o.value[0]?Number(o.value[0]):0,o.value[1]?Number(o.value[1]):0],Array.isArray(d.VALUE)){const g=[Number(d.VALUE[0]),Number(d.VALUE[1])];switch(Number(o.lo)){case 1:g[0]>c[0]&&c[1]>g[1]&&(f=!0);break;case 2:c[0]>g[0]&&g[1]>c[1]&&(f=!0);break;case 3:(g[0]<c[0]&&g[1]<c[0]||g[0]>c[1]&&g[1]>c[1])&&(f=!0);break;case 4:(g[0]<c[0]&&g[1]>c[0]||g[0]<c[1]&&g[1]>c[1])&&(f=!0);break}}else{const g=Number(d.VALUE);switch(Number(o.lo)){case 1:c[0]<g&&(f=!0);break;case 2:c[0]>g&&(f=!0);break;case 3:c[0]<g&&c[1]>g&&(f=!0);break;case 4:c[0]==g&&(f=!0);break}}break;case 10:c=[o.value[0]?Number(o.value[0]):0,o.value[1]?Number(o.value[1]):0];const p=Number(d.VALUE);switch(Number(o.lo)){case 1:c[0]<p&&(f=!0);break;case 2:c[0]>p&&(f=!0);break;case 3:c[0]<p&&c[1]>p&&(f=!0);break;
66case 4:c[0]==p&&(f=!0);break}break}f&&++u}}return e.lo==1?s==u&&(n.lo=!0):u>0&&(n.lo=!0),n}fields(t,e,r){const n=new FormData(t.closest(`.js-${this.module.name}-form`)),a={QUESTION:{},RESULT:{}},i=window.atumquiz.quizs[r].fields;if(i)for(const s of i){const u=`${this.module.name}_${r}_${s.NAME}_${s.TYPE}_${s.ID}`;switch(s.NAME){case"questions":if(a.QUESTION[u]={ID:s.ID,TYPE:s.TYPE},s.LOGIC&&e&&(a.QUESTION[u].LOGIC=this.conditions(t,s.LOGIC,r)),n.get(u))a.QUESTION[u].VALUE=n.get(u);else{const l=[];n.forEach((o,c)=>{c.includes(u)&&l.push(o)}),l.length&&(a.QUESTION[u].VALUE=[],l.forEach(o=>{a.QUESTION[u].VALUE.push(o)}))}break;case"results":a.RESULT[u]={ID:s.ID,TYPE:s.TYPE},s.LOGIC&&e&&(a.RESULT[u].LOGIC=this.conditions(t,s.LOGIC,r)),n.get(`${this.module.name}_${r}_result`)&&(a.QUESTION[u].VALUE=n.get(`${this.module.name}_${r}_result`)==s.ID);break}}return a}logic(t,e,r,n,a){let i;switch(e){case"prev":i=r[a-1];break;case"next":i=r[a+1];break}if(i)if(i.getAttribute("data-logic")=="Y"){let s=0;const u=this.fields(t,!0,n);switch(i.getAttribute("data-item")){case"results":const l=i.querySelectorAll('[data-logic="Y"]');if(l.length){let o=0;for(let c=0;c<l.length;c++)for(const f in u.RESULT){const d=u.RESULT[f];if(d.ID==l[c].getAttribute("data-id")){++o,d.LOGIC&&(d.LOGIC.display==1?d.LOGIC.lo||(++s,l[c].classList.contains(this.module.active)&&l[c].classList.remove(this.module.active)):d.LOGIC.lo&&(++s,l[c].classList.contains(this.module.active)&&l[c].classList.remove(this.module.active)));break}}if(!i.querySelector(`.${this.module.name}-all`)){let c=!1;for(let f=0;f<l.length;f++)l[f].classList.contains(this.module.active)&&(c&&l[f].classList.remove(this.module.active),c=!0)}this.transition(t,r,e,a,n,s==o)}break;case"questions":for(const o in u.QUESTION){const c=u.QUESTION[o];if(c.ID==i.getAttribute("data-id")){c.LOGIC&&(c.LOGIC.display==1?c.LOGIC.lo||++s:c.LOGIC.lo&&++s,this.transition(t,r,e,a,n,s>0));break}}break}}else this.transition(t,r,e,a,n)}formula(t,e,r){const n=({formula:i,questions:s},u={})=>{try{if(i&&s){const l=O0(jR),o=this.fields(t,!1,r);o.QUESTION&&Object.values(o.QUESTION).filter(({TYPE:c})=>[1,2,3,4,5,8,10,11,12,13,14,16,17,18].includes(Number(c))).forEach(c=>{const f=s[c.ID];f&&(u[c.ID]=0,[1,2,3,5,12,13,14,16,17,18].includes(Number(c.TYPE))?Array.isArray(c.VALUE)?c.VALUE.forEach(d=>{u[c.ID]=u[c.ID]+Number(f[d])}):u[c.ID]=Number(f[c.VALUE]):[8,11].includes(Number(c.TYPE))?Array.isArray(c.VALUE)?c.VALUE.forEach(d=>{u[c.ID]=u[c.ID]+Number(d)}):u[c.ID]=Number(c.VALUE):u[c.ID]=Number(c.VALUE.replace(/[^0-9]/g,"")))});for(const[c,f]of Object.entries(u))i=i.replace(new RegExp(`\\{${c}\\}`,"g"),f);return i=i.replace(/\{[^}]*\}/g,"0"),i=i.replace(/[^0-9.+\-*/^()%]/g,""),l.evaluate(i)}else return 0}catch{return 0}},a=window.atumquiz.quizs[r].fields;if(a){const i={new:0,old:0};a.forEach(l=>{const{ID:o,NAME:c,FORMULA:f,PRICE:d}=l;c=="results"&&(typeof d<"u"&&(typeof d.NEW.VALUE<"u"&&Number(d.NEW.VALUE)>0&&(i.new=i.new+Number(d.NEW.VALUE)),typeof d.OLD.VALUE<"u"&&Number(d.OLD.VALUE)>0&&(i.old=i.old+Number(d.OLD.VALUE))),Array.from(e.querySelectorAll('[data-formula="Y"]')).filter(m=>o==m.getAttribute("data-id")).forEach(m=>{const h={main:m.querySelector(`.js-${this.module.name}-price`),new:m.querySelector(`.js-${this.module.name}-price-new`),old:m.querySelector(`.js-${this.module.name}-price-old`),stock:m.querySelector(`.js-${this.module.name}-price-stock`)};if(Object.entries(h).forEach(({name:p,value:g})=>{g&&(g.classList.contains(this.module.active)&&g.classList.remove(this.module.active),["new","old"].includes(p)&&(g.textContent=""))}),h.main&&typeof f<"u"){let p=0;const g=n(f);Number(g)>0&&(d.STOCK&&d.STOCK.ACTIVE=="Y"&&d.STOCK.VALUE!=""&&(Number(d.STOCK.TYPE)==1&&Number(g)>Number(d.STOCK.VALUE)?p=Number(g)-Number(d.STOCK.VALUE):Number(d.STOCK.VALUE)<100&&(p=Number(g)*(100-Number(d.STOCK.VALUE))/100)),p>0?(h.new&&(h.main.classList.contains(this.module.active)||h.main.classList.add(this.module.active),i.new=i.new+p,h.new.textContent=`${d.TYPE} ${Gn(p)} ${d.CURRENCY}`),h.old&&(h.old.classList.contains(this.module.active)||h.old.classList.add(this.module.active),i.old=i.old+g,h.old.textContent=`${Gn(g)} ${d.CURRENCY}`),h.stock&&(h.stock.classList.contains(this.module.active)||h.stock.classList.add(this.module.active))):h.new&&(h.main.classList.contains(this.module.active)||h.main.classList.add(this.module.active),i.new=i.new+g,h.new.textContent=`${d.TYPE} ${Gn(g)} ${d.CURRENCY}`))}}))});const s={main:e.querySelector(`.js-${this.module.name}-total-price`),new:e.querySelector(`.js-${this.module.name}-total-price-new`),old:e.querySelector(`.js-${this.module.name}-total-price-old`),stock:e.querySelector(`.js-${this.module.name}-total-price-stock`)},u=window.atumquiz.quizs[r].total;
66if(s.main&&u&&(Object.entries(s).forEach(({name:l,value:o})=>{o&&(o.classList.contains(this.module.active)&&o.classList.remove(this.module.active),["new","old","stock"].includes(l)&&(o.textContent=""))}),typeof u.FORMULA<"u"&&(i.new=n(u.FORMULA,{SUM:i.new}),i.old=n(u.FORMULA,{SUM:i.old}),s.new&&(s.main.classList.contains(this.module.active)||s.main.classList.add(this.module.active),s.new.textContent=`${u.PRICE.TYPE} ${Gn(i.new)} ${u.PRICE.CURRENCY}`),i.new<i.old&&s.stock))){s.old&&(s.old.classList.contains(this.module.active)||s.old.classList.add(this.module.active),s.old.textContent=`${Gn(i.old)} ${u.PRICE.CURRENCY}`);let l=0;s.stock.classList.contains(this.module.active)||s.stock.classList.add(this.module.active),u.PRICE.STOCK.ACTIVE=="Y"&&(Number(u.PRICE.STOCK.TYPE)==1?(l=Number(i.old)-Number(i.new),s.stock.querySelector("span").textContent=`- ${Gn(l)} ${u.PRICE.CURRENCY}`):(l=100-Number(i.new)/Number(i.old)*100,s.stock.querySelector("span").textContent=`${l.toFixed(2)} %`))}}}repeat(t,e,r="body",n=0){switch(r){case"modal":t.closest(`#${this.module.modal}`).classList.add(this.module.loading),this.quiz(e,{SELECTOR:t.closest(`#${this.module.modal}`),SELECTOR_BODY:t.closest(`.${this.module.modal}-body`),MODAL:"Y"});break;case"widget":t.closest(`.${this.module.widget}-quiz`).classList.add(this.module.loading),this.quiz(e,{TYPE:"widget",INDEX:n,SELECTOR:t.closest(`.${this.module.widget}-quiz`),SELECTOR_BODY:t.closest(`.${this.module.widget}-center`)});break;case"body":t.closest(`.${this.module.body}`).classList.add(this.module.loading),this.quiz(e,{TYPE:"body",INDEX:n,SELECTOR:t.closest(`.${this.module.body}`),SELECTOR_BODY:t.closest(`.${this.module.body}-center`)});break}}pages(t,e,r,n=!0,a=!1){if(n&&(t=document.querySelector(t)),a&&(this.analytic({QUIZ_ID:r,ANALYTIC:a,ERROR:"N"}),a!=4)){let i;switch(a){case 1:i="messengers";break;case 2:i="start";break;case 3:i="startquiz";break;case 4:i="questions";break;case 5:i="result";break;case 6:i="resultend";break;case 7:i="form";break;case 8:i="end";break}this.metrika({SELECTOR:t.closest(`.js-${this.module.name}-form`),TYPE:i,QUIZ_ID:r})}if(t){const i=t.querySelectorAll(`.js-${this.module.name}-page`);if(i.length){for(let s=0;s<i.length;s++)if(i[s].classList.contains(this.module.active)){const u=i[s].querySelector(`.${this.module.name}-video iframe`),l=i[s].querySelector(`.${this.module.name}-video video`);u&&(u.src=""),l&&l.pause(),this.logic(t,e,i,r,s);break}}}}quiz(t,e){const{INDEX:r,TYPE:n,SELECTOR:a,SELECTOR_BODY:i,MODAL:s}=e;fr(`${this.module.name}.quiz.show`,document,{config:e,quizId:t}),this.fetch("quiz",{QUIZ_AJAX:"Y",QUIZ_ID:t,INDEX:r||"",TYPE:n||"modal",URL:window.location.href},({status:u,data:l,errors:o})=>{if(a.classList.remove(this.module.loading),u==="success"){if(l!==null){window.atumquiz.quizs[t]=window.atumquiz.quizs[t]||{},l.fields&&(window.atumquiz.quizs[t].fields=l.fields),l.total&&(window.atumquiz.quizs[t].total=l.total),l.message&&(window.atumquiz.quizs[t].message=l.message),i.innerHTML=l.result,e$(i);let c;const f=i.querySelectorAll(`.js-${this.module.name}-page`);if(f.length)for(let d=0;d<f.length;d++)f[d].getAttribute("data-item")=="questions"&&(f[d].classList.contains(this.module.active)?["input","textarea","select"].forEach(m=>{c=f[d].getElementsByTagName(m),c.length&&Array.from(c).forEach(h=>{h.disabled=!1})}):["input","textarea","select"].forEach(m=>{c=f[d].getElementsByTagName(m),c.length&&Array.from(c).forEach(h=>{h.disabled=!0})}));this.setVideoCenter(a),window.addEventListener("resize",()=>this.setVideoCenter(a),!0),s=="Y"&&(this.analytic({QUIZ_ID:t,ANALYTIC:2,ERROR:"N"}),this.metrika({SELECTOR:a.querySelector(`.js-${this.module.name}-form`),TYPE:"start",QUIZ_ID:t})),[1,4,5,6,7,8,9].forEach(d=>{this.input(d,{SELECTOR:a,QUIZ_ID:t})}),a.querySelector("form")&&a.querySelector("form").addEventListener("submit",d=>{d.preventDefault(),this.validate({TYPE:"submit",SELECTOR:a,FORM:d.target,QUIZ_ID:t})}),(n=="modal"||!n)&&a.setAttribute("data-template",l.template),this.validate({TYPE:"questions",SELECTOR:a})}fr(`${this.module.name}.quiz.shown`,document,{config:e,result:l,quizId:t})}else{fr(`${this.module.name}.quiz.error`,document,{config:e,errors:o,quizId:t});const c=Ro(o[0].message)?o[0].message:JSON.stringify(o[0].message);console.error(`${this.module.name}[quiz][error]: ${c}`),this.analytic({QUIZ_ID:t,ANALYTIC:2,ERROR:"Y"})}},u=>{a.classList.remove(this.module.loading),fr(`${this.module.name}.quiz.error`,document,{config:e,errors:u,quizId:t}),console.error(`${this.module.name}[quiz][error]: ${u}`),this.analytic({QUIZ_ID:t,ANALYTIC:2,ERROR:"Y"})})}modal(t,e,r={}){const n=document.getElementById(`${this.module.modal}`);if(n){const a=()=>
66{if(n.classList.contains(this.module.show)){fr(`${this.module.name}.modal.hide`,n,{config:r,method:e,quizId:t});const s=document.querySelector(`.${this.module.modal}-backdrop`);n.classList.contains(`${this.module.modal}-centered`)&&n.classList.remove(`${this.module.modal}-centered`),n.classList.contains(`${this.module.modal}-fullscreen`)&&n.classList.remove(`${this.module.modal}-fullscreen`),n.classList.add(this.module.hide),s.classList.add(this.module.hide),setTimeout(()=>{window.document.body.classList.remove(`${this.module.modal}-open`),window.document.body.style.removeProperty("padding-right"),n.removeAttribute("data-quiz"),n.classList.remove(this.module.show,this.module.hide);const u=n.querySelector(`.${this.module.modal}-body`);u&&(u.innerHTML=""),s&&(s.classList.remove(this.module.show,this.module.hide),s.removeAttribute("data-quiz"),s.remove()),fr(`${this.module.name}.modal.hidden`,n,{config:r,method:e,quizId:t}),n.setAttribute("data-template",""),r.AUTO!==void 0&&r.AUTO.ENABLE=="Y"&&(r.AUTO.indexREPLAY===void 0&&(r.AUTO.indexREPLAY=1),setTimeout(()=>{(Number(r.AUTO.REPLAY)==0||Number(r.AUTO.REPLAY)>r.AUTO.indexREPLAY)&&(r.AUTO.indexREPLAY++,this.modal(t,"show",r))},r.AUTO.INTERVAL*1e3))},500)}},i=()=>{if(!n.classList.contains(this.module.show)){const s=this.quizs[t].MODAL;typeof s.CENTERED<"u"&&s.CENTERED=="Y"&&n.classList.add(`${this.module.modal}-centered`),typeof s.FULLSCREEN<"u"&&s.FULLSCREEN=="Y"&&n.classList.add(`${this.module.modal}-fullscreen`),fr(`${this.module.name}.modal.show`,n,{config:r,method:e,quizId:t});const u=window.document.body.offsetWidth,l=document.createElement("div"),o=n.querySelector(`.${this.module.modal}-body`);n.setAttribute("data-quiz",t),setTimeout(()=>{window.document.body.classList.add(`${this.module.modal}-open`),window.document.body.style.paddingRight=`${window.document.body.offsetWidth-u}px`},1),l.classList.add(`${this.module.modal}-backdrop`,this.module.show),l.setAttribute("data-quiz",t),window.document.body.appendChild(l),n.classList.add(this.module.show,this.module.loading),this.quiz(t,{SELECTOR:n,SELECTOR_BODY:o,MODAL:"Y"}),window.onkeydown=({key:f})=>{f==="Escape"&&a()},typeof s.STATIC<"u"&&s.STATIC!="Y"&&(n.onclick=({target:f})=>{o.contains(f)||o==f||a()});const c=n.querySelector(`.${this.module.modal}-close`);c&&(c.onclick=()=>a()),fr(`${this.module.name}.modal.shown`,n,{config:r,method:e,quizId:t})}};switch(e){case"show":i();break;case"hide":a();break}return!0}else return console.error(`${this.module.name}[modal][error]: Element "${this.module.modal}" not found`),!1}show(t){return this.modal(t,"show")}hide(t){return this.modal(t,"hide")}button(t,e,r=!1){switch(e=t.closest(e),r){case"result":e&&!e.querySelector(`.js-${this.module.name}-full-content`).classList.contains(this.module.active)&&e.querySelector(`.js-${this.module.name}-full-content`).classList.add(this.module.active);break}}close(t,e,r=!1){switch(e=t.closest(e),r){case"result":e&&e.querySelector(`.js-${this.module.name}-full-content`).classList.contains(this.module.active)&&e.querySelector(`.js-${this.module.name}-full-content`).classList.remove(this.module.active);break;default:const n=`${this.module.name}_close_${e.getAttribute("data-quiz")}`;e.getAttribute("data-remove")=="Y"&&e.hasAttribute("data-remove")?!sessionStorage.getItem(n)&&sessionStorage.getItem(n)!="Y"&&sessionStorage.setItem(n,"Y"):(sessionStorage.getItem(n)||sessionStorage.getItem(n)=="Y")&&sessionStorage.removeItem(n),e.classList.contains(this.module.active)&&e.classList.remove(this.module.active);break}}links(t){let e=0;const r=document.querySelectorAll("a");if(r.length)for(let n=0;n<r.length;n++){e++;const a=r[n];if(a.getAttribute("href")){const i=a.getAttribute("href").split(/#(show|hide):(atumquiz)_([0-9]+)/);i[2]==this.module.name&&a.addEventListener("click",()=>{switch(i[1]){case"show":t[i[3]]&&this.modal(i[3],"show");break;case"hide":t[i[3]]&&this.modal(i[3],"hide");break}return!1})}}return e}basket(t,e,r,n,a="n",i="N"){const{currentTarget:s}=t;s.classList.add(this.module.loading),t.preventDefault();const u={QUIZ_AJAX:"Y",QUIZ_ID:e,ELEMENT_ID:r,URL:window.location.href};n=document.getElementById(n),n&&(u.SKU_ID=n.value),this.fetch("basket",u,({status:l,errors:o})=>{if(l==="success")BX.onCustomEvent("OnBasketChange"),a=="Y"&&this.hide(e),i!="N"?window.location.href=i:s.classList.contains(this.module.loading)&&s.classList.remove(this.module.loading);else{const c=Ro(o[0].message)?o[0].message:JSON.stringify(o[0].message);console.error(`${this.module.name}[basket][error]: ${c}`)}},l=>{console.error(`${this.module.name}[basket][error]: ${l}`)})}draggable(t,e,r,n=!1){let a=e,i=r;const s=({type:u,touches:l,clientX:o,clientY:c})=>{if(u=="touchstart"){const f={x:l[0].clientX-a,y:l[0].clientY-i},d=({touches:h})=>{a=h[0].clientX-f.x,i=h[0].clientY-f.y,t.style.transform=`translate(${a}px, ${i}px)`},m=()=>{document.removeEventListener("touchmove",d),document.removeEventListener("touchend",m)};document.addEventListener("touchmove",d),document.addEventListener("touchend",m)}else{const f={x:o-a,y:c-i},d=({clientX:h,clientY:p})=>{a=h-f.x,i=p-f.y,t.style.transform=`translate(${a}px, ${i}px)`},m=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",m)};document.addEventListener("mousemove",d),document.addEventListener("mouseup",m)}};return n?["mousedown","touchstart"].forEach(u=>{t.removeEventListener(u,s)}):["mousedown","touchstart"].forEach(u=>{t.addEventListener(u,s)}),s}maps(t){const{id:e,options:r,language:n,selector:a,apikey:i,type:s,script:u}=t,l=document.getElementById(e+"-map"),o=r.routing,f=`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath fill='${o.marker?o.marker.color.replace("#","%23"):"%23e01839"}' d='M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 256c-35.3 0-64-28.7-64-64s28.7-64 64-64s64 28.7 64 64s-28.7 64-64 64z'/%3E%3C/svg%3E`,m=`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath fill='${r.marker.color?r.marker.color.replace("#","%23"):"%23e01839"}' d='M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 256c-35.3 0-64-28.7-64-64s28.7-64 64-64s64 28.7 64 64s-28.7 64-64 64z'/%3E%3C/svg%3E`,h=(N,_,C)=>{if(document.getElementById(e)){const O=document.getElementById(e+"-map-img"),I=document.getElementById(e).querySelectorAll("[data-maps-input-center]");if(I&&I.forEach(k=>{if(k.getAttribute("data-maps-input-center")&&k.hasAttribute("data-maps-input-center")){const M=k.getAttribute("data-maps-input-center").split(",");
66_(N,M),k.addEventListener("click",()=>{O&&O.classList.contains(this.module.active)&&O.classList.remove(this.module.active),C(N,M)})}}),O){const k=document.getElementById(e).querySelectorAll("[data-maps-input-other]");k&&k.forEach(M=>{M.addEventListener(M.getAttribute("data-maps-input-other"),()=>{O.classList.contains(this.module.active)||O.classList.add(this.module.active)})})}}},p=(N,_=!0,C=10,O=-10)=>{const I=document.createElement("div");I.style.transform=`translate(${C}px,${O}px)`,I.className=`${this.module.name}-map-info`,N.appendChild(I),_&&o&&o.draggable=="Y"&&(this.draggable(I,C,O),I.setAttribute("data-draggable","Y"))},g=(N,_="",C="")=>{if(N=N.querySelector(`.${this.module.name}-map-info`),N&&(o.cost=="Y"||o.distance=="Y"||o.duration=="Y")){if(N.innerHTML="",N.classList.add(this.module.active),o.cost=="Y"){const O=(k=0)=>{let M=0;const H=Number(o.cost_total[0])||0,q=Number(o.cost_max_distance)||0,z=Number(o.cost_max_price)||0;return 1e3<=k?(k=parseFloat((Number(k)/1e3).toFixed(2)),M=H*k,q>0&&z>0&&q>=k&&(M=z*k),[Gn(M),o.cost_total[1]]):(M=z>0?z:H,[Gn(M),o.cost_total[1]])},I=document.createElement("div");I.className=`${this.module.name}-map-info-cost`,I.innerHTML=n.MAP_COST.replace("{VALUE}",O(_)[0]).replace("{UNIT}",O(_)[1]),N.appendChild(I)}if(o.distance=="Y"){const O=(k=0,M=!1)=>1e3<=k?M?n.MAP_KM:parseFloat((Number(k)/1e3).toFixed(2)):M?n.MAP_METER:Math.round(k),I=document.createElement("div");I.className=`${this.module.name}-map-info-distance`,I.innerHTML=n.MAP_DISTANCE.replace("{VALUE}",O(_)).replace("{UNIT}",O(_,!0)),N.appendChild(I)}if(o.duration=="Y"){const O=k=>{let M="";k=Math.round(k);const H=(B,j)=>B>0?B+` ${j} `:"",q=H(Math.floor(k/(3600*24)),n.MAP_DAY),z=H(Math.floor(k%(3600*24)/3600),n.MAP_HOUR),X=H(Math.floor(k%3600/60),n.MAP_MINUTE),te=H(Math.floor(k%60),n.MAP_SECOND);return q?M=`${q}${z}`:z?M=`${z}${X}`:X?M=X:te&&(M=te),M.replace(/,\s*$/,"")},I=document.createElement("div");I.className=`${this.module.name}-map-info-duration`,I.innerHTML=n.MAP_DURATION.replace("{VALUE}",O(C)),N.appendChild(I)}}},v=N=>{const _=document.createElement("div");_.style.transform="translate(10px,10px)",_.className=`${this.module.name}-map-error`,N.appendChild(_)},D=(N,_=!1)=>{N=N.querySelector(`.${this.module.name}-map-error`),N&&(_?(N.innerHTML=_,N.classList.add(this.module.active)):(N.innerHTML="",N.classList.contains(this.module.active)&&N.classList.remove(this.module.active)))},y=(N,_,C,O)=>{let I;switch(N){case"yandex":I=`https://yandex.ru/maps/?pt=${C[1].join("%2C")}&z=${r.zoom}&l=map`;break;case"2gis":I=`https://2gis.ru/geo/${C[1].join("%2C")}?m=${C[1].join("%2C")}%2F${r.zoom}`;break}const k=document.getElementById(e+"-result");k&&(k.value=Vo.encode(JSON.stringify({type:N,version:_,location:C[0].join(),url:I,address:O}))),this.validate({TYPE:"questions",SELECTOR:a});const M=document.getElementById(e+"-search");M&&(M.value=O)},x=[Number(r.center[0]),Number(r.center[1])],w=[Number(r.center[1]),Number(r.center[0])],b=()=>{ymaps.ready(()=>{const N=document.createElement("div");N.className=`${this.module.name}-map-center`,l.appendChild(N);const _=new ymaps.Map(N,{center:x,zoom:r.zoom,controls:["fullscreenControl"]}),C=_.container.getElement().closest(`#${e}-map`);switch(v(C),window.addEventListener("resize",()=>_.container.fitToViewport(),!0),_.behaviors.disable("scrollZoom"),_.controls.add(new ymaps.control.ZoomControl({options:{size:"auto",position:{top:108,bottom:"auto",left:"auto",right:10}}})),t.function){case 1:let I;o&&o.route=="Y"&&(_.geoObjects.add(new ymaps.Placemark(x,{},{iconLayout:"default#image",iconImageHref:f,iconImageSize:[40,40],iconImageOffset:[-20,-40]})),I=new ymaps.Polyline([],{},{cursor:"default",hasBalloon:!1,hasHint:!1,openBalloonOnClick:!1,openHintOnHover:!1,strokeOpacity:.8,strokeWidth:6,strokeColor:o.line.color}),p(C,!0,10,-40));const k=new ymaps.Placemark(x,{},{iconLayout:"default#image",iconImageHref:m,iconImageSize:[40,40],iconImageOffset:[-20,-40]}),M=(q="",z=!1)=>{document.getElementById(e+"-result")&&ymaps.geocode(q,{results:1}).then(X=>{D(C,!1);const te=X.geoObjects.get(0),B=z||te.geometry.getCoordinates(),j=[B[1],B[0]];if(z||_.setCenter(B,r.zoom),o){let R="auto";switch(o.mode){case"2":case"3":R="masstransit";break;case"4":R="pedestrian";break}ymaps.route([x,B],{mapStateAutoApply:!0,wayPointVisible:!1,routingMode:R}).then(oe=>{if(D(C,!1),o.route=="Y"){const se=[];
66oe.getPaths().get(0).getSegments().forEach(le=>{le.getCoordinates().forEach(P=>{se.push(P)})}),I.geometry.setCoordinates(se),_.geoObjects.add(I)}g(C,oe.getLength(),oe.getTime())},oe=>{D(C,oe.message),console.error(`${this.module.name}[map][Yandex][error][route]: ${oe.message}`)})}k.geometry.setCoordinates(B),_.geoObjects.add(k),y("yandex",2,[B,j],te.properties.get("metaDataProperty").GeocoderMetaData.text)},X=>{D(C,X.message),X=typeof X=="object"?JSON.stringify(X):X,console.error(`${this.module.name}[map][Yandex][error][geocode]: ${X}`)})};_.events.add("click",q=>{M(q.get("coords"),q.get("coords"))});const H=document.getElementById(e+"-search");H&&H.addEventListener("keydown",({key:q})=>{q==="Enter"&&M(H.value)});break;case 2:h(_,(q,z)=>{q.geoObjects.add(new ymaps.Placemark(z,{},{iconLayout:"default#image",iconImageHref:m,iconImageSize:[40,40],iconImageOffset:[-20,-40]}))},(q,z)=>{q.setCenter(z,r.zoom)});break}const O=document.getElementById(e+"-map").querySelectorAll("button");O&&O.forEach(I=>I.setAttribute("type","button"))})},A=async()=>{await ymaps3.ready;const{YMap:N,YMapDefaultSchemeLayer:_,YMapDefaultFeaturesLayer:C,YMapControls:O,YMapMarker:I,YMapListener:k,YMapFeature:M}=ymaps3,{YMapZoomControl:H,YMapGeolocationControl:q}=await ymaps3.import("@yandex/[email protected]"),z=document.createElement("div");z.className=`${this.module.name}-map-center`,l.appendChild(z);const X=new N(z,{location:{center:w,zoom:r.zoom}}),te=X.container.closest(`#${e}-map`);
66v(te),X.addChild(new _),X.addChild(new C),X.addChild(new O({position:"right"}).addChild(new H({}))),X.addChild(new O({position:"top right"}).addChild(new q({}))),X.setBehaviors(["drag","dblClick"]);const B=R=>{const oe=document.createElement("img");return oe.src=R,oe.style.width="40px",oe.style.height="40px",oe.style.maxWidth="none",oe.style.transform="translate(-50%, -100%)",oe},j=R=>{const oe=document.createElement("img");return oe.src=R,oe.style.width="40px",oe.style.height="40px",oe.style.maxWidth="none",oe.style.transform="translate(-50%, -100%)",oe};switch(t.function){case 1:let R;o&&(D(te,!1),o.apikey?o.route=="Y"&&(X.addChild(new I({coordinates:w},B(f))),R=new M({geometry:{type:"LineString",coordinates:[]},style:{stroke:[{color:o.line.color,width:6,opacity:.8}]}}),X.addChild(R),p(te)):(D(te,"Missing route apikey"),console.error(`${this.module.name}[map][Yandex][error][route]: Missing route apikey`)));const oe=new I({coordinates:[]},j(m));X.addChild(oe);const se=(P={},W=!1)=>{document.getElementById(e+"-result")&&ymaps3.search(P).then(J=>{const re=W||J[0].geometry.coordinates,ae=[re[1],re[0]];if(W||X.update({location:{center:re,zoom:r.zoom,duration:400}}),o){let he="driving";switch(o.mode){case"2":he="truck";break;case"3":he="transit";break;case"4":he="walking";break}fetch(qi("https://api.routing.yandex.net/v2/route",{apikey:o.apikey,waypoints:`${x.join()}|${ae.join()}`,mode:he}),{headers:{Accept:"application/json"}}).then(fe=>fe.json()).then(fe=>{if(D(te,!1),fe.errors)R.update({geometry:{type:"LineString",coordinates:[]}}),D(te,fe.errors[0]),console.error(`${this.module.name}[map][Yandex][error][route]: ${fe.errors[0]}`);else if(fe.route.legs[0].status="OK"){const De=[];let Te=0,Ie=0;fe.route.legs.forEach(Me=>{Me.steps.forEach(Le=>{Te=Te+Le.length,Ie=Ie+Le.duration,Le.polyline.points.forEach(Y=>{De.push([Y[1],Y[0]])})})}),o.route=="Y"&&R.update({geometry:{type:"LineString",coordinates:De}}),g(te,Te,Ie)}else R.update({geometry:{type:"LineString",coordinates:[]}}),D(te,"Route not found"),console.error(`${this.module.name}[map][Yandex][error][route]: Route not found`)})}oe.update({coordinates:re}),y("yandex",3,[ae,re],J[0].properties.description?J[0].properties.description+", "+J[0].properties.name:J[0].properties.name)})};X.addChild(new k({layer:"any",onFastClick:(P,{coordinates:W})=>se({text:W},W)}));const le=document.getElementById(e+"-search");le&&le.addEventListener("keydown",({key:P})=>{P==="Enter"&&se({text:le.value})});break;case 2:h(X,(P,W)=>P.addChild(new I({coordinates:[Number(W[1]),Number(W[0])]},j(m))),(P,W)=>P.update({location:{center:[Number(W[1]),Number(W[0])],zoom:r.zoom}}));break}ymaps3.ready.then(()=>{const R=te.querySelectorAll("button");R&&R.forEach(oe=>oe.setAttribute("type","button"))})},S=()=>{const N=document.createElement("div");N.className=`${this.module.name}-map-center`,l.appendChild(N);const _=new mapgl.Map(N,{center:w,zoom:r.zoom,disableZoomOnScroll:!0,key:i||""}),C=_.getContainer().parentElement;switch(v(C),t.function){case 1:let I;o&&(o.route=="Y"&&new mapgl.Marker(_,{coordinates:_.getCenter(),icon:f,size:[30,40],anchor:[20,40],zIndex:2}),p(C));const k=new mapgl.Marker(_,{coordinates:[],icon:m,size:[30,40],anchor:[20,40],zIndex:2}),M=(q={},z=!1)=>{document.getElementById(e+"-result")&&fetch(qi("https://catalog.api.2gis.ru/3.0/items/geocode",q),{headers:{Accept:"application/json"}}).then(X=>X.json()).then(X=>{const te=z||[X.result.items[0].point.lon,X.result.items[0].point.lat],B=[te[1],te[0]];if(z||_.setCenter(te,r.zoom),o){let j="car";switch(o.mode){case"2":j="truck";break;case"3":j="taxi";break;case"4":j="pedestrian";break}fetch("https://routing.api.2gis.com/routing/7.0.0/global?key="+q.key,{method:"POST",body:JSON.stringify({points:[{type:"stop",lat:x[0],lon:x[1]},{type:"stop",lat:B[0],lon:B[1]}],route_mode:"shortest",traffic_mode:"statistics",transport:j,output:"detailed",locale:"ru"})}).then(R=>R.json()).then(R=>{if(R.status=="OK"){D(C,!1);const oe=se=>se.slice(11,-1).split(",").map(le=>le.trim().split(" ").map(Number));if(o.route=="Y"){const se=[];R.result[0].maneuvers.forEach(le=>
66{le.comment!="finish"&&le.outcoming_path.geometry.forEach(P=>{oe(P.selection).forEach(W=>se.push(W))})}),I&&I.destroy(),I=new mapgl.Polyline(_,{coordinates:se,width:6,color:o.line.color,zIndex:1})}g(C,R.result[0].total_distance,R.result[0].total_duration)}else{const oe=R.message||R.status;D(C,oe),console.error(`${this.module.name}[map][2gis][error][route]: ${oe}`)}})}k.setCoordinates(te),y("2gis",1,[B,te],X.result.items[0].full_name)})};_.on("click",({lngLat:q})=>M({key:i,locale:"ru_RU",lon:q[0],lat:q[1],page_size:1,page:1,fields:"items.point,items.full_address_name"},q));const H=document.getElementById(e+"-search");H&&H.addEventListener("keydown",({key:q})=>{q==="Enter"&&M({key:i,locale:"ru_RU",q:H.value,page_size:1,page:1,fields:"items.point,items.full_address_name"})});break;case 2:h(_,(q,z)=>{new mapgl.Marker(q,{coordinates:[Number(z[1]),Number(z[0])],icon:m,size:[30,40],anchor:[20,40]})},(q,z)=>{q.setCenter([Number(z[1]),Number(z[0])],r.zoom)});break}window.addEventListener("resize",()=>_.invalidateSize()),[`${this.module.name}.page.prev.end`,`${this.module.name}.page.next.end`].forEach(I=>{document.addEventListener(I,({target:k})=>{k.querySelector(`#${e}-map`)&&_.invalidateSize()})});const O=C.querySelectorAll("button");O&&O.forEach(I=>I.setAttribute("type","button"))},E=()=>{DG.then(()=>{const N=document.createElement("div");N.className=`${this.module.name}-map-center`,l.appendChild(N);const _=DG.map(N,{center:x,zoom:r.zoom,scrollWheelZoom:!1}),C=_.getContainer().parentElement;switch(v(C),t.function){case 1:let I;o&&(o.route=="Y"&&(I=DG.polyline([],{color:o.line.color,weight:6,opacity:.8,lineCap:"round",lineJoin:"round"}).addTo(_),DG.marker(x,{icon:DG.icon({iconUrl:f,iconSize:[40,40],iconAnchor:[20,40]})}).addTo(_)),p(C));const k=DG.marker(x,{icon:DG.icon({iconUrl:m,iconSize:[40,40],iconAnchor:[20,40]})}),M=(q={},z=!1)=>{document.getElementById(e+"-result")&&fetch(qi("https://catalog.api.2gis.ru/3.0/items/geocode",q),{headers:{Accept:"application/json"}}).then(X=>X.json()).then(X=>{let te=z?[z.lat,z.lng]:[X.result.items[0].point.lat,X.result.items[0].point.lon],B=[te[1],te[0]];if(z||_.setView(te,r.zoom),o){let j="car";switch(o.mode){case"2":j="truck";break;case"3":j="taxi";break;case"4":j="pedestrian";break}fetch("https://routing.api.2gis.com/routing/7.0.0/global?key="+q.key,{method:"POST",body:JSON.stringify({points:[{type:"stop",lat:x[0],lon:x[1]},{type:"stop",lat:te[0],lon:te[1]}],route_mode:"shortest",traffic_mode:"statistics",transport:j,output:"detailed",locale:"ru"})}).then(R=>R.json()).then(R=>{if(R.status=="OK"){if(D(C,!1),o.route=="Y"){let oe=[];R.result[0].maneuvers.forEach(se=>{se.comment!="finish"&&se.outcoming_path.geometry.forEach(le=>{DG.Wkt.toGeoJSON(le.selection).coordinates.forEach(P=>oe.push([P[1],P[0]]))})}),I.setLatLngs(oe)}g(C,R.result[0].total_distance,R.result[0].total_duration)}else{let oe=R.message||R.status;D(C,oe),console.error(`${this.module.name}[map][2gis][error][route]: ${oe}`)}})}k.setLatLng(te),k.addTo(_),y("2gis",2,[te,B],X.result.items[0].full_name)})};_.on("click",({latlng:q})=>{M({key:i,locale:"ru_RU",lon:q.lng,lat:q.lat,page_size:1,page:1,fields:"items.point,items.full_address_name"},q)});const H=document.getElementById(e+"-search");H&&H.addEventListener("keydown",({key:q})=>{q==="Enter"&&M({key:i,locale:"ru_RU",q:H.value,page_size:1,page:1,fields:"items.point,items.full_address_name"})});break;case 2:h(_,(q,z)=>DG.marker([Number(z[0]),Number(z[1])],{icon:DG.icon({iconUrl:m,iconSize:[40,40],iconAnchor:[20,40]})}).addTo(q),(q,z)=>q.setView([Number(z[0]),Number(z[1])],r.zoom));break}window.addEventListener("resize",()=>_.invalidateSize()),[`${this.module.name}.page.prev.end`,`${this.module.name}.page.next.end`].forEach(I=>{document.addEventListener(I,({target:k})=>{k.querySelector(`#${e}-map`)&&_.invalidateSize()})});const O=C.querySelectorAll("button");O&&O.forEach(I=>I.setAttribute("type","button"))})};if(l)switch(Number(s)){case 1:u=="Y"?$o({url:"https://api-maps.yandex.ru/2.1/",params:{apikey:i||null,lang:"ru_RU"},callback:b}):b();break;case 2:u=="Y"?$o({url:"https://api-maps.yandex.ru/v3/",params:{apikey:i||null,lang:"ru_RU"},callback:A}):A();break;case 3:u=="Y"?$o({url:"https://mapgl.2gis.com/api/js/v1",callback:S}):S();break;case 4:u=="Y"?$o({url:"https://maps.api.2gis.ru/2.0/loader.js",params:{pkg:"full",lazy:!0},callback:E}):E();break}else{let N;switch(Number(s)){case 1:N="yandex";break;case 2:N="google";break;case 3:N="2gis";break}console.error(`${this.module.name}[map][error][${N}]: `)}}popup(t,e){const r=document.getElementById(e);if(r){const n=r.querySelector(`.${this.module.name}-popup-content`),a=()=>{r.classList.contains(this.module.show)&&(r.classList.add(this.module.hide),setTimeout(()=>{r.classList.remove(this.module.show,this.module.hide)},500))},i=()=>{r.classList.contains(this.module.show)||(r.classList.add(this.module.show),window.onkeydown=({key:s})=>{s==="Escape"&&a()},r.onclick=({target:s})=>{n.contains(s)||n==s||a()})};switch(t){case"show":i();break;case"hide":a();break}return!0}else return console.error(`${this.module.name}[popup][error]: Element "${this.module.popup}" not found`),!1}autorun(t){const e=(r,n)=>{const a=`${this.module.name}_autorun_${r}`;if(n.AUTO!==void 0&&n.AUTO.ENABLE=="Y"){let i="Y",s="N";n.AUTO.CLOSURE=="Y"?sessionStorage.getItem(a)=="N"?i="N":sessionStorage.setItem(a,"N"):sessionStorage.getItem(a)=="N"&&sessionStorage.removeItem(a),n.AUTO.MOBILE=="Y"&&(s=window.innerWidth<=576?"Y":"N"),i=="Y"&&s=="N"&&setTimeout(()=>{this.modal(r,"show",{AUTO:n.AUTO.EVERYTIME})||this.autorun(t)},Number(n.AUTO.SHOW)*1e3)}else sessionStorage.getItem(a)=="N"&&sessionStorage.removeItem(a)};for(const r in t)t.hasOwnProperty(r)&&e(r,t[r]);window.addEventListener("resize",()=>{for(const r in t)t.hasOwnProperty(r)&&e(r,t[r])})}leave(t){const e=(r,n)=>{const a=`${this.module.name}_leave_${r}`;if(n.LEAVE.ENABLE=="Y"){let i="Y";n.LEAVE.CLOSURE=="Y"?sessionStorage.getItem(a)=="N"?i="N":sessionStorage.setItem(a,"N"):sessionStorage.getItem(a)=="N"&&sessionStorage.removeItem(a),i=="Y"&&setTimeout(()=>{let s=!0;document.addEventListener("mouseleave",({clientY:u})=>{u<10&&s&&(this.modal(r,"show"),s=!1)})},Number(n.LEAVE.DELAY)*1e3)}else sessionStorage.getItem(a)=="N"&&sessionStorage.removeItem(a)};for(const r in t)t.hasOwnProperty(r)&&e(r,t[r])}init(){if(this.quizs){this.autorun(this.quizs),this.leave(this.quizs);const i=this.links(this.quizs);window.addEventListener("load",()=>{i||this.links(this.quizs)})}if(B0(this.module.name)!=null)for(const i in this.quizs)B0(this.module.name)==i&&this.modal(i,"show");(()=>{const i=document.querySelectorAll(`.${this.module.name} .${this.module.name}-window-button`);if(i.length)for(let s=0;s<i.length;s++){const u=i[s],l=u.getAttribute("data-quiz");sessionStorage.getItem(`${this.module.name}_close_${l}`)!="Y"&&(u.getAttribute("data-show")>0?setTimeout(()=>{u.classList.add(this.module.active)},Number(u.getAttribute("data-show"))*1e3):u.classList.contains(this.module.active)||u.classList.add(this.module.active))}})(),(()=>{const i=document.querySelectorAll(`.${this.module.name} .${this.module.name}-window-banner`);if(i.length)for(let s=0;s<i.length;s++){const u=i[s],l=u.getAttribute("data-quiz");sessionStorage.getItem(`${this.module.name}_close_${l}`)!="Y"&&(u.getAttribute("data-show")>0&&u.getAttribute("data-show")==0?setTimeout(()=>{u.classList.add(this.module.active)},Number(u.getAttribute("data-show"))*1e3):u.classList.contains(this.module.active)||u.classList.add(this.module.active))}})(),(()=>{const i=(u,l,o,c,f)=>{l?(this.quiz(l,{TYPE:"widget",INDEX:u+1,WIDGET:o,SELECTOR:c,SELECTOR_BODY:f}),c.addEventListener("click",()=>{c.classList.contains(`${this.module.name}-analytic`)||(c.classList.add(`${this.module.name}-analytic`),this.analytic({QUIZ_ID:l,ANALYTIC:2,ERROR:"N"}),this.metrika({SELECTOR:c.querySelector(`.js-${this.module.name}-form`),TYPE:"start",QUIZ_ID:l}))})):(console.error(`${this.module.name}[widget][error]: ${o}`),c.classList.contains(this.module.loading)&&c.classList.remove(this.module.loading),this.analytic({QUIZ_ID:l,ANALYTIC:2,ERROR:"Y"}))},s=document.querySelectorAll(`.${this.module.name} .${this.module.widget}`);if(s.length)for(let u=0;u<s.length;u++){const l=s[u],o=l.getAttribute("data-quiz"),c=l.querySelector(`.${this.module.widget}-quiz`),f=l.querySelector(`.${this.module.widget}-banner`),d=l.querySelector(`.${this.module.widget}-center`);if(sessionStorage.getItem(`${this.module.name}_close_${o}`)!="Y"){c.classList.add(this.module.loading);const m=()=>{f.classList.contains(this.module.active)&&f.classList.remove(this.module.active),c.classList.contains(this.module.active)||c.classList.add(this.module.active),i(u,o,l,c,d)};Number(l.getAttribute("data-show"))>0&&l.hasAttribute("data-show")?setTimeout(()=>{l.classList.contains(this.module.active)||l.classList.add(this.module.active),i(u,o,l,c,d),f&&f.addEventListener("click",m)},Number(l.getAttribute("data-show"))*1e3):(l.classList.contains(this.module.active)||l.classList.add(this.module.active),i(u,o,l,c,d),f&&f.addEventListener("click",m))}}})();const n=()=>{const i=(c,f,d,m)=>{f?(this.quiz(f,{TYPE:"body",INDEX:c+1,SELECTOR:d,SELECTOR_BODY:m}),d.addEventListener("click",()=>{d.classList.contains(`${this.module.name}-analytic`)||(d.classList.add(`${this.module.name}-analytic`),this.analytic({QUIZ_ID:f,ANALYTIC:2,ERROR:"N"}),this.metrika({SELECTOR:d.querySelector(`.js-${this.module.name}-form`),TYPE:"start",QUIZ_ID:f}))})):(console.error(`${this.module.name}[widget][error]: ${d}`),this.analytic({QUIZ_ID:f,ANALYTIC:2,ERROR:"Y"}),d.classList.contains(this.module.loading)&&d.classList.remove(this.module.loading))},s=(c,f,d)=>{d.classList.add(this.module.loading);
66const m=document.createElement("div");m.classList.add(this.module.body+"-center"),d.appendChild(m),i(c,f,d,m)},u=(c,f,d)=>{if(window.innerWidth>=575.98)d.classList.contains(`${this.module.body}-mobile`)&&(d.innerHTML="",d.classList.remove(`${this.module.body}-mobile`)),d.classList.contains(`${this.module.body}-active`)||(d.classList.add(`${this.module.body}-active`),s(c,f,d));else if(!d.classList.contains(`${this.module.body}-mobile`)){d.innerHTML="",d.classList.remove(`${this.module.body}-active`),d.classList.add(`${this.module.body}-mobile`);const m=document.createElement("div"),h=document.createElement("span");h.textContent=d.hasAttribute("data-button-title")&&d.getAttribute("data-button-title")!=""?d.getAttribute("data-button-title"):this.quizs[f].BODY.BUTTON,m.appendChild(h),m.classList.add(`${this.module.name}-button`),m.setAttribute("onclick",`${this.module.name}.show('${f}');`),d.appendChild(m)}},l=document.querySelectorAll(`.${this.module.body}`);let o=0;return l.length&&l.forEach(c=>{o++;const f=c.getAttribute("data-quiz");c.children.length&&[].slice.call(c.children).forEach(d=>{d.classList.contains(`${this.module.body}-ignore`)||d.remove()}),f?c.classList.contains(`${this.module.body}-active`)||(c.hasAttribute("data-mobile")&&c.getAttribute("data-mobile")=="Y"?(u(o,f,c),window.addEventListener("resize",()=>u(o,f,c),!0)):s(o,f,c)):c.classList.contains(this.module.loading)&&c.classList.remove(this.module.loading)}),o},a=n();window.addEventListener("load",()=>{a||n()})}}});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.