st-comp 0.0.122 → 0.0.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/ChartLayout.js +2 -2
- package/es/Dialog.cjs +1 -1
- package/es/Dialog.js +14 -13
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +26 -25
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +849 -1605
- package/es/KlineBasic.cjs +6 -0
- package/es/KlineBasic.js +2888 -0
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +12 -12
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +18 -17
- package/es/Pie.cjs +1 -1
- package/es/Pie.js +1 -1
- package/es/Table.cjs +1 -1
- package/es/Table.js +18 -17
- package/es/User.cjs +1 -1
- package/es/User.js +75 -74
- package/es/VarietySearch.cjs +1 -1
- package/es/VarietySearch.js +903 -1253
- package/es/VirtualTable.cjs +1 -1
- package/es/VirtualTable.js +13 -12
- package/es/{base-f7877059.js → base-a8f938bd.js} +6 -6
- package/es/{castArray-18f43497.js → castArray-5c01dae1.js} +1 -1
- package/es/config-provider-4954003d.cjs +1 -0
- package/es/{config-provider-6479d795.js → config-provider-d3edea8a.js} +3 -3
- package/es/{debounce-2336e546.js → debounce-edbff018.js} +10 -10
- package/es/{dropdown-46daf582.js → dropdown-7e381525.js} +4 -4
- package/es/el-button-c7b375c4.cjs +1 -0
- package/es/{el-button-802f579a.js → el-button-ce99c64e.js} +6 -5
- package/es/{el-empty-3c5ec277.js → el-empty-ed6c115b.js} +1 -1
- package/es/{el-form-item-84099d46.js → el-form-item-b686a8bb.js} +9 -9
- package/es/{el-form-item-c39f717e.cjs → el-form-item-ff0d8d07.cjs} +1 -1
- package/es/{el-input-fac5b401.js → el-input-21e079e4.js} +5 -5
- package/es/el-menu-item-9369a2ad.js +771 -0
- package/es/el-menu-item-dc904a35.cjs +1 -0
- package/es/el-message-e97bdea1.cjs +1 -0
- package/es/el-message-fd827012.js +374 -0
- package/es/el-overlay-7b90d61c.cjs +1 -0
- package/es/{el-overlay-69e9ae49.js → el-overlay-9245ec1e.js} +77 -76
- package/es/{el-popover-694ded47.js → el-popover-6f075cee.js} +4 -4
- package/es/{el-popover-8735b1fa.cjs → el-popover-6f48d00b.cjs} +1 -1
- package/es/{el-popper-6126b1f6.js → el-popper-8dca8dd4.js} +4 -4
- package/es/{el-scrollbar-e0493906.js → el-scrollbar-906103f8.js} +1 -1
- package/es/{el-select-513126a5.js → el-select-6d6093eb.js} +10 -10
- package/es/el-table-column-26e7f13f.cjs +14 -0
- package/es/{el-table-column-3c920bdd.js → el-table-column-3f388c44.js} +15 -14
- package/es/{el-tag-5becabc9.js → el-tag-cdf0019e.js} +19 -19
- package/es/{index-7e40be25.js → index-53bce290.js} +3 -3
- package/es/index-669a0983.js +14 -0
- package/es/{index-048dca7e.js → index-6ced00c4.js} +1 -1
- package/es/index-c4649a37.cjs +3 -0
- package/es/{index-dc273ea2.cjs → index-d1b7c61e.cjs} +39 -39
- package/es/{index-57f8f7b9.js → index-f8e448bc.js} +5893 -5856
- package/es/{raf-07da7cdf.js → raf-b584bce8.js} +1 -1
- package/es/{refs-1b1fe6ca.js → refs-e1675167.js} +1 -1
- package/es/{scroll-3b521d81.js → scroll-25ec9230.js} +1 -1
- package/es/style.css +1 -1
- package/es/{use-form-common-props-f3a520d0.js → use-form-common-props-f7d2e83c.js} +18 -18
- package/es/use-global-config-8429db7d.js +72 -0
- package/es/{index-8a0b1c53.cjs → use-global-config-ac2dad80.cjs} +1 -3
- package/es/{vnode-25d7c2f5.js → vnode-699e61cb.js} +1 -1
- package/es/{zh-cn-74781bbd.js → zh-cn-61ca7f91.js} +2 -2
- package/es/{zh-cn-ab9a583d.cjs → zh-cn-a20960b5.cjs} +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +213 -208
- package/lib/{index-62c62885.js → index-741ecbcc.js} +38391 -35484
- package/lib/{python-6cdad7a6.js → python-5a672b35.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +2 -2
- package/packages/KlineBasic/api.js +60 -0
- package/packages/KlineBasic/components/Contextmenu/index.vue +105 -0
- package/packages/KlineBasic/components/KlineSub/index.vue +297 -0
- package/packages/KlineBasic/components/KlineTips/index.vue +66 -0
- package/packages/KlineBasic/components/Tips/index.vue +33 -0
- package/packages/KlineBasic/index.ts +8 -0
- package/packages/KlineBasic/index.vue +565 -0
- package/packages/KlineBasic/utils.js +86 -0
- package/packages/VarietySearch/components/FactorScreen/index.vue +7 -7
- package/packages/index.ts +2 -0
- package/src/main.ts +2 -0
- package/src/pages/KlineBasic/api.js +45 -0
- package/src/pages/KlineBasic/index.vue +74 -0
- package/src/pages/KlineBasic/indicator.js +114 -0
- package/src/pages/VarietySearch/index.vue +3 -2
- package/src/router/routes.ts +5 -0
- package/es/config-provider-7cdfca4d.cjs +0 -1
- package/es/el-button-196807af.cjs +0 -1
- package/es/el-overlay-891dcc40.cjs +0 -1
- package/es/el-table-column-dd8b62aa.cjs +0 -14
- package/es/index-35117549.js +0 -81
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
"use strict";const qt=(e,t)=>{let r=e.length;return t<=1||t>r?new Array(r).fill(null):[...new Array(t-1).fill(null),...e.slice(0,r-t+1)]},Lo=e=>{const t=e.reduce((n,i)=>n+i,0)/e.length,r=e.map(n=>Math.pow(n-t,2)).reduce((n,i)=>n+i,0)/e.length;return Math.sqrt(r)},Po=(e,t)=>[...new Array(t).fill(null),...e.slice(0,e.length-t)],Pw=e=>{const t=e.reduce((r,n)=>r+n,0)/e.length;return e.reduce((r,n)=>r+Math.abs(n-t),0)/e.length},Pf=(e,t,r)=>{const n=[(e[0]*r+e[0]*(t-r))/t];for(let i=1;i<e.length;i++)n[i]=(e[i]*r+n[i-1]*(t-r))/t;return n},Vw=(e,t)=>{const r=Number(e.substr(1).split("天")[0]),n=e.split(" ")[1],i=Number(t.substr(1).split("天")[0]),a=t.split(" ")[1],o=new Date().getFullYear(),u=new Date(`${o} ${n}`),c=new Date(`${o} ${a}`);let l=0,s=0;return[["20:00:00","24:00:00"],["00:00:00","03:00:00"],["03:00:00","20:00:00"]].forEach((f,p)=>{u>=new Date(`${o} ${f[0]}`)&&u<=new Date(`${o} ${f[1]}`)&&(l=p),c>=new Date(`${o} ${f[0]}`)&&c<=new Date(`${o} ${f[1]}`)&&(s=p)}),r>i?!0:r<i?!1:l===s?u>=c:l>=s},nc=(e,t,r)=>{const n=new Array(e.length).fill(null);n[e.length-1]=r[t.length-1];let i=e.length-2,a=t.length-2;for(;i>=0&&a>=0;)(e[i].startsWith("第")&&!Vw(e[i],t[a])||new Date(e[i])<new Date(t[a]))&&(a+=-1),n[i]=r[a],i+=-1;return n},ic=(e,t,r)=>{const n=new Array(e.length).fill(null);n[e.length-1]=r[t.length-1];let i=e.length-2,a=t.length-1;for(;i>=0&&a>=0;)!e[i].startsWith("第")&&new Date(`${e[i].split(" ")[0]} 00:00:00`)>=new Date(`${t[a].split(" ")[0]} 00:00:00`)||e[i].startsWith("第")&&Number(e[i].split("天")[0].split("第")[1])>=Number(t[a].split("天")[0].split("第")[1])||(a+=-1),n[i]=r[a-1],i+=-1;return n},Ce={DKX:(e,t)=>{const{open:r,close:n,high:i,low:a}=t,o=r.map((c,l)=>(n[l]*3+i[l]+a[l]+c)/6),{output:u}=e.WMA({inReal:o,timePeriod:20});return qt(u,20)},MADKX:(e,t)=>{const{open:r,close:n,high:i,low:a}=t,o=r.map((l,s)=>(n[s]*3+i[s]+a[s]+l)/6),u=e.WMA({inReal:o,timePeriod:20}),{output:c}=e.SMA({inReal:u.output,timePeriod:10});return qt(c,29)},EMA:(e,t,r)=>{const{close:n}=t,{output:i}=e.EMA({inReal:n,timePeriod:r});return qt(i,r)},HHV:(e,t,r)=>{const{high:n}=t,{output:i}=e.MAX({inReal:n,timePeriod:r});return qt(i,r)},LLV:(e,t,r)=>{const{high:n}=t,{output:i}=e.MIN({inReal:n,timePeriod:r});return qt(i,r)},MA:(e,t,r)=>{const{close:n}=t,{output:i}=e.SMA({inReal:n,timePeriod:r});return qt(i,r)},BBI:(e,t)=>{const r=Ce.MA(e,t,3),n=Ce.MA(e,t,6),i=Ce.MA(e,t,12),a=Ce.MA(e,t,24);return r.map((o,u)=>(o+n[u]+i[u]+a[u])/4)},BBIBOLL:(e,t)=>{const r=Ce.MA(e,t,3),n=Ce.MA(e,t,6),i=Ce.MA(e,t,12),a=Ce.MA(e,t,24);return r.map((o,u)=>(o+n[u]+i[u]+a[u])/4)},DWN:(e,t)=>{const r=Ce.BBIBOLL(e,t);return r.map((n,i)=>n-6*Lo(r.slice(i-10,i+1)))},UPR:(e,t)=>{const r=Ce.BBIBOLL(e,t);return r.map((n,i)=>n+6*Lo(r.slice(i-10,i+1)))},MID:(e,t)=>Ce.MA(e,t,20),UPPER:(e,t)=>{const r=Ce.MID(e,t);return r.map((n,i)=>n+2*Lo(r.slice(i-19,i+1)))},LOWER:(e,t)=>{const r=Ce.MID(e,t);return r.map((n,i)=>n-2*Lo(r.slice(i-19,i+1)))},TQA_H:(e,t)=>{const{high:r}=t,{output:n}=e.MAX({inReal:r,timePeriod:20});return Po(qt(n,20),1)},TQA_L:(e,t)=>{const{low:r}=t,{output:n}=e.MIN({inReal:r,timePeriod:10});return Po(qt(n,10),1)},DKX_D:(e,t,r)=>{const{open:n,close:i,high:a,low:o}=r,u=n.map((l,s)=>(i[s]*3+a[s]+o[s]+l)/6),{output:c}=e.WMA({inReal:u,timePeriod:20});return ic(t.time,r.time,qt(c,20))},MADKX_D:(e,t,r)=>{const{open:n,close:i,high:a,low:o}=r,u=n.map((s,f)=>(i[f]*3+a[f]+o[f]+s)/6),c=e.WMA({inReal:u,timePeriod:20}),{output:l}=e.SMA({inReal:c.output,timePeriod:10});return ic(t.time,r.time,qt(l,29))},EMA_D:(e,t,r,n)=>ic(t.time,r.time,Ce.EMA(e,r,n)),DKX_H:(e,t,r)=>{const{open:n,close:i,high:a,low:o}=r,u=n.map((l,s)=>(i[s]*3+a[s]+o[s]+l)/6),{output:c}=e.WMA({inReal:u,timePeriod:20});return nc(t.time,r.time,qt(c,20))},MADKX_H:(e,t,r)=>{const{open:n,close:i,high:a,low:o}=r,u=n.map((s,f)=>(i[f]*3+a[f]+o[f]+s)/6),c=e.WMA({inReal:u,timePeriod:20}),{output:l}=e.SMA({inReal:c.output,timePeriod:10});return nc(t.time,r.time,qt(l,29))},EMA_H:(e,t,r,n)=>nc(t.time,r.time,Ce.EMA(e,r,n)),MAVOL:(e,t,r)=>{const{originData:n}=t,{output:i}=e.SMA({inReal:n.map(a=>a[5]),timePeriod:r});return qt(i,r)},MACCL:(e,t)=>{const{originData:r}=t,{output:n}=e.SMA({inReal:r.map(i=>i[7]),timePeriod:10});return qt(n,10)},MAAMO:(e,t,r)=>{const{originData:n}=t,{output:i}=e.MA({inReal:n.map(a=>a[6]),timePeriod:r});return qt(i,r)},DIF:(e,t)=>{const r=Ce.EMA(e,t,12),n=Ce.EMA(e,t,26);return r.map((i,a)=>{const o=i||0,u=n[a]||0;return o-u})},DEA:(e,t)=>{const r=Ce.DIF(e,t),{output:n}=e.EMA({inReal:r,timePeriod:9});return qt(n,9)},MACD:(e,t)=>{const r=Ce.DIF(e,t),n=Ce.DEA(e,t);return r.map((i,a)=>{const o=i||0,u=n[a]||0;return(o-u)*2})},MTR:(e,t)=>{const{close:r,high:n,low:i}=t,a=Po(r,1);return n.map((o,u)=>{const c=o,l=i[u],s=a[u];return Math.max(Math.max(c-l,Math.abs(s-c)),Math.abs(s-l))})},ATR:(e,t)=>{const r=Ce.MTR(e,t),{output:n}=e.MA({inReal:r,timePeriod:14});return qt(n,14)},CCI:(e,t)=>{const{close:r,high:n,low:i}=t,a=n.map((c,l)=>(c+i[l]+r[l])/3),{output:o}=e.MA({inReal:a,timePeriod:14}),u=qt(o,14);return a.map((c,l)=>{if(l<12)return 0;const s=Pw(a.slice(l-13,l+1));return(c-u[l])*1e3/(15*s)})},RSI:(e,t,r)=>{const{close:n}=t,i=Po(n,1),a=i.map((l,s)=>Math.max(n[s]-l,0)),o=i.map((l,s)=>Math.abs(n[s]-l)),u=Pf(a,r,1),c=Pf(o,r,1);return u.map((l,s)=>c[s]?l/c[s]*100:null)}},Uw={DKX:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.DKX(e,t)},MADKX:{color:"#FFFF00",calculationFn:(e,t)=>Ce.MADKX(e,t)},EMA30:{color:"#FF0000",calculationFn:(e,t)=>Ce.EMA(e,t,30)},EMA60:{color:"#00FF00",calculationFn:(e,t)=>Ce.EMA(e,t,60)},EMA120:{color:"#E4007F",calculationFn:(e,t)=>Ce.EMA(e,t,120)},EMA240:{color:"#999999",calculationFn:(e,t)=>Ce.EMA(e,t,240)},EMA360:{color:"#CFCFC4",calculationFn:(e,t)=>Ce.EMA(e,t,360)},EMA720:{color:"#00FFFF",calculationFn:(e,t)=>Ce.EMA(e,t,720)},DKX_D:{color:"#FFFFFF",width:2,calculationFn:(e,t,r)=>Ce.DKX_D(e,t,r)},EMA60_D:{color:"#00FF00",width:2,calculationFn:(e,t,r)=>Ce.EMA_D(e,t,r,60)},EMA120_D:{color:"#FF0000",width:2,calculationFn:(e,t,r)=>Ce.EMA_D(e,t,r,120)},EMA240_D:{color:"#0000FF",width:2,calculationFn:(e,t,r)=>Ce.EMA_D(e,t,r,240)},MADKX_D:{color:"#FFFF00",width:2,calculationFn:(e,t,r)=>Ce.MADKX_D(e,t,r)},DKX_H:{color:"#FFFFFF",width:2,calculationFn:(e,t,r)=>Ce.DKX_H(e,t,r)},EMA60_H:{color:"#00FF00",width:2,calculationFn:(e,t,r)=>Ce.EMA_H(e,t,r,60)},EMA120_H:{color:"#FF0000",width:2,calculationFn:(e,t,r)=>Ce.EMA_H(e,t,r,120)},EMA240_H:{color:"#0000FF",width:2,calculationFn:(e,t,r)=>Ce.EMA_H(e,t,r,240)},MADKX_H:{color:"#FFFF00",width:2,calculationFn:(e,t,r)=>Ce.MADKX_H(e,t,r)},BBI:{color:"rgba(238, 238, 238, 0.5)",calculationFn:(e,t)=>Ce.BBI(e,t)},BBIBOLL:{color:"rgba(238, 238, 238, 0.5)",calculationFn:(e,t)=>Ce.BBIBOLL(e,t)},DWN:{color:"#FF00FF",calculationFn:(e,t)=>Ce.DWN(e,t)},UPR:{color:"#FFFF00",calculationFn:(e,t)=>Ce.UPR(e,t)},LOWER:{color:"#FF00FF",calculationFn:(e,t)=>Ce.LOWER(e,t)},MID:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.MID(e,t)},UPPER:{color:"#FFFF00",calculationFn:(e,t)=>Ce.UPPER(e,t)},MA5:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.MA(e,t,5)},MA10:{color:"#FFFF00",calculationFn:(e,t)=>Ce.MA(e,t,10)},MA20:{color:"#FF00FF",calculationFn:(e,t)=>Ce.MA(e,t,20)},MA60:{color:"#00FF00",calculationFn:(e,t)=>Ce.MA(e,t,60)},HHV30:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.HHV(e,t,30)},LLV30:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.LLV(e,t,30)},TQA_H:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.TQA_H(e,t)},TQA_L:{color:"#FFFF00",calculationFn:(e,t)=>Ce.TQA_L(e,t)}},$w={main:[{key:"BBI",config:["BBI"]},{key:"BBIBOLL",config:["BBIBOLL","DWN","UPR"]},{key:"BOLL",config:["LOWER","MID","UPPER"]},{key:"DKX",config:["DKX","MADKX"]},{key:"DKX_EMA",config:["DKX","EMA30","EMA60","EMA120","EMA240","MADKX","EMA720"]},{key:"DKX_EMA_D",showFreq:["1m","5m","15m","60m"],mergeFreq:"1d",config:["DKX","MADKX","EMA60","DKX_D","EMA60_D","EMA120_D","EMA240_D","MADKX_D"]},{key:"DKX_EMA_H",showFreq:["1m","5m","15m"],mergeFreq:"60m",config:["DKX","MADKX","EMA60","DKX_H","EMA60_H","EMA120_H","EMA240_H","MADKX_H"]},{key:"DKX_MA",config:["DKX","HHV30","LLV30","MA60","MADKX"]},{key:"EMA_BIG",config:["EMA30","EMA60","EMA120","EMA240","EMA360","EMA720"]},{key:"MA",config:["MA5","MA10","MA20","MA60"]},{key:"TQA",config:["TQA_H","TQA_L"]}],sub:[{key:"AMOUNT",series:"bar",source:"origin",dataIndex:6,color:"kline",config:[{key:"AMO",color:"#FF0000",source:"origin",series:"base",dataIndex:6},{key:"MAAMO1",color:"#7DBABA",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MAAMO(e,t,5)},{key:"MAAMO2",color:"#D2C38C",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MAAMO(e,t,10)}]},{key:"ATR",series:"none",config:[{key:"ATR",color:"#7DBABA",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.ATR(e,t)},{key:"MTR",color:"#D2C38C",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MTR(e,t)}]},{key:"CCI",series:"none",config:[{key:"CCI",color:"#524c75",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.CCI(e,t)}]},{key:"VOL",series:"bar",source:"origin",dataIndex:5,color:"kline",rightYAxisRange:"cover",config:[{key:"MAVOL1",color:"#7DBABA",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MAVOL(e,t,5)},{key:"MAVOL2",color:"#D2C38C",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MAVOL(e,t,10)},{key:"VOLUME",color:"#FF0000",source:"origin",series:"base",dataIndex:5},{key:"CCL",color:"#FFFFFF",source:"origin",series:"line",dataIndex:7,yAxis:"right"}]},{key:"CCL",series:"none",leftYAxisRange:"cover",config:[{key:"CCL",color:"#524c75",source:"origin",series:"line",dataIndex:7},{key:"MACCL",color:"#524c75",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MACCL(e,t)}]},{key:"MACD",series:"bar",source:"calculation",dataIndex:"MACD",color:"value",leftYAxisRange:"cover",config:[{key:"DEA",color:"#bc8eab",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.DEA(e,t)},{key:"DIF",color:"#524c75",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.DIF(e,t)},{key:"MACD",color:"#FF0000",source:"calculation",series:"bar",calculationFn:(e,t)=>Ce.MACD(e,t)}]},{key:"RSI",series:"none",leftYAxisRange:"cover",config:[{key:"RSI1",color:"#bc8eab",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.RSI(e,t,6)},{key:"RS2",color:"#524c75",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.RSI(e,t,12)},{key:"RS3",color:"#a5a0c4",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.RSI(e,t,24)}]}]};$w.main.map(({key:e,showFreq:t,mergeFreq:r,config:n})=>({label:e,value:e,showFreq:t,mergeFreq:r,config:n.map(i=>({key:i,...Uw[i]}))}));const Rg=(e,t,r=null)=>{localStorage.setItem(`expires-${e}`,JSON.stringify({value:t,expires:r}))},qg=e=>{const t=localStorage.getItem(`expires-${e}`);if(!t)return null;const{value:r,expires:n}=JSON.parse(t);return n===null||new Date().getTime()<n?r:(localStorage.removeItem(`expires-${e}`),null)},Vf=e=>{localStorage.removeItem(`expires-${e}`)};function Tt(){return Tt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tt.apply(null,arguments)}var zg={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null};function Ue(e){return typeof e=="number"}function $e(e){return!e||typeof e!="object"||typeof e.constructor!="function"?!1:e.isBigNumber===!0&&typeof e.constructor.prototype=="object"&&e.constructor.prototype.isBigNumber===!0||typeof e.constructor.isDecimal=="function"&&e.constructor.isDecimal(e)===!0}function wn(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isComplex===!0||!1}function yo(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isFraction===!0||!1}function Cr(e){return e&&e.constructor.prototype.isUnit===!0||!1}function Qt(e){return typeof e=="string"}var st=Array.isArray;function ke(e){return e&&e.constructor.prototype.isMatrix===!0||!1}function Fr(e){return Array.isArray(e)||ke(e)}function Ms(e){return e&&e.isDenseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function wi(e){return e&&e.isSparseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function yl(e){return e&&e.constructor.prototype.isRange===!0||!1}function lu(e){return e&&e.constructor.prototype.isIndex===!0||!1}function Hw(e){return typeof e=="boolean"}function Jw(e){return e&&e.constructor.prototype.isResultSet===!0||!1}function jg(e){return e&&e.constructor.prototype.isHelp===!0||!1}function Gw(e){return typeof e=="function"}function Ww(e){return e instanceof Date}function Kw(e){return e instanceof RegExp}function fu(e){return!!(e&&typeof e=="object"&&e.constructor===Object&&!wn(e)&&!yo(e))}function Qw(e){return e===null}function Zw(e){return e===void 0}function Ti(e){return e&&e.isAccessorNode===!0&&e.constructor.prototype.isNode===!0||!1}function Sr(e){return e&&e.isArrayNode===!0&&e.constructor.prototype.isNode===!0||!1}function Xw(e){return e&&e.isAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function Yw(e){return e&&e.isBlockNode===!0&&e.constructor.prototype.isNode===!0||!1}function eN(e){return e&&e.isConditionalNode===!0&&e.constructor.prototype.isNode===!0||!1}function nt(e){return e&&e.isConstantNode===!0&&e.constructor.prototype.isNode===!0||!1}function _c(e){return nt(e)||Ct(e)&&e.args.length===1&&nt(e.args[0])&&"-+~".includes(e.op)}function xo(e){return e&&e.isFunctionAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function Zn(e){return e&&e.isFunctionNode===!0&&e.constructor.prototype.isNode===!0||!1}function Na(e){return e&&e.isIndexNode===!0&&e.constructor.prototype.isNode===!0||!1}function ft(e){return e&&e.isNode===!0&&e.constructor.prototype.isNode===!0||!1}function pu(e){return e&&e.isObjectNode===!0&&e.constructor.prototype.isNode===!0||!1}function Ct(e){return e&&e.isOperatorNode===!0&&e.constructor.prototype.isNode===!0||!1}function An(e){return e&&e.isParenthesisNode===!0&&e.constructor.prototype.isNode===!0||!1}function tN(e){return e&&e.isRangeNode===!0&&e.constructor.prototype.isNode===!0||!1}function rN(e){return e&&e.isRelationalNode===!0&&e.constructor.prototype.isNode===!0||!1}function zt(e){return e&&e.isSymbolNode===!0&&e.constructor.prototype.isNode===!0||!1}function Lg(e){return e&&e.constructor.prototype.isChain===!0||!1}function dt(e){var t=typeof e;return t==="object"?e===null?"null":$e(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":t}function ze(e){var t=typeof e;if(t==="number"||t==="string"||t==="boolean"||e===null||e===void 0)return e;if(typeof e.clone=="function")return e.clone();if(Array.isArray(e))return e.map(function(r){return ze(r)});if(e instanceof Date)return new Date(e.valueOf());if($e(e))return e;if(fu(e))return nN(e,ze);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(e,")"))}function nN(e,t){var r={};for(var n in e)Me(e,n)&&(r[n]=t(e[n]));return r}function Pg(e,t){for(var r in t)Me(t,r)&&(e[r]=t[r]);return e}function Oi(e,t){var r,n,i;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;n++)if(!Oi(e[n],t[n]))return!1;return!0}else{if(typeof e=="function")return e===t;if(e instanceof Object){if(Array.isArray(t)||!(t instanceof Object))return!1;for(r in e)if(!(r in t)||!Oi(e[r],t[r]))return!1;for(r in t)if(!(r in e))return!1;return!0}else return e===t}}function iN(e,t,r){var n=!0,i;Object.defineProperty(e,t,{get:function(){return n&&(i=r(),n=!1),i},set:function(a){i=a,n=!1},configurable:!0,enumerable:!0})}function Me(e,t){return e&&Object.hasOwnProperty.call(e,t)}function aN(e,t){for(var r={},n=0;n<t.length;n++){var i=t[n],a=e[i];a!==void 0&&(r[i]=a)}return r}var oN=["Matrix","Array"],sN=["number","BigNumber","Fraction"],ve=function(e){if(e)throw new Error(`The global config is readonly.
|
|
1
|
+
"use strict";const qt=(e,t)=>{let r=e.length;return t<=1||t>r?new Array(r).fill(null):[...new Array(t-1).fill(null),...e.slice(0,r-t+1)]},Po=e=>{const t=e.reduce((n,i)=>n+i,0)/e.length,r=e.map(n=>Math.pow(n-t,2)).reduce((n,i)=>n+i,0)/e.length;return Math.sqrt(r)},Vo=(e,t)=>[...new Array(t).fill(null),...e.slice(0,e.length-t)],Uw=e=>{const t=e.reduce((r,n)=>r+n,0)/e.length;return e.reduce((r,n)=>r+Math.abs(n-t),0)/e.length},Vf=(e,t,r)=>{const n=[(e[0]*r+e[0]*(t-r))/t];for(let i=1;i<e.length;i++)n[i]=(e[i]*r+n[i-1]*(t-r))/t;return n},$w=(e,t)=>{const r=Number(e.substr(1).split("天")[0]),n=e.split(" ")[1],i=Number(t.substr(1).split("天")[0]),a=t.split(" ")[1],o=new Date().getFullYear(),u=new Date(`${o} ${n}`),c=new Date(`${o} ${a}`);let l=0,s=0;return[["20:00:00","24:00:00"],["00:00:00","03:00:00"],["03:00:00","20:00:00"]].forEach((f,p)=>{u>=new Date(`${o} ${f[0]}`)&&u<=new Date(`${o} ${f[1]}`)&&(l=p),c>=new Date(`${o} ${f[0]}`)&&c<=new Date(`${o} ${f[1]}`)&&(s=p)}),r>i?!0:r<i?!1:l===s?u>=c:l>=s},ic=(e,t,r)=>{const n=new Array(e.length).fill(null);n[e.length-1]=r[t.length-1];let i=e.length-2,a=t.length-2;for(;i>=0&&a>=0;)(e[i].startsWith("第")&&!$w(e[i],t[a])||new Date(e[i])<new Date(t[a]))&&(a+=-1),n[i]=r[a],i+=-1;return n},ac=(e,t,r)=>{const n=new Array(e.length).fill(null);n[e.length-1]=r[t.length-1];let i=e.length-2,a=t.length-1;for(;i>=0&&a>=0;)!e[i].startsWith("第")&&new Date(`${e[i].split(" ")[0]} 00:00:00`)>=new Date(`${t[a].split(" ")[0]} 00:00:00`)||e[i].startsWith("第")&&Number(e[i].split("天")[0].split("第")[1])>=Number(t[a].split("天")[0].split("第")[1])||(a+=-1),n[i]=r[a-1],i+=-1;return n},Ce={DKX:(e,t)=>{const{open:r,close:n,high:i,low:a}=t,o=r.map((c,l)=>(n[l]*3+i[l]+a[l]+c)/6),{output:u}=e.WMA({inReal:o,timePeriod:20});return qt(u,20)},MADKX:(e,t)=>{const{open:r,close:n,high:i,low:a}=t,o=r.map((l,s)=>(n[s]*3+i[s]+a[s]+l)/6),u=e.WMA({inReal:o,timePeriod:20}),{output:c}=e.SMA({inReal:u.output,timePeriod:10});return qt(c,29)},EMA:(e,t,r)=>{const{close:n}=t,{output:i}=e.EMA({inReal:n,timePeriod:r});return qt(i,r)},HHV:(e,t,r)=>{const{high:n}=t,{output:i}=e.MAX({inReal:n,timePeriod:r});return qt(i,r)},LLV:(e,t,r)=>{const{high:n}=t,{output:i}=e.MIN({inReal:n,timePeriod:r});return qt(i,r)},MA:(e,t,r)=>{const{close:n}=t,{output:i}=e.SMA({inReal:n,timePeriod:r});return qt(i,r)},BBI:(e,t)=>{const r=Ce.MA(e,t,3),n=Ce.MA(e,t,6),i=Ce.MA(e,t,12),a=Ce.MA(e,t,24);return r.map((o,u)=>(o+n[u]+i[u]+a[u])/4)},BBIBOLL:(e,t)=>{const r=Ce.MA(e,t,3),n=Ce.MA(e,t,6),i=Ce.MA(e,t,12),a=Ce.MA(e,t,24);return r.map((o,u)=>(o+n[u]+i[u]+a[u])/4)},DWN:(e,t)=>{const r=Ce.BBIBOLL(e,t);return r.map((n,i)=>n-6*Po(r.slice(i-10,i+1)))},UPR:(e,t)=>{const r=Ce.BBIBOLL(e,t);return r.map((n,i)=>n+6*Po(r.slice(i-10,i+1)))},MID:(e,t)=>Ce.MA(e,t,20),UPPER:(e,t)=>{const r=Ce.MID(e,t);return r.map((n,i)=>n+2*Po(r.slice(i-19,i+1)))},LOWER:(e,t)=>{const r=Ce.MID(e,t);return r.map((n,i)=>n-2*Po(r.slice(i-19,i+1)))},TQA_H:(e,t)=>{const{high:r}=t,{output:n}=e.MAX({inReal:r,timePeriod:20});return Vo(qt(n,20),1)},TQA_L:(e,t)=>{const{low:r}=t,{output:n}=e.MIN({inReal:r,timePeriod:10});return Vo(qt(n,10),1)},DKX_D:(e,t,r)=>{const{open:n,close:i,high:a,low:o}=r,u=n.map((l,s)=>(i[s]*3+a[s]+o[s]+l)/6),{output:c}=e.WMA({inReal:u,timePeriod:20});return ac(t.time,r.time,qt(c,20))},MADKX_D:(e,t,r)=>{const{open:n,close:i,high:a,low:o}=r,u=n.map((s,f)=>(i[f]*3+a[f]+o[f]+s)/6),c=e.WMA({inReal:u,timePeriod:20}),{output:l}=e.SMA({inReal:c.output,timePeriod:10});return ac(t.time,r.time,qt(l,29))},EMA_D:(e,t,r,n)=>ac(t.time,r.time,Ce.EMA(e,r,n)),DKX_H:(e,t,r)=>{const{open:n,close:i,high:a,low:o}=r,u=n.map((l,s)=>(i[s]*3+a[s]+o[s]+l)/6),{output:c}=e.WMA({inReal:u,timePeriod:20});return ic(t.time,r.time,qt(c,20))},MADKX_H:(e,t,r)=>{const{open:n,close:i,high:a,low:o}=r,u=n.map((s,f)=>(i[f]*3+a[f]+o[f]+s)/6),c=e.WMA({inReal:u,timePeriod:20}),{output:l}=e.SMA({inReal:c.output,timePeriod:10});return ic(t.time,r.time,qt(l,29))},EMA_H:(e,t,r,n)=>ic(t.time,r.time,Ce.EMA(e,r,n)),MAVOL:(e,t,r)=>{const{originData:n}=t,{output:i}=e.SMA({inReal:n.map(a=>a[5]),timePeriod:r});return qt(i,r)},MACCL:(e,t)=>{const{originData:r}=t,{output:n}=e.SMA({inReal:r.map(i=>i[7]),timePeriod:10});return qt(n,10)},MAAMO:(e,t,r)=>{const{originData:n}=t,{output:i}=e.MA({inReal:n.map(a=>a[6]),timePeriod:r});return qt(i,r)},DIF:(e,t)=>{const r=Ce.EMA(e,t,12),n=Ce.EMA(e,t,26);return r.map((i,a)=>{const o=i||0,u=n[a]||0;return o-u})},DEA:(e,t)=>{const r=Ce.DIF(e,t),{output:n}=e.EMA({inReal:r,timePeriod:9});return qt(n,9)},MACD:(e,t)=>{const r=Ce.DIF(e,t),n=Ce.DEA(e,t);return r.map((i,a)=>{const o=i||0,u=n[a]||0;return(o-u)*2})},MTR:(e,t)=>{const{close:r,high:n,low:i}=t,a=Vo(r,1);return n.map((o,u)=>{const c=o,l=i[u],s=a[u];return Math.max(Math.max(c-l,Math.abs(s-c)),Math.abs(s-l))})},ATR:(e,t)=>{const r=Ce.MTR(e,t),{output:n}=e.MA({inReal:r,timePeriod:14});return qt(n,14)},CCI:(e,t)=>{const{close:r,high:n,low:i}=t,a=n.map((c,l)=>(c+i[l]+r[l])/3),{output:o}=e.MA({inReal:a,timePeriod:14}),u=qt(o,14);return a.map((c,l)=>{if(l<12)return 0;const s=Uw(a.slice(l-13,l+1));return(c-u[l])*1e3/(15*s)})},RSI:(e,t,r)=>{const{close:n}=t,i=Vo(n,1),a=i.map((l,s)=>Math.max(n[s]-l,0)),o=i.map((l,s)=>Math.abs(n[s]-l)),u=Vf(a,r,1),c=Vf(o,r,1);return u.map((l,s)=>c[s]?l/c[s]*100:null)}},Hw={DKX:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.DKX(e,t)},MADKX:{color:"#FFFF00",calculationFn:(e,t)=>Ce.MADKX(e,t)},EMA30:{color:"#FF0000",calculationFn:(e,t)=>Ce.EMA(e,t,30)},EMA60:{color:"#00FF00",calculationFn:(e,t)=>Ce.EMA(e,t,60)},EMA120:{color:"#E4007F",calculationFn:(e,t)=>Ce.EMA(e,t,120)},EMA240:{color:"#999999",calculationFn:(e,t)=>Ce.EMA(e,t,240)},EMA360:{color:"#CFCFC4",calculationFn:(e,t)=>Ce.EMA(e,t,360)},EMA720:{color:"#00FFFF",calculationFn:(e,t)=>Ce.EMA(e,t,720)},DKX_D:{color:"#FFFFFF",width:2,calculationFn:(e,t,r)=>Ce.DKX_D(e,t,r)},EMA60_D:{color:"#00FF00",width:2,calculationFn:(e,t,r)=>Ce.EMA_D(e,t,r,60)},EMA120_D:{color:"#FF0000",width:2,calculationFn:(e,t,r)=>Ce.EMA_D(e,t,r,120)},EMA240_D:{color:"#0000FF",width:2,calculationFn:(e,t,r)=>Ce.EMA_D(e,t,r,240)},MADKX_D:{color:"#FFFF00",width:2,calculationFn:(e,t,r)=>Ce.MADKX_D(e,t,r)},DKX_H:{color:"#FFFFFF",width:2,calculationFn:(e,t,r)=>Ce.DKX_H(e,t,r)},EMA60_H:{color:"#00FF00",width:2,calculationFn:(e,t,r)=>Ce.EMA_H(e,t,r,60)},EMA120_H:{color:"#FF0000",width:2,calculationFn:(e,t,r)=>Ce.EMA_H(e,t,r,120)},EMA240_H:{color:"#0000FF",width:2,calculationFn:(e,t,r)=>Ce.EMA_H(e,t,r,240)},MADKX_H:{color:"#FFFF00",width:2,calculationFn:(e,t,r)=>Ce.MADKX_H(e,t,r)},BBI:{color:"rgba(238, 238, 238, 0.5)",calculationFn:(e,t)=>Ce.BBI(e,t)},BBIBOLL:{color:"rgba(238, 238, 238, 0.5)",calculationFn:(e,t)=>Ce.BBIBOLL(e,t)},DWN:{color:"#FF00FF",calculationFn:(e,t)=>Ce.DWN(e,t)},UPR:{color:"#FFFF00",calculationFn:(e,t)=>Ce.UPR(e,t)},LOWER:{color:"#FF00FF",calculationFn:(e,t)=>Ce.LOWER(e,t)},MID:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.MID(e,t)},UPPER:{color:"#FFFF00",calculationFn:(e,t)=>Ce.UPPER(e,t)},MA5:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.MA(e,t,5)},MA10:{color:"#FFFF00",calculationFn:(e,t)=>Ce.MA(e,t,10)},MA20:{color:"#FF00FF",calculationFn:(e,t)=>Ce.MA(e,t,20)},MA60:{color:"#00FF00",calculationFn:(e,t)=>Ce.MA(e,t,60)},HHV30:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.HHV(e,t,30)},LLV30:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.LLV(e,t,30)},TQA_H:{color:"#FFFFFF",calculationFn:(e,t)=>Ce.TQA_H(e,t)},TQA_L:{color:"#FFFF00",calculationFn:(e,t)=>Ce.TQA_L(e,t)}},Jw={main:[{key:"BBI",config:["BBI"]},{key:"BBIBOLL",config:["BBIBOLL","DWN","UPR"]},{key:"BOLL",config:["LOWER","MID","UPPER"]},{key:"DKX",config:["DKX","MADKX"]},{key:"DKX_EMA",config:["DKX","EMA30","EMA60","EMA120","EMA240","MADKX","EMA720"]},{key:"DKX_EMA_D",showFreq:["1m","5m","15m","60m"],mergeFreq:"1d",config:["DKX","MADKX","EMA60","DKX_D","EMA60_D","EMA120_D","EMA240_D","MADKX_D"]},{key:"DKX_EMA_H",showFreq:["1m","5m","15m"],mergeFreq:"60m",config:["DKX","MADKX","EMA60","DKX_H","EMA60_H","EMA120_H","EMA240_H","MADKX_H"]},{key:"DKX_MA",config:["DKX","HHV30","LLV30","MA60","MADKX"]},{key:"EMA_BIG",config:["EMA30","EMA60","EMA120","EMA240","EMA360","EMA720"]},{key:"MA",config:["MA5","MA10","MA20","MA60"]},{key:"TQA",config:["TQA_H","TQA_L"]}],sub:[{key:"AMOUNT",series:"bar",source:"origin",dataIndex:6,color:"kline",config:[{key:"AMO",color:"#FF0000",source:"origin",series:"base",dataIndex:6},{key:"MAAMO1",color:"#7DBABA",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MAAMO(e,t,5)},{key:"MAAMO2",color:"#D2C38C",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MAAMO(e,t,10)}]},{key:"ATR",series:"none",config:[{key:"ATR",color:"#7DBABA",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.ATR(e,t)},{key:"MTR",color:"#D2C38C",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MTR(e,t)}]},{key:"CCI",series:"none",config:[{key:"CCI",color:"#524c75",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.CCI(e,t)}]},{key:"VOL",series:"bar",source:"origin",dataIndex:5,color:"kline",rightYAxisRange:"cover",config:[{key:"MAVOL1",color:"#7DBABA",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MAVOL(e,t,5)},{key:"MAVOL2",color:"#D2C38C",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MAVOL(e,t,10)},{key:"VOLUME",color:"#FF0000",source:"origin",series:"base",dataIndex:5},{key:"CCL",color:"#FFFFFF",source:"origin",series:"line",dataIndex:7,yAxis:"right"}]},{key:"CCL",series:"none",leftYAxisRange:"cover",config:[{key:"CCL",color:"#524c75",source:"origin",series:"line",dataIndex:7},{key:"MACCL",color:"#524c75",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.MACCL(e,t)}]},{key:"MACD",series:"bar",source:"calculation",dataIndex:"MACD",color:"value",leftYAxisRange:"cover",config:[{key:"DEA",color:"#bc8eab",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.DEA(e,t)},{key:"DIF",color:"#524c75",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.DIF(e,t)},{key:"MACD",color:"#FF0000",source:"calculation",series:"bar",calculationFn:(e,t)=>Ce.MACD(e,t)}]},{key:"RSI",series:"none",leftYAxisRange:"cover",config:[{key:"RSI1",color:"#bc8eab",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.RSI(e,t,6)},{key:"RS2",color:"#524c75",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.RSI(e,t,12)},{key:"RS3",color:"#a5a0c4",source:"calculation",series:"line",calculationFn:(e,t)=>Ce.RSI(e,t,24)}]}]};Jw.main.map(({key:e,showFreq:t,mergeFreq:r,config:n})=>({label:e,value:e,showFreq:t,mergeFreq:r,config:n.map(i=>({key:i,...Hw[i]}))}));const qg=(e,t,r=null)=>{localStorage.setItem(`expires-${e}`,JSON.stringify({value:t,expires:r}))},zg=e=>{const t=localStorage.getItem(`expires-${e}`);if(!t)return null;const{value:r,expires:n}=JSON.parse(t);return n===null||new Date().getTime()<n?r:(localStorage.removeItem(`expires-${e}`),null)},Uf=e=>{localStorage.removeItem(`expires-${e}`)};function Tt(){return Tt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tt.apply(null,arguments)}var jg={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null};function Ue(e){return typeof e=="number"}function $e(e){return!e||typeof e!="object"||typeof e.constructor!="function"?!1:e.isBigNumber===!0&&typeof e.constructor.prototype=="object"&&e.constructor.prototype.isBigNumber===!0||typeof e.constructor.isDecimal=="function"&&e.constructor.isDecimal(e)===!0}function wn(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isComplex===!0||!1}function bo(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isFraction===!0||!1}function Cr(e){return e&&e.constructor.prototype.isUnit===!0||!1}function Qt(e){return typeof e=="string"}var st=Array.isArray;function ke(e){return e&&e.constructor.prototype.isMatrix===!0||!1}function Fr(e){return Array.isArray(e)||ke(e)}function _s(e){return e&&e.isDenseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function wi(e){return e&&e.isSparseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function bl(e){return e&&e.constructor.prototype.isRange===!0||!1}function fu(e){return e&&e.constructor.prototype.isIndex===!0||!1}function Gw(e){return typeof e=="boolean"}function Ww(e){return e&&e.constructor.prototype.isResultSet===!0||!1}function Lg(e){return e&&e.constructor.prototype.isHelp===!0||!1}function Kw(e){return typeof e=="function"}function Qw(e){return e instanceof Date}function Zw(e){return e instanceof RegExp}function pu(e){return!!(e&&typeof e=="object"&&e.constructor===Object&&!wn(e)&&!bo(e))}function Xw(e){return e===null}function Yw(e){return e===void 0}function Ti(e){return e&&e.isAccessorNode===!0&&e.constructor.prototype.isNode===!0||!1}function Sr(e){return e&&e.isArrayNode===!0&&e.constructor.prototype.isNode===!0||!1}function eN(e){return e&&e.isAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function tN(e){return e&&e.isBlockNode===!0&&e.constructor.prototype.isNode===!0||!1}function rN(e){return e&&e.isConditionalNode===!0&&e.constructor.prototype.isNode===!0||!1}function nt(e){return e&&e.isConstantNode===!0&&e.constructor.prototype.isNode===!0||!1}function Fc(e){return nt(e)||Ct(e)&&e.args.length===1&&nt(e.args[0])&&"-+~".includes(e.op)}function xo(e){return e&&e.isFunctionAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function Zn(e){return e&&e.isFunctionNode===!0&&e.constructor.prototype.isNode===!0||!1}function Da(e){return e&&e.isIndexNode===!0&&e.constructor.prototype.isNode===!0||!1}function ft(e){return e&&e.isNode===!0&&e.constructor.prototype.isNode===!0||!1}function mu(e){return e&&e.isObjectNode===!0&&e.constructor.prototype.isNode===!0||!1}function Ct(e){return e&&e.isOperatorNode===!0&&e.constructor.prototype.isNode===!0||!1}function An(e){return e&&e.isParenthesisNode===!0&&e.constructor.prototype.isNode===!0||!1}function nN(e){return e&&e.isRangeNode===!0&&e.constructor.prototype.isNode===!0||!1}function iN(e){return e&&e.isRelationalNode===!0&&e.constructor.prototype.isNode===!0||!1}function zt(e){return e&&e.isSymbolNode===!0&&e.constructor.prototype.isNode===!0||!1}function Pg(e){return e&&e.constructor.prototype.isChain===!0||!1}function dt(e){var t=typeof e;return t==="object"?e===null?"null":$e(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":t}function ze(e){var t=typeof e;if(t==="number"||t==="string"||t==="boolean"||e===null||e===void 0)return e;if(typeof e.clone=="function")return e.clone();if(Array.isArray(e))return e.map(function(r){return ze(r)});if(e instanceof Date)return new Date(e.valueOf());if($e(e))return e;if(pu(e))return aN(e,ze);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(e,")"))}function aN(e,t){var r={};for(var n in e)Me(e,n)&&(r[n]=t(e[n]));return r}function Vg(e,t){for(var r in t)Me(t,r)&&(e[r]=t[r]);return e}function Oi(e,t){var r,n,i;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;n++)if(!Oi(e[n],t[n]))return!1;return!0}else{if(typeof e=="function")return e===t;if(e instanceof Object){if(Array.isArray(t)||!(t instanceof Object))return!1;for(r in e)if(!(r in t)||!Oi(e[r],t[r]))return!1;for(r in t)if(!(r in e))return!1;return!0}else return e===t}}function oN(e,t,r){var n=!0,i;Object.defineProperty(e,t,{get:function(){return n&&(i=r(),n=!1),i},set:function(a){i=a,n=!1},configurable:!0,enumerable:!0})}function Me(e,t){return e&&Object.hasOwnProperty.call(e,t)}function sN(e,t){for(var r={},n=0;n<t.length;n++){var i=t[n],a=e[i];a!==void 0&&(r[i]=a)}return r}var uN=["Matrix","Array"],cN=["number","BigNumber","Fraction"],ve=function(e){if(e)throw new Error(`The global config is readonly.
|
|
2
2
|
Please create a mathjs instance if you want to change the default configuration.
|
|
3
3
|
Example:
|
|
4
4
|
|
|
5
5
|
import { create, all } from 'mathjs';
|
|
6
6
|
const mathjs = create(all);
|
|
7
7
|
mathjs.config({ number: 'BigNumber' });
|
|
8
|
-
`);return Object.freeze(zg)};Tt(ve,zg,{MATRIX_OPTIONS:oN,NUMBER_OPTIONS:sN});function Uf(){return!0}function Er(){return!1}function Qi(){}const $f="Argument is not a typed-function.";function Vg(){function e(B){return typeof B=="object"&&B!==null&&B.constructor===Object}const t=[{name:"number",test:function(B){return typeof B=="number"}},{name:"string",test:function(B){return typeof B=="string"}},{name:"boolean",test:function(B){return typeof B=="boolean"}},{name:"Function",test:function(B){return typeof B=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(B){return B instanceof Date}},{name:"RegExp",test:function(B){return B instanceof RegExp}},{name:"Object",test:e},{name:"null",test:function(B){return B===null}},{name:"undefined",test:function(B){return B===void 0}}],r={name:"any",test:Uf,isAny:!0};let n,i,a=0,o={createCount:0};function u(B){const j=n.get(B);if(j)return j;let Q='Unknown type "'+B+'"';const Z=B.toLowerCase();let ie;for(ie of i)if(ie.toLowerCase()===Z){Q+='. Did you mean "'+ie+'" ?';break}throw new TypeError(Q)}function c(B){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any";const Q=j?u(j).index:i.length,Z=[];for(let oe=0;oe<B.length;++oe){if(!B[oe]||typeof B[oe].name!="string"||typeof B[oe].test!="function")throw new TypeError("Object with properties {name: string, test: function} expected");const ye=B[oe].name;if(n.has(ye))throw new TypeError('Duplicate type name "'+ye+'"');Z.push(ye),n.set(ye,{name:ye,test:B[oe].test,isAny:B[oe].isAny,index:Q+oe,conversionsTo:[]})}const ie=i.slice(Q);i=i.slice(0,Q).concat(Z).concat(ie);for(let oe=Q+Z.length;oe<i.length;++oe)n.get(i[oe]).index=oe}function l(){n=new Map,i=[],a=0,c([r],!1)}l(),c(t);function s(){let B;for(B of i)n.get(B).conversionsTo=[];a=0}function f(B){const j=i.filter(Q=>{const Z=n.get(Q);return!Z.isAny&&Z.test(B)});return j.length?j:["any"]}function p(B){return B&&typeof B=="function"&&"_typedFunctionData"in B}function m(B,j,Q){if(!p(B))throw new TypeError($f);const Z=Q&&Q.exact,ie=Array.isArray(j)?j.join(","):j,oe=x(ie),ye=w(oe);if(!Z||ye in B.signatures){const je=B._typedFunctionData.signatureMap.get(ye);if(je)return je}const fe=oe.length;let De;if(Z){De=[];let je;for(je in B.signatures)De.push(B._typedFunctionData.signatureMap.get(je))}else De=B._typedFunctionData.signatures;for(let je=0;je<fe;++je){const Ze=oe[je],_e=[];let wt;for(wt of De){const M=A(wt.params,je);if(!(!M||Ze.restParam&&!M.restParam)){if(!M.hasAny){const X=g(M);if(Ze.types.some(pe=>!X.has(pe.name)))continue}_e.push(wt)}}if(De=_e,De.length===0)break}let Ne;for(Ne of De)if(Ne.params.length<=fe)return Ne;throw new TypeError("Signature not found (signature: "+(B.name||"unnamed")+"("+w(oe,", ")+"))")}function d(B,j,Q){return m(B,j,Q).implementation}function h(B,j){const Q=u(j);if(Q.test(B))return B;const Z=Q.conversionsTo;if(Z.length===0)throw new Error("There are no conversions to "+j+" defined.");for(let ie=0;ie<Z.length;ie++)if(u(Z[ie].from).test(B))return Z[ie].convert(B);throw new Error("Cannot convert "+B+" to "+j)}function w(B){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:",";return B.map(Q=>Q.name).join(j)}function v(B){const j=B.indexOf("...")===0,Q=(j?B.length>3?B.slice(3):"any":B).split("|").map(oe=>u(oe.trim()));let Z=!1,ie=j?"...":"";return{types:Q.map(function(oe){return Z=oe.isAny||Z,ie+=oe.name+"|",{name:oe.name,typeIndex:oe.index,test:oe.test,isAny:oe.isAny,conversion:null,conversionIndex:-1}}),name:ie.slice(0,-1),hasAny:Z,hasConversion:!1,restParam:j}}function b(B){const j=B.types.map(ye=>ye.name),Q=F(j);let Z=B.hasAny,ie=B.name;const oe=Q.map(function(ye){const fe=u(ye.from);return Z=fe.isAny||Z,ie+="|"+ye.from,{name:ye.from,typeIndex:fe.index,test:fe.test,isAny:fe.isAny,conversion:ye,conversionIndex:ye.index}});return{types:B.types.concat(oe),name:ie,hasAny:Z,hasConversion:oe.length>0,restParam:B.restParam}}function g(B){return B.typeSet||(B.typeSet=new Set,B.types.forEach(j=>B.typeSet.add(j.name))),B.typeSet}function x(B){const j=[];if(typeof B!="string")throw new TypeError("Signatures must be strings");const Q=B.trim();if(Q==="")return j;const Z=Q.split(",");for(let ie=0;ie<Z.length;++ie){const oe=v(Z[ie].trim());if(oe.restParam&&ie!==Z.length-1)throw new SyntaxError('Unexpected rest parameter "'+Z[ie]+'": only allowed for the last parameter');if(oe.types.length===0)return null;j.push(oe)}return j}function y(B){const j=ne(B);return j?j.restParam:!1}function N(B){if(!B||B.types.length===0)return Uf;if(B.types.length===1)return u(B.types[0].name).test;if(B.types.length===2){const j=u(B.types[0].name).test,Q=u(B.types[1].name).test;return function(Z){return j(Z)||Q(Z)}}else{const j=B.types.map(function(Q){return u(Q.name).test});return function(Q){for(let Z=0;Z<j.length;Z++)if(j[Z](Q))return!0;return!1}}}function E(B){let j,Q,Z;if(y(B)){j=de(B).map(N);const ie=j.length,oe=N(ne(B)),ye=function(fe){for(let De=ie;De<fe.length;De++)if(!oe(fe[De]))return!1;return!0};return function(fe){for(let De=0;De<j.length;De++)if(!j[De](fe[De]))return!1;return ye(fe)&&fe.length>=ie+1}}else return B.length===0?function(ie){return ie.length===0}:B.length===1?(Q=N(B[0]),function(ie){return Q(ie[0])&&ie.length===1}):B.length===2?(Q=N(B[0]),Z=N(B[1]),function(ie){return Q(ie[0])&&Z(ie[1])&&ie.length===2}):(j=B.map(N),function(ie){for(let oe=0;oe<j.length;oe++)if(!j[oe](ie[oe]))return!1;return ie.length===j.length})}function A(B,j){return j<B.length?B[j]:y(B)?ne(B):null}function D(B,j){const Q=A(B,j);return Q?g(Q):new Set}function S(B){return B.conversion===null||B.conversion===void 0}function C(B,j){const Q=new Set;return B.forEach(Z=>{const ie=D(Z.params,j);let oe;for(oe of ie)Q.add(oe)}),Q.has("any")?["any"]:Array.from(Q)}function _(B,j,Q){let Z,ie;const oe=B||"unnamed";let ye=Q,fe;for(fe=0;fe<j.length;fe++){const Ze=[];if(ye.forEach(_e=>{const wt=A(_e.params,fe),M=N(wt);(fe<_e.params.length||y(_e.params))&&M(j[fe])&&Ze.push(_e)}),Ze.length===0){if(ie=C(ye,fe),ie.length>0){const _e=f(j[fe]);return Z=new TypeError("Unexpected type of argument in function "+oe+" (expected: "+ie.join(" or ")+", actual: "+_e.join(" | ")+", index: "+fe+")"),Z.data={category:"wrongType",fn:oe,index:fe,actual:_e,expected:ie},Z}}else ye=Ze}const De=ye.map(function(Ze){return y(Ze.params)?1/0:Ze.params.length});if(j.length<Math.min.apply(null,De))return ie=C(ye,fe),Z=new TypeError("Too few arguments in function "+oe+" (expected: "+ie.join(" or ")+", index: "+j.length+")"),Z.data={category:"tooFewArgs",fn:oe,index:j.length,expected:ie},Z;const Ne=Math.max.apply(null,De);if(j.length>Ne)return Z=new TypeError("Too many arguments in function "+oe+" (expected: "+Ne+", actual: "+j.length+")"),Z.data={category:"tooManyArgs",fn:oe,index:j.length,expectedLength:Ne},Z;const je=[];for(let Ze=0;Ze<j.length;++Ze)je.push(f(j[Ze]).join("|"));return Z=new TypeError('Arguments of type "'+je.join(", ")+'" do not match any of the defined signatures of function '+oe+"."),Z.data={category:"mismatch",actual:je},Z}function R(B){let j=i.length+1;for(let Q=0;Q<B.types.length;Q++)S(B.types[Q])&&(j=Math.min(j,B.types[Q].typeIndex));return j}function P(B){let j=a+1;for(let Q=0;Q<B.types.length;Q++)S(B.types[Q])||(j=Math.min(j,B.types[Q].conversionIndex));return j}function I(B,j){if(B.hasAny){if(!j.hasAny)return 1}else if(j.hasAny)return-1;if(B.restParam){if(!j.restParam)return 1}else if(j.restParam)return-1;if(B.hasConversion){if(!j.hasConversion)return 1}else if(j.hasConversion)return-1;const Q=R(B)-R(j);if(Q<0)return-1;if(Q>0)return 1;const Z=P(B)-P(j);return Z<0?-1:Z>0?1:0}function O(B,j){const Q=B.params,Z=j.params,ie=ne(Q),oe=ne(Z),ye=y(Q),fe=y(Z);if(ye&&ie.hasAny){if(!fe||!oe.hasAny)return 1}else if(fe&&oe.hasAny)return-1;let De=0,Ne=0,je;for(je of Q)je.hasAny&&++De,je.hasConversion&&++Ne;let Ze=0,_e=0;for(je of Z)je.hasAny&&++Ze,je.hasConversion&&++_e;if(De!==Ze)return De-Ze;if(ye&&ie.hasConversion){if(!fe||!oe.hasConversion)return 1}else if(fe&&oe.hasConversion)return-1;if(Ne!==_e)return Ne-_e;if(ye){if(!fe)return 1}else if(fe)return-1;const wt=(Q.length-Z.length)*(ye?-1:1);if(wt!==0)return wt;const M=[];let X=0;for(let Ee=0;Ee<Q.length;++Ee){const Re=I(Q[Ee],Z[Ee]);M.push(Re),X+=Re}if(X!==0)return X;let pe;for(pe of M)if(pe!==0)return pe;return 0}function F(B){if(B.length===0)return[];const j=B.map(u);B.length>1&&j.sort((ie,oe)=>ie.index-oe.index);let Q=j[0].conversionsTo;if(B.length===1)return Q;Q=Q.concat([]);const Z=new Set(B);for(let ie=1;ie<j.length;++ie){let oe;for(oe of j[ie].conversionsTo)Z.has(oe.from)||(Q.push(oe),Z.add(oe.from))}return Q}function q(B,j){let Q=j;if(B.some(ie=>ie.hasConversion)){const ie=y(B),oe=B.map(k);Q=function(){const ye=[],fe=ie?arguments.length-1:arguments.length;for(let De=0;De<fe;De++)ye[De]=oe[De](arguments[De]);return ie&&(ye[fe]=arguments[fe].map(oe[fe])),j.apply(this,ye)}}let Z=Q;if(y(B)){const ie=B.length-1;Z=function(){return Q.apply(this,ce(arguments,0,ie).concat([ce(arguments,ie)]))}}return Z}function k(B){let j,Q,Z,ie;const oe=[],ye=[];switch(B.types.forEach(function(fe){fe.conversion&&(oe.push(u(fe.conversion.from).test),ye.push(fe.conversion.convert))}),ye.length){case 0:return function(fe){return fe};case 1:return j=oe[0],Z=ye[0],function(fe){return j(fe)?Z(fe):fe};case 2:return j=oe[0],Q=oe[1],Z=ye[0],ie=ye[1],function(fe){return j(fe)?Z(fe):Q(fe)?ie(fe):fe};default:return function(fe){for(let De=0;De<ye.length;De++)if(oe[De](fe))return ye[De](fe);return fe}}}function te(B){function j(Q,Z,ie){if(Z<Q.length){const oe=Q[Z];let ye=[];if(oe.restParam){const fe=oe.types.filter(S);fe.length<oe.types.length&&ye.push({types:fe,name:"..."+fe.map(De=>De.name).join("|"),hasAny:fe.some(De=>De.isAny),hasConversion:!1,restParam:!0}),ye.push(oe)}else ye=oe.types.map(function(fe){return{types:[fe],name:fe.name,hasAny:fe.isAny,hasConversion:fe.conversion,restParam:!1}});return he(ye,function(fe){return j(Q,Z+1,ie.concat([fe]))})}else return[ie]}return j(B,0,[])}function se(B,j){const Q=Math.max(B.length,j.length);for(let fe=0;fe<Q;fe++){const De=D(B,fe),Ne=D(j,fe);let je=!1,Ze;for(Ze of Ne)if(De.has(Ze)){je=!0;break}if(!je)return!1}const Z=B.length,ie=j.length,oe=y(B),ye=y(j);return oe?ye?Z===ie:ie>=Z:ye?Z>=ie:Z===ie}function K(B){return B.map(j=>J(j)?T(j.referToSelf.callback):z(j)?$(j.referTo.references,j.referTo.callback):j)}function V(B,j,Q){const Z=[];let ie;for(ie of B){let oe=Q[ie];if(typeof oe!="number")throw new TypeError('No definition for referenced signature "'+ie+'"');if(oe=j[oe],typeof oe!="function")return!1;Z.push(oe)}return Z}function ue(B,j,Q){const Z=K(B),ie=new Array(Z.length).fill(!1);let oe=!0;for(;oe;){oe=!1;let ye=!0;for(let fe=0;fe<Z.length;++fe){if(ie[fe])continue;const De=Z[fe];if(J(De))Z[fe]=De.referToSelf.callback(Q),Z[fe].referToSelf=De.referToSelf,ie[fe]=!0,ye=!1;else if(z(De)){const Ne=V(De.referTo.references,Z,j);Ne?(Z[fe]=De.referTo.callback.apply(this,Ne),Z[fe].referTo=De.referTo,ie[fe]=!0,ye=!1):oe=!0}}if(ye&&oe)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return Z}function me(B){const j=/\bthis(\(|\.signatures\b)/;Object.keys(B).forEach(Q=>{const Z=B[Q];if(j.test(Z.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 re(B,j){if(o.createCount++,Object.keys(j).length===0)throw new SyntaxError("No signatures provided");o.warnAgainstDeprecatedThis&&me(j);const Q=[],Z=[],ie={},oe=[];let ye;for(ye in j){if(!Object.prototype.hasOwnProperty.call(j,ye))continue;const ut=x(ye);if(!ut)continue;Q.forEach(function(Va){if(se(Va,ut))throw new TypeError('Conflicting signatures "'+w(Va)+'" and "'+w(ut)+'".')}),Q.push(ut);const mn=Z.length;Z.push(j[ye]);const jw=ut.map(b);let jo;for(jo of te(jw)){const Va=w(jo);oe.push({params:jo,name:Va,fn:mn}),jo.every(Lw=>!Lw.hasConversion)&&(ie[Va]=mn)}}oe.sort(O);const fe=ue(Z,ie,Pa);let De;for(De in ie)Object.prototype.hasOwnProperty.call(ie,De)&&(ie[De]=fe[ie[De]]);const Ne=[],je=new Map;for(De of oe)je.has(De.name)||(De.fn=fe[De.fn],Ne.push(De),je.set(De.name,De));const Ze=Ne[0]&&Ne[0].params.length<=2&&!y(Ne[0].params),_e=Ne[1]&&Ne[1].params.length<=2&&!y(Ne[1].params),wt=Ne[2]&&Ne[2].params.length<=2&&!y(Ne[2].params),M=Ne[3]&&Ne[3].params.length<=2&&!y(Ne[3].params),X=Ne[4]&&Ne[4].params.length<=2&&!y(Ne[4].params),pe=Ne[5]&&Ne[5].params.length<=2&&!y(Ne[5].params),Ee=Ze&&_e&&wt&&M&&X&&pe;for(let ut=0;ut<Ne.length;++ut)Ne[ut].test=E(Ne[ut].params);const Re=Ze?N(Ne[0].params[0]):Er,Je=_e?N(Ne[1].params[0]):Er,vr=wt?N(Ne[2].params[0]):Er,rc=M?N(Ne[3].params[0]):Er,dw=X?N(Ne[4].params[0]):Er,hw=pe?N(Ne[5].params[0]):Er,gw=Ze?N(Ne[0].params[1]):Er,vw=_e?N(Ne[1].params[1]):Er,yw=wt?N(Ne[2].params[1]):Er,xw=M?N(Ne[3].params[1]):Er,bw=X?N(Ne[4].params[1]):Er,ww=pe?N(Ne[5].params[1]):Er;for(let ut=0;ut<Ne.length;++ut)Ne[ut].implementation=q(Ne[ut].params,Ne[ut].fn);const Nw=Ze?Ne[0].implementation:Qi,Dw=_e?Ne[1].implementation:Qi,Ew=wt?Ne[2].implementation:Qi,Aw=M?Ne[3].implementation:Qi,Sw=X?Ne[4].implementation:Qi,Cw=pe?Ne[5].implementation:Qi,Mw=Ze?Ne[0].params.length:-1,_w=_e?Ne[1].params.length:-1,Fw=wt?Ne[2].params.length:-1,Tw=M?Ne[3].params.length:-1,Ow=X?Ne[4].params.length:-1,Bw=pe?Ne[5].params.length:-1,kw=Ee?6:0,Iw=Ne.length,Rw=Ne.map(ut=>ut.test),qw=Ne.map(ut=>ut.implementation),zw=function(){for(let ut=kw;ut<Iw;ut++)if(Rw[ut](arguments))return qw[ut].apply(this,arguments);return o.onMismatch(B,arguments,Ne)};function Pa(ut,mn){return arguments.length===Mw&&Re(ut)&&gw(mn)?Nw.apply(this,arguments):arguments.length===_w&&Je(ut)&&vw(mn)?Dw.apply(this,arguments):arguments.length===Fw&&vr(ut)&&yw(mn)?Ew.apply(this,arguments):arguments.length===Tw&&rc(ut)&&xw(mn)?Aw.apply(this,arguments):arguments.length===Ow&&dw(ut)&&bw(mn)?Sw.apply(this,arguments):arguments.length===Bw&&hw(ut)&&ww(mn)?Cw.apply(this,arguments):zw.apply(this,arguments)}try{Object.defineProperty(Pa,"name",{value:B})}catch{}return Pa.signatures=ie,Pa._typedFunctionData={signatures:Ne,signatureMap:je},Pa}function ae(B,j,Q){throw _(B,j,Q)}function de(B){return ce(B,0,B.length-1)}function ne(B){return B[B.length-1]}function ce(B,j,Q){return Array.prototype.slice.call(B,j,Q)}function le(B,j){for(let Q=0;Q<B.length;Q++)if(j(B[Q]))return B[Q]}function he(B,j){return Array.prototype.concat.apply([],B.map(j))}function be(){const B=de(arguments).map(Q=>w(x(Q))),j=ne(arguments);if(typeof j!="function")throw new TypeError("Callback function expected as last argument");return $(B,j)}function $(B,j){return{referTo:{references:B,callback:j}}}function T(B){if(typeof B!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:B}}}function z(B){return B&&typeof B.referTo=="object"&&Array.isArray(B.referTo.references)&&typeof B.referTo.callback=="function"}function J(B){return B&&typeof B.referToSelf=="object"&&typeof B.referToSelf.callback=="function"}function L(B,j){if(!B)return j;if(j&&j!==B){const Q=new Error("Function names do not match (expected: "+B+", actual: "+j+")");throw Q.data={actual:j,expected:B},Q}return B}function H(B){let j;for(const Q in B)Object.prototype.hasOwnProperty.call(B,Q)&&(p(B[Q])||typeof B[Q].signature=="string")&&(j=L(j,B[Q].name));return j}function G(B,j){let Q;for(Q in j)if(Object.prototype.hasOwnProperty.call(j,Q)){if(Q in B&&j[Q]!==B[Q]){const Z=new Error('Signature "'+Q+'" is defined twice');throw Z.data={signature:Q,sourceFunction:j[Q],destFunction:B[Q]},Z}B[Q]=j[Q]}}const Y=o;o=function(B){const j=typeof B=="string",Q=j?1:0;let Z=j?B:"";const ie={};for(let oe=Q;oe<arguments.length;++oe){const ye=arguments[oe];let fe={},De;if(typeof ye=="function"?(De=ye.name,typeof ye.signature=="string"?fe[ye.signature]=ye:p(ye)&&(fe=ye.signatures)):e(ye)&&(fe=ye,j||(De=H(ye))),Object.keys(fe).length===0){const Ne=new TypeError("Argument to 'typed' at index "+oe+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw Ne.data={index:oe,argument:ye},Ne}j||(Z=L(Z,De)),G(ie,fe)}return re(Z||"",ie)},o.create=Vg,o.createCount=Y.createCount,o.onMismatch=ae,o.throwMismatchError=ae,o.createError=_,o.clear=l,o.clearConversions=s,o.addTypes=c,o._findType=u,o.referTo=be,o.referToSelf=T,o.convert=h,o.findSignature=m,o.find=d,o.isTypedFunction=p,o.warnAgainstDeprecatedThis=!0,o.addType=function(B,j){let Q="any";j!==!1&&n.has("Object")&&(Q="Object"),o.addTypes([B],Q)};function ee(B){if(!B||typeof B.from!="string"||typeof B.to!="string"||typeof B.convert!="function")throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(B.to===B.from)throw new SyntaxError('Illegal to define conversion from "'+B.from+'" to itself.')}return o.addConversion=function(B){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{override:!1};ee(B);const Q=u(B.to),Z=Q.conversionsTo.find(ie=>ie.from===B.from);if(Z)if(j&&j.override)o.removeConversion({from:Z.from,to:B.to,convert:Z.convert});else throw new Error('There is already a conversion from "'+B.from+'" to "'+Q.name+'"');Q.conversionsTo.push({from:B.from,convert:B.convert,index:a++})},o.addConversions=function(B,j){B.forEach(Q=>o.addConversion(Q,j))},o.removeConversion=function(B){ee(B);const j=u(B.to),Q=le(j.conversionsTo,ie=>ie.from===B.from);if(!Q)throw new Error("Attempt to remove nonexistent conversion from "+B.from+" to "+B.to);if(Q.convert!==B.convert)throw new Error("Conversion to remove does not match existing conversion");const Z=j.conversionsTo.indexOf(Q);j.conversionsTo.splice(Z,1)},o.resolve=function(B,j){if(!p(B))throw new TypeError($f);const Q=B._typedFunctionData.signatures;for(let Z=0;Z<Q.length;++Z)if(Q[Z].test(j))return Q[Z];return null},o}const ea=Vg();function Fe(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}var Wn=Math.sign||function(e){return e>0?1:e<0?-1:0},uN=Math.log2||function(e){return Math.log(e)/Math.LN2},cN=Math.log10||function(e){return Math.log(e)/Math.LN10},lN=Math.log1p||function(e){return Math.log(e+1)},fN=Math.cbrt||function(e){if(e===0)return e;var t=e<0,r;return t&&(e=-e),isFinite(e)?(r=Math.exp(Math.log(e)/3),r=(e/(r*r)+2*r)/3):r=e,t?-r:r},pN=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function ac(e,t,r){var n={2:"0b",8:"0o",16:"0x"},i=n[t],a="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!Fe(r))throw new Error("size must be an integer");if(e>2**(r-1)-1||e<-(2**(r-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!Fe(e))throw new Error("Value must be an integer");e<0&&(e=e+2**r),a="i".concat(r)}var o="";return e<0&&(e=-e,o="-"),"".concat(o).concat(i).concat(e.toString(t)).concat(a)}function Di(e,t){if(typeof t=="function")return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var{notation:r,precision:n,wordSize:i}=Ug(t);switch(r){case"fixed":return $g(e,n);case"exponential":return Hg(e,n);case"engineering":return mN(e,n);case"bin":return ac(e,2,i);case"oct":return ac(e,8,i);case"hex":return ac(e,16,i);case"auto":return dN(e,n,t).replace(/((\.\d*?)(0+))($|e)/,function(){var a=arguments[2],o=arguments[4];return a!=="."?a+o:o});default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Ug(e){var t="auto",r,n;if(e!==void 0)if(Ue(e))r=e;else if($e(e))r=e.toNumber();else if(fu(e))e.precision!==void 0&&(r=Hf(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),e.wordSize!==void 0&&(n=Hf(e.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),e.notation&&(t=e.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:t,precision:r,wordSize:n}}function bo(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var r=t[1],n=t[2],i=parseFloat(t[4]||"0"),a=n.indexOf(".");i+=a!==-1?a-1:n.length-1;var o=n.replace(".","").replace(/^0*/,function(u){return i-=u.length,""}).replace(/0*$/,"").split("").map(function(u){return parseInt(u)});return o.length===0&&(o.push(0),i++),{sign:r,coefficients:o,exponent:i}}function mN(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=bo(e),n=mu(r,t),i=n.exponent,a=n.coefficients,o=i%3===0?i:i<0?i-3-i%3:i-i%3;if(Ue(t))for(;t>a.length||i-o+1>a.length;)a.push(0);else for(var u=Math.abs(i-o)-(a.length-1),c=0;c<u;c++)a.push(0);for(var l=Math.abs(i-o),s=1;l>0;)s++,l--;var f=a.slice(s).join(""),p=Ue(t)&&f.length||f.match(/[1-9]/)?"."+f:"",m=a.slice(0,s).join("")+p+"e"+(i>=0?"+":"")+o.toString();return n.sign+m}function $g(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=bo(e),n=typeof t=="number"?mu(r,r.exponent+1+t):r,i=n.coefficients,a=n.exponent+1,o=a+(t||0);return i.length<o&&(i=i.concat(na(o-i.length))),a<0&&(i=na(-a+1).concat(i),a=1),a<i.length&&i.splice(a,0,a===0?"0.":"."),n.sign+i.join("")}function Hg(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=bo(e),n=t?mu(r,t):r,i=n.coefficients,a=n.exponent;i.length<t&&(i=i.concat(na(t-i.length)));var o=i.shift();return n.sign+o+(i.length>0?"."+i.join(""):"")+"e"+(a>=0?"+":"")+a}function dN(e,t,r){if(isNaN(e)||!isFinite(e))return String(e);var n=Jf(r==null?void 0:r.lowerExp,-3),i=Jf(r==null?void 0:r.upperExp,5),a=bo(e),o=t?mu(a,t):a;if(o.exponent<n||o.exponent>=i)return Hg(e,t);var u=o.coefficients,c=o.exponent;u.length<t&&(u=u.concat(na(t-u.length))),u=u.concat(na(c-u.length+1+(u.length<t?t-u.length:0))),u=na(-c).concat(u);var l=c>0?c:0;return l<u.length-1&&u.splice(l+1,0,"."),o.sign+u.join("")}function mu(e,t){for(var r={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},n=r.coefficients;t<=0;)n.unshift(0),r.exponent++,t++;if(n.length>t){var i=n.splice(t,n.length-t);if(i[0]>=5){var a=t-1;for(n[a]++;n[a]===10;)n.pop(),a===0&&(n.unshift(0),r.exponent++,a++),a--,n[a]++}}return r}function na(e){for(var t=[],r=0;r<e;r++)t.push(0);return t}function hN(e){return e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length}var gN=Number.EPSILON||2220446049250313e-31;function sr(e,t,r){if(r==null)return e===t;if(e===t)return!0;if(isNaN(e)||isNaN(t))return!1;if(isFinite(e)&&isFinite(t)){var n=Math.abs(e-t);return n<=gN?!0:n<=Math.max(Math.abs(e),Math.abs(t))*r}return!1}var vN=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)},yN=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},xN=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},bN=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},wN=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},NN=Math.tanh||function(e){var t=Math.exp(2*e);return(t-1)/(t+1)};function DN(e,t){var r=!0,n=t>0?!0:t<0?!1:1/t===1/0;return r^n?-e:e}function Hf(e,t){if(Ue(e))return e;if($e(e))return e.toNumber();t()}function Jf(e,t){return Ue(e)?e:$e(e)?e.toNumber():t}function U(e,t,r,n){function i(a){var o=aN(a,t.map(SN));return EN(e,t,a),r(o)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),n&&(i.meta=n),i}function EN(e,t,r){var n=t.filter(a=>!AN(a)).every(a=>r[a]!==void 0);if(!n){var i=t.filter(a=>r[a]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(i.map(a=>'"'.concat(a,'"')).join(", "),"."))}}function AN(e){return e&&e[0]==="?"}function SN(e){return e&&e[0]==="?"?e.slice(1):e}function nr(e,t){if(Gg(e)&&Jg(e,t))return e[t];throw typeof e[t]=="function"&&xl(e,t)?new Error('Cannot access method "'+t+'" as a property'):new Error('No access to property "'+t+'"')}function fa(e,t,r){if(Gg(e)&&Jg(e,t))return e[t]=r,r;throw new Error('No access to property "'+t+'"')}function CN(e,t){return t in e}function Jg(e,t){return!e||typeof e!="object"?!1:Me(_N,t)?!0:!(t in Object.prototype||t in Function.prototype)}function MN(e,t){if(!xl(e,t))throw new Error('No access to method "'+t+'"');return e[t]}function xl(e,t){return e==null||typeof e[t]!="function"||Me(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)?!1:Me(FN,t)?!0:!(t in Object.prototype||t in Function.prototype)}function Gg(e){return typeof e=="object"&&e&&e.constructor===Object}var _N={length:!0,name:!0},FN={toString:!0,valueOf:!0,toLocaleString:!0};class du{constructor(t){this.wrappedObject=t,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(t){return nr(this.wrappedObject,t)}set(t,r){return fa(this.wrappedObject,t,r),this}has(t){return CN(this.wrappedObject,t)}entries(){return Kg(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var r of this.keys())t(this.get(r),r,this)}delete(t){delete this.wrappedObject[t]}clear(){for(var t of this.keys())this.delete(t)}get size(){return Object.keys(this.wrappedObject).length}}class Wg{constructor(t,r,n){this.a=t,this.b=r,this.bKeys=n,this[Symbol.iterator]=this.entries}get(t){return this.bKeys.has(t)?this.b.get(t):this.a.get(t)}set(t,r){return this.bKeys.has(t)?this.b.set(t,r):this.a.set(t,r),this}has(t){return this.b.has(t)||this.a.has(t)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return Kg(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var r of this.keys())t(this.get(r),r,this)}delete(t){return this.bKeys.has(t)?this.b.delete(t):this.a.delete(t)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}}function Kg(e,t){return{next:()=>{var r=e.next();return r.done?r:{value:t(r.value),done:!1}}}}function io(){return new Map}function ia(e){if(!e)return io();if(Qg(e))return e;if(fu(e))return new du(e);throw new Error("createMap can create maps from objects or Maps")}function TN(e){if(e instanceof du)return e.wrappedObject;var t={};for(var r of e.keys()){var n=e.get(r);fa(t,r,n)}return t}function Qg(e){return e?e instanceof Map||e instanceof du||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}var Zg=function(){return Zg=ea.create,ea},ON=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],BN=U("typed",ON,function(e){var{BigNumber:t,Complex:r,DenseMatrix:n,Fraction:i}=e,a=Zg();return a.clear(),a.addTypes([{name:"number",test:Ue},{name:"Complex",test:wn},{name:"BigNumber",test:$e},{name:"Fraction",test:yo},{name:"Unit",test:Cr},{name:"identifier",test:o=>Qt&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\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\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\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\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\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\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(o)},{name:"string",test:Qt},{name:"Chain",test:Lg},{name:"Array",test:st},{name:"Matrix",test:ke},{name:"DenseMatrix",test:Ms},{name:"SparseMatrix",test:wi},{name:"Range",test:yl},{name:"Index",test:lu},{name:"boolean",test:Hw},{name:"ResultSet",test:Jw},{name:"Help",test:jg},{name:"function",test:Gw},{name:"Date",test:Ww},{name:"RegExp",test:Kw},{name:"null",test:Qw},{name:"undefined",test:Zw},{name:"AccessorNode",test:Ti},{name:"ArrayNode",test:Sr},{name:"AssignmentNode",test:Xw},{name:"BlockNode",test:Yw},{name:"ConditionalNode",test:eN},{name:"ConstantNode",test:nt},{name:"FunctionNode",test:Zn},{name:"FunctionAssignmentNode",test:xo},{name:"IndexNode",test:Na},{name:"Node",test:ft},{name:"ObjectNode",test:pu},{name:"OperatorNode",test:Ct},{name:"ParenthesisNode",test:An},{name:"RangeNode",test:tN},{name:"RelationalNode",test:rN},{name:"SymbolNode",test:zt},{name:"Map",test:Qg},{name:"Object",test:fu}]),a.addConversions([{from:"number",to:"BigNumber",convert:function(o){if(t||oc(o),hN(o)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+o+"). Use function bignumber(x) to convert to BigNumber.");return new t(o)}},{from:"number",to:"Complex",convert:function(o){return r||Vo(o),new r(o,0)}},{from:"BigNumber",to:"Complex",convert:function(o){return r||Vo(o),new r(o.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(o){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(o){return r||Vo(o),new r(o.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(o){i||sc(o);var u=new i(o);if(u.valueOf()!==o)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+o+"). Use function fraction(x) to convert to Fraction.");return u}},{from:"string",to:"number",convert:function(o){var u=Number(o);if(isNaN(u))throw new Error('Cannot convert "'+o+'" to a number');return u}},{from:"string",to:"BigNumber",convert:function(o){t||oc(o);try{return new t(o)}catch{throw new Error('Cannot convert "'+o+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(o){i||sc(o);try{return new i(o)}catch{throw new Error('Cannot convert "'+o+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(o){r||Vo(o);try{return new r(o)}catch{throw new Error('Cannot convert "'+o+'" to Complex')}}},{from:"boolean",to:"number",convert:function(o){return+o}},{from:"boolean",to:"BigNumber",convert:function(o){return t||oc(o),new t(+o)}},{from:"boolean",to:"Fraction",convert:function(o){return i||sc(o),new i(+o)}},{from:"boolean",to:"string",convert:function(o){return String(o)}},{from:"Array",to:"Matrix",convert:function(o){return n||kN(),new n(o)}},{from:"Matrix",to:"Array",convert:function(o){return o.valueOf()}}]),a.onMismatch=(o,u,c)=>{var l=a.createError(o,u,c);if(["wrongType","mismatch"].includes(l.data.category)&&u.length===1&&Fr(u[0])&&c.some(f=>!f.params.includes(","))){var s=new TypeError("Function '".concat(o,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(o,")'."));throw s.data=l.data,s}throw l},a.onMismatch=(o,u,c)=>{var l=a.createError(o,u,c);if(["wrongType","mismatch"].includes(l.data.category)&&u.length===1&&Fr(u[0])&&c.some(f=>!f.params.includes(","))){var s=new TypeError("Function '".concat(o,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(o,")'."));throw s.data=l.data,s}throw l},a});function oc(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function Vo(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function kN(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function sc(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var IN="ResultSet",RN=[],qN=U(IN,RN,()=>{function e(t){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=t||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(t){return new e(t.entries)},e},{isClass:!0});/*!
|
|
8
|
+
`);return Object.freeze(jg)};Tt(ve,jg,{MATRIX_OPTIONS:uN,NUMBER_OPTIONS:cN});function $f(){return!0}function Er(){return!1}function Qi(){}const Hf="Argument is not a typed-function.";function Ug(){function e(B){return typeof B=="object"&&B!==null&&B.constructor===Object}const t=[{name:"number",test:function(B){return typeof B=="number"}},{name:"string",test:function(B){return typeof B=="string"}},{name:"boolean",test:function(B){return typeof B=="boolean"}},{name:"Function",test:function(B){return typeof B=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(B){return B instanceof Date}},{name:"RegExp",test:function(B){return B instanceof RegExp}},{name:"Object",test:e},{name:"null",test:function(B){return B===null}},{name:"undefined",test:function(B){return B===void 0}}],r={name:"any",test:$f,isAny:!0};let n,i,a=0,o={createCount:0};function u(B){const j=n.get(B);if(j)return j;let Q='Unknown type "'+B+'"';const Z=B.toLowerCase();let ie;for(ie of i)if(ie.toLowerCase()===Z){Q+='. Did you mean "'+ie+'" ?';break}throw new TypeError(Q)}function c(B){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any";const Q=j?u(j).index:i.length,Z=[];for(let oe=0;oe<B.length;++oe){if(!B[oe]||typeof B[oe].name!="string"||typeof B[oe].test!="function")throw new TypeError("Object with properties {name: string, test: function} expected");const ye=B[oe].name;if(n.has(ye))throw new TypeError('Duplicate type name "'+ye+'"');Z.push(ye),n.set(ye,{name:ye,test:B[oe].test,isAny:B[oe].isAny,index:Q+oe,conversionsTo:[]})}const ie=i.slice(Q);i=i.slice(0,Q).concat(Z).concat(ie);for(let oe=Q+Z.length;oe<i.length;++oe)n.get(i[oe]).index=oe}function l(){n=new Map,i=[],a=0,c([r],!1)}l(),c(t);function s(){let B;for(B of i)n.get(B).conversionsTo=[];a=0}function f(B){const j=i.filter(Q=>{const Z=n.get(Q);return!Z.isAny&&Z.test(B)});return j.length?j:["any"]}function p(B){return B&&typeof B=="function"&&"_typedFunctionData"in B}function m(B,j,Q){if(!p(B))throw new TypeError(Hf);const Z=Q&&Q.exact,ie=Array.isArray(j)?j.join(","):j,oe=b(ie),ye=w(oe);if(!Z||ye in B.signatures){const je=B._typedFunctionData.signatureMap.get(ye);if(je)return je}const fe=oe.length;let De;if(Z){De=[];let je;for(je in B.signatures)De.push(B._typedFunctionData.signatureMap.get(je))}else De=B._typedFunctionData.signatures;for(let je=0;je<fe;++je){const Ze=oe[je],_e=[];let wt;for(wt of De){const M=A(wt.params,je);if(!(!M||Ze.restParam&&!M.restParam)){if(!M.hasAny){const X=g(M);if(Ze.types.some(pe=>!X.has(pe.name)))continue}_e.push(wt)}}if(De=_e,De.length===0)break}let Ne;for(Ne of De)if(Ne.params.length<=fe)return Ne;throw new TypeError("Signature not found (signature: "+(B.name||"unnamed")+"("+w(oe,", ")+"))")}function d(B,j,Q){return m(B,j,Q).implementation}function h(B,j){const Q=u(j);if(Q.test(B))return B;const Z=Q.conversionsTo;if(Z.length===0)throw new Error("There are no conversions to "+j+" defined.");for(let ie=0;ie<Z.length;ie++)if(u(Z[ie].from).test(B))return Z[ie].convert(B);throw new Error("Cannot convert "+B+" to "+j)}function w(B){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:",";return B.map(Q=>Q.name).join(j)}function v(B){const j=B.indexOf("...")===0,Q=(j?B.length>3?B.slice(3):"any":B).split("|").map(oe=>u(oe.trim()));let Z=!1,ie=j?"...":"";return{types:Q.map(function(oe){return Z=oe.isAny||Z,ie+=oe.name+"|",{name:oe.name,typeIndex:oe.index,test:oe.test,isAny:oe.isAny,conversion:null,conversionIndex:-1}}),name:ie.slice(0,-1),hasAny:Z,hasConversion:!1,restParam:j}}function x(B){const j=B.types.map(ye=>ye.name),Q=F(j);let Z=B.hasAny,ie=B.name;const oe=Q.map(function(ye){const fe=u(ye.from);return Z=fe.isAny||Z,ie+="|"+ye.from,{name:ye.from,typeIndex:fe.index,test:fe.test,isAny:fe.isAny,conversion:ye,conversionIndex:ye.index}});return{types:B.types.concat(oe),name:ie,hasAny:Z,hasConversion:oe.length>0,restParam:B.restParam}}function g(B){return B.typeSet||(B.typeSet=new Set,B.types.forEach(j=>B.typeSet.add(j.name))),B.typeSet}function b(B){const j=[];if(typeof B!="string")throw new TypeError("Signatures must be strings");const Q=B.trim();if(Q==="")return j;const Z=Q.split(",");for(let ie=0;ie<Z.length;++ie){const oe=v(Z[ie].trim());if(oe.restParam&&ie!==Z.length-1)throw new SyntaxError('Unexpected rest parameter "'+Z[ie]+'": only allowed for the last parameter');if(oe.types.length===0)return null;j.push(oe)}return j}function y(B){const j=ne(B);return j?j.restParam:!1}function N(B){if(!B||B.types.length===0)return $f;if(B.types.length===1)return u(B.types[0].name).test;if(B.types.length===2){const j=u(B.types[0].name).test,Q=u(B.types[1].name).test;return function(Z){return j(Z)||Q(Z)}}else{const j=B.types.map(function(Q){return u(Q.name).test});return function(Q){for(let Z=0;Z<j.length;Z++)if(j[Z](Q))return!0;return!1}}}function E(B){let j,Q,Z;if(y(B)){j=de(B).map(N);const ie=j.length,oe=N(ne(B)),ye=function(fe){for(let De=ie;De<fe.length;De++)if(!oe(fe[De]))return!1;return!0};return function(fe){for(let De=0;De<j.length;De++)if(!j[De](fe[De]))return!1;return ye(fe)&&fe.length>=ie+1}}else return B.length===0?function(ie){return ie.length===0}:B.length===1?(Q=N(B[0]),function(ie){return Q(ie[0])&&ie.length===1}):B.length===2?(Q=N(B[0]),Z=N(B[1]),function(ie){return Q(ie[0])&&Z(ie[1])&&ie.length===2}):(j=B.map(N),function(ie){for(let oe=0;oe<j.length;oe++)if(!j[oe](ie[oe]))return!1;return ie.length===j.length})}function A(B,j){return j<B.length?B[j]:y(B)?ne(B):null}function D(B,j){const Q=A(B,j);return Q?g(Q):new Set}function S(B){return B.conversion===null||B.conversion===void 0}function C(B,j){const Q=new Set;return B.forEach(Z=>{const ie=D(Z.params,j);let oe;for(oe of ie)Q.add(oe)}),Q.has("any")?["any"]:Array.from(Q)}function _(B,j,Q){let Z,ie;const oe=B||"unnamed";let ye=Q,fe;for(fe=0;fe<j.length;fe++){const Ze=[];if(ye.forEach(_e=>{const wt=A(_e.params,fe),M=N(wt);(fe<_e.params.length||y(_e.params))&&M(j[fe])&&Ze.push(_e)}),Ze.length===0){if(ie=C(ye,fe),ie.length>0){const _e=f(j[fe]);return Z=new TypeError("Unexpected type of argument in function "+oe+" (expected: "+ie.join(" or ")+", actual: "+_e.join(" | ")+", index: "+fe+")"),Z.data={category:"wrongType",fn:oe,index:fe,actual:_e,expected:ie},Z}}else ye=Ze}const De=ye.map(function(Ze){return y(Ze.params)?1/0:Ze.params.length});if(j.length<Math.min.apply(null,De))return ie=C(ye,fe),Z=new TypeError("Too few arguments in function "+oe+" (expected: "+ie.join(" or ")+", index: "+j.length+")"),Z.data={category:"tooFewArgs",fn:oe,index:j.length,expected:ie},Z;const Ne=Math.max.apply(null,De);if(j.length>Ne)return Z=new TypeError("Too many arguments in function "+oe+" (expected: "+Ne+", actual: "+j.length+")"),Z.data={category:"tooManyArgs",fn:oe,index:j.length,expectedLength:Ne},Z;const je=[];for(let Ze=0;Ze<j.length;++Ze)je.push(f(j[Ze]).join("|"));return Z=new TypeError('Arguments of type "'+je.join(", ")+'" do not match any of the defined signatures of function '+oe+"."),Z.data={category:"mismatch",actual:je},Z}function R(B){let j=i.length+1;for(let Q=0;Q<B.types.length;Q++)S(B.types[Q])&&(j=Math.min(j,B.types[Q].typeIndex));return j}function P(B){let j=a+1;for(let Q=0;Q<B.types.length;Q++)S(B.types[Q])||(j=Math.min(j,B.types[Q].conversionIndex));return j}function I(B,j){if(B.hasAny){if(!j.hasAny)return 1}else if(j.hasAny)return-1;if(B.restParam){if(!j.restParam)return 1}else if(j.restParam)return-1;if(B.hasConversion){if(!j.hasConversion)return 1}else if(j.hasConversion)return-1;const Q=R(B)-R(j);if(Q<0)return-1;if(Q>0)return 1;const Z=P(B)-P(j);return Z<0?-1:Z>0?1:0}function O(B,j){const Q=B.params,Z=j.params,ie=ne(Q),oe=ne(Z),ye=y(Q),fe=y(Z);if(ye&&ie.hasAny){if(!fe||!oe.hasAny)return 1}else if(fe&&oe.hasAny)return-1;let De=0,Ne=0,je;for(je of Q)je.hasAny&&++De,je.hasConversion&&++Ne;let Ze=0,_e=0;for(je of Z)je.hasAny&&++Ze,je.hasConversion&&++_e;if(De!==Ze)return De-Ze;if(ye&&ie.hasConversion){if(!fe||!oe.hasConversion)return 1}else if(fe&&oe.hasConversion)return-1;if(Ne!==_e)return Ne-_e;if(ye){if(!fe)return 1}else if(fe)return-1;const wt=(Q.length-Z.length)*(ye?-1:1);if(wt!==0)return wt;const M=[];let X=0;for(let Ee=0;Ee<Q.length;++Ee){const Re=I(Q[Ee],Z[Ee]);M.push(Re),X+=Re}if(X!==0)return X;let pe;for(pe of M)if(pe!==0)return pe;return 0}function F(B){if(B.length===0)return[];const j=B.map(u);B.length>1&&j.sort((ie,oe)=>ie.index-oe.index);let Q=j[0].conversionsTo;if(B.length===1)return Q;Q=Q.concat([]);const Z=new Set(B);for(let ie=1;ie<j.length;++ie){let oe;for(oe of j[ie].conversionsTo)Z.has(oe.from)||(Q.push(oe),Z.add(oe.from))}return Q}function q(B,j){let Q=j;if(B.some(ie=>ie.hasConversion)){const ie=y(B),oe=B.map(k);Q=function(){const ye=[],fe=ie?arguments.length-1:arguments.length;for(let De=0;De<fe;De++)ye[De]=oe[De](arguments[De]);return ie&&(ye[fe]=arguments[fe].map(oe[fe])),j.apply(this,ye)}}let Z=Q;if(y(B)){const ie=B.length-1;Z=function(){return Q.apply(this,ce(arguments,0,ie).concat([ce(arguments,ie)]))}}return Z}function k(B){let j,Q,Z,ie;const oe=[],ye=[];switch(B.types.forEach(function(fe){fe.conversion&&(oe.push(u(fe.conversion.from).test),ye.push(fe.conversion.convert))}),ye.length){case 0:return function(fe){return fe};case 1:return j=oe[0],Z=ye[0],function(fe){return j(fe)?Z(fe):fe};case 2:return j=oe[0],Q=oe[1],Z=ye[0],ie=ye[1],function(fe){return j(fe)?Z(fe):Q(fe)?ie(fe):fe};default:return function(fe){for(let De=0;De<ye.length;De++)if(oe[De](fe))return ye[De](fe);return fe}}}function te(B){function j(Q,Z,ie){if(Z<Q.length){const oe=Q[Z];let ye=[];if(oe.restParam){const fe=oe.types.filter(S);fe.length<oe.types.length&&ye.push({types:fe,name:"..."+fe.map(De=>De.name).join("|"),hasAny:fe.some(De=>De.isAny),hasConversion:!1,restParam:!0}),ye.push(oe)}else ye=oe.types.map(function(fe){return{types:[fe],name:fe.name,hasAny:fe.isAny,hasConversion:fe.conversion,restParam:!1}});return he(ye,function(fe){return j(Q,Z+1,ie.concat([fe]))})}else return[ie]}return j(B,0,[])}function se(B,j){const Q=Math.max(B.length,j.length);for(let fe=0;fe<Q;fe++){const De=D(B,fe),Ne=D(j,fe);let je=!1,Ze;for(Ze of Ne)if(De.has(Ze)){je=!0;break}if(!je)return!1}const Z=B.length,ie=j.length,oe=y(B),ye=y(j);return oe?ye?Z===ie:ie>=Z:ye?Z>=ie:Z===ie}function K(B){return B.map(j=>J(j)?T(j.referToSelf.callback):z(j)?$(j.referTo.references,j.referTo.callback):j)}function V(B,j,Q){const Z=[];let ie;for(ie of B){let oe=Q[ie];if(typeof oe!="number")throw new TypeError('No definition for referenced signature "'+ie+'"');if(oe=j[oe],typeof oe!="function")return!1;Z.push(oe)}return Z}function ue(B,j,Q){const Z=K(B),ie=new Array(Z.length).fill(!1);let oe=!0;for(;oe;){oe=!1;let ye=!0;for(let fe=0;fe<Z.length;++fe){if(ie[fe])continue;const De=Z[fe];if(J(De))Z[fe]=De.referToSelf.callback(Q),Z[fe].referToSelf=De.referToSelf,ie[fe]=!0,ye=!1;else if(z(De)){const Ne=V(De.referTo.references,Z,j);Ne?(Z[fe]=De.referTo.callback.apply(this,Ne),Z[fe].referTo=De.referTo,ie[fe]=!0,ye=!1):oe=!0}}if(ye&&oe)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return Z}function me(B){const j=/\bthis(\(|\.signatures\b)/;Object.keys(B).forEach(Q=>{const Z=B[Q];if(j.test(Z.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 re(B,j){if(o.createCount++,Object.keys(j).length===0)throw new SyntaxError("No signatures provided");o.warnAgainstDeprecatedThis&&me(j);const Q=[],Z=[],ie={},oe=[];let ye;for(ye in j){if(!Object.prototype.hasOwnProperty.call(j,ye))continue;const ut=b(ye);if(!ut)continue;Q.forEach(function(Ua){if(se(Ua,ut))throw new TypeError('Conflicting signatures "'+w(Ua)+'" and "'+w(ut)+'".')}),Q.push(ut);const mn=Z.length;Z.push(j[ye]);const Pw=ut.map(x);let Lo;for(Lo of te(Pw)){const Ua=w(Lo);oe.push({params:Lo,name:Ua,fn:mn}),Lo.every(Vw=>!Vw.hasConversion)&&(ie[Ua]=mn)}}oe.sort(O);const fe=ue(Z,ie,Va);let De;for(De in ie)Object.prototype.hasOwnProperty.call(ie,De)&&(ie[De]=fe[ie[De]]);const Ne=[],je=new Map;for(De of oe)je.has(De.name)||(De.fn=fe[De.fn],Ne.push(De),je.set(De.name,De));const Ze=Ne[0]&&Ne[0].params.length<=2&&!y(Ne[0].params),_e=Ne[1]&&Ne[1].params.length<=2&&!y(Ne[1].params),wt=Ne[2]&&Ne[2].params.length<=2&&!y(Ne[2].params),M=Ne[3]&&Ne[3].params.length<=2&&!y(Ne[3].params),X=Ne[4]&&Ne[4].params.length<=2&&!y(Ne[4].params),pe=Ne[5]&&Ne[5].params.length<=2&&!y(Ne[5].params),Ee=Ze&&_e&&wt&&M&&X&&pe;for(let ut=0;ut<Ne.length;++ut)Ne[ut].test=E(Ne[ut].params);const Re=Ze?N(Ne[0].params[0]):Er,Je=_e?N(Ne[1].params[0]):Er,vr=wt?N(Ne[2].params[0]):Er,nc=M?N(Ne[3].params[0]):Er,gw=X?N(Ne[4].params[0]):Er,vw=pe?N(Ne[5].params[0]):Er,yw=Ze?N(Ne[0].params[1]):Er,bw=_e?N(Ne[1].params[1]):Er,xw=wt?N(Ne[2].params[1]):Er,ww=M?N(Ne[3].params[1]):Er,Nw=X?N(Ne[4].params[1]):Er,Dw=pe?N(Ne[5].params[1]):Er;for(let ut=0;ut<Ne.length;++ut)Ne[ut].implementation=q(Ne[ut].params,Ne[ut].fn);const Ew=Ze?Ne[0].implementation:Qi,Aw=_e?Ne[1].implementation:Qi,Sw=wt?Ne[2].implementation:Qi,Cw=M?Ne[3].implementation:Qi,Mw=X?Ne[4].implementation:Qi,_w=pe?Ne[5].implementation:Qi,Fw=Ze?Ne[0].params.length:-1,Tw=_e?Ne[1].params.length:-1,Ow=wt?Ne[2].params.length:-1,Bw=M?Ne[3].params.length:-1,kw=X?Ne[4].params.length:-1,Iw=pe?Ne[5].params.length:-1,Rw=Ee?6:0,qw=Ne.length,zw=Ne.map(ut=>ut.test),jw=Ne.map(ut=>ut.implementation),Lw=function(){for(let ut=Rw;ut<qw;ut++)if(zw[ut](arguments))return jw[ut].apply(this,arguments);return o.onMismatch(B,arguments,Ne)};function Va(ut,mn){return arguments.length===Fw&&Re(ut)&&yw(mn)?Ew.apply(this,arguments):arguments.length===Tw&&Je(ut)&&bw(mn)?Aw.apply(this,arguments):arguments.length===Ow&&vr(ut)&&xw(mn)?Sw.apply(this,arguments):arguments.length===Bw&&nc(ut)&&ww(mn)?Cw.apply(this,arguments):arguments.length===kw&&gw(ut)&&Nw(mn)?Mw.apply(this,arguments):arguments.length===Iw&&vw(ut)&&Dw(mn)?_w.apply(this,arguments):Lw.apply(this,arguments)}try{Object.defineProperty(Va,"name",{value:B})}catch{}return Va.signatures=ie,Va._typedFunctionData={signatures:Ne,signatureMap:je},Va}function ae(B,j,Q){throw _(B,j,Q)}function de(B){return ce(B,0,B.length-1)}function ne(B){return B[B.length-1]}function ce(B,j,Q){return Array.prototype.slice.call(B,j,Q)}function le(B,j){for(let Q=0;Q<B.length;Q++)if(j(B[Q]))return B[Q]}function he(B,j){return Array.prototype.concat.apply([],B.map(j))}function xe(){const B=de(arguments).map(Q=>w(b(Q))),j=ne(arguments);if(typeof j!="function")throw new TypeError("Callback function expected as last argument");return $(B,j)}function $(B,j){return{referTo:{references:B,callback:j}}}function T(B){if(typeof B!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:B}}}function z(B){return B&&typeof B.referTo=="object"&&Array.isArray(B.referTo.references)&&typeof B.referTo.callback=="function"}function J(B){return B&&typeof B.referToSelf=="object"&&typeof B.referToSelf.callback=="function"}function L(B,j){if(!B)return j;if(j&&j!==B){const Q=new Error("Function names do not match (expected: "+B+", actual: "+j+")");throw Q.data={actual:j,expected:B},Q}return B}function H(B){let j;for(const Q in B)Object.prototype.hasOwnProperty.call(B,Q)&&(p(B[Q])||typeof B[Q].signature=="string")&&(j=L(j,B[Q].name));return j}function G(B,j){let Q;for(Q in j)if(Object.prototype.hasOwnProperty.call(j,Q)){if(Q in B&&j[Q]!==B[Q]){const Z=new Error('Signature "'+Q+'" is defined twice');throw Z.data={signature:Q,sourceFunction:j[Q],destFunction:B[Q]},Z}B[Q]=j[Q]}}const Y=o;o=function(B){const j=typeof B=="string",Q=j?1:0;let Z=j?B:"";const ie={};for(let oe=Q;oe<arguments.length;++oe){const ye=arguments[oe];let fe={},De;if(typeof ye=="function"?(De=ye.name,typeof ye.signature=="string"?fe[ye.signature]=ye:p(ye)&&(fe=ye.signatures)):e(ye)&&(fe=ye,j||(De=H(ye))),Object.keys(fe).length===0){const Ne=new TypeError("Argument to 'typed' at index "+oe+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw Ne.data={index:oe,argument:ye},Ne}j||(Z=L(Z,De)),G(ie,fe)}return re(Z||"",ie)},o.create=Ug,o.createCount=Y.createCount,o.onMismatch=ae,o.throwMismatchError=ae,o.createError=_,o.clear=l,o.clearConversions=s,o.addTypes=c,o._findType=u,o.referTo=xe,o.referToSelf=T,o.convert=h,o.findSignature=m,o.find=d,o.isTypedFunction=p,o.warnAgainstDeprecatedThis=!0,o.addType=function(B,j){let Q="any";j!==!1&&n.has("Object")&&(Q="Object"),o.addTypes([B],Q)};function ee(B){if(!B||typeof B.from!="string"||typeof B.to!="string"||typeof B.convert!="function")throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(B.to===B.from)throw new SyntaxError('Illegal to define conversion from "'+B.from+'" to itself.')}return o.addConversion=function(B){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{override:!1};ee(B);const Q=u(B.to),Z=Q.conversionsTo.find(ie=>ie.from===B.from);if(Z)if(j&&j.override)o.removeConversion({from:Z.from,to:B.to,convert:Z.convert});else throw new Error('There is already a conversion from "'+B.from+'" to "'+Q.name+'"');Q.conversionsTo.push({from:B.from,convert:B.convert,index:a++})},o.addConversions=function(B,j){B.forEach(Q=>o.addConversion(Q,j))},o.removeConversion=function(B){ee(B);const j=u(B.to),Q=le(j.conversionsTo,ie=>ie.from===B.from);if(!Q)throw new Error("Attempt to remove nonexistent conversion from "+B.from+" to "+B.to);if(Q.convert!==B.convert)throw new Error("Conversion to remove does not match existing conversion");const Z=j.conversionsTo.indexOf(Q);j.conversionsTo.splice(Z,1)},o.resolve=function(B,j){if(!p(B))throw new TypeError(Hf);const Q=B._typedFunctionData.signatures;for(let Z=0;Z<Q.length;++Z)if(Q[Z].test(j))return Q[Z];return null},o}const ta=Ug();function Fe(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}var Wn=Math.sign||function(e){return e>0?1:e<0?-1:0},lN=Math.log2||function(e){return Math.log(e)/Math.LN2},fN=Math.log10||function(e){return Math.log(e)/Math.LN10},pN=Math.log1p||function(e){return Math.log(e+1)},mN=Math.cbrt||function(e){if(e===0)return e;var t=e<0,r;return t&&(e=-e),isFinite(e)?(r=Math.exp(Math.log(e)/3),r=(e/(r*r)+2*r)/3):r=e,t?-r:r},dN=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function oc(e,t,r){var n={2:"0b",8:"0o",16:"0x"},i=n[t],a="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!Fe(r))throw new Error("size must be an integer");if(e>2**(r-1)-1||e<-(2**(r-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!Fe(e))throw new Error("Value must be an integer");e<0&&(e=e+2**r),a="i".concat(r)}var o="";return e<0&&(e=-e,o="-"),"".concat(o).concat(i).concat(e.toString(t)).concat(a)}function Di(e,t){if(typeof t=="function")return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var{notation:r,precision:n,wordSize:i}=$g(t);switch(r){case"fixed":return Hg(e,n);case"exponential":return Jg(e,n);case"engineering":return hN(e,n);case"bin":return oc(e,2,i);case"oct":return oc(e,8,i);case"hex":return oc(e,16,i);case"auto":return gN(e,n,t).replace(/((\.\d*?)(0+))($|e)/,function(){var a=arguments[2],o=arguments[4];return a!=="."?a+o:o});default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function $g(e){var t="auto",r,n;if(e!==void 0)if(Ue(e))r=e;else if($e(e))r=e.toNumber();else if(pu(e))e.precision!==void 0&&(r=Jf(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),e.wordSize!==void 0&&(n=Jf(e.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),e.notation&&(t=e.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:t,precision:r,wordSize:n}}function wo(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var r=t[1],n=t[2],i=parseFloat(t[4]||"0"),a=n.indexOf(".");i+=a!==-1?a-1:n.length-1;var o=n.replace(".","").replace(/^0*/,function(u){return i-=u.length,""}).replace(/0*$/,"").split("").map(function(u){return parseInt(u)});return o.length===0&&(o.push(0),i++),{sign:r,coefficients:o,exponent:i}}function hN(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=wo(e),n=du(r,t),i=n.exponent,a=n.coefficients,o=i%3===0?i:i<0?i-3-i%3:i-i%3;if(Ue(t))for(;t>a.length||i-o+1>a.length;)a.push(0);else for(var u=Math.abs(i-o)-(a.length-1),c=0;c<u;c++)a.push(0);for(var l=Math.abs(i-o),s=1;l>0;)s++,l--;var f=a.slice(s).join(""),p=Ue(t)&&f.length||f.match(/[1-9]/)?"."+f:"",m=a.slice(0,s).join("")+p+"e"+(i>=0?"+":"")+o.toString();return n.sign+m}function Hg(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=wo(e),n=typeof t=="number"?du(r,r.exponent+1+t):r,i=n.coefficients,a=n.exponent+1,o=a+(t||0);return i.length<o&&(i=i.concat(ia(o-i.length))),a<0&&(i=ia(-a+1).concat(i),a=1),a<i.length&&i.splice(a,0,a===0?"0.":"."),n.sign+i.join("")}function Jg(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=wo(e),n=t?du(r,t):r,i=n.coefficients,a=n.exponent;i.length<t&&(i=i.concat(ia(t-i.length)));var o=i.shift();return n.sign+o+(i.length>0?"."+i.join(""):"")+"e"+(a>=0?"+":"")+a}function gN(e,t,r){if(isNaN(e)||!isFinite(e))return String(e);var n=Gf(r==null?void 0:r.lowerExp,-3),i=Gf(r==null?void 0:r.upperExp,5),a=wo(e),o=t?du(a,t):a;if(o.exponent<n||o.exponent>=i)return Jg(e,t);var u=o.coefficients,c=o.exponent;u.length<t&&(u=u.concat(ia(t-u.length))),u=u.concat(ia(c-u.length+1+(u.length<t?t-u.length:0))),u=ia(-c).concat(u);var l=c>0?c:0;return l<u.length-1&&u.splice(l+1,0,"."),o.sign+u.join("")}function du(e,t){for(var r={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},n=r.coefficients;t<=0;)n.unshift(0),r.exponent++,t++;if(n.length>t){var i=n.splice(t,n.length-t);if(i[0]>=5){var a=t-1;for(n[a]++;n[a]===10;)n.pop(),a===0&&(n.unshift(0),r.exponent++,a++),a--,n[a]++}}return r}function ia(e){for(var t=[],r=0;r<e;r++)t.push(0);return t}function vN(e){return e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length}var yN=Number.EPSILON||2220446049250313e-31;function sr(e,t,r){if(r==null)return e===t;if(e===t)return!0;if(isNaN(e)||isNaN(t))return!1;if(isFinite(e)&&isFinite(t)){var n=Math.abs(e-t);return n<=yN?!0:n<=Math.max(Math.abs(e),Math.abs(t))*r}return!1}var bN=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)},xN=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},wN=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},NN=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},DN=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},EN=Math.tanh||function(e){var t=Math.exp(2*e);return(t-1)/(t+1)};function AN(e,t){var r=!0,n=t>0?!0:t<0?!1:1/t===1/0;return r^n?-e:e}function Jf(e,t){if(Ue(e))return e;if($e(e))return e.toNumber();t()}function Gf(e,t){return Ue(e)?e:$e(e)?e.toNumber():t}function U(e,t,r,n){function i(a){var o=sN(a,t.map(MN));return SN(e,t,a),r(o)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),n&&(i.meta=n),i}function SN(e,t,r){var n=t.filter(a=>!CN(a)).every(a=>r[a]!==void 0);if(!n){var i=t.filter(a=>r[a]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(i.map(a=>'"'.concat(a,'"')).join(", "),"."))}}function CN(e){return e&&e[0]==="?"}function MN(e){return e&&e[0]==="?"?e.slice(1):e}function nr(e,t){if(Wg(e)&&Gg(e,t))return e[t];throw typeof e[t]=="function"&&xl(e,t)?new Error('Cannot access method "'+t+'" as a property'):new Error('No access to property "'+t+'"')}function pa(e,t,r){if(Wg(e)&&Gg(e,t))return e[t]=r,r;throw new Error('No access to property "'+t+'"')}function _N(e,t){return t in e}function Gg(e,t){return!e||typeof e!="object"?!1:Me(TN,t)?!0:!(t in Object.prototype||t in Function.prototype)}function FN(e,t){if(!xl(e,t))throw new Error('No access to method "'+t+'"');return e[t]}function xl(e,t){return e==null||typeof e[t]!="function"||Me(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)?!1:Me(ON,t)?!0:!(t in Object.prototype||t in Function.prototype)}function Wg(e){return typeof e=="object"&&e&&e.constructor===Object}var TN={length:!0,name:!0},ON={toString:!0,valueOf:!0,toLocaleString:!0};class hu{constructor(t){this.wrappedObject=t,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(t){return nr(this.wrappedObject,t)}set(t,r){return pa(this.wrappedObject,t,r),this}has(t){return _N(this.wrappedObject,t)}entries(){return Qg(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var r of this.keys())t(this.get(r),r,this)}delete(t){delete this.wrappedObject[t]}clear(){for(var t of this.keys())this.delete(t)}get size(){return Object.keys(this.wrappedObject).length}}class Kg{constructor(t,r,n){this.a=t,this.b=r,this.bKeys=n,this[Symbol.iterator]=this.entries}get(t){return this.bKeys.has(t)?this.b.get(t):this.a.get(t)}set(t,r){return this.bKeys.has(t)?this.b.set(t,r):this.a.set(t,r),this}has(t){return this.b.has(t)||this.a.has(t)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return Qg(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var r of this.keys())t(this.get(r),r,this)}delete(t){return this.bKeys.has(t)?this.b.delete(t):this.a.delete(t)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}}function Qg(e,t){return{next:()=>{var r=e.next();return r.done?r:{value:t(r.value),done:!1}}}}function ao(){return new Map}function aa(e){if(!e)return ao();if(Zg(e))return e;if(pu(e))return new hu(e);throw new Error("createMap can create maps from objects or Maps")}function BN(e){if(e instanceof hu)return e.wrappedObject;var t={};for(var r of e.keys()){var n=e.get(r);pa(t,r,n)}return t}function Zg(e){return e?e instanceof Map||e instanceof hu||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}var Xg=function(){return Xg=ta.create,ta},kN=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],IN=U("typed",kN,function(e){var{BigNumber:t,Complex:r,DenseMatrix:n,Fraction:i}=e,a=Xg();return a.clear(),a.addTypes([{name:"number",test:Ue},{name:"Complex",test:wn},{name:"BigNumber",test:$e},{name:"Fraction",test:bo},{name:"Unit",test:Cr},{name:"identifier",test:o=>Qt&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\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\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\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\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\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\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(o)},{name:"string",test:Qt},{name:"Chain",test:Pg},{name:"Array",test:st},{name:"Matrix",test:ke},{name:"DenseMatrix",test:_s},{name:"SparseMatrix",test:wi},{name:"Range",test:bl},{name:"Index",test:fu},{name:"boolean",test:Gw},{name:"ResultSet",test:Ww},{name:"Help",test:Lg},{name:"function",test:Kw},{name:"Date",test:Qw},{name:"RegExp",test:Zw},{name:"null",test:Xw},{name:"undefined",test:Yw},{name:"AccessorNode",test:Ti},{name:"ArrayNode",test:Sr},{name:"AssignmentNode",test:eN},{name:"BlockNode",test:tN},{name:"ConditionalNode",test:rN},{name:"ConstantNode",test:nt},{name:"FunctionNode",test:Zn},{name:"FunctionAssignmentNode",test:xo},{name:"IndexNode",test:Da},{name:"Node",test:ft},{name:"ObjectNode",test:mu},{name:"OperatorNode",test:Ct},{name:"ParenthesisNode",test:An},{name:"RangeNode",test:nN},{name:"RelationalNode",test:iN},{name:"SymbolNode",test:zt},{name:"Map",test:Zg},{name:"Object",test:pu}]),a.addConversions([{from:"number",to:"BigNumber",convert:function(o){if(t||sc(o),vN(o)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+o+"). Use function bignumber(x) to convert to BigNumber.");return new t(o)}},{from:"number",to:"Complex",convert:function(o){return r||Uo(o),new r(o,0)}},{from:"BigNumber",to:"Complex",convert:function(o){return r||Uo(o),new r(o.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(o){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(o){return r||Uo(o),new r(o.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(o){i||uc(o);var u=new i(o);if(u.valueOf()!==o)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+o+"). Use function fraction(x) to convert to Fraction.");return u}},{from:"string",to:"number",convert:function(o){var u=Number(o);if(isNaN(u))throw new Error('Cannot convert "'+o+'" to a number');return u}},{from:"string",to:"BigNumber",convert:function(o){t||sc(o);try{return new t(o)}catch{throw new Error('Cannot convert "'+o+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(o){i||uc(o);try{return new i(o)}catch{throw new Error('Cannot convert "'+o+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(o){r||Uo(o);try{return new r(o)}catch{throw new Error('Cannot convert "'+o+'" to Complex')}}},{from:"boolean",to:"number",convert:function(o){return+o}},{from:"boolean",to:"BigNumber",convert:function(o){return t||sc(o),new t(+o)}},{from:"boolean",to:"Fraction",convert:function(o){return i||uc(o),new i(+o)}},{from:"boolean",to:"string",convert:function(o){return String(o)}},{from:"Array",to:"Matrix",convert:function(o){return n||RN(),new n(o)}},{from:"Matrix",to:"Array",convert:function(o){return o.valueOf()}}]),a.onMismatch=(o,u,c)=>{var l=a.createError(o,u,c);if(["wrongType","mismatch"].includes(l.data.category)&&u.length===1&&Fr(u[0])&&c.some(f=>!f.params.includes(","))){var s=new TypeError("Function '".concat(o,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(o,")'."));throw s.data=l.data,s}throw l},a.onMismatch=(o,u,c)=>{var l=a.createError(o,u,c);if(["wrongType","mismatch"].includes(l.data.category)&&u.length===1&&Fr(u[0])&&c.some(f=>!f.params.includes(","))){var s=new TypeError("Function '".concat(o,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(o,")'."));throw s.data=l.data,s}throw l},a});function sc(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function Uo(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function RN(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function uc(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var qN="ResultSet",zN=[],jN=U(qN,zN,()=>{function e(t){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=t||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(t){return new e(t.entries)},e},{isClass:!0});/*!
|
|
9
9
|
* decimal.js v10.4.3
|
|
10
10
|
* An arbitrary-precision Decimal type for JavaScript.
|
|
11
11
|
* https://github.com/MikeMcl/decimal.js
|
|
12
12
|
* Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
13
13
|
* MIT Licence
|
|
14
|
-
*/var ta=9e15,ni=1e9,Fc="0123456789abcdef",_s="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Fs="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Tc={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ta,maxE:ta,crypto:!1},Xg,xn,Le=!0,hu="[DecimalError] ",Xn=hu+"Invalid argument: ",Yg=hu+"Precision limit exceeded",ev=hu+"crypto unavailable",tv="[object Decimal]",Yt=Math.floor,Ft=Math.pow,zN=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,jN=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,LN=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,rv=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Lr=1e7,Ie=7,PN=9007199254740991,VN=_s.length-1,Oc=Fs.length-1,xe={toStringTag:tv};xe.absoluteValue=xe.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),Te(e)};xe.ceil=function(){return Te(new this.constructor(this),this.e+1,2)};xe.clampedTo=xe.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Xn+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};xe.comparedTo=xe.cmp=function(e){var t,r,n,i,a=this,o=a.d,u=(e=new a.constructor(e)).d,c=a.s,l=e.s;if(!o||!u)return!c||!l?NaN:c!==l?c:o===u?0:!o^c<0?1:-1;if(!o[0]||!u[0])return o[0]?c:u[0]?-l:0;if(c!==l)return c;if(a.e!==e.e)return a.e>e.e^c<0?1:-1;for(n=o.length,i=u.length,t=0,r=n<i?n:i;t<r;++t)if(o[t]!==u[t])return o[t]>u[t]^c<0?1:-1;return n===i?0:n>i^c<0?1:-1};xe.cosine=xe.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+Ie,n.rounding=1,r=UN(n,sv(n,r)),n.precision=e,n.rounding=t,Te(xn==2||xn==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};xe.cubeRoot=xe.cbrt=function(){var e,t,r,n,i,a,o,u,c,l,s=this,f=s.constructor;if(!s.isFinite()||s.isZero())return new f(s);for(Le=!1,a=s.s*Ft(s.s*s,1/3),!a||Math.abs(a)==1/0?(r=Vt(s.d),e=s.e,(a=(e-r.length+1)%3)&&(r+=a==1||a==-2?"0":"00"),a=Ft(r,1/3),e=Yt((e+1)/3)-(e%3==(e<0?-1:2)),a==1/0?r="5e"+e:(r=a.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new f(r),n.s=s.s):n=new f(a.toString()),o=(e=f.precision)+3;;)if(u=n,c=u.times(u).times(u),l=c.plus(s),n=xt(l.plus(s).times(u),l.plus(c),o+2,1),Vt(u.d).slice(0,o)===(r=Vt(n.d)).slice(0,o))if(r=r.slice(o-3,o+1),r=="9999"||!i&&r=="4999"){if(!i&&(Te(u,e+1,0),u.times(u).times(u).eq(s))){n=u;break}o+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(Te(n,e+1,1),t=!n.times(n).times(n).eq(s));break}return Le=!0,Te(n,e,f.rounding,t)};xe.decimalPlaces=xe.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-Yt(this.e/Ie))*Ie,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};xe.dividedBy=xe.div=function(e){return xt(this,new this.constructor(e))};xe.dividedToIntegerBy=xe.divToInt=function(e){var t=this,r=t.constructor;return Te(xt(t,new r(e),0,1,1),r.precision,r.rounding)};xe.equals=xe.eq=function(e){return this.cmp(e)===0};xe.floor=function(){return Te(new this.constructor(this),this.e+1,3)};xe.greaterThan=xe.gt=function(e){return this.cmp(e)>0};xe.greaterThanOrEqualTo=xe.gte=function(e){var t=this.cmp(e);return t==1||t===0};xe.hyperbolicCosine=xe.cosh=function(){var e,t,r,n,i,a=this,o=a.constructor,u=new o(1);if(!a.isFinite())return new o(a.s?1/0:NaN);if(a.isZero())return u;r=o.precision,n=o.rounding,o.precision=r+Math.max(a.e,a.sd())+4,o.rounding=1,i=a.d.length,i<32?(e=Math.ceil(i/3),t=(1/vu(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),a=pa(o,1,a.times(t),new o(1),!0);for(var c,l=e,s=new o(8);l--;)c=a.times(a),a=u.minus(c.times(s.minus(c.times(s))));return Te(a,o.precision=r,o.rounding=n,!0)};xe.hyperbolicSine=xe.sinh=function(){var e,t,r,n,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(t=a.precision,r=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,n=i.d.length,n<3)i=pa(a,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/vu(5,e)),i=pa(a,2,i,i,!0);for(var o,u=new a(5),c=new a(16),l=new a(20);e--;)o=i.times(i),i=i.times(u.plus(o.times(c.times(o).plus(l))))}return a.precision=t,a.rounding=r,Te(i,t,r,!0)};xe.hyperbolicTangent=xe.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,xt(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};xe.inverseCosine=xe.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,a=r.rounding;return n!==-1?n===0?t.isNeg()?zr(r,i,a):new r(0):new r(NaN):t.isZero()?zr(r,i+4,a).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=zr(r,i+4,a).times(.5),r.precision=i,r.rounding=a,e.minus(t))};xe.inverseHyperbolicCosine=xe.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,Le=!1,r=r.times(r).minus(1).sqrt().plus(r),Le=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};xe.inverseHyperbolicSine=xe.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,Le=!1,r=r.times(r).plus(1).sqrt().plus(r),Le=!0,n.precision=e,n.rounding=t,r.ln())};xe.inverseHyperbolicTangent=xe.atanh=function(){var e,t,r,n,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=a.precision,t=a.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?Te(new a(i),e,t,!0):(a.precision=r=n-i.e,i=xt(i.plus(1),new a(1).minus(i),r+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=t,i.times(.5))):new a(NaN)};xe.inverseSine=xe.asin=function(){var e,t,r,n,i=this,a=i.constructor;return i.isZero()?new a(i):(t=i.abs().cmp(1),r=a.precision,n=a.rounding,t!==-1?t===0?(e=zr(a,r+4,n).times(.5),e.s=i.s,e):new a(NaN):(a.precision=r+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=r,a.rounding=n,i.times(2)))};xe.inverseTangent=xe.atan=function(){var e,t,r,n,i,a,o,u,c,l=this,s=l.constructor,f=s.precision,p=s.rounding;if(l.isFinite()){if(l.isZero())return new s(l);if(l.abs().eq(1)&&f+4<=Oc)return o=zr(s,f+4,p).times(.25),o.s=l.s,o}else{if(!l.s)return new s(NaN);if(f+4<=Oc)return o=zr(s,f+4,p).times(.5),o.s=l.s,o}for(s.precision=u=f+10,s.rounding=1,r=Math.min(28,u/Ie+2|0),e=r;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(Le=!1,t=Math.ceil(u/Ie),n=1,c=l.times(l),o=new s(l),i=l;e!==-1;)if(i=i.times(c),a=o.minus(i.div(n+=2)),i=i.times(c),o=a.plus(i.div(n+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===a.d[e]&&e--;);return r&&(o=o.times(2<<r-1)),Le=!0,Te(o,s.precision=f,s.rounding=p,!0)};xe.isFinite=function(){return!!this.d};xe.isInteger=xe.isInt=function(){return!!this.d&&Yt(this.e/Ie)>this.d.length-2};xe.isNaN=function(){return!this.s};xe.isNegative=xe.isNeg=function(){return this.s<0};xe.isPositive=xe.isPos=function(){return this.s>0};xe.isZero=function(){return!!this.d&&this.d[0]===0};xe.lessThan=xe.lt=function(e){return this.cmp(e)<0};xe.lessThanOrEqualTo=xe.lte=function(e){return this.cmp(e)<1};xe.logarithm=xe.log=function(e){var t,r,n,i,a,o,u,c,l=this,s=l.constructor,f=s.precision,p=s.rounding,m=5;if(e==null)e=new s(10),t=!0;else{if(e=new s(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new s(NaN);t=e.eq(10)}if(r=l.d,l.s<0||!r||!r[0]||l.eq(1))return new s(r&&!r[0]?-1/0:l.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)a=!0;else{for(i=r[0];i%10===0;)i/=10;a=i!==1}if(Le=!1,u=f+m,o=Kn(l,u),n=t?Ts(s,u+10):Kn(e,u),c=xt(o,n,u,1),ao(c.d,i=f,p))do if(u+=10,o=Kn(l,u),n=t?Ts(s,u+10):Kn(e,u),c=xt(o,n,u,1),!a){+Vt(c.d).slice(i+1,i+15)+1==1e14&&(c=Te(c,f+1,0));break}while(ao(c.d,i+=10,p));return Le=!0,Te(c,f,p)};xe.minus=xe.sub=function(e){var t,r,n,i,a,o,u,c,l,s,f,p,m=this,d=m.constructor;if(e=new d(e),!m.d||!e.d)return!m.s||!e.s?e=new d(NaN):m.d?e.s=-e.s:e=new d(e.d||m.s!==e.s?m:NaN),e;if(m.s!=e.s)return e.s=-e.s,m.plus(e);if(l=m.d,p=e.d,u=d.precision,c=d.rounding,!l[0]||!p[0]){if(p[0])e.s=-e.s;else if(l[0])e=new d(m);else return new d(c===3?-0:0);return Le?Te(e,u,c):e}if(r=Yt(e.e/Ie),s=Yt(m.e/Ie),l=l.slice(),a=s-r,a){for(f=a<0,f?(t=l,a=-a,o=p.length):(t=p,r=s,o=l.length),n=Math.max(Math.ceil(u/Ie),o)+2,a>n&&(a=n,t.length=1),t.reverse(),n=a;n--;)t.push(0);t.reverse()}else{for(n=l.length,o=p.length,f=n<o,f&&(o=n),n=0;n<o;n++)if(l[n]!=p[n]){f=l[n]<p[n];break}a=0}for(f&&(t=l,l=p,p=t,e.s=-e.s),o=l.length,n=p.length-o;n>0;--n)l[o++]=0;for(n=p.length;n>a;){if(l[--n]<p[n]){for(i=n;i&&l[--i]===0;)l[i]=Lr-1;--l[i],l[n]+=Lr}l[n]-=p[n]}for(;l[--o]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(e.d=l,e.e=gu(l,r),Le?Te(e,u,c):e):new d(c===3?-0:0)};xe.modulo=xe.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?Te(new n(r),n.precision,n.rounding):(Le=!1,n.modulo==9?(t=xt(r,e.abs(),0,3,1),t.s*=e.s):t=xt(r,e,0,n.modulo,1),t=t.times(e),Le=!0,r.minus(t))};xe.naturalExponential=xe.exp=function(){return Bc(this)};xe.naturalLogarithm=xe.ln=function(){return Kn(this)};xe.negated=xe.neg=function(){var e=new this.constructor(this);return e.s=-e.s,Te(e)};xe.plus=xe.add=function(e){var t,r,n,i,a,o,u,c,l,s,f=this,p=f.constructor;if(e=new p(e),!f.d||!e.d)return!f.s||!e.s?e=new p(NaN):f.d||(e=new p(e.d||f.s===e.s?f:NaN)),e;if(f.s!=e.s)return e.s=-e.s,f.minus(e);if(l=f.d,s=e.d,u=p.precision,c=p.rounding,!l[0]||!s[0])return s[0]||(e=new p(f)),Le?Te(e,u,c):e;if(a=Yt(f.e/Ie),n=Yt(e.e/Ie),l=l.slice(),i=a-n,i){for(i<0?(r=l,i=-i,o=s.length):(r=s,n=a,o=l.length),a=Math.ceil(u/Ie),o=a>o?a+1:o+1,i>o&&(i=o,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(o=l.length,i=s.length,o-i<0&&(i=o,r=s,s=l,l=r),t=0;i;)t=(l[--i]=l[i]+s[i]+t)/Lr|0,l[i]%=Lr;for(t&&(l.unshift(t),++n),o=l.length;l[--o]==0;)l.pop();return e.d=l,e.e=gu(l,n),Le?Te(e,u,c):e};xe.precision=xe.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Xn+e);return r.d?(t=nv(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};xe.round=function(){var e=this,t=e.constructor;return Te(new t(e),e.e+1,t.rounding)};xe.sine=xe.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+Ie,n.rounding=1,r=HN(n,sv(n,r)),n.precision=e,n.rounding=t,Te(xn>2?r.neg():r,e,t,!0)):new n(NaN)};xe.squareRoot=xe.sqrt=function(){var e,t,r,n,i,a,o=this,u=o.d,c=o.e,l=o.s,s=o.constructor;if(l!==1||!u||!u[0])return new s(!l||l<0&&(!u||u[0])?NaN:u?o:1/0);for(Le=!1,l=Math.sqrt(+o),l==0||l==1/0?(t=Vt(u),(t.length+c)%2==0&&(t+="0"),l=Math.sqrt(t),c=Yt((c+1)/2)-(c<0||c%2),l==1/0?t="5e"+c:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+c),n=new s(t)):n=new s(l.toString()),r=(c=s.precision)+3;;)if(a=n,n=a.plus(xt(o,a,r+2,1)).times(.5),Vt(a.d).slice(0,r)===(t=Vt(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(Te(a,c+1,0),a.times(a).eq(o))){n=a;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(Te(n,c+1,1),e=!n.times(n).eq(o));break}return Le=!0,Te(n,c,s.rounding,e)};xe.tangent=xe.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=xt(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,Te(xn==2||xn==4?r.neg():r,e,t,!0)):new n(NaN)};xe.times=xe.mul=function(e){var t,r,n,i,a,o,u,c,l,s=this,f=s.constructor,p=s.d,m=(e=new f(e)).d;if(e.s*=s.s,!p||!p[0]||!m||!m[0])return new f(!e.s||p&&!p[0]&&!m||m&&!m[0]&&!p?NaN:!p||!m?e.s/0:e.s*0);for(r=Yt(s.e/Ie)+Yt(e.e/Ie),c=p.length,l=m.length,c<l&&(a=p,p=m,m=a,o=c,c=l,l=o),a=[],o=c+l,n=o;n--;)a.push(0);for(n=l;--n>=0;){for(t=0,i=c+n;i>n;)u=a[i]+m[n]*p[i-n-1]+t,a[i--]=u%Lr|0,t=u/Lr|0;a[i]=(a[i]+t)%Lr|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=gu(a,r),Le?Te(e,f.precision,f.rounding):e};xe.toBinary=function(e,t){return bl(this,2,e,t)};xe.toDecimalPlaces=xe.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(gr(e,0,ni),t===void 0?t=n.rounding:gr(t,0,8),Te(r,e+r.e+1,t))};xe.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=on(n,!0):(gr(e,0,ni),t===void 0?t=i.rounding:gr(t,0,8),n=Te(new i(n),e+1,t),r=on(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};xe.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?r=on(i):(gr(e,0,ni),t===void 0?t=a.rounding:gr(t,0,8),n=Te(new a(i),e+i.e+1,t),r=on(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};xe.toFraction=function(e){var t,r,n,i,a,o,u,c,l,s,f,p,m=this,d=m.d,h=m.constructor;if(!d)return new h(m);if(l=r=new h(1),n=c=new h(0),t=new h(n),a=t.e=nv(d)-m.e-1,o=a%Ie,t.d[0]=Ft(10,o<0?Ie+o:o),e==null)e=a>0?t:l;else{if(u=new h(e),!u.isInt()||u.lt(l))throw Error(Xn+u);e=u.gt(t)?a>0?t:l:u}for(Le=!1,u=new h(Vt(d)),s=h.precision,h.precision=a=d.length*Ie*2;f=xt(u,t,0,1,1),i=r.plus(f.times(n)),i.cmp(e)!=1;)r=n,n=i,i=l,l=c.plus(f.times(i)),c=i,i=t,t=u.minus(f.times(i)),u=i;return i=xt(e.minus(r),n,0,1,1),c=c.plus(i.times(l)),r=r.plus(i.times(n)),c.s=l.s=m.s,p=xt(l,n,a,1).minus(m).abs().cmp(xt(c,r,a,1).minus(m).abs())<1?[l,n]:[c,r],h.precision=s,Le=!0,p};xe.toHexadecimal=xe.toHex=function(e,t){return bl(this,16,e,t)};xe.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:gr(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(Le=!1,r=xt(r,e,0,t,1).times(e),Le=!0,Te(r)):(e.s=r.s,r=e),r};xe.toNumber=function(){return+this};xe.toOctal=function(e,t){return bl(this,8,e,t)};xe.toPower=xe.pow=function(e){var t,r,n,i,a,o,u=this,c=u.constructor,l=+(e=new c(e));if(!u.d||!e.d||!u.d[0]||!e.d[0])return new c(Ft(+u,l));if(u=new c(u),u.eq(1))return u;if(n=c.precision,a=c.rounding,e.eq(1))return Te(u,n,a);if(t=Yt(e.e/Ie),t>=e.d.length-1&&(r=l<0?-l:l)<=PN)return i=iv(c,u,r,n),e.s<0?new c(1).div(i):Te(i,n,a);if(o=u.s,o<0){if(t<e.d.length-1)return new c(NaN);if(e.d[t]&1||(o=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=o,u}return r=Ft(+u,l),t=r==0||!isFinite(r)?Yt(l*(Math.log("0."+Vt(u.d))/Math.LN10+u.e+1)):new c(r+"").e,t>c.maxE+1||t<c.minE-1?new c(t>0?o/0:0):(Le=!1,c.rounding=u.s=1,r=Math.min(12,(t+"").length),i=Bc(e.times(Kn(u,n+r)),n),i.d&&(i=Te(i,n+5,1),ao(i.d,n,a)&&(t=n+10,i=Te(Bc(e.times(Kn(u,t+r)),t),t+5,1),+Vt(i.d).slice(n+1,n+15)+1==1e14&&(i=Te(i,n+1,0)))),i.s=o,Le=!0,c.rounding=a,Te(i,n,a))};xe.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=on(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(gr(e,1,ni),t===void 0?t=i.rounding:gr(t,0,8),n=Te(new i(n),e,t),r=on(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};xe.toSignificantDigits=xe.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(gr(e,1,ni),t===void 0?t=n.rounding:gr(t,0,8)),Te(new n(r),e,t)};xe.toString=function(){var e=this,t=e.constructor,r=on(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};xe.truncated=xe.trunc=function(){return Te(new this.constructor(this),this.e+1,1)};xe.valueOf=xe.toJSON=function(){var e=this,t=e.constructor,r=on(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Vt(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)n=e[t]+"",r=Ie-n.length,r&&(a+=Pn(r)),a+=n;o=e[t],n=o+"",r=Ie-n.length,r&&(a+=Pn(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}function gr(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Xn+e)}function ao(e,t,r,n){var i,a,o,u;for(a=e[0];a>=10;a/=10)--t;return--t<0?(t+=Ie,i=0):(i=Math.ceil((t+1)/Ie),t%=Ie),a=Ft(10,Ie-t),u=e[i]%a|0,n==null?t<3?(t==0?u=u/100|0:t==1&&(u=u/10|0),o=r<4&&u==99999||r>3&&u==49999||u==5e4||u==0):o=(r<4&&u+1==a||r>3&&u+1==a/2)&&(e[i+1]/a/100|0)==Ft(10,t-2)-1||(u==a/2||u==0)&&(e[i+1]/a/100|0)==0:t<4?(t==0?u=u/1e3|0:t==1?u=u/100|0:t==2&&(u=u/10|0),o=(n||r<4)&&u==9999||!n&&r>3&&u==4999):o=((n||r<4)&&u+1==a||!n&&r>3&&u+1==a/2)&&(e[i+1]/a/1e3|0)==Ft(10,t-3)-1,o}function gs(e,t,r){for(var n,i=[0],a,o=0,u=e.length;o<u;){for(a=i.length;a--;)i[a]*=t;for(i[0]+=Fc.indexOf(e.charAt(o++)),n=0;n<i.length;n++)i[n]>r-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function UN(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/vu(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=pa(e,1,t.times(i),new e(1));for(var a=r;a--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=r,t}var xt=function(){function e(n,i,a){var o,u=0,c=n.length;for(n=n.slice();c--;)o=n[c]*i+u,n[c]=o%a|0,u=o/a|0;return u&&n.unshift(u),n}function t(n,i,a,o){var u,c;if(a!=o)c=a>o?1:-1;else for(u=c=0;u<a;u++)if(n[u]!=i[u]){c=n[u]>i[u]?1:-1;break}return c}function r(n,i,a,o){for(var u=0;a--;)n[a]-=u,u=n[a]<i[a]?1:0,n[a]=u*o+n[a]-i[a];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,a,o,u,c){var l,s,f,p,m,d,h,w,v,b,g,x,y,N,E,A,D,S,C,_,R=n.constructor,P=n.s==i.s?1:-1,I=n.d,O=i.d;if(!I||!I[0]||!O||!O[0])return new R(!n.s||!i.s||(I?O&&I[0]==O[0]:!O)?NaN:I&&I[0]==0||!O?P*0:P/0);for(c?(m=1,s=n.e-i.e):(c=Lr,m=Ie,s=Yt(n.e/m)-Yt(i.e/m)),C=O.length,D=I.length,v=new R(P),b=v.d=[],f=0;O[f]==(I[f]||0);f++);if(O[f]>(I[f]||0)&&s--,a==null?(N=a=R.precision,o=R.rounding):u?N=a+(n.e-i.e)+1:N=a,N<0)b.push(1),d=!0;else{if(N=N/m+2|0,f=0,C==1){for(p=0,O=O[0],N++;(f<D||p)&&N--;f++)E=p*c+(I[f]||0),b[f]=E/O|0,p=E%O|0;d=p||f<D}else{for(p=c/(O[0]+1)|0,p>1&&(O=e(O,p,c),I=e(I,p,c),C=O.length,D=I.length),A=C,g=I.slice(0,C),x=g.length;x<C;)g[x++]=0;_=O.slice(),_.unshift(0),S=O[0],O[1]>=c/2&&++S;do p=0,l=t(O,g,C,x),l<0?(y=g[0],C!=x&&(y=y*c+(g[1]||0)),p=y/S|0,p>1?(p>=c&&(p=c-1),h=e(O,p,c),w=h.length,x=g.length,l=t(h,g,w,x),l==1&&(p--,r(h,C<w?_:O,w,c))):(p==0&&(l=p=1),h=O.slice()),w=h.length,w<x&&h.unshift(0),r(g,h,x,c),l==-1&&(x=g.length,l=t(O,g,C,x),l<1&&(p++,r(g,C<x?_:O,x,c))),x=g.length):l===0&&(p++,g=[0]),b[f++]=p,l&&g[0]?g[x++]=I[A]||0:(g=[I[A]],x=1);while((A++<D||g[0]!==void 0)&&N--);d=g[0]!==void 0}b[0]||b.shift()}if(m==1)v.e=s,Xg=d;else{for(f=1,p=b[0];p>=10;p/=10)f++;v.e=f+s*m-1,Te(v,u?a+v.e+1:a,o,d)}return v}}();function Te(e,t,r,n){var i,a,o,u,c,l,s,f,p,m=e.constructor;e:if(t!=null){if(f=e.d,!f)return e;for(i=1,u=f[0];u>=10;u/=10)i++;if(a=t-i,a<0)a+=Ie,o=t,s=f[p=0],c=s/Ft(10,i-o-1)%10|0;else if(p=Math.ceil((a+1)/Ie),u=f.length,p>=u)if(n){for(;u++<=p;)f.push(0);s=c=0,i=1,a%=Ie,o=a-Ie+1}else break e;else{for(s=u=f[p],i=1;u>=10;u/=10)i++;a%=Ie,o=a-Ie+i,c=o<0?0:s/Ft(10,i-o-1)%10|0}if(n=n||t<0||f[p+1]!==void 0||(o<0?s:s%Ft(10,i-o-1)),l=r<4?(c||n)&&(r==0||r==(e.s<0?3:2)):c>5||c==5&&(r==4||n||r==6&&(a>0?o>0?s/Ft(10,i-o):0:f[p-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,l?(t-=e.e+1,f[0]=Ft(10,(Ie-t%Ie)%Ie),e.e=-t||0):f[0]=e.e=0,e;if(a==0?(f.length=p,u=1,p--):(f.length=p+1,u=Ft(10,Ie-a),f[p]=o>0?(s/Ft(10,i-o)%Ft(10,o)|0)*u:0),l)for(;;)if(p==0){for(a=1,o=f[0];o>=10;o/=10)a++;for(o=f[0]+=u,u=1;o>=10;o/=10)u++;a!=u&&(e.e++,f[0]==Lr&&(f[0]=1));break}else{if(f[p]+=u,f[p]!=Lr)break;f[p--]=0,u=1}for(a=f.length;f[--a]===0;)f.pop()}return Le&&(e.e>m.maxE?(e.d=null,e.e=NaN):e.e<m.minE&&(e.e=0,e.d=[0])),e}function on(e,t,r){if(!e.isFinite())return ov(e);var n,i=e.e,a=Vt(e.d),o=a.length;return t?(r&&(n=r-o)>0?a=a.charAt(0)+"."+a.slice(1)+Pn(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):i<0?(a="0."+Pn(-i-1)+a,r&&(n=r-o)>0&&(a+=Pn(n))):i>=o?(a+=Pn(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Pn(n))):((n=i+1)<o&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(a+="."),a+=Pn(n))),a}function gu(e,t){var r=e[0];for(t*=Ie;r>=10;r/=10)t++;return t}function Ts(e,t,r){if(t>VN)throw Le=!0,r&&(e.precision=r),Error(Yg);return Te(new e(_s),t,1,!0)}function zr(e,t,r){if(t>Oc)throw Error(Yg);return Te(new e(Fs),t,r,!0)}function nv(e){var t=e.length-1,r=t*Ie+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Pn(e){for(var t="";e--;)t+="0";return t}function iv(e,t,r,n){var i,a=new e(1),o=Math.ceil(n/Ie+4);for(Le=!1;;){if(r%2&&(a=a.times(t),Wf(a.d,o)&&(i=!0)),r=Yt(r/2),r===0){r=a.d.length-1,i&&a.d[r]===0&&++a.d[r];break}t=t.times(t),Wf(t.d,o)}return Le=!0,a}function Gf(e){return e.d[e.d.length-1]&1}function av(e,t,r){for(var n,i=new e(t[0]),a=0;++a<t.length;)if(n=new e(t[a]),n.s)i[r](n)&&(i=n);else{i=n;break}return i}function Bc(e,t){var r,n,i,a,o,u,c,l=0,s=0,f=0,p=e.constructor,m=p.rounding,d=p.precision;if(!e.d||!e.d[0]||e.e>17)return new p(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(Le=!1,c=d):c=t,u=new p(.03125);e.e>-2;)e=e.times(u),f+=5;for(n=Math.log(Ft(2,f))/Math.LN10*2+5|0,c+=n,r=a=o=new p(1),p.precision=c;;){if(a=Te(a.times(e),c,1),r=r.times(++s),u=o.plus(xt(a,r,c,1)),Vt(u.d).slice(0,c)===Vt(o.d).slice(0,c)){for(i=f;i--;)o=Te(o.times(o),c,1);if(t==null)if(l<3&&ao(o.d,c-n,m,l))p.precision=c+=10,r=a=u=new p(1),s=0,l++;else return Te(o,p.precision=d,m,Le=!0);else return p.precision=d,o}o=u}}function Kn(e,t){var r,n,i,a,o,u,c,l,s,f,p,m=1,d=10,h=e,w=h.d,v=h.constructor,b=v.rounding,g=v.precision;if(h.s<0||!w||!w[0]||!h.e&&w[0]==1&&w.length==1)return new v(w&&!w[0]?-1/0:h.s!=1?NaN:w?0:h);if(t==null?(Le=!1,s=g):s=t,v.precision=s+=d,r=Vt(w),n=r.charAt(0),Math.abs(a=h.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=Vt(h.d),n=r.charAt(0),m++;a=h.e,n>1?(h=new v("0."+r),a++):h=new v(n+"."+r.slice(1))}else return l=Ts(v,s+2,g).times(a+""),h=Kn(new v(n+"."+r.slice(1)),s-d).plus(l),v.precision=g,t==null?Te(h,g,b,Le=!0):h;for(f=h,c=o=h=xt(h.minus(1),h.plus(1),s,1),p=Te(h.times(h),s,1),i=3;;){if(o=Te(o.times(p),s,1),l=c.plus(xt(o,new v(i),s,1)),Vt(l.d).slice(0,s)===Vt(c.d).slice(0,s))if(c=c.times(2),a!==0&&(c=c.plus(Ts(v,s+2,g).times(a+""))),c=xt(c,new v(m),s,1),t==null)if(ao(c.d,s-d,b,u))v.precision=s+=d,l=o=h=xt(f.minus(1),f.plus(1),s,1),p=Te(h.times(h),s,1),i=u=1;else return Te(c,v.precision=g,b,Le=!0);else return v.precision=g,c;c=l,i+=2}}function ov(e){return String(e.s*e.s/0)}function kc(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%Ie,r<0&&(n+=Ie),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=Ie;n<i;)e.d.push(+t.slice(n,n+=Ie));t=t.slice(n),n=Ie-t.length}else n-=i;for(;n--;)t+="0";e.d.push(+t),Le&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function $N(e,t){var r,n,i,a,o,u,c,l,s;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),rv.test(t))return kc(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(jN.test(t))r=16,t=t.toLowerCase();else if(zN.test(t))r=2;else if(LN.test(t))r=8;else throw Error(Xn+t);for(a=t.search(/p/i),a>0?(c=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),a=t.indexOf("."),o=a>=0,n=e.constructor,o&&(t=t.replace(".",""),u=t.length,a=u-a,i=iv(n,new n(r),a,a*2)),l=gs(t,r,Lr),s=l.length-1,a=s;l[a]===0;--a)l.pop();return a<0?new n(e.s*0):(e.e=gu(l,s),e.d=l,Le=!1,o&&(e=xt(e,i,u*4)),c&&(e=e.times(Math.abs(c)<54?Ft(2,c):Yn.pow(2,c))),Le=!0,e)}function HN(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:pa(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/vu(5,r)),t=pa(e,2,t,t);for(var i,a=new e(5),o=new e(16),u=new e(20);r--;)i=t.times(t),t=t.times(a.plus(i.times(o.times(i).minus(u))));return t}function pa(e,t,r,n,i){var a,o,u,c,l=e.precision,s=Math.ceil(l/Ie);for(Le=!1,c=r.times(r),u=new e(n);;){if(o=xt(u.times(c),new e(t++*t++),l,1),u=i?n.plus(o):n.minus(o),n=xt(o.times(c),new e(t++*t++),l,1),o=u.plus(n),o.d[s]!==void 0){for(a=s;o.d[a]===u.d[a]&&a--;);if(a==-1)break}a=u,u=n,n=o,o=a}return Le=!0,o.d.length=s+1,o}function vu(e,t){for(var r=e;--t;)r*=e;return r}function sv(e,t){var r,n=t.s<0,i=zr(e,e.precision,1),a=i.times(.5);if(t=t.abs(),t.lte(a))return xn=n?4:1,t;if(r=t.divToInt(i),r.isZero())xn=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(a))return xn=Gf(r)?n?2:3:n?4:1,t;xn=Gf(r)?n?1:4:n?3:2}return t.minus(i).abs()}function bl(e,t,r,n){var i,a,o,u,c,l,s,f,p,m=e.constructor,d=r!==void 0;if(d?(gr(r,1,ni),n===void 0?n=m.rounding:gr(n,0,8)):(r=m.precision,n=m.rounding),!e.isFinite())s=ov(e);else{for(s=on(e),o=s.indexOf("."),d?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,o>=0&&(s=s.replace(".",""),p=new m(1),p.e=s.length-o,p.d=gs(on(p),10,i),p.e=p.d.length),f=gs(s,10,i),a=c=f.length;f[--c]==0;)f.pop();if(!f[0])s=d?"0p+0":"0";else{if(o<0?a--:(e=new m(e),e.d=f,e.e=a,e=xt(e,p,r,n,0,i),f=e.d,a=e.e,l=Xg),o=f[r],u=i/2,l=l||f[r+1]!==void 0,l=n<4?(o!==void 0||l)&&(n===0||n===(e.s<0?3:2)):o>u||o===u&&(n===4||l||n===6&&f[r-1]&1||n===(e.s<0?8:7)),f.length=r,l)for(;++f[--r]>i-1;)f[r]=0,r||(++a,f.unshift(1));for(c=f.length;!f[c-1];--c);for(o=0,s="";o<c;o++)s+=Fc.charAt(f[o]);if(d){if(c>1)if(t==16||t==8){for(o=t==16?4:3,--c;c%o;c++)s+="0";for(f=gs(s,i,t),c=f.length;!f[c-1];--c);for(o=1,s="1.";o<c;o++)s+=Fc.charAt(f[o])}else s=s.charAt(0)+"."+s.slice(1);s=s+(a<0?"p":"p+")+a}else if(a<0){for(;++a;)s="0"+s;s="0."+s}else if(++a>c)for(a-=c;a--;)s+="0";else a<c&&(s=s.slice(0,a)+"."+s.slice(a))}s=(t==16?"0x":t==2?"0b":t==8?"0o":"")+s}return e.s<0?"-"+s:s}function Wf(e,t){if(e.length>t)return e.length=t,!0}function JN(e){return new this(e).abs()}function GN(e){return new this(e).acos()}function WN(e){return new this(e).acosh()}function KN(e,t){return new this(e).plus(t)}function QN(e){return new this(e).asin()}function ZN(e){return new this(e).asinh()}function XN(e){return new this(e).atan()}function YN(e){return new this(e).atanh()}function e2(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,a=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=zr(this,a,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?zr(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=zr(this,a,1).times(.5),r.s=e.s):t.s<0?(this.precision=a,this.rounding=1,r=this.atan(xt(e,t,a,1)),t=zr(this,a,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(xt(e,t,a,1)),r}function t2(e){return new this(e).cbrt()}function r2(e){return Te(e=new this(e),e.e+1,2)}function n2(e,t,r){return new this(e).clamp(t,r)}function i2(e){if(!e||typeof e!="object")throw Error(hu+"Object expected");var t,r,n,i=e.defaults===!0,a=["precision",1,ni,"rounding",0,8,"toExpNeg",-ta,0,"toExpPos",0,ta,"maxE",0,ta,"minE",-ta,0,"modulo",0,9];for(t=0;t<a.length;t+=3)if(r=a[t],i&&(this[r]=Tc[r]),(n=e[r])!==void 0)if(Yt(n)===n&&n>=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(Xn+r+": "+n);if(r="crypto",i&&(this[r]=Tc[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(ev);else this[r]=!1;else throw Error(Xn+r+": "+n);return this}function a2(e){return new this(e).cos()}function o2(e){return new this(e).cosh()}function uv(e){var t,r,n;function i(a){var o,u,c,l=this;if(!(l instanceof i))return new i(a);if(l.constructor=i,Kf(a)){l.s=a.s,Le?!a.d||a.e>i.maxE?(l.e=NaN,l.d=null):a.e<i.minE?(l.e=0,l.d=[0]):(l.e=a.e,l.d=a.d.slice()):(l.e=a.e,l.d=a.d?a.d.slice():a.d);return}if(c=typeof a,c==="number"){if(a===0){l.s=1/a<0?-1:1,l.e=0,l.d=[0];return}if(a<0?(a=-a,l.s=-1):l.s=1,a===~~a&&a<1e7){for(o=0,u=a;u>=10;u/=10)o++;Le?o>i.maxE?(l.e=NaN,l.d=null):o<i.minE?(l.e=0,l.d=[0]):(l.e=o,l.d=[a]):(l.e=o,l.d=[a]);return}else if(a*0!==0){a||(l.s=NaN),l.e=NaN,l.d=null;return}return kc(l,a.toString())}else if(c!=="string")throw Error(Xn+a);return(u=a.charCodeAt(0))===45?(a=a.slice(1),l.s=-1):(u===43&&(a=a.slice(1)),l.s=1),rv.test(a)?kc(l,a):$N(l,a)}if(i.prototype=xe,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=i2,i.clone=uv,i.isDecimal=Kf,i.abs=JN,i.acos=GN,i.acosh=WN,i.add=KN,i.asin=QN,i.asinh=ZN,i.atan=XN,i.atanh=YN,i.atan2=e2,i.cbrt=t2,i.ceil=r2,i.clamp=n2,i.cos=a2,i.cosh=o2,i.div=s2,i.exp=u2,i.floor=c2,i.hypot=l2,i.ln=f2,i.log=p2,i.log10=d2,i.log2=m2,i.max=h2,i.min=g2,i.mod=v2,i.mul=y2,i.pow=x2,i.random=b2,i.round=w2,i.sign=N2,i.sin=D2,i.sinh=E2,i.sqrt=A2,i.sub=S2,i.sum=C2,i.tan=M2,i.tanh=_2,i.trunc=F2,e===void 0&&(e={}),e&&e.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function s2(e,t){return new this(e).div(t)}function u2(e){return new this(e).exp()}function c2(e){return Te(e=new this(e),e.e+1,3)}function l2(){var e,t,r=new this(0);for(Le=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return Le=!0,new this(1/0);r=t}return Le=!0,r.sqrt()}function Kf(e){return e instanceof Yn||e&&e.toStringTag===tv||!1}function f2(e){return new this(e).ln()}function p2(e,t){return new this(e).log(t)}function m2(e){return new this(e).log(2)}function d2(e){return new this(e).log(10)}function h2(){return av(this,arguments,"lt")}function g2(){return av(this,arguments,"gt")}function v2(e,t){return new this(e).mod(t)}function y2(e,t){return new this(e).mul(t)}function x2(e,t){return new this(e).pow(t)}function b2(e){var t,r,n,i,a=0,o=new this(1),u=[];if(e===void 0?e=this.precision:gr(e,1,ni),n=Math.ceil(e/Ie),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));a<n;)i=t[a],i>=429e7?t[a]=crypto.getRandomValues(new Uint32Array(1))[0]:u[a++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);a<n;)i=t[a]+(t[a+1]<<8)+(t[a+2]<<16)+((t[a+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,a):(u.push(i%1e7),a+=4);a=n/4}else throw Error(ev);else for(;a<n;)u[a++]=Math.random()*1e7|0;for(n=u[--a],e%=Ie,n&&e&&(i=Ft(10,Ie-e),u[a]=(n/i|0)*i);u[a]===0;a--)u.pop();if(a<0)r=0,u=[0];else{for(r=-1;u[0]===0;r-=Ie)u.shift();for(n=1,i=u[0];i>=10;i/=10)n++;n<Ie&&(r-=Ie-n)}return o.e=r,o.d=u,o}function w2(e){return Te(e=new this(e),e.e+1,this.rounding)}function N2(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function D2(e){return new this(e).sin()}function E2(e){return new this(e).sinh()}function A2(e){return new this(e).sqrt()}function S2(e,t){return new this(e).sub(t)}function C2(){var e=0,t=arguments,r=new this(t[e]);for(Le=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return Le=!0,Te(r,this.precision,this.rounding)}function M2(e){return new this(e).tan()}function _2(e){return new this(e).tanh()}function F2(e){return Te(e=new this(e),e.e+1,1)}xe[Symbol.for("nodejs.util.inspect.custom")]=xe.toString;xe[Symbol.toStringTag]="Decimal";var Yn=xe.constructor=uv(Tc);_s=new Yn(_s);Fs=new Yn(Fs);var T2="BigNumber",O2=["?on","config"],B2=U(T2,O2,e=>{var{on:t,config:r}=e,n=Yn.clone({precision:r.precision,modulo:Yn.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(i){return new n(i.value)},t&&t("config",function(i,a){i.precision!==a.precision&&n.config({precision:i.precision})}),n},{isClass:!0}),qi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function k2(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var cv={exports:{}};/**
|
|
14
|
+
*/var ra=9e15,ni=1e9,Tc="0123456789abcdef",Fs="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Ts="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Oc={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ra,maxE:ra,crypto:!1},Yg,bn,Le=!0,gu="[DecimalError] ",Xn=gu+"Invalid argument: ",ev=gu+"Precision limit exceeded",tv=gu+"crypto unavailable",rv="[object Decimal]",Yt=Math.floor,Ft=Math.pow,LN=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,PN=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,VN=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,nv=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Lr=1e7,Ie=7,UN=9007199254740991,$N=Fs.length-1,Bc=Ts.length-1,be={toStringTag:rv};be.absoluteValue=be.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),Te(e)};be.ceil=function(){return Te(new this.constructor(this),this.e+1,2)};be.clampedTo=be.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Xn+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};be.comparedTo=be.cmp=function(e){var t,r,n,i,a=this,o=a.d,u=(e=new a.constructor(e)).d,c=a.s,l=e.s;if(!o||!u)return!c||!l?NaN:c!==l?c:o===u?0:!o^c<0?1:-1;if(!o[0]||!u[0])return o[0]?c:u[0]?-l:0;if(c!==l)return c;if(a.e!==e.e)return a.e>e.e^c<0?1:-1;for(n=o.length,i=u.length,t=0,r=n<i?n:i;t<r;++t)if(o[t]!==u[t])return o[t]>u[t]^c<0?1:-1;return n===i?0:n>i^c<0?1:-1};be.cosine=be.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+Ie,n.rounding=1,r=HN(n,uv(n,r)),n.precision=e,n.rounding=t,Te(bn==2||bn==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};be.cubeRoot=be.cbrt=function(){var e,t,r,n,i,a,o,u,c,l,s=this,f=s.constructor;if(!s.isFinite()||s.isZero())return new f(s);for(Le=!1,a=s.s*Ft(s.s*s,1/3),!a||Math.abs(a)==1/0?(r=Vt(s.d),e=s.e,(a=(e-r.length+1)%3)&&(r+=a==1||a==-2?"0":"00"),a=Ft(r,1/3),e=Yt((e+1)/3)-(e%3==(e<0?-1:2)),a==1/0?r="5e"+e:(r=a.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new f(r),n.s=s.s):n=new f(a.toString()),o=(e=f.precision)+3;;)if(u=n,c=u.times(u).times(u),l=c.plus(s),n=bt(l.plus(s).times(u),l.plus(c),o+2,1),Vt(u.d).slice(0,o)===(r=Vt(n.d)).slice(0,o))if(r=r.slice(o-3,o+1),r=="9999"||!i&&r=="4999"){if(!i&&(Te(u,e+1,0),u.times(u).times(u).eq(s))){n=u;break}o+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(Te(n,e+1,1),t=!n.times(n).times(n).eq(s));break}return Le=!0,Te(n,e,f.rounding,t)};be.decimalPlaces=be.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-Yt(this.e/Ie))*Ie,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};be.dividedBy=be.div=function(e){return bt(this,new this.constructor(e))};be.dividedToIntegerBy=be.divToInt=function(e){var t=this,r=t.constructor;return Te(bt(t,new r(e),0,1,1),r.precision,r.rounding)};be.equals=be.eq=function(e){return this.cmp(e)===0};be.floor=function(){return Te(new this.constructor(this),this.e+1,3)};be.greaterThan=be.gt=function(e){return this.cmp(e)>0};be.greaterThanOrEqualTo=be.gte=function(e){var t=this.cmp(e);return t==1||t===0};be.hyperbolicCosine=be.cosh=function(){var e,t,r,n,i,a=this,o=a.constructor,u=new o(1);if(!a.isFinite())return new o(a.s?1/0:NaN);if(a.isZero())return u;r=o.precision,n=o.rounding,o.precision=r+Math.max(a.e,a.sd())+4,o.rounding=1,i=a.d.length,i<32?(e=Math.ceil(i/3),t=(1/yu(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),a=ma(o,1,a.times(t),new o(1),!0);for(var c,l=e,s=new o(8);l--;)c=a.times(a),a=u.minus(c.times(s.minus(c.times(s))));return Te(a,o.precision=r,o.rounding=n,!0)};be.hyperbolicSine=be.sinh=function(){var e,t,r,n,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(t=a.precision,r=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,n=i.d.length,n<3)i=ma(a,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/yu(5,e)),i=ma(a,2,i,i,!0);for(var o,u=new a(5),c=new a(16),l=new a(20);e--;)o=i.times(i),i=i.times(u.plus(o.times(c.times(o).plus(l))))}return a.precision=t,a.rounding=r,Te(i,t,r,!0)};be.hyperbolicTangent=be.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,bt(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};be.inverseCosine=be.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,a=r.rounding;return n!==-1?n===0?t.isNeg()?zr(r,i,a):new r(0):new r(NaN):t.isZero()?zr(r,i+4,a).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=zr(r,i+4,a).times(.5),r.precision=i,r.rounding=a,e.minus(t))};be.inverseHyperbolicCosine=be.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,Le=!1,r=r.times(r).minus(1).sqrt().plus(r),Le=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};be.inverseHyperbolicSine=be.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,Le=!1,r=r.times(r).plus(1).sqrt().plus(r),Le=!0,n.precision=e,n.rounding=t,r.ln())};be.inverseHyperbolicTangent=be.atanh=function(){var e,t,r,n,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=a.precision,t=a.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?Te(new a(i),e,t,!0):(a.precision=r=n-i.e,i=bt(i.plus(1),new a(1).minus(i),r+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=t,i.times(.5))):new a(NaN)};be.inverseSine=be.asin=function(){var e,t,r,n,i=this,a=i.constructor;return i.isZero()?new a(i):(t=i.abs().cmp(1),r=a.precision,n=a.rounding,t!==-1?t===0?(e=zr(a,r+4,n).times(.5),e.s=i.s,e):new a(NaN):(a.precision=r+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=r,a.rounding=n,i.times(2)))};be.inverseTangent=be.atan=function(){var e,t,r,n,i,a,o,u,c,l=this,s=l.constructor,f=s.precision,p=s.rounding;if(l.isFinite()){if(l.isZero())return new s(l);if(l.abs().eq(1)&&f+4<=Bc)return o=zr(s,f+4,p).times(.25),o.s=l.s,o}else{if(!l.s)return new s(NaN);if(f+4<=Bc)return o=zr(s,f+4,p).times(.5),o.s=l.s,o}for(s.precision=u=f+10,s.rounding=1,r=Math.min(28,u/Ie+2|0),e=r;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(Le=!1,t=Math.ceil(u/Ie),n=1,c=l.times(l),o=new s(l),i=l;e!==-1;)if(i=i.times(c),a=o.minus(i.div(n+=2)),i=i.times(c),o=a.plus(i.div(n+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===a.d[e]&&e--;);return r&&(o=o.times(2<<r-1)),Le=!0,Te(o,s.precision=f,s.rounding=p,!0)};be.isFinite=function(){return!!this.d};be.isInteger=be.isInt=function(){return!!this.d&&Yt(this.e/Ie)>this.d.length-2};be.isNaN=function(){return!this.s};be.isNegative=be.isNeg=function(){return this.s<0};be.isPositive=be.isPos=function(){return this.s>0};be.isZero=function(){return!!this.d&&this.d[0]===0};be.lessThan=be.lt=function(e){return this.cmp(e)<0};be.lessThanOrEqualTo=be.lte=function(e){return this.cmp(e)<1};be.logarithm=be.log=function(e){var t,r,n,i,a,o,u,c,l=this,s=l.constructor,f=s.precision,p=s.rounding,m=5;if(e==null)e=new s(10),t=!0;else{if(e=new s(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new s(NaN);t=e.eq(10)}if(r=l.d,l.s<0||!r||!r[0]||l.eq(1))return new s(r&&!r[0]?-1/0:l.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)a=!0;else{for(i=r[0];i%10===0;)i/=10;a=i!==1}if(Le=!1,u=f+m,o=Kn(l,u),n=t?Os(s,u+10):Kn(e,u),c=bt(o,n,u,1),oo(c.d,i=f,p))do if(u+=10,o=Kn(l,u),n=t?Os(s,u+10):Kn(e,u),c=bt(o,n,u,1),!a){+Vt(c.d).slice(i+1,i+15)+1==1e14&&(c=Te(c,f+1,0));break}while(oo(c.d,i+=10,p));return Le=!0,Te(c,f,p)};be.minus=be.sub=function(e){var t,r,n,i,a,o,u,c,l,s,f,p,m=this,d=m.constructor;if(e=new d(e),!m.d||!e.d)return!m.s||!e.s?e=new d(NaN):m.d?e.s=-e.s:e=new d(e.d||m.s!==e.s?m:NaN),e;if(m.s!=e.s)return e.s=-e.s,m.plus(e);if(l=m.d,p=e.d,u=d.precision,c=d.rounding,!l[0]||!p[0]){if(p[0])e.s=-e.s;else if(l[0])e=new d(m);else return new d(c===3?-0:0);return Le?Te(e,u,c):e}if(r=Yt(e.e/Ie),s=Yt(m.e/Ie),l=l.slice(),a=s-r,a){for(f=a<0,f?(t=l,a=-a,o=p.length):(t=p,r=s,o=l.length),n=Math.max(Math.ceil(u/Ie),o)+2,a>n&&(a=n,t.length=1),t.reverse(),n=a;n--;)t.push(0);t.reverse()}else{for(n=l.length,o=p.length,f=n<o,f&&(o=n),n=0;n<o;n++)if(l[n]!=p[n]){f=l[n]<p[n];break}a=0}for(f&&(t=l,l=p,p=t,e.s=-e.s),o=l.length,n=p.length-o;n>0;--n)l[o++]=0;for(n=p.length;n>a;){if(l[--n]<p[n]){for(i=n;i&&l[--i]===0;)l[i]=Lr-1;--l[i],l[n]+=Lr}l[n]-=p[n]}for(;l[--o]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(e.d=l,e.e=vu(l,r),Le?Te(e,u,c):e):new d(c===3?-0:0)};be.modulo=be.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?Te(new n(r),n.precision,n.rounding):(Le=!1,n.modulo==9?(t=bt(r,e.abs(),0,3,1),t.s*=e.s):t=bt(r,e,0,n.modulo,1),t=t.times(e),Le=!0,r.minus(t))};be.naturalExponential=be.exp=function(){return kc(this)};be.naturalLogarithm=be.ln=function(){return Kn(this)};be.negated=be.neg=function(){var e=new this.constructor(this);return e.s=-e.s,Te(e)};be.plus=be.add=function(e){var t,r,n,i,a,o,u,c,l,s,f=this,p=f.constructor;if(e=new p(e),!f.d||!e.d)return!f.s||!e.s?e=new p(NaN):f.d||(e=new p(e.d||f.s===e.s?f:NaN)),e;if(f.s!=e.s)return e.s=-e.s,f.minus(e);if(l=f.d,s=e.d,u=p.precision,c=p.rounding,!l[0]||!s[0])return s[0]||(e=new p(f)),Le?Te(e,u,c):e;if(a=Yt(f.e/Ie),n=Yt(e.e/Ie),l=l.slice(),i=a-n,i){for(i<0?(r=l,i=-i,o=s.length):(r=s,n=a,o=l.length),a=Math.ceil(u/Ie),o=a>o?a+1:o+1,i>o&&(i=o,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(o=l.length,i=s.length,o-i<0&&(i=o,r=s,s=l,l=r),t=0;i;)t=(l[--i]=l[i]+s[i]+t)/Lr|0,l[i]%=Lr;for(t&&(l.unshift(t),++n),o=l.length;l[--o]==0;)l.pop();return e.d=l,e.e=vu(l,n),Le?Te(e,u,c):e};be.precision=be.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Xn+e);return r.d?(t=iv(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};be.round=function(){var e=this,t=e.constructor;return Te(new t(e),e.e+1,t.rounding)};be.sine=be.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+Ie,n.rounding=1,r=GN(n,uv(n,r)),n.precision=e,n.rounding=t,Te(bn>2?r.neg():r,e,t,!0)):new n(NaN)};be.squareRoot=be.sqrt=function(){var e,t,r,n,i,a,o=this,u=o.d,c=o.e,l=o.s,s=o.constructor;if(l!==1||!u||!u[0])return new s(!l||l<0&&(!u||u[0])?NaN:u?o:1/0);for(Le=!1,l=Math.sqrt(+o),l==0||l==1/0?(t=Vt(u),(t.length+c)%2==0&&(t+="0"),l=Math.sqrt(t),c=Yt((c+1)/2)-(c<0||c%2),l==1/0?t="5e"+c:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+c),n=new s(t)):n=new s(l.toString()),r=(c=s.precision)+3;;)if(a=n,n=a.plus(bt(o,a,r+2,1)).times(.5),Vt(a.d).slice(0,r)===(t=Vt(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(Te(a,c+1,0),a.times(a).eq(o))){n=a;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(Te(n,c+1,1),e=!n.times(n).eq(o));break}return Le=!0,Te(n,c,s.rounding,e)};be.tangent=be.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=bt(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,Te(bn==2||bn==4?r.neg():r,e,t,!0)):new n(NaN)};be.times=be.mul=function(e){var t,r,n,i,a,o,u,c,l,s=this,f=s.constructor,p=s.d,m=(e=new f(e)).d;if(e.s*=s.s,!p||!p[0]||!m||!m[0])return new f(!e.s||p&&!p[0]&&!m||m&&!m[0]&&!p?NaN:!p||!m?e.s/0:e.s*0);for(r=Yt(s.e/Ie)+Yt(e.e/Ie),c=p.length,l=m.length,c<l&&(a=p,p=m,m=a,o=c,c=l,l=o),a=[],o=c+l,n=o;n--;)a.push(0);for(n=l;--n>=0;){for(t=0,i=c+n;i>n;)u=a[i]+m[n]*p[i-n-1]+t,a[i--]=u%Lr|0,t=u/Lr|0;a[i]=(a[i]+t)%Lr|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=vu(a,r),Le?Te(e,f.precision,f.rounding):e};be.toBinary=function(e,t){return wl(this,2,e,t)};be.toDecimalPlaces=be.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(gr(e,0,ni),t===void 0?t=n.rounding:gr(t,0,8),Te(r,e+r.e+1,t))};be.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=on(n,!0):(gr(e,0,ni),t===void 0?t=i.rounding:gr(t,0,8),n=Te(new i(n),e+1,t),r=on(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};be.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?r=on(i):(gr(e,0,ni),t===void 0?t=a.rounding:gr(t,0,8),n=Te(new a(i),e+i.e+1,t),r=on(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};be.toFraction=function(e){var t,r,n,i,a,o,u,c,l,s,f,p,m=this,d=m.d,h=m.constructor;if(!d)return new h(m);if(l=r=new h(1),n=c=new h(0),t=new h(n),a=t.e=iv(d)-m.e-1,o=a%Ie,t.d[0]=Ft(10,o<0?Ie+o:o),e==null)e=a>0?t:l;else{if(u=new h(e),!u.isInt()||u.lt(l))throw Error(Xn+u);e=u.gt(t)?a>0?t:l:u}for(Le=!1,u=new h(Vt(d)),s=h.precision,h.precision=a=d.length*Ie*2;f=bt(u,t,0,1,1),i=r.plus(f.times(n)),i.cmp(e)!=1;)r=n,n=i,i=l,l=c.plus(f.times(i)),c=i,i=t,t=u.minus(f.times(i)),u=i;return i=bt(e.minus(r),n,0,1,1),c=c.plus(i.times(l)),r=r.plus(i.times(n)),c.s=l.s=m.s,p=bt(l,n,a,1).minus(m).abs().cmp(bt(c,r,a,1).minus(m).abs())<1?[l,n]:[c,r],h.precision=s,Le=!0,p};be.toHexadecimal=be.toHex=function(e,t){return wl(this,16,e,t)};be.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:gr(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(Le=!1,r=bt(r,e,0,t,1).times(e),Le=!0,Te(r)):(e.s=r.s,r=e),r};be.toNumber=function(){return+this};be.toOctal=function(e,t){return wl(this,8,e,t)};be.toPower=be.pow=function(e){var t,r,n,i,a,o,u=this,c=u.constructor,l=+(e=new c(e));if(!u.d||!e.d||!u.d[0]||!e.d[0])return new c(Ft(+u,l));if(u=new c(u),u.eq(1))return u;if(n=c.precision,a=c.rounding,e.eq(1))return Te(u,n,a);if(t=Yt(e.e/Ie),t>=e.d.length-1&&(r=l<0?-l:l)<=UN)return i=av(c,u,r,n),e.s<0?new c(1).div(i):Te(i,n,a);if(o=u.s,o<0){if(t<e.d.length-1)return new c(NaN);if(e.d[t]&1||(o=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=o,u}return r=Ft(+u,l),t=r==0||!isFinite(r)?Yt(l*(Math.log("0."+Vt(u.d))/Math.LN10+u.e+1)):new c(r+"").e,t>c.maxE+1||t<c.minE-1?new c(t>0?o/0:0):(Le=!1,c.rounding=u.s=1,r=Math.min(12,(t+"").length),i=kc(e.times(Kn(u,n+r)),n),i.d&&(i=Te(i,n+5,1),oo(i.d,n,a)&&(t=n+10,i=Te(kc(e.times(Kn(u,t+r)),t),t+5,1),+Vt(i.d).slice(n+1,n+15)+1==1e14&&(i=Te(i,n+1,0)))),i.s=o,Le=!0,c.rounding=a,Te(i,n,a))};be.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=on(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(gr(e,1,ni),t===void 0?t=i.rounding:gr(t,0,8),n=Te(new i(n),e,t),r=on(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};be.toSignificantDigits=be.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(gr(e,1,ni),t===void 0?t=n.rounding:gr(t,0,8)),Te(new n(r),e,t)};be.toString=function(){var e=this,t=e.constructor,r=on(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};be.truncated=be.trunc=function(){return Te(new this.constructor(this),this.e+1,1)};be.valueOf=be.toJSON=function(){var e=this,t=e.constructor,r=on(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Vt(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)n=e[t]+"",r=Ie-n.length,r&&(a+=Pn(r)),a+=n;o=e[t],n=o+"",r=Ie-n.length,r&&(a+=Pn(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}function gr(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Xn+e)}function oo(e,t,r,n){var i,a,o,u;for(a=e[0];a>=10;a/=10)--t;return--t<0?(t+=Ie,i=0):(i=Math.ceil((t+1)/Ie),t%=Ie),a=Ft(10,Ie-t),u=e[i]%a|0,n==null?t<3?(t==0?u=u/100|0:t==1&&(u=u/10|0),o=r<4&&u==99999||r>3&&u==49999||u==5e4||u==0):o=(r<4&&u+1==a||r>3&&u+1==a/2)&&(e[i+1]/a/100|0)==Ft(10,t-2)-1||(u==a/2||u==0)&&(e[i+1]/a/100|0)==0:t<4?(t==0?u=u/1e3|0:t==1?u=u/100|0:t==2&&(u=u/10|0),o=(n||r<4)&&u==9999||!n&&r>3&&u==4999):o=((n||r<4)&&u+1==a||!n&&r>3&&u+1==a/2)&&(e[i+1]/a/1e3|0)==Ft(10,t-3)-1,o}function vs(e,t,r){for(var n,i=[0],a,o=0,u=e.length;o<u;){for(a=i.length;a--;)i[a]*=t;for(i[0]+=Tc.indexOf(e.charAt(o++)),n=0;n<i.length;n++)i[n]>r-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function HN(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/yu(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=ma(e,1,t.times(i),new e(1));for(var a=r;a--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=r,t}var bt=function(){function e(n,i,a){var o,u=0,c=n.length;for(n=n.slice();c--;)o=n[c]*i+u,n[c]=o%a|0,u=o/a|0;return u&&n.unshift(u),n}function t(n,i,a,o){var u,c;if(a!=o)c=a>o?1:-1;else for(u=c=0;u<a;u++)if(n[u]!=i[u]){c=n[u]>i[u]?1:-1;break}return c}function r(n,i,a,o){for(var u=0;a--;)n[a]-=u,u=n[a]<i[a]?1:0,n[a]=u*o+n[a]-i[a];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,a,o,u,c){var l,s,f,p,m,d,h,w,v,x,g,b,y,N,E,A,D,S,C,_,R=n.constructor,P=n.s==i.s?1:-1,I=n.d,O=i.d;if(!I||!I[0]||!O||!O[0])return new R(!n.s||!i.s||(I?O&&I[0]==O[0]:!O)?NaN:I&&I[0]==0||!O?P*0:P/0);for(c?(m=1,s=n.e-i.e):(c=Lr,m=Ie,s=Yt(n.e/m)-Yt(i.e/m)),C=O.length,D=I.length,v=new R(P),x=v.d=[],f=0;O[f]==(I[f]||0);f++);if(O[f]>(I[f]||0)&&s--,a==null?(N=a=R.precision,o=R.rounding):u?N=a+(n.e-i.e)+1:N=a,N<0)x.push(1),d=!0;else{if(N=N/m+2|0,f=0,C==1){for(p=0,O=O[0],N++;(f<D||p)&&N--;f++)E=p*c+(I[f]||0),x[f]=E/O|0,p=E%O|0;d=p||f<D}else{for(p=c/(O[0]+1)|0,p>1&&(O=e(O,p,c),I=e(I,p,c),C=O.length,D=I.length),A=C,g=I.slice(0,C),b=g.length;b<C;)g[b++]=0;_=O.slice(),_.unshift(0),S=O[0],O[1]>=c/2&&++S;do p=0,l=t(O,g,C,b),l<0?(y=g[0],C!=b&&(y=y*c+(g[1]||0)),p=y/S|0,p>1?(p>=c&&(p=c-1),h=e(O,p,c),w=h.length,b=g.length,l=t(h,g,w,b),l==1&&(p--,r(h,C<w?_:O,w,c))):(p==0&&(l=p=1),h=O.slice()),w=h.length,w<b&&h.unshift(0),r(g,h,b,c),l==-1&&(b=g.length,l=t(O,g,C,b),l<1&&(p++,r(g,C<b?_:O,b,c))),b=g.length):l===0&&(p++,g=[0]),x[f++]=p,l&&g[0]?g[b++]=I[A]||0:(g=[I[A]],b=1);while((A++<D||g[0]!==void 0)&&N--);d=g[0]!==void 0}x[0]||x.shift()}if(m==1)v.e=s,Yg=d;else{for(f=1,p=x[0];p>=10;p/=10)f++;v.e=f+s*m-1,Te(v,u?a+v.e+1:a,o,d)}return v}}();function Te(e,t,r,n){var i,a,o,u,c,l,s,f,p,m=e.constructor;e:if(t!=null){if(f=e.d,!f)return e;for(i=1,u=f[0];u>=10;u/=10)i++;if(a=t-i,a<0)a+=Ie,o=t,s=f[p=0],c=s/Ft(10,i-o-1)%10|0;else if(p=Math.ceil((a+1)/Ie),u=f.length,p>=u)if(n){for(;u++<=p;)f.push(0);s=c=0,i=1,a%=Ie,o=a-Ie+1}else break e;else{for(s=u=f[p],i=1;u>=10;u/=10)i++;a%=Ie,o=a-Ie+i,c=o<0?0:s/Ft(10,i-o-1)%10|0}if(n=n||t<0||f[p+1]!==void 0||(o<0?s:s%Ft(10,i-o-1)),l=r<4?(c||n)&&(r==0||r==(e.s<0?3:2)):c>5||c==5&&(r==4||n||r==6&&(a>0?o>0?s/Ft(10,i-o):0:f[p-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,l?(t-=e.e+1,f[0]=Ft(10,(Ie-t%Ie)%Ie),e.e=-t||0):f[0]=e.e=0,e;if(a==0?(f.length=p,u=1,p--):(f.length=p+1,u=Ft(10,Ie-a),f[p]=o>0?(s/Ft(10,i-o)%Ft(10,o)|0)*u:0),l)for(;;)if(p==0){for(a=1,o=f[0];o>=10;o/=10)a++;for(o=f[0]+=u,u=1;o>=10;o/=10)u++;a!=u&&(e.e++,f[0]==Lr&&(f[0]=1));break}else{if(f[p]+=u,f[p]!=Lr)break;f[p--]=0,u=1}for(a=f.length;f[--a]===0;)f.pop()}return Le&&(e.e>m.maxE?(e.d=null,e.e=NaN):e.e<m.minE&&(e.e=0,e.d=[0])),e}function on(e,t,r){if(!e.isFinite())return sv(e);var n,i=e.e,a=Vt(e.d),o=a.length;return t?(r&&(n=r-o)>0?a=a.charAt(0)+"."+a.slice(1)+Pn(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):i<0?(a="0."+Pn(-i-1)+a,r&&(n=r-o)>0&&(a+=Pn(n))):i>=o?(a+=Pn(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Pn(n))):((n=i+1)<o&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(a+="."),a+=Pn(n))),a}function vu(e,t){var r=e[0];for(t*=Ie;r>=10;r/=10)t++;return t}function Os(e,t,r){if(t>$N)throw Le=!0,r&&(e.precision=r),Error(ev);return Te(new e(Fs),t,1,!0)}function zr(e,t,r){if(t>Bc)throw Error(ev);return Te(new e(Ts),t,r,!0)}function iv(e){var t=e.length-1,r=t*Ie+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Pn(e){for(var t="";e--;)t+="0";return t}function av(e,t,r,n){var i,a=new e(1),o=Math.ceil(n/Ie+4);for(Le=!1;;){if(r%2&&(a=a.times(t),Kf(a.d,o)&&(i=!0)),r=Yt(r/2),r===0){r=a.d.length-1,i&&a.d[r]===0&&++a.d[r];break}t=t.times(t),Kf(t.d,o)}return Le=!0,a}function Wf(e){return e.d[e.d.length-1]&1}function ov(e,t,r){for(var n,i=new e(t[0]),a=0;++a<t.length;)if(n=new e(t[a]),n.s)i[r](n)&&(i=n);else{i=n;break}return i}function kc(e,t){var r,n,i,a,o,u,c,l=0,s=0,f=0,p=e.constructor,m=p.rounding,d=p.precision;if(!e.d||!e.d[0]||e.e>17)return new p(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(Le=!1,c=d):c=t,u=new p(.03125);e.e>-2;)e=e.times(u),f+=5;for(n=Math.log(Ft(2,f))/Math.LN10*2+5|0,c+=n,r=a=o=new p(1),p.precision=c;;){if(a=Te(a.times(e),c,1),r=r.times(++s),u=o.plus(bt(a,r,c,1)),Vt(u.d).slice(0,c)===Vt(o.d).slice(0,c)){for(i=f;i--;)o=Te(o.times(o),c,1);if(t==null)if(l<3&&oo(o.d,c-n,m,l))p.precision=c+=10,r=a=u=new p(1),s=0,l++;else return Te(o,p.precision=d,m,Le=!0);else return p.precision=d,o}o=u}}function Kn(e,t){var r,n,i,a,o,u,c,l,s,f,p,m=1,d=10,h=e,w=h.d,v=h.constructor,x=v.rounding,g=v.precision;if(h.s<0||!w||!w[0]||!h.e&&w[0]==1&&w.length==1)return new v(w&&!w[0]?-1/0:h.s!=1?NaN:w?0:h);if(t==null?(Le=!1,s=g):s=t,v.precision=s+=d,r=Vt(w),n=r.charAt(0),Math.abs(a=h.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=Vt(h.d),n=r.charAt(0),m++;a=h.e,n>1?(h=new v("0."+r),a++):h=new v(n+"."+r.slice(1))}else return l=Os(v,s+2,g).times(a+""),h=Kn(new v(n+"."+r.slice(1)),s-d).plus(l),v.precision=g,t==null?Te(h,g,x,Le=!0):h;for(f=h,c=o=h=bt(h.minus(1),h.plus(1),s,1),p=Te(h.times(h),s,1),i=3;;){if(o=Te(o.times(p),s,1),l=c.plus(bt(o,new v(i),s,1)),Vt(l.d).slice(0,s)===Vt(c.d).slice(0,s))if(c=c.times(2),a!==0&&(c=c.plus(Os(v,s+2,g).times(a+""))),c=bt(c,new v(m),s,1),t==null)if(oo(c.d,s-d,x,u))v.precision=s+=d,l=o=h=bt(f.minus(1),f.plus(1),s,1),p=Te(h.times(h),s,1),i=u=1;else return Te(c,v.precision=g,x,Le=!0);else return v.precision=g,c;c=l,i+=2}}function sv(e){return String(e.s*e.s/0)}function Ic(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%Ie,r<0&&(n+=Ie),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=Ie;n<i;)e.d.push(+t.slice(n,n+=Ie));t=t.slice(n),n=Ie-t.length}else n-=i;for(;n--;)t+="0";e.d.push(+t),Le&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function JN(e,t){var r,n,i,a,o,u,c,l,s;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),nv.test(t))return Ic(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(PN.test(t))r=16,t=t.toLowerCase();else if(LN.test(t))r=2;else if(VN.test(t))r=8;else throw Error(Xn+t);for(a=t.search(/p/i),a>0?(c=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),a=t.indexOf("."),o=a>=0,n=e.constructor,o&&(t=t.replace(".",""),u=t.length,a=u-a,i=av(n,new n(r),a,a*2)),l=vs(t,r,Lr),s=l.length-1,a=s;l[a]===0;--a)l.pop();return a<0?new n(e.s*0):(e.e=vu(l,s),e.d=l,Le=!1,o&&(e=bt(e,i,u*4)),c&&(e=e.times(Math.abs(c)<54?Ft(2,c):Yn.pow(2,c))),Le=!0,e)}function GN(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:ma(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/yu(5,r)),t=ma(e,2,t,t);for(var i,a=new e(5),o=new e(16),u=new e(20);r--;)i=t.times(t),t=t.times(a.plus(i.times(o.times(i).minus(u))));return t}function ma(e,t,r,n,i){var a,o,u,c,l=e.precision,s=Math.ceil(l/Ie);for(Le=!1,c=r.times(r),u=new e(n);;){if(o=bt(u.times(c),new e(t++*t++),l,1),u=i?n.plus(o):n.minus(o),n=bt(o.times(c),new e(t++*t++),l,1),o=u.plus(n),o.d[s]!==void 0){for(a=s;o.d[a]===u.d[a]&&a--;);if(a==-1)break}a=u,u=n,n=o,o=a}return Le=!0,o.d.length=s+1,o}function yu(e,t){for(var r=e;--t;)r*=e;return r}function uv(e,t){var r,n=t.s<0,i=zr(e,e.precision,1),a=i.times(.5);if(t=t.abs(),t.lte(a))return bn=n?4:1,t;if(r=t.divToInt(i),r.isZero())bn=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(a))return bn=Wf(r)?n?2:3:n?4:1,t;bn=Wf(r)?n?1:4:n?3:2}return t.minus(i).abs()}function wl(e,t,r,n){var i,a,o,u,c,l,s,f,p,m=e.constructor,d=r!==void 0;if(d?(gr(r,1,ni),n===void 0?n=m.rounding:gr(n,0,8)):(r=m.precision,n=m.rounding),!e.isFinite())s=sv(e);else{for(s=on(e),o=s.indexOf("."),d?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,o>=0&&(s=s.replace(".",""),p=new m(1),p.e=s.length-o,p.d=vs(on(p),10,i),p.e=p.d.length),f=vs(s,10,i),a=c=f.length;f[--c]==0;)f.pop();if(!f[0])s=d?"0p+0":"0";else{if(o<0?a--:(e=new m(e),e.d=f,e.e=a,e=bt(e,p,r,n,0,i),f=e.d,a=e.e,l=Yg),o=f[r],u=i/2,l=l||f[r+1]!==void 0,l=n<4?(o!==void 0||l)&&(n===0||n===(e.s<0?3:2)):o>u||o===u&&(n===4||l||n===6&&f[r-1]&1||n===(e.s<0?8:7)),f.length=r,l)for(;++f[--r]>i-1;)f[r]=0,r||(++a,f.unshift(1));for(c=f.length;!f[c-1];--c);for(o=0,s="";o<c;o++)s+=Tc.charAt(f[o]);if(d){if(c>1)if(t==16||t==8){for(o=t==16?4:3,--c;c%o;c++)s+="0";for(f=vs(s,i,t),c=f.length;!f[c-1];--c);for(o=1,s="1.";o<c;o++)s+=Tc.charAt(f[o])}else s=s.charAt(0)+"."+s.slice(1);s=s+(a<0?"p":"p+")+a}else if(a<0){for(;++a;)s="0"+s;s="0."+s}else if(++a>c)for(a-=c;a--;)s+="0";else a<c&&(s=s.slice(0,a)+"."+s.slice(a))}s=(t==16?"0x":t==2?"0b":t==8?"0o":"")+s}return e.s<0?"-"+s:s}function Kf(e,t){if(e.length>t)return e.length=t,!0}function WN(e){return new this(e).abs()}function KN(e){return new this(e).acos()}function QN(e){return new this(e).acosh()}function ZN(e,t){return new this(e).plus(t)}function XN(e){return new this(e).asin()}function YN(e){return new this(e).asinh()}function e2(e){return new this(e).atan()}function t2(e){return new this(e).atanh()}function r2(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,a=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=zr(this,a,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?zr(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=zr(this,a,1).times(.5),r.s=e.s):t.s<0?(this.precision=a,this.rounding=1,r=this.atan(bt(e,t,a,1)),t=zr(this,a,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(bt(e,t,a,1)),r}function n2(e){return new this(e).cbrt()}function i2(e){return Te(e=new this(e),e.e+1,2)}function a2(e,t,r){return new this(e).clamp(t,r)}function o2(e){if(!e||typeof e!="object")throw Error(gu+"Object expected");var t,r,n,i=e.defaults===!0,a=["precision",1,ni,"rounding",0,8,"toExpNeg",-ra,0,"toExpPos",0,ra,"maxE",0,ra,"minE",-ra,0,"modulo",0,9];for(t=0;t<a.length;t+=3)if(r=a[t],i&&(this[r]=Oc[r]),(n=e[r])!==void 0)if(Yt(n)===n&&n>=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(Xn+r+": "+n);if(r="crypto",i&&(this[r]=Oc[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(tv);else this[r]=!1;else throw Error(Xn+r+": "+n);return this}function s2(e){return new this(e).cos()}function u2(e){return new this(e).cosh()}function cv(e){var t,r,n;function i(a){var o,u,c,l=this;if(!(l instanceof i))return new i(a);if(l.constructor=i,Qf(a)){l.s=a.s,Le?!a.d||a.e>i.maxE?(l.e=NaN,l.d=null):a.e<i.minE?(l.e=0,l.d=[0]):(l.e=a.e,l.d=a.d.slice()):(l.e=a.e,l.d=a.d?a.d.slice():a.d);return}if(c=typeof a,c==="number"){if(a===0){l.s=1/a<0?-1:1,l.e=0,l.d=[0];return}if(a<0?(a=-a,l.s=-1):l.s=1,a===~~a&&a<1e7){for(o=0,u=a;u>=10;u/=10)o++;Le?o>i.maxE?(l.e=NaN,l.d=null):o<i.minE?(l.e=0,l.d=[0]):(l.e=o,l.d=[a]):(l.e=o,l.d=[a]);return}else if(a*0!==0){a||(l.s=NaN),l.e=NaN,l.d=null;return}return Ic(l,a.toString())}else if(c!=="string")throw Error(Xn+a);return(u=a.charCodeAt(0))===45?(a=a.slice(1),l.s=-1):(u===43&&(a=a.slice(1)),l.s=1),nv.test(a)?Ic(l,a):JN(l,a)}if(i.prototype=be,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=o2,i.clone=cv,i.isDecimal=Qf,i.abs=WN,i.acos=KN,i.acosh=QN,i.add=ZN,i.asin=XN,i.asinh=YN,i.atan=e2,i.atanh=t2,i.atan2=r2,i.cbrt=n2,i.ceil=i2,i.clamp=a2,i.cos=s2,i.cosh=u2,i.div=c2,i.exp=l2,i.floor=f2,i.hypot=p2,i.ln=m2,i.log=d2,i.log10=g2,i.log2=h2,i.max=v2,i.min=y2,i.mod=b2,i.mul=x2,i.pow=w2,i.random=N2,i.round=D2,i.sign=E2,i.sin=A2,i.sinh=S2,i.sqrt=C2,i.sub=M2,i.sum=_2,i.tan=F2,i.tanh=T2,i.trunc=O2,e===void 0&&(e={}),e&&e.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function c2(e,t){return new this(e).div(t)}function l2(e){return new this(e).exp()}function f2(e){return Te(e=new this(e),e.e+1,3)}function p2(){var e,t,r=new this(0);for(Le=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return Le=!0,new this(1/0);r=t}return Le=!0,r.sqrt()}function Qf(e){return e instanceof Yn||e&&e.toStringTag===rv||!1}function m2(e){return new this(e).ln()}function d2(e,t){return new this(e).log(t)}function h2(e){return new this(e).log(2)}function g2(e){return new this(e).log(10)}function v2(){return ov(this,arguments,"lt")}function y2(){return ov(this,arguments,"gt")}function b2(e,t){return new this(e).mod(t)}function x2(e,t){return new this(e).mul(t)}function w2(e,t){return new this(e).pow(t)}function N2(e){var t,r,n,i,a=0,o=new this(1),u=[];if(e===void 0?e=this.precision:gr(e,1,ni),n=Math.ceil(e/Ie),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));a<n;)i=t[a],i>=429e7?t[a]=crypto.getRandomValues(new Uint32Array(1))[0]:u[a++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);a<n;)i=t[a]+(t[a+1]<<8)+(t[a+2]<<16)+((t[a+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,a):(u.push(i%1e7),a+=4);a=n/4}else throw Error(tv);else for(;a<n;)u[a++]=Math.random()*1e7|0;for(n=u[--a],e%=Ie,n&&e&&(i=Ft(10,Ie-e),u[a]=(n/i|0)*i);u[a]===0;a--)u.pop();if(a<0)r=0,u=[0];else{for(r=-1;u[0]===0;r-=Ie)u.shift();for(n=1,i=u[0];i>=10;i/=10)n++;n<Ie&&(r-=Ie-n)}return o.e=r,o.d=u,o}function D2(e){return Te(e=new this(e),e.e+1,this.rounding)}function E2(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function A2(e){return new this(e).sin()}function S2(e){return new this(e).sinh()}function C2(e){return new this(e).sqrt()}function M2(e,t){return new this(e).sub(t)}function _2(){var e=0,t=arguments,r=new this(t[e]);for(Le=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return Le=!0,Te(r,this.precision,this.rounding)}function F2(e){return new this(e).tan()}function T2(e){return new this(e).tanh()}function O2(e){return Te(e=new this(e),e.e+1,1)}be[Symbol.for("nodejs.util.inspect.custom")]=be.toString;be[Symbol.toStringTag]="Decimal";var Yn=be.constructor=cv(Oc);Fs=new Yn(Fs);Ts=new Yn(Ts);var B2="BigNumber",k2=["?on","config"],I2=U(B2,k2,e=>{var{on:t,config:r}=e,n=Yn.clone({precision:r.precision,modulo:Yn.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(i){return new n(i.value)},t&&t("config",function(i,a){i.precision!==a.precision&&n.config({precision:i.precision})}),n},{isClass:!0}),qi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function No(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function R2(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var lv={exports:{}};/**
|
|
15
15
|
* @license Complex.js v2.1.1 12/05/2020
|
|
16
16
|
*
|
|
17
17
|
* Copyright (c) 2020, Robert Eisele (robert@xarg.org)
|
|
18
18
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
19
|
-
**/(function(e,t){(function(r){var n=Math.cosh||function(f){return Math.abs(f)<1e-9?1-f:(Math.exp(f)+Math.exp(-f))*.5},i=Math.sinh||function(f){return Math.abs(f)<1e-9?f:(Math.exp(f)-Math.exp(-f))*.5},a=function(f){var p=Math.PI/4;if(-p>f||f>p)return Math.cos(f)-1;var m=f*f;return m*(m*(m*(m*(m*(m*(m*(m/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},o=function(f,p){var m=Math.abs(f),d=Math.abs(p);return m<3e3&&d<3e3?Math.sqrt(m*m+d*d):(m<d?(m=d,d=f/p):d=p/f,m*Math.sqrt(1+d*d))},u=function(){throw SyntaxError("Invalid Param")};function c(f,p){var m=Math.abs(f),d=Math.abs(p);return f===0?Math.log(d):p===0?Math.log(m):m<3e3&&d<3e3?Math.log(f*f+p*p)*.5:(f=f/2,p=p/2,.5*Math.log(f*f+p*p)+Math.LN2)}var l=function(f,p){var m={re:0,im:0};if(f==null)m.re=m.im=0;else if(p!==void 0)m.re=f,m.im=p;else switch(typeof f){case"object":if("im"in f&&"re"in f)m.re=f.re,m.im=f.im;else if("abs"in f&&"arg"in f){if(!Number.isFinite(f.abs)&&Number.isFinite(f.arg))return s.INFINITY;m.re=f.abs*Math.cos(f.arg),m.im=f.abs*Math.sin(f.arg)}else if("r"in f&&"phi"in f){if(!Number.isFinite(f.r)&&Number.isFinite(f.phi))return s.INFINITY;m.re=f.r*Math.cos(f.phi),m.im=f.r*Math.sin(f.phi)}else f.length===2?(m.re=f[0],m.im=f[1]):u();break;case"string":m.im=m.re=0;var d=f.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),h=1,w=0;d===null&&u();for(var v=0;v<d.length;v++){var
|
|
20
|
-
`||(
|
|
19
|
+
**/(function(e,t){(function(r){var n=Math.cosh||function(f){return Math.abs(f)<1e-9?1-f:(Math.exp(f)+Math.exp(-f))*.5},i=Math.sinh||function(f){return Math.abs(f)<1e-9?f:(Math.exp(f)-Math.exp(-f))*.5},a=function(f){var p=Math.PI/4;if(-p>f||f>p)return Math.cos(f)-1;var m=f*f;return m*(m*(m*(m*(m*(m*(m*(m/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},o=function(f,p){var m=Math.abs(f),d=Math.abs(p);return m<3e3&&d<3e3?Math.sqrt(m*m+d*d):(m<d?(m=d,d=f/p):d=p/f,m*Math.sqrt(1+d*d))},u=function(){throw SyntaxError("Invalid Param")};function c(f,p){var m=Math.abs(f),d=Math.abs(p);return f===0?Math.log(d):p===0?Math.log(m):m<3e3&&d<3e3?Math.log(f*f+p*p)*.5:(f=f/2,p=p/2,.5*Math.log(f*f+p*p)+Math.LN2)}var l=function(f,p){var m={re:0,im:0};if(f==null)m.re=m.im=0;else if(p!==void 0)m.re=f,m.im=p;else switch(typeof f){case"object":if("im"in f&&"re"in f)m.re=f.re,m.im=f.im;else if("abs"in f&&"arg"in f){if(!Number.isFinite(f.abs)&&Number.isFinite(f.arg))return s.INFINITY;m.re=f.abs*Math.cos(f.arg),m.im=f.abs*Math.sin(f.arg)}else if("r"in f&&"phi"in f){if(!Number.isFinite(f.r)&&Number.isFinite(f.phi))return s.INFINITY;m.re=f.r*Math.cos(f.phi),m.im=f.r*Math.sin(f.phi)}else f.length===2?(m.re=f[0],m.im=f[1]):u();break;case"string":m.im=m.re=0;var d=f.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),h=1,w=0;d===null&&u();for(var v=0;v<d.length;v++){var x=d[v];x===" "||x===" "||x===`
|
|
20
|
+
`||(x==="+"?h++:x==="-"?w++:x==="i"||x==="I"?(h+w===0&&u(),d[v+1]!==" "&&!isNaN(d[v+1])?(m.im+=parseFloat((w%2?"-":"")+d[v+1]),v++):m.im+=parseFloat((w%2?"-":"")+"1"),h=w=0):((h+w===0||isNaN(x))&&u(),d[v+1]==="i"||d[v+1]==="I"?(m.im+=parseFloat((w%2?"-":"")+x),v++):m.re+=parseFloat((w%2?"-":"")+x),h=w=0))}h+w>0&&u();break;case"number":m.im=0,m.re=f;break;default:u()}return isNaN(m.re)||isNaN(m.im),m};function s(f,p){if(!(this instanceof s))return new s(f,p);var m=l(f,p);this.re=m.re,this.im=m.im}s.prototype={re:0,im:0,sign:function(){var f=this.abs();return new s(this.re/f,this.im/f)},add:function(f,p){var m=new s(f,p);return this.isInfinite()&&m.isInfinite()?s.NAN:this.isInfinite()||m.isInfinite()?s.INFINITY:new s(this.re+m.re,this.im+m.im)},sub:function(f,p){var m=new s(f,p);return this.isInfinite()&&m.isInfinite()?s.NAN:this.isInfinite()||m.isInfinite()?s.INFINITY:new s(this.re-m.re,this.im-m.im)},mul:function(f,p){var m=new s(f,p);return this.isInfinite()&&m.isZero()||this.isZero()&&m.isInfinite()?s.NAN:this.isInfinite()||m.isInfinite()?s.INFINITY:m.im===0&&this.im===0?new s(this.re*m.re,0):new s(this.re*m.re-this.im*m.im,this.re*m.im+this.im*m.re)},div:function(f,p){var m=new s(f,p);if(this.isZero()&&m.isZero()||this.isInfinite()&&m.isInfinite())return s.NAN;if(this.isInfinite()||m.isZero())return s.INFINITY;if(this.isZero()||m.isInfinite())return s.ZERO;f=this.re,p=this.im;var d=m.re,h=m.im,w,v;return h===0?new s(f/d,p/d):Math.abs(d)<Math.abs(h)?(v=d/h,w=d*v+h,new s((f*v+p)/w,(p*v-f)/w)):(v=h/d,w=h*v+d,new s((f+p*v)/w,(p-f*v)/w))},pow:function(f,p){var m=new s(f,p);if(f=this.re,p=this.im,m.isZero())return s.ONE;if(m.im===0){if(p===0&&f>0)return new s(Math.pow(f,m.re),0);if(f===0)switch((m.re%4+4)%4){case 0:return new s(Math.pow(p,m.re),0);case 1:return new s(0,Math.pow(p,m.re));case 2:return new s(-Math.pow(p,m.re),0);case 3:return new s(0,-Math.pow(p,m.re))}}if(f===0&&p===0&&m.re>0&&m.im>=0)return s.ZERO;var d=Math.atan2(p,f),h=c(f,p);return f=Math.exp(m.re*h-m.im*d),p=m.im*h+m.re*d,new s(f*Math.cos(p),f*Math.sin(p))},sqrt:function(){var f=this.re,p=this.im,m=this.abs(),d,h;if(f>=0){if(p===0)return new s(Math.sqrt(f),0);d=.5*Math.sqrt(2*(m+f))}else d=Math.abs(p)/Math.sqrt(2*(m-f));return f<=0?h=.5*Math.sqrt(2*(m-f)):h=Math.abs(p)/Math.sqrt(2*(m+f)),new s(d,p<0?-h:h)},exp:function(){var f=Math.exp(this.re);return this.im,new s(f*Math.cos(this.im),f*Math.sin(this.im))},expm1:function(){var f=this.re,p=this.im;return new s(Math.expm1(f)*Math.cos(p)+a(p),Math.exp(f)*Math.sin(p))},log:function(){var f=this.re,p=this.im;return new s(c(f,p),Math.atan2(p,f))},abs:function(){return o(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var f=this.re,p=this.im;return new s(Math.sin(f)*n(p),Math.cos(f)*i(p))},cos:function(){var f=this.re,p=this.im;return new s(Math.cos(f)*n(p),-Math.sin(f)*i(p))},tan:function(){var f=2*this.re,p=2*this.im,m=Math.cos(f)+n(p);return new s(Math.sin(f)/m,i(p)/m)},cot:function(){var f=2*this.re,p=2*this.im,m=Math.cos(f)-n(p);return new s(-Math.sin(f)/m,i(p)/m)},sec:function(){var f=this.re,p=this.im,m=.5*n(2*p)+.5*Math.cos(2*f);return new s(Math.cos(f)*n(p)/m,Math.sin(f)*i(p)/m)},csc:function(){var f=this.re,p=this.im,m=.5*n(2*p)-.5*Math.cos(2*f);return new s(Math.sin(f)*n(p)/m,-Math.cos(f)*i(p)/m)},asin:function(){var f=this.re,p=this.im,m=new s(p*p-f*f+1,-2*f*p).sqrt(),d=new s(m.re-p,m.im+f).log();return new s(d.im,-d.re)},acos:function(){var f=this.re,p=this.im,m=new s(p*p-f*f+1,-2*f*p).sqrt(),d=new s(m.re-p,m.im+f).log();return new s(Math.PI/2-d.im,d.re)},atan:function(){var f=this.re,p=this.im;if(f===0){if(p===1)return new s(0,1/0);if(p===-1)return new s(0,-1/0)}var m=f*f+(1-p)*(1-p),d=new s((1-p*p-f*f)/m,-2*f/m).log();return new s(-.5*d.im,.5*d.re)},acot:function(){var f=this.re,p=this.im;if(p===0)return new s(Math.atan2(1,f),0);var m=f*f+p*p;return m!==0?new s(f/m,-p/m).atan():new s(f!==0?f/0:0,p!==0?-p/0:0).atan()},asec:function(){var f=this.re,p=this.im;if(f===0&&p===0)return new s(0,1/0);var m=f*f+p*p;return m!==0?new s(f/m,-p/m).acos():new s(f!==0?f/0:0,p!==0?-p/0:0).acos()},acsc:function(){var f=this.re,p=this.im;if(f===0&&p===0)return new s(Math.PI/2,1/0);var m=f*f+p*p;return m!==0?new s(f/m,-p/m).asin():new s(f!==0?f/0:0,p!==0?-p/0:0).asin()},sinh:function(){var f=this.re,p=this.im;return new s(i(f)*Math.cos(p),n(f)*Math.sin(p))},cosh:function(){var f=this.re,p=this.im;return new s(n(f)*Math.cos(p),i(f)*Math.sin(p))},tanh:function(){var f=2*this.re,p=2*this.im,m=n(f)+Math.cos(p);return new s(i(f)/m,Math.sin(p)/m)},coth:function(){var f=2*this.re,p=2*this.im,m=n(f)-Math.cos(p);return new s(i(f)/m,-Math.sin(p)/m)},csch:function(){var f=this.re,p=this.im,m=Math.cos(2*p)-n(2*f);return new s(-2*i(f)*Math.cos(p)/m,2*n(f)*Math.sin(p)/m)},sech:function(){var f=this.re,p=this.im,m=Math.cos(2*p)+n(2*f);return new s(2*n(f)*Math.cos(p)/m,-2*i(f)*Math.sin(p)/m)},asinh:function(){var f=this.im;this.im=-this.re,this.re=f;var p=this.asin();return this.re=-this.im,this.im=f,f=p.re,p.re=-p.im,p.im=f,p},acosh:function(){var f=this.acos();if(f.im<=0){var p=f.re;f.re=-f.im,f.im=p}else{var p=f.im;f.im=-f.re,f.re=p}return f},atanh:function(){var f=this.re,p=this.im,m=f>1&&p===0,d=1-f,h=1+f,w=d*d+p*p,v=w!==0?new s((h*d-p*p)/w,(p*d+h*p)/w):new s(f!==-1?f/0:0,p!==0?p/0:0),x=v.re;return v.re=c(v.re,v.im)/2,v.im=Math.atan2(v.im,x)/2,m&&(v.im=-v.im),v},acoth:function(){var f=this.re,p=this.im;if(f===0&&p===0)return new s(0,Math.PI/2);var m=f*f+p*p;return m!==0?new s(f/m,-p/m).atanh():new s(f!==0?f/0:0,p!==0?-p/0:0).atanh()},acsch:function(){var f=this.re,p=this.im;if(p===0)return new s(f!==0?Math.log(f+Math.sqrt(f*f+1)):1/0,0);var m=f*f+p*p;return m!==0?new s(f/m,-p/m).asinh():new s(f!==0?f/0:0,p!==0?-p/0:0).asinh()},asech:function(){var f=this.re,p=this.im;if(this.isZero())return s.INFINITY;var m=f*f+p*p;return m!==0?new s(f/m,-p/m).acosh():new s(f!==0?f/0:0,p!==0?-p/0:0).acosh()},inverse:function(){if(this.isZero())return s.INFINITY;if(this.isInfinite())return s.ZERO;var f=this.re,p=this.im,m=f*f+p*p;return new s(f/m,-p/m)},conjugate:function(){return new s(this.re,-this.im)},neg:function(){return new s(-this.re,-this.im)},ceil:function(f){return f=Math.pow(10,f||0),new s(Math.ceil(this.re*f)/f,Math.ceil(this.im*f)/f)},floor:function(f){return f=Math.pow(10,f||0),new s(Math.floor(this.re*f)/f,Math.floor(this.im*f)/f)},round:function(f){return f=Math.pow(10,f||0),new s(Math.round(this.re*f)/f,Math.round(this.im*f)/f)},equals:function(f,p){var m=new s(f,p);return Math.abs(m.re-this.re)<=s.EPSILON&&Math.abs(m.im-this.im)<=s.EPSILON},clone:function(){return new s(this.re,this.im)},toString:function(){var f=this.re,p=this.im,m="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(f)<s.EPSILON&&(f=0),Math.abs(p)<s.EPSILON&&(p=0),p===0?m+f:(f!==0?(m+=f,m+=" ",p<0?(p=-p,m+="-"):m+="+",m+=" "):p<0&&(p=-p,m+="-"),p!==1&&(m+=p),m+"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.isNaN()||this.isFinite())}},s.ZERO=new s(0,0),s.ONE=new s(1,0),s.I=new s(0,1),s.PI=new s(Math.PI,0),s.E=new s(Math.E,0),s.INFINITY=new s(1/0,1/0),s.NAN=new s(NaN,NaN),s.EPSILON=1e-15,Object.defineProperty(s,"__esModule",{value:!0}),s.default=s,s.Complex=s,e.exports=s})()})(lv);var q2=lv.exports;const Pt=No(q2);var z2="Complex",j2=[],L2=U(z2,j2,()=>(Object.defineProperty(Pt,"name",{value:"Complex"}),Pt.prototype.constructor=Pt,Pt.prototype.type="Complex",Pt.prototype.isComplex=!0,Pt.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},Pt.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},Pt.prototype.format=function(e){var t="",r=this.im,n=this.re,i=Di(this.re,e),a=Di(this.im,e),o=Ue(e)?e:e?e.precision:null;if(o!==null){var u=Math.pow(10,-o);Math.abs(n/r)<u&&(n=0),Math.abs(r/n)<u&&(r=0)}return r===0?t=i:n===0?r===1?t="i":r===-1?t="-i":t=a+"i":r<0?r===-1?t=i+" - i":t=i+" - "+a.substring(1)+"i":r===1?t=i+" + i":t=i+" + "+a+"i",t},Pt.fromPolar=function(e){switch(arguments.length){case 1:{var t=arguments[0];if(typeof t=="object")return Pt(t);throw new TypeError("Input has to be an object with r and phi keys.")}case 2:{var r=arguments[0],n=arguments[1];if(Ue(r)){if(Cr(n)&&n.hasBase("ANGLE")&&(n=n.toNumber("rad")),Ue(n))return new Pt({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")}},Pt.prototype.valueOf=Pt.prototype.toString,Pt.fromJSON=function(e){return new Pt(e)},Pt.compare=function(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0},Pt),{isClass:!0}),fv={exports:{}};/**
|
|
21
21
|
* @license Fraction.js v4.3.0 20/08/2023
|
|
22
22
|
* https://www.xarg.org/2014/03/rational-numbers-in-javascript/
|
|
23
23
|
*
|
|
24
24
|
* Copyright (c) 2023, Robert Eisele (robert@raw.org)
|
|
25
25
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
26
|
-
**/(function(e,t){(function(r){var n=2e3,i={s:1,n:0,d:1};function a(v,b){if(isNaN(v=parseInt(v,10)))throw h();return v*b}function o(v,b){if(b===0)throw d();var g=Object.create(m.prototype);g.s=v<0?-1:1,v=v<0?-v:v;var x=p(v,b);return g.n=v/x,g.d=b/x,g}function u(v){for(var b={},g=v,x=2,y=4;y<=g;){for(;g%x===0;)g/=x,b[x]=(b[x]||0)+1;y+=1+2*x++}return g!==v?g>1&&(b[g]=(b[g]||0)+1):b[v]=(b[v]||0)+1,b}var c=function(v,b){var g=0,x=1,y=1,N=0,E=0,A=0,D=1,S=1,C=0,_=1,R=1,P=1,I=1e7,O;if(v!=null)if(b!==void 0){if(g=v,x=b,y=g*x,g%1!==0||x%1!==0)throw w()}else switch(typeof v){case"object":{if("d"in v&&"n"in v)g=v.n,x=v.d,"s"in v&&(g*=v.s);else if(0 in v)g=v[0],1 in v&&(x=v[1]);else throw h();y=g*x;break}case"number":{if(v<0&&(y=v,v=-v),v%1===0)g=v;else if(v>0){for(v>=1&&(S=Math.pow(10,Math.floor(1+Math.log(v)/Math.LN10)),v/=S);_<=I&&P<=I;)if(O=(C+R)/(_+P),v===O){_+P<=I?(g=C+R,x=_+P):P>_?(g=R,x=P):(g=C,x=_);break}else v>O?(C+=R,_+=P):(R+=C,P+=_),_>I?(g=R,x=P):(g=C,x=_);g*=S}else(isNaN(v)||isNaN(b))&&(x=g=NaN);break}case"string":{if(_=v.match(/\d+|./g),_===null)throw h();if(_[C]==="-"?(y=-1,C++):_[C]==="+"&&C++,_.length===C+1?E=a(_[C++],y):_[C+1]==="."||_[C]==="."?(_[C]!=="."&&(N=a(_[C++],y)),C++,(C+1===_.length||_[C+1]==="("&&_[C+3]===")"||_[C+1]==="'"&&_[C+3]==="'")&&(E=a(_[C],y),D=Math.pow(10,_[C].length),C++),(_[C]==="("&&_[C+2]===")"||_[C]==="'"&&_[C+2]==="'")&&(A=a(_[C+1],y),S=Math.pow(10,_[C+1].length)-1,C+=3)):_[C+1]==="/"||_[C+1]===":"?(E=a(_[C],y),D=a(_[C+2],1),C+=3):_[C+3]==="/"&&_[C+1]===" "&&(N=a(_[C],y),E=a(_[C+2],y),D=a(_[C+4],1),C+=5),_.length<=C){x=D*S,y=g=A+x*N+S*E;break}}default:throw h()}if(x===0)throw d();i.s=y<0?-1:1,i.n=Math.abs(g),i.d=Math.abs(x)};function l(v,b,g){for(var x=1;b>0;v=v*v%g,b>>=1)b&1&&(x=x*v%g);return x}function s(v,b){for(;b%2===0;b/=2);for(;b%5===0;b/=5);if(b===1)return 0;for(var g=10%b,x=1;g!==1;x++)if(g=g*10%b,x>n)return 0;return x}function f(v,b,g){for(var x=1,y=l(10,g,b),N=0;N<300;N++){if(x===y)return N;x=x*10%b,y=y*10%b}return 0}function p(v,b){if(!v)return b;if(!b)return v;for(;;){if(v%=b,!v)return b;if(b%=v,!b)return v}}function m(v,b){if(c(v,b),this instanceof m)v=p(i.d,i.n),this.s=i.s,this.n=i.n/v,this.d=i.d/v;else return o(i.s*i.n,i.d)}var d=function(){return new Error("Division by Zero")},h=function(){return new Error("Invalid argument")},w=function(){return new Error("Parameters must be integer")};m.prototype={s:1,n:0,d:1,abs:function(){return o(this.n,this.d)},neg:function(){return o(-this.s*this.n,this.d)},add:function(v,b){return c(v,b),o(this.s*this.n*i.d+i.s*this.d*i.n,this.d*i.d)},sub:function(v,b){return c(v,b),o(this.s*this.n*i.d-i.s*this.d*i.n,this.d*i.d)},mul:function(v,b){return c(v,b),o(this.s*i.s*this.n*i.n,this.d*i.d)},div:function(v,b){return c(v,b),o(this.s*i.s*this.n*i.d,this.d*i.n)},clone:function(){return o(this.s*this.n,this.d)},mod:function(v,b){if(isNaN(this.n)||isNaN(this.d))return new m(NaN);if(v===void 0)return o(this.s*this.n%this.d,1);if(c(v,b),i.n===0&&this.d===0)throw d();return o(this.s*(i.d*this.n)%(i.n*this.d),i.d*this.d)},gcd:function(v,b){return c(v,b),o(p(i.n,this.n)*p(i.d,this.d),i.d*this.d)},lcm:function(v,b){return c(v,b),i.n===0&&this.n===0?o(0,1):o(i.n*this.n,p(i.n,this.n)*p(i.d,this.d))},ceil:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new m(NaN):o(Math.ceil(v*this.s*this.n/this.d),v)},floor:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new m(NaN):o(Math.floor(v*this.s*this.n/this.d),v)},round:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new m(NaN):o(Math.round(v*this.s*this.n/this.d),v)},inverse:function(){return o(this.s*this.d,this.n)},pow:function(v,b){if(c(v,b),i.d===1)return i.s<0?o(Math.pow(this.s*this.d,i.n),Math.pow(this.n,i.n)):o(Math.pow(this.s*this.n,i.n),Math.pow(this.d,i.n));if(this.s<0)return null;var g=u(this.n),x=u(this.d),y=1,N=1;for(var E in g)if(E!=="1"){if(E==="0"){y=0;break}if(g[E]*=i.n,g[E]%i.d===0)g[E]/=i.d;else return null;y*=Math.pow(E,g[E])}for(var E in x)if(E!=="1"){if(x[E]*=i.n,x[E]%i.d===0)x[E]/=i.d;else return null;N*=Math.pow(E,x[E])}return i.s<0?o(N,y):o(y,N)},equals:function(v,b){return c(v,b),this.s*this.n*i.d===i.s*i.n*this.d},compare:function(v,b){c(v,b);var g=this.s*this.n*i.d-i.s*i.n*this.d;return(0<g)-(g<0)},simplify:function(v){if(isNaN(this.n)||isNaN(this.d))return this;v=v||.001;for(var b=this.abs(),g=b.toContinued(),x=1;x<g.length;x++){for(var y=o(g[x-1],1),N=x-2;N>=0;N--)y=y.inverse().add(g[N]);if(Math.abs(y.sub(b).valueOf())<v)return y.mul(this.s)}return this},divisible:function(v,b){return c(v,b),!(!(i.n*this.d)||this.n*i.d%(i.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(v){var b,g="",x=this.n,y=this.d;return this.s<0&&(g+="-"),y===1?g+=x:(v&&(b=Math.floor(x/y))>0&&(g+=b,g+=" ",x%=y),g+=x,g+="/",g+=y),g},toLatex:function(v){var b,g="",x=this.n,y=this.d;return this.s<0&&(g+="-"),y===1?g+=x:(v&&(b=Math.floor(x/y))>0&&(g+=b,x%=y),g+="\\frac{",g+=x,g+="}{",g+=y,g+="}"),g},toContinued:function(){var v,b=this.n,g=this.d,x=[];if(isNaN(b)||isNaN(g))return x;do x.push(Math.floor(b/g)),v=b%g,b=g,g=v;while(b!==1);return x},toString:function(v){var b=this.n,g=this.d;if(isNaN(b)||isNaN(g))return"NaN";v=v||15;var x=s(b,g),y=f(b,g,x),N=this.s<0?"-":"";if(N+=b/g|0,b%=g,b*=10,b&&(N+="."),x){for(var E=y;E--;)N+=b/g|0,b%=g,b*=10;N+="(";for(var E=x;E--;)N+=b/g|0,b%=g,b*=10;N+=")"}else for(var E=v;b&&E--;)N+=b/g|0,b%=g,b*=10;return N}},Object.defineProperty(m,"__esModule",{value:!0}),m.default=m,m.Fraction=m,e.exports=m})()})(lv);var j2=lv.exports;const dn=wo(j2);var L2="Fraction",P2=[],V2=U(L2,P2,()=>(Object.defineProperty(dn,"name",{value:"Fraction"}),dn.prototype.constructor=dn,dn.prototype.type="Fraction",dn.prototype.isFraction=!0,dn.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},dn.fromJSON=function(e){return new dn(e)},dn),{isClass:!0}),U2="Range",$2=[],H2=U(U2,$2,()=>{function e(t,r,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var i=t!=null,a=r!=null,o=n!=null;if(i){if($e(t))t=t.toNumber();else if(typeof t!="number")throw new TypeError("Parameter start must be a number")}if(a){if($e(r))r=r.toNumber();else if(typeof r!="number")throw new TypeError("Parameter end must be a number")}if(o){if($e(n))n=n.toNumber();else if(typeof n!="number")throw new TypeError("Parameter step must be a number")}this.start=i?parseFloat(t):0,this.end=a?parseFloat(r):0,this.step=o?parseFloat(n):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(t){if(typeof t!="string")return null;var r=t.split(":"),n=r.map(function(a){return parseFloat(a)}),i=n.some(function(a){return isNaN(a)});if(i)return null;switch(n.length){case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[2],n[1]);default:return null}},e.prototype.clone=function(){return new e(this.start,this.end,this.step)},e.prototype.size=function(){var t=0,r=this.start,n=this.step,i=this.end,a=i-r;return Wn(n)===Wn(a)?t=Math.ceil(a/n):a===0&&(t=0),isNaN(t)&&(t=0),[t]},e.prototype.min=function(){var t=this.size()[0];if(t>0)return this.step>0?this.start:this.start+(t-1)*this.step},e.prototype.max=function(){var t=this.size()[0];if(t>0)return this.step>0?this.start+(t-1)*this.step:this.start},e.prototype.forEach=function(t){var r=this.start,n=this.step,i=this.end,a=0;if(n>0)for(;r<i;)t(r,[a],this),r+=n,a++;else if(n<0)for(;r>i;)t(r,[a],this),r+=n,a++},e.prototype.map=function(t){var r=[];return this.forEach(function(n,i,a){r[i[0]]=t(n,i,a)}),r},e.prototype.toArray=function(){var t=[];return this.forEach(function(r,n){t[n[0]]=r}),t},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(t){var r=Di(this.start,t);return this.step!==1&&(r+=":"+Di(this.step,t)),r+=":"+Di(this.end,t),r},e.prototype.toString=function(){return this.format()},e.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},e.fromJSON=function(t){return new e(t.start,t.end,t.step)},e},{isClass:!0}),J2="Matrix",G2=[],W2=U(J2,G2,()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(t,r){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(t,r,n){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(t,r,n){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(t,r){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(t,r){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(t,r){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(t){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(t){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0});function uc(e,t,r){var n=e.constructor,i=new n(2),a="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!Fe(r))throw new Error("size must be an integer");if(e.greaterThan(i.pow(r-1).sub(1))||e.lessThan(i.pow(r-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(i.pow(r))),a="i".concat(r)}switch(t){case 2:return"".concat(e.toBinary()).concat(a);case 8:return"".concat(e.toOctal()).concat(a);case 16:return"".concat(e.toHexadecimal()).concat(a);default:throw new Error("Base ".concat(t," not supported "))}}function K2(e,t){if(typeof t=="function")return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var{notation:r,precision:n,wordSize:i}=Ug(t);switch(r){case"fixed":return Z2(e,n);case"exponential":return Qf(e,n);case"engineering":return Q2(e,n);case"bin":return uc(e,2,i);case"oct":return uc(e,8,i);case"hex":return uc(e,16,i);case"auto":{var a=Zf(t==null?void 0:t.lowerExp,-3),o=Zf(t==null?void 0:t.upperExp,5);if(e.isZero())return"0";var u,c=e.toSignificantDigits(n),l=c.e;return l>=a&&l<o?u=c.toFixed():u=Qf(e,n),u.replace(/((\.\d*?)(0+))($|e)/,function(){var s=arguments[2],f=arguments[4];return s!=="."?s+f:f})}default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Q2(e,t){var r=e.e,n=r%3===0?r:r<0?r-3-r%3:r-r%3,i=e.mul(Math.pow(10,-n)),a=i.toPrecision(t);if(a.includes("e")){var o=e.constructor;a=new o(a).toFixed()}return a+"e"+(r>=0?"+":"")+n.toString()}function Qf(e,t){return t!==void 0?e.toExponential(t-1):e.toExponential()}function Z2(e,t){return e.toFixed(t)}function Zf(e,t){return Ue(e)?e:$e(e)?e.toNumber():t}function X2(e,t){var r=e.length-t.length,n=e.length;return e.substring(r,n)===t}function Ge(e,t){var r=Y2(e,t);return t&&typeof t=="object"&&"truncate"in t&&r.length>t.truncate?r.substring(0,t.truncate-3)+"...":r}function Y2(e,t){if(typeof e=="number")return Di(e,t);if($e(e))return K2(e,t);if(eD(e))return!t||t.fraction!=="decimal"?e.s*e.n+"/"+e.d:e.toString();if(Array.isArray(e))return fv(e,t);if(Qt(e))return ra(e);if(typeof e=="function")return e.syntax?String(e.syntax):"function";if(e&&typeof e=="object"){if(typeof e.format=="function")return e.format(t);if(e&&e.toString(t)!=={}.toString())return e.toString(t);var r=Object.keys(e).map(n=>ra(n)+": "+Ge(e[n],t));return"{"+r.join(", ")+"}"}return String(e)}function ra(e){for(var t=String(e),r="",n=0;n<t.length;){var i=t.charAt(n);r+=i in Xf?Xf[i]:i,n++}return'"'+r+'"'}var Xf={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"};function Mr(e){var t=String(e);return t=t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">"),t}function fv(e,t){if(Array.isArray(e)){for(var r="[",n=e.length,i=0;i<n;i++)i!==0&&(r+=", "),r+=fv(e[i],t);return r+="]",r}else return Ge(e,t)}function eD(e){return e&&typeof e=="object"&&typeof e.s=="number"&&typeof e.n=="number"&&typeof e.d=="number"||!1}function Ic(e,t){if(!Qt(e))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+dt(e)+", index: 0)");if(!Qt(t))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+dt(t)+", index: 1)");return e===t?0:e>t?1:-1}function Ke(e,t,r){if(!(this instanceof Ke))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=r,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=new Error().stack}Ke.prototype=new RangeError;Ke.prototype.constructor=RangeError;Ke.prototype.name="DimensionError";Ke.prototype.isDimensionError=!0;function $r(e,t,r){if(!(this instanceof $r))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=r),this.min!==void 0&&this.index<this.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 Ve(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function pv(e,t,r){var n,i=e.length;if(i!==t[r])throw new Ke(i,t[r]);if(r<t.length-1){var a=r+1;for(n=0;n<i;n++){var o=e[n];if(!Array.isArray(o))throw new Ke(t.length-1,t.length,"<");pv(e[n],t,a)}}else for(n=0;n<i;n++)if(Array.isArray(e[n]))throw new Ke(t.length+1,t.length,">")}function Yf(e,t){var r=t.length===0;if(r){if(Array.isArray(e))throw new Ke(e.length,0)}else pv(e,t,0)}function Os(e,t){var r=e.isMatrix?e._size:Ve(e),n=t._sourceSize;n.forEach((i,a)=>{if(i!==null&&i!==r[a])throw new Ke(i,r[a])})}function pt(e,t){if(e!==void 0){if(!Ue(e)||!Fe(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof t=="number"&&e>=t)throw new $r(e,t)}}function ma(e){for(var t=0;t<e._dimensions.length;++t){var r=e._dimensions[t];if(r._data&&st(r._data)){if(r._size[0]===0)return!0}else if(r.isRange){if(r.start===r.end)return!0}else if(Qt(r)&&r.length===0)return!0}return!1}function da(e,t,r){if(!Array.isArray(t))throw new TypeError("Array expected");if(t.length===0)throw new Error("Resizing to scalar is not supported");t.forEach(function(i){if(!Ue(i)||!Fe(i)||i<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Ge(t)+")")}),(Ue(e)||$e(e))&&(e=[e]);var n=r!==void 0?r:0;return Rc(e,t,0,n),e}function Rc(e,t,r,n){var i,a,o=e.length,u=t[r],c=Math.min(o,u);if(e.length=u,r<t.length-1){var l=r+1;for(i=0;i<c;i++)a=e[i],Array.isArray(a)||(a=[a],e[i]=a),Rc(a,t,l,n);for(i=c;i<u;i++)a=[],e[i]=a,Rc(a,t,l,n)}else{for(i=0;i<c;i++)for(;Array.isArray(e[i]);)e[i]=e[i][0];for(i=c;i<u;i++)e[i]=n}}function wl(e,t){var r=ot(e),n=r.length;if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(t.length===0)throw new Ke(0,n,"!=");t=Nl(t,n);var i=mv(t);if(n!==i)throw new Ke(i,n,"!=");try{return tD(r,t)}catch(a){throw a instanceof Ke?new Ke(i,n,"!="):a}}function Nl(e,t){var r=mv(e),n=e.slice(),i=-1,a=e.indexOf(i),o=e.indexOf(i,a+1)>=0;if(o)throw new Error("More than one wildcard in sizes");var u=a>=0,c=t%r===0;if(u)if(c)n[a]=-t/r;else throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-r);return n}function mv(e){return e.reduce((t,r)=>t*r,1)}function tD(e,t){for(var r=e,n,i=t.length-1;i>0;i--){var a=t[i];n=[];for(var o=r.length/a,u=0;u<o;u++)n.push(r.slice(u*a,(u+1)*a));r=n}return r}function Bs(e,t){for(var r=Ve(e);Array.isArray(e)&&e.length===1;)e=e[0],r.shift();for(var n=r.length;r[n-1]===1;)n--;return n<r.length&&(e=dv(e,n,0),r.length=n),e}function dv(e,t,r){var n,i;if(r<t){var a=r+1;for(n=0,i=e.length;n<i;n++)e[n]=dv(e[n],t,a)}else for(;Array.isArray(e);)e=e[0];return e}function hv(e,t,r,n){var i=n||Ve(e);if(r)for(var a=0;a<r;a++)e=[e],i.unshift(1);for(e=gv(e,t,0);i.length<t;)i.push(1);return e}function gv(e,t,r){var n,i;if(Array.isArray(e)){var a=r+1;for(n=0,i=e.length;n<i;n++)e[n]=gv(e[n],t,a)}else for(var o=r;o<t;o++)e=[e];return e}function ot(e){if(!Array.isArray(e))return e;var t=[];return e.forEach(function r(n){Array.isArray(n)?n.forEach(r):t.push(n)}),t}function Nn(e,t){return Array.prototype.map.call(e,t)}function yu(e,t){Array.prototype.forEach.call(e,t)}function vv(e,t){if(Ve(e).length!==1)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,t)}function ks(e,t){if(Ve(e).length!==1)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,r=>t.test(r))}function ep(e,t){return Array.prototype.join.call(e,t)}function ha(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(e.length===0)return e;var t=[],r=0;t[0]={value:e[0],identifier:0};for(var n=1;n<e.length;n++)e[n]===e[n-1]?r++:r=0,t.push({value:e[n],identifier:r});return t}function Is(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(e.length===0)return e;for(var t=[],r=0;r<e.length;r++)t.push(e[r].value);return t}function oo(e,t){for(var r,n=0,i=0;i<e.length;i++){var a=e[i],o=Array.isArray(a);if(i===0&&o&&(n=a.length),o&&a.length!==n)return;var u=o?oo(a,t):t(a);if(r===void 0)r=u;else if(r!==u)return"mixed"}return r}function yv(e,t,r,n){if(n<r){if(e.length!==t.length)throw new Ke(e.length,t.length);for(var i=[],a=0;a<e.length;a++)i[a]=yv(e[a],t[a],r,n+1);return i}else return e.concat(t)}function xv(){var e=Array.prototype.slice.call(arguments,0,-1),t=Array.prototype.slice.call(arguments,-1);if(e.length===1)return e[0];if(e.length>1)return e.slice(1).reduce(function(r,n){return yv(r,n,t,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function rD(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=t.map(p=>p.length),i=Math.max(...n),a=new Array(i).fill(null),o=0;o<t.length;o++)for(var u=t[o],c=n[o],l=0;l<c;l++){var s=i-c+l;u[l]>a[s]&&(a[s]=u[l])}for(var f=0;f<t.length;f++)Rs(t[f],a);return a}function Rs(e,t){for(var r=t.length,n=e.length,i=0;i<n;i++){var a=r-n+i;if(e[i]<t[a]&&e[i]>1||e[i]>t[a])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(n," with size ").concat(e[i]," to size ").concat(t[a]))}}function tp(e,t){var r=Ve(e);if(Oi(r,t))return e;Rs(r,t);var n=rD(r,t),i=n.length,a=[...Array(i-r.length).fill(1),...r],o=iD(e);r.length<i&&(o=wl(o,a),r=Ve(o));for(var u=0;u<i;u++)r[u]<n[u]&&(o=nD(o,n[u],u),r=Ve(o));return o}function nD(e,t,r){return xv(...Array(t).fill(e),r)}function iD(e){return Tt([],e)}function aD(e){var t=0,r=1,n=Object.create(null),i=Object.create(null),a=0,o=function(u){var c=i[u];if(c&&(delete n[c],delete i[u],--t,r===c)){if(!t){a=0,r=1;return}for(;!Object.prototype.hasOwnProperty.call(n,++r););}};return e=Math.abs(e),{hit:function(u){var c=i[u],l=++a;if(n[l]=u,i[u]=l,!c)return++t,t<=e?void 0:(u=n[r],o(u),u);if(delete n[c],r===c)for(;!Object.prototype.hasOwnProperty.call(n,++r););},delete:o,clear:function(){t=a=0,r=1,n=Object.create(null),i=Object.create(null)}}}function No(e){var{hasher:t,limit:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return r=r??Number.POSITIVE_INFINITY,t=t??JSON.stringify,function n(){typeof n.cache!="object"&&(n.cache={values:new Map,lru:aD(r||Number.POSITIVE_INFINITY)});for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var o=t(i);if(n.cache.values.has(o))return n.cache.lru.hit(o),n.cache.values.get(o);var u=e.apply(e,i);return n.cache.values.set(o,u),n.cache.values.delete(n.cache.lru.hit(o)),u}}function bv(e){return Object.keys(e.signatures||{}).reduce(function(t,r){var n=(r.match(/,/g)||[]).length+1;return Math.max(t,n)},-1)}var oD="DenseMatrix",sD=["Matrix"],uD=U(oD,sD,e=>{var{Matrix:t}=e;function r(s,f){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(f&&!Qt(f))throw new Error("Invalid datatype: "+f);if(ke(s))s.type==="DenseMatrix"?(this._data=ze(s._data),this._size=ze(s._size),this._datatype=f||s._datatype):(this._data=s.toArray(),this._size=s.size(),this._datatype=f||s._datatype);else if(s&&st(s.data)&&st(s.size))this._data=s.data,this._size=s.size,Yf(this._data,this._size),this._datatype=f||s.datatype;else if(st(s))this._data=l(s),this._size=Ve(this._data),Yf(this._data,this._size),this._datatype=f;else{if(s)throw new TypeError("Unsupported type of data ("+dt(s)+")");this._data=[],this._size=[0],this._datatype=f}}r.prototype=new t,r.prototype.createDenseMatrix=function(s,f){return new r(s,f)},Object.defineProperty(r,"name",{value:"DenseMatrix"}),r.prototype.constructor=r,r.prototype.type="DenseMatrix",r.prototype.isDenseMatrix=!0,r.prototype.getDataType=function(){return oo(this._data,dt)},r.prototype.storage=function(){return"dense"},r.prototype.datatype=function(){return this._datatype},r.prototype.create=function(s,f){return new r(s,f)},r.prototype.subset=function(s,f,p){switch(arguments.length){case 1:return n(this,s);case 2:case 3:return a(this,s,f,p);default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.get=function(s){if(!st(s))throw new TypeError("Array expected");if(s.length!==this._size.length)throw new Ke(s.length,this._size.length);for(var f=0;f<s.length;f++)pt(s[f],this._size[f]);for(var p=this._data,m=0,d=s.length;m<d;m++){var h=s[m];pt(h,p.length),p=p[h]}return p},r.prototype.set=function(s,f,p){if(!st(s))throw new TypeError("Array expected");if(s.length<this._size.length)throw new Ke(s.length,this._size.length,"<");var m,d,h,w=s.map(function(b){return b+1});c(this,w,p);var v=this._data;for(m=0,d=s.length-1;m<d;m++)h=s[m],pt(h,v.length),v=v[h];return h=s[s.length-1],pt(h,v.length),v[h]=f,this};function n(s,f){if(!lu(f))throw new TypeError("Invalid index");var p=f.isScalar();if(p)return s.get(f.min());var m=f.size();if(m.length!==s._size.length)throw new Ke(m.length,s._size.length);for(var d=f.min(),h=f.max(),w=0,v=s._size.length;w<v;w++)pt(d[w],s._size[w]),pt(h[w],s._size[w]);return new r(i(s._data,f,m.length,0),s._datatype)}function i(s,f,p,m){var d=m===p-1,h=f.dimension(m);return d?h.map(function(w){return pt(w,s.length),s[w]}).valueOf():h.map(function(w){pt(w,s.length);var v=s[w];return i(v,f,p,m+1)}).valueOf()}function a(s,f,p,m){if(!f||f.isIndex!==!0)throw new TypeError("Invalid index");var d=f.size(),h=f.isScalar(),w;if(ke(p)?(w=p.size(),p=p.valueOf()):w=Ve(p),h){if(w.length!==0)throw new TypeError("Scalar expected");s.set(f.min(),p,m)}else{if(!Oi(w,d))try{w.length===0?p=tp([p],d):p=tp(p,d),w=Ve(p)}catch{}if(d.length<s._size.length)throw new Ke(d.length,s._size.length,"<");if(w.length<d.length){for(var v=0,b=0;d[v]===1&&w[v]===1;)v++;for(;d[v]===1;)b++,v++;p=hv(p,d.length,b,w)}if(!Oi(d,w))throw new Ke(d,w,">");var g=f.max().map(function(N){return N+1});c(s,g,m);var x=d.length,y=0;o(s._data,f,p,x,y)}return s}function o(s,f,p,m,d){var h=d===m-1,w=f.dimension(d);h?w.forEach(function(v,b){pt(v),s[v]=p[b[0]]}):w.forEach(function(v,b){pt(v),o(s[v],f,p[b[0]],m,d+1)})}r.prototype.resize=function(s,f,p){if(!Fr(s))throw new TypeError("Array or Matrix expected");var m=s.valueOf().map(h=>Array.isArray(h)&&h.length===1?h[0]:h),d=p?this.clone():this;return u(d,m,f)};function u(s,f,p){if(f.length===0){for(var m=s._data;st(m);)m=m[0];return m}return s._size=f.slice(0),s._data=da(s._data,s._size,p),s}r.prototype.reshape=function(s,f){var p=f?this.clone():this;p._data=wl(p._data,s);var m=p._size.reduce((d,h)=>d*h);return p._size=Nl(s,m),p};function c(s,f,p){for(var m=s._size.slice(0),d=!1;m.length<f.length;)m.push(0),d=!0;for(var h=0,w=f.length;h<w;h++)f[h]>m[h]&&(m[h]=f[h],d=!0);d&&u(s,m,p)}r.prototype.clone=function(){var s=new r({data:ze(this._data),size:ze(this._size),datatype:this._datatype});return s},r.prototype.size=function(){return this._size.slice(0)},r.prototype.map=function(s){var f=this,p=bv(s),m=function w(v,b){return st(v)?v.map(function(g,x){return w(g,b.concat(x))}):p===1?s(v):p===2?s(v,b):s(v,b,f)},d=m(this._data,[]),h=this._datatype!==void 0?oo(d,dt):void 0;return new r(d,h)},r.prototype.forEach=function(s){var f=this,p=function m(d,h){st(d)?d.forEach(function(w,v){m(w,h.concat(v))}):s(d,h,f)};p(this._data,[])},r.prototype[Symbol.iterator]=function*(){var s=function*f(p,m){if(st(p))for(var d=0;d<p.length;d++)yield*f(p[d],m.concat(d));else yield{value:p,index:m}};yield*s(this._data,[])},r.prototype.rows=function(){var s=[],f=this.size();if(f.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");var p=this._data;for(var m of p)s.push(new r([m],this._datatype));return s},r.prototype.columns=function(){var s=this,f=[],p=this.size();if(p.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var m=this._data,d=function(w){var v=m.map(b=>[b[w]]);f.push(new r(v,s._datatype))},h=0;h<p[1];h++)d(h);return f},r.prototype.toArray=function(){return ze(this._data)},r.prototype.valueOf=function(){return this._data},r.prototype.format=function(s){return Ge(this._data,s)},r.prototype.toString=function(){return Ge(this._data)},r.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},r.prototype.diagonal=function(s){if(s){if($e(s)&&(s=s.toNumber()),!Ue(s)||!Fe(s))throw new TypeError("The parameter k must be an integer number")}else s=0;for(var f=s>0?s:0,p=s<0?-s:0,m=this._size[0],d=this._size[1],h=Math.min(m-p,d-f),w=[],v=0;v<h;v++)w[v]=this._data[v+p][v+f];return new r({data:w,size:[h],datatype:this._datatype})},r.diagonal=function(s,f,p,m){if(!st(s))throw new TypeError("Array expected, size parameter");if(s.length!==2)throw new Error("Only two dimensions matrix are supported");if(s=s.map(function(E){if($e(E)&&(E=E.toNumber()),!Ue(E)||!Fe(E)||E<1)throw new Error("Size values must be positive integers");return E}),p){if($e(p)&&(p=p.toNumber()),!Ue(p)||!Fe(p))throw new TypeError("The parameter k must be an integer number")}else p=0;var d=p>0?p:0,h=p<0?-p:0,w=s[0],v=s[1],b=Math.min(w-h,v-d),g;if(st(f)){if(f.length!==b)throw new Error("Invalid value array length");g=function(E){return f[E]}}else if(ke(f)){var x=f.size();if(x.length!==1||x[0]!==b)throw new Error("Invalid matrix length");g=function(E){return f.get([E])}}else g=function(){return f};m||(m=$e(g(0))?g(0).mul(0):0);var y=[];if(s.length>0){y=da(y,s,m);for(var N=0;N<b;N++)y[N+h][N+d]=g(N)}return new r({data:y,size:[w,v]})},r.fromJSON=function(s){return new r(s)},r.prototype.swapRows=function(s,f){if(!Ue(s)||!Fe(s)||!Ue(f)||!Fe(f))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return pt(s,this._size[0]),pt(f,this._size[0]),r._swapRows(s,f,this._data),this},r._swapRows=function(s,f,p){var m=p[s];p[s]=p[f],p[f]=m};function l(s){return ke(s)?l(s.valueOf()):st(s)?s.map(l):s}return r},{isClass:!0}),rp="clone",cD=["typed"],lD=U(rp,cD,e=>{var{typed:t}=e;return t(rp,{any:ze})});function wv(e){var t=e.length,r=e[0].length,n,i,a=[];for(i=0;i<r;i++){var o=[];for(n=0;n<t;n++)o.push(e[n][i]);a.push(o)}return a}function Da(e){for(var t=0;t<e.length;t++)if(Fr(e[t]))return!0;return!1}function Sn(e,t){ke(e)&&(e=e.valueOf());for(var r=0,n=e.length;r<n;r++){var i=e[r];Array.isArray(i)?Sn(i,t):t(i)}}function Qe(e,t,r){return e&&typeof e.map=="function"?e.map(function(n){return Qe(n,t)}):t(e)}function xu(e,t,r){var n=Array.isArray(e)?Ve(e):e.size();if(t<0||t>=n.length)throw new $r(t,n.length);return ke(e)?e.create(qs(e.valueOf(),t,r)):qs(e,t,r)}function qs(e,t,r){var n,i,a,o;if(t<=0)if(Array.isArray(e[0])){for(o=wv(e),i=[],n=0;n<o.length;n++)i[n]=qs(o[n],t-1,r);return i}else{for(a=e[0],n=1;n<e.length;n++)a=r(a,e[n]);return a}else{for(i=[],n=0;n<e.length;n++)i[n]=qs(e[n],t-1,r);return i}}function np(e,t,r,n,i,a,o,u,c,l,s){var f=e._values,p=e._index,m=e._ptr,d,h,w,v;if(n)for(h=m[t],w=m[t+1],d=h;d<w;d++)v=p[d],r[v]!==a?(r[v]=a,o.push(v),n[v]=f[d]):(n[v]=u(n[v],f[d]),i[v]=a);else for(h=m[t],w=m[t+1],d=h;d<w;d++)v=p[d],r[v]!==a?(r[v]=a,o.push(v)):i[v]=a}var ip="isInteger",fD=["typed"],pD=U(ip,fD,e=>{var{typed:t}=e;return t(ip,{number:Fe,BigNumber:function(r){return r.isInt()},Fraction:function(r){return r.d===1&&isFinite(r.n)},"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Hr="number",Ea="number, number";function Nv(e){return Math.abs(e)}Nv.signature=Hr;function Dv(e,t){return e+t}Dv.signature=Ea;function Ev(e,t){return e-t}Ev.signature=Ea;function Av(e,t){return e*t}Av.signature=Ea;function Sv(e){return-e}Sv.signature=Hr;function Cv(e){return e}Cv.signature=Hr;function Qa(e){return fN(e)}Qa.signature=Hr;function Mv(e){return e*e*e}Mv.signature=Hr;function _v(e){return Math.exp(e)}_v.signature=Hr;function Fv(e){return pN(e)}Fv.signature=Hr;function Tv(e,t){if(!Fe(e)||!Fe(t))throw new Error("Parameters in function lcm must be integer numbers");if(e===0||t===0)return 0;for(var r,n=e*t;t!==0;)r=t,t=e%r,e=r;return Math.abs(n/e)}Tv.signature=Ea;function mD(e,t){return Math.log(e)}function Ov(e){return cN(e)}Ov.signature=Hr;function Bv(e){return uN(e)}Bv.signature=Hr;function ap(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,r=t<0;if(r&&(t=-t),t===0)throw new Error("Root must be non-zero");if(e<0&&Math.abs(t)%2!==1)throw new Error("Root must be odd when a is negative.");if(e===0)return r?1/0:0;if(!isFinite(e))return r?0:e;var n=Math.pow(Math.abs(e),1/t);return n=e<0?-n:n,r?1/n:n}function qc(e){return Wn(e)}qc.signature=Hr;function kv(e){return e*e}kv.signature=Hr;function Iv(e,t){var r,n,i,a=0,o=1,u=1,c=0;if(!Fe(e)||!Fe(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)n=Math.floor(e/t),i=e-n*t,r=a,a=o-n*a,o=r,r=u,u=c-n*u,c=r,e=t,t=i;var l;return e<0?l=[-e,-o,-c]:l=[e,e?o:0,c],l}Iv.signature=Ea;function Rv(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}Rv.signature=Ea;function Ua(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!Fe(t)||t<0||t>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat($g(e,t))}var dD="number",Aa="number, number";function qv(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function bitAnd");return e&t}qv.signature=Aa;function zv(e){if(!Fe(e))throw new Error("Integer expected in function bitNot");return~e}zv.signature=dD;function jv(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function bitOr");return e|t}jv.signature=Aa;function Lv(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function bitXor");return e^t}Lv.signature=Aa;function Pv(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function leftShift");return e<<t}Pv.signature=Aa;function Vv(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function rightArithShift");return e>>t}Vv.signature=Aa;function Uv(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function rightLogShift");return e>>>t}Uv.signature=Aa;function bn(e,t){if(t<e)return 1;if(t===e)return t;var r=t+e>>1;return bn(e,r)*bn(r+1,t)}function $v(e,t){if(!Fe(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!Fe(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(t>e)throw new TypeError("k must be less than or equal to n");for(var r=e-t,n=1,i=t<r?r+1:t+1,a=2,o=t<r?t:r,u=i;u<=e;++u)for(n*=u;a<=o&&n%a===0;)n/=a,++a;return a<=o&&(n/=bn(a,o)),n}$v.signature="number, number";var hD=Math.PI,gD=2*Math.PI,vD=Math.E,yD=1.618033988749895,xD="number",Dl="number, number";function Hv(e){return!e}Hv.signature=xD;function Jv(e,t){return!!(e||t)}Jv.signature=Dl;function Gv(e,t){return!!e!=!!t}Gv.signature=Dl;function Wv(e,t){return!!(e&&t)}Wv.signature=Dl;function zs(e){var t;if(Fe(e))return e<=0?isFinite(e)?1/0:NaN:e>171?1/0:bn(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*zs(1-e));if(e>=171.35)return 1/0;if(e>85){var r=e*e,n=r*e,i=n*e,a=i*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*r)-139/(51840*n)-571/(2488320*i)+163879/(209018880*a)+5246819/(75246796800*a*e))}--e,t=aa[0];for(var o=1;o<aa.length;++o)t+=aa[o]/(e+o);var u=e+Kv+.5;return Math.sqrt(2*Math.PI)*Math.pow(u,e+.5)*Math.exp(-u)*t}zs.signature="number";var Kv=4.7421875,aa=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],Qv=.9189385332046728,bD=5,wD=7,op=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];function js(e){if(e<0)return NaN;if(e===0)return 1/0;if(!isFinite(e))return e;if(e<.5)return Math.log(Math.PI/Math.sin(Math.PI*e))-js(1-e);e=e-1;for(var t=e+bD+.5,r=op[0],n=wD-1;n>=1;n--)r+=op[n]/(e+n);return Qv+(e+.5)*Math.log(t)-t+Math.log(r)}js.signature="number";var er="number";function Zv(e){return vN(e)}Zv.signature=er;function Xv(e){return Math.atan(1/e)}Xv.signature=er;function Yv(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}Yv.signature=er;function ey(e){return Math.asin(1/e)}ey.signature=er;function ty(e){var t=1/e;return Math.log(t+Math.sqrt(t*t+1))}ty.signature=er;function ry(e){return Math.acos(1/e)}ry.signature=er;function ny(e){var t=1/e,r=Math.sqrt(t*t-1);return Math.log(r+t)}ny.signature=er;function iy(e){return yN(e)}iy.signature=er;function ay(e){return xN(e)}ay.signature=er;function oy(e){return 1/Math.tan(e)}oy.signature=er;function sy(e){var t=Math.exp(2*e);return(t+1)/(t-1)}sy.signature=er;function uy(e){return 1/Math.sin(e)}uy.signature=er;function cy(e){return e===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*Wn(e)}cy.signature=er;function ly(e){return 1/Math.cos(e)}ly.signature=er;function fy(e){return 2/(Math.exp(e)+Math.exp(-e))}fy.signature=er;function py(e){return wN(e)}py.signature=er;var bu="number";function my(e){return e<0}my.signature=bu;function dy(e){return e>0}dy.signature=bu;function hy(e){return e===0}hy.signature=bu;function gy(e){return Number.isNaN(e)}gy.signature=bu;var sp="isNegative",ND=["typed"],DD=U(sp,ND,e=>{var{typed:t}=e;return t(sp,{number:my,BigNumber:function(r){return r.isNeg()&&!r.isZero()&&!r.isNaN()},Fraction:function(r){return r.s<0},Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),up="isNumeric",ED=["typed"],AD=U(up,ED,e=>{var{typed:t}=e;return t(up,{"number | BigNumber | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),cp="hasNumericValue",SD=["typed","isNumeric"],CD=U(cp,SD,e=>{var{typed:t,isNumeric:r}=e;return t(cp,{boolean:()=>!0,string:function(n){return n.trim().length>0&&!isNaN(Number(n))},any:function(n){return r(n)}})}),lp="isPositive",MD=["typed"],_D=U(lp,MD,e=>{var{typed:t}=e;return t(lp,{number:dy,BigNumber:function(r){return!r.isNeg()&&!r.isZero()&&!r.isNaN()},Fraction:function(r){return r.s>0&&r.n>0},Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),fp="isZero",FD=["typed"],TD=U(fp,FD,e=>{var{typed:t}=e;return t(fp,{number:hy,BigNumber:function(r){return r.isZero()},Complex:function(r){return r.re===0&&r.im===0},Fraction:function(r){return r.d===1&&r.n===0},Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),pp="isNaN",OD=["typed"],BD=U(pp,OD,e=>{var{typed:t}=e;return t(pp,{number:gy,BigNumber:function(r){return r.isNaN()},Fraction:function(r){return!1},Complex:function(r){return r.isNaN()},Unit:function(r){return Number.isNaN(r.value)},"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),mp="typeOf",kD=["typed"],ID=U(mp,kD,e=>{var{typed:t}=e;return t(mp,{any:dt})});function Tr(e,t,r){if(r==null)return e.eq(t);if(e.eq(t))return!0;if(e.isNaN()||t.isNaN())return!1;if(e.isFinite()&&t.isFinite()){var n=e.minus(t).abs();if(n.isZero())return!0;var i=e.constructor.max(e.abs(),t.abs());return n.lte(i.times(r))}return!1}function RD(e,t,r){return sr(e.re,t.re,r)&&sr(e.im,t.im,r)}var Sa=U("compareUnits",["typed"],e=>{var{typed:t}=e;return{"Unit, Unit":t.referToSelf(r=>(n,i)=>{if(!n.equalBase(i))throw new Error("Cannot compare units with different base");return t.find(r,[n.valueType(),i.valueType()])(n.value,i.value)})}}),Ls="equalScalar",qD=["typed","config"],zD=U(Ls,qD,e=>{var{typed:t,config:r}=e,n=Sa({typed:t});return t(Ls,{"boolean, boolean":function(i,a){return i===a},"number, number":function(i,a){return sr(i,a,r.epsilon)},"BigNumber, BigNumber":function(i,a){return i.eq(a)||Tr(i,a,r.epsilon)},"Fraction, Fraction":function(i,a){return i.equals(a)},"Complex, Complex":function(i,a){return RD(i,a,r.epsilon)}},n)});U(Ls,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Ls,{"number, number":function(n,i){return sr(n,i,r.epsilon)}})});var jD="SparseMatrix",LD=["typed","equalScalar","Matrix"],PD=U(jD,LD,e=>{var{typed:t,equalScalar:r,Matrix:n}=e;function i(h,w){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(w&&!Qt(w))throw new Error("Invalid datatype: "+w);if(ke(h))a(this,h,w);else if(h&&st(h.index)&&st(h.ptr)&&st(h.size))this._values=h.values,this._index=h.index,this._ptr=h.ptr,this._size=h.size,this._datatype=w||h.datatype;else if(st(h))o(this,h,w);else{if(h)throw new TypeError("Unsupported type of data ("+dt(h)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=w}}function a(h,w,v){w.type==="SparseMatrix"?(h._values=w._values?ze(w._values):void 0,h._index=ze(w._index),h._ptr=ze(w._ptr),h._size=ze(w._size),h._datatype=v||w._datatype):o(h,w.valueOf(),v||w._datatype)}function o(h,w,v){h._values=[],h._index=[],h._ptr=[],h._datatype=v;var b=w.length,g=0,x=r,y=0;if(Qt(v)&&(x=t.find(r,[v,v])||r,y=t.convert(0,v)),b>0){var N=0;do{h._ptr.push(h._index.length);for(var E=0;E<b;E++){var A=w[E];if(st(A)){if(N===0&&g<A.length&&(g=A.length),N<A.length){var D=A[N];x(D,y)||(h._values.push(D),h._index.push(E))}}else N===0&&g<1&&(g=1),x(A,y)||(h._values.push(A),h._index.push(E))}N++}while(N<g)}h._ptr.push(h._index.length),h._size=[b,g]}i.prototype=new n,i.prototype.createSparseMatrix=function(h,w){return new i(h,w)},Object.defineProperty(i,"name",{value:"SparseMatrix"}),i.prototype.constructor=i,i.prototype.type="SparseMatrix",i.prototype.isSparseMatrix=!0,i.prototype.getDataType=function(){return oo(this._values,dt)},i.prototype.storage=function(){return"sparse"},i.prototype.datatype=function(){return this._datatype},i.prototype.create=function(h,w){return new i(h,w)},i.prototype.density=function(){var h=this._size[0],w=this._size[1];return h!==0&&w!==0?this._index.length/(h*w):0},i.prototype.subset=function(h,w,v){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return u(this,h);case 2:case 3:return c(this,h,w,v);default:throw new SyntaxError("Wrong number of arguments")}};function u(h,w){if(!lu(w))throw new TypeError("Invalid index");var v=w.isScalar();if(v)return h.get(w.min());var b=w.size();if(b.length!==h._size.length)throw new Ke(b.length,h._size.length);var g,x,y,N,E=w.min(),A=w.max();for(g=0,x=h._size.length;g<x;g++)pt(E[g],h._size[g]),pt(A[g],h._size[g]);var D=h._values,S=h._index,C=h._ptr,_=w.dimension(0),R=w.dimension(1),P=[],I=[];_.forEach(function(k,te){I[k]=te[0],P[k]=!0});var O=D?[]:void 0,F=[],q=[];return R.forEach(function(k){for(q.push(F.length),y=C[k],N=C[k+1];y<N;y++)g=S[y],P[g]===!0&&(F.push(I[g]),O&&O.push(D[y]))}),q.push(F.length),new i({values:O,index:F,ptr:q,size:b,datatype:h._datatype})}function c(h,w,v,b){if(!w||w.isIndex!==!0)throw new TypeError("Invalid index");var g=w.size(),x=w.isScalar(),y;if(ke(v)?(y=v.size(),v=v.toArray()):y=Ve(v),x){if(y.length!==0)throw new TypeError("Scalar expected");h.set(w.min(),v,b)}else{if(g.length!==1&&g.length!==2)throw new Ke(g.length,h._size.length,"<");if(y.length<g.length){for(var N=0,E=0;g[N]===1&&y[N]===1;)N++;for(;g[N]===1;)E++,N++;v=hv(v,g.length,E,y)}if(!Oi(g,y))throw new Ke(g,y,">");if(g.length===1){var A=w.dimension(0);A.forEach(function(C,_){pt(C),h.set([C,0],v[_[0]],b)})}else{var D=w.dimension(0),S=w.dimension(1);D.forEach(function(C,_){pt(C),S.forEach(function(R,P){pt(R),h.set([C,R],v[_[0]][P[0]],b)})})}}return h}i.prototype.get=function(h){if(!st(h))throw new TypeError("Array expected");if(h.length!==this._size.length)throw new Ke(h.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var w=h[0],v=h[1];pt(w,this._size[0]),pt(v,this._size[1]);var b=l(w,this._ptr[v],this._ptr[v+1],this._index);return b<this._ptr[v+1]&&this._index[b]===w?this._values[b]:0},i.prototype.set=function(h,w,v){if(!st(h))throw new TypeError("Array expected");if(h.length!==this._size.length)throw new Ke(h.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var b=h[0],g=h[1],x=this._size[0],y=this._size[1],N=r,E=0;Qt(this._datatype)&&(N=t.find(r,[this._datatype,this._datatype])||r,E=t.convert(0,this._datatype)),(b>x-1||g>y-1)&&(p(this,Math.max(b+1,x),Math.max(g+1,y),v),x=this._size[0],y=this._size[1]),pt(b,x),pt(g,y);var A=l(b,this._ptr[g],this._ptr[g+1],this._index);return A<this._ptr[g+1]&&this._index[A]===b?N(w,E)?s(A,g,this._values,this._index,this._ptr):this._values[A]=w:N(w,E)||f(A,b,g,w,this._values,this._index,this._ptr),this};function l(h,w,v,b){if(v-w===0)return v;for(var g=w;g<v;g++)if(b[g]===h)return g;return w}function s(h,w,v,b,g){v.splice(h,1),b.splice(h,1);for(var x=w+1;x<g.length;x++)g[x]--}function f(h,w,v,b,g,x,y){g.splice(h,0,b),x.splice(h,0,w);for(var N=v+1;N<y.length;N++)y[N]++}i.prototype.resize=function(h,w,v){if(!Fr(h))throw new TypeError("Array or Matrix expected");var b=h.valueOf().map(x=>Array.isArray(x)&&x.length===1?x[0]:x);if(b.length!==2)throw new Error("Only two dimensions matrix are supported");b.forEach(function(x){if(!Ue(x)||!Fe(x)||x<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Ge(b)+")")});var g=v?this.clone():this;return p(g,b[0],b[1],w)};function p(h,w,v,b){var g=b||0,x=r,y=0;Qt(h._datatype)&&(x=t.find(r,[h._datatype,h._datatype])||r,y=t.convert(0,h._datatype),g=t.convert(g,h._datatype));var N=!x(g,y),E=h._size[0],A=h._size[1],D,S,C;if(v>A){for(S=A;S<v;S++)if(h._ptr[S]=h._values.length,N)for(D=0;D<E;D++)h._values.push(g),h._index.push(D);h._ptr[v]=h._values.length}else v<A&&(h._ptr.splice(v+1,A-v),h._values.splice(h._ptr[v],h._values.length),h._index.splice(h._ptr[v],h._index.length));if(A=v,w>E){if(N){var _=0;for(S=0;S<A;S++){h._ptr[S]=h._ptr[S]+_,C=h._ptr[S+1]+_;var R=0;for(D=E;D<w;D++,R++)h._values.splice(C+R,0,g),h._index.splice(C+R,0,D),_++}h._ptr[A]=h._values.length}}else if(w<E){var P=0;for(S=0;S<A;S++){h._ptr[S]=h._ptr[S]-P;var I=h._ptr[S],O=h._ptr[S+1]-P;for(C=I;C<O;C++)D=h._index[C],D>w-1&&(h._values.splice(C,1),h._index.splice(C,1),P++)}h._ptr[S]=h._values.length}return h._size[0]=w,h._size[1]=v,h}i.prototype.reshape=function(h,w){if(!st(h))throw new TypeError("Array expected");if(h.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");h.forEach(function(k){if(!Ue(k)||!Fe(k)||k<=-2||k===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+Ge(h)+")")});var v=this._size[0]*this._size[1];h=Nl(h,v);var b=h[0]*h[1];if(v!==b)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var g=w?this.clone():this;if(this._size[0]===h[0]&&this._size[1]===h[1])return g;for(var x=[],y=0;y<g._ptr.length;y++)for(var N=0;N<g._ptr[y+1]-g._ptr[y];N++)x.push(y);for(var E=g._values.slice(),A=g._index.slice(),D=0;D<g._index.length;D++){var S=A[D],C=x[D],_=S*g._size[1]+C;x[D]=_%h[1],A[D]=Math.floor(_/h[1])}g._values.length=0,g._index.length=0,g._ptr.length=h[1]+1,g._size=h.slice();for(var R=0;R<g._ptr.length;R++)g._ptr[R]=0;for(var P=0;P<E.length;P++){var I=A[P],O=x[P],F=E[P],q=l(I,g._ptr[O],g._ptr[O+1],g._index);f(q,I,O,F,g._values,g._index,g._ptr)}return g},i.prototype.clone=function(){var h=new i({values:this._values?ze(this._values):void 0,index:ze(this._index),ptr:ze(this._ptr),size:ze(this._size),datatype:this._datatype});return h},i.prototype.size=function(){return this._size.slice(0)},i.prototype.map=function(h,w){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var v=this,b=this._size[0],g=this._size[1],x=bv(h),y=function(N,E,A){return x===1?h(N):x===2?h(N,[E,A]):h(N,[E,A],v)};return m(this,0,b-1,0,g-1,y,w)};function m(h,w,v,b,g,x,y){var N=[],E=[],A=[],D=r,S=0;Qt(h._datatype)&&(D=t.find(r,[h._datatype,h._datatype])||r,S=t.convert(0,h._datatype));for(var C=function(K,V,ue){K=x(K,V,ue),D(K,S)||(N.push(K),E.push(V))},_=b;_<=g;_++){A.push(N.length);var R=h._ptr[_],P=h._ptr[_+1];if(y)for(var I=R;I<P;I++){var O=h._index[I];O>=w&&O<=v&&C(h._values[I],O-w,_-b)}else{for(var F={},q=R;q<P;q++){var k=h._index[q];F[k]=h._values[q]}for(var te=w;te<=v;te++){var se=te in F?F[te]:0;C(se,te-w,_-b)}}}return A.push(N.length),new i({values:N,index:E,ptr:A,size:[v-w+1,g-b+1]})}i.prototype.forEach=function(h,w){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var v=this,b=this._size[0],g=this._size[1],x=0;x<g;x++){var y=this._ptr[x],N=this._ptr[x+1];if(w)for(var E=y;E<N;E++){var A=this._index[E];h(this._values[E],[A,x],v)}else{for(var D={},S=y;S<N;S++){var C=this._index[S];D[C]=this._values[S]}for(var _=0;_<b;_++){var R=_ in D?D[_]:0;h(R,[_,x],v)}}}},i.prototype[Symbol.iterator]=function*(){if(!this._values)throw new Error("Cannot iterate a Pattern only matrix");for(var h=this._size[1],w=0;w<h;w++)for(var v=this._ptr[w],b=this._ptr[w+1],g=v;g<b;g++){var x=this._index[g];yield{value:this._values[g],index:[x,w]}}},i.prototype.toArray=function(){return d(this._values,this._index,this._ptr,this._size,!0)},i.prototype.valueOf=function(){return d(this._values,this._index,this._ptr,this._size,!1)};function d(h,w,v,b,g){var x=b[0],y=b[1],N=[],E,A;for(E=0;E<x;E++)for(N[E]=[],A=0;A<y;A++)N[E][A]=0;for(A=0;A<y;A++)for(var D=v[A],S=v[A+1],C=D;C<S;C++)E=w[C],N[E][A]=h?g?ze(h[C]):h[C]:1;return N}return i.prototype.format=function(h){for(var w=this._size[0],v=this._size[1],b=this.density(),g="Sparse Matrix ["+Ge(w,h)+" x "+Ge(v,h)+"] density: "+Ge(b,h)+`
|
|
27
|
-
`,
|
|
28
|
-
(`+Ge(A,h)+", "+Ge(x,h)+") ==> "+(this._values?Ge(this._values[E],h):"X")}return g},i.prototype.toString=function(){return Ge(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(h){if(h){if($e(h)&&(h=h.toNumber()),!Ue(h)||!Fe(h))throw new TypeError("The parameter k must be an integer number")}else h=0;var w=h>0?h:0,v=h<0?-h:0,b=this._size[0],g=this._size[1],x=Math.min(b-v,g-w),y=[],N=[],E=[];E[0]=0;for(var A=w;A<g&&y.length<x;A++)for(var D=this._ptr[A],S=this._ptr[A+1],C=D;C<S;C++){var _=this._index[C];if(_===A-w+v){y.push(this._values[C]),N[y.length-1]=_-v;break}}return E.push(y.length),new i({values:y,index:N,ptr:E,size:[x,1]})},i.fromJSON=function(h){return new i(h)},i.diagonal=function(h,w,v,b,g){if(!st(h))throw new TypeError("Array expected, size parameter");if(h.length!==2)throw new Error("Only two dimensions matrix are supported");if(h=h.map(function(k){if($e(k)&&(k=k.toNumber()),!Ue(k)||!Fe(k)||k<1)throw new Error("Size values must be positive integers");return k}),v){if($e(v)&&(v=v.toNumber()),!Ue(v)||!Fe(v))throw new TypeError("The parameter k must be an integer number")}else v=0;var x=r,y=0;Qt(g)&&(x=t.find(r,[g,g])||r,y=t.convert(0,g));var N=v>0?v:0,E=v<0?-v:0,A=h[0],D=h[1],S=Math.min(A-E,D-N),C;if(st(w)){if(w.length!==S)throw new Error("Invalid value array length");C=function(k){return w[k]}}else if(ke(w)){var _=w.size();if(_.length!==1||_[0]!==S)throw new Error("Invalid matrix length");C=function(k){return w.get([k])}}else C=function(){return w};for(var R=[],P=[],I=[],O=0;O<D;O++){I.push(R.length);var F=O-N;if(F>=0&&F<S){var q=C(F);x(q,y)||(P.push(F+E),R.push(q))}}return I.push(R.length),new i({values:R,index:P,ptr:I,size:[A,D]})},i.prototype.swapRows=function(h,w){if(!Ue(h)||!Fe(h)||!Ue(w)||!Fe(w))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return pt(h,this._size[0]),pt(w,this._size[0]),i._swapRows(h,w,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(h,w,v,b,g){for(var x=b[h],y=b[h+1],N=x;N<y;N++)g(v[N],w[N])},i._swapRows=function(h,w,v,b,g,x){for(var y=0;y<v;y++){var N=x[y],E=x[y+1],A=l(h,N,E,g),D=l(w,N,E,g);if(A<E&&D<E&&g[A]===h&&g[D]===w){if(b){var S=b[A];b[A]=b[D],b[D]=S}continue}if(A<E&&g[A]===h&&(D>=E||g[D]!==w)){var C=b?b[A]:void 0;g.splice(D,0,w),b&&b.splice(D,0,C),g.splice(D<=A?A+1:A,1),b&&b.splice(D<=A?A+1:A,1);continue}if(D<E&&g[D]===w&&(A>=E||g[A]!==h)){var _=b?b[D]:void 0;g.splice(A,0,h),b&&b.splice(A,0,_),g.splice(A<=D?D+1:D,1),b&&b.splice(A<=D?D+1:D,1)}}},i},{isClass:!0}),VD="number",UD=["typed"];function $D(e){var t=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(t){var r={"0b":2,"0o":8,"0x":16}[t[1]],n=t[2],i=t[3];return{input:e,radix:r,integerPart:n,fractionalPart:i}}else return null}function HD(e){for(var t=parseInt(e.integerPart,e.radix),r=0,n=0;n<e.fractionalPart.length;n++){var i=parseInt(e.fractionalPart[n],e.radix);r+=i/Math.pow(e.radix,n+1)}var a=t+r;if(isNaN(a))throw new SyntaxError('String "'+e.input+'" is not a valid number');return a}var JD=U(VD,UD,e=>{var{typed:t}=e,r=t("number",{"":function(){return 0},number:function(n){return n},string:function(n){if(n==="NaN")return NaN;var i=$D(n);if(i)return HD(i);var a=0,o=n.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);o&&(a=Number(o[2]),n=o[1]);var u=Number(n);if(isNaN(u))throw new SyntaxError('String "'+n+'" is not a valid number');if(o){if(u>2**a-1)throw new SyntaxError('String "'.concat(n,'" is out of range'));u>=2**(a-1)&&(u=u-2**a)}return u},BigNumber:function(n){return n.toNumber()},Fraction:function(n){return n.valueOf()},Unit:t.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),null:function(n){return 0},"Unit, string | Unit":function(n,i){return n.toNumber(i)},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))});return r.fromJSON=function(n){return parseFloat(n.value)},r}),dp="string",GD=["typed"],WD=U(dp,GD,e=>{var{typed:t}=e;return t(dp,{"":function(){return""},number:Di,null:function(r){return"null"},boolean:function(r){return r+""},string:function(r){return r},"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r)),any:function(r){return String(r)}})}),hp="boolean",KD=["typed"],QD=U(hp,KD,e=>{var{typed:t}=e;return t(hp,{"":function(){return!1},boolean:function(r){return r},number:function(r){return!!r},null:function(r){return!1},BigNumber:function(r){return!r.isZero()},string:function(r){var n=r.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;var i=Number(r);if(r!==""&&!isNaN(i))return!!i;throw new Error('Cannot convert "'+r+'" to a boolean')},"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),ZD="bignumber",XD=["typed","BigNumber"],YD=U(ZD,XD,e=>{var{typed:t,BigNumber:r}=e;return t("bignumber",{"":function(){return new r(0)},number:function(n){return new r(n+"")},string:function(n){var i=n.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(i){var a=i[2],o=r(i[1]),u=new r(2).pow(Number(a));if(o.gt(u.sub(1)))throw new SyntaxError('String "'.concat(n,'" is out of range'));var c=new r(2).pow(Number(a)-1);return o.gte(c)?o.sub(u):o}return new r(n)},BigNumber:function(n){return n},Unit:t.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),Fraction:function(n){return new r(n.n).div(n.d).times(n.s)},null:function(n){return new r(0)},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))})}),eE="complex",tE=["typed","Complex"],rE=U(eE,tE,e=>{var{typed:t,Complex:r}=e;return t("complex",{"":function(){return r.ZERO},number:function(n){return new r(n,0)},"number, number":function(n,i){return new r(n,i)},"BigNumber, BigNumber":function(n,i){return new r(n.toNumber(),i.toNumber())},Fraction:function(n){return new r(n.valueOf(),0)},Complex:function(n){return n.clone()},string:function(n){return r(n)},null:function(n){return r(0)},Object:function(n){if("re"in n&&"im"in n)return new r(n.re,n.im);if("r"in n&&"phi"in n||"abs"in n&&"arg"in n)return new r(n);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))})}),nE="fraction",iE=["typed","Fraction"],aE=U(nE,iE,e=>{var{typed:t,Fraction:r}=e;return t("fraction",{number:function(n){if(!isFinite(n)||isNaN(n))throw new Error(n+" cannot be represented as a fraction");return new r(n)},string:function(n){return new r(n)},"number, number":function(n,i){return new r(n,i)},null:function(n){return new r(0)},BigNumber:function(n){return new r(n.toString())},Fraction:function(n){return n},Unit:t.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),Object:function(n){return new r(n)},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))})}),gp="matrix",oE=["typed","Matrix","DenseMatrix","SparseMatrix"],sE=U(gp,oE,e=>{var{typed:t,Matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(gp,{"":function(){return a([])},string:function(o){return a([],o)},"string, string":function(o,u){return a([],o,u)},Array:function(o){return a(o)},Matrix:function(o){return a(o,o.storage())},"Array | Matrix, string":a,"Array | Matrix, string, string":a});function a(o,u,c){if(u==="dense"||u==="default"||u===void 0)return new n(o,c);if(u==="sparse")return new i(o,c);throw new TypeError("Unknown matrix type "+JSON.stringify(u)+".")}}),vp="matrixFromFunction",uE=["typed","matrix","isZero"],cE=U(vp,uE,e=>{var{typed:t,matrix:r,isZero:n}=e;return t(vp,{"Array | Matrix, function, string, string":function(a,o,u,c){return i(a,o,u,c)},"Array | Matrix, function, string":function(a,o,u){return i(a,o,u)},"Matrix, function":function(a,o){return i(a,o,"dense")},"Array, function":function(a,o){return i(a,o,"dense").toArray()},"Array | Matrix, string, function":function(a,o,u){return i(a,u,o)},"Array | Matrix, string, string, function":function(a,o,u,c){return i(a,c,o,u)}});function i(a,o,u,c){var l;return c!==void 0?l=r(u,c):l=r(u),l.resize(a),l.forEach(function(s,f){var p=o(f);n(p)||l.set(f,p)}),l}}),yp="matrixFromRows",lE=["typed","matrix","flatten","size"],fE=U(yp,lE,e=>{var{typed:t,matrix:r,flatten:n,size:i}=e;return t(yp,{"...Array":function(u){return a(u)},"...Matrix":function(u){return r(a(u.map(c=>c.toArray())))}});function a(u){if(u.length===0)throw new TypeError("At least one row is needed to construct a matrix.");var c=o(u[0]),l=[];for(var s of u){var f=o(s);if(f!==c)throw new TypeError("The vectors had different length: "+(c|0)+" ≠ "+(f|0));l.push(n(s))}return l}function o(u){var c=i(u);if(c.length===1)return c[0];if(c.length===2){if(c[0]===1)return c[1];if(c[1]===1)return c[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.")}}),xp="matrixFromColumns",pE=["typed","matrix","flatten","size"],mE=U(xp,pE,e=>{var{typed:t,matrix:r,flatten:n,size:i}=e;return t(xp,{"...Array":function(u){return a(u)},"...Matrix":function(u){return r(a(u.map(c=>c.toArray())))}});function a(u){if(u.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var c=o(u[0]),l=[],s=0;s<c;s++)l[s]=[];for(var f of u){var p=o(f);if(p!==c)throw new TypeError("The vectors had different length: "+(c|0)+" ≠ "+(p|0));for(var m=n(f),d=0;d<c;d++)l[d].push(m[d])}return l}function o(u){var c=i(u);if(c.length===1)return c[0];if(c.length===2){if(c[0]===1)return c[1];if(c[1]===1)return c[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.")}}),bp="splitUnit",dE=["typed"],hE=U(bp,dE,e=>{var{typed:t}=e;return t(bp,{"Unit, Array":function(r,n){return r.splitUnit(n)}})}),wp="unaryMinus",gE=["typed"],vE=U(wp,gE,e=>{var{typed:t}=e;return t(wp,{number:Sv,"Complex | BigNumber | Fraction":r=>r.neg(),Unit:t.referToSelf(r=>n=>{var i=n.clone();return i.value=t.find(r,i.valueType())(n.value),i}),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Np="unaryPlus",yE=["typed","config","BigNumber"],xE=U(Np,yE,e=>{var{typed:t,config:r,BigNumber:n}=e;return t(Np,{number:Cv,Complex:function(i){return i},BigNumber:function(i){return i},Fraction:function(i){return i},Unit:function(i){return i.clone()},"Array | Matrix":t.referToSelf(i=>a=>Qe(a,i)),"boolean | string":function(i){return r.number==="BigNumber"?new n(+i):+i}})}),Dp="abs",bE=["typed"],wE=U(Dp,bE,e=>{var{typed:t}=e;return t(Dp,{number:Nv,"Complex | BigNumber | Fraction | Unit":r=>r.abs(),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Ep="apply",NE=["typed","isInteger"],El=U(Ep,NE,e=>{var{typed:t,isInteger:r}=e;return t(Ep,{"Array | Matrix, number | BigNumber, function":function(n,i,a){if(!r(i))throw new TypeError("Integer number expected for dimension");var o=Array.isArray(n)?Ve(n):n.size();if(i<0||i>=o.length)throw new $r(i,o.length);return ke(n)?n.create(Ps(n.valueOf(),i,a)):Ps(n,i,a)}})});function Ps(e,t,r){var n,i,a;if(t<=0)if(Array.isArray(e[0])){for(a=DE(e),i=[],n=0;n<a.length;n++)i[n]=Ps(a[n],t-1,r);return i}else return r(e);else{for(i=[],n=0;n<e.length;n++)i[n]=Ps(e[n],t-1,r);return i}}function DE(e){var t=e.length,r=e[0].length,n,i,a=[];for(i=0;i<r;i++){var o=[];for(n=0;n<t;n++)o.push(e[n][i]);a.push(o)}return a}var Ap="addScalar",EE=["typed"],AE=U(Ap,EE,e=>{var{typed:t}=e;return t(Ap,{"number, number":Dv,"Complex, Complex":function(r,n){return r.add(n)},"BigNumber, BigNumber":function(r,n){return r.plus(n)},"Fraction, Fraction":function(r,n){return r.add(n)},"Unit, Unit":t.referToSelf(r=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var a=n.clone();return a.value=t.find(r,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})}),Sp="subtractScalar",SE=["typed"],CE=U(Sp,SE,e=>{var{typed:t}=e;return t(Sp,{"number, number":Ev,"Complex, Complex":function(r,n){return r.sub(n)},"BigNumber, BigNumber":function(r,n){return r.minus(n)},"Fraction, Fraction":function(r,n){return r.sub(n)},"Unit, Unit":t.referToSelf(r=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var a=n.clone();return a.value=t.find(r,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})}),Cp="cbrt",ME=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],_E=U(Cp,ME,e=>{var{config:t,typed:r,isNegative:n,unaryMinus:i,matrix:a,Complex:o,BigNumber:u,Fraction:c}=e;return r(Cp,{number:Qa,Complex:l,"Complex, boolean":l,BigNumber:function(f){return f.cbrt()},Unit:s});function l(f,p){var m=f.arg()/3,d=f.abs(),h=new o(Qa(d),0).mul(new o(0,m).exp());if(p){var w=[h,new o(Qa(d),0).mul(new o(0,m+Math.PI*2/3).exp()),new o(Qa(d),0).mul(new o(0,m-Math.PI*2/3).exp())];return t.matrix==="Array"?w:a(w)}else return h}function s(f){if(f.value&&wn(f.value)){var p=f.clone();return p.value=1,p=p.pow(1/3),p.value=l(f.value),p}else{var m=n(f.value);m&&(f.value=i(f.value));var d;$e(f.value)?d=new u(1).div(3):yo(f.value)?d=new c(1,3):d=1/3;var h=f.pow(d);return m&&(h.value=i(h.value)),h}}}),FE="matAlgo11xS0s",TE=["typed","equalScalar"],Jt=U(FE,TE,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a,o){var u=n._values,c=n._index,l=n._ptr,s=n._size,f=n._datatype;if(!u)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=s[0],m=s[1],d,h=r,w=0,v=a;typeof f=="string"&&(d=f,h=t.find(r,[d,d]),w=t.convert(0,d),i=t.convert(i,d),v=t.find(a,[d,d]));for(var b=[],g=[],x=[],y=0;y<m;y++){x[y]=g.length;for(var N=l[y],E=l[y+1],A=N;A<E;A++){var D=c[A],S=o?v(i,u[A]):v(u[A],i);h(S,w)||(g.push(D),b.push(S))}}return x[m]=g.length,n.createSparseMatrix({values:b,index:g,ptr:x,size:[p,m],datatype:d})}}),OE="matAlgo12xSfs",BE=["typed","DenseMatrix"],It=U(OE,BE,e=>{var{typed:t,DenseMatrix:r}=e;return function(n,i,a,o){var u=n._values,c=n._index,l=n._ptr,s=n._size,f=n._datatype;if(!u)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=s[0],m=s[1],d,h=a;typeof f=="string"&&(d=f,i=t.convert(i,d),h=t.find(a,[d,d]));for(var w=[],v=[],b=[],g=0;g<m;g++){for(var x=g+1,y=l[g],N=l[g+1],E=y;E<N;E++){var A=c[E];v[A]=u[E],b[A]=x}for(var D=0;D<p;D++)g===0&&(w[D]=[]),b[D]===x?w[D][g]=o?h(i,v[D]):h(v[D],i):w[D][g]=o?h(i,0):h(0,i)}return new r({data:w,size:[p,m],datatype:d})}}),kE="matAlgo14xDs",IE=["typed"],Jr=U(kE,IE,e=>{var{typed:t}=e;return function(n,i,a,o){var u=n._data,c=n._size,l=n._datatype,s,f=a;typeof l=="string"&&(s=l,i=t.convert(i,s),f=t.find(a,[s,s]));var p=c.length>0?r(f,0,c,c[0],u,i,o):[];return n.createDenseMatrix({data:p,size:ze(c),datatype:s})};function r(n,i,a,o,u,c,l){var s=[];if(i===a.length-1)for(var f=0;f<o;f++)s[f]=l?n(c,u[f]):n(u[f],c);else for(var p=0;p<o;p++)s[p]=r(n,i+1,a,a[i+1],u[p],c,l);return s}}),zc="ceil",RE=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],qE=U(zc,["typed","config","round"],e=>{var{typed:t,config:r,round:n}=e;return t(zc,{number:function(i){return sr(i,n(i),r.epsilon)?n(i):Math.ceil(i)},"number, number":function(i,a){if(sr(i,n(i,a),r.epsilon))return n(i,a);var[o,u]="".concat(i,"e").split("e"),c=Math.ceil(Number("".concat(o,"e").concat(Number(u)+a)));return[o,u]="".concat(c,"e").split("e"),Number("".concat(o,"e").concat(Number(u)-a))}})}),zE=U(zc,RE,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:u}=e,c=Jt({typed:t,equalScalar:a}),l=It({typed:t,DenseMatrix:u}),s=Jr({typed:t}),f=qE({typed:t,config:r,round:n});return t("ceil",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(p){return p.ceil()},"Complex, number":function(p,m){return p.ceil(m)},"Complex, BigNumber":function(p,m){return p.ceil(m.toNumber())},BigNumber:function(p){return Tr(p,n(p),r.epsilon)?n(p):p.ceil()},"BigNumber, BigNumber":function(p,m){return Tr(p,n(p,m),r.epsilon)?n(p,m):p.toDecimalPlaces(m.toNumber(),Yn.ROUND_CEIL)},Fraction:function(p){return p.ceil()},"Fraction, number":function(p,m){return p.ceil(m)},"Fraction, BigNumber":function(p,m){return p.ceil(m.toNumber())},"Array | Matrix":t.referToSelf(p=>m=>Qe(m,p)),"Array, number | BigNumber":t.referToSelf(p=>(m,d)=>Qe(m,h=>p(h,d))),"SparseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>c(m,d,p,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>s(m,d,p,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(p=>(m,d)=>s(i(d),m,p,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(p=>(m,d)=>a(m,0)?o(d.size(),d.storage()):d.storage()==="dense"?s(d,m,p,!0):l(d,m,p,!0))})}),Mp="cube",jE=["typed"],LE=U(Mp,jE,e=>{var{typed:t}=e;return t(Mp,{number:Mv,Complex:function(r){return r.mul(r).mul(r)},BigNumber:function(r){return r.times(r).times(r)},Fraction:function(r){return r.pow(3)},Unit:function(r){return r.pow(3)}})}),_p="exp",PE=["typed"],VE=U(_p,PE,e=>{var{typed:t}=e;return t(_p,{number:_v,Complex:function(r){return r.exp()},BigNumber:function(r){return r.exp()}})}),Fp="expm1",UE=["typed","Complex"],$E=U(Fp,UE,e=>{var{typed:t,Complex:r}=e;return t(Fp,{number:Fv,Complex:function(n){var i=Math.exp(n.re);return new r(i*Math.cos(n.im)-1,i*Math.sin(n.im))},BigNumber:function(n){return n.exp().minus(1)}})}),jc="fix",HE=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],JE=U(jc,["typed","ceil","floor"],e=>{var{typed:t,ceil:r,floor:n}=e;return t(jc,{number:function(i){return i>0?n(i):r(i)},"number, number":function(i,a){return i>0?n(i,a):r(i,a)}})}),GE=U(jc,HE,e=>{var{typed:t,Complex:r,matrix:n,ceil:i,floor:a,equalScalar:o,zeros:u,DenseMatrix:c}=e,l=It({typed:t,DenseMatrix:c}),s=Jr({typed:t}),f=JE({typed:t,ceil:i,floor:a});return t("fix",{number:f.signatures.number,"number, number | BigNumber":f.signatures["number,number"],Complex:function(p){return new r(p.re>0?Math.floor(p.re):Math.ceil(p.re),p.im>0?Math.floor(p.im):Math.ceil(p.im))},"Complex, number":function(p,m){return new r(p.re>0?a(p.re,m):i(p.re,m),p.im>0?a(p.im,m):i(p.im,m))},"Complex, BigNumber":function(p,m){var d=m.toNumber();return new r(p.re>0?a(p.re,d):i(p.re,d),p.im>0?a(p.im,d):i(p.im,d))},BigNumber:function(p){return p.isNegative()?i(p):a(p)},"BigNumber, number | BigNumber":function(p,m){return p.isNegative()?i(p,m):a(p,m)},Fraction:function(p){return p.s<0?p.ceil():p.floor()},"Fraction, number | BigNumber":function(p,m){return p.s<0?i(p,m):a(p,m)},"Array | Matrix":t.referToSelf(p=>m=>Qe(m,p)),"Array | Matrix, number | BigNumber":t.referToSelf(p=>(m,d)=>Qe(m,h=>p(h,d))),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(p=>(m,d)=>s(n(d),m,p,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(p=>(m,d)=>o(m,0)?u(d.size(),d.storage()):d.storage()==="dense"?s(d,m,p,!0):l(d,m,p,!0))})}),Lc="floor",WE=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],KE=U(Lc,["typed","config","round"],e=>{var{typed:t,config:r,round:n}=e;return t(Lc,{number:function(i){return sr(i,n(i),r.epsilon)?n(i):Math.floor(i)},"number, number":function(i,a){if(sr(i,n(i,a),r.epsilon))return n(i,a);var[o,u]="".concat(i,"e").split("e"),c=Math.floor(Number("".concat(o,"e").concat(Number(u)+a)));return[o,u]="".concat(c,"e").split("e"),Number("".concat(o,"e").concat(Number(u)-a))}})}),vy=U(Lc,WE,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:u}=e,c=Jt({typed:t,equalScalar:a}),l=It({typed:t,DenseMatrix:u}),s=Jr({typed:t}),f=KE({typed:t,config:r,round:n});return t("floor",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(p){return p.floor()},"Complex, number":function(p,m){return p.floor(m)},"Complex, BigNumber":function(p,m){return p.floor(m.toNumber())},BigNumber:function(p){return Tr(p,n(p),r.epsilon)?n(p):p.floor()},"BigNumber, BigNumber":function(p,m){return Tr(p,n(p,m),r.epsilon)?n(p,m):p.toDecimalPlaces(m.toNumber(),Yn.ROUND_FLOOR)},Fraction:function(p){return p.floor()},"Fraction, number":function(p,m){return p.floor(m)},"Fraction, BigNumber":function(p,m){return p.floor(m.toNumber())},"Array | Matrix":t.referToSelf(p=>m=>Qe(m,p)),"Array, number | BigNumber":t.referToSelf(p=>(m,d)=>Qe(m,h=>p(h,d))),"SparseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>c(m,d,p,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>s(m,d,p,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(p=>(m,d)=>s(i(d),m,p,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(p=>(m,d)=>a(m,0)?o(d.size(),d.storage()):d.storage()==="dense"?s(d,m,p,!0):l(d,m,p,!0))})}),QE="matAlgo02xDS0",ZE=["typed","equalScalar"],Gr=U(QE,ZE,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a,o){var u=n._data,c=n._size,l=n._datatype||n.getDataType(),s=i._values,f=i._index,p=i._ptr,m=i._size,d=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(c.length!==m.length)throw new Ke(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");if(!s)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h=c[0],w=c[1],v,b=r,g=0,x=a;typeof l=="string"&&l===d&&l!=="mixed"&&(v=l,b=t.find(r,[v,v]),g=t.convert(0,v),x=t.find(a,[v,v]));for(var y=[],N=[],E=[],A=0;A<w;A++){E[A]=N.length;for(var D=p[A],S=p[A+1],C=D;C<S;C++){var _=f[C],R=o?x(s[C],u[_][A]):x(u[_][A],s[C]);b(R,g)||(N.push(_),y.push(R))}}return E[w]=N.length,i.createSparseMatrix({values:y,index:N,ptr:E,size:[h,w],datatype:l===n._datatype&&d===i._datatype?v:void 0})}}),XE="matAlgo03xDSf",YE=["typed"],cr=U(XE,YE,e=>{var{typed:t}=e;return function(r,n,i,a){var o=r._data,u=r._size,c=r._datatype||r.getDataType(),l=n._values,s=n._index,f=n._ptr,p=n._size,m=n._datatype||n._data===void 0?n._datatype:n.getDataType();if(u.length!==p.length)throw new Ke(u.length,p.length);if(u[0]!==p[0]||u[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+p+")");if(!l)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var d=u[0],h=u[1],w,v=0,b=i;typeof c=="string"&&c===m&&c!=="mixed"&&(w=c,v=t.convert(0,w),b=t.find(i,[w,w]));for(var g=[],x=0;x<d;x++)g[x]=[];for(var y=[],N=[],E=0;E<h;E++){for(var A=E+1,D=f[E],S=f[E+1],C=D;C<S;C++){var _=s[C];y[_]=a?b(l[C],o[_][E]):b(o[_][E],l[C]),N[_]=A}for(var R=0;R<d;R++)N[R]===A?g[R][E]=y[R]:g[R][E]=a?b(v,o[R][E]):b(o[R][E],v)}return r.createDenseMatrix({data:g,size:[d,h],datatype:c===r._datatype&&m===n._datatype?w:void 0})}}),eA="matAlgo05xSfSf",tA=["typed","equalScalar"],wu=U(eA,tA,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a){var o=n._values,u=n._index,c=n._ptr,l=n._size,s=n._datatype||n._data===void 0?n._datatype:n.getDataType(),f=i._values,p=i._index,m=i._ptr,d=i._size,h=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==d.length)throw new Ke(l.length,d.length);if(l[0]!==d[0]||l[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+d+")");var w=l[0],v=l[1],b,g=r,x=0,y=a;typeof s=="string"&&s===h&&s!=="mixed"&&(b=s,g=t.find(r,[b,b]),x=t.convert(0,b),y=t.find(a,[b,b]));var N=o&&f?[]:void 0,E=[],A=[],D=N?[]:void 0,S=N?[]:void 0,C=[],_=[],R,P,I,O;for(P=0;P<v;P++){A[P]=E.length;var F=P+1;for(I=c[P],O=c[P+1];I<O;I++)R=u[I],E.push(R),C[R]=F,D&&(D[R]=o[I]);for(I=m[P],O=m[P+1];I<O;I++)R=p[I],C[R]!==F&&E.push(R),_[R]=F,S&&(S[R]=f[I]);if(N)for(I=A[P];I<E.length;){R=E[I];var q=C[R],k=_[R];if(q===F||k===F){var te=q===F?D[R]:x,se=k===F?S[R]:x,K=y(te,se);g(K,x)?E.splice(I,1):(N.push(K),I++)}}}return A[v]=E.length,n.createSparseMatrix({values:N,index:E,ptr:A,size:[w,v],datatype:s===n._datatype&&h===i._datatype?b:void 0})}}),rA="matAlgo13xDD",nA=["typed"],iA=U(rA,nA,e=>{var{typed:t}=e;return function(n,i,a){var o=n._data,u=n._size,c=n._datatype,l=i._data,s=i._size,f=i._datatype,p=[];if(u.length!==s.length)throw new Ke(u.length,s.length);for(var m=0;m<u.length;m++){if(u[m]!==s[m])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+s+")");p[m]=u[m]}var d,h=a;typeof c=="string"&&c===f&&(d=c,h=t.find(a,[d,d]));var w=p.length>0?r(h,0,p,p[0],o,l):[];return n.createDenseMatrix({data:w,size:p,datatype:d})};function r(n,i,a,o,u,c){var l=[];if(i===a.length-1)for(var s=0;s<o;s++)l[s]=n(u[s],c[s]);else for(var f=0;f<o;f++)l[f]=r(n,i+1,a,a[i+1],u[f],c[f]);return l}}),aA="broadcast",oA=["concat"],sA=U(aA,oA,e=>{var{concat:t}=e;return function(i,a){var o=Math.max(i._size.length,a._size.length);if(i._size.length===a._size.length&&i._size.every((d,h)=>d===a._size[h]))return[i,a];for(var u=r(i._size,o,0),c=r(a._size,o,0),l=[],s=0;s<o;s++)l[s]=Math.max(u[s],c[s]);Rs(u,l),Rs(c,l);var f=i.clone(),p=a.clone();f._size.length<o?f.reshape(r(f._size,o,1)):p._size.length<o&&p.reshape(r(p._size,o,1));for(var m=0;m<o;m++)f._size[m]<l[m]&&(f=n(f,l[m],m)),p._size[m]<l[m]&&(p=n(p,l[m],m));return[f,p]};function r(i,a,o){return[...Array(a-i.length).fill(o),...i]}function n(i,a,o){return t(...Array(a).fill(i),o)}}),uA="matrixAlgorithmSuite",cA=["typed","matrix","concat"],gt=U(uA,cA,e=>{var{typed:t,matrix:r,concat:n}=e,i=iA({typed:t}),a=Jr({typed:t}),o=sA({concat:n});return function(u){var c=u.elop,l=u.SD||u.DS,s;c?(s={"DenseMatrix, DenseMatrix":(d,h)=>i(...o(d,h),c),"Array, Array":(d,h)=>i(...o(r(d),r(h)),c).valueOf(),"Array, DenseMatrix":(d,h)=>i(...o(r(d),h),c),"DenseMatrix, Array":(d,h)=>i(...o(d,r(h)),c)},u.SS&&(s["SparseMatrix, SparseMatrix"]=(d,h)=>u.SS(...o(d,h),c,!1)),u.DS&&(s["DenseMatrix, SparseMatrix"]=(d,h)=>u.DS(...o(d,h),c,!1),s["Array, SparseMatrix"]=(d,h)=>u.DS(...o(r(d),h),c,!1)),l&&(s["SparseMatrix, DenseMatrix"]=(d,h)=>l(...o(h,d),c,!0),s["SparseMatrix, Array"]=(d,h)=>l(...o(r(h),d),c,!0))):(s={"DenseMatrix, DenseMatrix":t.referToSelf(d=>(h,w)=>i(...o(h,w),d)),"Array, Array":t.referToSelf(d=>(h,w)=>i(...o(r(h),r(w)),d).valueOf()),"Array, DenseMatrix":t.referToSelf(d=>(h,w)=>i(...o(r(h),w),d)),"DenseMatrix, Array":t.referToSelf(d=>(h,w)=>i(...o(h,r(w)),d))},u.SS&&(s["SparseMatrix, SparseMatrix"]=t.referToSelf(d=>(h,w)=>u.SS(...o(h,w),d,!1))),u.DS&&(s["DenseMatrix, SparseMatrix"]=t.referToSelf(d=>(h,w)=>u.DS(...o(h,w),d,!1)),s["Array, SparseMatrix"]=t.referToSelf(d=>(h,w)=>u.DS(...o(r(h),w),d,!1))),l&&(s["SparseMatrix, DenseMatrix"]=t.referToSelf(d=>(h,w)=>l(...o(w,h),d,!0)),s["SparseMatrix, Array"]=t.referToSelf(d=>(h,w)=>l(...o(r(w),h),d,!0))));var f=u.scalar||"any",p=u.Ds||u.Ss;p&&(c?(s["DenseMatrix,"+f]=(d,h)=>a(d,h,c,!1),s[f+", DenseMatrix"]=(d,h)=>a(h,d,c,!0),s["Array,"+f]=(d,h)=>a(r(d),h,c,!1).valueOf(),s[f+", Array"]=(d,h)=>a(r(h),d,c,!0).valueOf()):(s["DenseMatrix,"+f]=t.referToSelf(d=>(h,w)=>a(h,w,d,!1)),s[f+", DenseMatrix"]=t.referToSelf(d=>(h,w)=>a(w,h,d,!0)),s["Array,"+f]=t.referToSelf(d=>(h,w)=>a(r(h),w,d,!1).valueOf()),s[f+", Array"]=t.referToSelf(d=>(h,w)=>a(r(w),h,d,!0).valueOf())));var m=u.sS!==void 0?u.sS:u.Ss;return c?(u.Ss&&(s["SparseMatrix,"+f]=(d,h)=>u.Ss(d,h,c,!1)),m&&(s[f+", SparseMatrix"]=(d,h)=>m(h,d,c,!0))):(u.Ss&&(s["SparseMatrix,"+f]=t.referToSelf(d=>(h,w)=>u.Ss(h,w,d,!1))),m&&(s[f+", SparseMatrix"]=t.referToSelf(d=>(h,w)=>m(w,h,d,!0)))),c&&c.signatures&&Pg(s,c.signatures),s}}),Tp="mod",lA=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],yy=U(Tp,lA,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:u,concat:c}=e,l=vy({typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:u}),s=Gr({typed:t,equalScalar:a}),f=cr({typed:t}),p=wu({typed:t,equalScalar:a}),m=Jt({typed:t,equalScalar:a}),d=It({typed:t,DenseMatrix:u}),h=gt({typed:t,matrix:i,concat:c});return t(Tp,{"number, number":w,"BigNumber, BigNumber":function(v,b){return b.isZero()?v:v.sub(b.mul(l(v.div(b))))},"Fraction, Fraction":function(v,b){return b.equals(0)?v:v.sub(b.mul(l(v.div(b))))}},h({SS:p,DS:f,SD:s,Ss:m,sS:d}));function w(v,b){return b===0?v:v-b*l(v/b)}}),fA="matAlgo01xDSid",pA=["typed"],ii=U(fA,pA,e=>{var{typed:t}=e;return function(r,n,i,a){var o=r._data,u=r._size,c=r._datatype||r.getDataType(),l=n._values,s=n._index,f=n._ptr,p=n._size,m=n._datatype||n._data===void 0?n._datatype:n.getDataType();if(u.length!==p.length)throw new Ke(u.length,p.length);if(u[0]!==p[0]||u[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+p+")");if(!l)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var d=u[0],h=u[1],w=typeof c=="string"&&c!=="mixed"&&c===m?c:void 0,v=w?t.find(i,[w,w]):i,b,g,x=[];for(b=0;b<d;b++)x[b]=[];var y=[],N=[];for(g=0;g<h;g++){for(var E=g+1,A=f[g],D=f[g+1],S=A;S<D;S++)b=s[S],y[b]=a?v(l[S],o[b][g]):v(o[b][g],l[S]),N[b]=E;for(b=0;b<d;b++)N[b]===E?x[b][g]=y[b]:x[b][g]=o[b][g]}return r.createDenseMatrix({data:x,size:[d,h],datatype:c===r._datatype&&m===n._datatype?w:void 0})}}),mA="matAlgo04xSidSid",dA=["typed","equalScalar"],Al=U(mA,dA,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a){var o=n._values,u=n._index,c=n._ptr,l=n._size,s=n._datatype||n._data===void 0?n._datatype:n.getDataType(),f=i._values,p=i._index,m=i._ptr,d=i._size,h=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==d.length)throw new Ke(l.length,d.length);if(l[0]!==d[0]||l[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+d+")");var w=l[0],v=l[1],b,g=r,x=0,y=a;typeof s=="string"&&s===h&&s!=="mixed"&&(b=s,g=t.find(r,[b,b]),x=t.convert(0,b),y=t.find(a,[b,b]));var N=o&&f?[]:void 0,E=[],A=[],D=o&&f?[]:void 0,S=o&&f?[]:void 0,C=[],_=[],R,P,I,O,F;for(P=0;P<v;P++){A[P]=E.length;var q=P+1;for(O=c[P],F=c[P+1],I=O;I<F;I++)R=u[I],E.push(R),C[R]=q,D&&(D[R]=o[I]);for(O=m[P],F=m[P+1],I=O;I<F;I++)if(R=p[I],C[R]===q){if(D){var k=y(D[R],f[I]);g(k,x)?C[R]=null:D[R]=k}}else E.push(R),_[R]=q,S&&(S[R]=f[I]);if(D&&S)for(I=A[P];I<E.length;)R=E[I],C[R]===q?(N[I]=D[R],I++):_[R]===q?(N[I]=S[R],I++):E.splice(I,1)}return A[v]=E.length,n.createSparseMatrix({values:N,index:E,ptr:A,size:[w,v],datatype:s===n._datatype&&h===i._datatype?b:void 0})}}),hA="matAlgo10xSids",gA=["typed","DenseMatrix"],zi=U(hA,gA,e=>{var{typed:t,DenseMatrix:r}=e;return function(n,i,a,o){var u=n._values,c=n._index,l=n._ptr,s=n._size,f=n._datatype;if(!u)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=s[0],m=s[1],d,h=a;typeof f=="string"&&(d=f,i=t.convert(i,d),h=t.find(a,[d,d]));for(var w=[],v=[],b=[],g=0;g<m;g++){for(var x=g+1,y=l[g],N=l[g+1],E=y;E<N;E++){var A=c[E];v[A]=u[E],b[A]=x}for(var D=0;D<p;D++)g===0&&(w[D]=[]),b[D]===x?w[D][g]=o?h(i,v[D]):h(v[D],i):w[D][g]=i}return new r({data:w,size:[p,m],datatype:d})}});function ji(e,t,r,n){if(!(this instanceof ji))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=r,this.max=n,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+r+(n!=null?"-"+n:"")+" expected)",this.stack=new Error().stack}ji.prototype=new Error;ji.prototype.constructor=Error;ji.prototype.name="ArgumentsError";ji.prototype.isArgumentsError=!0;var Op="gcd",vA=["typed","config","round","matrix","equalScalar","zeros","BigNumber","DenseMatrix","concat"],cc="number | BigNumber | Fraction | Matrix | Array",yA="".concat(cc,", ").concat(cc,", ...").concat(cc);function Bp(e){return!e.some(t=>Array.isArray(t))}var xA=U(Op,vA,e=>{var{typed:t,matrix:r,config:n,round:i,equalScalar:a,zeros:o,BigNumber:u,DenseMatrix:c,concat:l}=e,s=yy({typed:t,config:n,round:i,matrix:r,equalScalar:a,zeros:o,DenseMatrix:c,concat:l}),f=ii({typed:t}),p=Al({typed:t,equalScalar:a}),m=zi({typed:t,DenseMatrix:c}),d=gt({typed:t,matrix:r,concat:l});return t(Op,{"number, number":h,"BigNumber, BigNumber":w,"Fraction, Fraction":(v,b)=>v.gcd(b)},d({SS:p,DS:f,Ss:m}),{[yA]:t.referToSelf(v=>(b,g,x)=>{for(var y=v(b,g),N=0;N<x.length;N++)y=v(y,x[N]);return y}),Array:t.referToSelf(v=>b=>{if(b.length===1&&Array.isArray(b[0])&&Bp(b[0]))return v(...b[0]);if(Bp(b))return v(...b);throw new ji("gcd() supports only 1d matrices!")}),Matrix:t.referToSelf(v=>b=>v(b.toArray()))});function h(v,b){if(!Fe(v)||!Fe(b))throw new Error("Parameters in function gcd must be integer numbers");for(var g;b!==0;)g=s(v,b),v=b,b=g;return v<0?-v:v}function w(v,b){if(!v.isInt()||!b.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var g=new u(0);!b.isZero();){var x=s(v,b);v=b,b=x}return v.lt(g)?v.neg():v}}),bA="matAlgo06xS0S0",wA=["typed","equalScalar"],Nu=U(bA,wA,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a){var o=n._values,u=n._size,c=n._datatype||n._data===void 0?n._datatype:n.getDataType(),l=i._values,s=i._size,f=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(u.length!==s.length)throw new Ke(u.length,s.length);if(u[0]!==s[0]||u[1]!==s[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+s+")");var p=u[0],m=u[1],d,h=r,w=0,v=a;typeof c=="string"&&c===f&&c!=="mixed"&&(d=c,h=t.find(r,[d,d]),w=t.convert(0,d),v=t.find(a,[d,d]));for(var b=o&&l?[]:void 0,g=[],x=[],y=b?[]:void 0,N=[],E=[],A=0;A<m;A++){x[A]=g.length;var D=A+1;if(np(n,A,N,y,E,D,g,v),np(i,A,N,y,E,D,g,v),y)for(var S=x[A];S<g.length;){var C=g[S];if(E[C]===D){var _=y[C];h(_,w)?g.splice(S,1):(b.push(_),S++)}else g.splice(S,1)}else for(var R=x[A];R<g.length;){var P=g[R];E[P]!==D?g.splice(R,1):R++}}return x[m]=g.length,n.createSparseMatrix({values:b,index:g,ptr:x,size:[p,m],datatype:c===n._datatype&&f===i._datatype?d:void 0})}}),kp="lcm",NA=["typed","matrix","equalScalar","concat"],DA=U(kp,NA,e=>{var{typed:t,matrix:r,equalScalar:n,concat:i}=e,a=Gr({typed:t,equalScalar:n}),o=Nu({typed:t,equalScalar:n}),u=Jt({typed:t,equalScalar:n}),c=gt({typed:t,matrix:r,concat:i}),l="number | BigNumber | Fraction | Matrix | Array",s={};return s["".concat(l,", ").concat(l,", ...").concat(l)]=t.referToSelf(p=>(m,d,h)=>{for(var w=p(m,d),v=0;v<h.length;v++)w=p(w,h[v]);return w}),t(kp,{"number, number":Tv,"BigNumber, BigNumber":f,"Fraction, Fraction":(p,m)=>p.lcm(m)},c({SS:o,DS:a,Ss:u}),s);function f(p,m){if(!p.isInt()||!m.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(p.isZero())return p;if(m.isZero())return m;for(var d=p.times(m);!m.isZero();){var h=m;m=p.mod(h),p=h}return d.div(p).abs()}}),Ip="log10",EA=["typed","config","Complex"],AA=U(Ip,EA,e=>{var{typed:t,config:r,Complex:n}=e;return t(Ip,{number:function(i){return i>=0||r.predictable?Ov(i):new n(i,0).log().div(Math.LN10)},Complex:function(i){return new n(i).log().div(Math.LN10)},BigNumber:function(i){return!i.isNegative()||r.predictable?i.log():new n(i.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":t.referToSelf(i=>a=>Qe(a,i))})}),Rp="log2",SA=["typed","config","Complex"],CA=U(Rp,SA,e=>{var{typed:t,config:r,Complex:n}=e;return t(Rp,{number:function(a){return a>=0||r.predictable?Bv(a):i(new n(a,0))},Complex:i,BigNumber:function(a){return!a.isNegative()||r.predictable?a.log(2):i(new n(a.toNumber(),0))},"Array | Matrix":t.referToSelf(a=>o=>Qe(o,a))});function i(a){var o=Math.sqrt(a.re*a.re+a.im*a.im);return new n(Math.log2?Math.log2(o):Math.log(o)/Math.LN2,Math.atan2(a.im,a.re)/Math.LN2)}}),MA="multiplyScalar",_A=["typed"],FA=U(MA,_A,e=>{var{typed:t}=e;return t("multiplyScalar",{"number, number":Av,"Complex, Complex":function(r,n){return r.mul(n)},"BigNumber, BigNumber":function(r,n){return r.times(n)},"Fraction, Fraction":function(r,n){return r.mul(n)},"number | Fraction | BigNumber | Complex, Unit":(r,n)=>n.multiply(r),"Unit, number | Fraction | BigNumber | Complex | Unit":(r,n)=>r.multiply(n)})}),qp="multiply",TA=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],OA=U(qp,TA,e=>{var{typed:t,matrix:r,addScalar:n,multiplyScalar:i,equalScalar:a,dot:o}=e,u=Jt({typed:t,equalScalar:a}),c=Jr({typed:t});function l(y,N){switch(y.length){case 1:switch(N.length){case 1:if(y[0]!==N[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(y[0]!==N[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+y[0]+") must match Matrix rows ("+N[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+N.length+" dimensions)")}break;case 2:switch(N.length){case 1:if(y[1]!==N[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+y[1]+") must match Vector length ("+N[0]+")");break;case 2:if(y[1]!==N[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+y[1]+") must match Matrix B rows ("+N[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+N.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+y.length+" dimensions)")}}function s(y,N,E){if(E===0)throw new Error("Cannot multiply two empty vectors");return o(y,N)}function f(y,N){if(N.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return p(y,N)}function p(y,N){var E=y._data,A=y._size,D=y._datatype||y.getDataType(),S=N._data,C=N._size,_=N._datatype||N.getDataType(),R=A[0],P=C[1],I,O=n,F=i;D&&_&&D===_&&typeof D=="string"&&D!=="mixed"&&(I=D,O=t.find(n,[I,I]),F=t.find(i,[I,I]));for(var q=[],k=0;k<P;k++){for(var te=F(E[0],S[0][k]),se=1;se<R;se++)te=O(te,F(E[se],S[se][k]));q[k]=te}return y.createDenseMatrix({data:q,size:[P],datatype:D===y._datatype&&_===N._datatype?I:void 0})}var m=t("_multiplyMatrixVector",{"DenseMatrix, any":h,"SparseMatrix, any":b}),d=t("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":w,"DenseMatrix, SparseMatrix":v,"SparseMatrix, DenseMatrix":g,"SparseMatrix, SparseMatrix":x});function h(y,N){var E=y._data,A=y._size,D=y._datatype||y.getDataType(),S=N._data,C=N._datatype||N.getDataType(),_=A[0],R=A[1],P,I=n,O=i;D&&C&&D===C&&typeof D=="string"&&D!=="mixed"&&(P=D,I=t.find(n,[P,P]),O=t.find(i,[P,P]));for(var F=[],q=0;q<_;q++){for(var k=E[q],te=O(k[0],S[0]),se=1;se<R;se++)te=I(te,O(k[se],S[se]));F[q]=te}return y.createDenseMatrix({data:F,size:[_],datatype:D===y._datatype&&C===N._datatype?P:void 0})}function w(y,N){var E=y._data,A=y._size,D=y._datatype||y.getDataType(),S=N._data,C=N._size,_=N._datatype||N.getDataType(),R=A[0],P=A[1],I=C[1],O,F=n,q=i;D&&_&&D===_&&typeof D=="string"&&D!=="mixed"&&D!=="mixed"&&(O=D,F=t.find(n,[O,O]),q=t.find(i,[O,O]));for(var k=[],te=0;te<R;te++){var se=E[te];k[te]=[];for(var K=0;K<I;K++){for(var V=q(se[0],S[0][K]),ue=1;ue<P;ue++)V=F(V,q(se[ue],S[ue][K]));k[te][K]=V}}return y.createDenseMatrix({data:k,size:[R,I],datatype:D===y._datatype&&_===N._datatype?O:void 0})}function v(y,N){var E=y._data,A=y._size,D=y._datatype||y.getDataType(),S=N._values,C=N._index,_=N._ptr,R=N._size,P=N._datatype||N._data===void 0?N._datatype:N.getDataType();if(!S)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var I=A[0],O=R[1],F,q=n,k=i,te=a,se=0;D&&P&&D===P&&typeof D=="string"&&D!=="mixed"&&(F=D,q=t.find(n,[F,F]),k=t.find(i,[F,F]),te=t.find(a,[F,F]),se=t.convert(0,F));for(var K=[],V=[],ue=[],me=N.createSparseMatrix({values:K,index:V,ptr:ue,size:[I,O],datatype:D===y._datatype&&P===N._datatype?F:void 0}),re=0;re<O;re++){ue[re]=V.length;var ae=_[re],de=_[re+1];if(de>ae)for(var ne=0,ce=0;ce<I;ce++){for(var le=ce+1,he=void 0,be=ae;be<de;be++){var $=C[be];ne!==le?(he=k(E[ce][$],S[be]),ne=le):he=q(he,k(E[ce][$],S[be]))}ne===le&&!te(he,se)&&(V.push(ce),K.push(he))}}return ue[O]=V.length,me}function b(y,N){var E=y._values,A=y._index,D=y._ptr,S=y._datatype||y._data===void 0?y._datatype:y.getDataType();if(!E)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var C=N._data,_=N._datatype||N.getDataType(),R=y._size[0],P=N._size[0],I=[],O=[],F=[],q,k=n,te=i,se=a,K=0;S&&_&&S===_&&typeof S=="string"&&S!=="mixed"&&(q=S,k=t.find(n,[q,q]),te=t.find(i,[q,q]),se=t.find(a,[q,q]),K=t.convert(0,q));var V=[],ue=[];F[0]=0;for(var me=0;me<P;me++){var re=C[me];if(!se(re,K))for(var ae=D[me],de=D[me+1],ne=ae;ne<de;ne++){var ce=A[ne];ue[ce]?V[ce]=k(V[ce],te(re,E[ne])):(ue[ce]=!0,O.push(ce),V[ce]=te(re,E[ne]))}}for(var le=O.length,he=0;he<le;he++){var be=O[he];I[he]=V[be]}return F[1]=O.length,y.createSparseMatrix({values:I,index:O,ptr:F,size:[R,1],datatype:S===y._datatype&&_===N._datatype?q:void 0})}function g(y,N){var E=y._values,A=y._index,D=y._ptr,S=y._datatype||y._data===void 0?y._datatype:y.getDataType();if(!E)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var C=N._data,_=N._datatype||N.getDataType(),R=y._size[0],P=N._size[0],I=N._size[1],O,F=n,q=i,k=a,te=0;S&&_&&S===_&&typeof S=="string"&&S!=="mixed"&&(O=S,F=t.find(n,[O,O]),q=t.find(i,[O,O]),k=t.find(a,[O,O]),te=t.convert(0,O));for(var se=[],K=[],V=[],ue=y.createSparseMatrix({values:se,index:K,ptr:V,size:[R,I],datatype:S===y._datatype&&_===N._datatype?O:void 0}),me=[],re=[],ae=0;ae<I;ae++){V[ae]=K.length;for(var de=ae+1,ne=0;ne<P;ne++){var ce=C[ne][ae];if(!k(ce,te))for(var le=D[ne],he=D[ne+1],be=le;be<he;be++){var $=A[be];re[$]!==de?(re[$]=de,K.push($),me[$]=q(ce,E[be])):me[$]=F(me[$],q(ce,E[be]))}}for(var T=V[ae],z=K.length,J=T;J<z;J++){var L=K[J];se[J]=me[L]}}return V[I]=K.length,ue}function x(y,N){var E=y._values,A=y._index,D=y._ptr,S=y._datatype||y._data===void 0?y._datatype:y.getDataType(),C=N._values,_=N._index,R=N._ptr,P=N._datatype||N._data===void 0?N._datatype:N.getDataType(),I=y._size[0],O=N._size[1],F=E&&C,q,k=n,te=i;S&&P&&S===P&&typeof S=="string"&&S!=="mixed"&&(q=S,k=t.find(n,[q,q]),te=t.find(i,[q,q]));for(var se=F?[]:void 0,K=[],V=[],ue=y.createSparseMatrix({values:se,index:K,ptr:V,size:[I,O],datatype:S===y._datatype&&P===N._datatype?q:void 0}),me=F?[]:void 0,re=[],ae,de,ne,ce,le,he,be,$,T=0;T<O;T++){V[T]=K.length;var z=T+1;for(le=R[T],he=R[T+1],ce=le;ce<he;ce++)if($=_[ce],F)for(de=D[$],ne=D[$+1],ae=de;ae<ne;ae++)be=A[ae],re[be]!==z?(re[be]=z,K.push(be),me[be]=te(C[ce],E[ae])):me[be]=k(me[be],te(C[ce],E[ae]));else for(de=D[$],ne=D[$+1],ae=de;ae<ne;ae++)be=A[ae],re[be]!==z&&(re[be]=z,K.push(be));if(F)for(var J=V[T],L=K.length,H=J;H<L;H++){var G=K[H];se[H]=me[G]}}return V[O]=K.length,ue}return t(qp,i,{"Array, Array":t.referTo("Matrix, Matrix",y=>(N,E)=>{l(Ve(N),Ve(E));var A=y(r(N),r(E));return ke(A)?A.valueOf():A}),"Matrix, Matrix":function(y,N){var E=y.size(),A=N.size();return l(E,A),E.length===1?A.length===1?s(y,N,E[0]):f(y,N):A.length===1?m(y,N):d(y,N)},"Matrix, Array":t.referTo("Matrix,Matrix",y=>(N,E)=>y(N,r(E))),"Array, Matrix":t.referToSelf(y=>(N,E)=>y(r(N,E.storage()),E)),"SparseMatrix, any":function(y,N){return u(y,N,i,!1)},"DenseMatrix, any":function(y,N){return c(y,N,i,!1)},"any, SparseMatrix":function(y,N){return u(N,y,i,!0)},"any, DenseMatrix":function(y,N){return c(N,y,i,!0)},"Array, any":function(y,N){return c(r(y),N,i,!1).valueOf()},"any, Array":function(y,N){return c(r(N),y,i,!0).valueOf()},"any, any":i,"any, any, ...any":t.referToSelf(y=>(N,E,A)=>{for(var D=y(N,E),S=0;S<A.length;S++)D=y(D,A[S]);return D})})}),zp="nthRoot",BA=["typed","matrix","equalScalar","BigNumber","concat"],kA=U(zp,BA,e=>{var{typed:t,matrix:r,equalScalar:n,BigNumber:i,concat:a}=e,o=ii({typed:t}),u=Gr({typed:t,equalScalar:n}),c=Nu({typed:t,equalScalar:n}),l=Jt({typed:t,equalScalar:n}),s=gt({typed:t,matrix:r,concat:a});function f(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return t(zp,{number:ap,"number, number":ap,BigNumber:m=>p(m,new i(2)),"BigNumber, BigNumber":p,Complex:f,"Complex, number":f,Array:t.referTo("DenseMatrix,number",m=>d=>m(r(d),2).valueOf()),DenseMatrix:t.referTo("DenseMatrix,number",m=>d=>m(d,2)),SparseMatrix:t.referTo("SparseMatrix,number",m=>d=>m(d,2)),"SparseMatrix, SparseMatrix":t.referToSelf(m=>(d,h)=>{if(h.density()===1)return c(d,h,m);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":t.referToSelf(m=>(d,h)=>{if(h.density()===1)return o(d,h,m,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":t.referTo("DenseMatrix,SparseMatrix",m=>(d,h)=>m(r(d),h)),"number | BigNumber, SparseMatrix":t.referToSelf(m=>(d,h)=>{if(h.density()===1)return l(h,d,m,!0);throw new Error("Root must be non-zero")})},s({scalar:"number | BigNumber",SD:u,Ss:l,sS:!1}));function p(m,d){var h=i.precision,w=i.clone({precision:h+2}),v=new i(0),b=new w(1),g=d.isNegative();if(g&&(d=d.neg()),d.isZero())throw new Error("Root must be non-zero");if(m.isNegative()&&!d.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(m.isZero())return g?new w(1/0):0;if(!m.isFinite())return g?v:m;var x=m.abs().pow(b.div(d));return x=m.isNeg()?x.neg():x,new i((g?b.div(x):x).toPrecision(h))}}),jp="sign",IA=["typed","BigNumber","Fraction","complex"],RA=U(jp,IA,e=>{var{typed:t,BigNumber:r,complex:n,Fraction:i}=e;return t(jp,{number:qc,Complex:function(a){return a.im===0?n(qc(a.re)):a.sign()},BigNumber:function(a){return new r(a.cmp(0))},Fraction:function(a){return new i(a.s,1)},"Array | Matrix":t.referToSelf(a=>o=>Qe(o,a)),Unit:t.referToSelf(a=>o=>{if(!o._isDerived()&&o.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return t.find(a,o.valueType())(o.value)})})}),qA="sqrt",zA=["config","typed","Complex"],jA=U(qA,zA,e=>{var{config:t,typed:r,Complex:n}=e;return r("sqrt",{number:i,Complex:function(a){return a.sqrt()},BigNumber:function(a){return!a.isNegative()||t.predictable?a.sqrt():i(a.toNumber())},Unit:function(a){return a.pow(.5)}});function i(a){return isNaN(a)?NaN:a>=0||t.predictable?Math.sqrt(a):new n(a,0).sqrt()}}),Lp="square",LA=["typed"],PA=U(Lp,LA,e=>{var{typed:t}=e;return t(Lp,{number:kv,Complex:function(r){return r.mul(r)},BigNumber:function(r){return r.times(r)},Fraction:function(r){return r.mul(r)},Unit:function(r){return r.pow(2)}})}),Pp="subtract",VA=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],UA=U(Pp,VA,e=>{var{typed:t,matrix:r,equalScalar:n,subtractScalar:i,unaryMinus:a,DenseMatrix:o,concat:u}=e,c=ii({typed:t}),l=cr({typed:t}),s=wu({typed:t,equalScalar:n}),f=zi({typed:t,DenseMatrix:o}),p=It({typed:t,DenseMatrix:o}),m=gt({typed:t,matrix:r,concat:u});return t(Pp,{"any, any":i},m({elop:i,SS:s,DS:c,SD:l,Ss:p,sS:f}))}),Vp="xgcd",$A=["typed","config","matrix","BigNumber"],HA=U(Vp,$A,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(Vp,{"number, number":function(o,u){var c=Iv(o,u);return r.matrix==="Array"?c:n(c)},"BigNumber, BigNumber":a});function a(o,u){var c,l,s,f=new i(0),p=new i(1),m=f,d=p,h=p,w=f;if(!o.isInt()||!u.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!u.isZero();)l=o.div(u).floor(),s=o.mod(u),c=m,m=d.minus(l.times(m)),d=c,c=h,h=w.minus(l.times(h)),w=c,o=u,u=s;var v;return o.lt(f)?v=[o.neg(),d.neg(),w.neg()]:v=[o,o.isZero()?0:d,w],r.matrix==="Array"?v:n(v)}}),Up="invmod",JA=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],GA=U(Up,JA,e=>{var{typed:t,config:r,BigNumber:n,xgcd:i,equal:a,smaller:o,mod:u,add:c,isInteger:l}=e;return t(Up,{"number, number":s,"BigNumber, BigNumber":s});function s(f,p){if(!l(f)||!l(p))throw new Error("Parameters in function invmod must be integer numbers");if(f=u(f,p),a(p,0))throw new Error("Divisor must be non zero");var m=i(f,p);m=m.valueOf();var[d,h]=m;return a(d,n(1))?(h=u(h,p),o(h,n(0))&&(h=c(h,p)),h):NaN}}),WA="matAlgo09xS0Sf",KA=["typed","equalScalar"],xy=U(WA,KA,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a){var o=n._values,u=n._index,c=n._ptr,l=n._size,s=n._datatype||n._data===void 0?n._datatype:n.getDataType(),f=i._values,p=i._index,m=i._ptr,d=i._size,h=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==d.length)throw new Ke(l.length,d.length);if(l[0]!==d[0]||l[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+d+")");var w=l[0],v=l[1],b,g=r,x=0,y=a;typeof s=="string"&&s===h&&s!=="mixed"&&(b=s,g=t.find(r,[b,b]),x=t.convert(0,b),y=t.find(a,[b,b]));var N=o&&f?[]:void 0,E=[],A=[],D=N?[]:void 0,S=[],C,_,R,P,I;for(_=0;_<v;_++){A[_]=E.length;var O=_+1;if(D)for(P=m[_],I=m[_+1],R=P;R<I;R++)C=p[R],S[C]=O,D[C]=f[R];for(P=c[_],I=c[_+1],R=P;R<I;R++)if(C=u[R],D){var F=S[C]===O?D[C]:x,q=y(o[R],F);g(q,x)||(E.push(C),N.push(q))}else E.push(C)}return A[v]=E.length,n.createSparseMatrix({values:N,index:E,ptr:A,size:[w,v],datatype:s===n._datatype&&h===i._datatype?b:void 0})}}),$p="dotMultiply",QA=["typed","matrix","equalScalar","multiplyScalar","concat"],ZA=U($p,QA,e=>{var{typed:t,matrix:r,equalScalar:n,multiplyScalar:i,concat:a}=e,o=Gr({typed:t,equalScalar:n}),u=xy({typed:t,equalScalar:n}),c=Jt({typed:t,equalScalar:n}),l=gt({typed:t,matrix:r,concat:a});return t($p,l({elop:i,SS:u,DS:o,Ss:c}))});function XA(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitAnd");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero()||t.eq(-1)||e.eq(t))return e;if(t.isZero()||e.eq(-1))return t;if(!e.isFinite()||!t.isFinite()){if(!e.isFinite()&&!t.isFinite())return e.isNegative()===t.isNegative()?e:new r(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new r(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new r(0):e}return Sl(e,t,function(n,i){return n&i})}function so(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var t=e.constructor,r=t.precision;t.config({precision:1e9});var n=e.plus(new t(1));return n.s=-n.s||null,t.config({precision:r}),n}function YA(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitOr");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);var n=new r(-1);return e.isZero()||t.eq(n)||e.eq(t)?t:t.isZero()||e.eq(n)?e:!e.isFinite()||!t.isFinite()?!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?n:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e:Sl(e,t,function(i,a){return i|a})}function Sl(e,t,r){var n=e.constructor,i,a,o=+(e.s<0),u=+(t.s<0);if(o){i=Uo(so(e));for(var c=0;c<i.length;++c)i[c]^=1}else i=Uo(e);if(u){a=Uo(so(t));for(var l=0;l<a.length;++l)a[l]^=1}else a=Uo(t);var s,f,p;i.length<=a.length?(s=i,f=a,p=o):(s=a,f=i,p=u);var m=s.length,d=f.length,h=r(o,u)^1,w=new n(h^1),v=new n(1),b=new n(2),g=n.precision;for(n.config({precision:1e9});m>0;)r(s[--m],f[--d])===h&&(w=w.plus(v)),v=v.times(b);for(;d>0;)r(p,f[--d])===h&&(w=w.plus(v)),v=v.times(b);return n.config({precision:g}),h===0&&(w.s=-w.s),w}function Uo(e){for(var t=e.d,r=t[0]+"",n=1;n<t.length;++n){for(var i=t[n]+"",a=7-i.length;a--;)i="0"+i;r+=i}for(var o=r.length;r.charAt(o)==="0";)o--;var u=e.e,c=r.slice(0,o+1||1),l=c.length;if(u>0)if(++u>l)for(u-=l;u--;)c+="0";else u<l&&(c=c.slice(0,u)+"."+c.slice(u));for(var s=[0],f=0;f<c.length;){for(var p=s.length;p--;)s[p]*=10;s[0]+=parseInt(c.charAt(f++));for(var m=0;m<s.length;++m)s[m]>1&&((s[m+1]===null||s[m+1]===void 0)&&(s[m+1]=0),s[m+1]+=s[m]>>1,s[m]&=1)}return s.reverse()}function eS(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitXor");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero())return t;if(t.isZero())return e;if(e.eq(t))return new r(0);var n=new r(-1);return e.eq(n)?so(t):t.eq(n)?so(e):!e.isFinite()||!t.isFinite()?!e.isFinite()&&!t.isFinite()?n:new r(e.isNegative()===t.isNegative()?1/0:-1/0):Sl(e,t,function(i,a){return i^a})}function tS(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function leftShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:!e.isFinite()&&!t.isFinite()?new r(NaN):t.lt(55)?e.times(Math.pow(2,t.toNumber())+""):e.times(new r(2).pow(t))}function rS(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function rightArithShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:t.isFinite()?t.lt(55)?e.div(Math.pow(2,t.toNumber())+"").floor():e.div(new r(2).pow(t)).floor():e.isNegative()?new r(-1):e.isFinite()?new r(0):new r(NaN)}var Hp="bitAnd",nS=["typed","matrix","equalScalar","concat"],by=U(Hp,nS,e=>{var{typed:t,matrix:r,equalScalar:n,concat:i}=e,a=Gr({typed:t,equalScalar:n}),o=Nu({typed:t,equalScalar:n}),u=Jt({typed:t,equalScalar:n}),c=gt({typed:t,matrix:r,concat:i});return t(Hp,{"number, number":qv,"BigNumber, BigNumber":XA},c({SS:o,DS:a,Ss:u}))}),Jp="bitNot",iS=["typed"],aS=U(Jp,iS,e=>{var{typed:t}=e;return t(Jp,{number:zv,BigNumber:so,"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Gp="bitOr",oS=["typed","matrix","equalScalar","DenseMatrix","concat"],wy=U(Gp,oS,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=ii({typed:t}),u=Al({typed:t,equalScalar:n}),c=zi({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:r,concat:a});return t(Gp,{"number, number":jv,"BigNumber, BigNumber":YA},l({SS:u,DS:o,Ss:c}))}),sS="matAlgo07xSSf",uS=["typed","DenseMatrix"],cn=U(sS,uS,e=>{var{typed:t,DenseMatrix:r}=e;return function(i,a,o){var u=i._size,c=i._datatype||i._data===void 0?i._datatype:i.getDataType(),l=a._size,s=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==l.length)throw new Ke(u.length,l.length);if(u[0]!==l[0]||u[1]!==l[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+l+")");var f=u[0],p=u[1],m,d=0,h=o;typeof c=="string"&&c===s&&c!=="mixed"&&(m=c,d=t.convert(0,m),h=t.find(o,[m,m]));var w,v,b=[];for(w=0;w<f;w++)b[w]=[];var g=[],x=[],y=[],N=[];for(v=0;v<p;v++){var E=v+1;for(n(i,v,y,g,E),n(a,v,N,x,E),w=0;w<f;w++){var A=y[w]===E?g[w]:d,D=N[w]===E?x[w]:d;b[w][v]=h(A,D)}}return new r({data:b,size:[f,p],datatype:c===i._datatype&&s===a._datatype?m:void 0})};function n(i,a,o,u,c){for(var l=i._values,s=i._index,f=i._ptr,p=f[a],m=f[a+1];p<m;p++){var d=s[p];o[d]=c,u[d]=l[p]}}}),Wp="bitXor",cS=["typed","matrix","DenseMatrix","concat"],lS=U(Wp,cS,e=>{var{typed:t,matrix:r,DenseMatrix:n,concat:i}=e,a=cr({typed:t}),o=cn({typed:t,DenseMatrix:n}),u=It({typed:t,DenseMatrix:n}),c=gt({typed:t,matrix:r,concat:i});return t(Wp,{"number, number":Lv,"BigNumber, BigNumber":eS},c({SS:o,DS:a,Ss:u}))}),Kp="arg",fS=["typed"],pS=U(Kp,fS,e=>{var{typed:t}=e;return t(Kp,{number:function(r){return Math.atan2(0,r)},BigNumber:function(r){return r.constructor.atan2(0,r)},Complex:function(r){return r.arg()},"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Qp="conj",mS=["typed"],dS=U(Qp,mS,e=>{var{typed:t}=e;return t(Qp,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.conjugate(),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Zp="im",hS=["typed"],gS=U(Zp,hS,e=>{var{typed:t}=e;return t(Zp,{number:()=>0,"BigNumber | Fraction":r=>r.mul(0),Complex:r=>r.im,"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Xp="re",vS=["typed"],yS=U(Xp,vS,e=>{var{typed:t}=e;return t(Xp,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.re,"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Yp="not",xS=["typed"],bS=U(Yp,xS,e=>{var{typed:t}=e;return t(Yp,{"null | undefined":()=>!0,number:Hv,Complex:function(r){return r.re===0&&r.im===0},BigNumber:function(r){return r.isZero()||r.isNaN()},Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),em="or",wS=["typed","matrix","equalScalar","DenseMatrix","concat"],Ny=U(em,wS,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=wu({typed:t,equalScalar:n}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:r,concat:a});return t(em,{"number, number":Jv,"Complex, Complex":function(s,f){return s.re!==0||s.im!==0||f.re!==0||f.im!==0},"BigNumber, BigNumber":function(s,f){return!s.isZero()&&!s.isNaN()||!f.isZero()&&!f.isNaN()},"Unit, Unit":t.referToSelf(s=>(f,p)=>s(f.value||0,p.value||0))},l({SS:u,DS:o,Ss:c}))}),tm="xor",NS=["typed","matrix","DenseMatrix","concat"],DS=U(tm,NS,e=>{var{typed:t,matrix:r,DenseMatrix:n,concat:i}=e,a=cr({typed:t}),o=cn({typed:t,DenseMatrix:n}),u=It({typed:t,DenseMatrix:n}),c=gt({typed:t,matrix:r,concat:i});return t(tm,{"number, number":Gv,"Complex, Complex":function(l,s){return(l.re!==0||l.im!==0)!=(s.re!==0||s.im!==0)},"BigNumber, BigNumber":function(l,s){return(!l.isZero()&&!l.isNaN())!=(!s.isZero()&&!s.isNaN())},"Unit, Unit":t.referToSelf(l=>(s,f)=>l(s.value||0,f.value||0))},c({SS:o,DS:a,Ss:u}))}),rm="concat",ES=["typed","matrix","isInteger"],Dy=U(rm,ES,e=>{var{typed:t,matrix:r,isInteger:n}=e;return t(rm,{"...Array | Matrix | number | BigNumber":function(i){var a,o=i.length,u=-1,c,l=!1,s=[];for(a=0;a<o;a++){var f=i[a];if(ke(f)&&(l=!0),Ue(f)||$e(f)){if(a!==o-1)throw new Error("Dimension must be specified as last argument");if(c=u,u=f.valueOf(),!n(u))throw new TypeError("Integer number expected for dimension");if(u<0||a>0&&u>c)throw new $r(u,c+1)}else{var p=ze(f).valueOf(),m=Ve(p);if(s[a]=p,c=u,u=m.length-1,a>0&&u!==c)throw new Ke(c+1,u+1)}}if(s.length===0)throw new SyntaxError("At least one matrix expected");for(var d=s.shift();s.length;)d=xv(d,s.shift(),u);return l?r(d):d},"...string":function(i){return i.join("")}})}),nm="column",AS=["typed","Index","matrix","range"],Ey=U(nm,AS,e=>{var{typed:t,Index:r,matrix:n,range:i}=e;return t(nm,{"Matrix, number":a,"Array, number":function(o,u){return a(n(ze(o)),u).valueOf()}});function a(o,u){if(o.size().length!==2)throw new Error("Only two dimensional matrix is supported");pt(u,o.size()[1]);var c=i(0,o.size()[0]),l=new r(c,u),s=o.subset(l);return ke(s)?s:n([[s]])}}),im="count",SS=["typed","size","prod"],CS=U(im,SS,e=>{var{typed:t,size:r,prod:n}=e;return t(im,{string:function(i){return i.length},"Matrix | Array":function(i){return n(r(i))}})}),am="cross",MS=["typed","matrix","subtract","multiply"],_S=U(am,MS,e=>{var{typed:t,matrix:r,subtract:n,multiply:i}=e;return t(am,{"Matrix, Matrix":function(o,u){return r(a(o.toArray(),u.toArray()))},"Matrix, Array":function(o,u){return r(a(o.toArray(),u))},"Array, Matrix":function(o,u){return r(a(o,u.toArray()))},"Array, Array":a});function a(o,u){var c=Math.max(Ve(o).length,Ve(u).length);o=Bs(o),u=Bs(u);var l=Ve(o),s=Ve(u);if(l.length!==1||s.length!==1||l[0]!==3||s[0]!==3)throw new RangeError("Vectors with length 3 expected (Size A = ["+l.join(", ")+"], B = ["+s.join(", ")+"])");var f=[n(i(o[1],u[2]),i(o[2],u[1])),n(i(o[2],u[0]),i(o[0],u[2])),n(i(o[0],u[1]),i(o[1],u[0]))];return c>1?[f]:f}}),om="diag",FS=["typed","matrix","DenseMatrix","SparseMatrix"],TS=U(om,FS,e=>{var{typed:t,matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(om,{Array:function(c){return a(c,0,Ve(c),null)},"Array, number":function(c,l){return a(c,l,Ve(c),null)},"Array, BigNumber":function(c,l){return a(c,l.toNumber(),Ve(c),null)},"Array, string":function(c,l){return a(c,0,Ve(c),l)},"Array, number, string":function(c,l,s){return a(c,l,Ve(c),s)},"Array, BigNumber, string":function(c,l,s){return a(c,l.toNumber(),Ve(c),s)},Matrix:function(c){return a(c,0,c.size(),c.storage())},"Matrix, number":function(c,l){return a(c,l,c.size(),c.storage())},"Matrix, BigNumber":function(c,l){return a(c,l.toNumber(),c.size(),c.storage())},"Matrix, string":function(c,l){return a(c,0,c.size(),l)},"Matrix, number, string":function(c,l,s){return a(c,l,c.size(),s)},"Matrix, BigNumber, string":function(c,l,s){return a(c,l.toNumber(),c.size(),s)}});function a(c,l,s,f){if(!Fe(l))throw new TypeError("Second parameter in function diag must be an integer");var p=l>0?l:0,m=l<0?-l:0;switch(s.length){case 1:return o(c,l,f,s[0],m,p);case 2:return u(c,l,f,s,m,p)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function o(c,l,s,f,p,m){var d=[f+p,f+m];if(s&&s!=="sparse"&&s!=="dense")throw new TypeError("Unknown matrix type ".concat(s,'"'));var h=s==="sparse"?i.diagonal(d,c,l):n.diagonal(d,c,l);return s!==null?h:h.valueOf()}function u(c,l,s,f,p,m){if(ke(c)){var d=c.diagonal(l);return s!==null?s!==d.storage()?r(d,s):d:d.valueOf()}for(var h=Math.min(f[0]-p,f[1]-m),w=[],v=0;v<h;v++)w[v]=c[v+p][v+m];return s!==null?r(w):w}});function Ca(e,t,r,n,i){if(ea.isTypedFunction(e)){var a=[t,r,n],o=ea.resolve(e,a);if(o)return f(o.implementation,a);var u=[t,r],c=ea.resolve(e,u);if(c)return f(c.implementation,u);var l=[t],s=ea.resolve(e,l);return s?f(s.implementation,l):f(e,a)}else return e(t,r,n);function f(p,m){try{return p.apply(p,m)}catch(w){var d;if(w instanceof TypeError&&((d=w.data)===null||d===void 0?void 0:d.category)==="wrongType"){var h=[];throw h.push("value: ".concat(dt(t))),m.length>=2&&h.push("index: ".concat(dt(r))),m.length>=3&&h.push("array: ".concat(dt(n))),new TypeError("Function ".concat(i," cannot apply callback arguments ")+"".concat(e.name,"(").concat(h.join(", "),") at index ").concat(JSON.stringify(r)))}else throw new TypeError("Function ".concat(i," cannot apply callback arguments ")+"to function ".concat(e.name,": ").concat(w.message))}}}var OS="filter",BS=["typed"],kS=U(OS,BS,e=>{var{typed:t}=e;return t("filter",{"Array, function":sm,"Matrix, function":function(r,n){return r.create(sm(r.toArray(),n))},"Array, RegExp":ks,"Matrix, RegExp":function(r,n){return r.create(ks(r.toArray(),n))}})});function sm(e,t){return vv(e,function(r,n,i){return Ca(t,r,[n],i,"filter")})}var um="flatten",IS=["typed","matrix"],RS=U(um,IS,e=>{var{typed:t,matrix:r}=e;return t(um,{Array:function(n){return ot(n)},Matrix:function(n){var i=ot(n.toArray());return r(i)}})}),cm="forEach",qS=["typed"],zS=U(cm,qS,e=>{var{typed:t}=e;return t(cm,{"Array, function":jS,"Matrix, function":function(r,n){r.forEach(n)}})});function jS(e,t){var r=function n(i,a){if(Array.isArray(i))yu(i,function(o,u){n(o,a.concat(u))});else return Ca(t,i,a,e,"forEach")};r(e,[])}var lm="getMatrixDataType",LS=["typed"],PS=U(lm,LS,e=>{var{typed:t}=e;return t(lm,{Array:function(r){return oo(r,dt)},Matrix:function(r){return r.getDataType()}})}),fm="identity",VS=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],US=U(fm,VS,e=>{var{typed:t,config:r,matrix:n,BigNumber:i,DenseMatrix:a,SparseMatrix:o}=e;return t(fm,{"":function(){return r.matrix==="Matrix"?n([]):[]},string:function(l){return n(l)},"number | BigNumber":function(l){return c(l,l,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(l,s){return c(l,l,s)},"number | BigNumber, number | BigNumber":function(l,s){return c(l,s,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(l,s,f){return c(l,s,f)},Array:function(l){return u(l)},"Array, string":function(l,s){return u(l,s)},Matrix:function(l){return u(l.valueOf(),l.storage())},"Matrix, string":function(l,s){return u(l.valueOf(),s)}});function u(l,s){switch(l.length){case 0:return s?n(s):[];case 1:return c(l[0],l[0],s);case 2:return c(l[0],l[1],s);default:throw new Error("Vector containing two values expected")}}function c(l,s,f){var p=$e(l)||$e(s)?i:null;if($e(l)&&(l=l.toNumber()),$e(s)&&(s=s.toNumber()),!Fe(l)||l<1)throw new Error("Parameters in function identity must be positive integers");if(!Fe(s)||s<1)throw new Error("Parameters in function identity must be positive integers");var m=p?new i(1):1,d=p?new p(0):0,h=[l,s];if(f){if(f==="sparse")return o.diagonal(h,m,0,d);if(f==="dense")return a.diagonal(h,m,0,d);throw new TypeError('Unknown matrix type "'.concat(f,'"'))}for(var w=da([],h,d),v=l<s?l:s,b=0;b<v;b++)w[b][b]=m;return w}}),pm="kron",$S=["typed","matrix","multiplyScalar"],HS=U(pm,$S,e=>{var{typed:t,matrix:r,multiplyScalar:n}=e;return t(pm,{"Matrix, Matrix":function(a,o){return r(i(a.toArray(),o.toArray()))},"Matrix, Array":function(a,o){return r(i(a.toArray(),o))},"Array, Matrix":function(a,o){return r(i(a,o.toArray()))},"Array, Array":i});function i(a,o){if(Ve(a).length===1&&(a=[a]),Ve(o).length===1&&(o=[o]),Ve(a).length>2||Ve(o).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(a.length)+", y = "+JSON.stringify(o.length)+")");var u=[],c=[];return a.map(function(l){return o.map(function(s){return c=[],u.push(c),l.map(function(f){return s.map(function(p){return c.push(n(f,p))})})})})&&u}}),mm="map",JS=["typed"],GS=U(mm,JS,e=>{var{typed:t}=e;return t(mm,{"Array, function":WS,"Matrix, function":function(r,n){return r.map(n)}})});function WS(e,t){var r=function n(i,a){return Array.isArray(i)?i.map(function(o,u){return n(o,a.concat(u))}):Ca(t,i,a,e,"map")};return r(e,[])}var dm="diff",KS=["typed","matrix","subtract","number"],Ay=U(dm,KS,e=>{var{typed:t,matrix:r,subtract:n,number:i}=e;return t(dm,{"Array | Matrix":function(l){return ke(l)?r(o(l.toArray())):o(l)},"Array | Matrix, number":function(l,s){if(!Fe(s))throw new RangeError("Dimension must be a whole number");return ke(l)?r(a(l.toArray(),s)):a(l,s)},"Array, BigNumber":t.referTo("Array,number",l=>(s,f)=>l(s,i(f))),"Matrix, BigNumber":t.referTo("Matrix,number",l=>(s,f)=>l(s,i(f)))});function a(l,s){if(ke(l)&&(l=l.toArray()),!Array.isArray(l))throw RangeError("Array/Matrix does not have that many dimensions");if(s>0){var f=[];return l.forEach(p=>{f.push(a(p,s-1))}),f}else{if(s===0)return o(l);throw RangeError("Cannot have negative dimension")}}function o(l){for(var s=[],f=l.length,p=1;p<f;p++)s.push(u(l[p-1],l[p]));return s}function u(l,s){ke(l)&&(l=l.toArray()),ke(s)&&(s=s.toArray());var f=Array.isArray(l),p=Array.isArray(s);if(f&&p)return c(l,s);if(!f&&!p)return n(s,l);throw TypeError("Cannot calculate difference between 1 array and 1 non-array")}function c(l,s){if(l.length!==s.length)throw RangeError("Not all sub-arrays have the same length");for(var f=[],p=l.length,m=0;m<p;m++)f.push(u(l[m],s[m]));return f}}),QS="ones",ZS=["typed","config","matrix","BigNumber"],XS=U(QS,ZS,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t("ones",{"":function(){return r.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(c){var l=c[c.length-1];if(typeof l=="string"){var s=c.pop();return a(c,s)}else return r.matrix==="Array"?a(c):a(c,"default")},Array:a,Matrix:function(c){var l=c.storage();return a(c.valueOf(),l)},"Array | Matrix, string":function(c,l){return a(c.valueOf(),l)}});function a(c,l){var s=o(c),f=s?new i(1):1;if(u(c),l){var p=n(l);return c.length>0?p.resize(c,f):p}else{var m=[];return c.length>0?da(m,c,f):m}}function o(c){var l=!1;return c.forEach(function(s,f,p){$e(s)&&(l=!0,p[f]=s.toNumber())}),l}function u(c){c.forEach(function(l){if(typeof l!="number"||!Fe(l)||l<0)throw new Error("Parameters in function ones must be positive integers")})}});function Cl(){throw new Error('No "bignumber" implementation available')}function Sy(){throw new Error('No "fraction" implementation available')}function Cy(){throw new Error('No "matrix" implementation available')}var hm="range",YS=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],My=U(hm,YS,e=>{var{typed:t,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:u,largerEq:c,add:l,isPositive:s}=e;return t(hm,{string:p,"string, boolean":p,"number, number":function(h,w){return f(m(h,w,1,!1))},"number, number, number":function(h,w,v){return f(m(h,w,v,!1))},"number, number, boolean":function(h,w,v){return f(m(h,w,1,v))},"number, number, number, boolean":function(h,w,v,b){return f(m(h,w,v,b))},"BigNumber, BigNumber":function(h,w){var v=h.constructor;return f(m(h,w,new v(1),!1))},"BigNumber, BigNumber, BigNumber":function(h,w,v){return f(m(h,w,v,!1))},"BigNumber, BigNumber, boolean":function(h,w,v){var b=h.constructor;return f(m(h,w,new b(1),v))},"BigNumber, BigNumber, BigNumber, boolean":function(h,w,v,b){return f(m(h,w,v,b))},"Unit, Unit, Unit":function(h,w,v){return f(m(h,w,v,!1))},"Unit, Unit, Unit, boolean":function(h,w,v,b){return f(m(h,w,v,b))}});function f(h){return r.matrix==="Matrix"?n?n(h):Cy():h}function p(h,w){var v=d(h);if(!v)throw new SyntaxError('String "'+h+'" is no valid range');return r.number==="BigNumber"?(i===void 0&&Cl(),f(m(i(v.start),i(v.end),i(v.step)))):f(m(v.start,v.end,v.step,w))}function m(h,w,v,b){for(var g=[],x=s(v)?b?o:a:b?c:u,y=h;x(y,w);)g.push(y),y=l(y,v);return g}function d(h){var w=h.split(":"),v=w.map(function(g){return Number(g)}),b=v.some(function(g){return isNaN(g)});if(b)return null;switch(v.length){case 2:return{start:v[0],end:v[1],step:1};case 3:return{start:v[0],end:v[2],step:v[1]};default:return null}}}),gm="reshape",eC=["typed","isInteger","matrix"],tC=U(gm,eC,e=>{var{typed:t,isInteger:r}=e;return t(gm,{"Matrix, Array":function(n,i){return n.reshape(i,!0)},"Array, Array":function(n,i){return i.forEach(function(a){if(!r(a))throw new TypeError("Invalid size for dimension: "+a)}),wl(n,i)}})}),rC="resize",nC=["config","matrix"],iC=U(rC,nC,e=>{var{config:t,matrix:r}=e;return function(i,a,o){if(arguments.length!==2&&arguments.length!==3)throw new ji("resize",arguments.length,2,3);if(ke(a)&&(a=a.valueOf()),$e(a[0])&&(a=a.map(function(l){return $e(l)?l.toNumber():l})),ke(i))return i.resize(a,o,!0);if(typeof i=="string")return n(i,a,o);var u=Array.isArray(i)?!1:t.matrix!=="Array";if(a.length===0){for(;Array.isArray(i);)i=i[0];return ze(i)}else{Array.isArray(i)||(i=[i]),i=ze(i);var c=da(i,a,o);return u?r(c):c}};function n(i,a,o){if(o!==void 0){if(typeof o!="string"||o.length!==1)throw new TypeError("Single character expected as defaultValue")}else o=" ";if(a.length!==1)throw new Ke(a.length,1);var u=a[0];if(typeof u!="number"||!Fe(u))throw new TypeError("Invalid size, must contain positive integers (size: "+Ge(a)+")");if(i.length>u)return i.substring(0,u);if(i.length<u){for(var c=i,l=0,s=u-i.length;l<s;l++)c+=o;return c}else return i}}),vm="rotate",aC=["typed","multiply","rotationMatrix"],oC=U(vm,aC,e=>{var{typed:t,multiply:r,rotationMatrix:n}=e;return t(vm,{"Array , number | BigNumber | Complex | Unit":function(a,o){i(a,2);var u=r(n(o),a);return u.toArray()},"Matrix , number | BigNumber | Complex | Unit":function(a,o){return i(a,2),r(n(o),a)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(a,o,u){i(a,3);var c=r(n(o,u),a);return c},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(a,o,u){return i(a,3),r(n(o,u),a)}});function i(a,o){var u=Array.isArray(a)?Ve(a):a.size();if(u.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(o));if(u.length===2&&u[1]!==1)throw new RangeError("Vector must be of dimensions 1x".concat(o));if(u[0]!==o)throw new RangeError("Vector must be of dimensions 1x".concat(o))}}),ym="rotationMatrix",sC=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],uC=U(ym,sC,e=>{var{typed:t,config:r,multiplyScalar:n,addScalar:i,unaryMinus:a,norm:o,BigNumber:u,matrix:c,DenseMatrix:l,SparseMatrix:s,cos:f,sin:p}=e;return t(ym,{"":function(){return r.matrix==="Matrix"?c([]):[]},string:function(b){return c(b)},"number | BigNumber | Complex | Unit":function(b){return m(b,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(b,g){return m(b,g)},"number | BigNumber | Complex | Unit, Array":function(b,g){var x=c(g);return d(x),v(b,x,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(b,g){d(g);var x=g.storage()||(r.matrix==="Matrix"?"dense":void 0);return v(b,g,x)},"number | BigNumber | Complex | Unit, Array, string":function(b,g,x){var y=c(g);return d(y),v(b,y,x)},"number | BigNumber | Complex | Unit, Matrix, string":function(b,g,x){return d(g),v(b,g,x)}});function m(b,g){var x=$e(b),y=x?new u(-1):-1,N=f(b),E=p(b),A=[[N,n(y,E)],[E,N]];return w(A,g)}function d(b){var g=b.size();if(g.length<1||g[0]!==3)throw new RangeError("Vector must be of dimensions 1x3")}function h(b){return b.reduce((g,x)=>n(g,x))}function w(b,g){if(g){if(g==="sparse")return new s(b);if(g==="dense")return new l(b);throw new TypeError('Unknown matrix type "'.concat(g,'"'))}return b}function v(b,g,x){var y=o(g);if(y===0)throw new RangeError("Rotation around zero vector");var N=$e(b)?u:null,E=N?new N(1):1,A=N?new N(-1):-1,D=N?new N(g.get([0])/y):g.get([0])/y,S=N?new N(g.get([1])/y):g.get([1])/y,C=N?new N(g.get([2])/y):g.get([2])/y,_=f(b),R=i(E,a(_)),P=p(b),I=i(_,h([D,D,R])),O=i(h([D,S,R]),h([A,C,P])),F=i(h([D,C,R]),h([S,P])),q=i(h([D,S,R]),h([C,P])),k=i(_,h([S,S,R])),te=i(h([S,C,R]),h([A,D,P])),se=i(h([D,C,R]),h([A,S,P])),K=i(h([S,C,R]),h([D,P])),V=i(_,h([C,C,R])),ue=[[I,O,F],[q,k,te],[se,K,V]];return w(ue,x)}}),xm="row",cC=["typed","Index","matrix","range"],_y=U(xm,cC,e=>{var{typed:t,Index:r,matrix:n,range:i}=e;return t(xm,{"Matrix, number":a,"Array, number":function(o,u){return a(n(ze(o)),u).valueOf()}});function a(o,u){if(o.size().length!==2)throw new Error("Only two dimensional matrix is supported");pt(u,o.size()[0]);var c=i(0,o.size()[1]),l=new r(u,c),s=o.subset(l);return ke(s)?s:n([[s]])}}),bm="size",lC=["typed","config","?matrix"],fC=U(bm,lC,e=>{var{typed:t,config:r,matrix:n}=e;return t(bm,{Matrix:function(i){return i.create(i.size())},Array:Ve,string:function(i){return r.matrix==="Array"?[i.length]:n([i.length])},"number | Complex | BigNumber | Unit | boolean | null":function(i){return r.matrix==="Array"?[]:n?n([]):Cy()}})}),wm="squeeze",pC=["typed","matrix"],mC=U(wm,pC,e=>{var{typed:t,matrix:r}=e;return t(wm,{Array:function(n){return Bs(ze(n))},Matrix:function(n){var i=Bs(n.toArray());return Array.isArray(i)?r(i):i},any:function(n){return ze(n)}})}),Nm="subset",dC=["typed","matrix","zeros","add"],Fy=U(Nm,dC,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e;return t(Nm,{"Matrix, Index":function(o,u){return ma(u)?r():(Os(o,u),o.subset(u))},"Array, Index":t.referTo("Matrix, Index",function(o){return function(u,c){var l=o(r(u),c);return c.isScalar()?l:l.valueOf()}}),"Object, Index":gC,"string, Index":hC,"Matrix, Index, any, any":function(o,u,c,l){return ma(u)?o:(Os(o,u),o.clone().subset(u,a(c,u),l))},"Array, Index, any, any":t.referTo("Matrix, Index, any, any",function(o){return function(u,c,l,s){var f=o(r(u),c,l,s);return f.isMatrix?f.valueOf():f}}),"Array, Index, any":t.referTo("Matrix, Index, any, any",function(o){return function(u,c,l){return o(r(u),c,l,void 0).valueOf()}}),"Matrix, Index, any":t.referTo("Matrix, Index, any, any",function(o){return function(u,c,l){return o(u,c,l,void 0)}}),"string, Index, string":Dm,"string, Index, string, string":Dm,"Object, Index, any":vC});function a(o,u){if(typeof o=="string")throw new Error("can't boradcast a string");if(u._isScalar)return o;var c=u.size();if(c.every(l=>l>0))try{return i(o,n(c))}catch{return o}else return o}});function hC(e,t){if(!lu(t))throw new TypeError("Index expected");if(ma(t))return"";if(Os(Array.from(e),t),t.size().length!==1)throw new Ke(t.size().length,1);var r=e.length;pt(t.min()[0],r),pt(t.max()[0],r);var n=t.dimension(0),i="";return n.forEach(function(a){i+=e.charAt(a)}),i}function Dm(e,t,r,n){if(!t||t.isIndex!==!0)throw new TypeError("Index expected");if(ma(t))return e;if(Os(Array.from(e),t),t.size().length!==1)throw new Ke(t.size().length,1);if(n!==void 0){if(typeof n!="string"||n.length!==1)throw new TypeError("Single character expected as defaultValue")}else n=" ";var i=t.dimension(0),a=i.size()[0];if(a!==r.length)throw new Ke(i.size()[0],r.length);var o=e.length;pt(t.min()[0]),pt(t.max()[0]);for(var u=[],c=0;c<o;c++)u[c]=e.charAt(c);if(i.forEach(function(f,p){u[f]=r.charAt(p[0])}),u.length>o)for(var l=o-1,s=u.length;l<s;l++)u[l]||(u[l]=n);return u.join("")}function gC(e,t){if(!ma(t)){if(t.size().length!==1)throw new Ke(t.size(),1);var r=t.dimension(0);if(typeof r!="string")throw new TypeError("String expected as index to retrieve an object property");return nr(e,r)}}function vC(e,t,r){if(ma(t))return e;if(t.size().length!==1)throw new Ke(t.size(),1);var n=t.dimension(0);if(typeof n!="string")throw new TypeError("String expected as index to retrieve an object property");var i=ze(e);return fa(i,n,r),i}var Em="transpose",yC=["typed","matrix"],xC=U(Em,yC,e=>{var{typed:t,matrix:r}=e;return t(Em,{Array:o=>n(r(o)).valueOf(),Matrix:n,any:ze});function n(o){var u=o.size(),c;switch(u.length){case 1:c=o.clone();break;case 2:{var l=u[0],s=u[1];if(s===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+Ge(u)+")");switch(o.storage()){case"dense":c=i(o,l,s);break;case"sparse":c=a(o,l,s);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+Ge(u)+")")}return c}function i(o,u,c){for(var l=o._data,s=[],f,p=0;p<c;p++){f=s[p]=[];for(var m=0;m<u;m++)f[m]=ze(l[m][p])}return o.createDenseMatrix({data:s,size:[c,u],datatype:o._datatype})}function a(o,u,c){for(var l=o._values,s=o._index,f=o._ptr,p=l?[]:void 0,m=[],d=[],h=[],w=0;w<u;w++)h[w]=0;var v,b,g;for(v=0,b=s.length;v<b;v++)h[s[v]]++;for(var x=0,y=0;y<u;y++)d.push(x),x+=h[y],h[y]=d[y];for(d.push(x),g=0;g<c;g++)for(var N=f[g],E=f[g+1],A=N;A<E;A++){var D=h[s[A]]++;m[D]=g,l&&(p[D]=ze(l[A]))}return o.createSparseMatrix({values:p,index:m,ptr:d,size:[c,u],datatype:o._datatype})}}),Am="ctranspose",bC=["typed","transpose","conj"],wC=U(Am,bC,e=>{var{typed:t,transpose:r,conj:n}=e;return t(Am,{any:function(i){return n(r(i))}})}),Sm="zeros",NC=["typed","config","matrix","BigNumber"],DC=U(Sm,NC,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(Sm,{"":function(){return r.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(c){var l=c[c.length-1];if(typeof l=="string"){var s=c.pop();return a(c,s)}else return r.matrix==="Array"?a(c):a(c,"default")},Array:a,Matrix:function(c){var l=c.storage();return a(c.valueOf(),l)},"Array | Matrix, string":function(c,l){return a(c.valueOf(),l)}});function a(c,l){var s=o(c),f=s?new i(0):0;if(u(c),l){var p=n(l);return c.length>0?p.resize(c,f):p}else{var m=[];return c.length>0?da(m,c,f):m}}function o(c){var l=!1;return c.forEach(function(s,f,p){$e(s)&&(l=!0,p[f]=s.toNumber())}),l}function u(c){c.forEach(function(l){if(typeof l!="number"||!Fe(l)||l<0)throw new Error("Parameters in function zeros must be positive integers")})}}),Cm="fft",EC=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],AC=U(Cm,EC,e=>{var{typed:t,matrix:r,addScalar:n,multiplyScalar:i,divideScalar:a,exp:o,tau:u,i:c,dotDivide:l,conj:s,pow:f,ceil:p,log2:m}=e;return t(Cm,{Array:d,Matrix:function(b){return b.create(d(b.toArray()))}});function d(b){var g=Ve(b);return g.length===1?v(b,g[0]):h(b.map(x=>d(x,g.slice(1))),0)}function h(b,g){var x=Ve(b);if(g!==0)return new Array(x[0]).fill(0).map((N,E)=>h(b[E],g-1));if(x.length===1)return v(b);function y(N){var E=Ve(N);return new Array(E[1]).fill(0).map((A,D)=>new Array(E[0]).fill(0).map((S,C)=>N[C][D]))}return y(h(y(b),1))}function w(b){for(var g=b.length,x=o(a(i(-1,i(c,u)),g)),y=[],N=1-g;N<g;N++)y.push(f(x,a(f(N,2),2)));for(var E=f(2,p(m(g+g-1))),A=[...new Array(g).fill(0).map((O,F)=>i(b[F],y[g-1+F])),...new Array(E-g).fill(0)],D=[...new Array(g+g-1).fill(0).map((O,F)=>a(1,y[F])),...new Array(E-(g+g-1)).fill(0)],S=v(A),C=v(D),_=new Array(E).fill(0).map((O,F)=>i(S[F],C[F])),R=l(s(d(s(_))),E),P=[],I=g-1;I<g+g-1;I++)P.push(i(R[I],y[I]));return P}function v(b){var g=b.length;if(g===1)return[b[0]];if(g%2===0){for(var x=[...v(b.filter((A,D)=>D%2===0)),...v(b.filter((A,D)=>D%2===1))],y=0;y<g/2;y++){var N=x[y],E=i(x[y+g/2],o(i(i(u,c),a(-y,g))));x[y]=n(N,E),x[y+g/2]=n(N,i(-1,E))}return x}else return w(b)}}),Mm="ifft",SC=["typed","fft","dotDivide","conj"],CC=U(Mm,SC,e=>{var{typed:t,fft:r,dotDivide:n,conj:i}=e;return t(Mm,{"Array | Matrix":function(a){var o=ke(a)?a.size():Ve(a);return n(i(r(i(a))),o.reduce((u,c)=>u*c,1))}})});function uo(e){"@babel/helpers - typeof";return uo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uo(e)}function MC(e,t){if(uo(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(uo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _C(e){var t=MC(e,"string");return uo(t)=="symbol"?t:t+""}function Bt(e,t,r){return(t=_C(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function FC(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_m(Object(r),!0).forEach(function(n){Bt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_m(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var TC="solveODE",OC=["typed","add","subtract","multiply","divide","max","map","abs","isPositive","isNegative","larger","smaller","matrix","bignumber","unaryMinus"],BC=U(TC,OC,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:a,max:o,map:u,abs:c,isPositive:l,isNegative:s,larger:f,smaller:p,matrix:m,bignumber:d,unaryMinus:h}=e;function w(A){return function(D,S,C,_){var R=!(S.length===2&&(S.every(N)||S.every(Cr)));if(R)throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var P=S[0],I=S[1],O=f(I,P),F=_.firstStep;if(F!==void 0&&!l(F))throw new Error('"firstStep" must be positive');var q=_.maxStep;if(q!==void 0&&!l(q))throw new Error('"maxStep" must be positive');var k=_.minStep;if(k&&s(k))throw new Error('"minStep" must be positive or zero');var te=[P,I,F,k,q].filter(B=>B!==void 0);if(!(te.every(N)||te.every(Cr)))throw new Error('Inconsistent type of "t" dependant variables');for(var se=1,K=_.tol?_.tol:1e-4,V=_.minDelta?_.minDelta:.2,ue=_.maxDelta?_.maxDelta:5,me=_.maxIter?_.maxIter:1e4,re=[P,I,...C,q,k].some($e),[ae,de,ne,ce]=re?[d(A.a),d(A.c),d(A.b),d(A.bp)]:[A.a,A.c,A.b,A.bp],le=F?O?F:h(F):a(n(I,P),se),he=[P],be=[C],$=n(ne,ce),T=0,z=0,J=x(O),L=y(O);J(he[T],I);){var H=[];le=L(he[T],I,le),H.push(D(he[T],be[T]));for(var G=1;G<de.length;++G)H.push(D(r(he[T],i(de[G],le)),r(be[T],i(le,ae[G],H))));var Y=o(c(u(i($,H),B=>Cr(B)?B.value:B)));Y<K&&K/Y>1/4&&(he.push(r(he[T],le)),be.push(r(be[T],i(le,ne,H))),T++);var ee=.84*(K/Y)**(1/5);if(p(ee,V)?ee=V:f(ee,ue)&&(ee=ue),ee=re?d(ee):ee,le=i(le,ee),q&&f(c(le),q)?le=O?q:h(q):k&&p(c(le),k)&&(le=O?k:h(k)),z++,z>me)throw new Error("Maximum number of iterations reached, try changing options")}return{t:he,y:be}}}function v(A,D,S,C){var _=[[],[.5],[0,.75],[.2222222222222222,.3333333333333333,.4444444444444444]],R=[null,1/2,3/4,1],P=[2/9,1/3,4/9,0],I=[7/24,1/4,1/3,1/8],O={a:_,c:R,b:P,bp:I};return w(O)(A,D,S,C)}function b(A,D,S,C){var _=[[],[.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]],R=[null,1/5,3/10,4/5,8/9,1,1],P=[35/384,0,500/1113,125/192,-2187/6784,11/84,0],I=[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40],O={a:_,c:R,b:P,bp:I};return w(O)(A,D,S,C)}function g(A,D,S,C){var _=C.method?C.method:"RK45",R={RK23:v,RK45:b};if(_.toUpperCase()in R){var P=FC({},C);return delete P.method,R[_.toUpperCase()](A,D,S,P)}else{var I=Object.keys(R).map(F=>'"'.concat(F,'"')),O="".concat(I.slice(0,-1).join(", ")," and ").concat(I.slice(-1));throw new Error('Unavailable method "'.concat(_,'". Available methods are ').concat(O))}}function x(A){return A?p:f}function y(A){var D=A?f:p;return function(S,C,_){var R=r(S,_);return D(R,C)?n(C,S):_}}function N(A){return $e(A)||Ue(A)}function E(A,D,S,C){var _=g(A,D.toArray(),S.toArray(),C);return{t:m(_.t),y:m(_.y)}}return t("solveODE",{"function, Array, Array, Object":g,"function, Matrix, Matrix, Object":E,"function, Array, Array":(A,D,S)=>g(A,D,S,{}),"function, Matrix, Matrix":(A,D,S)=>E(A,D,S,{}),"function, Array, number | BigNumber | Unit":(A,D,S)=>{var C=g(A,D,[S],{});return{t:C.t,y:C.y.map(_=>_[0])}},"function, Matrix, number | BigNumber | Unit":(A,D,S)=>{var C=g(A,D.toArray(),[S],{});return{t:m(C.t),y:m(C.y.map(_=>_[0]))}},"function, Array, number | BigNumber | Unit, Object":(A,D,S,C)=>{var _=g(A,D,[S],C);return{t:_.t,y:_.y.map(R=>R[0])}},"function, Matrix, number | BigNumber | Unit, Object":(A,D,S,C)=>{var _=g(A,D.toArray(),[S],C);return{t:m(_.t),y:m(_.y.map(R=>R[0]))}}})}),kC="erf",IC=["typed"],RC=U(kC,IC,e=>{var{typed:t}=e;return t("name",{number:function(a){var o=Math.abs(a);return o>=jC?Wn(a):o<=qC?Wn(a)*r(o):o<=4?Wn(a)*(1-n(o)):Wn(a)*(1-i(o))},"Array | Matrix":t.referToSelf(a=>o=>Qe(o,a))});function r(a){var o=a*a,u=hn[0][4]*o,c=o,l;for(l=0;l<3;l+=1)u=(u+hn[0][l])*o,c=(c+Zi[0][l])*o;return a*(u+hn[0][3])/(c+Zi[0][3])}function n(a){var o=hn[1][8]*a,u=a,c;for(c=0;c<7;c+=1)o=(o+hn[1][c])*a,u=(u+Zi[1][c])*a;var l=(o+hn[1][7])/(u+Zi[1][7]),s=parseInt(a*16)/16,f=(a-s)*(a+s);return Math.exp(-s*s)*Math.exp(-f)*l}function i(a){var o=1/(a*a),u=hn[2][5]*o,c=o,l;for(l=0;l<4;l+=1)u=(u+hn[2][l])*o,c=(c+Zi[2][l])*o;var s=o*(u+hn[2][4])/(c+Zi[2][4]);s=(zC-s)/a,o=parseInt(a*16)/16;var f=(a-o)*(a+o);return Math.exp(-o*o)*Math.exp(-f)*s}}),qC=.46875,zC=.5641895835477563,hn=[[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]],Zi=[[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]],jC=Math.pow(2,53),Fm="zeta",LC=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],PC=U(Fm,LC,e=>{var{typed:t,config:r,multiply:n,pow:i,divide:a,factorial:o,equal:u,smallerEq:c,isNegative:l,gamma:s,sin:f,subtract:p,add:m,Complex:d,BigNumber:h,pi:w}=e;return t(Fm,{number:N=>v(N,E=>E,()=>20),BigNumber:N=>v(N,E=>new h(E),()=>Math.abs(Math.log10(r.epsilon))),Complex:b});function v(N,E,A){return u(N,0)?E(-.5):u(N,1)?E(NaN):isFinite(N)?g(N,E,A,D=>D):l(N)?E(NaN):E(1)}function b(N){return N.re===0&&N.im===0?new d(-.5):N.re===1?new d(NaN,NaN):N.re===1/0&&N.im===0?new d(1):N.im===1/0||N.re===-1/0?new d(NaN,NaN):g(N,E=>E,E=>Math.round(1.3*15+.9*Math.abs(E.im)),E=>E.re)}function g(N,E,A,D){var S=A(N);if(D(N)>-(S-1)/2)return y(N,E(S),E);var C=n(i(2,N),i(E(w),p(N,1)));return C=n(C,f(n(a(E(w),2),N))),C=n(C,s(p(1,N))),n(C,g(p(1,N),E,A,D))}function x(N,E){for(var A=N,D=N;c(D,E);D=m(D,1)){var S=a(n(o(m(E,p(D,1))),i(4,D)),n(o(p(E,D)),o(n(2,D))));A=m(A,S)}return n(E,A)}function y(N,E,A){for(var D=a(1,n(x(A(0),E),p(1,i(2,p(1,N))))),S=A(0),C=A(1);c(C,E);C=m(C,1))S=m(S,a(n((-1)**(C-1),x(C,E)),i(C,N)));return n(D,S)}}),Tm="mode",VC=["typed","isNaN","isNumeric"],UC=U(Tm,VC,e=>{var{typed:t,isNaN:r,isNumeric:n}=e;return t(Tm,{"Array | Matrix":i,"...":function(a){return i(a)}});function i(a){a=ot(a.valueOf());var o=a.length;if(o===0)throw new Error("Cannot calculate mode of an empty array");for(var u={},c=[],l=0,s=0;s<a.length;s++){var f=a[s];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]===l?c.push(f):u[f]>l&&(l=u[f],c=[f])}return c}});function ur(e,t,r){var n;return String(e).includes("Unexpected type")?(n=arguments.length>2?" (type: "+dt(r)+", value: "+JSON.stringify(r)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+n)):String(e).includes("complex numbers")?(n=arguments.length>2?" (type: "+dt(r)+", value: "+JSON.stringify(r)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+n)):e}var Om="prod",$C=["typed","config","multiplyScalar","numeric"],HC=U(Om,$C,e=>{var{typed:t,config:r,multiplyScalar:n,numeric:i}=e;return t(Om,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(o,u){throw new Error("prod(A, dim) is not yet supported")},"...":function(o){return a(o)}});function a(o){var u;if(Sn(o,function(c){try{u=u===void 0?c:n(u,c)}catch(l){throw ur(l,"prod",c)}}),typeof u=="string"&&(u=i(u,r.number)),u===void 0)throw new Error("Cannot calculate prod of an empty array");return u}}),Bm="format",JC=["typed"],GC=U(Bm,JC,e=>{var{typed:t}=e;return t(Bm,{any:Ge,"any, Object | function | number | BigNumber":Ge})}),km="bin",WC=["typed","format"],KC=U(km,WC,e=>{var{typed:t,format:r}=e;return t(km,{"number | BigNumber":function(n){return r(n,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(n,i){return r(n,{notation:"bin",wordSize:i})}})}),Im="oct",QC=["typed","format"],ZC=U(Im,QC,e=>{var{typed:t,format:r}=e;return t(Im,{"number | BigNumber":function(n){return r(n,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(n,i){return r(n,{notation:"oct",wordSize:i})}})}),Rm="hex",XC=["typed","format"],YC=U(Rm,XC,e=>{var{typed:t,format:r}=e;return t(Rm,{"number | BigNumber":function(n){return r(n,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(n,i){return r(n,{notation:"hex",wordSize:i})}})}),Ty=/\$([\w.]+)/g,qm="print",eM=["typed"],Oy=U(qm,eM,e=>{var{typed:t}=e;return t(qm,{"string, Object | Array":zm,"string, Object | Array, number | Object":zm})});function zm(e,t,r){return e.replace(Ty,function(n,i){var a=i.split("."),o=t[a.shift()];for(o!==void 0&&o.isMatrix&&(o=o.toArray());a.length&&o!==void 0;){var u=a.shift();o=u?o[u]:o+"."}return o!==void 0?Qt(o)?o:Ge(o,r):n})}var jm="to",tM=["typed","matrix","concat"],rM=U(jm,tM,e=>{var{typed:t,matrix:r,concat:n}=e,i=gt({typed:t,matrix:r,concat:n});return t(jm,{"Unit, Unit | string":(a,o)=>a.to(o)},i({Ds:!0}))}),Lm="isPrime",nM=["typed"],iM=U(Lm,nM,e=>{var{typed:t}=e;return t(Lm,{number:function(r){if(r*0!==0)return!1;if(r<=3)return r>1;if(r%2===0||r%3===0)return!1;for(var n=5;n*n<=r;n+=6)if(r%n===0||r%(n+2)===0)return!1;return!0},BigNumber:function(r){if(r.toNumber()*0!==0)return!1;if(r.lte(3))return r.gt(1);if(r.mod(2).eq(0)||r.mod(3).eq(0))return!1;if(r.lt(Math.pow(2,32))){for(var n=r.toNumber(),i=5;i*i<=n;i+=6)if(n%i===0||n%(i+2)===0)return!1;return!0}function a(v,b,g){for(var x=1;!b.eq(0);)b.mod(2).eq(0)?(b=b.div(2),v=v.mul(v).mod(g)):(b=b.sub(1),x=v.mul(x).mod(g));return x}var o=r.constructor.clone({precision:r.toFixed(0).length*2});r=new o(r);for(var u=0,c=r.sub(1);c.mod(2).eq(0);)c=c.div(2),u+=1;var l=null;if(r.lt("3317044064679887385961981"))l=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter(v=>v<r);else{var s=Math.min(r.toNumber()-2,Math.floor(2*Math.pow(r.toFixed(0).length*Math.log(10),2)));l=[];for(var f=2;f<=s;f+=1)l.push(s)}for(var p=0;p<l.length;p+=1){var m=l[p],d=a(r.sub(r).add(m),c,r);if(!d.eq(1)){for(var h=0,w=d;!w.eq(r.sub(1));h+=1,w=w.mul(w).mod(r))if(h===u-1)return!1}}return!0},"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),aM="numeric",oM=["number","?bignumber","?fraction"],sM=U(aM,oM,e=>{var{number:t,bignumber:r,fraction:n}=e,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:o=>t(o),BigNumber:r?o=>r(o):Cl,Fraction:n?o=>n(o):Sy};return function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",c=arguments.length>2?arguments[2]:void 0;if(c!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var l=dt(o);if(!(l in i))throw new TypeError("Cannot convert "+o+' of type "'+l+'"; valid input types are '+Object.keys(i).join(", "));if(!(u in a))throw new TypeError("Cannot convert "+o+' to type "'+u+'"; valid output types are '+Object.keys(a).join(", "));return u===l?o:a[u](o)}}),Pm="divideScalar",uM=["typed","numeric"],cM=U(Pm,uM,e=>{var{typed:t,numeric:r}=e;return t(Pm,{"number, number":function(n,i){return n/i},"Complex, Complex":function(n,i){return n.div(i)},"BigNumber, BigNumber":function(n,i){return n.div(i)},"Fraction, Fraction":function(n,i){return n.div(i)},"Unit, number | Complex | Fraction | BigNumber | Unit":(n,i)=>n.divide(i),"number | Fraction | Complex | BigNumber, Unit":(n,i)=>i.divideInto(n)})}),Vm="pow",lM=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],fM=U(Vm,lM,e=>{var{typed:t,config:r,identity:n,multiply:i,matrix:a,inv:o,number:u,fraction:c,Complex:l}=e;return t(Vm,{"number, number":s,"Complex, Complex":function(m,d){return m.pow(d)},"BigNumber, BigNumber":function(m,d){return d.isInteger()||m>=0||r.predictable?m.pow(d):new l(m.toNumber(),0).pow(d.toNumber(),0)},"Fraction, Fraction":function(m,d){var h=m.pow(d);if(h!=null)return h;if(r.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return s(m.valueOf(),d.valueOf())},"Array, number":f,"Array, BigNumber":function(m,d){return f(m,d.toNumber())},"Matrix, number":p,"Matrix, BigNumber":function(m,d){return p(m,d.toNumber())},"Unit, number | BigNumber":function(m,d){return m.pow(d)}});function s(m,d){if(r.predictable&&!Fe(d)&&m<0)try{var h=c(d),w=u(h);if((d===w||Math.abs((d-w)/d)<1e-14)&&h.d%2===1)return(h.n%2===0?1:-1)*Math.pow(-m,d)}catch{}return r.predictable&&(m<-1&&d===1/0||m>-1&&m<0&&d===-1/0)?NaN:Fe(d)||m>=0||r.predictable?Rv(m,d):m*m<1&&d===1/0||m*m>1&&d===-1/0?0:new l(m,0).pow(d,0)}function f(m,d){if(!Fe(d))throw new TypeError("For A^b, b must be an integer (value is "+d+")");var h=Ve(m);if(h.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+h.length+" dimensions)");if(h[0]!==h[1])throw new Error("For A^b, A must be square (size is "+h[0]+"x"+h[1]+")");if(d<0)try{return f(o(m),-d)}catch(b){throw b.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 "+d+")"):b}for(var w=n(h[0]).valueOf(),v=m;d>=1;)(d&1)===1&&(w=i(v,w)),d>>=1,v=i(v,v);return w}function p(m,d){return a(f(m.valueOf(),d))}}),Xi="Number of decimals in function round must be an integer",Um="round",pM=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],mM=U(Um,pM,e=>{var{typed:t,config:r,matrix:n,equalScalar:i,zeros:a,BigNumber:o,DenseMatrix:u}=e,c=Jt({typed:t,equalScalar:i}),l=It({typed:t,DenseMatrix:u}),s=Jr({typed:t});function f(p){return Math.abs(bo(p).exponent)}return t(Um,{number:function(p){var m=Ua(p,f(r.epsilon)),d=sr(p,m,r.epsilon)?m:p;return Ua(d)},"number, number":function(p,m){var d=f(r.epsilon);if(m>=d)return Ua(p,m);var h=Ua(p,d),w=sr(p,h,r.epsilon)?h:p;return Ua(w,m)},"number, BigNumber":function(p,m){if(!m.isInteger())throw new TypeError(Xi);return new o(p).toDecimalPlaces(m.toNumber())},Complex:function(p){return p.round()},"Complex, number":function(p,m){if(m%1)throw new TypeError(Xi);return p.round(m)},"Complex, BigNumber":function(p,m){if(!m.isInteger())throw new TypeError(Xi);var d=m.toNumber();return p.round(d)},BigNumber:function(p){var m=new o(p).toDecimalPlaces(f(r.epsilon)),d=Tr(p,m,r.epsilon)?m:p;return d.toDecimalPlaces(0)},"BigNumber, BigNumber":function(p,m){if(!m.isInteger())throw new TypeError(Xi);var d=f(r.epsilon);if(m>=d)return p.toDecimalPlaces(m.toNumber());var h=p.toDecimalPlaces(d),w=Tr(p,h,r.epsilon)?h:p;return w.toDecimalPlaces(m.toNumber())},Fraction:function(p){return p.round()},"Fraction, number":function(p,m){if(m%1)throw new TypeError(Xi);return p.round(m)},"Fraction, BigNumber":function(p,m){if(!m.isInteger())throw new TypeError(Xi);return p.round(m.toNumber())},"Unit, number, Unit":t.referToSelf(p=>function(m,d,h){var w=m.toNumeric(h);return h.multiply(p(w,d))}),"Unit, BigNumber, Unit":t.referToSelf(p=>(m,d,h)=>p(m,d.toNumber(),h)),"Unit, Unit":t.referToSelf(p=>(m,d)=>p(m,0,d)),"Array | Matrix, number, Unit":t.referToSelf(p=>(m,d,h)=>Qe(m,w=>p(w,d,h))),"Array | Matrix, BigNumber, Unit":t.referToSelf(p=>(m,d,h)=>p(m,d.toNumber(),h)),"Array | Matrix, Unit":t.referToSelf(p=>(m,d)=>p(m,0,d)),"Array | Matrix":t.referToSelf(p=>m=>Qe(m,p)),"SparseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>c(m,d,p,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>s(m,d,p,!1)),"Array, number | BigNumber":t.referToSelf(p=>(m,d)=>s(n(m),d,p,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":t.referToSelf(p=>(m,d)=>i(m,0)?a(d.size(),d.storage()):l(d,m,p,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":t.referToSelf(p=>(m,d)=>i(m,0)?a(d.size(),d.storage()):s(d,m,p,!0)),"number | Complex | BigNumber | Fraction, Array":t.referToSelf(p=>(m,d)=>s(n(d),m,p,!0).valueOf())})}),$m="log",dM=["config","typed","divideScalar","Complex"],hM=U($m,dM,e=>{var{typed:t,config:r,divideScalar:n,Complex:i}=e;return t($m,{number:function(a){return a>=0||r.predictable?mD(a):new i(a,0).log()},Complex:function(a){return a.log()},BigNumber:function(a){return!a.isNegative()||r.predictable?a.ln():new i(a.toNumber(),0).log()},"any, any":t.referToSelf(a=>(o,u)=>n(a(o),a(u)))})}),Hm="log1p",gM=["typed","config","divideScalar","log","Complex"],vM=U(Hm,gM,e=>{var{typed:t,config:r,divideScalar:n,log:i,Complex:a}=e;return t(Hm,{number:function(u){return u>=-1||r.predictable?lN(u):o(new a(u,0))},Complex:o,BigNumber:function(u){var c=u.plus(1);return!c.isNegative()||r.predictable?c.ln():o(new a(u.toNumber(),0))},"Array | Matrix":t.referToSelf(u=>c=>Qe(c,u)),"any, any":t.referToSelf(u=>(c,l)=>n(u(c),i(l)))});function o(u){var c=u.re+1;return new a(Math.log(Math.sqrt(c*c+u.im*u.im)),Math.atan2(u.im,c))}}),Jm="nthRoots",yM=["config","typed","divideScalar","Complex"],xM=U(Jm,yM,e=>{var{typed:t,config:r,divideScalar:n,Complex:i}=e,a=[function(u){return new i(u,0)},function(u){return new i(0,u)},function(u){return new i(-u,0)},function(u){return new i(0,-u)}];function o(u,c){if(c<0)throw new Error("Root must be greater than zero");if(c===0)throw new Error("Root must be non-zero");if(c%1!==0)throw new Error("Root must be an integer");if(u===0||u.abs()===0)return[new i(0,0)];var l=typeof u=="number",s;(l||u.re===0||u.im===0)&&(l?s=2*+(u<0):u.im===0?s=2*+(u.re<0):s=2*+(u.im<0)+1);for(var f=u.arg(),p=u.abs(),m=[],d=Math.pow(p,1/c),h=0;h<c;h++){var w=(s+4*h)/c;if(w===Math.round(w)){m.push(a[w%4](d));continue}m.push(new i({r:d,phi:(f+2*Math.PI*h)/c}))}return m}return t(Jm,{Complex:function(u){return o(u,2)},"Complex, number":o})}),Gm="dotPow",bM=["typed","equalScalar","matrix","pow","DenseMatrix","concat"],wM=U(Gm,bM,e=>{var{typed:t,equalScalar:r,matrix:n,pow:i,DenseMatrix:a,concat:o}=e,u=cr({typed:t}),c=cn({typed:t,DenseMatrix:a}),l=Jt({typed:t,equalScalar:r}),s=It({typed:t,DenseMatrix:a}),f=gt({typed:t,matrix:n,concat:o}),p={};for(var m in i.signatures)Object.prototype.hasOwnProperty.call(i.signatures,m)&&!m.includes("Matrix")&&!m.includes("Array")&&(p[m]=i.signatures[m]);var d=t(p);return t(Gm,f({elop:d,SS:c,DS:u,Ss:l,sS:s}))}),Wm="dotDivide",NM=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],DM=U(Wm,NM,e=>{var{typed:t,matrix:r,equalScalar:n,divideScalar:i,DenseMatrix:a,concat:o}=e,u=Gr({typed:t,equalScalar:n}),c=cr({typed:t}),l=cn({typed:t,DenseMatrix:a}),s=Jt({typed:t,equalScalar:n}),f=It({typed:t,DenseMatrix:a}),p=gt({typed:t,matrix:r,concat:o});return t(Wm,p({elop:i,SS:l,DS:c,SD:u,Ss:s,sS:f}))});function Do(e){var{DenseMatrix:t}=e;return function(r,n,i){var a=r.size();if(a.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+Ge(a)+")");var o=a[0],u=a[1];if(o!==u)throw new RangeError("Matrix must be square (size: "+Ge(a)+")");var c=[];if(ke(n)){var l=n.size(),s=n._data;if(l.length===1){if(l[0]!==o)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var f=0;f<o;f++)c[f]=[s[f]];return new t({data:c,size:[o,1],datatype:n._datatype})}if(l.length===2){if(l[0]!==o||l[1]!==1)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");if(Ms(n)){if(i){c=[];for(var p=0;p<o;p++)c[p]=[s[p][0]];return new t({data:c,size:[o,1],datatype:n._datatype})}return n}if(wi(n)){for(var m=0;m<o;m++)c[m]=[0];for(var d=n._values,h=n._index,w=n._ptr,v=w[1],b=w[0];b<v;b++){var g=h[b];c[g][0]=d[b]}return new t({data:c,size:[o,1],datatype:n._datatype})}}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}if(st(n)){var x=Ve(n);if(x.length===1){if(x[0]!==o)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var y=0;y<o;y++)c[y]=[n[y]];return new t({data:c,size:[o,1]})}if(x.length===2){if(x[0]!==o||x[1]!==1)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var N=0;N<o;N++)c[N]=[n[N][0]];return new t({data:c,size:[o,1]})}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}}}var Km="lsolve",EM=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],AM=U(Km,EM,e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:u}=e,c=Do({DenseMatrix:u});return t(Km,{"SparseMatrix, Array | Matrix":function(f,p){return s(f,p)},"DenseMatrix, Array | Matrix":function(f,p){return l(f,p)},"Array, Array | Matrix":function(f,p){var m=r(f),d=l(m,p);return d.valueOf()}});function l(f,p){p=c(f,p,!0);for(var m=p._data,d=f._size[0],h=f._size[1],w=[],v=f._data,b=0;b<h;b++){var g=m[b][0]||0,x=void 0;if(o(g,0))x=0;else{var y=v[b][b];if(o(y,0))throw new Error("Linear system cannot be solved since matrix is singular");x=n(g,y);for(var N=b+1;N<d;N++)m[N]=[a(m[N][0]||0,i(x,v[N][b]))]}w[b]=[x]}return new u({data:w,size:[d,1]})}function s(f,p){p=c(f,p,!0);for(var m=p._data,d=f._size[0],h=f._size[1],w=f._values,v=f._index,b=f._ptr,g=[],x=0;x<h;x++){var y=m[x][0]||0;if(o(y,0))g[x]=[0];else{for(var N=0,E=[],A=[],D=b[x],S=b[x+1],C=D;C<S;C++){var _=v[C];_===x?N=w[C]:_>x&&(E.push(w[C]),A.push(_))}if(o(N,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var R=n(y,N),P=0,I=A.length;P<I;P++){var O=A[P];m[O]=[a(m[O][0]||0,i(R,E[P]))]}g[x]=[R]}}return new u({data:g,size:[d,1]})}}),Qm="usolve",SM=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],CM=U(Qm,SM,e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:u}=e,c=Do({DenseMatrix:u});return t(Qm,{"SparseMatrix, Array | Matrix":function(f,p){return s(f,p)},"DenseMatrix, Array | Matrix":function(f,p){return l(f,p)},"Array, Array | Matrix":function(f,p){var m=r(f),d=l(m,p);return d.valueOf()}});function l(f,p){p=c(f,p,!0);for(var m=p._data,d=f._size[0],h=f._size[1],w=[],v=f._data,b=h-1;b>=0;b--){var g=m[b][0]||0,x=void 0;if(o(g,0))x=0;else{var y=v[b][b];if(o(y,0))throw new Error("Linear system cannot be solved since matrix is singular");x=n(g,y);for(var N=b-1;N>=0;N--)m[N]=[a(m[N][0]||0,i(x,v[N][b]))]}w[b]=[x]}return new u({data:w,size:[d,1]})}function s(f,p){p=c(f,p,!0);for(var m=p._data,d=f._size[0],h=f._size[1],w=f._values,v=f._index,b=f._ptr,g=[],x=h-1;x>=0;x--){var y=m[x][0]||0;if(o(y,0))g[x]=[0];else{for(var N=0,E=[],A=[],D=b[x],S=b[x+1],C=S-1;C>=D;C--){var _=v[C];_===x?N=w[C]:_<x&&(E.push(w[C]),A.push(_))}if(o(N,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var R=n(y,N),P=0,I=A.length;P<I;P++){var O=A[P];m[O]=[a(m[O][0],i(R,E[P]))]}g[x]=[R]}}return new u({data:g,size:[d,1]})}}),Zm="lsolveAll",MM=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],_M=U(Zm,MM,e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:u}=e,c=Do({DenseMatrix:u});return t(Zm,{"SparseMatrix, Array | Matrix":function(f,p){return s(f,p)},"DenseMatrix, Array | Matrix":function(f,p){return l(f,p)},"Array, Array | Matrix":function(f,p){var m=r(f),d=l(m,p);return d.map(h=>h.valueOf())}});function l(f,p){for(var m=[c(f,p,!0)._data.map(A=>A[0])],d=f._data,h=f._size[0],w=f._size[1],v=0;v<w;v++)for(var b=m.length,g=0;g<b;g++){var x=m[g];if(o(d[v][v],0))if(o(x[v],0)){if(g===0){var y=[...x];y[v]=1;for(var N=v+1;N<w;N++)y[N]=a(y[N],d[N][v]);m.push(y)}}else{if(g===0)return[];m.splice(g,1),g-=1,b-=1}else{x[v]=n(x[v],d[v][v]);for(var E=v+1;E<w;E++)x[E]=a(x[E],i(x[v],d[E][v]))}}return m.map(A=>new u({data:A.map(D=>[D]),size:[h,1]}))}function s(f,p){for(var m=[c(f,p,!0)._data.map(se=>se[0])],d=f._size[0],h=f._size[1],w=f._values,v=f._index,b=f._ptr,g=0;g<h;g++)for(var x=m.length,y=0;y<x;y++){for(var N=m[y],E=[],A=[],D=b[g],S=b[g+1],C=0,_=D;_<S;_++){var R=v[_];R===g?C=w[_]:R>g&&(E.push(w[_]),A.push(R))}if(o(C,0))if(o(N[g],0)){if(y===0){var P=[...N];P[g]=1;for(var I=0,O=A.length;I<O;I++){var F=A[I];P[F]=a(P[F],E[I])}m.push(P)}}else{if(y===0)return[];m.splice(y,1),y-=1,x-=1}else{N[g]=n(N[g],C);for(var q=0,k=A.length;q<k;q++){var te=A[q];N[te]=a(N[te],i(N[g],E[q]))}}}return m.map(se=>new u({data:se.map(K=>[K]),size:[d,1]}))}}),Xm="usolveAll",FM=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],TM=U(Xm,FM,e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:u}=e,c=Do({DenseMatrix:u});return t(Xm,{"SparseMatrix, Array | Matrix":function(f,p){return s(f,p)},"DenseMatrix, Array | Matrix":function(f,p){return l(f,p)},"Array, Array | Matrix":function(f,p){var m=r(f),d=l(m,p);return d.map(h=>h.valueOf())}});function l(f,p){for(var m=[c(f,p,!0)._data.map(A=>A[0])],d=f._data,h=f._size[0],w=f._size[1],v=w-1;v>=0;v--)for(var b=m.length,g=0;g<b;g++){var x=m[g];if(o(d[v][v],0))if(o(x[v],0)){if(g===0){var y=[...x];y[v]=1;for(var N=v-1;N>=0;N--)y[N]=a(y[N],d[N][v]);m.push(y)}}else{if(g===0)return[];m.splice(g,1),g-=1,b-=1}else{x[v]=n(x[v],d[v][v]);for(var E=v-1;E>=0;E--)x[E]=a(x[E],i(x[v],d[E][v]))}}return m.map(A=>new u({data:A.map(D=>[D]),size:[h,1]}))}function s(f,p){for(var m=[c(f,p,!0)._data.map(se=>se[0])],d=f._size[0],h=f._size[1],w=f._values,v=f._index,b=f._ptr,g=h-1;g>=0;g--)for(var x=m.length,y=0;y<x;y++){for(var N=m[y],E=[],A=[],D=b[g],S=b[g+1],C=0,_=S-1;_>=D;_--){var R=v[_];R===g?C=w[_]:R<g&&(E.push(w[_]),A.push(R))}if(o(C,0))if(o(N[g],0)){if(y===0){var P=[...N];P[g]=1;for(var I=0,O=A.length;I<O;I++){var F=A[I];P[F]=a(P[F],E[I])}m.push(P)}}else{if(y===0)return[];m.splice(y,1),y-=1,x-=1}else{N[g]=n(N[g],C);for(var q=0,k=A.length;q<k;q++){var te=A[q];N[te]=a(N[te],i(N[g],E[q]))}}}return m.map(se=>new u({data:se.map(K=>[K]),size:[d,1]}))}}),OM="matAlgo08xS0Sid",BM=["typed","equalScalar"],Ml=U(OM,BM,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a){var o=n._values,u=n._index,c=n._ptr,l=n._size,s=n._datatype||n._data===void 0?n._datatype:n.getDataType(),f=i._values,p=i._index,m=i._ptr,d=i._size,h=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==d.length)throw new Ke(l.length,d.length);if(l[0]!==d[0]||l[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+d+")");if(!o||!f)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var w=l[0],v=l[1],b,g=r,x=0,y=a;typeof s=="string"&&s===h&&s!=="mixed"&&(b=s,g=t.find(r,[b,b]),x=t.convert(0,b),y=t.find(a,[b,b]));for(var N=[],E=[],A=[],D=[],S=[],C,_,R,P,I=0;I<v;I++){A[I]=E.length;var O=I+1;for(_=c[I],R=c[I+1],C=_;C<R;C++)P=u[C],S[P]=O,D[P]=o[C],E.push(P);for(_=m[I],R=m[I+1],C=_;C<R;C++)P=p[C],S[P]===O&&(D[P]=y(D[P],f[C]));for(C=A[I];C<E.length;){P=E[C];var F=D[P];g(F,x)?E.splice(C,1):(N.push(F),C++)}}return A[v]=E.length,n.createSparseMatrix({values:N,index:E,ptr:A,size:[w,v],datatype:s===n._datatype&&h===i._datatype?b:void 0})}}),_l=U("useMatrixForArrayScalar",["typed","matrix"],e=>{var{typed:t,matrix:r}=e;return{"Array, number":t.referTo("DenseMatrix, number",n=>(i,a)=>n(r(i),a).valueOf()),"Array, BigNumber":t.referTo("DenseMatrix, BigNumber",n=>(i,a)=>n(r(i),a).valueOf()),"number, Array":t.referTo("number, DenseMatrix",n=>(i,a)=>n(i,r(a)).valueOf()),"BigNumber, Array":t.referTo("BigNumber, DenseMatrix",n=>(i,a)=>n(i,r(a)).valueOf())}}),Ym="leftShift",kM=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],IM=U(Ym,kM,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e,u=ii({typed:t}),c=Gr({typed:t,equalScalar:n}),l=Ml({typed:t,equalScalar:n}),s=zi({typed:t,DenseMatrix:a}),f=Jt({typed:t,equalScalar:n}),p=Jr({typed:t}),m=gt({typed:t,matrix:r,concat:o}),d=_l({typed:t,matrix:r});return t(Ym,{"number, number":Pv,"BigNumber, BigNumber":tS,"SparseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():f(w,v,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():p(w,v,h,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):s(v,w,h,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):p(v,w,h,!0))},d,m({SS:l,DS:u,SD:c}))}),ed="rightArithShift",RM=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],qM=U(ed,RM,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e,u=ii({typed:t}),c=Gr({typed:t,equalScalar:n}),l=Ml({typed:t,equalScalar:n}),s=zi({typed:t,DenseMatrix:a}),f=Jt({typed:t,equalScalar:n}),p=Jr({typed:t}),m=gt({typed:t,matrix:r,concat:o}),d=_l({typed:t,matrix:r});return t(ed,{"number, number":Vv,"BigNumber, BigNumber":rS,"SparseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():f(w,v,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():p(w,v,h,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):s(v,w,h,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):p(v,w,h,!0))},d,m({SS:l,DS:u,SD:c}))}),td="rightLogShift",zM=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],jM=U(td,zM,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e,u=ii({typed:t}),c=Gr({typed:t,equalScalar:n}),l=Ml({typed:t,equalScalar:n}),s=zi({typed:t,DenseMatrix:a}),f=Jt({typed:t,equalScalar:n}),p=Jr({typed:t}),m=gt({typed:t,matrix:r,concat:o}),d=_l({typed:t,matrix:r});return t(td,{"number, number":Uv,"SparseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():f(w,v,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():p(w,v,h,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):s(v,w,h,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):p(v,w,h,!0))},d,m({SS:l,DS:u,SD:c}))}),rd="and",LM=["typed","matrix","equalScalar","zeros","not","concat"],By=U(rd,LM,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o}=e,u=Gr({typed:t,equalScalar:n}),c=Nu({typed:t,equalScalar:n}),l=Jt({typed:t,equalScalar:n}),s=Jr({typed:t}),f=gt({typed:t,matrix:r,concat:o});return t(rd,{"number, number":Wv,"Complex, Complex":function(p,m){return(p.re!==0||p.im!==0)&&(m.re!==0||m.im!==0)},"BigNumber, BigNumber":function(p,m){return!p.isZero()&&!m.isZero()&&!p.isNaN()&&!m.isNaN()},"Unit, Unit":t.referToSelf(p=>(m,d)=>p(m.value||0,d.value||0)),"SparseMatrix, any":t.referToSelf(p=>(m,d)=>a(d)?i(m.size(),m.storage()):l(m,d,p,!1)),"DenseMatrix, any":t.referToSelf(p=>(m,d)=>a(d)?i(m.size(),m.storage()):s(m,d,p,!1)),"any, SparseMatrix":t.referToSelf(p=>(m,d)=>a(m)?i(m.size(),m.storage()):l(d,m,p,!0)),"any, DenseMatrix":t.referToSelf(p=>(m,d)=>a(m)?i(m.size(),m.storage()):s(d,m,p,!0)),"Array, any":t.referToSelf(p=>(m,d)=>p(r(m),d).valueOf()),"any, Array":t.referToSelf(p=>(m,d)=>p(m,r(d)).valueOf())},f({SS:c,DS:u}))}),Vs="compare",PM=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],VM=U(Vs,PM,e=>{var{typed:t,config:r,equalScalar:n,matrix:i,BigNumber:a,Fraction:o,DenseMatrix:u,concat:c}=e,l=cr({typed:t}),s=wu({typed:t,equalScalar:n}),f=It({typed:t,DenseMatrix:u}),p=gt({typed:t,matrix:i,concat:c}),m=Sa({typed:t});return t(Vs,UM({typed:t,config:r}),{"boolean, boolean":function(d,h){return d===h?0:d>h?1:-1},"BigNumber, BigNumber":function(d,h){return Tr(d,h,r.epsilon)?new a(0):new a(d.cmp(h))},"Fraction, Fraction":function(d,h){return new o(d.compare(h))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},m,p({SS:s,DS:l,Ss:f}))}),UM=U(Vs,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Vs,{"number, number":function(n,i){return sr(n,i,r.epsilon)?0:n>i?1:-1}})}),$M=function e(t,r){var n=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,i=/(^[ ]*|[ ]*$)/g,a=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,o=/^0x[0-9a-f]+$/i,u=/^0/,c=function(g){return e.insensitive&&(""+g).toLowerCase()||""+g},l=c(t).replace(i,"")||"",s=c(r).replace(i,"")||"",f=l.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),p=s.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=parseInt(l.match(o),16)||f.length!==1&&l.match(a)&&Date.parse(l),d=parseInt(s.match(o),16)||m&&s.match(a)&&Date.parse(s)||null,h,w;if(d){if(m<d)return-1;if(m>d)return 1}for(var v=0,b=Math.max(f.length,p.length);v<b;v++){if(h=!(f[v]||"").match(u)&&parseFloat(f[v])||f[v]||0,w=!(p[v]||"").match(u)&&parseFloat(p[v])||p[v]||0,isNaN(h)!==isNaN(w))return isNaN(h)?1:-1;if(typeof h!=typeof w&&(h+="",w+=""),h<w)return-1;if(h>w)return 1}return 0};const Yi=wo($M);var nd="compareNatural",HM=["typed","compare"],JM=U(nd,HM,e=>{var{typed:t,compare:r}=e,n=r.signatures["boolean,boolean"];return t(nd,{"any, any":i});function i(c,l){var s=dt(c),f=dt(l),p;if((s==="number"||s==="BigNumber"||s==="Fraction")&&(f==="number"||f==="BigNumber"||f==="Fraction"))return p=r(c,l),p.toString()!=="0"?p>0?1:-1:Yi(s,f);var m=["Array","DenseMatrix","SparseMatrix"];if(m.includes(s)||m.includes(f))return p=a(i,c,l),p!==0?p:Yi(s,f);if(s!==f)return Yi(s,f);if(s==="Complex")return GM(c,l);if(s==="Unit")return c.equalBase(l)?i(c.value,l.value):o(i,c.formatUnits(),l.formatUnits());if(s==="boolean")return n(c,l);if(s==="string")return Yi(c,l);if(s==="Object")return u(i,c,l);if(s==="null"||s==="undefined")return 0;throw new TypeError('Unsupported type of value "'+s+'"')}function a(c,l,s){return wi(l)&&wi(s)?o(c,l.toJSON().values,s.toJSON().values):wi(l)?a(c,l.toArray(),s):wi(s)?a(c,l,s.toArray()):Ms(l)?a(c,l.toJSON().data,s):Ms(s)?a(c,l,s.toJSON().data):Array.isArray(l)?Array.isArray(s)?o(c,l,s):a(c,l,[s]):a(c,[l],s)}function o(c,l,s){for(var f=0,p=Math.min(l.length,s.length);f<p;f++){var m=c(l[f],s[f]);if(m!==0)return m}return l.length>s.length?1:l.length<s.length?-1:0}function u(c,l,s){var f=Object.keys(l),p=Object.keys(s);f.sort(Yi),p.sort(Yi);var m=o(c,f,p);if(m!==0)return m;for(var d=0;d<f.length;d++){var h=c(l[f[d]],s[p[d]]);if(h!==0)return h}return 0}});function GM(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0}var id="compareText",WM=["typed","matrix","concat"];Ic.signature="any, any";var KM=U(id,WM,e=>{var{typed:t,matrix:r,concat:n}=e,i=gt({typed:t,matrix:r,concat:n});return t(id,Ic,i({elop:Ic,Ds:!0}))}),Us="equal",QM=["typed","matrix","equalScalar","DenseMatrix","concat"],ZM=U(Us,QM,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=cn({typed:t,DenseMatrix:i}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:r,concat:a});return t(Us,XM({typed:t,equalScalar:n}),l({elop:n,SS:u,DS:o,Ss:c}))}),XM=U(Us,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t(Us,{"any, any":function(n,i){return n===null?i===null:i===null?n===null:n===void 0?i===void 0:i===void 0?n===void 0:r(n,i)}})}),ad="equalText",YM=["typed","compareText","isZero"],e3=U(ad,YM,e=>{var{typed:t,compareText:r,isZero:n}=e;return t(ad,{"any, any":function(i,a){return n(r(i,a))}})}),$s="smaller",t3=["typed","config","matrix","DenseMatrix","concat"],r3=U($s,t3,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=cn({typed:t,DenseMatrix:i}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:n,concat:a}),s=Sa({typed:t});return t($s,n3({typed:t,config:r}),{"boolean, boolean":(f,p)=>f<p,"BigNumber, BigNumber":function(f,p){return f.lt(p)&&!Tr(f,p,r.epsilon)},"Fraction, Fraction":(f,p)=>f.compare(p)===-1,"Complex, Complex":function(f,p){throw new TypeError("No ordering relation is defined for complex numbers")}},s,l({SS:u,DS:o,Ss:c}))}),n3=U($s,["typed","config"],e=>{var{typed:t,config:r}=e;return t($s,{"number, number":function(n,i){return n<i&&!sr(n,i,r.epsilon)}})}),Hs="smallerEq",i3=["typed","config","matrix","DenseMatrix","concat"],a3=U(Hs,i3,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=cn({typed:t,DenseMatrix:i}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:n,concat:a}),s=Sa({typed:t});return t(Hs,o3({typed:t,config:r}),{"boolean, boolean":(f,p)=>f<=p,"BigNumber, BigNumber":function(f,p){return f.lte(p)||Tr(f,p,r.epsilon)},"Fraction, Fraction":(f,p)=>f.compare(p)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},s,l({SS:u,DS:o,Ss:c}))}),o3=U(Hs,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Hs,{"number, number":function(n,i){return n<=i||sr(n,i,r.epsilon)}})}),Js="larger",s3=["typed","config","matrix","DenseMatrix","concat"],u3=U(Js,s3,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=cn({typed:t,DenseMatrix:i}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:n,concat:a}),s=Sa({typed:t});return t(Js,c3({typed:t,config:r}),{"boolean, boolean":(f,p)=>f>p,"BigNumber, BigNumber":function(f,p){return f.gt(p)&&!Tr(f,p,r.epsilon)},"Fraction, Fraction":(f,p)=>f.compare(p)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},s,l({SS:u,DS:o,Ss:c}))}),c3=U(Js,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Js,{"number, number":function(n,i){return n>i&&!sr(n,i,r.epsilon)}})}),Gs="largerEq",l3=["typed","config","matrix","DenseMatrix","concat"],f3=U(Gs,l3,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=cn({typed:t,DenseMatrix:i}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:n,concat:a}),s=Sa({typed:t});return t(Gs,p3({typed:t,config:r}),{"boolean, boolean":(f,p)=>f>=p,"BigNumber, BigNumber":function(f,p){return f.gte(p)||Tr(f,p,r.epsilon)},"Fraction, Fraction":(f,p)=>f.compare(p)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},s,l({SS:u,DS:o,Ss:c}))}),p3=U(Gs,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Gs,{"number, number":function(n,i){return n>=i||sr(n,i,r.epsilon)}})}),od="deepEqual",m3=["typed","equal"],d3=U(od,m3,e=>{var{typed:t,equal:r}=e;return t(od,{"any, any":function(i,a){return n(i.valueOf(),a.valueOf())}});function n(i,a){if(Array.isArray(i))if(Array.isArray(a)){var o=i.length;if(o!==a.length)return!1;for(var u=0;u<o;u++)if(!n(i[u],a[u]))return!1;return!0}else return!1;else return Array.isArray(a)?!1:r(i,a)}}),Ws="unequal",h3=["typed","config","equalScalar","matrix","DenseMatrix","concat"],g3=U(Ws,h3,e=>{var{typed:t,config:r,equalScalar:n,matrix:i,DenseMatrix:a,concat:o}=e,u=cr({typed:t}),c=cn({typed:t,DenseMatrix:a}),l=It({typed:t,DenseMatrix:a}),s=gt({typed:t,matrix:i,concat:o});return t(Ws,v3({typed:t,equalScalar:n}),s({elop:f,SS:c,DS:u,Ss:l}));function f(p,m){return!n(p,m)}}),v3=U(Ws,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t(Ws,{"any, any":function(n,i){return n===null?i!==null:i===null?n!==null:n===void 0?i!==void 0:i===void 0?n!==void 0:!r(n,i)}})}),sd="partitionSelect",y3=["typed","isNumeric","isNaN","compare"],x3=U(sd,y3,e=>{var{typed:t,isNumeric:r,isNaN:n,compare:i}=e,a=i,o=(l,s)=>-i(l,s);return t(sd,{"Array | Matrix, number":function(l,s){return u(l,s,a)},"Array | Matrix, number, string":function(l,s,f){if(f==="asc")return u(l,s,a);if(f==="desc")return u(l,s,o);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":u});function u(l,s,f){if(!Fe(s)||s<0)throw new Error("k must be a non-negative integer");if(ke(l)){var p=l.size();if(p.length>1)throw new Error("Only one dimensional matrices supported");return c(l.valueOf(),s,f)}if(Array.isArray(l))return c(l,s,f)}function c(l,s,f){if(s>=l.length)throw new Error("k out of bounds");for(var p=0;p<l.length;p++)if(r(l[p])&&n(l[p]))return l[p];for(var m=0,d=l.length-1;m<d;){for(var h=m,w=d,v=l[Math.floor(Math.random()*(d-m+1))+m];h<w;)if(f(l[h],v)>=0){var b=l[w];l[w]=l[h],l[h]=b,--w}else++h;f(l[h],v)>0&&--h,s<=h?d=h:m=h+1}return l[s]}}),ud="sort",b3=["typed","matrix","compare","compareNatural"],w3=U(ud,b3,e=>{var{typed:t,matrix:r,compare:n,compareNatural:i}=e,a=n,o=(s,f)=>-n(s,f);return t(ud,{Array:function(s){return c(s),s.sort(a)},Matrix:function(s){return l(s),r(s.toArray().sort(a),s.storage())},"Array, function":function(s,f){return c(s),s.sort(f)},"Matrix, function":function(s,f){return l(s),r(s.toArray().sort(f),s.storage())},"Array, string":function(s,f){return c(s),s.sort(u(f))},"Matrix, string":function(s,f){return l(s),r(s.toArray().sort(u(f)),s.storage())}});function u(s){if(s==="asc")return a;if(s==="desc")return o;if(s==="natural")return i;throw new Error('String "asc", "desc", or "natural" expected')}function c(s){if(Ve(s).length!==1)throw new Error("One dimensional array expected")}function l(s){if(s.size().length!==1)throw new Error("One dimensional matrix expected")}}),cd="max",N3=["typed","config","numeric","larger"],ky=U(cd,N3,e=>{var{typed:t,config:r,numeric:n,larger:i}=e;return t(cd,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(u,c){return xu(u,c.valueOf(),a)},"...":function(u){if(Da(u))throw new TypeError("Scalar values expected in function max");return o(u)}});function a(u,c){try{return i(u,c)?u:c}catch(l){throw ur(l,"max",c)}}function o(u){var c;if(Sn(u,function(l){try{isNaN(l)&&typeof l=="number"?c=NaN:(c===void 0||i(l,c))&&(c=l)}catch(s){throw ur(s,"max",l)}}),c===void 0)throw new Error("Cannot calculate max of an empty array");return typeof c=="string"&&(c=n(c,r.number)),c}}),ld="min",D3=["typed","config","numeric","smaller"],Iy=U(ld,D3,e=>{var{typed:t,config:r,numeric:n,smaller:i}=e;return t(ld,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(u,c){return xu(u,c.valueOf(),a)},"...":function(u){if(Da(u))throw new TypeError("Scalar values expected in function min");return o(u)}});function a(u,c){try{return i(u,c)?u:c}catch(l){throw ur(l,"min",c)}}function o(u){var c;if(Sn(u,function(l){try{isNaN(l)&&typeof l=="number"?c=NaN:(c===void 0||i(l,c))&&(c=l)}catch(s){throw ur(s,"min",l)}}),c===void 0)throw new Error("Cannot calculate min of an empty array");return typeof c=="string"&&(c=n(c,r.number)),c}}),E3="ImmutableDenseMatrix",A3=["smaller","DenseMatrix"],S3=U(E3,A3,e=>{var{smaller:t,DenseMatrix:r}=e;function n(i,a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(a&&!Qt(a))throw new Error("Invalid datatype: "+a);if(ke(i)||st(i)){var o=new r(i,a);this._data=o._data,this._size=o._size,this._datatype=o._datatype,this._min=null,this._max=null}else if(i&&st(i.data)&&st(i.size))this._data=i.data,this._size=i.size,this._datatype=i.datatype,this._min=typeof i.min<"u"?i.min:null,this._max=typeof i.max<"u"?i.max:null;else{if(i)throw new TypeError("Unsupported type of data ("+dt(i)+")");this._data=[],this._size=[0],this._datatype=a,this._min=null,this._max=null}}return n.prototype=new r,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(i){switch(arguments.length){case 1:{var a=r.prototype.subset.call(this,i);return ke(a)?new n({data:a._data,size:a._size,datatype:a._datatype}):a}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:ze(this._data),size:ze(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(i){return new n(i)},n.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(this._min===null){var i=null;this.forEach(function(a){(i===null||t(a,i))&&(i=a)}),this._min=i!==null?i:void 0}return this._min},n.prototype.max=function(){if(this._max===null){var i=null;this.forEach(function(a){(i===null||t(i,a))&&(i=a)}),this._max=i!==null?i:void 0}return this._max},n},{isClass:!0}),C3="Index",M3=["ImmutableDenseMatrix","getMatrixDataType"],_3=U(C3,M3,e=>{var{ImmutableDenseMatrix:t,getMatrixDataType:r}=e;function n(a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var o=0,u=arguments.length;o<u;o++){var c=arguments[o],l=st(c),s=ke(c),f=null;if(yl(c))this._dimensions.push(c),this._isScalar=!1;else if(l||s){var p=void 0;r(c)==="boolean"?(l&&(p=i(fd(c).valueOf())),s&&(p=i(fd(c._data).valueOf())),f=c.valueOf().length):p=i(c.valueOf()),this._dimensions.push(p);var m=p.size();(m.length!==1||m[0]!==1||f!==null)&&(this._isScalar=!1)}else if(typeof c=="number")this._dimensions.push(i([c]));else if(typeof c=="string")this._dimensions.push(c);else throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");this._sourceSize.push(f)}}n.prototype.type="Index",n.prototype.isIndex=!0;function i(a){for(var o=0,u=a.length;o<u;o++)if(typeof a[o]!="number"||!Fe(a[o]))throw new TypeError("Index parameters must be positive integer numbers");return new t(a)}return n.prototype.clone=function(){var a=new n;return a._dimensions=ze(this._dimensions),a._isScalar=this._isScalar,a._sourceSize=this._sourceSize,a},n.create=function(a){var o=new n;return n.apply(o,a),o},n.prototype.size=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var c=this._dimensions[o];a[o]=typeof c=="string"?1:c.size()[0]}return a},n.prototype.max=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var c=this._dimensions[o];a[o]=typeof c=="string"?c:c.max()}return a},n.prototype.min=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var c=this._dimensions[o];a[o]=typeof c=="string"?c:c.min()}return a},n.prototype.forEach=function(a){for(var o=0,u=this._dimensions.length;o<u;o++)a(this._dimensions[o],o,this)},n.prototype.dimension=function(a){return this._dimensions[a]||null},n.prototype.isObjectProperty=function(){return this._dimensions.length===1&&typeof this._dimensions[0]=="string"},n.prototype.getObjectProperty=function(){return this.isObjectProperty()?this._dimensions[0]:null},n.prototype.isScalar=function(){return this._isScalar},n.prototype.toArray=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var c=this._dimensions[o];a.push(typeof c=="string"?c:c.toArray())}return a},n.prototype.valueOf=n.prototype.toArray,n.prototype.toString=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var c=this._dimensions[o];typeof c=="string"?a.push(JSON.stringify(c)):a.push(c.toString())}return"["+a.join(", ")+"]"},n.prototype.toJSON=function(){return{mathjs:"Index",dimensions:this._dimensions}},n.fromJSON=function(a){return n.create(a.dimensions)},n},{isClass:!0});function fd(e){var t=[];return e.forEach((r,n)=>{r&&t.push(n)}),t}var F3="FibonacciHeap",T3=["smaller","larger"],O3=U(F3,T3,e=>{var{smaller:t,larger:r}=e,n=1/Math.log((1+Math.sqrt(5))/2);function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(s,f){var p={key:s,value:f,degree:0};if(this._minimum){var m=this._minimum;p.left=m,p.right=m.right,m.right=p,p.right.left=p,t(s,m.key)&&(this._minimum=p)}else p.left=p,p.right=p,this._minimum=p;return this._size++,p},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return this._size===0},i.prototype.extractMinimum=function(){var s=this._minimum;if(s===null)return s;for(var f=this._minimum,p=s.degree,m=s.child;p>0;){var d=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=d,p--}return s.left.right=s.right,s.right.left=s.left,s===s.right?f=null:(f=s.right,f=l(f,this._size)),this._size--,this._minimum=f,s},i.prototype.remove=function(s){this._minimum=a(this._minimum,s,-1),this.extractMinimum()};function a(s,f,p){f.key=p;var m=f.parent;return m&&t(f.key,m.key)&&(o(s,f,m),u(s,m)),t(f.key,s.key)&&(s=f),s}function o(s,f,p){f.left.right=f.right,f.right.left=f.left,p.degree--,p.child===f&&(p.child=f.right),p.degree===0&&(p.child=null),f.left=s,f.right=s.right,s.right=f,f.right.left=f,f.parent=null,f.mark=!1}function u(s,f){var p=f.parent;p&&(f.mark?(o(s,f,p),u(p)):f.mark=!0)}var c=function(s,f){s.left.right=s.right,s.right.left=s.left,s.parent=f,f.child?(s.left=f.child,s.right=f.child.right,f.child.right=s,s.right.left=s):(f.child=s,s.right=s,s.left=s),f.degree++,s.mark=!1};function l(s,f){var p=Math.floor(Math.log(f)*n)+1,m=new Array(p),d=0,h=s;if(h)for(d++,h=h.right;h!==s;)d++,h=h.right;for(var w;d>0;){for(var v=h.degree,b=h.right;w=m[v],!!w;){if(r(h.key,w.key)){var g=w;w=h,h=g}c(w,h),m[v]=null,v++}m[v]=h,h=b,d--}s=null;for(var x=0;x<p;x++)w=m[x],w&&(s?(w.left.right=w.right,w.right.left=w.left,w.left=s,w.right=s.right,s.right=w,w.right.left=w,t(w.key,s.key)&&(s=w)):s=w);return s}return i},{isClass:!0}),B3="Spa",k3=["addScalar","equalScalar","FibonacciHeap"],I3=U(B3,k3,e=>{var{addScalar:t,equalScalar:r,FibonacciHeap:n}=e;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(a,o){if(this._values[a])this._values[a].value=o;else{var u=this._heap.insert(a,o);this._values[a]=u}},i.prototype.get=function(a){var o=this._values[a];return o?o.value:0},i.prototype.accumulate=function(a,o){var u=this._values[a];u?u.value=t(u.value,o):(u=this._heap.insert(a,o),this._values[a]=u)},i.prototype.forEach=function(a,o,u){var c=this._heap,l=this._values,s=[],f=c.extractMinimum();for(f&&s.push(f);f&&f.key<=o;)f.key>=a&&(r(f.value,0)||u(f.key,f.value,this)),f=c.extractMinimum(),f&&s.push(f);for(var p=0;p<s.length;p++){var m=s[p];f=c.insert(m.key,m.value),l[f.key]=f}},i.prototype.swap=function(a,o){var u=this._values[a],c=this._values[o];if(!u&&c)u=this._heap.insert(a,c.value),this._heap.remove(c),this._values[a]=u,this._values[o]=void 0;else if(u&&!c)c=this._heap.insert(o,u.value),this._heap.remove(u),this._values[o]=c,this._values[a]=void 0;else if(u&&c){var l=u.value;u.value=c.value,c.value=l}},i},{isClass:!0}),R3=No(function(e){return new e(1).exp()},{hasher:Du}),q3=No(function(e){return new e(1).plus(new e(5).sqrt()).div(2)},{hasher:Du}),Fl=No(function(e){return e.acos(-1)},{hasher:Du}),z3=No(function(e){return Fl(e).times(2)},{hasher:Du});function Du(e){return e[0].precision}function pd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function lc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pd(Object(r),!0).forEach(function(n){Bt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pd(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var j3="Unit",L3=["?on","config","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","abs","fix","round","equal","isNumeric","format","number","Complex","BigNumber","Fraction"],P3=U(j3,L3,e=>{var{on:t,config:r,addScalar:n,subtractScalar:i,multiplyScalar:a,divideScalar:o,pow:u,abs:c,fix:l,round:s,equal:f,isNumeric:p,format:m,number:d,Complex:h,BigNumber:w,Fraction:v}=e,b=d;function g(T,z){if(!(this instanceof g))throw new Error("Constructor must be called with the new operator");if(!(T==null||p(T)||wn(T)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,z===void 0)this.units=[],this.dimensions=q.map(L=>0);else if(typeof z=="string"){var J=g.parse(z);this.units=J.units,this.dimensions=J.dimensions}else if(Cr(z)&&z.value===null)this.fixPrefix=z.fixPrefix,this.skipAutomaticSimplification=z.skipAutomaticSimplification,this.dimensions=z.dimensions.slice(0),this.units=z.units.map(L=>Tt({},L));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(T)}Object.defineProperty(g,"name",{value:"Unit"}),g.prototype.constructor=g,g.prototype.type="Unit",g.prototype.isUnit=!0;var x,y,N;function E(){for(;N===" "||N===" ";)S()}function A(T){return T>="0"&&T<="9"||T==="."}function D(T){return T>="0"&&T<="9"}function S(){y++,N=x.charAt(y)}function C(T){y=T,N=x.charAt(y)}function _(){var T="",z=y;if(N==="+"?S():N==="-"&&(T+=N,S()),!A(N))return C(z),null;if(N==="."){if(T+=N,S(),!D(N))return C(z),null}else{for(;D(N);)T+=N,S();N==="."&&(T+=N,S())}for(;D(N);)T+=N,S();if(N==="E"||N==="e"){var J="",L=y;if(J+=N,S(),(N==="+"||N==="-")&&(J+=N,S()),!D(N))return C(L),T;for(T=T+J;D(N);)T+=N,S()}return T}function R(){for(var T="";D(N)||g.isValidAlpha(N);)T+=N,S();var z=T.charAt(0);return g.isValidAlpha(z)?T:null}function P(T){return N===T?(S(),T):null}g.parse=function(T,z){if(z=z||{},x=T,y=-1,N="",typeof x!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var J=new g;J.units=[];var L=1,H=!1;S(),E();var G=_(),Y=null;if(G){if(r.number==="BigNumber")Y=new w(G);else if(r.number==="Fraction")try{Y=new v(G)}catch{Y=parseFloat(G)}else Y=parseFloat(G);E(),P("*")?(L=1,H=!0):P("/")&&(L=-1,H=!0)}for(var ee=[],B=1;;){for(E();N==="(";)ee.push(L),B*=L,L=1,S(),E();var j=void 0;if(N){var Q=N;if(j=R(),j===null)throw new SyntaxError('Unexpected "'+Q+'" in "'+x+'" at index '+y.toString())}else break;var Z=I(j);if(Z===null)throw new SyntaxError('Unit "'+j+'" not found.');var ie=L*B;if(E(),P("^")){E();var oe=_();if(oe===null)throw new SyntaxError('In "'+T+'", "^" must be followed by a floating-point number');ie*=oe}J.units.push({unit:Z.unit,prefix:Z.prefix,power:ie});for(var ye=0;ye<q.length;ye++)J.dimensions[ye]+=(Z.unit.dimensions[ye]||0)*ie;for(E();N===")";){if(ee.length===0)throw new SyntaxError('Unmatched ")" in "'+x+'" at index '+y.toString());B/=ee.pop(),S(),E()}if(H=!1,P("*")?(L=1,H=!0):P("/")?(L=-1,H=!0):L=1,Z.unit.base){var fe=Z.unit.base.key;re.auto[fe]={unit:Z.unit,prefix:Z.prefix}}}if(E(),N)throw new SyntaxError('Could not parse: "'+T+'"');if(H)throw new SyntaxError('Trailing characters: "'+T+'"');if(ee.length!==0)throw new SyntaxError('Unmatched "(" in "'+x+'"');if(J.units.length===0&&!z.allowNoUnits)throw new SyntaxError('"'+T+'" contains no units');return J.value=Y!==void 0?J._normalize(Y):null,J},g.prototype.clone=function(){var T=new g;T.fixPrefix=this.fixPrefix,T.skipAutomaticSimplification=this.skipAutomaticSimplification,T.value=ze(this.value),T.dimensions=this.dimensions.slice(0),T.units=[];for(var z=0;z<this.units.length;z++){T.units[z]={};for(var J in this.units[z])Me(this.units[z],J)&&(T.units[z][J]=this.units[z][J])}return T},g.prototype.valueType=function(){return dt(this.value)},g.prototype._isDerived=function(){return this.units.length===0?!1:this.units.length>1||Math.abs(this.units[0].power-1)>1e-15},g.prototype._normalize=function(T){if(T==null||this.units.length===0)return T;for(var z=T,J=g._getNumberConverter(dt(T)),L=0;L<this.units.length;L++){var H=J(this.units[L].unit.value),G=J(this.units[L].prefix.value),Y=J(this.units[L].power);z=a(z,u(a(H,G),Y))}return z},g.prototype._denormalize=function(T,z){if(T==null||this.units.length===0)return T;for(var J=T,L=g._getNumberConverter(dt(T)),H=0;H<this.units.length;H++){var G=L(this.units[H].unit.value),Y=L(this.units[H].prefix.value),ee=L(this.units[H].power);J=o(J,u(a(G,Y),ee))}return J};var I=No(T=>{if(Me(V,T)){var z=V[T],J=z.prefixes[""];return{unit:z,prefix:J}}for(var L in V)if(Me(V,L)&&X2(T,L)){var H=V[L],G=T.length-L.length,Y=T.substring(0,G),ee=Me(H.prefixes,Y)?H.prefixes[Y]:void 0;if(ee!==void 0)return{unit:H,prefix:ee}}return null},{hasher:T=>T[0],limit:100});g.isValuelessUnit=function(T){return I(T)!==null},g.prototype.hasBase=function(T){if(typeof T=="string"&&(T=k[T]),!T)return!1;for(var z=0;z<q.length;z++)if(Math.abs((this.dimensions[z]||0)-(T.dimensions[z]||0))>1e-12)return!1;return!0},g.prototype.equalBase=function(T){for(var z=0;z<q.length;z++)if(Math.abs((this.dimensions[z]||0)-(T.dimensions[z]||0))>1e-12)return!1;return!0},g.prototype.equals=function(T){return this.equalBase(T)&&f(this.value,T.value)},g.prototype.multiply=function(T){for(var z=this.clone(),J=Cr(T)?T:new g(T),L=0;L<q.length;L++)z.dimensions[L]=(this.dimensions[L]||0)+(J.dimensions[L]||0);for(var H=0;H<J.units.length;H++){var G=lc({},J.units[H]);z.units.push(G)}if(this.value!==null||J.value!==null){var Y=this.value===null?this._normalize(1):this.value,ee=J.value===null?J._normalize(1):J.value;z.value=a(Y,ee)}else z.value=null;return Cr(T)&&(z.skipAutomaticSimplification=!1),O(z)},g.prototype.divideInto=function(T){return new g(T).divide(this)},g.prototype.divide=function(T){for(var z=this.clone(),J=Cr(T)?T:new g(T),L=0;L<q.length;L++)z.dimensions[L]=(this.dimensions[L]||0)-(J.dimensions[L]||0);for(var H=0;H<J.units.length;H++){var G=lc(lc({},J.units[H]),{},{power:-J.units[H].power});z.units.push(G)}if(this.value!==null||J.value!==null){var Y=this.value===null?this._normalize(1):this.value,ee=J.value===null?J._normalize(1):J.value;z.value=o(Y,ee)}else z.value=null;return Cr(T)&&(z.skipAutomaticSimplification=!1),O(z)},g.prototype.pow=function(T){for(var z=this.clone(),J=0;J<q.length;J++)z.dimensions[J]=(this.dimensions[J]||0)*T;for(var L=0;L<z.units.length;L++)z.units[L].power*=T;return z.value!==null?z.value=u(z.value,T):z.value=null,z.skipAutomaticSimplification=!1,O(z)};function O(T){return T.equalBase(k.NONE)&&T.value!==null&&!r.predictable?T.value:T}g.prototype.abs=function(){var T=this.clone();if(T.value!==null)if(T._isDerived()||T.units.length===0||T.units[0].unit.offset===0)T.value=c(T.value);else{var z=T._numberConverter(),J=z(T.units[0].unit.value),L=z(T.units[0].unit.offset),H=a(J,L);T.value=i(c(n(T.value,H)),H)}for(var G in T.units)(T.units[G].unit.name==="VA"||T.units[G].unit.name==="VAR")&&(T.units[G].unit=V.W);return T},g.prototype.to=function(T){var z=this.value===null?this._normalize(1):this.value,J;if(typeof T=="string")J=g.parse(T);else if(Cr(T))J=T.clone();else throw new Error("String or Unit expected as parameter");if(!this.equalBase(J))throw new Error("Units do not match ('".concat(J.toString(),"' != '").concat(this.toString(),"')"));if(J.value!==null)throw new Error("Cannot convert to a unit with a value");if(this.value===null||this._isDerived()||this.units.length===0||J.units.length===0||this.units[0].unit.offset===J.units[0].unit.offset)J.value=ze(z);else{var L=g._getNumberConverter(dt(z)),H=this.units[0].unit.value,G=this.units[0].unit.offset,Y=a(H,G),ee=J.units[0].unit.value,B=J.units[0].unit.offset,j=a(ee,B);J.value=n(z,L(i(Y,j)))}return J.fixPrefix=!0,J.skipAutomaticSimplification=!0,J},g.prototype.toNumber=function(T){return b(this.toNumeric(T))},g.prototype.toNumeric=function(T){var z;return T?z=this.to(T):z=this.clone(),z._isDerived()||z.units.length===0?z._denormalize(z.value):z._denormalize(z.value,z.units[0].prefix.value)},g.prototype.toString=function(){return this.format()},g.prototype.toJSON=function(){return{mathjs:"Unit",value:this._denormalize(this.value),unit:this.units.length>0?this.formatUnits():null,fixPrefix:this.fixPrefix}},g.fromJSON=function(T){var z,J=new g(T.value,(z=T.unit)!==null&&z!==void 0?z:void 0);return J.fixPrefix=T.fixPrefix||!1,J},g.prototype.valueOf=g.prototype.toString,g.prototype.simplify=function(){var T=this.clone(),z=[],J;for(var L in ae)if(Me(ae,L)&&T.hasBase(k[L])){J=L;break}if(J==="NONE")T.units=[];else{var H;if(J&&Me(ae,J)&&(H=ae[J]),H)T.units=[{unit:H.unit,prefix:H.prefix,power:1}];else{for(var G=!1,Y=0;Y<q.length;Y++){var ee=q[Y];Math.abs(T.dimensions[Y]||0)>1e-12&&(Me(ae,ee)?z.push({unit:ae[ee].unit,prefix:ae[ee].prefix,power:T.dimensions[Y]||0}):G=!0)}z.length<T.units.length&&!G&&(T.units=z)}}return T},g.prototype.toSI=function(){for(var T=this.clone(),z=[],J=0;J<q.length;J++){var L=q[J];if(Math.abs(T.dimensions[J]||0)>1e-12)if(Me(re.si,L))z.push({unit:re.si[L].unit,prefix:re.si[L].prefix,power:T.dimensions[J]||0});else throw new Error("Cannot express custom unit "+L+" in SI units")}return T.units=z,T.fixPrefix=!0,T.skipAutomaticSimplification=!0,this.value!==null?(T.value=null,this.to(T)):T},g.prototype.formatUnits=function(){for(var T="",z="",J=0,L=0,H=0;H<this.units.length;H++)this.units[H].power>0?(J++,T+=" "+this.units[H].prefix.name+this.units[H].unit.name,Math.abs(this.units[H].power-1)>1e-15&&(T+="^"+this.units[H].power)):this.units[H].power<0&&L++;if(L>0)for(var G=0;G<this.units.length;G++)this.units[G].power<0&&(J>0?(z+=" "+this.units[G].prefix.name+this.units[G].unit.name,Math.abs(this.units[G].power+1)>1e-15&&(z+="^"+-this.units[G].power)):(z+=" "+this.units[G].prefix.name+this.units[G].unit.name,z+="^"+this.units[G].power));T=T.substr(1),z=z.substr(1),J>1&&L>0&&(T="("+T+")"),L>1&&J>0&&(z="("+z+")");var Y=T;return J>0&&L>0&&(Y+=" / "),Y+=z,Y},g.prototype.format=function(T){var z=this.skipAutomaticSimplification||this.value===null?this.clone():this.simplify(),J=!1;typeof z.value<"u"&&z.value!==null&&wn(z.value)&&(J=Math.abs(z.value.re)<1e-14);for(var L in z.units)Me(z.units,L)&&z.units[L].unit&&(z.units[L].unit.name==="VA"&&J?z.units[L].unit=V.VAR:z.units[L].unit.name==="VAR"&&!J&&(z.units[L].unit=V.VA));z.units.length===1&&!z.fixPrefix&&Math.abs(z.units[0].power-Math.round(z.units[0].power))<1e-14&&(z.units[0].prefix=z._bestPrefix());var H=z._denormalize(z.value),G=z.value!==null?m(H,T||{}):"",Y=z.formatUnits();return z.value&&wn(z.value)&&(G="("+G+")"),Y.length>0&&G.length>0&&(G+=" "),G+=Y,G},g.prototype._bestPrefix=function(){if(this.units.length!==1)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var T=this.value!==null?c(this.value):0,z=c(this.units[0].unit.value),J=this.units[0].prefix;if(T===0)return J;var L=this.units[0].power,H=Math.log(T/Math.pow(J.value*z,L))/Math.LN10-1.2;if(H>-2.200001&&H<1.800001)return J;H=Math.abs(H);var G=this.units[0].unit.prefixes;for(var Y in G)if(Me(G,Y)){var ee=G[Y];if(ee.scientific){var B=Math.abs(Math.log(T/Math.pow(ee.value*z,L))/Math.LN10-1.2);(B<H||B===H&&ee.name.length<J.name.length)&&(J=ee,H=B)}}return J},g.prototype.splitUnit=function(T){for(var z=this.clone(),J=[],L=0;L<T.length&&(z=z.to(T[L]),L!==T.length-1);L++){var H=z.toNumeric(),G=s(H),Y=void 0,ee=f(G,H);ee?Y=G:Y=l(z.toNumeric());var B=new g(Y,T[L].toString());J.push(B),z=i(z,B)}for(var j=0,Q=0;Q<J.length;Q++)j=n(j,J[Q].value);return f(j,this.value)&&(z.value=0),J.push(z),J};var F={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},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}}};F.SHORTLONG=Tt({},F.SHORT,F.LONG),F.BINARY_SHORT=Tt({},F.BINARY_SHORT_SI,F.BINARY_SHORT_IEC),F.BINARY_LONG=Tt({},F.BINARY_LONG_SI,F.BINARY_LONG_IEC);var q=["MASS","LENGTH","TIME","CURRENT","TEMPERATURE","LUMINOUS_INTENSITY","AMOUNT_OF_SUBSTANCE","ANGLE","BIT"],k={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 te in k)Me(k,te)&&(k[te].key=te);var se={},K={name:"",base:se,value:1,offset:0,dimensions:q.map(T=>0)},V={meter:{name:"meter",base:k.LENGTH,prefixes:F.LONG,value:1,offset:0},inch:{name:"inch",base:k.LENGTH,prefixes:F.NONE,value:.0254,offset:0},foot:{name:"foot",base:k.LENGTH,prefixes:F.NONE,value:.3048,offset:0},yard:{name:"yard",base:k.LENGTH,prefixes:F.NONE,value:.9144,offset:0},mile:{name:"mile",base:k.LENGTH,prefixes:F.NONE,value:1609.344,offset:0},link:{name:"link",base:k.LENGTH,prefixes:F.NONE,value:.201168,offset:0},rod:{name:"rod",base:k.LENGTH,prefixes:F.NONE,value:5.0292,offset:0},chain:{name:"chain",base:k.LENGTH,prefixes:F.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:k.LENGTH,prefixes:F.NONE,value:1e-10,offset:0},m:{name:"m",base:k.LENGTH,prefixes:F.SHORT,value:1,offset:0},in:{name:"in",base:k.LENGTH,prefixes:F.NONE,value:.0254,offset:0},ft:{name:"ft",base:k.LENGTH,prefixes:F.NONE,value:.3048,offset:0},yd:{name:"yd",base:k.LENGTH,prefixes:F.NONE,value:.9144,offset:0},mi:{name:"mi",base:k.LENGTH,prefixes:F.NONE,value:1609.344,offset:0},li:{name:"li",base:k.LENGTH,prefixes:F.NONE,value:.201168,offset:0},rd:{name:"rd",base:k.LENGTH,prefixes:F.NONE,value:5.02921,offset:0},ch:{name:"ch",base:k.LENGTH,prefixes:F.NONE,value:20.1168,offset:0},mil:{name:"mil",base:k.LENGTH,prefixes:F.NONE,value:254e-7,offset:0},m2:{name:"m2",base:k.SURFACE,prefixes:F.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:k.SURFACE,prefixes:F.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:k.SURFACE,prefixes:F.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:k.SURFACE,prefixes:F.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:k.SURFACE,prefixes:F.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:k.SURFACE,prefixes:F.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:k.SURFACE,prefixes:F.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:k.SURFACE,prefixes:F.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:k.SURFACE,prefixes:F.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:k.SURFACE,prefixes:F.NONE,value:1e4,offset:0},m3:{name:"m3",base:k.VOLUME,prefixes:F.CUBIC,value:1,offset:0},L:{name:"L",base:k.VOLUME,prefixes:F.SHORT,value:.001,offset:0},l:{name:"l",base:k.VOLUME,prefixes:F.SHORT,value:.001,offset:0},litre:{name:"litre",base:k.VOLUME,prefixes:F.LONG,value:.001,offset:0},cuin:{name:"cuin",base:k.VOLUME,prefixes:F.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:k.VOLUME,prefixes:F.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:k.VOLUME,prefixes:F.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:k.VOLUME,prefixes:F.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:k.VOLUME,prefixes:F.NONE,value:15e-6,offset:0},drop:{name:"drop",base:k.VOLUME,prefixes:F.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:k.VOLUME,prefixes:F.NONE,value:5e-8,offset:0},minim:{name:"minim",base:k.VOLUME,prefixes:F.NONE,value:6161152e-14,offset:0},fluiddram:{name:"fluiddram",base:k.VOLUME,prefixes:F.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:k.VOLUME,prefixes:F.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:k.VOLUME,prefixes:F.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:k.VOLUME,prefixes:F.NONE,value:1e-6,offset:0},cup:{name:"cup",base:k.VOLUME,prefixes:F.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:k.VOLUME,prefixes:F.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:k.VOLUME,prefixes:F.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:k.VOLUME,prefixes:F.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:k.VOLUME,prefixes:F.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:k.VOLUME,prefixes:F.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:k.VOLUME,prefixes:F.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:k.VOLUME,prefixes:F.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:k.VOLUME,prefixes:F.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:k.VOLUME,prefixes:F.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:k.VOLUME,prefixes:F.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:k.VOLUME,prefixes:F.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:k.VOLUME,prefixes:F.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:k.VOLUME,prefixes:F.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:k.VOLUME,prefixes:F.NONE,value:.1173478,offset:0},obl:{name:"obl",base:k.VOLUME,prefixes:F.NONE,value:.1589873,offset:0},g:{name:"g",base:k.MASS,prefixes:F.SHORT,value:.001,offset:0},gram:{name:"gram",base:k.MASS,prefixes:F.LONG,value:.001,offset:0},ton:{name:"ton",base:k.MASS,prefixes:F.SHORT,value:907.18474,offset:0},t:{name:"t",base:k.MASS,prefixes:F.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:k.MASS,prefixes:F.LONG,value:1e3,offset:0},grain:{name:"grain",base:k.MASS,prefixes:F.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:k.MASS,prefixes:F.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:k.MASS,prefixes:F.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:k.MASS,prefixes:F.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:k.MASS,prefixes:F.NONE,value:45.359237,offset:0},stick:{name:"stick",base:k.MASS,prefixes:F.NONE,value:.115,offset:0},stone:{name:"stone",base:k.MASS,prefixes:F.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:k.MASS,prefixes:F.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:k.MASS,prefixes:F.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:k.MASS,prefixes:F.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:k.MASS,prefixes:F.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:k.MASS,prefixes:F.NONE,value:45.359237,offset:0},s:{name:"s",base:k.TIME,prefixes:F.SHORT,value:1,offset:0},min:{name:"min",base:k.TIME,prefixes:F.NONE,value:60,offset:0},h:{name:"h",base:k.TIME,prefixes:F.NONE,value:3600,offset:0},second:{name:"second",base:k.TIME,prefixes:F.LONG,value:1,offset:0},sec:{name:"sec",base:k.TIME,prefixes:F.LONG,value:1,offset:0},minute:{name:"minute",base:k.TIME,prefixes:F.NONE,value:60,offset:0},hour:{name:"hour",base:k.TIME,prefixes:F.NONE,value:3600,offset:0},day:{name:"day",base:k.TIME,prefixes:F.NONE,value:86400,offset:0},week:{name:"week",base:k.TIME,prefixes:F.NONE,value:7*86400,offset:0},month:{name:"month",base:k.TIME,prefixes:F.NONE,value:2629800,offset:0},year:{name:"year",base:k.TIME,prefixes:F.NONE,value:31557600,offset:0},decade:{name:"decade",base:k.TIME,prefixes:F.NONE,value:315576e3,offset:0},century:{name:"century",base:k.TIME,prefixes:F.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:k.TIME,prefixes:F.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:k.FREQUENCY,prefixes:F.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:k.FREQUENCY,prefixes:F.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:k.ANGLE,prefixes:F.SHORT,value:1,offset:0},radian:{name:"radian",base:k.ANGLE,prefixes:F.LONG,value:1,offset:0},deg:{name:"deg",base:k.ANGLE,prefixes:F.SHORT,value:null,offset:0},degree:{name:"degree",base:k.ANGLE,prefixes:F.LONG,value:null,offset:0},grad:{name:"grad",base:k.ANGLE,prefixes:F.SHORT,value:null,offset:0},gradian:{name:"gradian",base:k.ANGLE,prefixes:F.LONG,value:null,offset:0},cycle:{name:"cycle",base:k.ANGLE,prefixes:F.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:k.ANGLE,prefixes:F.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:k.ANGLE,prefixes:F.NONE,value:null,offset:0},A:{name:"A",base:k.CURRENT,prefixes:F.SHORT,value:1,offset:0},ampere:{name:"ampere",base:k.CURRENT,prefixes:F.LONG,value:1,offset:0},K:{name:"K",base:k.TEMPERATURE,prefixes:F.SHORT,value:1,offset:0},degC:{name:"degC",base:k.TEMPERATURE,prefixes:F.SHORT,value:1,offset:273.15},degF:{name:"degF",base:k.TEMPERATURE,prefixes:F.SHORT,value:new v(5,9),offset:459.67},degR:{name:"degR",base:k.TEMPERATURE,prefixes:F.SHORT,value:new v(5,9),offset:0},kelvin:{name:"kelvin",base:k.TEMPERATURE,prefixes:F.LONG,value:1,offset:0},celsius:{name:"celsius",base:k.TEMPERATURE,prefixes:F.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:k.TEMPERATURE,prefixes:F.LONG,value:new v(5,9),offset:459.67},rankine:{name:"rankine",base:k.TEMPERATURE,prefixes:F.LONG,value:new v(5,9),offset:0},mol:{name:"mol",base:k.AMOUNT_OF_SUBSTANCE,prefixes:F.SHORT,value:1,offset:0},mole:{name:"mole",base:k.AMOUNT_OF_SUBSTANCE,prefixes:F.LONG,value:1,offset:0},cd:{name:"cd",base:k.LUMINOUS_INTENSITY,prefixes:F.SHORT,value:1,offset:0},candela:{name:"candela",base:k.LUMINOUS_INTENSITY,prefixes:F.LONG,value:1,offset:0},N:{name:"N",base:k.FORCE,prefixes:F.SHORT,value:1,offset:0},newton:{name:"newton",base:k.FORCE,prefixes:F.LONG,value:1,offset:0},dyn:{name:"dyn",base:k.FORCE,prefixes:F.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:k.FORCE,prefixes:F.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:k.FORCE,prefixes:F.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:k.FORCE,prefixes:F.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:k.FORCE,prefixes:F.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:k.FORCE,prefixes:F.NONE,value:9.80665,offset:0},J:{name:"J",base:k.ENERGY,prefixes:F.SHORT,value:1,offset:0},joule:{name:"joule",base:k.ENERGY,prefixes:F.LONG,value:1,offset:0},erg:{name:"erg",base:k.ENERGY,prefixes:F.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:k.ENERGY,prefixes:F.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:k.ENERGY,prefixes:F.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:k.ENERGY,prefixes:F.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:k.ENERGY,prefixes:F.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:k.POWER,prefixes:F.SHORT,value:1,offset:0},watt:{name:"watt",base:k.POWER,prefixes:F.LONG,value:1,offset:0},hp:{name:"hp",base:k.POWER,prefixes:F.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:k.POWER,prefixes:F.SHORT,value:h.I,offset:0},VA:{name:"VA",base:k.POWER,prefixes:F.SHORT,value:1,offset:0},Pa:{name:"Pa",base:k.PRESSURE,prefixes:F.SHORT,value:1,offset:0},psi:{name:"psi",base:k.PRESSURE,prefixes:F.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:k.PRESSURE,prefixes:F.NONE,value:101325,offset:0},bar:{name:"bar",base:k.PRESSURE,prefixes:F.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:k.PRESSURE,prefixes:F.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:k.PRESSURE,prefixes:F.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:k.PRESSURE,prefixes:F.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:k.PRESSURE,prefixes:F.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:k.ELECTRIC_CHARGE,prefixes:F.LONG,value:1,offset:0},C:{name:"C",base:k.ELECTRIC_CHARGE,prefixes:F.SHORT,value:1,offset:0},farad:{name:"farad",base:k.ELECTRIC_CAPACITANCE,prefixes:F.LONG,value:1,offset:0},F:{name:"F",base:k.ELECTRIC_CAPACITANCE,prefixes:F.SHORT,value:1,offset:0},volt:{name:"volt",base:k.ELECTRIC_POTENTIAL,prefixes:F.LONG,value:1,offset:0},V:{name:"V",base:k.ELECTRIC_POTENTIAL,prefixes:F.SHORT,value:1,offset:0},ohm:{name:"ohm",base:k.ELECTRIC_RESISTANCE,prefixes:F.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:k.ELECTRIC_INDUCTANCE,prefixes:F.LONG,value:1,offset:0},H:{name:"H",base:k.ELECTRIC_INDUCTANCE,prefixes:F.SHORT,value:1,offset:0},siemens:{name:"siemens",base:k.ELECTRIC_CONDUCTANCE,prefixes:F.LONG,value:1,offset:0},S:{name:"S",base:k.ELECTRIC_CONDUCTANCE,prefixes:F.SHORT,value:1,offset:0},weber:{name:"weber",base:k.MAGNETIC_FLUX,prefixes:F.LONG,value:1,offset:0},Wb:{name:"Wb",base:k.MAGNETIC_FLUX,prefixes:F.SHORT,value:1,offset:0},tesla:{name:"tesla",base:k.MAGNETIC_FLUX_DENSITY,prefixes:F.LONG,value:1,offset:0},T:{name:"T",base:k.MAGNETIC_FLUX_DENSITY,prefixes:F.SHORT,value:1,offset:0},b:{name:"b",base:k.BIT,prefixes:F.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:k.BIT,prefixes:F.BINARY_LONG,value:1,offset:0},B:{name:"B",base:k.BIT,prefixes:F.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:k.BIT,prefixes:F.BINARY_LONG,value:8,offset:0}},ue={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fluiddrams:"fluiddram",fluidounces:"fluidounce",gills:"gill",cups:"cup",pints:"pint",quarts:"quart",gallons:"gallon",beerbarrels:"beerbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function me(T){if(T.number==="BigNumber"){var z=Fl(w);V.rad.value=new w(1),V.deg.value=z.div(180),V.grad.value=z.div(200),V.cycle.value=z.times(2),V.arcsec.value=z.div(648e3),V.arcmin.value=z.div(10800)}else V.rad.value=1,V.deg.value=Math.PI/180,V.grad.value=Math.PI/200,V.cycle.value=Math.PI*2,V.arcsec.value=Math.PI/648e3,V.arcmin.value=Math.PI/10800;V.radian.value=V.rad.value,V.degree.value=V.deg.value,V.gradian.value=V.grad.value}me(r),t&&t("config",function(T,z){T.number!==z.number&&me(T)});var re={si:{NONE:{unit:K,prefix:F.NONE[""]},LENGTH:{unit:V.m,prefix:F.SHORT[""]},MASS:{unit:V.g,prefix:F.SHORT.k},TIME:{unit:V.s,prefix:F.SHORT[""]},CURRENT:{unit:V.A,prefix:F.SHORT[""]},TEMPERATURE:{unit:V.K,prefix:F.SHORT[""]},LUMINOUS_INTENSITY:{unit:V.cd,prefix:F.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:V.mol,prefix:F.SHORT[""]},ANGLE:{unit:V.rad,prefix:F.SHORT[""]},BIT:{unit:V.bits,prefix:F.SHORT[""]},FORCE:{unit:V.N,prefix:F.SHORT[""]},ENERGY:{unit:V.J,prefix:F.SHORT[""]},POWER:{unit:V.W,prefix:F.SHORT[""]},PRESSURE:{unit:V.Pa,prefix:F.SHORT[""]},ELECTRIC_CHARGE:{unit:V.C,prefix:F.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:V.F,prefix:F.SHORT[""]},ELECTRIC_POTENTIAL:{unit:V.V,prefix:F.SHORT[""]},ELECTRIC_RESISTANCE:{unit:V.ohm,prefix:F.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:V.H,prefix:F.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:V.S,prefix:F.SHORT[""]},MAGNETIC_FLUX:{unit:V.Wb,prefix:F.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:V.T,prefix:F.SHORT[""]},FREQUENCY:{unit:V.Hz,prefix:F.SHORT[""]}}};re.cgs=JSON.parse(JSON.stringify(re.si)),re.cgs.LENGTH={unit:V.m,prefix:F.SHORT.c},re.cgs.MASS={unit:V.g,prefix:F.SHORT[""]},re.cgs.FORCE={unit:V.dyn,prefix:F.SHORT[""]},re.cgs.ENERGY={unit:V.erg,prefix:F.NONE[""]},re.us=JSON.parse(JSON.stringify(re.si)),re.us.LENGTH={unit:V.ft,prefix:F.NONE[""]},re.us.MASS={unit:V.lbm,prefix:F.NONE[""]},re.us.TEMPERATURE={unit:V.degF,prefix:F.NONE[""]},re.us.FORCE={unit:V.lbf,prefix:F.NONE[""]},re.us.ENERGY={unit:V.BTU,prefix:F.BTU[""]},re.us.POWER={unit:V.hp,prefix:F.NONE[""]},re.us.PRESSURE={unit:V.psi,prefix:F.NONE[""]},re.auto=JSON.parse(JSON.stringify(re.si));var ae=re.auto;g.setUnitSystem=function(T){if(Me(re,T))ae=re[T];else throw new Error("Unit system "+T+" does not exist. Choices are: "+Object.keys(re).join(", "))},g.getUnitSystem=function(){for(var T in re)if(Me(re,T)&&re[T]===ae)return T},g.typeConverters={BigNumber:function(T){return T!=null&&T.isFraction?new w(T.n).div(T.d).times(T.s):new w(T+"")},Fraction:function(T){return new v(T)},Complex:function(T){return T},number:function(T){return T!=null&&T.isFraction?d(T):T}},g.prototype._numberConverter=function(){var T=g.typeConverters[this.valueType()];if(T)return T;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},g._getNumberConverter=function(T){if(!g.typeConverters[T])throw new TypeError('Unsupported type "'+T+'"');return g.typeConverters[T]};for(var de in V)if(Me(V,de)){var ne=V[de];ne.dimensions=ne.base.dimensions}for(var ce in ue)if(Me(ue,ce)){var le=V[ue[ce]],he={};for(var be in le)Me(le,be)&&(he[be]=le[be]);he.name=ce,V[ce]=he}g.isValidAlpha=function(T){return/^[a-zA-Z]$/.test(T)};function $(T){for(var z=0;z<T.length;z++){if(N=T.charAt(z),z===0&&!g.isValidAlpha(N))throw new Error('Invalid unit name (must begin with alpha character): "'+T+'"');if(z>0&&!(g.isValidAlpha(N)||D(N)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+T+'"')}}return g.createUnit=function(T,z){if(typeof T!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(z&&z.override){for(var J in T)if(Me(T,J)&&g.deleteUnit(J),T[J].aliases)for(var L=0;L<T[J].aliases.length;L++)g.deleteUnit(T[J].aliases[L])}var H;for(var G in T)Me(T,G)&&(H=g.createUnitSingle(G,T[G]));return H},g.createUnitSingle=function(T,z){if((typeof z>"u"||z===null)&&(z={}),typeof T!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(Me(V,T))throw new Error('Cannot create unit "'+T+'": a unit with that name already exists');$(T);var J=null,L=[],H=0,G,Y,ee;if(z&&z.type==="Unit")J=z.clone();else if(typeof z=="string")z!==""&&(G=z);else if(typeof z=="object")G=z.definition,Y=z.prefixes,H=z.offset,ee=z.baseName,z.aliases&&(L=z.aliases.valueOf());else throw new TypeError('Cannot create unit "'+T+'" from "'+z.toString()+'": expecting "string" or "Unit" or "Object"');if(L){for(var B=0;B<L.length;B++)if(Me(V,L[B]))throw new Error('Cannot create alias "'+L[B]+'": a unit with that name already exists')}if(G&&typeof G=="string"&&!J)try{J=g.parse(G,{allowNoUnits:!0})}catch(M){throw M.message='Could not create unit "'+T+'" from "'+G+'": '+M.message,M}else G&&G.type==="Unit"&&(J=G.clone());L=L||[],H=H||0,Y&&Y.toUpperCase?Y=F[Y.toUpperCase()]||F.NONE:Y=F.NONE;var j={};if(J){j={name:T,value:J.value,dimensions:J.dimensions.slice(0),prefixes:Y,offset:H};var Q=!1;for(var Z in k)if(Me(k,Z)){for(var ie=!0,oe=0;oe<q.length;oe++)if(Math.abs((j.dimensions[oe]||0)-(k[Z].dimensions[oe]||0))>1e-12){ie=!1;break}if(ie){Q=!0,j.base=k[Z];break}}if(!Q){ee=ee||T+"_STUFF";var ye={dimensions:J.dimensions.slice(0)};ye.key=ee,k[ee]=ye,ae[ee]={unit:j,prefix:F.NONE[""]},j.base=k[ee]}}else{if(ee=ee||T+"_STUFF",q.indexOf(ee)>=0)throw new Error('Cannot create new base unit "'+T+'": a base unit with that name already exists (and cannot be overridden)');q.push(ee);for(var fe in k)Me(k,fe)&&(k[fe].dimensions[q.length-1]=0);for(var De={dimensions:[]},Ne=0;Ne<q.length;Ne++)De.dimensions[Ne]=0;De.dimensions[q.length-1]=1,De.key=ee,k[ee]=De,j={name:T,value:1,dimensions:k[ee].dimensions.slice(0),prefixes:Y,offset:H,base:k[ee]},ae[ee]={unit:j,prefix:F.NONE[""]}}g.UNITS[T]=j;for(var je=0;je<L.length;je++){var Ze=L[je],_e={};for(var wt in j)Me(j,wt)&&(_e[wt]=j[wt]);_e.name=Ze,g.UNITS[Ze]=_e}return delete I.cache,new g(null,T)},g.deleteUnit=function(T){delete g.UNITS[T],delete I.cache},g.PREFIXES=F,g.BASE_DIMENSIONS=q,g.BASE_UNITS=k,g.UNIT_SYSTEMS=re,g.UNITS=V,g},{isClass:!0}),md="unit",V3=["typed","Unit"],U3=U(md,V3,e=>{var{typed:t,Unit:r}=e;return t(md,{Unit:function(n){return n.clone()},string:function(n){return r.isValuelessUnit(n)?new r(null,n):r.parse(n,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(n,i){return new r(n,i)},"number | BigNumber | Fraction":function(n){return new r(n)},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))})}),dd="sparse",$3=["typed","SparseMatrix"],H3=U(dd,$3,e=>{var{typed:t,SparseMatrix:r}=e;return t(dd,{"":function(){return new r([])},string:function(n){return new r([],n)},"Array | Matrix":function(n){return new r(n)},"Array | Matrix, string":function(n,i){return new r(n,i)}})}),hd="createUnit",J3=["typed","Unit"],G3=U(hd,J3,e=>{var{typed:t,Unit:r}=e;return t(hd,{"Object, Object":function(n,i){return r.createUnit(n,i)},Object:function(n){return r.createUnit(n,{})},"string, Unit | string | Object, Object":function(n,i,a){var o={};return o[n]=i,r.createUnit(o,a)},"string, Unit | string | Object":function(n,i){var a={};return a[n]=i,r.createUnit(a,{})},string:function(n){var i={};return i[n]={},r.createUnit(i,{})}})}),gd="acos",W3=["typed","config","Complex"],K3=U(gd,W3,e=>{var{typed:t,config:r,Complex:n}=e;return t(gd,{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()}})}),vd="acosh",Q3=["typed","config","Complex"],Z3=U(vd,Q3,e=>{var{typed:t,config:r,Complex:n}=e;return t(vd,{number:function(i){return i>=1||r.predictable?Zv(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()}})}),yd="acot",X3=["typed","BigNumber"],Y3=U(yd,X3,e=>{var{typed:t,BigNumber:r}=e;return t(yd,{number:Xv,Complex:function(n){return n.acot()},BigNumber:function(n){return new r(1).div(n).atan()}})}),xd="acoth",e_=["typed","config","Complex","BigNumber"],t_=U(xd,e_,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(xd,{number:function(a){return a>=1||a<=-1||r.predictable?Yv(a):new n(a,0).acoth()},Complex:function(a){return a.acoth()},BigNumber:function(a){return new i(1).div(a).atanh()}})}),bd="acsc",r_=["typed","config","Complex","BigNumber"],n_=U(bd,r_,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(bd,{number:function(a){return a<=-1||a>=1||r.predictable?ey(a):new n(a,0).acsc()},Complex:function(a){return a.acsc()},BigNumber:function(a){return new i(1).div(a).asin()}})}),wd="acsch",i_=["typed","BigNumber"],a_=U(wd,i_,e=>{var{typed:t,BigNumber:r}=e;return t(wd,{number:ty,Complex:function(n){return n.acsch()},BigNumber:function(n){return new r(1).div(n).asinh()}})}),Nd="asec",o_=["typed","config","Complex","BigNumber"],s_=U(Nd,o_,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(Nd,{number:function(a){return a<=-1||a>=1||r.predictable?ry(a):new n(a,0).asec()},Complex:function(a){return a.asec()},BigNumber:function(a){return new i(1).div(a).acos()}})}),Dd="asech",u_=["typed","config","Complex","BigNumber"],c_=U(Dd,u_,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(Dd,{number:function(a){if(a<=1&&a>=-1||r.predictable){var o=1/a;if(o>0||r.predictable)return ny(a);var u=Math.sqrt(o*o-1);return new n(Math.log(u-o),Math.PI)}return new n(a,0).asech()},Complex:function(a){return a.asech()},BigNumber:function(a){return new i(1).div(a).acosh()}})}),Ed="asin",l_=["typed","config","Complex"],f_=U(Ed,l_,e=>{var{typed:t,config:r,Complex:n}=e;return t(Ed,{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()}})}),p_="asinh",m_=["typed"],d_=U(p_,m_,e=>{var{typed:t}=e;return t("asinh",{number:iy,Complex:function(r){return r.asinh()},BigNumber:function(r){return r.asinh()}})}),h_="atan",g_=["typed"],v_=U(h_,g_,e=>{var{typed:t}=e;return t("atan",{number:function(r){return Math.atan(r)},Complex:function(r){return r.atan()},BigNumber:function(r){return r.atan()}})}),Ad="atan2",y_=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],x_=U(Ad,y_,e=>{var{typed:t,matrix:r,equalScalar:n,BigNumber:i,DenseMatrix:a,concat:o}=e,u=Gr({typed:t,equalScalar:n}),c=cr({typed:t}),l=xy({typed:t,equalScalar:n}),s=Jt({typed:t,equalScalar:n}),f=It({typed:t,DenseMatrix:a}),p=gt({typed:t,matrix:r,concat:o});return t(Ad,{"number, number":Math.atan2,"BigNumber, BigNumber":(m,d)=>i.atan2(m,d)},p({scalar:"number | BigNumber",SS:l,DS:c,SD:u,Ss:s,sS:f}))}),Sd="atanh",b_=["typed","config","Complex"],w_=U(Sd,b_,e=>{var{typed:t,config:r,Complex:n}=e;return t(Sd,{number:function(i){return i<=1&&i>=-1||r.predictable?ay(i):new n(i,0).atanh()},Complex:function(i){return i.atanh()},BigNumber:function(i){return i.atanh()}})}),Ma=U("trigUnit",["typed"],e=>{var{typed:t}=e;return{Unit:t.referToSelf(r=>n=>{if(!n.hasBase(n.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return t.find(r,n.valueType())(n.value)})}}),Cd="cos",N_=["typed"],D_=U(Cd,N_,e=>{var{typed:t}=e,r=Ma({typed:t});return t(Cd,{number:Math.cos,"Complex | BigNumber":n=>n.cos()},r)}),Md="cosh",E_=["typed"],A_=U(Md,E_,e=>{var{typed:t}=e;return t(Md,{number:bN,"Complex | BigNumber":r=>r.cosh()})}),_d="cot",S_=["typed","BigNumber"],C_=U(_d,S_,e=>{var{typed:t,BigNumber:r}=e,n=Ma({typed:t});return t(_d,{number:oy,Complex:i=>i.cot(),BigNumber:i=>new r(1).div(i.tan())},n)}),Fd="coth",M_=["typed","BigNumber"],__=U(Fd,M_,e=>{var{typed:t,BigNumber:r}=e;return t(Fd,{number:sy,Complex:n=>n.coth(),BigNumber:n=>new r(1).div(n.tanh())})}),Td="csc",F_=["typed","BigNumber"],T_=U(Td,F_,e=>{var{typed:t,BigNumber:r}=e,n=Ma({typed:t});return t(Td,{number:uy,Complex:i=>i.csc(),BigNumber:i=>new r(1).div(i.sin())},n)}),Od="csch",O_=["typed","BigNumber"],B_=U(Od,O_,e=>{var{typed:t,BigNumber:r}=e;return t(Od,{number:cy,Complex:n=>n.csch(),BigNumber:n=>new r(1).div(n.sinh())})}),Bd="sec",k_=["typed","BigNumber"],I_=U(Bd,k_,e=>{var{typed:t,BigNumber:r}=e,n=Ma({typed:t});return t(Bd,{number:ly,Complex:i=>i.sec(),BigNumber:i=>new r(1).div(i.cos())},n)}),kd="sech",R_=["typed","BigNumber"],q_=U(kd,R_,e=>{var{typed:t,BigNumber:r}=e;return t(kd,{number:fy,Complex:n=>n.sech(),BigNumber:n=>new r(1).div(n.cosh())})}),Id="sin",z_=["typed"],j_=U(Id,z_,e=>{var{typed:t}=e,r=Ma({typed:t});return t(Id,{number:Math.sin,"Complex | BigNumber":n=>n.sin()},r)}),Rd="sinh",L_=["typed"],P_=U(Rd,L_,e=>{var{typed:t}=e;return t(Rd,{number:py,"Complex | BigNumber":r=>r.sinh()})}),qd="tan",V_=["typed"],U_=U(qd,V_,e=>{var{typed:t}=e,r=Ma({typed:t});return t(qd,{number:Math.tan,"Complex | BigNumber":n=>n.tan()},r)}),$_="tanh",H_=["typed"],J_=U($_,H_,e=>{var{typed:t}=e;return t("tanh",{number:NN,"Complex | BigNumber":r=>r.tanh()})}),zd="setCartesian",G_=["typed","size","subset","compareNatural","Index","DenseMatrix"],W_=U(zd,G_,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(zd,{"Array | Matrix, Array | Matrix":function(u,c){var l=[];if(n(r(u),new a(0))!==0&&n(r(c),new a(0))!==0){var s=ot(Array.isArray(u)?u:u.toArray()).sort(i),f=ot(Array.isArray(c)?c:c.toArray()).sort(i);l=[];for(var p=0;p<s.length;p++)for(var m=0;m<f.length;m++)l.push([s[p],f[m]])}return Array.isArray(u)&&Array.isArray(c)?l:new o(l)}})}),jd="setDifference",K_=["typed","size","subset","compareNatural","Index","DenseMatrix"],Q_=U(jd,K_,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(jd,{"Array | Matrix, Array | Matrix":function(u,c){var l;if(n(r(u),new a(0))===0)l=[];else{if(n(r(c),new a(0))===0)return ot(u.toArray());var s=ha(ot(Array.isArray(u)?u:u.toArray()).sort(i)),f=ha(ot(Array.isArray(c)?c:c.toArray()).sort(i));l=[];for(var p,m=0;m<s.length;m++){p=!1;for(var d=0;d<f.length;d++)if(i(s[m].value,f[d].value)===0&&s[m].identifier===f[d].identifier){p=!0;break}p||l.push(s[m])}}return Array.isArray(u)&&Array.isArray(c)?Is(l):new o(Is(l))}})}),Ld="setDistinct",Z_=["typed","size","subset","compareNatural","Index","DenseMatrix"],X_=U(Ld,Z_,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(Ld,{"Array | Matrix":function(u){var c;if(n(r(u),new a(0))===0)c=[];else{var l=ot(Array.isArray(u)?u:u.toArray()).sort(i);c=[],c.push(l[0]);for(var s=1;s<l.length;s++)i(l[s],l[s-1])!==0&&c.push(l[s])}return Array.isArray(u)?c:new o(c)}})}),Pd="setIntersect",Y_=["typed","size","subset","compareNatural","Index","DenseMatrix"],e4=U(Pd,Y_,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(Pd,{"Array | Matrix, Array | Matrix":function(u,c){var l;if(n(r(u),new a(0))===0||n(r(c),new a(0))===0)l=[];else{var s=ha(ot(Array.isArray(u)?u:u.toArray()).sort(i)),f=ha(ot(Array.isArray(c)?c:c.toArray()).sort(i));l=[];for(var p=0;p<s.length;p++)for(var m=0;m<f.length;m++)if(i(s[p].value,f[m].value)===0&&s[p].identifier===f[m].identifier){l.push(s[p]);break}}return Array.isArray(u)&&Array.isArray(c)?Is(l):new o(Is(l))}})}),Vd="setIsSubset",t4=["typed","size","subset","compareNatural","Index"],r4=U(Vd,t4,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a}=e;return t(Vd,{"Array | Matrix, Array | Matrix":function(o,u){if(n(r(o),new a(0))===0)return!0;if(n(r(u),new a(0))===0)return!1;for(var c=ha(ot(Array.isArray(o)?o:o.toArray()).sort(i)),l=ha(ot(Array.isArray(u)?u:u.toArray()).sort(i)),s,f=0;f<c.length;f++){s=!1;for(var p=0;p<l.length;p++)if(i(c[f].value,l[p].value)===0&&c[f].identifier===l[p].identifier){s=!0;break}if(s===!1)return!1}return!0}})}),Ud="setMultiplicity",n4=["typed","size","subset","compareNatural","Index"],i4=U(Ud,n4,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a}=e;return t(Ud,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(o,u){if(n(r(u),new a(0))===0)return 0;for(var c=ot(Array.isArray(u)?u:u.toArray()),l=0,s=0;s<c.length;s++)i(c[s],o)===0&&l++;return l}})}),$d="setPowerset",a4=["typed","size","subset","compareNatural","Index"],o4=U($d,a4,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a}=e;return t($d,{"Array | Matrix":function(c){if(n(r(c),new a(0))===0)return[];for(var l=ot(Array.isArray(c)?c:c.toArray()).sort(i),s=[],f=0;f.toString(2).length<=l.length;)s.push(o(l,f.toString(2).split("").reverse())),f++;return u(s)}});function o(c,l){for(var s=[],f=0;f<l.length;f++)l[f]==="1"&&s.push(c[f]);return s}function u(c){for(var l=[],s=c.length-1;s>0;s--)for(var f=0;f<s;f++)c[f].length>c[f+1].length&&(l=c[f],c[f]=c[f+1],c[f+1]=l);return c}}),Hd="setSize",s4=["typed","compareNatural"],u4=U(Hd,s4,e=>{var{typed:t,compareNatural:r}=e;return t(Hd,{"Array | Matrix":function(n){return Array.isArray(n)?ot(n).length:ot(n.toArray()).length},"Array | Matrix, boolean":function(n,i){if(i===!1||n.length===0)return Array.isArray(n)?ot(n).length:ot(n.toArray()).length;for(var a=ot(Array.isArray(n)?n:n.toArray()).sort(r),o=1,u=1;u<a.length;u++)r(a[u],a[u-1])!==0&&o++;return o}})}),Jd="setSymDifference",c4=["typed","size","concat","subset","setDifference","Index"],l4=U(Jd,c4,e=>{var{typed:t,size:r,concat:n,subset:i,setDifference:a,Index:o}=e;return t(Jd,{"Array | Matrix, Array | Matrix":function(u,c){if(i(r(u),new o(0))===0)return ot(c);if(i(r(c),new o(0))===0)return ot(u);var l=ot(u),s=ot(c);return n(a(l,s),a(s,l))}})}),Gd="setUnion",f4=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],p4=U(Gd,f4,e=>{var{typed:t,size:r,concat:n,subset:i,setIntersect:a,setSymDifference:o,Index:u}=e;return t(Gd,{"Array | Matrix, Array | Matrix":function(c,l){if(i(r(c),new u(0))===0)return ot(l);if(i(r(l),new u(0))===0)return ot(c);var s=ot(c),f=ot(l);return n(o(s,f),a(s,f))}})}),Wd="add",m4=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],d4=U(Wd,m4,e=>{var{typed:t,matrix:r,addScalar:n,equalScalar:i,DenseMatrix:a,SparseMatrix:o,concat:u}=e,c=ii({typed:t}),l=Al({typed:t,equalScalar:i}),s=zi({typed:t,DenseMatrix:a}),f=gt({typed:t,matrix:r,concat:u});return t(Wd,{"any, any":n,"any, any, ...any":t.referToSelf(p=>(m,d,h)=>{for(var w=p(m,d),v=0;v<h.length;v++)w=p(w,h[v]);return w})},f({elop:n,DS:c,SS:l,Ss:s}))}),Kd="hypot",h4=["typed","abs","addScalar","divideScalar","multiplyScalar","sqrt","smaller","isPositive"],g4=U(Kd,h4,e=>{var{typed:t,abs:r,addScalar:n,divideScalar:i,multiplyScalar:a,sqrt:o,smaller:u,isPositive:c}=e;return t(Kd,{"... number | BigNumber":l,Array:l,Matrix:s=>l(ot(s.toArray()))});function l(s){for(var f=0,p=0,m=0;m<s.length;m++){if(wn(s[m]))throw new TypeError("Unexpected type of argument to hypot");var d=r(s[m]);u(p,d)?(f=a(f,a(i(p,d),i(p,d))),f=n(f,1),p=d):f=n(f,c(d)?a(i(d,p),i(d,p)):d)}return a(p,o(f))}}),Qd="norm",v4=["typed","abs","add","pow","conj","sqrt","multiply","equalScalar","larger","smaller","matrix","ctranspose","eigs"],y4=U(Qd,v4,e=>{var{typed:t,abs:r,add:n,pow:i,conj:a,sqrt:o,multiply:u,equalScalar:c,larger:l,smaller:s,matrix:f,ctranspose:p,eigs:m}=e;return t(Qd,{number:Math.abs,Complex:function(E){return E.abs()},BigNumber:function(E){return E.abs()},boolean:function(E){return Math.abs(E)},Array:function(E){return N(f(E),2)},Matrix:function(E){return N(E,2)},"Array, number | BigNumber | string":function(E,A){return N(f(E),A)},"Matrix, number | BigNumber | string":function(E,A){return N(E,A)}});function d(E){var A=0;return E.forEach(function(D){var S=r(D);l(S,A)&&(A=S)},!0),A}function h(E){var A;return E.forEach(function(D){var S=r(D);(!A||s(S,A))&&(A=S)},!0),A||0}function w(E,A){if(A===Number.POSITIVE_INFINITY||A==="inf")return d(E);if(A===Number.NEGATIVE_INFINITY||A==="-inf")return h(E);if(A==="fro")return N(E,2);if(typeof A=="number"&&!isNaN(A)){if(!c(A,0)){var D=0;return E.forEach(function(S){D=n(i(r(S),A),D)},!0),i(D,1/A)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function v(E){var A=0;return E.forEach(function(D,S){A=n(A,u(D,a(D)))}),r(o(A))}function b(E){var A=[],D=0;return E.forEach(function(S,C){var _=C[1],R=n(A[_]||0,r(S));l(R,D)&&(D=R),A[_]=R},!0),D}function g(E){var A=E.size();if(A[0]!==A[1])throw new RangeError("Invalid matrix dimensions");var D=p(E),S=u(D,E),C=m(S).values.toArray(),_=C[C.length-1];return r(o(_))}function x(E){var A=[],D=0;return E.forEach(function(S,C){var _=C[0],R=n(A[_]||0,r(S));l(R,D)&&(D=R),A[_]=R},!0),D}function y(E,A){if(A===1)return b(E);if(A===Number.POSITIVE_INFINITY||A==="inf")return x(E);if(A==="fro")return v(E);if(A===2)return g(E);throw new Error("Unsupported parameter value "+A)}function N(E,A){var D=E.size();if(D.length===1)return w(E,A);if(D.length===2){if(D[0]&&D[1])return y(E,A);throw new RangeError("Invalid matrix dimensions")}}}),Zd="dot",x4=["typed","addScalar","multiplyScalar","conj","size"],b4=U(Zd,x4,e=>{var{typed:t,addScalar:r,multiplyScalar:n,conj:i,size:a}=e;return t(Zd,{"Array | DenseMatrix, Array | DenseMatrix":u,"SparseMatrix, SparseMatrix":c});function o(s,f){var p=l(s),m=l(f),d,h;if(p.length===1)d=p[0];else if(p.length===2&&p[1]===1)d=p[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+p.join(", ")+")");if(m.length===1)h=m[0];else if(m.length===2&&m[1]===1)h=m[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+m.join(", ")+")");if(d!==h)throw new RangeError("Vectors must have equal length ("+d+" != "+h+")");if(d===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return d}function u(s,f){var p=o(s,f),m=ke(s)?s._data:s,d=ke(s)?s._datatype||s.getDataType():void 0,h=ke(f)?f._data:f,w=ke(f)?f._datatype||f.getDataType():void 0,v=l(s).length===2,b=l(f).length===2,g=r,x=n;if(d&&w&&d===w&&typeof d=="string"&&d!=="mixed"){var y=d;g=t.find(r,[y,y]),x=t.find(n,[y,y])}if(!v&&!b){for(var N=x(i(m[0]),h[0]),E=1;E<p;E++)N=g(N,x(i(m[E]),h[E]));return N}if(!v&&b){for(var A=x(i(m[0]),h[0][0]),D=1;D<p;D++)A=g(A,x(i(m[D]),h[D][0]));return A}if(v&&!b){for(var S=x(i(m[0][0]),h[0]),C=1;C<p;C++)S=g(S,x(i(m[C][0]),h[C]));return S}if(v&&b){for(var _=x(i(m[0][0]),h[0][0]),R=1;R<p;R++)_=g(_,x(i(m[R][0]),h[R][0]));return _}}function c(s,f){o(s,f);for(var p=s._index,m=s._values,d=f._index,h=f._values,w=0,v=r,b=n,g=0,x=0;g<p.length&&x<d.length;){var y=p[g],N=d[x];if(y<N){g++;continue}if(y>N){x++;continue}y===N&&(w=v(w,b(m[g],h[x])),g++,x++)}return w}function l(s){return ke(s)?s.size():a(s)}}),w4="trace",N4=["typed","matrix","add"],D4=U(w4,N4,e=>{var{typed:t,matrix:r,add:n}=e;return t("trace",{Array:function(o){return i(r(o))},SparseMatrix:a,DenseMatrix:i,any:ze});function i(o){var u=o._size,c=o._data;switch(u.length){case 1:if(u[0]===1)return ze(c[0]);throw new RangeError("Matrix must be square (size: "+Ge(u)+")");case 2:{var l=u[0],s=u[1];if(l===s){for(var f=0,p=0;p<l;p++)f=n(f,c[p][p]);return f}else throw new RangeError("Matrix must be square (size: "+Ge(u)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ge(u)+")")}}function a(o){var u=o._values,c=o._index,l=o._ptr,s=o._size,f=s[0],p=s[1];if(f===p){var m=0;if(u.length>0)for(var d=0;d<p;d++)for(var h=l[d],w=l[d+1],v=h;v<w;v++){var b=c[v];if(b===d){m=n(m,u[v]);break}if(b>d)break}return m}throw new RangeError("Matrix must be square (size: "+Ge(s)+")")}}),Xd="index",E4=["typed","Index"],A4=U(Xd,E4,e=>{var{typed:t,Index:r}=e;return t(Xd,{"...number | string | BigNumber | Range | Array | Matrix":function(n){var i=n.map(function(o){return $e(o)?o.toNumber():st(o)||ke(o)?o.map(function(u){return $e(u)?u.toNumber():u}):o}),a=new r;return r.apply(a,i),a}})}),Ry=new Set(["end"]),S4="Node",C4=["mathWithTransform"],M4=U(S4,C4,e=>{var{mathWithTransform:t}=e;function r(i){for(var a of[...Ry])if(i.has(a))throw new Error('Scope contains an illegal symbol, "'+a+'" is a reserved keyword')}class n{get type(){return"Node"}get isNode(){return!0}evaluate(a){return this.compile().evaluate(a)}compile(){var a=this._compile(t,{}),o={},u=null;function c(l){var s=ia(l);return r(s),a(s,o,u)}return{evaluate:c}}_compile(a,o){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(a){throw new Error("Cannot run forEach on a Node interface")}map(a){throw new Error("Cannot run map on a Node interface")}_ifNode(a){if(!ft(a))throw new TypeError("Callback function must return a Node");return a}traverse(a){a(this,null,null);function o(u,c){u.forEach(function(l,s,f){c(l,s,f),o(l,c)})}o(this,a)}transform(a){function o(u,c,l){var s=a(u,c,l);return s!==u?s:u.map(o)}return o(this,null,null)}filter(a){var o=[];return this.traverse(function(u,c,l){a(u,c,l)&&o.push(u)}),o}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(a){return a.cloneDeep()})}equals(a){return a?this.type===a.type&&Oi(this,a):!1}toString(a){var o=this._getCustomString(a);return typeof o<"u"?o:this._toString(a)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(a){var o=this._getCustomString(a);return typeof o<"u"?o:this._toHTML(a)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(a){var o=this._getCustomString(a);return typeof o<"u"?o:this._toTex(a)}_toTex(a){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(a){if(a&&typeof a=="object")switch(typeof a.handler){case"object":case"undefined":return;case"function":return a.handler(this,a);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}return n},{isClass:!0,isNode:!0});function lr(e){return e&&e.isIndexError?new $r(e.index+1,e.min+1,e.max!==void 0?e.max+1:void 0):e}function qy(e){var{subset:t}=e;return function(r,n){try{if(Array.isArray(r))return t(r,n);if(r&&typeof r.subset=="function")return r.subset(n);if(typeof r=="string")return t(r,n);if(typeof r=="object"){if(!n.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return nr(r,n.getObjectProperty())}else throw new TypeError("Cannot apply index: unsupported type of object")}catch(i){throw lr(i)}}}var $o="AccessorNode",_4=["subset","Node"],F4=U($o,_4,e=>{var{subset:t,Node:r}=e,n=qy({subset:t});function i(o){return!(Ti(o)||Sr(o)||nt(o)||Zn(o)||pu(o)||An(o)||zt(o))}class a extends r{constructor(u,c){if(super(),!ft(u))throw new TypeError('Node expected for parameter "object"');if(!Na(c))throw new TypeError('IndexNode expected for parameter "index"');this.object=u,this.index=c}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return $o}get isAccessorNode(){return!0}_compile(u,c){var l=this.object._compile(u,c),s=this.index._compile(u,c);if(this.index.isObjectProperty()){var f=this.index.getObjectProperty();return function(p,m,d){return nr(l(p,m,d),f)}}else return function(p,m,d){var h=l(p,m,d),w=s(p,m,h);return n(h,w)}}forEach(u){u(this.object,"object",this),u(this.index,"index",this)}map(u){return new a(this._ifNode(u(this.object,"object",this)),this._ifNode(u(this.index,"index",this)))}clone(){return new a(this.object,this.index)}_toString(u){var c=this.object.toString(u);return i(this.object)&&(c="("+c+")"),c+this.index.toString(u)}_toHTML(u){var c=this.object.toHTML(u);return i(this.object)&&(c='<span class="math-parenthesis math-round-parenthesis">(</span>'+c+'<span class="math-parenthesis math-round-parenthesis">)</span>'),c+this.index.toHTML(u)}_toTex(u){var c=this.object.toTex(u);return i(this.object)&&(c="\\left(' + object + '\\right)"),c+this.index.toTex(u)}toJSON(){return{mathjs:$o,object:this.object,index:this.index}}static fromJSON(u){return new a(u.object,u.index)}}return Bt(a,"name",$o),a},{isClass:!0,isNode:!0}),Ho="ArrayNode",T4=["Node"],O4=U(Ho,T4,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),this.items=i||[],!Array.isArray(this.items)||!this.items.every(ft))throw new TypeError("Array containing Nodes expected")}get type(){return Ho}get isArrayNode(){return!0}_compile(i,a){var o=Nn(this.items,function(l){return l._compile(i,a)}),u=i.config.matrix!=="Array";if(u){var c=i.matrix;return function(l,s,f){return c(Nn(o,function(p){return p(l,s,f)}))}}else return function(l,s,f){return Nn(o,function(p){return p(l,s,f)})}}forEach(i){for(var a=0;a<this.items.length;a++){var o=this.items[a];i(o,"items["+a+"]",this)}}map(i){for(var a=[],o=0;o<this.items.length;o++)a[o]=this._ifNode(i(this.items[o],"items["+o+"]",this));return new r(a)}clone(){return new r(this.items.slice(0))}_toString(i){var a=this.items.map(function(o){return o.toString(i)});return"["+a.join(", ")+"]"}toJSON(){return{mathjs:Ho,items:this.items}}static fromJSON(i){return new r(i.items)}_toHTML(i){var a=this.items.map(function(o){return o.toHTML(i)});return'<span class="math-parenthesis math-square-parenthesis">[</span>'+a.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'}_toTex(i){function a(o,u){var c=o.some(Sr)&&!o.every(Sr),l=u||c,s=l?"&":"\\\\",f=o.map(function(p){return p.items?a(p.items,!u):p.toTex(i)}).join(s);return c||!l||l&&!u?"\\begin{bmatrix}"+f+"\\end{bmatrix}":f}return a(this.items,!1)}}return Bt(r,"name",Ho),r},{isClass:!0,isNode:!0});function B4(e){var{subset:t,matrix:r}=e;return function(n,i,a){try{if(Array.isArray(n)){var o=r(n).subset(i,a).valueOf();return o.forEach((u,c)=>{n[c]=u}),n}else{if(n&&typeof n.subset=="function")return n.subset(i,a);if(typeof n=="string")return t(n,i,a);if(typeof n=="object"){if(!i.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return fa(n,i.getObjectProperty(),a),n}else throw new TypeError("Cannot apply index: unsupported type of object")}}catch(u){throw lr(u)}}}var Ir=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function Jo(e,t){if(!t||t!=="auto")return e;for(var r=e;An(r);)r=r.content;return r}function mt(e,t,r,n){var i=e;t!=="keep"&&(i=e.getContent());for(var a=i.getIdentifier(),o=null,u=0;u<Ir.length;u++)if(a in Ir[u]){o=u;break}if(a==="OperatorNode:multiply"&&i.implicit&&r!=="show"){var c=Jo(i.args[0],t);!(nt(c)&&n&&n.getIdentifier()==="OperatorNode:divide"&&_c(Jo(n.args[0],t)))&&!(c.getIdentifier()==="OperatorNode:divide"&&_c(Jo(c.args[0],t))&&nt(Jo(c.args[1])))&&(o+=1)}return o}function $a(e,t){var r=e;t!=="keep"&&(r=e.getContent());var n=r.getIdentifier(),i=mt(r,t);if(i===null)return null;var a=Ir[i][n];if(Me(a,"associativity")){if(a.associativity==="left")return"left";if(a.associativity==="right")return"right";throw Error("'"+n+"' has the invalid associativity '"+a.associativity+"'.")}return null}function fc(e,t,r){var n=r!=="keep"?e.getContent():e,i=r!=="keep"?e.getContent():t,a=n.getIdentifier(),o=i.getIdentifier(),u=mt(n,r);if(u===null)return null;var c=Ir[u][a];if(Me(c,"associativeWith")&&c.associativeWith instanceof Array){for(var l=0;l<c.associativeWith.length;l++)if(c.associativeWith[l]===o)return!0;return!1}return null}function k4(e){var t="OperatorNode:"+e;for(var r of Ir)if(t in r)return r[t].op;return null}var Go="AssignmentNode",I4=["subset","?matrix","Node"],R4=U(Go,I4,e=>{var{subset:t,matrix:r,Node:n}=e,i=qy({subset:t}),a=B4({subset:t,matrix:r});function o(c,l,s){l||(l="keep");var f=mt(c,l,s),p=mt(c.value,l,s);return l==="all"||p!==null&&p<=f}class u extends n{constructor(l,s,f){if(super(),this.object=l,this.index=f?s:null,this.value=f||s,!zt(l)&&!Ti(l))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(zt(l)&&l.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!Na(this.index))throw new TypeError('IndexNode expected as "index"');if(!ft(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 Go}get isAssignmentNode(){return!0}_compile(l,s){var f=this.object._compile(l,s),p=this.index?this.index._compile(l,s):null,m=this.value._compile(l,s),d=this.object.name;if(this.index)if(this.index.isObjectProperty()){var h=this.index.getObjectProperty();return function(g,x,y){var N=f(g,x,y),E=m(g,x,y);return fa(N,h,E),E}}else{if(zt(this.object))return function(g,x,y){var N=f(g,x,y),E=m(g,x,y),A=p(g,x,N);return g.set(d,a(N,A,E)),E};var w=this.object.object._compile(l,s);if(this.object.index.isObjectProperty()){var v=this.object.index.getObjectProperty();return function(g,x,y){var N=w(g,x,y),E=nr(N,v),A=p(g,x,E),D=m(g,x,y);return fa(N,v,a(E,A,D)),D}}else{var b=this.object.index._compile(l,s);return function(g,x,y){var N=w(g,x,y),E=b(g,x,N),A=i(N,E),D=p(g,x,A),S=m(g,x,y);return a(N,E,a(A,D,S)),S}}}else{if(!zt(this.object))throw new TypeError("SymbolNode expected as object");return function(g,x,y){var N=m(g,x,y);return g.set(d,N),N}}}forEach(l){l(this.object,"object",this),this.index&&l(this.index,"index",this),l(this.value,"value",this)}map(l){var s=this._ifNode(l(this.object,"object",this)),f=this.index?this._ifNode(l(this.index,"index",this)):null,p=this._ifNode(l(this.value,"value",this));return new u(s,f,p)}clone(){return new u(this.object,this.index,this.value)}_toString(l){var s=this.object.toString(l),f=this.index?this.index.toString(l):"",p=this.value.toString(l);return o(this,l&&l.parenthesis,l&&l.implicit)&&(p="("+p+")"),s+f+" = "+p}toJSON(){return{mathjs:Go,object:this.object,index:this.index,value:this.value}}static fromJSON(l){return new u(l.object,l.index,l.value)}_toHTML(l){var s=this.object.toHTML(l),f=this.index?this.index.toHTML(l):"",p=this.value.toHTML(l);return o(this,l&&l.parenthesis,l&&l.implicit)&&(p='<span class="math-paranthesis math-round-parenthesis">(</span>'+p+'<span class="math-paranthesis math-round-parenthesis">)</span>'),s+f+'<span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+p}_toTex(l){var s=this.object.toTex(l),f=this.index?this.index.toTex(l):"",p=this.value.toTex(l);return o(this,l&&l.parenthesis,l&&l.implicit)&&(p="\\left(".concat(p,"\\right)")),s+f+"="+p}}return Bt(u,"name",Go),u},{isClass:!0,isNode:!0}),Wo="BlockNode",q4=["ResultSet","Node"],z4=U(Wo,q4,e=>{var{ResultSet:t,Node:r}=e;class n extends r{constructor(a){if(super(),!Array.isArray(a))throw new Error("Array expected");this.blocks=a.map(function(o){var u=o&&o.node,c=o&&o.visible!==void 0?o.visible:!0;if(!ft(u))throw new TypeError('Property "node" must be a Node');if(typeof c!="boolean")throw new TypeError('Property "visible" must be a boolean');return{node:u,visible:c}})}get type(){return Wo}get isBlockNode(){return!0}_compile(a,o){var u=Nn(this.blocks,function(c){return{evaluate:c.node._compile(a,o),visible:c.visible}});return function(c,l,s){var f=[];return yu(u,function(p){var m=p.evaluate(c,l,s);p.visible&&f.push(m)}),new t(f)}}forEach(a){for(var o=0;o<this.blocks.length;o++)a(this.blocks[o].node,"blocks["+o+"].node",this)}map(a){for(var o=[],u=0;u<this.blocks.length;u++){var c=this.blocks[u],l=this._ifNode(a(c.node,"blocks["+u+"].node",this));o[u]={node:l,visible:c.visible}}return new n(o)}clone(){var a=this.blocks.map(function(o){return{node:o.node,visible:o.visible}});return new n(a)}_toString(a){return this.blocks.map(function(o){return o.node.toString(a)+(o.visible?"":";")}).join(`
|
|
29
|
-
`)}toJSON(){return{mathjs:
|
|
30
|
-
`)}}return Bt(n,"name",Wo),n},{isClass:!0,isNode:!0}),Ko="ConditionalNode",j4=["Node"],L4=U(Ko,j4,e=>{var{Node:t}=e;function r(i){if(typeof i=="number"||typeof i=="boolean"||typeof i=="string")return!!i;if(i){if($e(i))return!i.isZero();if(wn(i))return!!(i.re||i.im);if(Cr(i))return!!i.value}if(i==null)return!1;throw new TypeError('Unsupported type of condition "'+dt(i)+'"')}class n extends t{constructor(a,o,u){if(super(),!ft(a))throw new TypeError("Parameter condition must be a Node");if(!ft(o))throw new TypeError("Parameter trueExpr must be a Node");if(!ft(u))throw new TypeError("Parameter falseExpr must be a Node");this.condition=a,this.trueExpr=o,this.falseExpr=u}get type(){return Ko}get isConditionalNode(){return!0}_compile(a,o){var u=this.condition._compile(a,o),c=this.trueExpr._compile(a,o),l=this.falseExpr._compile(a,o);return function(s,f,p){return r(u(s,f,p))?c(s,f,p):l(s,f,p)}}forEach(a){a(this.condition,"condition",this),a(this.trueExpr,"trueExpr",this),a(this.falseExpr,"falseExpr",this)}map(a){return new n(this._ifNode(a(this.condition,"condition",this)),this._ifNode(a(this.trueExpr,"trueExpr",this)),this._ifNode(a(this.falseExpr,"falseExpr",this)))}clone(){return new n(this.condition,this.trueExpr,this.falseExpr)}_toString(a){var o=a&&a.parenthesis?a.parenthesis:"keep",u=mt(this,o,a&&a.implicit),c=this.condition.toString(a),l=mt(this.condition,o,a&&a.implicit);(o==="all"||this.condition.type==="OperatorNode"||l!==null&&l<=u)&&(c="("+c+")");var s=this.trueExpr.toString(a),f=mt(this.trueExpr,o,a&&a.implicit);(o==="all"||this.trueExpr.type==="OperatorNode"||f!==null&&f<=u)&&(s="("+s+")");var p=this.falseExpr.toString(a),m=mt(this.falseExpr,o,a&&a.implicit);return(o==="all"||this.falseExpr.type==="OperatorNode"||m!==null&&m<=u)&&(p="("+p+")"),c+" ? "+s+" : "+p}toJSON(){return{mathjs:Ko,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(a){return new n(a.condition,a.trueExpr,a.falseExpr)}_toHTML(a){var o=a&&a.parenthesis?a.parenthesis:"keep",u=mt(this,o,a&&a.implicit),c=this.condition.toHTML(a),l=mt(this.condition,o,a&&a.implicit);(o==="all"||this.condition.type==="OperatorNode"||l!==null&&l<=u)&&(c='<span class="math-parenthesis math-round-parenthesis">(</span>'+c+'<span class="math-parenthesis math-round-parenthesis">)</span>');var s=this.trueExpr.toHTML(a),f=mt(this.trueExpr,o,a&&a.implicit);(o==="all"||this.trueExpr.type==="OperatorNode"||f!==null&&f<=u)&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>');var p=this.falseExpr.toHTML(a),m=mt(this.falseExpr,o,a&&a.implicit);return(o==="all"||this.falseExpr.type==="OperatorNode"||m!==null&&m<=u)&&(p='<span class="math-parenthesis math-round-parenthesis">(</span>'+p+'<span class="math-parenthesis math-round-parenthesis">)</span>'),c+'<span class="math-operator math-conditional-operator">?</span>'+s+'<span class="math-operator math-conditional-operator">:</span>'+p}_toTex(a){return"\\begin{cases} {"+this.trueExpr.toTex(a)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(a)+"}\\\\{"+this.falseExpr.toTex(a)+"}, &\\quad{\\text{otherwise}}\\end{cases}"}}return Bt(n,"name",Ko),n},{isClass:!0,isNode:!0}),Pc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},P4={"{":"\\{","}":"\\}","\\":"\\textbackslash{}","#":"\\#",$:"\\$","%":"\\%","&":"\\&","^":"\\textasciicircum{}",_:"\\_","~":"\\textasciitilde{}"},V4={"–":"\\--","—":"\\---"," ":"~"," ":"\\qquad{}","\r\n":"\\newline{}","\n":"\\newline{}"},U4=function(e,t){return Pc({},e,t)},$4=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.preserveFormatting,n=r===void 0?!1:r,i=t.escapeMapFn,a=i===void 0?U4:i,o=String(e),u="",c=a(Pc({},P4),n?Pc({},V4):{}),l=Object.keys(c),s=function(){var f=!1;l.forEach(function(p,m){f||o.length>=p.length&&o.slice(0,p.length)===p&&(u+=c[l[m]],o=o.slice(p.length,o.length),f=!0)}),f||(u+=o.slice(0,1),o=o.slice(1,o.length))};o;)s();return u};const H4=wo($4);var Vc={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{?}"},at={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"},Yd={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(at.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(at.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(at.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(at.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(at.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},gcd:"\\gcd\\left(${args}\\right)",hypot:"\\hypot\\left(${args}\\right)",log:{1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},log10:{1:"\\log_{10}\\left(${args[0]}\\right)"},log1p:{1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},log2:"\\log_{2}\\left(${args[0]}\\right)",mod:{2:"\\left(${args[0]}".concat(at.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(at.multiply,"${args[1]}\\right)")},norm:{1:"\\left\\|${args[0]}\\right\\|",2:void 0},nthRoot:{2:"\\sqrt[${args[1]}]{${args[0]}}"},nthRoots:{2:"\\{y : $y^{args[1]} = {${args[0]}}\\}"},pow:{2:"\\left(${args[0]}\\right)".concat(at.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(at.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(at.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(at.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(at.bitAnd,"${args[1]}\\right)")},bitNot:{1:at.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(at.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(at.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(at.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(at.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(at.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(at.and,"${args[1]}\\right)")},not:{1:at.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(at.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(at.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(at.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(at.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(at.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(at.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(at.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(at.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(at.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(at.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(at.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(at.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(at.to,"${args[1]}\\right)")},numeric:function(e,t){return e.args[0].toTex()},number:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:"0",1:"\\left(${args[0]}\\right)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(Vc.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)"}},J4="\\mathrm{${name}}\\left(${args}\\right)",eh={deg:"^\\circ"};function Uc(e){return H4(e,{preserveFormatting:!0})}function zy(e,t){return t=typeof t>"u"?!1:t,t?Me(eh,e)?eh[e]:"\\mathrm{"+Uc(e)+"}":Me(Vc,e)?Vc[e]:Uc(e)}var Qo="ConstantNode",G4=["Node"],W4=U(Qo,G4,e=>{var{Node:t}=e;class r extends t{constructor(i){super(),this.value=i}get type(){return Qo}get isConstantNode(){return!0}_compile(i,a){var o=this.value;return function(){return o}}forEach(i){}map(i){return this.clone()}clone(){return new r(this.value)}_toString(i){return Ge(this.value,i)}_toHTML(i){var a=this._toString(i);switch(dt(this.value)){case"number":case"BigNumber":case"Fraction":return'<span class="math-number">'+a+"</span>";case"string":return'<span class="math-string">'+a+"</span>";case"boolean":return'<span class="math-boolean">'+a+"</span>";case"null":return'<span class="math-null-symbol">'+a+"</span>";case"undefined":return'<span class="math-undefined">'+a+"</span>";default:return'<span class="math-symbol">'+a+"</span>"}}toJSON(){return{mathjs:Qo,value:this.value}}static fromJSON(i){return new r(i.value)}_toTex(i){var a=this._toString(i),o=dt(this.value);switch(o){case"string":return"\\mathtt{"+Uc(a)+"}";case"number":case"BigNumber":{var u=o==="BigNumber"?this.value.isFinite():isFinite(this.value);if(!u)return this.value.valueOf()<0?"-\\infty":"\\infty";var c=a.toLowerCase().indexOf("e");return c!==-1?a.substring(0,c)+"\\cdot10^{"+a.substring(c+1)+"}":a}case"Fraction":return this.value.toLatex();default:return a}}}return Bt(r,"name",Qo),r},{isClass:!0,isNode:!0}),Zo="FunctionAssignmentNode",K4=["typed","Node"],Q4=U(Zo,K4,e=>{var{typed:t,Node:r}=e;function n(a,o,u){var c=mt(a,o,u),l=mt(a.expr,o,u);return o==="all"||l!==null&&l<=c}class i extends r{constructor(o,u,c){if(super(),typeof o!="string")throw new TypeError('String expected for parameter "name"');if(!Array.isArray(u))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!ft(c))throw new TypeError('Node expected for parameter "expr"');if(Ry.has(o))throw new Error('Illegal function name, "'+o+'" is a reserved keyword');var l=new Set;for(var s of u){var f=typeof s=="string"?s:s.name;if(l.has(f))throw new Error('Duplicate parameter name "'.concat(f,'"'));l.add(f)}this.name=o,this.params=u.map(function(p){return p&&p.name||p}),this.types=u.map(function(p){return p&&p.type||"any"}),this.expr=c}get type(){return Zo}get isFunctionAssignmentNode(){return!0}_compile(o,u){var c=Object.create(u);yu(this.params,function(d){c[d]=!0});var l=this.expr._compile(o,c),s=this.name,f=this.params,p=ep(this.types,","),m=s+"("+ep(this.params,", ")+")";return function(d,h,w){var v={};v[p]=function(){for(var g=Object.create(h),x=0;x<f.length;x++)g[f[x]]=arguments[x];return l(d,g,w)};var b=t(s,v);return b.syntax=m,d.set(s,b),b}}forEach(o){o(this.expr,"expr",this)}map(o){var u=this._ifNode(o(this.expr,"expr",this));return new i(this.name,this.params.slice(0),u)}clone(){return new i(this.name,this.params.slice(0),this.expr)}_toString(o){var u=o&&o.parenthesis?o.parenthesis:"keep",c=this.expr.toString(o);return n(this,u,o&&o.implicit)&&(c="("+c+")"),this.name+"("+this.params.join(", ")+") = "+c}toJSON(){var o=this.types;return{mathjs:Zo,name:this.name,params:this.params.map(function(u,c){return{name:u,type:o[c]}}),expr:this.expr}}static fromJSON(o){return new i(o.name,o.params,o.expr)}_toHTML(o){for(var u=o&&o.parenthesis?o.parenthesis:"keep",c=[],l=0;l<this.params.length;l++)c.push('<span class="math-symbol math-parameter">'+Mr(this.params[l])+"</span>");var s=this.expr.toHTML(o);return n(this,u,o&&o.implicit)&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),'<span class="math-function">'+Mr(this.name)+'</span><span class="math-parenthesis math-round-parenthesis">(</span>'+c.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>'+s}_toTex(o){var u=o&&o.parenthesis?o.parenthesis:"keep",c=this.expr.toTex(o);return n(this,u,o&&o.implicit)&&(c="\\left(".concat(c,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(zy).join(",")+"\\right)="+c}}return Bt(i,"name",Zo),i},{isClass:!0,isNode:!0}),Xo="IndexNode",Z4=["Node","size"],X4=U(Xo,Z4,e=>{var{Node:t,size:r}=e;class n extends t{constructor(a,o){if(super(),this.dimensions=a,this.dotNotation=o||!1,!Array.isArray(a)||!a.every(ft))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 Xo}get isIndexNode(){return!0}_compile(a,o){var u=Nn(this.dimensions,function(l,s){var f=l.filter(d=>d.isSymbolNode&&d.name==="end").length>0;if(f){var p=Object.create(o);p.end=!0;var m=l._compile(a,p);return function(d,h,w){if(!ke(w)&&!st(w)&&!Qt(w))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+dt(w));var v=r(w).valueOf(),b=Object.create(h);return b.end=v[s],m(d,b,w)}}else return l._compile(a,o)}),c=nr(a,"index");return function(l,s,f){var p=Nn(u,function(m){return m(l,s,f)});return c(...p)}}forEach(a){for(var o=0;o<this.dimensions.length;o++)a(this.dimensions[o],"dimensions["+o+"]",this)}map(a){for(var o=[],u=0;u<this.dimensions.length;u++)o[u]=this._ifNode(a(this.dimensions[u],"dimensions["+u+"]",this));return new n(o,this.dotNotation)}clone(){return new n(this.dimensions.slice(0),this.dotNotation)}isObjectProperty(){return this.dimensions.length===1&&nt(this.dimensions[0])&&typeof this.dimensions[0].value=="string"}getObjectProperty(){return this.isObjectProperty()?this.dimensions[0].value:null}_toString(a){return this.dotNotation?"."+this.getObjectProperty():"["+this.dimensions.join(", ")+"]"}toJSON(){return{mathjs:Xo,dimensions:this.dimensions,dotNotation:this.dotNotation}}static fromJSON(a){return new n(a.dimensions,a.dotNotation)}_toHTML(a){for(var o=[],u=0;u<this.dimensions.length;u++)o[u]=this.dimensions[u].toHTML();return this.dotNotation?'<span class="math-operator math-accessor-operator">.</span><span class="math-symbol math-property">'+Mr(this.getObjectProperty())+"</span>":'<span class="math-parenthesis math-square-parenthesis">[</span>'+o.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'}_toTex(a){var o=this.dimensions.map(function(u){return u.toTex(a)});return this.dotNotation?"."+this.getObjectProperty():"_{"+o.join(",")+"}"}}return Bt(n,"name",Xo),n},{isClass:!0,isNode:!0}),Yo="ObjectNode",Y4=["Node"],eF=U(Yo,Y4,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),this.properties=i||{},i&&(typeof i!="object"||!Object.keys(i).every(function(a){return ft(i[a])})))throw new TypeError("Object containing Nodes expected")}get type(){return Yo}get isObjectNode(){return!0}_compile(i,a){var o={};for(var u in this.properties)if(Me(this.properties,u)){var c=ra(u),l=JSON.parse(c),s=nr(this.properties,u);o[l]=s._compile(i,a)}return function(f,p,m){var d={};for(var h in o)Me(o,h)&&(d[h]=o[h](f,p,m));return d}}forEach(i){for(var a in this.properties)Me(this.properties,a)&&i(this.properties[a],"properties["+ra(a)+"]",this)}map(i){var a={};for(var o in this.properties)Me(this.properties,o)&&(a[o]=this._ifNode(i(this.properties[o],"properties["+ra(o)+"]",this)));return new r(a)}clone(){var i={};for(var a in this.properties)Me(this.properties,a)&&(i[a]=this.properties[a]);return new r(i)}_toString(i){var a=[];for(var o in this.properties)Me(this.properties,o)&&a.push(ra(o)+": "+this.properties[o].toString(i));return"{"+a.join(", ")+"}"}toJSON(){return{mathjs:Yo,properties:this.properties}}static fromJSON(i){return new r(i.properties)}_toHTML(i){var a=[];for(var o in this.properties)Me(this.properties,o)&&a.push('<span class="math-symbol math-property">'+Mr(o)+'</span><span class="math-operator math-assignment-operator math-property-assignment-operator math-binary-operator">:</span>'+this.properties[o].toHTML(i));return'<span class="math-parenthesis math-curly-parenthesis">{</span>'+a.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-curly-parenthesis">}</span>'}_toTex(i){var a=[];for(var o in this.properties)Me(this.properties,o)&&a.push("\\mathbf{"+o+":} & "+this.properties[o].toTex(i)+"\\\\");var u="\\left\\{\\begin{array}{ll}"+a.join(`
|
|
31
|
-
`)+"\\end{array}\\right\\}";return u}}return Bt(r,"name",Yo),r},{isClass:!0,isNode:!0});function Za(e,t){return new Wg(e,new du(t),new Set(Object.keys(t)))}var es="OperatorNode",tF=["Node"],rF=U(es,tF,e=>{var{Node:t}=e;function r(a,o){var u=a;if(o==="auto")for(;An(u);)u=u.content;return nt(u)?!0:Ct(u)?r(u.args[0],o):!1}function n(a,o,u,c,l){var s=mt(a,o,u),f=$a(a,o);if(o==="all"||c.length>2&&a.getIdentifier()!=="OperatorNode:add"&&a.getIdentifier()!=="OperatorNode:multiply")return c.map(function(S){switch(S.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});var p;switch(c.length){case 0:p=[];break;case 1:{var m=mt(c[0],o,u,a);if(l&&m!==null){var d,h;if(o==="keep"?(d=c[0].getIdentifier(),h=a.getIdentifier()):(d=c[0].getContent().getIdentifier(),h=a.getContent().getIdentifier()),Ir[s][h].latexLeftParens===!1){p=[!1];break}if(Ir[m][d].latexParens===!1){p=[!1];break}}if(m===null){p=[!1];break}if(m<=s){p=[!0];break}p=[!1]}break;case 2:{var w,v=mt(c[0],o,u,a),b=fc(a,c[0],o);v===null?w=!1:v===s&&f==="right"&&!b||v<s?w=!0:w=!1;var g,x=mt(c[1],o,u,a),y=fc(a,c[1],o);if(x===null?g=!1:x===s&&f==="left"&&!y||x<s?g=!0:g=!1,l){var N,E,A;o==="keep"?(N=a.getIdentifier(),E=a.args[0].getIdentifier(),A=a.args[1].getIdentifier()):(N=a.getContent().getIdentifier(),E=a.args[0].getContent().getIdentifier(),A=a.args[1].getContent().getIdentifier()),v!==null&&(Ir[s][N].latexLeftParens===!1&&(w=!1),Ir[v][E].latexParens===!1&&(w=!1)),x!==null&&(Ir[s][N].latexRightParens===!1&&(g=!1),Ir[x][A].latexParens===!1&&(g=!1))}p=[w,g]}break;default:(a.getIdentifier()==="OperatorNode:add"||a.getIdentifier()==="OperatorNode:multiply")&&(p=c.map(function(S){var C=mt(S,o,u,a),_=fc(a,S,o),R=$a(S,o);return C===null?!1:s===C&&f===R&&!_?!0:C<s}));break}if(c.length>=2&&a.getIdentifier()==="OperatorNode:multiply"&&a.implicit&&o!=="all"&&u==="hide")for(var D=1;D<p.length;++D)r(c[D],o)&&!p[D-1]&&(o!=="keep"||!An(c[D-1]))&&(p[D]=!0);return p}class i extends t{constructor(o,u,c,l,s){if(super(),typeof o!="string")throw new TypeError('string expected for parameter "op"');if(typeof u!="string")throw new TypeError('string expected for parameter "fn"');if(!Array.isArray(c)||!c.every(ft))throw new TypeError('Array containing Nodes expected for parameter "args"');this.implicit=l===!0,this.isPercentage=s===!0,this.op=o,this.fn=u,this.args=c||[]}get type(){return es}get isOperatorNode(){return!0}_compile(o,u){if(typeof this.fn!="string"||!xl(o,this.fn))throw o[this.fn]?new Error('No access to function "'+this.fn+'"'):new Error("Function "+this.fn+' missing in provided namespace "math"');var c=nr(o,this.fn),l=Nn(this.args,function(d){return d._compile(o,u)});if(typeof c=="function"&&c.rawArgs===!0){var s=this.args;return function(d,h,w){return c(s,o,Za(d,h))}}else if(l.length===1){var f=l[0];return function(d,h,w){return c(f(d,h,w))}}else if(l.length===2){var p=l[0],m=l[1];return function(d,h,w){return c(p(d,h,w),m(d,h,w))}}else return function(d,h,w){return c.apply(null,Nn(l,function(v){return v(d,h,w)}))}}forEach(o){for(var u=0;u<this.args.length;u++)o(this.args[u],"args["+u+"]",this)}map(o){for(var u=[],c=0;c<this.args.length;c++)u[c]=this._ifNode(o(this.args[c],"args["+c+"]",this));return new i(this.op,this.fn,u,this.implicit,this.isPercentage)}clone(){return new i(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(o){var u=o&&o.parenthesis?o.parenthesis:"keep",c=o&&o.implicit?o.implicit:"hide",l=this.args,s=n(this,u,c,l,!1);if(l.length===1){var f=$a(this,u),p=l[0].toString(o);s[0]&&(p="("+p+")");var m=/[a-zA-Z]+/.test(this.op);return f==="right"?this.op+(m?" ":"")+p:f==="left"?p+(m?" ":"")+this.op:p+this.op}else if(l.length===2){var d=l[0].toString(o),h=l[1].toString(o);return s[0]&&(d="("+d+")"),s[1]&&(h="("+h+")"),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&c==="hide"?d+" "+h:d+" "+this.op+" "+h}else if(l.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var w=l.map(function(v,b){return v=v.toString(o),s[b]&&(v="("+v+")"),v});return this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&c==="hide"?w.join(" "):w.join(" "+this.op+" ")}else return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:es,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(o){return new i(o.op,o.fn,o.args,o.implicit,o.isPercentage)}_toHTML(o){var u=o&&o.parenthesis?o.parenthesis:"keep",c=o&&o.implicit?o.implicit:"hide",l=this.args,s=n(this,u,c,l,!1);if(l.length===1){var f=$a(this,u),p=l[0].toHTML(o);return s[0]&&(p='<span class="math-parenthesis math-round-parenthesis">(</span>'+p+'<span class="math-parenthesis math-round-parenthesis">)</span>'),f==="right"?'<span class="math-operator math-unary-operator math-lefthand-unary-operator">'+Mr(this.op)+"</span>"+p:p+'<span class="math-operator math-unary-operator math-righthand-unary-operator">'+Mr(this.op)+"</span>"}else if(l.length===2){var m=l[0].toHTML(o),d=l[1].toHTML(o);return s[0]&&(m='<span class="math-parenthesis math-round-parenthesis">(</span>'+m+'<span class="math-parenthesis math-round-parenthesis">)</span>'),s[1]&&(d='<span class="math-parenthesis math-round-parenthesis">(</span>'+d+'<span class="math-parenthesis math-round-parenthesis">)</span>'),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&c==="hide"?m+'<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'+d:m+'<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Mr(this.op)+"</span>"+d}else{var h=l.map(function(w,v){return w=w.toHTML(o),s[v]&&(w='<span class="math-parenthesis math-round-parenthesis">(</span>'+w+'<span class="math-parenthesis math-round-parenthesis">)</span>'),w});return l.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")?this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&c==="hide"?h.join('<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'):h.join('<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Mr(this.op)+"</span>"):'<span class="math-function">'+Mr(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+h.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'}}_toTex(o){var u=o&&o.parenthesis?o.parenthesis:"keep",c=o&&o.implicit?o.implicit:"hide",l=this.args,s=n(this,u,c,l,!0),f=at[this.fn];if(f=typeof f>"u"?this.op:f,l.length===1){var p=$a(this,u),m=l[0].toTex(o);return s[0]&&(m="\\left(".concat(m,"\\right)")),p==="right"?f+m:m+f}else if(l.length===2){var d=l[0],h=d.toTex(o);s[0]&&(h="\\left(".concat(h,"\\right)"));var w=l[1],v=w.toTex(o);s[1]&&(v="\\left(".concat(v,"\\right)"));var b;switch(u==="keep"?b=d.getIdentifier():b=d.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return f+"{"+h+"}{"+v+"}";case"OperatorNode:pow":switch(h="{"+h+"}",v="{"+v+"}",b){case"ConditionalNode":case"OperatorNode:divide":h="\\left(".concat(h,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&c==="hide")return h+"~"+v}return h+f+v}else if(l.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var g=l.map(function(x,y){return x=x.toTex(o),s[y]&&(x="\\left(".concat(x,"\\right)")),x});return this.getIdentifier()==="OperatorNode:multiply"&&this.implicit&&c==="hide"?g.join("~"):g.join(f)}else return"\\mathrm{"+this.fn+"}\\left("+l.map(function(x){return x.toTex(o)}).join(",")+"\\right)"}getIdentifier(){return this.type+":"+this.fn}}return Bt(i,"name",es),i},{isClass:!0,isNode:!0}),ts="ParenthesisNode",nF=["Node"],iF=U(ts,nF,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),!ft(i))throw new TypeError('Node expected for parameter "content"');this.content=i}get type(){return ts}get isParenthesisNode(){return!0}_compile(i,a){return this.content._compile(i,a)}getContent(){return this.content.getContent()}forEach(i){i(this.content,"content",this)}map(i){var a=i(this.content,"content",this);return new r(a)}clone(){return new r(this.content)}_toString(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"("+this.content.toString(i)+")":this.content.toString(i)}toJSON(){return{mathjs:ts,content:this.content}}static fromJSON(i){return new r(i.content)}_toHTML(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?'<span class="math-parenthesis math-round-parenthesis">(</span>'+this.content.toHTML(i)+'<span class="math-parenthesis math-round-parenthesis">)</span>':this.content.toHTML(i)}_toTex(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"\\left(".concat(this.content.toTex(i),"\\right)"):this.content.toTex(i)}}return Bt(r,"name",ts),r},{isClass:!0,isNode:!0}),rs="RangeNode",aF=["Node"],oF=U(rs,aF,e=>{var{Node:t}=e;function r(i,a,o){var u=mt(i,a,o),c={},l=mt(i.start,a,o);if(c.start=l!==null&&l<=u||a==="all",i.step){var s=mt(i.step,a,o);c.step=s!==null&&s<=u||a==="all"}var f=mt(i.end,a,o);return c.end=f!==null&&f<=u||a==="all",c}class n extends t{constructor(a,o,u){if(super(),!ft(a))throw new TypeError("Node expected");if(!ft(o))throw new TypeError("Node expected");if(u&&!ft(u))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=a,this.end=o,this.step=u||null}get type(){return rs}get isRangeNode(){return!0}needsEnd(){var a=this.filter(function(o){return zt(o)&&o.name==="end"});return a.length>0}_compile(a,o){var u=a.range,c=this.start._compile(a,o),l=this.end._compile(a,o);if(this.step){var s=this.step._compile(a,o);return function(f,p,m){return u(c(f,p,m),l(f,p,m),s(f,p,m))}}else return function(f,p,m){return u(c(f,p,m),l(f,p,m))}}forEach(a){a(this.start,"start",this),a(this.end,"end",this),this.step&&a(this.step,"step",this)}map(a){return new n(this._ifNode(a(this.start,"start",this)),this._ifNode(a(this.end,"end",this)),this.step&&this._ifNode(a(this.step,"step",this)))}clone(){return new n(this.start,this.end,this.step&&this.step)}_toString(a){var o=a&&a.parenthesis?a.parenthesis:"keep",u=r(this,o,a&&a.implicit),c,l=this.start.toString(a);if(u.start&&(l="("+l+")"),c=l,this.step){var s=this.step.toString(a);u.step&&(s="("+s+")"),c+=":"+s}var f=this.end.toString(a);return u.end&&(f="("+f+")"),c+=":"+f,c}toJSON(){return{mathjs:rs,start:this.start,end:this.end,step:this.step}}static fromJSON(a){return new n(a.start,a.end,a.step)}_toHTML(a){var o=a&&a.parenthesis?a.parenthesis:"keep",u=r(this,o,a&&a.implicit),c,l=this.start.toHTML(a);if(u.start&&(l='<span class="math-parenthesis math-round-parenthesis">(</span>'+l+'<span class="math-parenthesis math-round-parenthesis">)</span>'),c=l,this.step){var s=this.step.toHTML(a);u.step&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),c+='<span class="math-operator math-range-operator">:</span>'+s}var f=this.end.toHTML(a);return u.end&&(f='<span class="math-parenthesis math-round-parenthesis">(</span>'+f+'<span class="math-parenthesis math-round-parenthesis">)</span>'),c+='<span class="math-operator math-range-operator">:</span>'+f,c}_toTex(a){var o=a&&a.parenthesis?a.parenthesis:"keep",u=r(this,o,a&&a.implicit),c=this.start.toTex(a);if(u.start&&(c="\\left(".concat(c,"\\right)")),this.step){var l=this.step.toTex(a);u.step&&(l="\\left(".concat(l,"\\right)")),c+=":"+l}var s=this.end.toTex(a);return u.end&&(s="\\left(".concat(s,"\\right)")),c+=":"+s,c}}return Bt(n,"name",rs),n},{isClass:!0,isNode:!0}),ns="RelationalNode",sF=["Node"],uF=U(ns,sF,e=>{var{Node:t}=e,r={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class n extends t{constructor(a,o){if(super(),!Array.isArray(a))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(o))throw new TypeError("Parameter params must be an array");if(a.length!==o.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=a,this.params=o}get type(){return ns}get isRelationalNode(){return!0}_compile(a,o){var u=this,c=this.params.map(l=>l._compile(a,o));return function(l,s,f){for(var p,m=c[0](l,s,f),d=0;d<u.conditionals.length;d++){p=m,m=c[d+1](l,s,f);var h=nr(a,u.conditionals[d]);if(!h(p,m))return!1}return!0}}forEach(a){this.params.forEach((o,u)=>a(o,"params["+u+"]",this),this)}map(a){return new n(this.conditionals.slice(),this.params.map((o,u)=>this._ifNode(a(o,"params["+u+"]",this)),this))}clone(){return new n(this.conditionals,this.params)}_toString(a){for(var o=a&&a.parenthesis?a.parenthesis:"keep",u=mt(this,o,a&&a.implicit),c=this.params.map(function(f,p){var m=mt(f,o,a&&a.implicit);return o==="all"||m!==null&&m<=u?"("+f.toString(a)+")":f.toString(a)}),l=c[0],s=0;s<this.conditionals.length;s++)l+=" "+r[this.conditionals[s]],l+=" "+c[s+1];return l}toJSON(){return{mathjs:ns,conditionals:this.conditionals,params:this.params}}static fromJSON(a){return new n(a.conditionals,a.params)}_toHTML(a){for(var o=a&&a.parenthesis?a.parenthesis:"keep",u=mt(this,o,a&&a.implicit),c=this.params.map(function(f,p){var m=mt(f,o,a&&a.implicit);return o==="all"||m!==null&&m<=u?'<span class="math-parenthesis math-round-parenthesis">(</span>'+f.toHTML(a)+'<span class="math-parenthesis math-round-parenthesis">)</span>':f.toHTML(a)}),l=c[0],s=0;s<this.conditionals.length;s++)l+='<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Mr(r[this.conditionals[s]])+"</span>"+c[s+1];return l}_toTex(a){for(var o=a&&a.parenthesis?a.parenthesis:"keep",u=mt(this,o,a&&a.implicit),c=this.params.map(function(f,p){var m=mt(f,o,a&&a.implicit);return o==="all"||m!==null&&m<=u?"\\left("+f.toTex(a)+"\right)":f.toTex(a)}),l=c[0],s=0;s<this.conditionals.length;s++)l+=at[this.conditionals[s]]+c[s+1];return l}}return Bt(n,"name",ns),n},{isClass:!0,isNode:!0}),cF="SymbolNode",lF=["math","?Unit","Node"],fF=U(cF,lF,e=>{var{math:t,Unit:r,Node:n}=e;function i(o){return r?r.isValuelessUnit(o):!1}class a 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,c){var l=this.name;if(c[l]===!0)return function(f,p,m){return nr(p,l)};if(l in u)return function(f,p,m){return f.has(l)?f.get(l):nr(u,l)};var s=i(l);return function(f,p,m){return f.has(l)?f.get(l):s?new r(null,l):a.onUndefinedSymbol(l)}}forEach(u){}map(u){return this.clone()}static onUndefinedSymbol(u){throw new Error("Undefined symbol "+u)}clone(){return new a(this.name)}_toString(u){return this.name}_toHTML(u){var c=Mr(this.name);return c==="true"||c==="false"?'<span class="math-symbol math-boolean">'+c+"</span>":c==="i"?'<span class="math-symbol math-imaginary-symbol">'+c+"</span>":c==="Infinity"?'<span class="math-symbol math-infinity-symbol">'+c+"</span>":c==="NaN"?'<span class="math-symbol math-nan-symbol">'+c+"</span>":c==="null"?'<span class="math-symbol math-null-symbol">'+c+"</span>":c==="undefined"?'<span class="math-symbol math-undefined-symbol">'+c+"</span>":'<span class="math-symbol">'+c+"</span>"}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(u){return new a(u.name)}_toTex(u){var c=!1;typeof t[this.name]>"u"&&i(this.name)&&(c=!0);var l=zy(this.name,c);return l[0]==="\\"?l:" "+l}}return a},{isClass:!0,isNode:!0}),is="FunctionNode",pF=["math","Node","SymbolNode"],mF=U(is,pF,e=>{var t,{math:r,Node:n,SymbolNode:i}=e,a=c=>Ge(c,{truncate:78});function o(c,l,s){for(var f="",p=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,m=0,d;(d=p.exec(c))!==null;)if(f+=c.substring(m,d.index),m=d.index,d[0]==="$$")f+="$",m++;else{m+=d[0].length;var h=l[d[1]];if(!h)throw new ReferenceError("Template: Property "+d[1]+" does not exist.");if(d[2]===void 0)switch(typeof h){case"string":f+=h;break;case"object":if(ft(h))f+=h.toTex(s);else if(Array.isArray(h))f+=h.map(function(w,v){if(ft(w))return w.toTex(s);throw new TypeError("Template: "+d[1]+"["+v+"] is not a Node.")}).join(",");else throw new TypeError("Template: "+d[1]+" has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: "+d[1]+" has to be a Node, String or array of Nodes")}else if(ft(h[d[2]]&&h[d[2]]))f+=h[d[2]].toTex(s);else throw new TypeError("Template: "+d[1]+"["+d[2]+"] is not a Node.")}return f+=c.slice(m),f}class u extends n{constructor(l,s){if(super(),typeof l=="string"&&(l=new i(l)),!ft(l))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(s)||!s.every(ft))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=l,this.args=s||[]}get name(){return this.fn.name||""}get type(){return is}get isFunctionNode(){return!0}_compile(l,s){var f=this.args.map(A=>A._compile(l,s));if(zt(this.fn)){var p=this.fn.name;if(s[p]){var m=this.args;return function(A,D,S){var C=nr(D,p);if(typeof C!="function")throw new TypeError("Argument '".concat(p,"' was not a function; received: ").concat(a(C)));if(C.rawArgs)return C(m,l,Za(A,D));var _=f.map(R=>R(A,D,S));return C.apply(C,_)}}else{var d=p in l?nr(l,p):void 0,h=typeof d=="function"&&d.rawArgs===!0,w=A=>{var D;if(A.has(p))D=A.get(p);else if(p in l)D=nr(l,p);else return u.onUndefinedFunction(p);if(typeof D=="function")return D;throw new TypeError("'".concat(p,`' is not a function; its value is:
|
|
32
|
-
`).concat(a(D)))};if(h){var v=this.args;return function(A,D,S){var C=w(A);return C(v,l,
|
|
33
|
-
`.concat(a(C)));if(C.rawArgs)return C(E,l,
|
|
26
|
+
**/(function(e,t){(function(r){var n=2e3,i={s:1,n:0,d:1};function a(v,x){if(isNaN(v=parseInt(v,10)))throw h();return v*x}function o(v,x){if(x===0)throw d();var g=Object.create(m.prototype);g.s=v<0?-1:1,v=v<0?-v:v;var b=p(v,x);return g.n=v/b,g.d=x/b,g}function u(v){for(var x={},g=v,b=2,y=4;y<=g;){for(;g%b===0;)g/=b,x[b]=(x[b]||0)+1;y+=1+2*b++}return g!==v?g>1&&(x[g]=(x[g]||0)+1):x[v]=(x[v]||0)+1,x}var c=function(v,x){var g=0,b=1,y=1,N=0,E=0,A=0,D=1,S=1,C=0,_=1,R=1,P=1,I=1e7,O;if(v!=null)if(x!==void 0){if(g=v,b=x,y=g*b,g%1!==0||b%1!==0)throw w()}else switch(typeof v){case"object":{if("d"in v&&"n"in v)g=v.n,b=v.d,"s"in v&&(g*=v.s);else if(0 in v)g=v[0],1 in v&&(b=v[1]);else throw h();y=g*b;break}case"number":{if(v<0&&(y=v,v=-v),v%1===0)g=v;else if(v>0){for(v>=1&&(S=Math.pow(10,Math.floor(1+Math.log(v)/Math.LN10)),v/=S);_<=I&&P<=I;)if(O=(C+R)/(_+P),v===O){_+P<=I?(g=C+R,b=_+P):P>_?(g=R,b=P):(g=C,b=_);break}else v>O?(C+=R,_+=P):(R+=C,P+=_),_>I?(g=R,b=P):(g=C,b=_);g*=S}else(isNaN(v)||isNaN(x))&&(b=g=NaN);break}case"string":{if(_=v.match(/\d+|./g),_===null)throw h();if(_[C]==="-"?(y=-1,C++):_[C]==="+"&&C++,_.length===C+1?E=a(_[C++],y):_[C+1]==="."||_[C]==="."?(_[C]!=="."&&(N=a(_[C++],y)),C++,(C+1===_.length||_[C+1]==="("&&_[C+3]===")"||_[C+1]==="'"&&_[C+3]==="'")&&(E=a(_[C],y),D=Math.pow(10,_[C].length),C++),(_[C]==="("&&_[C+2]===")"||_[C]==="'"&&_[C+2]==="'")&&(A=a(_[C+1],y),S=Math.pow(10,_[C+1].length)-1,C+=3)):_[C+1]==="/"||_[C+1]===":"?(E=a(_[C],y),D=a(_[C+2],1),C+=3):_[C+3]==="/"&&_[C+1]===" "&&(N=a(_[C],y),E=a(_[C+2],y),D=a(_[C+4],1),C+=5),_.length<=C){b=D*S,y=g=A+b*N+S*E;break}}default:throw h()}if(b===0)throw d();i.s=y<0?-1:1,i.n=Math.abs(g),i.d=Math.abs(b)};function l(v,x,g){for(var b=1;x>0;v=v*v%g,x>>=1)x&1&&(b=b*v%g);return b}function s(v,x){for(;x%2===0;x/=2);for(;x%5===0;x/=5);if(x===1)return 0;for(var g=10%x,b=1;g!==1;b++)if(g=g*10%x,b>n)return 0;return b}function f(v,x,g){for(var b=1,y=l(10,g,x),N=0;N<300;N++){if(b===y)return N;b=b*10%x,y=y*10%x}return 0}function p(v,x){if(!v)return x;if(!x)return v;for(;;){if(v%=x,!v)return x;if(x%=v,!x)return v}}function m(v,x){if(c(v,x),this instanceof m)v=p(i.d,i.n),this.s=i.s,this.n=i.n/v,this.d=i.d/v;else return o(i.s*i.n,i.d)}var d=function(){return new Error("Division by Zero")},h=function(){return new Error("Invalid argument")},w=function(){return new Error("Parameters must be integer")};m.prototype={s:1,n:0,d:1,abs:function(){return o(this.n,this.d)},neg:function(){return o(-this.s*this.n,this.d)},add:function(v,x){return c(v,x),o(this.s*this.n*i.d+i.s*this.d*i.n,this.d*i.d)},sub:function(v,x){return c(v,x),o(this.s*this.n*i.d-i.s*this.d*i.n,this.d*i.d)},mul:function(v,x){return c(v,x),o(this.s*i.s*this.n*i.n,this.d*i.d)},div:function(v,x){return c(v,x),o(this.s*i.s*this.n*i.d,this.d*i.n)},clone:function(){return o(this.s*this.n,this.d)},mod:function(v,x){if(isNaN(this.n)||isNaN(this.d))return new m(NaN);if(v===void 0)return o(this.s*this.n%this.d,1);if(c(v,x),i.n===0&&this.d===0)throw d();return o(this.s*(i.d*this.n)%(i.n*this.d),i.d*this.d)},gcd:function(v,x){return c(v,x),o(p(i.n,this.n)*p(i.d,this.d),i.d*this.d)},lcm:function(v,x){return c(v,x),i.n===0&&this.n===0?o(0,1):o(i.n*this.n,p(i.n,this.n)*p(i.d,this.d))},ceil:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new m(NaN):o(Math.ceil(v*this.s*this.n/this.d),v)},floor:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new m(NaN):o(Math.floor(v*this.s*this.n/this.d),v)},round:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new m(NaN):o(Math.round(v*this.s*this.n/this.d),v)},inverse:function(){return o(this.s*this.d,this.n)},pow:function(v,x){if(c(v,x),i.d===1)return i.s<0?o(Math.pow(this.s*this.d,i.n),Math.pow(this.n,i.n)):o(Math.pow(this.s*this.n,i.n),Math.pow(this.d,i.n));if(this.s<0)return null;var g=u(this.n),b=u(this.d),y=1,N=1;for(var E in g)if(E!=="1"){if(E==="0"){y=0;break}if(g[E]*=i.n,g[E]%i.d===0)g[E]/=i.d;else return null;y*=Math.pow(E,g[E])}for(var E in b)if(E!=="1"){if(b[E]*=i.n,b[E]%i.d===0)b[E]/=i.d;else return null;N*=Math.pow(E,b[E])}return i.s<0?o(N,y):o(y,N)},equals:function(v,x){return c(v,x),this.s*this.n*i.d===i.s*i.n*this.d},compare:function(v,x){c(v,x);var g=this.s*this.n*i.d-i.s*i.n*this.d;return(0<g)-(g<0)},simplify:function(v){if(isNaN(this.n)||isNaN(this.d))return this;v=v||.001;for(var x=this.abs(),g=x.toContinued(),b=1;b<g.length;b++){for(var y=o(g[b-1],1),N=b-2;N>=0;N--)y=y.inverse().add(g[N]);if(Math.abs(y.sub(x).valueOf())<v)return y.mul(this.s)}return this},divisible:function(v,x){return c(v,x),!(!(i.n*this.d)||this.n*i.d%(i.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(v){var x,g="",b=this.n,y=this.d;return this.s<0&&(g+="-"),y===1?g+=b:(v&&(x=Math.floor(b/y))>0&&(g+=x,g+=" ",b%=y),g+=b,g+="/",g+=y),g},toLatex:function(v){var x,g="",b=this.n,y=this.d;return this.s<0&&(g+="-"),y===1?g+=b:(v&&(x=Math.floor(b/y))>0&&(g+=x,b%=y),g+="\\frac{",g+=b,g+="}{",g+=y,g+="}"),g},toContinued:function(){var v,x=this.n,g=this.d,b=[];if(isNaN(x)||isNaN(g))return b;do b.push(Math.floor(x/g)),v=x%g,x=g,g=v;while(x!==1);return b},toString:function(v){var x=this.n,g=this.d;if(isNaN(x)||isNaN(g))return"NaN";v=v||15;var b=s(x,g),y=f(x,g,b),N=this.s<0?"-":"";if(N+=x/g|0,x%=g,x*=10,x&&(N+="."),b){for(var E=y;E--;)N+=x/g|0,x%=g,x*=10;N+="(";for(var E=b;E--;)N+=x/g|0,x%=g,x*=10;N+=")"}else for(var E=v;x&&E--;)N+=x/g|0,x%=g,x*=10;return N}},Object.defineProperty(m,"__esModule",{value:!0}),m.default=m,m.Fraction=m,e.exports=m})()})(fv);var P2=fv.exports;const dn=No(P2);var V2="Fraction",U2=[],$2=U(V2,U2,()=>(Object.defineProperty(dn,"name",{value:"Fraction"}),dn.prototype.constructor=dn,dn.prototype.type="Fraction",dn.prototype.isFraction=!0,dn.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},dn.fromJSON=function(e){return new dn(e)},dn),{isClass:!0}),H2="Range",J2=[],G2=U(H2,J2,()=>{function e(t,r,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var i=t!=null,a=r!=null,o=n!=null;if(i){if($e(t))t=t.toNumber();else if(typeof t!="number")throw new TypeError("Parameter start must be a number")}if(a){if($e(r))r=r.toNumber();else if(typeof r!="number")throw new TypeError("Parameter end must be a number")}if(o){if($e(n))n=n.toNumber();else if(typeof n!="number")throw new TypeError("Parameter step must be a number")}this.start=i?parseFloat(t):0,this.end=a?parseFloat(r):0,this.step=o?parseFloat(n):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(t){if(typeof t!="string")return null;var r=t.split(":"),n=r.map(function(a){return parseFloat(a)}),i=n.some(function(a){return isNaN(a)});if(i)return null;switch(n.length){case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[2],n[1]);default:return null}},e.prototype.clone=function(){return new e(this.start,this.end,this.step)},e.prototype.size=function(){var t=0,r=this.start,n=this.step,i=this.end,a=i-r;return Wn(n)===Wn(a)?t=Math.ceil(a/n):a===0&&(t=0),isNaN(t)&&(t=0),[t]},e.prototype.min=function(){var t=this.size()[0];if(t>0)return this.step>0?this.start:this.start+(t-1)*this.step},e.prototype.max=function(){var t=this.size()[0];if(t>0)return this.step>0?this.start+(t-1)*this.step:this.start},e.prototype.forEach=function(t){var r=this.start,n=this.step,i=this.end,a=0;if(n>0)for(;r<i;)t(r,[a],this),r+=n,a++;else if(n<0)for(;r>i;)t(r,[a],this),r+=n,a++},e.prototype.map=function(t){var r=[];return this.forEach(function(n,i,a){r[i[0]]=t(n,i,a)}),r},e.prototype.toArray=function(){var t=[];return this.forEach(function(r,n){t[n[0]]=r}),t},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(t){var r=Di(this.start,t);return this.step!==1&&(r+=":"+Di(this.step,t)),r+=":"+Di(this.end,t),r},e.prototype.toString=function(){return this.format()},e.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},e.fromJSON=function(t){return new e(t.start,t.end,t.step)},e},{isClass:!0}),W2="Matrix",K2=[],Q2=U(W2,K2,()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(t,r){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(t,r,n){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(t,r,n){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(t,r){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(t,r){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(t,r){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(t){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(t){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0});function cc(e,t,r){var n=e.constructor,i=new n(2),a="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!Fe(r))throw new Error("size must be an integer");if(e.greaterThan(i.pow(r-1).sub(1))||e.lessThan(i.pow(r-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(i.pow(r))),a="i".concat(r)}switch(t){case 2:return"".concat(e.toBinary()).concat(a);case 8:return"".concat(e.toOctal()).concat(a);case 16:return"".concat(e.toHexadecimal()).concat(a);default:throw new Error("Base ".concat(t," not supported "))}}function Z2(e,t){if(typeof t=="function")return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var{notation:r,precision:n,wordSize:i}=$g(t);switch(r){case"fixed":return Y2(e,n);case"exponential":return Zf(e,n);case"engineering":return X2(e,n);case"bin":return cc(e,2,i);case"oct":return cc(e,8,i);case"hex":return cc(e,16,i);case"auto":{var a=Xf(t==null?void 0:t.lowerExp,-3),o=Xf(t==null?void 0:t.upperExp,5);if(e.isZero())return"0";var u,c=e.toSignificantDigits(n),l=c.e;return l>=a&&l<o?u=c.toFixed():u=Zf(e,n),u.replace(/((\.\d*?)(0+))($|e)/,function(){var s=arguments[2],f=arguments[4];return s!=="."?s+f:f})}default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function X2(e,t){var r=e.e,n=r%3===0?r:r<0?r-3-r%3:r-r%3,i=e.mul(Math.pow(10,-n)),a=i.toPrecision(t);if(a.includes("e")){var o=e.constructor;a=new o(a).toFixed()}return a+"e"+(r>=0?"+":"")+n.toString()}function Zf(e,t){return t!==void 0?e.toExponential(t-1):e.toExponential()}function Y2(e,t){return e.toFixed(t)}function Xf(e,t){return Ue(e)?e:$e(e)?e.toNumber():t}function eD(e,t){var r=e.length-t.length,n=e.length;return e.substring(r,n)===t}function Ge(e,t){var r=tD(e,t);return t&&typeof t=="object"&&"truncate"in t&&r.length>t.truncate?r.substring(0,t.truncate-3)+"...":r}function tD(e,t){if(typeof e=="number")return Di(e,t);if($e(e))return Z2(e,t);if(rD(e))return!t||t.fraction!=="decimal"?e.s*e.n+"/"+e.d:e.toString();if(Array.isArray(e))return pv(e,t);if(Qt(e))return na(e);if(typeof e=="function")return e.syntax?String(e.syntax):"function";if(e&&typeof e=="object"){if(typeof e.format=="function")return e.format(t);if(e&&e.toString(t)!=={}.toString())return e.toString(t);var r=Object.keys(e).map(n=>na(n)+": "+Ge(e[n],t));return"{"+r.join(", ")+"}"}return String(e)}function na(e){for(var t=String(e),r="",n=0;n<t.length;){var i=t.charAt(n);r+=i in Yf?Yf[i]:i,n++}return'"'+r+'"'}var Yf={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"};function Mr(e){var t=String(e);return t=t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">"),t}function pv(e,t){if(Array.isArray(e)){for(var r="[",n=e.length,i=0;i<n;i++)i!==0&&(r+=", "),r+=pv(e[i],t);return r+="]",r}else return Ge(e,t)}function rD(e){return e&&typeof e=="object"&&typeof e.s=="number"&&typeof e.n=="number"&&typeof e.d=="number"||!1}function Rc(e,t){if(!Qt(e))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+dt(e)+", index: 0)");if(!Qt(t))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+dt(t)+", index: 1)");return e===t?0:e>t?1:-1}function Ke(e,t,r){if(!(this instanceof Ke))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=r,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=new Error().stack}Ke.prototype=new RangeError;Ke.prototype.constructor=RangeError;Ke.prototype.name="DimensionError";Ke.prototype.isDimensionError=!0;function $r(e,t,r){if(!(this instanceof $r))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=r),this.min!==void 0&&this.index<this.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 Ve(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function mv(e,t,r){var n,i=e.length;if(i!==t[r])throw new Ke(i,t[r]);if(r<t.length-1){var a=r+1;for(n=0;n<i;n++){var o=e[n];if(!Array.isArray(o))throw new Ke(t.length-1,t.length,"<");mv(e[n],t,a)}}else for(n=0;n<i;n++)if(Array.isArray(e[n]))throw new Ke(t.length+1,t.length,">")}function ep(e,t){var r=t.length===0;if(r){if(Array.isArray(e))throw new Ke(e.length,0)}else mv(e,t,0)}function Bs(e,t){var r=e.isMatrix?e._size:Ve(e),n=t._sourceSize;n.forEach((i,a)=>{if(i!==null&&i!==r[a])throw new Ke(i,r[a])})}function pt(e,t){if(e!==void 0){if(!Ue(e)||!Fe(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof t=="number"&&e>=t)throw new $r(e,t)}}function da(e){for(var t=0;t<e._dimensions.length;++t){var r=e._dimensions[t];if(r._data&&st(r._data)){if(r._size[0]===0)return!0}else if(r.isRange){if(r.start===r.end)return!0}else if(Qt(r)&&r.length===0)return!0}return!1}function ha(e,t,r){if(!Array.isArray(t))throw new TypeError("Array expected");if(t.length===0)throw new Error("Resizing to scalar is not supported");t.forEach(function(i){if(!Ue(i)||!Fe(i)||i<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Ge(t)+")")}),(Ue(e)||$e(e))&&(e=[e]);var n=r!==void 0?r:0;return qc(e,t,0,n),e}function qc(e,t,r,n){var i,a,o=e.length,u=t[r],c=Math.min(o,u);if(e.length=u,r<t.length-1){var l=r+1;for(i=0;i<c;i++)a=e[i],Array.isArray(a)||(a=[a],e[i]=a),qc(a,t,l,n);for(i=c;i<u;i++)a=[],e[i]=a,qc(a,t,l,n)}else{for(i=0;i<c;i++)for(;Array.isArray(e[i]);)e[i]=e[i][0];for(i=c;i<u;i++)e[i]=n}}function Nl(e,t){var r=ot(e),n=r.length;if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(t.length===0)throw new Ke(0,n,"!=");t=Dl(t,n);var i=dv(t);if(n!==i)throw new Ke(i,n,"!=");try{return nD(r,t)}catch(a){throw a instanceof Ke?new Ke(i,n,"!="):a}}function Dl(e,t){var r=dv(e),n=e.slice(),i=-1,a=e.indexOf(i),o=e.indexOf(i,a+1)>=0;if(o)throw new Error("More than one wildcard in sizes");var u=a>=0,c=t%r===0;if(u)if(c)n[a]=-t/r;else throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-r);return n}function dv(e){return e.reduce((t,r)=>t*r,1)}function nD(e,t){for(var r=e,n,i=t.length-1;i>0;i--){var a=t[i];n=[];for(var o=r.length/a,u=0;u<o;u++)n.push(r.slice(u*a,(u+1)*a));r=n}return r}function ks(e,t){for(var r=Ve(e);Array.isArray(e)&&e.length===1;)e=e[0],r.shift();for(var n=r.length;r[n-1]===1;)n--;return n<r.length&&(e=hv(e,n,0),r.length=n),e}function hv(e,t,r){var n,i;if(r<t){var a=r+1;for(n=0,i=e.length;n<i;n++)e[n]=hv(e[n],t,a)}else for(;Array.isArray(e);)e=e[0];return e}function gv(e,t,r,n){var i=n||Ve(e);if(r)for(var a=0;a<r;a++)e=[e],i.unshift(1);for(e=vv(e,t,0);i.length<t;)i.push(1);return e}function vv(e,t,r){var n,i;if(Array.isArray(e)){var a=r+1;for(n=0,i=e.length;n<i;n++)e[n]=vv(e[n],t,a)}else for(var o=r;o<t;o++)e=[e];return e}function ot(e){if(!Array.isArray(e))return e;var t=[];return e.forEach(function r(n){Array.isArray(n)?n.forEach(r):t.push(n)}),t}function Nn(e,t){return Array.prototype.map.call(e,t)}function bu(e,t){Array.prototype.forEach.call(e,t)}function yv(e,t){if(Ve(e).length!==1)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,t)}function Is(e,t){if(Ve(e).length!==1)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,r=>t.test(r))}function tp(e,t){return Array.prototype.join.call(e,t)}function ga(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(e.length===0)return e;var t=[],r=0;t[0]={value:e[0],identifier:0};for(var n=1;n<e.length;n++)e[n]===e[n-1]?r++:r=0,t.push({value:e[n],identifier:r});return t}function Rs(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(e.length===0)return e;for(var t=[],r=0;r<e.length;r++)t.push(e[r].value);return t}function so(e,t){for(var r,n=0,i=0;i<e.length;i++){var a=e[i],o=Array.isArray(a);if(i===0&&o&&(n=a.length),o&&a.length!==n)return;var u=o?so(a,t):t(a);if(r===void 0)r=u;else if(r!==u)return"mixed"}return r}function bv(e,t,r,n){if(n<r){if(e.length!==t.length)throw new Ke(e.length,t.length);for(var i=[],a=0;a<e.length;a++)i[a]=bv(e[a],t[a],r,n+1);return i}else return e.concat(t)}function xv(){var e=Array.prototype.slice.call(arguments,0,-1),t=Array.prototype.slice.call(arguments,-1);if(e.length===1)return e[0];if(e.length>1)return e.slice(1).reduce(function(r,n){return bv(r,n,t,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function iD(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=t.map(p=>p.length),i=Math.max(...n),a=new Array(i).fill(null),o=0;o<t.length;o++)for(var u=t[o],c=n[o],l=0;l<c;l++){var s=i-c+l;u[l]>a[s]&&(a[s]=u[l])}for(var f=0;f<t.length;f++)qs(t[f],a);return a}function qs(e,t){for(var r=t.length,n=e.length,i=0;i<n;i++){var a=r-n+i;if(e[i]<t[a]&&e[i]>1||e[i]>t[a])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(n," with size ").concat(e[i]," to size ").concat(t[a]))}}function rp(e,t){var r=Ve(e);if(Oi(r,t))return e;qs(r,t);var n=iD(r,t),i=n.length,a=[...Array(i-r.length).fill(1),...r],o=oD(e);r.length<i&&(o=Nl(o,a),r=Ve(o));for(var u=0;u<i;u++)r[u]<n[u]&&(o=aD(o,n[u],u),r=Ve(o));return o}function aD(e,t,r){return xv(...Array(t).fill(e),r)}function oD(e){return Tt([],e)}function sD(e){var t=0,r=1,n=Object.create(null),i=Object.create(null),a=0,o=function(u){var c=i[u];if(c&&(delete n[c],delete i[u],--t,r===c)){if(!t){a=0,r=1;return}for(;!Object.prototype.hasOwnProperty.call(n,++r););}};return e=Math.abs(e),{hit:function(u){var c=i[u],l=++a;if(n[l]=u,i[u]=l,!c)return++t,t<=e?void 0:(u=n[r],o(u),u);if(delete n[c],r===c)for(;!Object.prototype.hasOwnProperty.call(n,++r););},delete:o,clear:function(){t=a=0,r=1,n=Object.create(null),i=Object.create(null)}}}function Do(e){var{hasher:t,limit:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return r=r??Number.POSITIVE_INFINITY,t=t??JSON.stringify,function n(){typeof n.cache!="object"&&(n.cache={values:new Map,lru:sD(r||Number.POSITIVE_INFINITY)});for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var o=t(i);if(n.cache.values.has(o))return n.cache.lru.hit(o),n.cache.values.get(o);var u=e.apply(e,i);return n.cache.values.set(o,u),n.cache.values.delete(n.cache.lru.hit(o)),u}}function wv(e){return Object.keys(e.signatures||{}).reduce(function(t,r){var n=(r.match(/,/g)||[]).length+1;return Math.max(t,n)},-1)}var uD="DenseMatrix",cD=["Matrix"],lD=U(uD,cD,e=>{var{Matrix:t}=e;function r(s,f){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(f&&!Qt(f))throw new Error("Invalid datatype: "+f);if(ke(s))s.type==="DenseMatrix"?(this._data=ze(s._data),this._size=ze(s._size),this._datatype=f||s._datatype):(this._data=s.toArray(),this._size=s.size(),this._datatype=f||s._datatype);else if(s&&st(s.data)&&st(s.size))this._data=s.data,this._size=s.size,ep(this._data,this._size),this._datatype=f||s.datatype;else if(st(s))this._data=l(s),this._size=Ve(this._data),ep(this._data,this._size),this._datatype=f;else{if(s)throw new TypeError("Unsupported type of data ("+dt(s)+")");this._data=[],this._size=[0],this._datatype=f}}r.prototype=new t,r.prototype.createDenseMatrix=function(s,f){return new r(s,f)},Object.defineProperty(r,"name",{value:"DenseMatrix"}),r.prototype.constructor=r,r.prototype.type="DenseMatrix",r.prototype.isDenseMatrix=!0,r.prototype.getDataType=function(){return so(this._data,dt)},r.prototype.storage=function(){return"dense"},r.prototype.datatype=function(){return this._datatype},r.prototype.create=function(s,f){return new r(s,f)},r.prototype.subset=function(s,f,p){switch(arguments.length){case 1:return n(this,s);case 2:case 3:return a(this,s,f,p);default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.get=function(s){if(!st(s))throw new TypeError("Array expected");if(s.length!==this._size.length)throw new Ke(s.length,this._size.length);for(var f=0;f<s.length;f++)pt(s[f],this._size[f]);for(var p=this._data,m=0,d=s.length;m<d;m++){var h=s[m];pt(h,p.length),p=p[h]}return p},r.prototype.set=function(s,f,p){if(!st(s))throw new TypeError("Array expected");if(s.length<this._size.length)throw new Ke(s.length,this._size.length,"<");var m,d,h,w=s.map(function(x){return x+1});c(this,w,p);var v=this._data;for(m=0,d=s.length-1;m<d;m++)h=s[m],pt(h,v.length),v=v[h];return h=s[s.length-1],pt(h,v.length),v[h]=f,this};function n(s,f){if(!fu(f))throw new TypeError("Invalid index");var p=f.isScalar();if(p)return s.get(f.min());var m=f.size();if(m.length!==s._size.length)throw new Ke(m.length,s._size.length);for(var d=f.min(),h=f.max(),w=0,v=s._size.length;w<v;w++)pt(d[w],s._size[w]),pt(h[w],s._size[w]);return new r(i(s._data,f,m.length,0),s._datatype)}function i(s,f,p,m){var d=m===p-1,h=f.dimension(m);return d?h.map(function(w){return pt(w,s.length),s[w]}).valueOf():h.map(function(w){pt(w,s.length);var v=s[w];return i(v,f,p,m+1)}).valueOf()}function a(s,f,p,m){if(!f||f.isIndex!==!0)throw new TypeError("Invalid index");var d=f.size(),h=f.isScalar(),w;if(ke(p)?(w=p.size(),p=p.valueOf()):w=Ve(p),h){if(w.length!==0)throw new TypeError("Scalar expected");s.set(f.min(),p,m)}else{if(!Oi(w,d))try{w.length===0?p=rp([p],d):p=rp(p,d),w=Ve(p)}catch{}if(d.length<s._size.length)throw new Ke(d.length,s._size.length,"<");if(w.length<d.length){for(var v=0,x=0;d[v]===1&&w[v]===1;)v++;for(;d[v]===1;)x++,v++;p=gv(p,d.length,x,w)}if(!Oi(d,w))throw new Ke(d,w,">");var g=f.max().map(function(N){return N+1});c(s,g,m);var b=d.length,y=0;o(s._data,f,p,b,y)}return s}function o(s,f,p,m,d){var h=d===m-1,w=f.dimension(d);h?w.forEach(function(v,x){pt(v),s[v]=p[x[0]]}):w.forEach(function(v,x){pt(v),o(s[v],f,p[x[0]],m,d+1)})}r.prototype.resize=function(s,f,p){if(!Fr(s))throw new TypeError("Array or Matrix expected");var m=s.valueOf().map(h=>Array.isArray(h)&&h.length===1?h[0]:h),d=p?this.clone():this;return u(d,m,f)};function u(s,f,p){if(f.length===0){for(var m=s._data;st(m);)m=m[0];return m}return s._size=f.slice(0),s._data=ha(s._data,s._size,p),s}r.prototype.reshape=function(s,f){var p=f?this.clone():this;p._data=Nl(p._data,s);var m=p._size.reduce((d,h)=>d*h);return p._size=Dl(s,m),p};function c(s,f,p){for(var m=s._size.slice(0),d=!1;m.length<f.length;)m.push(0),d=!0;for(var h=0,w=f.length;h<w;h++)f[h]>m[h]&&(m[h]=f[h],d=!0);d&&u(s,m,p)}r.prototype.clone=function(){var s=new r({data:ze(this._data),size:ze(this._size),datatype:this._datatype});return s},r.prototype.size=function(){return this._size.slice(0)},r.prototype.map=function(s){var f=this,p=wv(s),m=function w(v,x){return st(v)?v.map(function(g,b){return w(g,x.concat(b))}):p===1?s(v):p===2?s(v,x):s(v,x,f)},d=m(this._data,[]),h=this._datatype!==void 0?so(d,dt):void 0;return new r(d,h)},r.prototype.forEach=function(s){var f=this,p=function m(d,h){st(d)?d.forEach(function(w,v){m(w,h.concat(v))}):s(d,h,f)};p(this._data,[])},r.prototype[Symbol.iterator]=function*(){var s=function*f(p,m){if(st(p))for(var d=0;d<p.length;d++)yield*f(p[d],m.concat(d));else yield{value:p,index:m}};yield*s(this._data,[])},r.prototype.rows=function(){var s=[],f=this.size();if(f.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");var p=this._data;for(var m of p)s.push(new r([m],this._datatype));return s},r.prototype.columns=function(){var s=this,f=[],p=this.size();if(p.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var m=this._data,d=function(w){var v=m.map(x=>[x[w]]);f.push(new r(v,s._datatype))},h=0;h<p[1];h++)d(h);return f},r.prototype.toArray=function(){return ze(this._data)},r.prototype.valueOf=function(){return this._data},r.prototype.format=function(s){return Ge(this._data,s)},r.prototype.toString=function(){return Ge(this._data)},r.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},r.prototype.diagonal=function(s){if(s){if($e(s)&&(s=s.toNumber()),!Ue(s)||!Fe(s))throw new TypeError("The parameter k must be an integer number")}else s=0;for(var f=s>0?s:0,p=s<0?-s:0,m=this._size[0],d=this._size[1],h=Math.min(m-p,d-f),w=[],v=0;v<h;v++)w[v]=this._data[v+p][v+f];return new r({data:w,size:[h],datatype:this._datatype})},r.diagonal=function(s,f,p,m){if(!st(s))throw new TypeError("Array expected, size parameter");if(s.length!==2)throw new Error("Only two dimensions matrix are supported");if(s=s.map(function(E){if($e(E)&&(E=E.toNumber()),!Ue(E)||!Fe(E)||E<1)throw new Error("Size values must be positive integers");return E}),p){if($e(p)&&(p=p.toNumber()),!Ue(p)||!Fe(p))throw new TypeError("The parameter k must be an integer number")}else p=0;var d=p>0?p:0,h=p<0?-p:0,w=s[0],v=s[1],x=Math.min(w-h,v-d),g;if(st(f)){if(f.length!==x)throw new Error("Invalid value array length");g=function(E){return f[E]}}else if(ke(f)){var b=f.size();if(b.length!==1||b[0]!==x)throw new Error("Invalid matrix length");g=function(E){return f.get([E])}}else g=function(){return f};m||(m=$e(g(0))?g(0).mul(0):0);var y=[];if(s.length>0){y=ha(y,s,m);for(var N=0;N<x;N++)y[N+h][N+d]=g(N)}return new r({data:y,size:[w,v]})},r.fromJSON=function(s){return new r(s)},r.prototype.swapRows=function(s,f){if(!Ue(s)||!Fe(s)||!Ue(f)||!Fe(f))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return pt(s,this._size[0]),pt(f,this._size[0]),r._swapRows(s,f,this._data),this},r._swapRows=function(s,f,p){var m=p[s];p[s]=p[f],p[f]=m};function l(s){return ke(s)?l(s.valueOf()):st(s)?s.map(l):s}return r},{isClass:!0}),np="clone",fD=["typed"],pD=U(np,fD,e=>{var{typed:t}=e;return t(np,{any:ze})});function Nv(e){var t=e.length,r=e[0].length,n,i,a=[];for(i=0;i<r;i++){var o=[];for(n=0;n<t;n++)o.push(e[n][i]);a.push(o)}return a}function Ea(e){for(var t=0;t<e.length;t++)if(Fr(e[t]))return!0;return!1}function Sn(e,t){ke(e)&&(e=e.valueOf());for(var r=0,n=e.length;r<n;r++){var i=e[r];Array.isArray(i)?Sn(i,t):t(i)}}function Qe(e,t,r){return e&&typeof e.map=="function"?e.map(function(n){return Qe(n,t)}):t(e)}function xu(e,t,r){var n=Array.isArray(e)?Ve(e):e.size();if(t<0||t>=n.length)throw new $r(t,n.length);return ke(e)?e.create(zs(e.valueOf(),t,r)):zs(e,t,r)}function zs(e,t,r){var n,i,a,o;if(t<=0)if(Array.isArray(e[0])){for(o=Nv(e),i=[],n=0;n<o.length;n++)i[n]=zs(o[n],t-1,r);return i}else{for(a=e[0],n=1;n<e.length;n++)a=r(a,e[n]);return a}else{for(i=[],n=0;n<e.length;n++)i[n]=zs(e[n],t-1,r);return i}}function ip(e,t,r,n,i,a,o,u,c,l,s){var f=e._values,p=e._index,m=e._ptr,d,h,w,v;if(n)for(h=m[t],w=m[t+1],d=h;d<w;d++)v=p[d],r[v]!==a?(r[v]=a,o.push(v),n[v]=f[d]):(n[v]=u(n[v],f[d]),i[v]=a);else for(h=m[t],w=m[t+1],d=h;d<w;d++)v=p[d],r[v]!==a?(r[v]=a,o.push(v)):i[v]=a}var ap="isInteger",mD=["typed"],dD=U(ap,mD,e=>{var{typed:t}=e;return t(ap,{number:Fe,BigNumber:function(r){return r.isInt()},Fraction:function(r){return r.d===1&&isFinite(r.n)},"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Hr="number",Aa="number, number";function Dv(e){return Math.abs(e)}Dv.signature=Hr;function Ev(e,t){return e+t}Ev.signature=Aa;function Av(e,t){return e-t}Av.signature=Aa;function Sv(e,t){return e*t}Sv.signature=Aa;function Cv(e){return-e}Cv.signature=Hr;function Mv(e){return e}Mv.signature=Hr;function Za(e){return mN(e)}Za.signature=Hr;function _v(e){return e*e*e}_v.signature=Hr;function Fv(e){return Math.exp(e)}Fv.signature=Hr;function Tv(e){return dN(e)}Tv.signature=Hr;function Ov(e,t){if(!Fe(e)||!Fe(t))throw new Error("Parameters in function lcm must be integer numbers");if(e===0||t===0)return 0;for(var r,n=e*t;t!==0;)r=t,t=e%r,e=r;return Math.abs(n/e)}Ov.signature=Aa;function hD(e,t){return Math.log(e)}function Bv(e){return fN(e)}Bv.signature=Hr;function kv(e){return lN(e)}kv.signature=Hr;function op(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,r=t<0;if(r&&(t=-t),t===0)throw new Error("Root must be non-zero");if(e<0&&Math.abs(t)%2!==1)throw new Error("Root must be odd when a is negative.");if(e===0)return r?1/0:0;if(!isFinite(e))return r?0:e;var n=Math.pow(Math.abs(e),1/t);return n=e<0?-n:n,r?1/n:n}function zc(e){return Wn(e)}zc.signature=Hr;function Iv(e){return e*e}Iv.signature=Hr;function Rv(e,t){var r,n,i,a=0,o=1,u=1,c=0;if(!Fe(e)||!Fe(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)n=Math.floor(e/t),i=e-n*t,r=a,a=o-n*a,o=r,r=u,u=c-n*u,c=r,e=t,t=i;var l;return e<0?l=[-e,-o,-c]:l=[e,e?o:0,c],l}Rv.signature=Aa;function qv(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}qv.signature=Aa;function $a(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!Fe(t)||t<0||t>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(Hg(e,t))}var gD="number",Sa="number, number";function zv(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function bitAnd");return e&t}zv.signature=Sa;function jv(e){if(!Fe(e))throw new Error("Integer expected in function bitNot");return~e}jv.signature=gD;function Lv(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function bitOr");return e|t}Lv.signature=Sa;function Pv(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function bitXor");return e^t}Pv.signature=Sa;function Vv(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function leftShift");return e<<t}Vv.signature=Sa;function Uv(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function rightArithShift");return e>>t}Uv.signature=Sa;function $v(e,t){if(!Fe(e)||!Fe(t))throw new Error("Integers expected in function rightLogShift");return e>>>t}$v.signature=Sa;function xn(e,t){if(t<e)return 1;if(t===e)return t;var r=t+e>>1;return xn(e,r)*xn(r+1,t)}function Hv(e,t){if(!Fe(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!Fe(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(t>e)throw new TypeError("k must be less than or equal to n");for(var r=e-t,n=1,i=t<r?r+1:t+1,a=2,o=t<r?t:r,u=i;u<=e;++u)for(n*=u;a<=o&&n%a===0;)n/=a,++a;return a<=o&&(n/=xn(a,o)),n}Hv.signature="number, number";var vD=Math.PI,yD=2*Math.PI,bD=Math.E,xD=1.618033988749895,wD="number",El="number, number";function Jv(e){return!e}Jv.signature=wD;function Gv(e,t){return!!(e||t)}Gv.signature=El;function Wv(e,t){return!!e!=!!t}Wv.signature=El;function Kv(e,t){return!!(e&&t)}Kv.signature=El;function js(e){var t;if(Fe(e))return e<=0?isFinite(e)?1/0:NaN:e>171?1/0:xn(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*js(1-e));if(e>=171.35)return 1/0;if(e>85){var r=e*e,n=r*e,i=n*e,a=i*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*r)-139/(51840*n)-571/(2488320*i)+163879/(209018880*a)+5246819/(75246796800*a*e))}--e,t=oa[0];for(var o=1;o<oa.length;++o)t+=oa[o]/(e+o);var u=e+Qv+.5;return Math.sqrt(2*Math.PI)*Math.pow(u,e+.5)*Math.exp(-u)*t}js.signature="number";var Qv=4.7421875,oa=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],Zv=.9189385332046728,ND=5,DD=7,sp=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];function Ls(e){if(e<0)return NaN;if(e===0)return 1/0;if(!isFinite(e))return e;if(e<.5)return Math.log(Math.PI/Math.sin(Math.PI*e))-Ls(1-e);e=e-1;for(var t=e+ND+.5,r=sp[0],n=DD-1;n>=1;n--)r+=sp[n]/(e+n);return Zv+(e+.5)*Math.log(t)-t+Math.log(r)}Ls.signature="number";var er="number";function Xv(e){return bN(e)}Xv.signature=er;function Yv(e){return Math.atan(1/e)}Yv.signature=er;function ey(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}ey.signature=er;function ty(e){return Math.asin(1/e)}ty.signature=er;function ry(e){var t=1/e;return Math.log(t+Math.sqrt(t*t+1))}ry.signature=er;function ny(e){return Math.acos(1/e)}ny.signature=er;function iy(e){var t=1/e,r=Math.sqrt(t*t-1);return Math.log(r+t)}iy.signature=er;function ay(e){return xN(e)}ay.signature=er;function oy(e){return wN(e)}oy.signature=er;function sy(e){return 1/Math.tan(e)}sy.signature=er;function uy(e){var t=Math.exp(2*e);return(t+1)/(t-1)}uy.signature=er;function cy(e){return 1/Math.sin(e)}cy.signature=er;function ly(e){return e===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*Wn(e)}ly.signature=er;function fy(e){return 1/Math.cos(e)}fy.signature=er;function py(e){return 2/(Math.exp(e)+Math.exp(-e))}py.signature=er;function my(e){return DN(e)}my.signature=er;var wu="number";function dy(e){return e<0}dy.signature=wu;function hy(e){return e>0}hy.signature=wu;function gy(e){return e===0}gy.signature=wu;function vy(e){return Number.isNaN(e)}vy.signature=wu;var up="isNegative",ED=["typed"],AD=U(up,ED,e=>{var{typed:t}=e;return t(up,{number:dy,BigNumber:function(r){return r.isNeg()&&!r.isZero()&&!r.isNaN()},Fraction:function(r){return r.s<0},Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),cp="isNumeric",SD=["typed"],CD=U(cp,SD,e=>{var{typed:t}=e;return t(cp,{"number | BigNumber | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),lp="hasNumericValue",MD=["typed","isNumeric"],_D=U(lp,MD,e=>{var{typed:t,isNumeric:r}=e;return t(lp,{boolean:()=>!0,string:function(n){return n.trim().length>0&&!isNaN(Number(n))},any:function(n){return r(n)}})}),fp="isPositive",FD=["typed"],TD=U(fp,FD,e=>{var{typed:t}=e;return t(fp,{number:hy,BigNumber:function(r){return!r.isNeg()&&!r.isZero()&&!r.isNaN()},Fraction:function(r){return r.s>0&&r.n>0},Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),pp="isZero",OD=["typed"],BD=U(pp,OD,e=>{var{typed:t}=e;return t(pp,{number:gy,BigNumber:function(r){return r.isZero()},Complex:function(r){return r.re===0&&r.im===0},Fraction:function(r){return r.d===1&&r.n===0},Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),mp="isNaN",kD=["typed"],ID=U(mp,kD,e=>{var{typed:t}=e;return t(mp,{number:vy,BigNumber:function(r){return r.isNaN()},Fraction:function(r){return!1},Complex:function(r){return r.isNaN()},Unit:function(r){return Number.isNaN(r.value)},"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),dp="typeOf",RD=["typed"],qD=U(dp,RD,e=>{var{typed:t}=e;return t(dp,{any:dt})});function Tr(e,t,r){if(r==null)return e.eq(t);if(e.eq(t))return!0;if(e.isNaN()||t.isNaN())return!1;if(e.isFinite()&&t.isFinite()){var n=e.minus(t).abs();if(n.isZero())return!0;var i=e.constructor.max(e.abs(),t.abs());return n.lte(i.times(r))}return!1}function zD(e,t,r){return sr(e.re,t.re,r)&&sr(e.im,t.im,r)}var Ca=U("compareUnits",["typed"],e=>{var{typed:t}=e;return{"Unit, Unit":t.referToSelf(r=>(n,i)=>{if(!n.equalBase(i))throw new Error("Cannot compare units with different base");return t.find(r,[n.valueType(),i.valueType()])(n.value,i.value)})}}),Ps="equalScalar",jD=["typed","config"],LD=U(Ps,jD,e=>{var{typed:t,config:r}=e,n=Ca({typed:t});return t(Ps,{"boolean, boolean":function(i,a){return i===a},"number, number":function(i,a){return sr(i,a,r.epsilon)},"BigNumber, BigNumber":function(i,a){return i.eq(a)||Tr(i,a,r.epsilon)},"Fraction, Fraction":function(i,a){return i.equals(a)},"Complex, Complex":function(i,a){return zD(i,a,r.epsilon)}},n)});U(Ps,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Ps,{"number, number":function(n,i){return sr(n,i,r.epsilon)}})});var PD="SparseMatrix",VD=["typed","equalScalar","Matrix"],UD=U(PD,VD,e=>{var{typed:t,equalScalar:r,Matrix:n}=e;function i(h,w){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(w&&!Qt(w))throw new Error("Invalid datatype: "+w);if(ke(h))a(this,h,w);else if(h&&st(h.index)&&st(h.ptr)&&st(h.size))this._values=h.values,this._index=h.index,this._ptr=h.ptr,this._size=h.size,this._datatype=w||h.datatype;else if(st(h))o(this,h,w);else{if(h)throw new TypeError("Unsupported type of data ("+dt(h)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=w}}function a(h,w,v){w.type==="SparseMatrix"?(h._values=w._values?ze(w._values):void 0,h._index=ze(w._index),h._ptr=ze(w._ptr),h._size=ze(w._size),h._datatype=v||w._datatype):o(h,w.valueOf(),v||w._datatype)}function o(h,w,v){h._values=[],h._index=[],h._ptr=[],h._datatype=v;var x=w.length,g=0,b=r,y=0;if(Qt(v)&&(b=t.find(r,[v,v])||r,y=t.convert(0,v)),x>0){var N=0;do{h._ptr.push(h._index.length);for(var E=0;E<x;E++){var A=w[E];if(st(A)){if(N===0&&g<A.length&&(g=A.length),N<A.length){var D=A[N];b(D,y)||(h._values.push(D),h._index.push(E))}}else N===0&&g<1&&(g=1),b(A,y)||(h._values.push(A),h._index.push(E))}N++}while(N<g)}h._ptr.push(h._index.length),h._size=[x,g]}i.prototype=new n,i.prototype.createSparseMatrix=function(h,w){return new i(h,w)},Object.defineProperty(i,"name",{value:"SparseMatrix"}),i.prototype.constructor=i,i.prototype.type="SparseMatrix",i.prototype.isSparseMatrix=!0,i.prototype.getDataType=function(){return so(this._values,dt)},i.prototype.storage=function(){return"sparse"},i.prototype.datatype=function(){return this._datatype},i.prototype.create=function(h,w){return new i(h,w)},i.prototype.density=function(){var h=this._size[0],w=this._size[1];return h!==0&&w!==0?this._index.length/(h*w):0},i.prototype.subset=function(h,w,v){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return u(this,h);case 2:case 3:return c(this,h,w,v);default:throw new SyntaxError("Wrong number of arguments")}};function u(h,w){if(!fu(w))throw new TypeError("Invalid index");var v=w.isScalar();if(v)return h.get(w.min());var x=w.size();if(x.length!==h._size.length)throw new Ke(x.length,h._size.length);var g,b,y,N,E=w.min(),A=w.max();for(g=0,b=h._size.length;g<b;g++)pt(E[g],h._size[g]),pt(A[g],h._size[g]);var D=h._values,S=h._index,C=h._ptr,_=w.dimension(0),R=w.dimension(1),P=[],I=[];_.forEach(function(k,te){I[k]=te[0],P[k]=!0});var O=D?[]:void 0,F=[],q=[];return R.forEach(function(k){for(q.push(F.length),y=C[k],N=C[k+1];y<N;y++)g=S[y],P[g]===!0&&(F.push(I[g]),O&&O.push(D[y]))}),q.push(F.length),new i({values:O,index:F,ptr:q,size:x,datatype:h._datatype})}function c(h,w,v,x){if(!w||w.isIndex!==!0)throw new TypeError("Invalid index");var g=w.size(),b=w.isScalar(),y;if(ke(v)?(y=v.size(),v=v.toArray()):y=Ve(v),b){if(y.length!==0)throw new TypeError("Scalar expected");h.set(w.min(),v,x)}else{if(g.length!==1&&g.length!==2)throw new Ke(g.length,h._size.length,"<");if(y.length<g.length){for(var N=0,E=0;g[N]===1&&y[N]===1;)N++;for(;g[N]===1;)E++,N++;v=gv(v,g.length,E,y)}if(!Oi(g,y))throw new Ke(g,y,">");if(g.length===1){var A=w.dimension(0);A.forEach(function(C,_){pt(C),h.set([C,0],v[_[0]],x)})}else{var D=w.dimension(0),S=w.dimension(1);D.forEach(function(C,_){pt(C),S.forEach(function(R,P){pt(R),h.set([C,R],v[_[0]][P[0]],x)})})}}return h}i.prototype.get=function(h){if(!st(h))throw new TypeError("Array expected");if(h.length!==this._size.length)throw new Ke(h.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var w=h[0],v=h[1];pt(w,this._size[0]),pt(v,this._size[1]);var x=l(w,this._ptr[v],this._ptr[v+1],this._index);return x<this._ptr[v+1]&&this._index[x]===w?this._values[x]:0},i.prototype.set=function(h,w,v){if(!st(h))throw new TypeError("Array expected");if(h.length!==this._size.length)throw new Ke(h.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var x=h[0],g=h[1],b=this._size[0],y=this._size[1],N=r,E=0;Qt(this._datatype)&&(N=t.find(r,[this._datatype,this._datatype])||r,E=t.convert(0,this._datatype)),(x>b-1||g>y-1)&&(p(this,Math.max(x+1,b),Math.max(g+1,y),v),b=this._size[0],y=this._size[1]),pt(x,b),pt(g,y);var A=l(x,this._ptr[g],this._ptr[g+1],this._index);return A<this._ptr[g+1]&&this._index[A]===x?N(w,E)?s(A,g,this._values,this._index,this._ptr):this._values[A]=w:N(w,E)||f(A,x,g,w,this._values,this._index,this._ptr),this};function l(h,w,v,x){if(v-w===0)return v;for(var g=w;g<v;g++)if(x[g]===h)return g;return w}function s(h,w,v,x,g){v.splice(h,1),x.splice(h,1);for(var b=w+1;b<g.length;b++)g[b]--}function f(h,w,v,x,g,b,y){g.splice(h,0,x),b.splice(h,0,w);for(var N=v+1;N<y.length;N++)y[N]++}i.prototype.resize=function(h,w,v){if(!Fr(h))throw new TypeError("Array or Matrix expected");var x=h.valueOf().map(b=>Array.isArray(b)&&b.length===1?b[0]:b);if(x.length!==2)throw new Error("Only two dimensions matrix are supported");x.forEach(function(b){if(!Ue(b)||!Fe(b)||b<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Ge(x)+")")});var g=v?this.clone():this;return p(g,x[0],x[1],w)};function p(h,w,v,x){var g=x||0,b=r,y=0;Qt(h._datatype)&&(b=t.find(r,[h._datatype,h._datatype])||r,y=t.convert(0,h._datatype),g=t.convert(g,h._datatype));var N=!b(g,y),E=h._size[0],A=h._size[1],D,S,C;if(v>A){for(S=A;S<v;S++)if(h._ptr[S]=h._values.length,N)for(D=0;D<E;D++)h._values.push(g),h._index.push(D);h._ptr[v]=h._values.length}else v<A&&(h._ptr.splice(v+1,A-v),h._values.splice(h._ptr[v],h._values.length),h._index.splice(h._ptr[v],h._index.length));if(A=v,w>E){if(N){var _=0;for(S=0;S<A;S++){h._ptr[S]=h._ptr[S]+_,C=h._ptr[S+1]+_;var R=0;for(D=E;D<w;D++,R++)h._values.splice(C+R,0,g),h._index.splice(C+R,0,D),_++}h._ptr[A]=h._values.length}}else if(w<E){var P=0;for(S=0;S<A;S++){h._ptr[S]=h._ptr[S]-P;var I=h._ptr[S],O=h._ptr[S+1]-P;for(C=I;C<O;C++)D=h._index[C],D>w-1&&(h._values.splice(C,1),h._index.splice(C,1),P++)}h._ptr[S]=h._values.length}return h._size[0]=w,h._size[1]=v,h}i.prototype.reshape=function(h,w){if(!st(h))throw new TypeError("Array expected");if(h.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");h.forEach(function(k){if(!Ue(k)||!Fe(k)||k<=-2||k===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+Ge(h)+")")});var v=this._size[0]*this._size[1];h=Dl(h,v);var x=h[0]*h[1];if(v!==x)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var g=w?this.clone():this;if(this._size[0]===h[0]&&this._size[1]===h[1])return g;for(var b=[],y=0;y<g._ptr.length;y++)for(var N=0;N<g._ptr[y+1]-g._ptr[y];N++)b.push(y);for(var E=g._values.slice(),A=g._index.slice(),D=0;D<g._index.length;D++){var S=A[D],C=b[D],_=S*g._size[1]+C;b[D]=_%h[1],A[D]=Math.floor(_/h[1])}g._values.length=0,g._index.length=0,g._ptr.length=h[1]+1,g._size=h.slice();for(var R=0;R<g._ptr.length;R++)g._ptr[R]=0;for(var P=0;P<E.length;P++){var I=A[P],O=b[P],F=E[P],q=l(I,g._ptr[O],g._ptr[O+1],g._index);f(q,I,O,F,g._values,g._index,g._ptr)}return g},i.prototype.clone=function(){var h=new i({values:this._values?ze(this._values):void 0,index:ze(this._index),ptr:ze(this._ptr),size:ze(this._size),datatype:this._datatype});return h},i.prototype.size=function(){return this._size.slice(0)},i.prototype.map=function(h,w){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var v=this,x=this._size[0],g=this._size[1],b=wv(h),y=function(N,E,A){return b===1?h(N):b===2?h(N,[E,A]):h(N,[E,A],v)};return m(this,0,x-1,0,g-1,y,w)};function m(h,w,v,x,g,b,y){var N=[],E=[],A=[],D=r,S=0;Qt(h._datatype)&&(D=t.find(r,[h._datatype,h._datatype])||r,S=t.convert(0,h._datatype));for(var C=function(K,V,ue){K=b(K,V,ue),D(K,S)||(N.push(K),E.push(V))},_=x;_<=g;_++){A.push(N.length);var R=h._ptr[_],P=h._ptr[_+1];if(y)for(var I=R;I<P;I++){var O=h._index[I];O>=w&&O<=v&&C(h._values[I],O-w,_-x)}else{for(var F={},q=R;q<P;q++){var k=h._index[q];F[k]=h._values[q]}for(var te=w;te<=v;te++){var se=te in F?F[te]:0;C(se,te-w,_-x)}}}return A.push(N.length),new i({values:N,index:E,ptr:A,size:[v-w+1,g-x+1]})}i.prototype.forEach=function(h,w){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var v=this,x=this._size[0],g=this._size[1],b=0;b<g;b++){var y=this._ptr[b],N=this._ptr[b+1];if(w)for(var E=y;E<N;E++){var A=this._index[E];h(this._values[E],[A,b],v)}else{for(var D={},S=y;S<N;S++){var C=this._index[S];D[C]=this._values[S]}for(var _=0;_<x;_++){var R=_ in D?D[_]:0;h(R,[_,b],v)}}}},i.prototype[Symbol.iterator]=function*(){if(!this._values)throw new Error("Cannot iterate a Pattern only matrix");for(var h=this._size[1],w=0;w<h;w++)for(var v=this._ptr[w],x=this._ptr[w+1],g=v;g<x;g++){var b=this._index[g];yield{value:this._values[g],index:[b,w]}}},i.prototype.toArray=function(){return d(this._values,this._index,this._ptr,this._size,!0)},i.prototype.valueOf=function(){return d(this._values,this._index,this._ptr,this._size,!1)};function d(h,w,v,x,g){var b=x[0],y=x[1],N=[],E,A;for(E=0;E<b;E++)for(N[E]=[],A=0;A<y;A++)N[E][A]=0;for(A=0;A<y;A++)for(var D=v[A],S=v[A+1],C=D;C<S;C++)E=w[C],N[E][A]=h?g?ze(h[C]):h[C]:1;return N}return i.prototype.format=function(h){for(var w=this._size[0],v=this._size[1],x=this.density(),g="Sparse Matrix ["+Ge(w,h)+" x "+Ge(v,h)+"] density: "+Ge(x,h)+`
|
|
27
|
+
`,b=0;b<v;b++)for(var y=this._ptr[b],N=this._ptr[b+1],E=y;E<N;E++){var A=this._index[E];g+=`
|
|
28
|
+
(`+Ge(A,h)+", "+Ge(b,h)+") ==> "+(this._values?Ge(this._values[E],h):"X")}return g},i.prototype.toString=function(){return Ge(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(h){if(h){if($e(h)&&(h=h.toNumber()),!Ue(h)||!Fe(h))throw new TypeError("The parameter k must be an integer number")}else h=0;var w=h>0?h:0,v=h<0?-h:0,x=this._size[0],g=this._size[1],b=Math.min(x-v,g-w),y=[],N=[],E=[];E[0]=0;for(var A=w;A<g&&y.length<b;A++)for(var D=this._ptr[A],S=this._ptr[A+1],C=D;C<S;C++){var _=this._index[C];if(_===A-w+v){y.push(this._values[C]),N[y.length-1]=_-v;break}}return E.push(y.length),new i({values:y,index:N,ptr:E,size:[b,1]})},i.fromJSON=function(h){return new i(h)},i.diagonal=function(h,w,v,x,g){if(!st(h))throw new TypeError("Array expected, size parameter");if(h.length!==2)throw new Error("Only two dimensions matrix are supported");if(h=h.map(function(k){if($e(k)&&(k=k.toNumber()),!Ue(k)||!Fe(k)||k<1)throw new Error("Size values must be positive integers");return k}),v){if($e(v)&&(v=v.toNumber()),!Ue(v)||!Fe(v))throw new TypeError("The parameter k must be an integer number")}else v=0;var b=r,y=0;Qt(g)&&(b=t.find(r,[g,g])||r,y=t.convert(0,g));var N=v>0?v:0,E=v<0?-v:0,A=h[0],D=h[1],S=Math.min(A-E,D-N),C;if(st(w)){if(w.length!==S)throw new Error("Invalid value array length");C=function(k){return w[k]}}else if(ke(w)){var _=w.size();if(_.length!==1||_[0]!==S)throw new Error("Invalid matrix length");C=function(k){return w.get([k])}}else C=function(){return w};for(var R=[],P=[],I=[],O=0;O<D;O++){I.push(R.length);var F=O-N;if(F>=0&&F<S){var q=C(F);b(q,y)||(P.push(F+E),R.push(q))}}return I.push(R.length),new i({values:R,index:P,ptr:I,size:[A,D]})},i.prototype.swapRows=function(h,w){if(!Ue(h)||!Fe(h)||!Ue(w)||!Fe(w))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return pt(h,this._size[0]),pt(w,this._size[0]),i._swapRows(h,w,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(h,w,v,x,g){for(var b=x[h],y=x[h+1],N=b;N<y;N++)g(v[N],w[N])},i._swapRows=function(h,w,v,x,g,b){for(var y=0;y<v;y++){var N=b[y],E=b[y+1],A=l(h,N,E,g),D=l(w,N,E,g);if(A<E&&D<E&&g[A]===h&&g[D]===w){if(x){var S=x[A];x[A]=x[D],x[D]=S}continue}if(A<E&&g[A]===h&&(D>=E||g[D]!==w)){var C=x?x[A]:void 0;g.splice(D,0,w),x&&x.splice(D,0,C),g.splice(D<=A?A+1:A,1),x&&x.splice(D<=A?A+1:A,1);continue}if(D<E&&g[D]===w&&(A>=E||g[A]!==h)){var _=x?x[D]:void 0;g.splice(A,0,h),x&&x.splice(A,0,_),g.splice(A<=D?D+1:D,1),x&&x.splice(A<=D?D+1:D,1)}}},i},{isClass:!0}),$D="number",HD=["typed"];function JD(e){var t=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(t){var r={"0b":2,"0o":8,"0x":16}[t[1]],n=t[2],i=t[3];return{input:e,radix:r,integerPart:n,fractionalPart:i}}else return null}function GD(e){for(var t=parseInt(e.integerPart,e.radix),r=0,n=0;n<e.fractionalPart.length;n++){var i=parseInt(e.fractionalPart[n],e.radix);r+=i/Math.pow(e.radix,n+1)}var a=t+r;if(isNaN(a))throw new SyntaxError('String "'+e.input+'" is not a valid number');return a}var WD=U($D,HD,e=>{var{typed:t}=e,r=t("number",{"":function(){return 0},number:function(n){return n},string:function(n){if(n==="NaN")return NaN;var i=JD(n);if(i)return GD(i);var a=0,o=n.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);o&&(a=Number(o[2]),n=o[1]);var u=Number(n);if(isNaN(u))throw new SyntaxError('String "'+n+'" is not a valid number');if(o){if(u>2**a-1)throw new SyntaxError('String "'.concat(n,'" is out of range'));u>=2**(a-1)&&(u=u-2**a)}return u},BigNumber:function(n){return n.toNumber()},Fraction:function(n){return n.valueOf()},Unit:t.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),null:function(n){return 0},"Unit, string | Unit":function(n,i){return n.toNumber(i)},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))});return r.fromJSON=function(n){return parseFloat(n.value)},r}),hp="string",KD=["typed"],QD=U(hp,KD,e=>{var{typed:t}=e;return t(hp,{"":function(){return""},number:Di,null:function(r){return"null"},boolean:function(r){return r+""},string:function(r){return r},"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r)),any:function(r){return String(r)}})}),gp="boolean",ZD=["typed"],XD=U(gp,ZD,e=>{var{typed:t}=e;return t(gp,{"":function(){return!1},boolean:function(r){return r},number:function(r){return!!r},null:function(r){return!1},BigNumber:function(r){return!r.isZero()},string:function(r){var n=r.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;var i=Number(r);if(r!==""&&!isNaN(i))return!!i;throw new Error('Cannot convert "'+r+'" to a boolean')},"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),YD="bignumber",eE=["typed","BigNumber"],tE=U(YD,eE,e=>{var{typed:t,BigNumber:r}=e;return t("bignumber",{"":function(){return new r(0)},number:function(n){return new r(n+"")},string:function(n){var i=n.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(i){var a=i[2],o=r(i[1]),u=new r(2).pow(Number(a));if(o.gt(u.sub(1)))throw new SyntaxError('String "'.concat(n,'" is out of range'));var c=new r(2).pow(Number(a)-1);return o.gte(c)?o.sub(u):o}return new r(n)},BigNumber:function(n){return n},Unit:t.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),Fraction:function(n){return new r(n.n).div(n.d).times(n.s)},null:function(n){return new r(0)},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))})}),rE="complex",nE=["typed","Complex"],iE=U(rE,nE,e=>{var{typed:t,Complex:r}=e;return t("complex",{"":function(){return r.ZERO},number:function(n){return new r(n,0)},"number, number":function(n,i){return new r(n,i)},"BigNumber, BigNumber":function(n,i){return new r(n.toNumber(),i.toNumber())},Fraction:function(n){return new r(n.valueOf(),0)},Complex:function(n){return n.clone()},string:function(n){return r(n)},null:function(n){return r(0)},Object:function(n){if("re"in n&&"im"in n)return new r(n.re,n.im);if("r"in n&&"phi"in n||"abs"in n&&"arg"in n)return new r(n);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))})}),aE="fraction",oE=["typed","Fraction"],sE=U(aE,oE,e=>{var{typed:t,Fraction:r}=e;return t("fraction",{number:function(n){if(!isFinite(n)||isNaN(n))throw new Error(n+" cannot be represented as a fraction");return new r(n)},string:function(n){return new r(n)},"number, number":function(n,i){return new r(n,i)},null:function(n){return new r(0)},BigNumber:function(n){return new r(n.toString())},Fraction:function(n){return n},Unit:t.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),Object:function(n){return new r(n)},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))})}),vp="matrix",uE=["typed","Matrix","DenseMatrix","SparseMatrix"],cE=U(vp,uE,e=>{var{typed:t,Matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(vp,{"":function(){return a([])},string:function(o){return a([],o)},"string, string":function(o,u){return a([],o,u)},Array:function(o){return a(o)},Matrix:function(o){return a(o,o.storage())},"Array | Matrix, string":a,"Array | Matrix, string, string":a});function a(o,u,c){if(u==="dense"||u==="default"||u===void 0)return new n(o,c);if(u==="sparse")return new i(o,c);throw new TypeError("Unknown matrix type "+JSON.stringify(u)+".")}}),yp="matrixFromFunction",lE=["typed","matrix","isZero"],fE=U(yp,lE,e=>{var{typed:t,matrix:r,isZero:n}=e;return t(yp,{"Array | Matrix, function, string, string":function(a,o,u,c){return i(a,o,u,c)},"Array | Matrix, function, string":function(a,o,u){return i(a,o,u)},"Matrix, function":function(a,o){return i(a,o,"dense")},"Array, function":function(a,o){return i(a,o,"dense").toArray()},"Array | Matrix, string, function":function(a,o,u){return i(a,u,o)},"Array | Matrix, string, string, function":function(a,o,u,c){return i(a,c,o,u)}});function i(a,o,u,c){var l;return c!==void 0?l=r(u,c):l=r(u),l.resize(a),l.forEach(function(s,f){var p=o(f);n(p)||l.set(f,p)}),l}}),bp="matrixFromRows",pE=["typed","matrix","flatten","size"],mE=U(bp,pE,e=>{var{typed:t,matrix:r,flatten:n,size:i}=e;return t(bp,{"...Array":function(u){return a(u)},"...Matrix":function(u){return r(a(u.map(c=>c.toArray())))}});function a(u){if(u.length===0)throw new TypeError("At least one row is needed to construct a matrix.");var c=o(u[0]),l=[];for(var s of u){var f=o(s);if(f!==c)throw new TypeError("The vectors had different length: "+(c|0)+" ≠ "+(f|0));l.push(n(s))}return l}function o(u){var c=i(u);if(c.length===1)return c[0];if(c.length===2){if(c[0]===1)return c[1];if(c[1]===1)return c[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.")}}),xp="matrixFromColumns",dE=["typed","matrix","flatten","size"],hE=U(xp,dE,e=>{var{typed:t,matrix:r,flatten:n,size:i}=e;return t(xp,{"...Array":function(u){return a(u)},"...Matrix":function(u){return r(a(u.map(c=>c.toArray())))}});function a(u){if(u.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var c=o(u[0]),l=[],s=0;s<c;s++)l[s]=[];for(var f of u){var p=o(f);if(p!==c)throw new TypeError("The vectors had different length: "+(c|0)+" ≠ "+(p|0));for(var m=n(f),d=0;d<c;d++)l[d].push(m[d])}return l}function o(u){var c=i(u);if(c.length===1)return c[0];if(c.length===2){if(c[0]===1)return c[1];if(c[1]===1)return c[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.")}}),wp="splitUnit",gE=["typed"],vE=U(wp,gE,e=>{var{typed:t}=e;return t(wp,{"Unit, Array":function(r,n){return r.splitUnit(n)}})}),Np="unaryMinus",yE=["typed"],bE=U(Np,yE,e=>{var{typed:t}=e;return t(Np,{number:Cv,"Complex | BigNumber | Fraction":r=>r.neg(),Unit:t.referToSelf(r=>n=>{var i=n.clone();return i.value=t.find(r,i.valueType())(n.value),i}),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Dp="unaryPlus",xE=["typed","config","BigNumber"],wE=U(Dp,xE,e=>{var{typed:t,config:r,BigNumber:n}=e;return t(Dp,{number:Mv,Complex:function(i){return i},BigNumber:function(i){return i},Fraction:function(i){return i},Unit:function(i){return i.clone()},"Array | Matrix":t.referToSelf(i=>a=>Qe(a,i)),"boolean | string":function(i){return r.number==="BigNumber"?new n(+i):+i}})}),Ep="abs",NE=["typed"],DE=U(Ep,NE,e=>{var{typed:t}=e;return t(Ep,{number:Dv,"Complex | BigNumber | Fraction | Unit":r=>r.abs(),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Ap="apply",EE=["typed","isInteger"],Al=U(Ap,EE,e=>{var{typed:t,isInteger:r}=e;return t(Ap,{"Array | Matrix, number | BigNumber, function":function(n,i,a){if(!r(i))throw new TypeError("Integer number expected for dimension");var o=Array.isArray(n)?Ve(n):n.size();if(i<0||i>=o.length)throw new $r(i,o.length);return ke(n)?n.create(Vs(n.valueOf(),i,a)):Vs(n,i,a)}})});function Vs(e,t,r){var n,i,a;if(t<=0)if(Array.isArray(e[0])){for(a=AE(e),i=[],n=0;n<a.length;n++)i[n]=Vs(a[n],t-1,r);return i}else return r(e);else{for(i=[],n=0;n<e.length;n++)i[n]=Vs(e[n],t-1,r);return i}}function AE(e){var t=e.length,r=e[0].length,n,i,a=[];for(i=0;i<r;i++){var o=[];for(n=0;n<t;n++)o.push(e[n][i]);a.push(o)}return a}var Sp="addScalar",SE=["typed"],CE=U(Sp,SE,e=>{var{typed:t}=e;return t(Sp,{"number, number":Ev,"Complex, Complex":function(r,n){return r.add(n)},"BigNumber, BigNumber":function(r,n){return r.plus(n)},"Fraction, Fraction":function(r,n){return r.add(n)},"Unit, Unit":t.referToSelf(r=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var a=n.clone();return a.value=t.find(r,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})}),Cp="subtractScalar",ME=["typed"],_E=U(Cp,ME,e=>{var{typed:t}=e;return t(Cp,{"number, number":Av,"Complex, Complex":function(r,n){return r.sub(n)},"BigNumber, BigNumber":function(r,n){return r.minus(n)},"Fraction, Fraction":function(r,n){return r.sub(n)},"Unit, Unit":t.referToSelf(r=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var a=n.clone();return a.value=t.find(r,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})}),Mp="cbrt",FE=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],TE=U(Mp,FE,e=>{var{config:t,typed:r,isNegative:n,unaryMinus:i,matrix:a,Complex:o,BigNumber:u,Fraction:c}=e;return r(Mp,{number:Za,Complex:l,"Complex, boolean":l,BigNumber:function(f){return f.cbrt()},Unit:s});function l(f,p){var m=f.arg()/3,d=f.abs(),h=new o(Za(d),0).mul(new o(0,m).exp());if(p){var w=[h,new o(Za(d),0).mul(new o(0,m+Math.PI*2/3).exp()),new o(Za(d),0).mul(new o(0,m-Math.PI*2/3).exp())];return t.matrix==="Array"?w:a(w)}else return h}function s(f){if(f.value&&wn(f.value)){var p=f.clone();return p.value=1,p=p.pow(1/3),p.value=l(f.value),p}else{var m=n(f.value);m&&(f.value=i(f.value));var d;$e(f.value)?d=new u(1).div(3):bo(f.value)?d=new c(1,3):d=1/3;var h=f.pow(d);return m&&(h.value=i(h.value)),h}}}),OE="matAlgo11xS0s",BE=["typed","equalScalar"],Jt=U(OE,BE,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a,o){var u=n._values,c=n._index,l=n._ptr,s=n._size,f=n._datatype;if(!u)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=s[0],m=s[1],d,h=r,w=0,v=a;typeof f=="string"&&(d=f,h=t.find(r,[d,d]),w=t.convert(0,d),i=t.convert(i,d),v=t.find(a,[d,d]));for(var x=[],g=[],b=[],y=0;y<m;y++){b[y]=g.length;for(var N=l[y],E=l[y+1],A=N;A<E;A++){var D=c[A],S=o?v(i,u[A]):v(u[A],i);h(S,w)||(g.push(D),x.push(S))}}return b[m]=g.length,n.createSparseMatrix({values:x,index:g,ptr:b,size:[p,m],datatype:d})}}),kE="matAlgo12xSfs",IE=["typed","DenseMatrix"],It=U(kE,IE,e=>{var{typed:t,DenseMatrix:r}=e;return function(n,i,a,o){var u=n._values,c=n._index,l=n._ptr,s=n._size,f=n._datatype;if(!u)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=s[0],m=s[1],d,h=a;typeof f=="string"&&(d=f,i=t.convert(i,d),h=t.find(a,[d,d]));for(var w=[],v=[],x=[],g=0;g<m;g++){for(var b=g+1,y=l[g],N=l[g+1],E=y;E<N;E++){var A=c[E];v[A]=u[E],x[A]=b}for(var D=0;D<p;D++)g===0&&(w[D]=[]),x[D]===b?w[D][g]=o?h(i,v[D]):h(v[D],i):w[D][g]=o?h(i,0):h(0,i)}return new r({data:w,size:[p,m],datatype:d})}}),RE="matAlgo14xDs",qE=["typed"],Jr=U(RE,qE,e=>{var{typed:t}=e;return function(n,i,a,o){var u=n._data,c=n._size,l=n._datatype,s,f=a;typeof l=="string"&&(s=l,i=t.convert(i,s),f=t.find(a,[s,s]));var p=c.length>0?r(f,0,c,c[0],u,i,o):[];return n.createDenseMatrix({data:p,size:ze(c),datatype:s})};function r(n,i,a,o,u,c,l){var s=[];if(i===a.length-1)for(var f=0;f<o;f++)s[f]=l?n(c,u[f]):n(u[f],c);else for(var p=0;p<o;p++)s[p]=r(n,i+1,a,a[i+1],u[p],c,l);return s}}),jc="ceil",zE=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],jE=U(jc,["typed","config","round"],e=>{var{typed:t,config:r,round:n}=e;return t(jc,{number:function(i){return sr(i,n(i),r.epsilon)?n(i):Math.ceil(i)},"number, number":function(i,a){if(sr(i,n(i,a),r.epsilon))return n(i,a);var[o,u]="".concat(i,"e").split("e"),c=Math.ceil(Number("".concat(o,"e").concat(Number(u)+a)));return[o,u]="".concat(c,"e").split("e"),Number("".concat(o,"e").concat(Number(u)-a))}})}),LE=U(jc,zE,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:u}=e,c=Jt({typed:t,equalScalar:a}),l=It({typed:t,DenseMatrix:u}),s=Jr({typed:t}),f=jE({typed:t,config:r,round:n});return t("ceil",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(p){return p.ceil()},"Complex, number":function(p,m){return p.ceil(m)},"Complex, BigNumber":function(p,m){return p.ceil(m.toNumber())},BigNumber:function(p){return Tr(p,n(p),r.epsilon)?n(p):p.ceil()},"BigNumber, BigNumber":function(p,m){return Tr(p,n(p,m),r.epsilon)?n(p,m):p.toDecimalPlaces(m.toNumber(),Yn.ROUND_CEIL)},Fraction:function(p){return p.ceil()},"Fraction, number":function(p,m){return p.ceil(m)},"Fraction, BigNumber":function(p,m){return p.ceil(m.toNumber())},"Array | Matrix":t.referToSelf(p=>m=>Qe(m,p)),"Array, number | BigNumber":t.referToSelf(p=>(m,d)=>Qe(m,h=>p(h,d))),"SparseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>c(m,d,p,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>s(m,d,p,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(p=>(m,d)=>s(i(d),m,p,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(p=>(m,d)=>a(m,0)?o(d.size(),d.storage()):d.storage()==="dense"?s(d,m,p,!0):l(d,m,p,!0))})}),_p="cube",PE=["typed"],VE=U(_p,PE,e=>{var{typed:t}=e;return t(_p,{number:_v,Complex:function(r){return r.mul(r).mul(r)},BigNumber:function(r){return r.times(r).times(r)},Fraction:function(r){return r.pow(3)},Unit:function(r){return r.pow(3)}})}),Fp="exp",UE=["typed"],$E=U(Fp,UE,e=>{var{typed:t}=e;return t(Fp,{number:Fv,Complex:function(r){return r.exp()},BigNumber:function(r){return r.exp()}})}),Tp="expm1",HE=["typed","Complex"],JE=U(Tp,HE,e=>{var{typed:t,Complex:r}=e;return t(Tp,{number:Tv,Complex:function(n){var i=Math.exp(n.re);return new r(i*Math.cos(n.im)-1,i*Math.sin(n.im))},BigNumber:function(n){return n.exp().minus(1)}})}),Lc="fix",GE=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],WE=U(Lc,["typed","ceil","floor"],e=>{var{typed:t,ceil:r,floor:n}=e;return t(Lc,{number:function(i){return i>0?n(i):r(i)},"number, number":function(i,a){return i>0?n(i,a):r(i,a)}})}),KE=U(Lc,GE,e=>{var{typed:t,Complex:r,matrix:n,ceil:i,floor:a,equalScalar:o,zeros:u,DenseMatrix:c}=e,l=It({typed:t,DenseMatrix:c}),s=Jr({typed:t}),f=WE({typed:t,ceil:i,floor:a});return t("fix",{number:f.signatures.number,"number, number | BigNumber":f.signatures["number,number"],Complex:function(p){return new r(p.re>0?Math.floor(p.re):Math.ceil(p.re),p.im>0?Math.floor(p.im):Math.ceil(p.im))},"Complex, number":function(p,m){return new r(p.re>0?a(p.re,m):i(p.re,m),p.im>0?a(p.im,m):i(p.im,m))},"Complex, BigNumber":function(p,m){var d=m.toNumber();return new r(p.re>0?a(p.re,d):i(p.re,d),p.im>0?a(p.im,d):i(p.im,d))},BigNumber:function(p){return p.isNegative()?i(p):a(p)},"BigNumber, number | BigNumber":function(p,m){return p.isNegative()?i(p,m):a(p,m)},Fraction:function(p){return p.s<0?p.ceil():p.floor()},"Fraction, number | BigNumber":function(p,m){return p.s<0?i(p,m):a(p,m)},"Array | Matrix":t.referToSelf(p=>m=>Qe(m,p)),"Array | Matrix, number | BigNumber":t.referToSelf(p=>(m,d)=>Qe(m,h=>p(h,d))),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(p=>(m,d)=>s(n(d),m,p,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(p=>(m,d)=>o(m,0)?u(d.size(),d.storage()):d.storage()==="dense"?s(d,m,p,!0):l(d,m,p,!0))})}),Pc="floor",QE=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],ZE=U(Pc,["typed","config","round"],e=>{var{typed:t,config:r,round:n}=e;return t(Pc,{number:function(i){return sr(i,n(i),r.epsilon)?n(i):Math.floor(i)},"number, number":function(i,a){if(sr(i,n(i,a),r.epsilon))return n(i,a);var[o,u]="".concat(i,"e").split("e"),c=Math.floor(Number("".concat(o,"e").concat(Number(u)+a)));return[o,u]="".concat(c,"e").split("e"),Number("".concat(o,"e").concat(Number(u)-a))}})}),yy=U(Pc,QE,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:u}=e,c=Jt({typed:t,equalScalar:a}),l=It({typed:t,DenseMatrix:u}),s=Jr({typed:t}),f=ZE({typed:t,config:r,round:n});return t("floor",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(p){return p.floor()},"Complex, number":function(p,m){return p.floor(m)},"Complex, BigNumber":function(p,m){return p.floor(m.toNumber())},BigNumber:function(p){return Tr(p,n(p),r.epsilon)?n(p):p.floor()},"BigNumber, BigNumber":function(p,m){return Tr(p,n(p,m),r.epsilon)?n(p,m):p.toDecimalPlaces(m.toNumber(),Yn.ROUND_FLOOR)},Fraction:function(p){return p.floor()},"Fraction, number":function(p,m){return p.floor(m)},"Fraction, BigNumber":function(p,m){return p.floor(m.toNumber())},"Array | Matrix":t.referToSelf(p=>m=>Qe(m,p)),"Array, number | BigNumber":t.referToSelf(p=>(m,d)=>Qe(m,h=>p(h,d))),"SparseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>c(m,d,p,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>s(m,d,p,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(p=>(m,d)=>s(i(d),m,p,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(p=>(m,d)=>a(m,0)?o(d.size(),d.storage()):d.storage()==="dense"?s(d,m,p,!0):l(d,m,p,!0))})}),XE="matAlgo02xDS0",YE=["typed","equalScalar"],Gr=U(XE,YE,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a,o){var u=n._data,c=n._size,l=n._datatype||n.getDataType(),s=i._values,f=i._index,p=i._ptr,m=i._size,d=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(c.length!==m.length)throw new Ke(c.length,m.length);if(c[0]!==m[0]||c[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+m+")");if(!s)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h=c[0],w=c[1],v,x=r,g=0,b=a;typeof l=="string"&&l===d&&l!=="mixed"&&(v=l,x=t.find(r,[v,v]),g=t.convert(0,v),b=t.find(a,[v,v]));for(var y=[],N=[],E=[],A=0;A<w;A++){E[A]=N.length;for(var D=p[A],S=p[A+1],C=D;C<S;C++){var _=f[C],R=o?b(s[C],u[_][A]):b(u[_][A],s[C]);x(R,g)||(N.push(_),y.push(R))}}return E[w]=N.length,i.createSparseMatrix({values:y,index:N,ptr:E,size:[h,w],datatype:l===n._datatype&&d===i._datatype?v:void 0})}}),eA="matAlgo03xDSf",tA=["typed"],cr=U(eA,tA,e=>{var{typed:t}=e;return function(r,n,i,a){var o=r._data,u=r._size,c=r._datatype||r.getDataType(),l=n._values,s=n._index,f=n._ptr,p=n._size,m=n._datatype||n._data===void 0?n._datatype:n.getDataType();if(u.length!==p.length)throw new Ke(u.length,p.length);if(u[0]!==p[0]||u[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+p+")");if(!l)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var d=u[0],h=u[1],w,v=0,x=i;typeof c=="string"&&c===m&&c!=="mixed"&&(w=c,v=t.convert(0,w),x=t.find(i,[w,w]));for(var g=[],b=0;b<d;b++)g[b]=[];for(var y=[],N=[],E=0;E<h;E++){for(var A=E+1,D=f[E],S=f[E+1],C=D;C<S;C++){var _=s[C];y[_]=a?x(l[C],o[_][E]):x(o[_][E],l[C]),N[_]=A}for(var R=0;R<d;R++)N[R]===A?g[R][E]=y[R]:g[R][E]=a?x(v,o[R][E]):x(o[R][E],v)}return r.createDenseMatrix({data:g,size:[d,h],datatype:c===r._datatype&&m===n._datatype?w:void 0})}}),rA="matAlgo05xSfSf",nA=["typed","equalScalar"],Nu=U(rA,nA,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a){var o=n._values,u=n._index,c=n._ptr,l=n._size,s=n._datatype||n._data===void 0?n._datatype:n.getDataType(),f=i._values,p=i._index,m=i._ptr,d=i._size,h=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==d.length)throw new Ke(l.length,d.length);if(l[0]!==d[0]||l[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+d+")");var w=l[0],v=l[1],x,g=r,b=0,y=a;typeof s=="string"&&s===h&&s!=="mixed"&&(x=s,g=t.find(r,[x,x]),b=t.convert(0,x),y=t.find(a,[x,x]));var N=o&&f?[]:void 0,E=[],A=[],D=N?[]:void 0,S=N?[]:void 0,C=[],_=[],R,P,I,O;for(P=0;P<v;P++){A[P]=E.length;var F=P+1;for(I=c[P],O=c[P+1];I<O;I++)R=u[I],E.push(R),C[R]=F,D&&(D[R]=o[I]);for(I=m[P],O=m[P+1];I<O;I++)R=p[I],C[R]!==F&&E.push(R),_[R]=F,S&&(S[R]=f[I]);if(N)for(I=A[P];I<E.length;){R=E[I];var q=C[R],k=_[R];if(q===F||k===F){var te=q===F?D[R]:b,se=k===F?S[R]:b,K=y(te,se);g(K,b)?E.splice(I,1):(N.push(K),I++)}}}return A[v]=E.length,n.createSparseMatrix({values:N,index:E,ptr:A,size:[w,v],datatype:s===n._datatype&&h===i._datatype?x:void 0})}}),iA="matAlgo13xDD",aA=["typed"],oA=U(iA,aA,e=>{var{typed:t}=e;return function(n,i,a){var o=n._data,u=n._size,c=n._datatype,l=i._data,s=i._size,f=i._datatype,p=[];if(u.length!==s.length)throw new Ke(u.length,s.length);for(var m=0;m<u.length;m++){if(u[m]!==s[m])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+s+")");p[m]=u[m]}var d,h=a;typeof c=="string"&&c===f&&(d=c,h=t.find(a,[d,d]));var w=p.length>0?r(h,0,p,p[0],o,l):[];return n.createDenseMatrix({data:w,size:p,datatype:d})};function r(n,i,a,o,u,c){var l=[];if(i===a.length-1)for(var s=0;s<o;s++)l[s]=n(u[s],c[s]);else for(var f=0;f<o;f++)l[f]=r(n,i+1,a,a[i+1],u[f],c[f]);return l}}),sA="broadcast",uA=["concat"],cA=U(sA,uA,e=>{var{concat:t}=e;return function(i,a){var o=Math.max(i._size.length,a._size.length);if(i._size.length===a._size.length&&i._size.every((d,h)=>d===a._size[h]))return[i,a];for(var u=r(i._size,o,0),c=r(a._size,o,0),l=[],s=0;s<o;s++)l[s]=Math.max(u[s],c[s]);qs(u,l),qs(c,l);var f=i.clone(),p=a.clone();f._size.length<o?f.reshape(r(f._size,o,1)):p._size.length<o&&p.reshape(r(p._size,o,1));for(var m=0;m<o;m++)f._size[m]<l[m]&&(f=n(f,l[m],m)),p._size[m]<l[m]&&(p=n(p,l[m],m));return[f,p]};function r(i,a,o){return[...Array(a-i.length).fill(o),...i]}function n(i,a,o){return t(...Array(a).fill(i),o)}}),lA="matrixAlgorithmSuite",fA=["typed","matrix","concat"],gt=U(lA,fA,e=>{var{typed:t,matrix:r,concat:n}=e,i=oA({typed:t}),a=Jr({typed:t}),o=cA({concat:n});return function(u){var c=u.elop,l=u.SD||u.DS,s;c?(s={"DenseMatrix, DenseMatrix":(d,h)=>i(...o(d,h),c),"Array, Array":(d,h)=>i(...o(r(d),r(h)),c).valueOf(),"Array, DenseMatrix":(d,h)=>i(...o(r(d),h),c),"DenseMatrix, Array":(d,h)=>i(...o(d,r(h)),c)},u.SS&&(s["SparseMatrix, SparseMatrix"]=(d,h)=>u.SS(...o(d,h),c,!1)),u.DS&&(s["DenseMatrix, SparseMatrix"]=(d,h)=>u.DS(...o(d,h),c,!1),s["Array, SparseMatrix"]=(d,h)=>u.DS(...o(r(d),h),c,!1)),l&&(s["SparseMatrix, DenseMatrix"]=(d,h)=>l(...o(h,d),c,!0),s["SparseMatrix, Array"]=(d,h)=>l(...o(r(h),d),c,!0))):(s={"DenseMatrix, DenseMatrix":t.referToSelf(d=>(h,w)=>i(...o(h,w),d)),"Array, Array":t.referToSelf(d=>(h,w)=>i(...o(r(h),r(w)),d).valueOf()),"Array, DenseMatrix":t.referToSelf(d=>(h,w)=>i(...o(r(h),w),d)),"DenseMatrix, Array":t.referToSelf(d=>(h,w)=>i(...o(h,r(w)),d))},u.SS&&(s["SparseMatrix, SparseMatrix"]=t.referToSelf(d=>(h,w)=>u.SS(...o(h,w),d,!1))),u.DS&&(s["DenseMatrix, SparseMatrix"]=t.referToSelf(d=>(h,w)=>u.DS(...o(h,w),d,!1)),s["Array, SparseMatrix"]=t.referToSelf(d=>(h,w)=>u.DS(...o(r(h),w),d,!1))),l&&(s["SparseMatrix, DenseMatrix"]=t.referToSelf(d=>(h,w)=>l(...o(w,h),d,!0)),s["SparseMatrix, Array"]=t.referToSelf(d=>(h,w)=>l(...o(r(w),h),d,!0))));var f=u.scalar||"any",p=u.Ds||u.Ss;p&&(c?(s["DenseMatrix,"+f]=(d,h)=>a(d,h,c,!1),s[f+", DenseMatrix"]=(d,h)=>a(h,d,c,!0),s["Array,"+f]=(d,h)=>a(r(d),h,c,!1).valueOf(),s[f+", Array"]=(d,h)=>a(r(h),d,c,!0).valueOf()):(s["DenseMatrix,"+f]=t.referToSelf(d=>(h,w)=>a(h,w,d,!1)),s[f+", DenseMatrix"]=t.referToSelf(d=>(h,w)=>a(w,h,d,!0)),s["Array,"+f]=t.referToSelf(d=>(h,w)=>a(r(h),w,d,!1).valueOf()),s[f+", Array"]=t.referToSelf(d=>(h,w)=>a(r(w),h,d,!0).valueOf())));var m=u.sS!==void 0?u.sS:u.Ss;return c?(u.Ss&&(s["SparseMatrix,"+f]=(d,h)=>u.Ss(d,h,c,!1)),m&&(s[f+", SparseMatrix"]=(d,h)=>m(h,d,c,!0))):(u.Ss&&(s["SparseMatrix,"+f]=t.referToSelf(d=>(h,w)=>u.Ss(h,w,d,!1))),m&&(s[f+", SparseMatrix"]=t.referToSelf(d=>(h,w)=>m(w,h,d,!0)))),c&&c.signatures&&Vg(s,c.signatures),s}}),Op="mod",pA=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],by=U(Op,pA,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:u,concat:c}=e,l=yy({typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:u}),s=Gr({typed:t,equalScalar:a}),f=cr({typed:t}),p=Nu({typed:t,equalScalar:a}),m=Jt({typed:t,equalScalar:a}),d=It({typed:t,DenseMatrix:u}),h=gt({typed:t,matrix:i,concat:c});return t(Op,{"number, number":w,"BigNumber, BigNumber":function(v,x){return x.isZero()?v:v.sub(x.mul(l(v.div(x))))},"Fraction, Fraction":function(v,x){return x.equals(0)?v:v.sub(x.mul(l(v.div(x))))}},h({SS:p,DS:f,SD:s,Ss:m,sS:d}));function w(v,x){return x===0?v:v-x*l(v/x)}}),mA="matAlgo01xDSid",dA=["typed"],ii=U(mA,dA,e=>{var{typed:t}=e;return function(r,n,i,a){var o=r._data,u=r._size,c=r._datatype||r.getDataType(),l=n._values,s=n._index,f=n._ptr,p=n._size,m=n._datatype||n._data===void 0?n._datatype:n.getDataType();if(u.length!==p.length)throw new Ke(u.length,p.length);if(u[0]!==p[0]||u[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+p+")");if(!l)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var d=u[0],h=u[1],w=typeof c=="string"&&c!=="mixed"&&c===m?c:void 0,v=w?t.find(i,[w,w]):i,x,g,b=[];for(x=0;x<d;x++)b[x]=[];var y=[],N=[];for(g=0;g<h;g++){for(var E=g+1,A=f[g],D=f[g+1],S=A;S<D;S++)x=s[S],y[x]=a?v(l[S],o[x][g]):v(o[x][g],l[S]),N[x]=E;for(x=0;x<d;x++)N[x]===E?b[x][g]=y[x]:b[x][g]=o[x][g]}return r.createDenseMatrix({data:b,size:[d,h],datatype:c===r._datatype&&m===n._datatype?w:void 0})}}),hA="matAlgo04xSidSid",gA=["typed","equalScalar"],Sl=U(hA,gA,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a){var o=n._values,u=n._index,c=n._ptr,l=n._size,s=n._datatype||n._data===void 0?n._datatype:n.getDataType(),f=i._values,p=i._index,m=i._ptr,d=i._size,h=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==d.length)throw new Ke(l.length,d.length);if(l[0]!==d[0]||l[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+d+")");var w=l[0],v=l[1],x,g=r,b=0,y=a;typeof s=="string"&&s===h&&s!=="mixed"&&(x=s,g=t.find(r,[x,x]),b=t.convert(0,x),y=t.find(a,[x,x]));var N=o&&f?[]:void 0,E=[],A=[],D=o&&f?[]:void 0,S=o&&f?[]:void 0,C=[],_=[],R,P,I,O,F;for(P=0;P<v;P++){A[P]=E.length;var q=P+1;for(O=c[P],F=c[P+1],I=O;I<F;I++)R=u[I],E.push(R),C[R]=q,D&&(D[R]=o[I]);for(O=m[P],F=m[P+1],I=O;I<F;I++)if(R=p[I],C[R]===q){if(D){var k=y(D[R],f[I]);g(k,b)?C[R]=null:D[R]=k}}else E.push(R),_[R]=q,S&&(S[R]=f[I]);if(D&&S)for(I=A[P];I<E.length;)R=E[I],C[R]===q?(N[I]=D[R],I++):_[R]===q?(N[I]=S[R],I++):E.splice(I,1)}return A[v]=E.length,n.createSparseMatrix({values:N,index:E,ptr:A,size:[w,v],datatype:s===n._datatype&&h===i._datatype?x:void 0})}}),vA="matAlgo10xSids",yA=["typed","DenseMatrix"],zi=U(vA,yA,e=>{var{typed:t,DenseMatrix:r}=e;return function(n,i,a,o){var u=n._values,c=n._index,l=n._ptr,s=n._size,f=n._datatype;if(!u)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=s[0],m=s[1],d,h=a;typeof f=="string"&&(d=f,i=t.convert(i,d),h=t.find(a,[d,d]));for(var w=[],v=[],x=[],g=0;g<m;g++){for(var b=g+1,y=l[g],N=l[g+1],E=y;E<N;E++){var A=c[E];v[A]=u[E],x[A]=b}for(var D=0;D<p;D++)g===0&&(w[D]=[]),x[D]===b?w[D][g]=o?h(i,v[D]):h(v[D],i):w[D][g]=i}return new r({data:w,size:[p,m],datatype:d})}});function ji(e,t,r,n){if(!(this instanceof ji))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=r,this.max=n,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+r+(n!=null?"-"+n:"")+" expected)",this.stack=new Error().stack}ji.prototype=new Error;ji.prototype.constructor=Error;ji.prototype.name="ArgumentsError";ji.prototype.isArgumentsError=!0;var Bp="gcd",bA=["typed","config","round","matrix","equalScalar","zeros","BigNumber","DenseMatrix","concat"],lc="number | BigNumber | Fraction | Matrix | Array",xA="".concat(lc,", ").concat(lc,", ...").concat(lc);function kp(e){return!e.some(t=>Array.isArray(t))}var wA=U(Bp,bA,e=>{var{typed:t,matrix:r,config:n,round:i,equalScalar:a,zeros:o,BigNumber:u,DenseMatrix:c,concat:l}=e,s=by({typed:t,config:n,round:i,matrix:r,equalScalar:a,zeros:o,DenseMatrix:c,concat:l}),f=ii({typed:t}),p=Sl({typed:t,equalScalar:a}),m=zi({typed:t,DenseMatrix:c}),d=gt({typed:t,matrix:r,concat:l});return t(Bp,{"number, number":h,"BigNumber, BigNumber":w,"Fraction, Fraction":(v,x)=>v.gcd(x)},d({SS:p,DS:f,Ss:m}),{[xA]:t.referToSelf(v=>(x,g,b)=>{for(var y=v(x,g),N=0;N<b.length;N++)y=v(y,b[N]);return y}),Array:t.referToSelf(v=>x=>{if(x.length===1&&Array.isArray(x[0])&&kp(x[0]))return v(...x[0]);if(kp(x))return v(...x);throw new ji("gcd() supports only 1d matrices!")}),Matrix:t.referToSelf(v=>x=>v(x.toArray()))});function h(v,x){if(!Fe(v)||!Fe(x))throw new Error("Parameters in function gcd must be integer numbers");for(var g;x!==0;)g=s(v,x),v=x,x=g;return v<0?-v:v}function w(v,x){if(!v.isInt()||!x.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var g=new u(0);!x.isZero();){var b=s(v,x);v=x,x=b}return v.lt(g)?v.neg():v}}),NA="matAlgo06xS0S0",DA=["typed","equalScalar"],Du=U(NA,DA,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a){var o=n._values,u=n._size,c=n._datatype||n._data===void 0?n._datatype:n.getDataType(),l=i._values,s=i._size,f=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(u.length!==s.length)throw new Ke(u.length,s.length);if(u[0]!==s[0]||u[1]!==s[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+s+")");var p=u[0],m=u[1],d,h=r,w=0,v=a;typeof c=="string"&&c===f&&c!=="mixed"&&(d=c,h=t.find(r,[d,d]),w=t.convert(0,d),v=t.find(a,[d,d]));for(var x=o&&l?[]:void 0,g=[],b=[],y=x?[]:void 0,N=[],E=[],A=0;A<m;A++){b[A]=g.length;var D=A+1;if(ip(n,A,N,y,E,D,g,v),ip(i,A,N,y,E,D,g,v),y)for(var S=b[A];S<g.length;){var C=g[S];if(E[C]===D){var _=y[C];h(_,w)?g.splice(S,1):(x.push(_),S++)}else g.splice(S,1)}else for(var R=b[A];R<g.length;){var P=g[R];E[P]!==D?g.splice(R,1):R++}}return b[m]=g.length,n.createSparseMatrix({values:x,index:g,ptr:b,size:[p,m],datatype:c===n._datatype&&f===i._datatype?d:void 0})}}),Ip="lcm",EA=["typed","matrix","equalScalar","concat"],AA=U(Ip,EA,e=>{var{typed:t,matrix:r,equalScalar:n,concat:i}=e,a=Gr({typed:t,equalScalar:n}),o=Du({typed:t,equalScalar:n}),u=Jt({typed:t,equalScalar:n}),c=gt({typed:t,matrix:r,concat:i}),l="number | BigNumber | Fraction | Matrix | Array",s={};return s["".concat(l,", ").concat(l,", ...").concat(l)]=t.referToSelf(p=>(m,d,h)=>{for(var w=p(m,d),v=0;v<h.length;v++)w=p(w,h[v]);return w}),t(Ip,{"number, number":Ov,"BigNumber, BigNumber":f,"Fraction, Fraction":(p,m)=>p.lcm(m)},c({SS:o,DS:a,Ss:u}),s);function f(p,m){if(!p.isInt()||!m.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(p.isZero())return p;if(m.isZero())return m;for(var d=p.times(m);!m.isZero();){var h=m;m=p.mod(h),p=h}return d.div(p).abs()}}),Rp="log10",SA=["typed","config","Complex"],CA=U(Rp,SA,e=>{var{typed:t,config:r,Complex:n}=e;return t(Rp,{number:function(i){return i>=0||r.predictable?Bv(i):new n(i,0).log().div(Math.LN10)},Complex:function(i){return new n(i).log().div(Math.LN10)},BigNumber:function(i){return!i.isNegative()||r.predictable?i.log():new n(i.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":t.referToSelf(i=>a=>Qe(a,i))})}),qp="log2",MA=["typed","config","Complex"],_A=U(qp,MA,e=>{var{typed:t,config:r,Complex:n}=e;return t(qp,{number:function(a){return a>=0||r.predictable?kv(a):i(new n(a,0))},Complex:i,BigNumber:function(a){return!a.isNegative()||r.predictable?a.log(2):i(new n(a.toNumber(),0))},"Array | Matrix":t.referToSelf(a=>o=>Qe(o,a))});function i(a){var o=Math.sqrt(a.re*a.re+a.im*a.im);return new n(Math.log2?Math.log2(o):Math.log(o)/Math.LN2,Math.atan2(a.im,a.re)/Math.LN2)}}),FA="multiplyScalar",TA=["typed"],OA=U(FA,TA,e=>{var{typed:t}=e;return t("multiplyScalar",{"number, number":Sv,"Complex, Complex":function(r,n){return r.mul(n)},"BigNumber, BigNumber":function(r,n){return r.times(n)},"Fraction, Fraction":function(r,n){return r.mul(n)},"number | Fraction | BigNumber | Complex, Unit":(r,n)=>n.multiply(r),"Unit, number | Fraction | BigNumber | Complex | Unit":(r,n)=>r.multiply(n)})}),zp="multiply",BA=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],kA=U(zp,BA,e=>{var{typed:t,matrix:r,addScalar:n,multiplyScalar:i,equalScalar:a,dot:o}=e,u=Jt({typed:t,equalScalar:a}),c=Jr({typed:t});function l(y,N){switch(y.length){case 1:switch(N.length){case 1:if(y[0]!==N[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(y[0]!==N[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+y[0]+") must match Matrix rows ("+N[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+N.length+" dimensions)")}break;case 2:switch(N.length){case 1:if(y[1]!==N[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+y[1]+") must match Vector length ("+N[0]+")");break;case 2:if(y[1]!==N[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+y[1]+") must match Matrix B rows ("+N[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+N.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+y.length+" dimensions)")}}function s(y,N,E){if(E===0)throw new Error("Cannot multiply two empty vectors");return o(y,N)}function f(y,N){if(N.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return p(y,N)}function p(y,N){var E=y._data,A=y._size,D=y._datatype||y.getDataType(),S=N._data,C=N._size,_=N._datatype||N.getDataType(),R=A[0],P=C[1],I,O=n,F=i;D&&_&&D===_&&typeof D=="string"&&D!=="mixed"&&(I=D,O=t.find(n,[I,I]),F=t.find(i,[I,I]));for(var q=[],k=0;k<P;k++){for(var te=F(E[0],S[0][k]),se=1;se<R;se++)te=O(te,F(E[se],S[se][k]));q[k]=te}return y.createDenseMatrix({data:q,size:[P],datatype:D===y._datatype&&_===N._datatype?I:void 0})}var m=t("_multiplyMatrixVector",{"DenseMatrix, any":h,"SparseMatrix, any":x}),d=t("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":w,"DenseMatrix, SparseMatrix":v,"SparseMatrix, DenseMatrix":g,"SparseMatrix, SparseMatrix":b});function h(y,N){var E=y._data,A=y._size,D=y._datatype||y.getDataType(),S=N._data,C=N._datatype||N.getDataType(),_=A[0],R=A[1],P,I=n,O=i;D&&C&&D===C&&typeof D=="string"&&D!=="mixed"&&(P=D,I=t.find(n,[P,P]),O=t.find(i,[P,P]));for(var F=[],q=0;q<_;q++){for(var k=E[q],te=O(k[0],S[0]),se=1;se<R;se++)te=I(te,O(k[se],S[se]));F[q]=te}return y.createDenseMatrix({data:F,size:[_],datatype:D===y._datatype&&C===N._datatype?P:void 0})}function w(y,N){var E=y._data,A=y._size,D=y._datatype||y.getDataType(),S=N._data,C=N._size,_=N._datatype||N.getDataType(),R=A[0],P=A[1],I=C[1],O,F=n,q=i;D&&_&&D===_&&typeof D=="string"&&D!=="mixed"&&D!=="mixed"&&(O=D,F=t.find(n,[O,O]),q=t.find(i,[O,O]));for(var k=[],te=0;te<R;te++){var se=E[te];k[te]=[];for(var K=0;K<I;K++){for(var V=q(se[0],S[0][K]),ue=1;ue<P;ue++)V=F(V,q(se[ue],S[ue][K]));k[te][K]=V}}return y.createDenseMatrix({data:k,size:[R,I],datatype:D===y._datatype&&_===N._datatype?O:void 0})}function v(y,N){var E=y._data,A=y._size,D=y._datatype||y.getDataType(),S=N._values,C=N._index,_=N._ptr,R=N._size,P=N._datatype||N._data===void 0?N._datatype:N.getDataType();if(!S)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var I=A[0],O=R[1],F,q=n,k=i,te=a,se=0;D&&P&&D===P&&typeof D=="string"&&D!=="mixed"&&(F=D,q=t.find(n,[F,F]),k=t.find(i,[F,F]),te=t.find(a,[F,F]),se=t.convert(0,F));for(var K=[],V=[],ue=[],me=N.createSparseMatrix({values:K,index:V,ptr:ue,size:[I,O],datatype:D===y._datatype&&P===N._datatype?F:void 0}),re=0;re<O;re++){ue[re]=V.length;var ae=_[re],de=_[re+1];if(de>ae)for(var ne=0,ce=0;ce<I;ce++){for(var le=ce+1,he=void 0,xe=ae;xe<de;xe++){var $=C[xe];ne!==le?(he=k(E[ce][$],S[xe]),ne=le):he=q(he,k(E[ce][$],S[xe]))}ne===le&&!te(he,se)&&(V.push(ce),K.push(he))}}return ue[O]=V.length,me}function x(y,N){var E=y._values,A=y._index,D=y._ptr,S=y._datatype||y._data===void 0?y._datatype:y.getDataType();if(!E)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var C=N._data,_=N._datatype||N.getDataType(),R=y._size[0],P=N._size[0],I=[],O=[],F=[],q,k=n,te=i,se=a,K=0;S&&_&&S===_&&typeof S=="string"&&S!=="mixed"&&(q=S,k=t.find(n,[q,q]),te=t.find(i,[q,q]),se=t.find(a,[q,q]),K=t.convert(0,q));var V=[],ue=[];F[0]=0;for(var me=0;me<P;me++){var re=C[me];if(!se(re,K))for(var ae=D[me],de=D[me+1],ne=ae;ne<de;ne++){var ce=A[ne];ue[ce]?V[ce]=k(V[ce],te(re,E[ne])):(ue[ce]=!0,O.push(ce),V[ce]=te(re,E[ne]))}}for(var le=O.length,he=0;he<le;he++){var xe=O[he];I[he]=V[xe]}return F[1]=O.length,y.createSparseMatrix({values:I,index:O,ptr:F,size:[R,1],datatype:S===y._datatype&&_===N._datatype?q:void 0})}function g(y,N){var E=y._values,A=y._index,D=y._ptr,S=y._datatype||y._data===void 0?y._datatype:y.getDataType();if(!E)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var C=N._data,_=N._datatype||N.getDataType(),R=y._size[0],P=N._size[0],I=N._size[1],O,F=n,q=i,k=a,te=0;S&&_&&S===_&&typeof S=="string"&&S!=="mixed"&&(O=S,F=t.find(n,[O,O]),q=t.find(i,[O,O]),k=t.find(a,[O,O]),te=t.convert(0,O));for(var se=[],K=[],V=[],ue=y.createSparseMatrix({values:se,index:K,ptr:V,size:[R,I],datatype:S===y._datatype&&_===N._datatype?O:void 0}),me=[],re=[],ae=0;ae<I;ae++){V[ae]=K.length;for(var de=ae+1,ne=0;ne<P;ne++){var ce=C[ne][ae];if(!k(ce,te))for(var le=D[ne],he=D[ne+1],xe=le;xe<he;xe++){var $=A[xe];re[$]!==de?(re[$]=de,K.push($),me[$]=q(ce,E[xe])):me[$]=F(me[$],q(ce,E[xe]))}}for(var T=V[ae],z=K.length,J=T;J<z;J++){var L=K[J];se[J]=me[L]}}return V[I]=K.length,ue}function b(y,N){var E=y._values,A=y._index,D=y._ptr,S=y._datatype||y._data===void 0?y._datatype:y.getDataType(),C=N._values,_=N._index,R=N._ptr,P=N._datatype||N._data===void 0?N._datatype:N.getDataType(),I=y._size[0],O=N._size[1],F=E&&C,q,k=n,te=i;S&&P&&S===P&&typeof S=="string"&&S!=="mixed"&&(q=S,k=t.find(n,[q,q]),te=t.find(i,[q,q]));for(var se=F?[]:void 0,K=[],V=[],ue=y.createSparseMatrix({values:se,index:K,ptr:V,size:[I,O],datatype:S===y._datatype&&P===N._datatype?q:void 0}),me=F?[]:void 0,re=[],ae,de,ne,ce,le,he,xe,$,T=0;T<O;T++){V[T]=K.length;var z=T+1;for(le=R[T],he=R[T+1],ce=le;ce<he;ce++)if($=_[ce],F)for(de=D[$],ne=D[$+1],ae=de;ae<ne;ae++)xe=A[ae],re[xe]!==z?(re[xe]=z,K.push(xe),me[xe]=te(C[ce],E[ae])):me[xe]=k(me[xe],te(C[ce],E[ae]));else for(de=D[$],ne=D[$+1],ae=de;ae<ne;ae++)xe=A[ae],re[xe]!==z&&(re[xe]=z,K.push(xe));if(F)for(var J=V[T],L=K.length,H=J;H<L;H++){var G=K[H];se[H]=me[G]}}return V[O]=K.length,ue}return t(zp,i,{"Array, Array":t.referTo("Matrix, Matrix",y=>(N,E)=>{l(Ve(N),Ve(E));var A=y(r(N),r(E));return ke(A)?A.valueOf():A}),"Matrix, Matrix":function(y,N){var E=y.size(),A=N.size();return l(E,A),E.length===1?A.length===1?s(y,N,E[0]):f(y,N):A.length===1?m(y,N):d(y,N)},"Matrix, Array":t.referTo("Matrix,Matrix",y=>(N,E)=>y(N,r(E))),"Array, Matrix":t.referToSelf(y=>(N,E)=>y(r(N,E.storage()),E)),"SparseMatrix, any":function(y,N){return u(y,N,i,!1)},"DenseMatrix, any":function(y,N){return c(y,N,i,!1)},"any, SparseMatrix":function(y,N){return u(N,y,i,!0)},"any, DenseMatrix":function(y,N){return c(N,y,i,!0)},"Array, any":function(y,N){return c(r(y),N,i,!1).valueOf()},"any, Array":function(y,N){return c(r(N),y,i,!0).valueOf()},"any, any":i,"any, any, ...any":t.referToSelf(y=>(N,E,A)=>{for(var D=y(N,E),S=0;S<A.length;S++)D=y(D,A[S]);return D})})}),jp="nthRoot",IA=["typed","matrix","equalScalar","BigNumber","concat"],RA=U(jp,IA,e=>{var{typed:t,matrix:r,equalScalar:n,BigNumber:i,concat:a}=e,o=ii({typed:t}),u=Gr({typed:t,equalScalar:n}),c=Du({typed:t,equalScalar:n}),l=Jt({typed:t,equalScalar:n}),s=gt({typed:t,matrix:r,concat:a});function f(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return t(jp,{number:op,"number, number":op,BigNumber:m=>p(m,new i(2)),"BigNumber, BigNumber":p,Complex:f,"Complex, number":f,Array:t.referTo("DenseMatrix,number",m=>d=>m(r(d),2).valueOf()),DenseMatrix:t.referTo("DenseMatrix,number",m=>d=>m(d,2)),SparseMatrix:t.referTo("SparseMatrix,number",m=>d=>m(d,2)),"SparseMatrix, SparseMatrix":t.referToSelf(m=>(d,h)=>{if(h.density()===1)return c(d,h,m);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":t.referToSelf(m=>(d,h)=>{if(h.density()===1)return o(d,h,m,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":t.referTo("DenseMatrix,SparseMatrix",m=>(d,h)=>m(r(d),h)),"number | BigNumber, SparseMatrix":t.referToSelf(m=>(d,h)=>{if(h.density()===1)return l(h,d,m,!0);throw new Error("Root must be non-zero")})},s({scalar:"number | BigNumber",SD:u,Ss:l,sS:!1}));function p(m,d){var h=i.precision,w=i.clone({precision:h+2}),v=new i(0),x=new w(1),g=d.isNegative();if(g&&(d=d.neg()),d.isZero())throw new Error("Root must be non-zero");if(m.isNegative()&&!d.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(m.isZero())return g?new w(1/0):0;if(!m.isFinite())return g?v:m;var b=m.abs().pow(x.div(d));return b=m.isNeg()?b.neg():b,new i((g?x.div(b):b).toPrecision(h))}}),Lp="sign",qA=["typed","BigNumber","Fraction","complex"],zA=U(Lp,qA,e=>{var{typed:t,BigNumber:r,complex:n,Fraction:i}=e;return t(Lp,{number:zc,Complex:function(a){return a.im===0?n(zc(a.re)):a.sign()},BigNumber:function(a){return new r(a.cmp(0))},Fraction:function(a){return new i(a.s,1)},"Array | Matrix":t.referToSelf(a=>o=>Qe(o,a)),Unit:t.referToSelf(a=>o=>{if(!o._isDerived()&&o.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return t.find(a,o.valueType())(o.value)})})}),jA="sqrt",LA=["config","typed","Complex"],PA=U(jA,LA,e=>{var{config:t,typed:r,Complex:n}=e;return r("sqrt",{number:i,Complex:function(a){return a.sqrt()},BigNumber:function(a){return!a.isNegative()||t.predictable?a.sqrt():i(a.toNumber())},Unit:function(a){return a.pow(.5)}});function i(a){return isNaN(a)?NaN:a>=0||t.predictable?Math.sqrt(a):new n(a,0).sqrt()}}),Pp="square",VA=["typed"],UA=U(Pp,VA,e=>{var{typed:t}=e;return t(Pp,{number:Iv,Complex:function(r){return r.mul(r)},BigNumber:function(r){return r.times(r)},Fraction:function(r){return r.mul(r)},Unit:function(r){return r.pow(2)}})}),Vp="subtract",$A=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],HA=U(Vp,$A,e=>{var{typed:t,matrix:r,equalScalar:n,subtractScalar:i,unaryMinus:a,DenseMatrix:o,concat:u}=e,c=ii({typed:t}),l=cr({typed:t}),s=Nu({typed:t,equalScalar:n}),f=zi({typed:t,DenseMatrix:o}),p=It({typed:t,DenseMatrix:o}),m=gt({typed:t,matrix:r,concat:u});return t(Vp,{"any, any":i},m({elop:i,SS:s,DS:c,SD:l,Ss:p,sS:f}))}),Up="xgcd",JA=["typed","config","matrix","BigNumber"],GA=U(Up,JA,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(Up,{"number, number":function(o,u){var c=Rv(o,u);return r.matrix==="Array"?c:n(c)},"BigNumber, BigNumber":a});function a(o,u){var c,l,s,f=new i(0),p=new i(1),m=f,d=p,h=p,w=f;if(!o.isInt()||!u.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!u.isZero();)l=o.div(u).floor(),s=o.mod(u),c=m,m=d.minus(l.times(m)),d=c,c=h,h=w.minus(l.times(h)),w=c,o=u,u=s;var v;return o.lt(f)?v=[o.neg(),d.neg(),w.neg()]:v=[o,o.isZero()?0:d,w],r.matrix==="Array"?v:n(v)}}),$p="invmod",WA=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],KA=U($p,WA,e=>{var{typed:t,config:r,BigNumber:n,xgcd:i,equal:a,smaller:o,mod:u,add:c,isInteger:l}=e;return t($p,{"number, number":s,"BigNumber, BigNumber":s});function s(f,p){if(!l(f)||!l(p))throw new Error("Parameters in function invmod must be integer numbers");if(f=u(f,p),a(p,0))throw new Error("Divisor must be non zero");var m=i(f,p);m=m.valueOf();var[d,h]=m;return a(d,n(1))?(h=u(h,p),o(h,n(0))&&(h=c(h,p)),h):NaN}}),QA="matAlgo09xS0Sf",ZA=["typed","equalScalar"],xy=U(QA,ZA,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a){var o=n._values,u=n._index,c=n._ptr,l=n._size,s=n._datatype||n._data===void 0?n._datatype:n.getDataType(),f=i._values,p=i._index,m=i._ptr,d=i._size,h=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==d.length)throw new Ke(l.length,d.length);if(l[0]!==d[0]||l[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+d+")");var w=l[0],v=l[1],x,g=r,b=0,y=a;typeof s=="string"&&s===h&&s!=="mixed"&&(x=s,g=t.find(r,[x,x]),b=t.convert(0,x),y=t.find(a,[x,x]));var N=o&&f?[]:void 0,E=[],A=[],D=N?[]:void 0,S=[],C,_,R,P,I;for(_=0;_<v;_++){A[_]=E.length;var O=_+1;if(D)for(P=m[_],I=m[_+1],R=P;R<I;R++)C=p[R],S[C]=O,D[C]=f[R];for(P=c[_],I=c[_+1],R=P;R<I;R++)if(C=u[R],D){var F=S[C]===O?D[C]:b,q=y(o[R],F);g(q,b)||(E.push(C),N.push(q))}else E.push(C)}return A[v]=E.length,n.createSparseMatrix({values:N,index:E,ptr:A,size:[w,v],datatype:s===n._datatype&&h===i._datatype?x:void 0})}}),Hp="dotMultiply",XA=["typed","matrix","equalScalar","multiplyScalar","concat"],YA=U(Hp,XA,e=>{var{typed:t,matrix:r,equalScalar:n,multiplyScalar:i,concat:a}=e,o=Gr({typed:t,equalScalar:n}),u=xy({typed:t,equalScalar:n}),c=Jt({typed:t,equalScalar:n}),l=gt({typed:t,matrix:r,concat:a});return t(Hp,l({elop:i,SS:u,DS:o,Ss:c}))});function eS(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitAnd");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero()||t.eq(-1)||e.eq(t))return e;if(t.isZero()||e.eq(-1))return t;if(!e.isFinite()||!t.isFinite()){if(!e.isFinite()&&!t.isFinite())return e.isNegative()===t.isNegative()?e:new r(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new r(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new r(0):e}return Cl(e,t,function(n,i){return n&i})}function uo(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var t=e.constructor,r=t.precision;t.config({precision:1e9});var n=e.plus(new t(1));return n.s=-n.s||null,t.config({precision:r}),n}function tS(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitOr");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);var n=new r(-1);return e.isZero()||t.eq(n)||e.eq(t)?t:t.isZero()||e.eq(n)?e:!e.isFinite()||!t.isFinite()?!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?n:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e:Cl(e,t,function(i,a){return i|a})}function Cl(e,t,r){var n=e.constructor,i,a,o=+(e.s<0),u=+(t.s<0);if(o){i=$o(uo(e));for(var c=0;c<i.length;++c)i[c]^=1}else i=$o(e);if(u){a=$o(uo(t));for(var l=0;l<a.length;++l)a[l]^=1}else a=$o(t);var s,f,p;i.length<=a.length?(s=i,f=a,p=o):(s=a,f=i,p=u);var m=s.length,d=f.length,h=r(o,u)^1,w=new n(h^1),v=new n(1),x=new n(2),g=n.precision;for(n.config({precision:1e9});m>0;)r(s[--m],f[--d])===h&&(w=w.plus(v)),v=v.times(x);for(;d>0;)r(p,f[--d])===h&&(w=w.plus(v)),v=v.times(x);return n.config({precision:g}),h===0&&(w.s=-w.s),w}function $o(e){for(var t=e.d,r=t[0]+"",n=1;n<t.length;++n){for(var i=t[n]+"",a=7-i.length;a--;)i="0"+i;r+=i}for(var o=r.length;r.charAt(o)==="0";)o--;var u=e.e,c=r.slice(0,o+1||1),l=c.length;if(u>0)if(++u>l)for(u-=l;u--;)c+="0";else u<l&&(c=c.slice(0,u)+"."+c.slice(u));for(var s=[0],f=0;f<c.length;){for(var p=s.length;p--;)s[p]*=10;s[0]+=parseInt(c.charAt(f++));for(var m=0;m<s.length;++m)s[m]>1&&((s[m+1]===null||s[m+1]===void 0)&&(s[m+1]=0),s[m+1]+=s[m]>>1,s[m]&=1)}return s.reverse()}function rS(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitXor");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero())return t;if(t.isZero())return e;if(e.eq(t))return new r(0);var n=new r(-1);return e.eq(n)?uo(t):t.eq(n)?uo(e):!e.isFinite()||!t.isFinite()?!e.isFinite()&&!t.isFinite()?n:new r(e.isNegative()===t.isNegative()?1/0:-1/0):Cl(e,t,function(i,a){return i^a})}function nS(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function leftShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:!e.isFinite()&&!t.isFinite()?new r(NaN):t.lt(55)?e.times(Math.pow(2,t.toNumber())+""):e.times(new r(2).pow(t))}function iS(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function rightArithShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:t.isFinite()?t.lt(55)?e.div(Math.pow(2,t.toNumber())+"").floor():e.div(new r(2).pow(t)).floor():e.isNegative()?new r(-1):e.isFinite()?new r(0):new r(NaN)}var Jp="bitAnd",aS=["typed","matrix","equalScalar","concat"],wy=U(Jp,aS,e=>{var{typed:t,matrix:r,equalScalar:n,concat:i}=e,a=Gr({typed:t,equalScalar:n}),o=Du({typed:t,equalScalar:n}),u=Jt({typed:t,equalScalar:n}),c=gt({typed:t,matrix:r,concat:i});return t(Jp,{"number, number":zv,"BigNumber, BigNumber":eS},c({SS:o,DS:a,Ss:u}))}),Gp="bitNot",oS=["typed"],sS=U(Gp,oS,e=>{var{typed:t}=e;return t(Gp,{number:jv,BigNumber:uo,"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Wp="bitOr",uS=["typed","matrix","equalScalar","DenseMatrix","concat"],Ny=U(Wp,uS,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=ii({typed:t}),u=Sl({typed:t,equalScalar:n}),c=zi({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:r,concat:a});return t(Wp,{"number, number":Lv,"BigNumber, BigNumber":tS},l({SS:u,DS:o,Ss:c}))}),cS="matAlgo07xSSf",lS=["typed","DenseMatrix"],cn=U(cS,lS,e=>{var{typed:t,DenseMatrix:r}=e;return function(i,a,o){var u=i._size,c=i._datatype||i._data===void 0?i._datatype:i.getDataType(),l=a._size,s=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==l.length)throw new Ke(u.length,l.length);if(u[0]!==l[0]||u[1]!==l[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+l+")");var f=u[0],p=u[1],m,d=0,h=o;typeof c=="string"&&c===s&&c!=="mixed"&&(m=c,d=t.convert(0,m),h=t.find(o,[m,m]));var w,v,x=[];for(w=0;w<f;w++)x[w]=[];var g=[],b=[],y=[],N=[];for(v=0;v<p;v++){var E=v+1;for(n(i,v,y,g,E),n(a,v,N,b,E),w=0;w<f;w++){var A=y[w]===E?g[w]:d,D=N[w]===E?b[w]:d;x[w][v]=h(A,D)}}return new r({data:x,size:[f,p],datatype:c===i._datatype&&s===a._datatype?m:void 0})};function n(i,a,o,u,c){for(var l=i._values,s=i._index,f=i._ptr,p=f[a],m=f[a+1];p<m;p++){var d=s[p];o[d]=c,u[d]=l[p]}}}),Kp="bitXor",fS=["typed","matrix","DenseMatrix","concat"],pS=U(Kp,fS,e=>{var{typed:t,matrix:r,DenseMatrix:n,concat:i}=e,a=cr({typed:t}),o=cn({typed:t,DenseMatrix:n}),u=It({typed:t,DenseMatrix:n}),c=gt({typed:t,matrix:r,concat:i});return t(Kp,{"number, number":Pv,"BigNumber, BigNumber":rS},c({SS:o,DS:a,Ss:u}))}),Qp="arg",mS=["typed"],dS=U(Qp,mS,e=>{var{typed:t}=e;return t(Qp,{number:function(r){return Math.atan2(0,r)},BigNumber:function(r){return r.constructor.atan2(0,r)},Complex:function(r){return r.arg()},"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Zp="conj",hS=["typed"],gS=U(Zp,hS,e=>{var{typed:t}=e;return t(Zp,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.conjugate(),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Xp="im",vS=["typed"],yS=U(Xp,vS,e=>{var{typed:t}=e;return t(Xp,{number:()=>0,"BigNumber | Fraction":r=>r.mul(0),Complex:r=>r.im,"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),Yp="re",bS=["typed"],xS=U(Yp,bS,e=>{var{typed:t}=e;return t(Yp,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.re,"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),em="not",wS=["typed"],NS=U(em,wS,e=>{var{typed:t}=e;return t(em,{"null | undefined":()=>!0,number:Jv,Complex:function(r){return r.re===0&&r.im===0},BigNumber:function(r){return r.isZero()||r.isNaN()},Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),tm="or",DS=["typed","matrix","equalScalar","DenseMatrix","concat"],Dy=U(tm,DS,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=Nu({typed:t,equalScalar:n}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:r,concat:a});return t(tm,{"number, number":Gv,"Complex, Complex":function(s,f){return s.re!==0||s.im!==0||f.re!==0||f.im!==0},"BigNumber, BigNumber":function(s,f){return!s.isZero()&&!s.isNaN()||!f.isZero()&&!f.isNaN()},"Unit, Unit":t.referToSelf(s=>(f,p)=>s(f.value||0,p.value||0))},l({SS:u,DS:o,Ss:c}))}),rm="xor",ES=["typed","matrix","DenseMatrix","concat"],AS=U(rm,ES,e=>{var{typed:t,matrix:r,DenseMatrix:n,concat:i}=e,a=cr({typed:t}),o=cn({typed:t,DenseMatrix:n}),u=It({typed:t,DenseMatrix:n}),c=gt({typed:t,matrix:r,concat:i});return t(rm,{"number, number":Wv,"Complex, Complex":function(l,s){return(l.re!==0||l.im!==0)!=(s.re!==0||s.im!==0)},"BigNumber, BigNumber":function(l,s){return(!l.isZero()&&!l.isNaN())!=(!s.isZero()&&!s.isNaN())},"Unit, Unit":t.referToSelf(l=>(s,f)=>l(s.value||0,f.value||0))},c({SS:o,DS:a,Ss:u}))}),nm="concat",SS=["typed","matrix","isInteger"],Ey=U(nm,SS,e=>{var{typed:t,matrix:r,isInteger:n}=e;return t(nm,{"...Array | Matrix | number | BigNumber":function(i){var a,o=i.length,u=-1,c,l=!1,s=[];for(a=0;a<o;a++){var f=i[a];if(ke(f)&&(l=!0),Ue(f)||$e(f)){if(a!==o-1)throw new Error("Dimension must be specified as last argument");if(c=u,u=f.valueOf(),!n(u))throw new TypeError("Integer number expected for dimension");if(u<0||a>0&&u>c)throw new $r(u,c+1)}else{var p=ze(f).valueOf(),m=Ve(p);if(s[a]=p,c=u,u=m.length-1,a>0&&u!==c)throw new Ke(c+1,u+1)}}if(s.length===0)throw new SyntaxError("At least one matrix expected");for(var d=s.shift();s.length;)d=xv(d,s.shift(),u);return l?r(d):d},"...string":function(i){return i.join("")}})}),im="column",CS=["typed","Index","matrix","range"],Ay=U(im,CS,e=>{var{typed:t,Index:r,matrix:n,range:i}=e;return t(im,{"Matrix, number":a,"Array, number":function(o,u){return a(n(ze(o)),u).valueOf()}});function a(o,u){if(o.size().length!==2)throw new Error("Only two dimensional matrix is supported");pt(u,o.size()[1]);var c=i(0,o.size()[0]),l=new r(c,u),s=o.subset(l);return ke(s)?s:n([[s]])}}),am="count",MS=["typed","size","prod"],_S=U(am,MS,e=>{var{typed:t,size:r,prod:n}=e;return t(am,{string:function(i){return i.length},"Matrix | Array":function(i){return n(r(i))}})}),om="cross",FS=["typed","matrix","subtract","multiply"],TS=U(om,FS,e=>{var{typed:t,matrix:r,subtract:n,multiply:i}=e;return t(om,{"Matrix, Matrix":function(o,u){return r(a(o.toArray(),u.toArray()))},"Matrix, Array":function(o,u){return r(a(o.toArray(),u))},"Array, Matrix":function(o,u){return r(a(o,u.toArray()))},"Array, Array":a});function a(o,u){var c=Math.max(Ve(o).length,Ve(u).length);o=ks(o),u=ks(u);var l=Ve(o),s=Ve(u);if(l.length!==1||s.length!==1||l[0]!==3||s[0]!==3)throw new RangeError("Vectors with length 3 expected (Size A = ["+l.join(", ")+"], B = ["+s.join(", ")+"])");var f=[n(i(o[1],u[2]),i(o[2],u[1])),n(i(o[2],u[0]),i(o[0],u[2])),n(i(o[0],u[1]),i(o[1],u[0]))];return c>1?[f]:f}}),sm="diag",OS=["typed","matrix","DenseMatrix","SparseMatrix"],BS=U(sm,OS,e=>{var{typed:t,matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(sm,{Array:function(c){return a(c,0,Ve(c),null)},"Array, number":function(c,l){return a(c,l,Ve(c),null)},"Array, BigNumber":function(c,l){return a(c,l.toNumber(),Ve(c),null)},"Array, string":function(c,l){return a(c,0,Ve(c),l)},"Array, number, string":function(c,l,s){return a(c,l,Ve(c),s)},"Array, BigNumber, string":function(c,l,s){return a(c,l.toNumber(),Ve(c),s)},Matrix:function(c){return a(c,0,c.size(),c.storage())},"Matrix, number":function(c,l){return a(c,l,c.size(),c.storage())},"Matrix, BigNumber":function(c,l){return a(c,l.toNumber(),c.size(),c.storage())},"Matrix, string":function(c,l){return a(c,0,c.size(),l)},"Matrix, number, string":function(c,l,s){return a(c,l,c.size(),s)},"Matrix, BigNumber, string":function(c,l,s){return a(c,l.toNumber(),c.size(),s)}});function a(c,l,s,f){if(!Fe(l))throw new TypeError("Second parameter in function diag must be an integer");var p=l>0?l:0,m=l<0?-l:0;switch(s.length){case 1:return o(c,l,f,s[0],m,p);case 2:return u(c,l,f,s,m,p)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function o(c,l,s,f,p,m){var d=[f+p,f+m];if(s&&s!=="sparse"&&s!=="dense")throw new TypeError("Unknown matrix type ".concat(s,'"'));var h=s==="sparse"?i.diagonal(d,c,l):n.diagonal(d,c,l);return s!==null?h:h.valueOf()}function u(c,l,s,f,p,m){if(ke(c)){var d=c.diagonal(l);return s!==null?s!==d.storage()?r(d,s):d:d.valueOf()}for(var h=Math.min(f[0]-p,f[1]-m),w=[],v=0;v<h;v++)w[v]=c[v+p][v+m];return s!==null?r(w):w}});function Ma(e,t,r,n,i){if(ta.isTypedFunction(e)){var a=[t,r,n],o=ta.resolve(e,a);if(o)return f(o.implementation,a);var u=[t,r],c=ta.resolve(e,u);if(c)return f(c.implementation,u);var l=[t],s=ta.resolve(e,l);return s?f(s.implementation,l):f(e,a)}else return e(t,r,n);function f(p,m){try{return p.apply(p,m)}catch(w){var d;if(w instanceof TypeError&&((d=w.data)===null||d===void 0?void 0:d.category)==="wrongType"){var h=[];throw h.push("value: ".concat(dt(t))),m.length>=2&&h.push("index: ".concat(dt(r))),m.length>=3&&h.push("array: ".concat(dt(n))),new TypeError("Function ".concat(i," cannot apply callback arguments ")+"".concat(e.name,"(").concat(h.join(", "),") at index ").concat(JSON.stringify(r)))}else throw new TypeError("Function ".concat(i," cannot apply callback arguments ")+"to function ".concat(e.name,": ").concat(w.message))}}}var kS="filter",IS=["typed"],RS=U(kS,IS,e=>{var{typed:t}=e;return t("filter",{"Array, function":um,"Matrix, function":function(r,n){return r.create(um(r.toArray(),n))},"Array, RegExp":Is,"Matrix, RegExp":function(r,n){return r.create(Is(r.toArray(),n))}})});function um(e,t){return yv(e,function(r,n,i){return Ma(t,r,[n],i,"filter")})}var cm="flatten",qS=["typed","matrix"],zS=U(cm,qS,e=>{var{typed:t,matrix:r}=e;return t(cm,{Array:function(n){return ot(n)},Matrix:function(n){var i=ot(n.toArray());return r(i)}})}),lm="forEach",jS=["typed"],LS=U(lm,jS,e=>{var{typed:t}=e;return t(lm,{"Array, function":PS,"Matrix, function":function(r,n){r.forEach(n)}})});function PS(e,t){var r=function n(i,a){if(Array.isArray(i))bu(i,function(o,u){n(o,a.concat(u))});else return Ma(t,i,a,e,"forEach")};r(e,[])}var fm="getMatrixDataType",VS=["typed"],US=U(fm,VS,e=>{var{typed:t}=e;return t(fm,{Array:function(r){return so(r,dt)},Matrix:function(r){return r.getDataType()}})}),pm="identity",$S=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],HS=U(pm,$S,e=>{var{typed:t,config:r,matrix:n,BigNumber:i,DenseMatrix:a,SparseMatrix:o}=e;return t(pm,{"":function(){return r.matrix==="Matrix"?n([]):[]},string:function(l){return n(l)},"number | BigNumber":function(l){return c(l,l,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(l,s){return c(l,l,s)},"number | BigNumber, number | BigNumber":function(l,s){return c(l,s,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(l,s,f){return c(l,s,f)},Array:function(l){return u(l)},"Array, string":function(l,s){return u(l,s)},Matrix:function(l){return u(l.valueOf(),l.storage())},"Matrix, string":function(l,s){return u(l.valueOf(),s)}});function u(l,s){switch(l.length){case 0:return s?n(s):[];case 1:return c(l[0],l[0],s);case 2:return c(l[0],l[1],s);default:throw new Error("Vector containing two values expected")}}function c(l,s,f){var p=$e(l)||$e(s)?i:null;if($e(l)&&(l=l.toNumber()),$e(s)&&(s=s.toNumber()),!Fe(l)||l<1)throw new Error("Parameters in function identity must be positive integers");if(!Fe(s)||s<1)throw new Error("Parameters in function identity must be positive integers");var m=p?new i(1):1,d=p?new p(0):0,h=[l,s];if(f){if(f==="sparse")return o.diagonal(h,m,0,d);if(f==="dense")return a.diagonal(h,m,0,d);throw new TypeError('Unknown matrix type "'.concat(f,'"'))}for(var w=ha([],h,d),v=l<s?l:s,x=0;x<v;x++)w[x][x]=m;return w}}),mm="kron",JS=["typed","matrix","multiplyScalar"],GS=U(mm,JS,e=>{var{typed:t,matrix:r,multiplyScalar:n}=e;return t(mm,{"Matrix, Matrix":function(a,o){return r(i(a.toArray(),o.toArray()))},"Matrix, Array":function(a,o){return r(i(a.toArray(),o))},"Array, Matrix":function(a,o){return r(i(a,o.toArray()))},"Array, Array":i});function i(a,o){if(Ve(a).length===1&&(a=[a]),Ve(o).length===1&&(o=[o]),Ve(a).length>2||Ve(o).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(a.length)+", y = "+JSON.stringify(o.length)+")");var u=[],c=[];return a.map(function(l){return o.map(function(s){return c=[],u.push(c),l.map(function(f){return s.map(function(p){return c.push(n(f,p))})})})})&&u}}),dm="map",WS=["typed"],KS=U(dm,WS,e=>{var{typed:t}=e;return t(dm,{"Array, function":QS,"Matrix, function":function(r,n){return r.map(n)}})});function QS(e,t){var r=function n(i,a){return Array.isArray(i)?i.map(function(o,u){return n(o,a.concat(u))}):Ma(t,i,a,e,"map")};return r(e,[])}var hm="diff",ZS=["typed","matrix","subtract","number"],Sy=U(hm,ZS,e=>{var{typed:t,matrix:r,subtract:n,number:i}=e;return t(hm,{"Array | Matrix":function(l){return ke(l)?r(o(l.toArray())):o(l)},"Array | Matrix, number":function(l,s){if(!Fe(s))throw new RangeError("Dimension must be a whole number");return ke(l)?r(a(l.toArray(),s)):a(l,s)},"Array, BigNumber":t.referTo("Array,number",l=>(s,f)=>l(s,i(f))),"Matrix, BigNumber":t.referTo("Matrix,number",l=>(s,f)=>l(s,i(f)))});function a(l,s){if(ke(l)&&(l=l.toArray()),!Array.isArray(l))throw RangeError("Array/Matrix does not have that many dimensions");if(s>0){var f=[];return l.forEach(p=>{f.push(a(p,s-1))}),f}else{if(s===0)return o(l);throw RangeError("Cannot have negative dimension")}}function o(l){for(var s=[],f=l.length,p=1;p<f;p++)s.push(u(l[p-1],l[p]));return s}function u(l,s){ke(l)&&(l=l.toArray()),ke(s)&&(s=s.toArray());var f=Array.isArray(l),p=Array.isArray(s);if(f&&p)return c(l,s);if(!f&&!p)return n(s,l);throw TypeError("Cannot calculate difference between 1 array and 1 non-array")}function c(l,s){if(l.length!==s.length)throw RangeError("Not all sub-arrays have the same length");for(var f=[],p=l.length,m=0;m<p;m++)f.push(u(l[m],s[m]));return f}}),XS="ones",YS=["typed","config","matrix","BigNumber"],eC=U(XS,YS,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t("ones",{"":function(){return r.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(c){var l=c[c.length-1];if(typeof l=="string"){var s=c.pop();return a(c,s)}else return r.matrix==="Array"?a(c):a(c,"default")},Array:a,Matrix:function(c){var l=c.storage();return a(c.valueOf(),l)},"Array | Matrix, string":function(c,l){return a(c.valueOf(),l)}});function a(c,l){var s=o(c),f=s?new i(1):1;if(u(c),l){var p=n(l);return c.length>0?p.resize(c,f):p}else{var m=[];return c.length>0?ha(m,c,f):m}}function o(c){var l=!1;return c.forEach(function(s,f,p){$e(s)&&(l=!0,p[f]=s.toNumber())}),l}function u(c){c.forEach(function(l){if(typeof l!="number"||!Fe(l)||l<0)throw new Error("Parameters in function ones must be positive integers")})}});function Ml(){throw new Error('No "bignumber" implementation available')}function Cy(){throw new Error('No "fraction" implementation available')}function My(){throw new Error('No "matrix" implementation available')}var gm="range",tC=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],_y=U(gm,tC,e=>{var{typed:t,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:u,largerEq:c,add:l,isPositive:s}=e;return t(gm,{string:p,"string, boolean":p,"number, number":function(h,w){return f(m(h,w,1,!1))},"number, number, number":function(h,w,v){return f(m(h,w,v,!1))},"number, number, boolean":function(h,w,v){return f(m(h,w,1,v))},"number, number, number, boolean":function(h,w,v,x){return f(m(h,w,v,x))},"BigNumber, BigNumber":function(h,w){var v=h.constructor;return f(m(h,w,new v(1),!1))},"BigNumber, BigNumber, BigNumber":function(h,w,v){return f(m(h,w,v,!1))},"BigNumber, BigNumber, boolean":function(h,w,v){var x=h.constructor;return f(m(h,w,new x(1),v))},"BigNumber, BigNumber, BigNumber, boolean":function(h,w,v,x){return f(m(h,w,v,x))},"Unit, Unit, Unit":function(h,w,v){return f(m(h,w,v,!1))},"Unit, Unit, Unit, boolean":function(h,w,v,x){return f(m(h,w,v,x))}});function f(h){return r.matrix==="Matrix"?n?n(h):My():h}function p(h,w){var v=d(h);if(!v)throw new SyntaxError('String "'+h+'" is no valid range');return r.number==="BigNumber"?(i===void 0&&Ml(),f(m(i(v.start),i(v.end),i(v.step)))):f(m(v.start,v.end,v.step,w))}function m(h,w,v,x){for(var g=[],b=s(v)?x?o:a:x?c:u,y=h;b(y,w);)g.push(y),y=l(y,v);return g}function d(h){var w=h.split(":"),v=w.map(function(g){return Number(g)}),x=v.some(function(g){return isNaN(g)});if(x)return null;switch(v.length){case 2:return{start:v[0],end:v[1],step:1};case 3:return{start:v[0],end:v[2],step:v[1]};default:return null}}}),vm="reshape",rC=["typed","isInteger","matrix"],nC=U(vm,rC,e=>{var{typed:t,isInteger:r}=e;return t(vm,{"Matrix, Array":function(n,i){return n.reshape(i,!0)},"Array, Array":function(n,i){return i.forEach(function(a){if(!r(a))throw new TypeError("Invalid size for dimension: "+a)}),Nl(n,i)}})}),iC="resize",aC=["config","matrix"],oC=U(iC,aC,e=>{var{config:t,matrix:r}=e;return function(i,a,o){if(arguments.length!==2&&arguments.length!==3)throw new ji("resize",arguments.length,2,3);if(ke(a)&&(a=a.valueOf()),$e(a[0])&&(a=a.map(function(l){return $e(l)?l.toNumber():l})),ke(i))return i.resize(a,o,!0);if(typeof i=="string")return n(i,a,o);var u=Array.isArray(i)?!1:t.matrix!=="Array";if(a.length===0){for(;Array.isArray(i);)i=i[0];return ze(i)}else{Array.isArray(i)||(i=[i]),i=ze(i);var c=ha(i,a,o);return u?r(c):c}};function n(i,a,o){if(o!==void 0){if(typeof o!="string"||o.length!==1)throw new TypeError("Single character expected as defaultValue")}else o=" ";if(a.length!==1)throw new Ke(a.length,1);var u=a[0];if(typeof u!="number"||!Fe(u))throw new TypeError("Invalid size, must contain positive integers (size: "+Ge(a)+")");if(i.length>u)return i.substring(0,u);if(i.length<u){for(var c=i,l=0,s=u-i.length;l<s;l++)c+=o;return c}else return i}}),ym="rotate",sC=["typed","multiply","rotationMatrix"],uC=U(ym,sC,e=>{var{typed:t,multiply:r,rotationMatrix:n}=e;return t(ym,{"Array , number | BigNumber | Complex | Unit":function(a,o){i(a,2);var u=r(n(o),a);return u.toArray()},"Matrix , number | BigNumber | Complex | Unit":function(a,o){return i(a,2),r(n(o),a)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(a,o,u){i(a,3);var c=r(n(o,u),a);return c},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(a,o,u){return i(a,3),r(n(o,u),a)}});function i(a,o){var u=Array.isArray(a)?Ve(a):a.size();if(u.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(o));if(u.length===2&&u[1]!==1)throw new RangeError("Vector must be of dimensions 1x".concat(o));if(u[0]!==o)throw new RangeError("Vector must be of dimensions 1x".concat(o))}}),bm="rotationMatrix",cC=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],lC=U(bm,cC,e=>{var{typed:t,config:r,multiplyScalar:n,addScalar:i,unaryMinus:a,norm:o,BigNumber:u,matrix:c,DenseMatrix:l,SparseMatrix:s,cos:f,sin:p}=e;return t(bm,{"":function(){return r.matrix==="Matrix"?c([]):[]},string:function(x){return c(x)},"number | BigNumber | Complex | Unit":function(x){return m(x,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(x,g){return m(x,g)},"number | BigNumber | Complex | Unit, Array":function(x,g){var b=c(g);return d(b),v(x,b,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(x,g){d(g);var b=g.storage()||(r.matrix==="Matrix"?"dense":void 0);return v(x,g,b)},"number | BigNumber | Complex | Unit, Array, string":function(x,g,b){var y=c(g);return d(y),v(x,y,b)},"number | BigNumber | Complex | Unit, Matrix, string":function(x,g,b){return d(g),v(x,g,b)}});function m(x,g){var b=$e(x),y=b?new u(-1):-1,N=f(x),E=p(x),A=[[N,n(y,E)],[E,N]];return w(A,g)}function d(x){var g=x.size();if(g.length<1||g[0]!==3)throw new RangeError("Vector must be of dimensions 1x3")}function h(x){return x.reduce((g,b)=>n(g,b))}function w(x,g){if(g){if(g==="sparse")return new s(x);if(g==="dense")return new l(x);throw new TypeError('Unknown matrix type "'.concat(g,'"'))}return x}function v(x,g,b){var y=o(g);if(y===0)throw new RangeError("Rotation around zero vector");var N=$e(x)?u:null,E=N?new N(1):1,A=N?new N(-1):-1,D=N?new N(g.get([0])/y):g.get([0])/y,S=N?new N(g.get([1])/y):g.get([1])/y,C=N?new N(g.get([2])/y):g.get([2])/y,_=f(x),R=i(E,a(_)),P=p(x),I=i(_,h([D,D,R])),O=i(h([D,S,R]),h([A,C,P])),F=i(h([D,C,R]),h([S,P])),q=i(h([D,S,R]),h([C,P])),k=i(_,h([S,S,R])),te=i(h([S,C,R]),h([A,D,P])),se=i(h([D,C,R]),h([A,S,P])),K=i(h([S,C,R]),h([D,P])),V=i(_,h([C,C,R])),ue=[[I,O,F],[q,k,te],[se,K,V]];return w(ue,b)}}),xm="row",fC=["typed","Index","matrix","range"],Fy=U(xm,fC,e=>{var{typed:t,Index:r,matrix:n,range:i}=e;return t(xm,{"Matrix, number":a,"Array, number":function(o,u){return a(n(ze(o)),u).valueOf()}});function a(o,u){if(o.size().length!==2)throw new Error("Only two dimensional matrix is supported");pt(u,o.size()[0]);var c=i(0,o.size()[1]),l=new r(u,c),s=o.subset(l);return ke(s)?s:n([[s]])}}),wm="size",pC=["typed","config","?matrix"],mC=U(wm,pC,e=>{var{typed:t,config:r,matrix:n}=e;return t(wm,{Matrix:function(i){return i.create(i.size())},Array:Ve,string:function(i){return r.matrix==="Array"?[i.length]:n([i.length])},"number | Complex | BigNumber | Unit | boolean | null":function(i){return r.matrix==="Array"?[]:n?n([]):My()}})}),Nm="squeeze",dC=["typed","matrix"],hC=U(Nm,dC,e=>{var{typed:t,matrix:r}=e;return t(Nm,{Array:function(n){return ks(ze(n))},Matrix:function(n){var i=ks(n.toArray());return Array.isArray(i)?r(i):i},any:function(n){return ze(n)}})}),Dm="subset",gC=["typed","matrix","zeros","add"],Ty=U(Dm,gC,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e;return t(Dm,{"Matrix, Index":function(o,u){return da(u)?r():(Bs(o,u),o.subset(u))},"Array, Index":t.referTo("Matrix, Index",function(o){return function(u,c){var l=o(r(u),c);return c.isScalar()?l:l.valueOf()}}),"Object, Index":yC,"string, Index":vC,"Matrix, Index, any, any":function(o,u,c,l){return da(u)?o:(Bs(o,u),o.clone().subset(u,a(c,u),l))},"Array, Index, any, any":t.referTo("Matrix, Index, any, any",function(o){return function(u,c,l,s){var f=o(r(u),c,l,s);return f.isMatrix?f.valueOf():f}}),"Array, Index, any":t.referTo("Matrix, Index, any, any",function(o){return function(u,c,l){return o(r(u),c,l,void 0).valueOf()}}),"Matrix, Index, any":t.referTo("Matrix, Index, any, any",function(o){return function(u,c,l){return o(u,c,l,void 0)}}),"string, Index, string":Em,"string, Index, string, string":Em,"Object, Index, any":bC});function a(o,u){if(typeof o=="string")throw new Error("can't boradcast a string");if(u._isScalar)return o;var c=u.size();if(c.every(l=>l>0))try{return i(o,n(c))}catch{return o}else return o}});function vC(e,t){if(!fu(t))throw new TypeError("Index expected");if(da(t))return"";if(Bs(Array.from(e),t),t.size().length!==1)throw new Ke(t.size().length,1);var r=e.length;pt(t.min()[0],r),pt(t.max()[0],r);var n=t.dimension(0),i="";return n.forEach(function(a){i+=e.charAt(a)}),i}function Em(e,t,r,n){if(!t||t.isIndex!==!0)throw new TypeError("Index expected");if(da(t))return e;if(Bs(Array.from(e),t),t.size().length!==1)throw new Ke(t.size().length,1);if(n!==void 0){if(typeof n!="string"||n.length!==1)throw new TypeError("Single character expected as defaultValue")}else n=" ";var i=t.dimension(0),a=i.size()[0];if(a!==r.length)throw new Ke(i.size()[0],r.length);var o=e.length;pt(t.min()[0]),pt(t.max()[0]);for(var u=[],c=0;c<o;c++)u[c]=e.charAt(c);if(i.forEach(function(f,p){u[f]=r.charAt(p[0])}),u.length>o)for(var l=o-1,s=u.length;l<s;l++)u[l]||(u[l]=n);return u.join("")}function yC(e,t){if(!da(t)){if(t.size().length!==1)throw new Ke(t.size(),1);var r=t.dimension(0);if(typeof r!="string")throw new TypeError("String expected as index to retrieve an object property");return nr(e,r)}}function bC(e,t,r){if(da(t))return e;if(t.size().length!==1)throw new Ke(t.size(),1);var n=t.dimension(0);if(typeof n!="string")throw new TypeError("String expected as index to retrieve an object property");var i=ze(e);return pa(i,n,r),i}var Am="transpose",xC=["typed","matrix"],wC=U(Am,xC,e=>{var{typed:t,matrix:r}=e;return t(Am,{Array:o=>n(r(o)).valueOf(),Matrix:n,any:ze});function n(o){var u=o.size(),c;switch(u.length){case 1:c=o.clone();break;case 2:{var l=u[0],s=u[1];if(s===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+Ge(u)+")");switch(o.storage()){case"dense":c=i(o,l,s);break;case"sparse":c=a(o,l,s);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+Ge(u)+")")}return c}function i(o,u,c){for(var l=o._data,s=[],f,p=0;p<c;p++){f=s[p]=[];for(var m=0;m<u;m++)f[m]=ze(l[m][p])}return o.createDenseMatrix({data:s,size:[c,u],datatype:o._datatype})}function a(o,u,c){for(var l=o._values,s=o._index,f=o._ptr,p=l?[]:void 0,m=[],d=[],h=[],w=0;w<u;w++)h[w]=0;var v,x,g;for(v=0,x=s.length;v<x;v++)h[s[v]]++;for(var b=0,y=0;y<u;y++)d.push(b),b+=h[y],h[y]=d[y];for(d.push(b),g=0;g<c;g++)for(var N=f[g],E=f[g+1],A=N;A<E;A++){var D=h[s[A]]++;m[D]=g,l&&(p[D]=ze(l[A]))}return o.createSparseMatrix({values:p,index:m,ptr:d,size:[c,u],datatype:o._datatype})}}),Sm="ctranspose",NC=["typed","transpose","conj"],DC=U(Sm,NC,e=>{var{typed:t,transpose:r,conj:n}=e;return t(Sm,{any:function(i){return n(r(i))}})}),Cm="zeros",EC=["typed","config","matrix","BigNumber"],AC=U(Cm,EC,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(Cm,{"":function(){return r.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(c){var l=c[c.length-1];if(typeof l=="string"){var s=c.pop();return a(c,s)}else return r.matrix==="Array"?a(c):a(c,"default")},Array:a,Matrix:function(c){var l=c.storage();return a(c.valueOf(),l)},"Array | Matrix, string":function(c,l){return a(c.valueOf(),l)}});function a(c,l){var s=o(c),f=s?new i(0):0;if(u(c),l){var p=n(l);return c.length>0?p.resize(c,f):p}else{var m=[];return c.length>0?ha(m,c,f):m}}function o(c){var l=!1;return c.forEach(function(s,f,p){$e(s)&&(l=!0,p[f]=s.toNumber())}),l}function u(c){c.forEach(function(l){if(typeof l!="number"||!Fe(l)||l<0)throw new Error("Parameters in function zeros must be positive integers")})}}),Mm="fft",SC=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],CC=U(Mm,SC,e=>{var{typed:t,matrix:r,addScalar:n,multiplyScalar:i,divideScalar:a,exp:o,tau:u,i:c,dotDivide:l,conj:s,pow:f,ceil:p,log2:m}=e;return t(Mm,{Array:d,Matrix:function(x){return x.create(d(x.toArray()))}});function d(x){var g=Ve(x);return g.length===1?v(x,g[0]):h(x.map(b=>d(b,g.slice(1))),0)}function h(x,g){var b=Ve(x);if(g!==0)return new Array(b[0]).fill(0).map((N,E)=>h(x[E],g-1));if(b.length===1)return v(x);function y(N){var E=Ve(N);return new Array(E[1]).fill(0).map((A,D)=>new Array(E[0]).fill(0).map((S,C)=>N[C][D]))}return y(h(y(x),1))}function w(x){for(var g=x.length,b=o(a(i(-1,i(c,u)),g)),y=[],N=1-g;N<g;N++)y.push(f(b,a(f(N,2),2)));for(var E=f(2,p(m(g+g-1))),A=[...new Array(g).fill(0).map((O,F)=>i(x[F],y[g-1+F])),...new Array(E-g).fill(0)],D=[...new Array(g+g-1).fill(0).map((O,F)=>a(1,y[F])),...new Array(E-(g+g-1)).fill(0)],S=v(A),C=v(D),_=new Array(E).fill(0).map((O,F)=>i(S[F],C[F])),R=l(s(d(s(_))),E),P=[],I=g-1;I<g+g-1;I++)P.push(i(R[I],y[I]));return P}function v(x){var g=x.length;if(g===1)return[x[0]];if(g%2===0){for(var b=[...v(x.filter((A,D)=>D%2===0)),...v(x.filter((A,D)=>D%2===1))],y=0;y<g/2;y++){var N=b[y],E=i(b[y+g/2],o(i(i(u,c),a(-y,g))));b[y]=n(N,E),b[y+g/2]=n(N,i(-1,E))}return b}else return w(x)}}),_m="ifft",MC=["typed","fft","dotDivide","conj"],_C=U(_m,MC,e=>{var{typed:t,fft:r,dotDivide:n,conj:i}=e;return t(_m,{"Array | Matrix":function(a){var o=ke(a)?a.size():Ve(a);return n(i(r(i(a))),o.reduce((u,c)=>u*c,1))}})});function co(e){"@babel/helpers - typeof";return co=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},co(e)}function FC(e,t){if(co(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(co(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function TC(e){var t=FC(e,"string");return co(t)=="symbol"?t:t+""}function Bt(e,t,r){return(t=TC(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fm(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function OC(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Fm(Object(r),!0).forEach(function(n){Bt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fm(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var BC="solveODE",kC=["typed","add","subtract","multiply","divide","max","map","abs","isPositive","isNegative","larger","smaller","matrix","bignumber","unaryMinus"],IC=U(BC,kC,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:a,max:o,map:u,abs:c,isPositive:l,isNegative:s,larger:f,smaller:p,matrix:m,bignumber:d,unaryMinus:h}=e;function w(A){return function(D,S,C,_){var R=!(S.length===2&&(S.every(N)||S.every(Cr)));if(R)throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var P=S[0],I=S[1],O=f(I,P),F=_.firstStep;if(F!==void 0&&!l(F))throw new Error('"firstStep" must be positive');var q=_.maxStep;if(q!==void 0&&!l(q))throw new Error('"maxStep" must be positive');var k=_.minStep;if(k&&s(k))throw new Error('"minStep" must be positive or zero');var te=[P,I,F,k,q].filter(B=>B!==void 0);if(!(te.every(N)||te.every(Cr)))throw new Error('Inconsistent type of "t" dependant variables');for(var se=1,K=_.tol?_.tol:1e-4,V=_.minDelta?_.minDelta:.2,ue=_.maxDelta?_.maxDelta:5,me=_.maxIter?_.maxIter:1e4,re=[P,I,...C,q,k].some($e),[ae,de,ne,ce]=re?[d(A.a),d(A.c),d(A.b),d(A.bp)]:[A.a,A.c,A.b,A.bp],le=F?O?F:h(F):a(n(I,P),se),he=[P],xe=[C],$=n(ne,ce),T=0,z=0,J=b(O),L=y(O);J(he[T],I);){var H=[];le=L(he[T],I,le),H.push(D(he[T],xe[T]));for(var G=1;G<de.length;++G)H.push(D(r(he[T],i(de[G],le)),r(xe[T],i(le,ae[G],H))));var Y=o(c(u(i($,H),B=>Cr(B)?B.value:B)));Y<K&&K/Y>1/4&&(he.push(r(he[T],le)),xe.push(r(xe[T],i(le,ne,H))),T++);var ee=.84*(K/Y)**(1/5);if(p(ee,V)?ee=V:f(ee,ue)&&(ee=ue),ee=re?d(ee):ee,le=i(le,ee),q&&f(c(le),q)?le=O?q:h(q):k&&p(c(le),k)&&(le=O?k:h(k)),z++,z>me)throw new Error("Maximum number of iterations reached, try changing options")}return{t:he,y:xe}}}function v(A,D,S,C){var _=[[],[.5],[0,.75],[.2222222222222222,.3333333333333333,.4444444444444444]],R=[null,1/2,3/4,1],P=[2/9,1/3,4/9,0],I=[7/24,1/4,1/3,1/8],O={a:_,c:R,b:P,bp:I};return w(O)(A,D,S,C)}function x(A,D,S,C){var _=[[],[.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]],R=[null,1/5,3/10,4/5,8/9,1,1],P=[35/384,0,500/1113,125/192,-2187/6784,11/84,0],I=[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40],O={a:_,c:R,b:P,bp:I};return w(O)(A,D,S,C)}function g(A,D,S,C){var _=C.method?C.method:"RK45",R={RK23:v,RK45:x};if(_.toUpperCase()in R){var P=OC({},C);return delete P.method,R[_.toUpperCase()](A,D,S,P)}else{var I=Object.keys(R).map(F=>'"'.concat(F,'"')),O="".concat(I.slice(0,-1).join(", ")," and ").concat(I.slice(-1));throw new Error('Unavailable method "'.concat(_,'". Available methods are ').concat(O))}}function b(A){return A?p:f}function y(A){var D=A?f:p;return function(S,C,_){var R=r(S,_);return D(R,C)?n(C,S):_}}function N(A){return $e(A)||Ue(A)}function E(A,D,S,C){var _=g(A,D.toArray(),S.toArray(),C);return{t:m(_.t),y:m(_.y)}}return t("solveODE",{"function, Array, Array, Object":g,"function, Matrix, Matrix, Object":E,"function, Array, Array":(A,D,S)=>g(A,D,S,{}),"function, Matrix, Matrix":(A,D,S)=>E(A,D,S,{}),"function, Array, number | BigNumber | Unit":(A,D,S)=>{var C=g(A,D,[S],{});return{t:C.t,y:C.y.map(_=>_[0])}},"function, Matrix, number | BigNumber | Unit":(A,D,S)=>{var C=g(A,D.toArray(),[S],{});return{t:m(C.t),y:m(C.y.map(_=>_[0]))}},"function, Array, number | BigNumber | Unit, Object":(A,D,S,C)=>{var _=g(A,D,[S],C);return{t:_.t,y:_.y.map(R=>R[0])}},"function, Matrix, number | BigNumber | Unit, Object":(A,D,S,C)=>{var _=g(A,D.toArray(),[S],C);return{t:m(_.t),y:m(_.y.map(R=>R[0]))}}})}),RC="erf",qC=["typed"],zC=U(RC,qC,e=>{var{typed:t}=e;return t("name",{number:function(a){var o=Math.abs(a);return o>=PC?Wn(a):o<=jC?Wn(a)*r(o):o<=4?Wn(a)*(1-n(o)):Wn(a)*(1-i(o))},"Array | Matrix":t.referToSelf(a=>o=>Qe(o,a))});function r(a){var o=a*a,u=hn[0][4]*o,c=o,l;for(l=0;l<3;l+=1)u=(u+hn[0][l])*o,c=(c+Zi[0][l])*o;return a*(u+hn[0][3])/(c+Zi[0][3])}function n(a){var o=hn[1][8]*a,u=a,c;for(c=0;c<7;c+=1)o=(o+hn[1][c])*a,u=(u+Zi[1][c])*a;var l=(o+hn[1][7])/(u+Zi[1][7]),s=parseInt(a*16)/16,f=(a-s)*(a+s);return Math.exp(-s*s)*Math.exp(-f)*l}function i(a){var o=1/(a*a),u=hn[2][5]*o,c=o,l;for(l=0;l<4;l+=1)u=(u+hn[2][l])*o,c=(c+Zi[2][l])*o;var s=o*(u+hn[2][4])/(c+Zi[2][4]);s=(LC-s)/a,o=parseInt(a*16)/16;var f=(a-o)*(a+o);return Math.exp(-o*o)*Math.exp(-f)*s}}),jC=.46875,LC=.5641895835477563,hn=[[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]],Zi=[[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]],PC=Math.pow(2,53),Tm="zeta",VC=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],UC=U(Tm,VC,e=>{var{typed:t,config:r,multiply:n,pow:i,divide:a,factorial:o,equal:u,smallerEq:c,isNegative:l,gamma:s,sin:f,subtract:p,add:m,Complex:d,BigNumber:h,pi:w}=e;return t(Tm,{number:N=>v(N,E=>E,()=>20),BigNumber:N=>v(N,E=>new h(E),()=>Math.abs(Math.log10(r.epsilon))),Complex:x});function v(N,E,A){return u(N,0)?E(-.5):u(N,1)?E(NaN):isFinite(N)?g(N,E,A,D=>D):l(N)?E(NaN):E(1)}function x(N){return N.re===0&&N.im===0?new d(-.5):N.re===1?new d(NaN,NaN):N.re===1/0&&N.im===0?new d(1):N.im===1/0||N.re===-1/0?new d(NaN,NaN):g(N,E=>E,E=>Math.round(1.3*15+.9*Math.abs(E.im)),E=>E.re)}function g(N,E,A,D){var S=A(N);if(D(N)>-(S-1)/2)return y(N,E(S),E);var C=n(i(2,N),i(E(w),p(N,1)));return C=n(C,f(n(a(E(w),2),N))),C=n(C,s(p(1,N))),n(C,g(p(1,N),E,A,D))}function b(N,E){for(var A=N,D=N;c(D,E);D=m(D,1)){var S=a(n(o(m(E,p(D,1))),i(4,D)),n(o(p(E,D)),o(n(2,D))));A=m(A,S)}return n(E,A)}function y(N,E,A){for(var D=a(1,n(b(A(0),E),p(1,i(2,p(1,N))))),S=A(0),C=A(1);c(C,E);C=m(C,1))S=m(S,a(n((-1)**(C-1),b(C,E)),i(C,N)));return n(D,S)}}),Om="mode",$C=["typed","isNaN","isNumeric"],HC=U(Om,$C,e=>{var{typed:t,isNaN:r,isNumeric:n}=e;return t(Om,{"Array | Matrix":i,"...":function(a){return i(a)}});function i(a){a=ot(a.valueOf());var o=a.length;if(o===0)throw new Error("Cannot calculate mode of an empty array");for(var u={},c=[],l=0,s=0;s<a.length;s++){var f=a[s];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]===l?c.push(f):u[f]>l&&(l=u[f],c=[f])}return c}});function ur(e,t,r){var n;return String(e).includes("Unexpected type")?(n=arguments.length>2?" (type: "+dt(r)+", value: "+JSON.stringify(r)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+n)):String(e).includes("complex numbers")?(n=arguments.length>2?" (type: "+dt(r)+", value: "+JSON.stringify(r)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+n)):e}var Bm="prod",JC=["typed","config","multiplyScalar","numeric"],GC=U(Bm,JC,e=>{var{typed:t,config:r,multiplyScalar:n,numeric:i}=e;return t(Bm,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(o,u){throw new Error("prod(A, dim) is not yet supported")},"...":function(o){return a(o)}});function a(o){var u;if(Sn(o,function(c){try{u=u===void 0?c:n(u,c)}catch(l){throw ur(l,"prod",c)}}),typeof u=="string"&&(u=i(u,r.number)),u===void 0)throw new Error("Cannot calculate prod of an empty array");return u}}),km="format",WC=["typed"],KC=U(km,WC,e=>{var{typed:t}=e;return t(km,{any:Ge,"any, Object | function | number | BigNumber":Ge})}),Im="bin",QC=["typed","format"],ZC=U(Im,QC,e=>{var{typed:t,format:r}=e;return t(Im,{"number | BigNumber":function(n){return r(n,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(n,i){return r(n,{notation:"bin",wordSize:i})}})}),Rm="oct",XC=["typed","format"],YC=U(Rm,XC,e=>{var{typed:t,format:r}=e;return t(Rm,{"number | BigNumber":function(n){return r(n,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(n,i){return r(n,{notation:"oct",wordSize:i})}})}),qm="hex",eM=["typed","format"],tM=U(qm,eM,e=>{var{typed:t,format:r}=e;return t(qm,{"number | BigNumber":function(n){return r(n,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(n,i){return r(n,{notation:"hex",wordSize:i})}})}),Oy=/\$([\w.]+)/g,zm="print",rM=["typed"],By=U(zm,rM,e=>{var{typed:t}=e;return t(zm,{"string, Object | Array":jm,"string, Object | Array, number | Object":jm})});function jm(e,t,r){return e.replace(Oy,function(n,i){var a=i.split("."),o=t[a.shift()];for(o!==void 0&&o.isMatrix&&(o=o.toArray());a.length&&o!==void 0;){var u=a.shift();o=u?o[u]:o+"."}return o!==void 0?Qt(o)?o:Ge(o,r):n})}var Lm="to",nM=["typed","matrix","concat"],iM=U(Lm,nM,e=>{var{typed:t,matrix:r,concat:n}=e,i=gt({typed:t,matrix:r,concat:n});return t(Lm,{"Unit, Unit | string":(a,o)=>a.to(o)},i({Ds:!0}))}),Pm="isPrime",aM=["typed"],oM=U(Pm,aM,e=>{var{typed:t}=e;return t(Pm,{number:function(r){if(r*0!==0)return!1;if(r<=3)return r>1;if(r%2===0||r%3===0)return!1;for(var n=5;n*n<=r;n+=6)if(r%n===0||r%(n+2)===0)return!1;return!0},BigNumber:function(r){if(r.toNumber()*0!==0)return!1;if(r.lte(3))return r.gt(1);if(r.mod(2).eq(0)||r.mod(3).eq(0))return!1;if(r.lt(Math.pow(2,32))){for(var n=r.toNumber(),i=5;i*i<=n;i+=6)if(n%i===0||n%(i+2)===0)return!1;return!0}function a(v,x,g){for(var b=1;!x.eq(0);)x.mod(2).eq(0)?(x=x.div(2),v=v.mul(v).mod(g)):(x=x.sub(1),b=v.mul(b).mod(g));return b}var o=r.constructor.clone({precision:r.toFixed(0).length*2});r=new o(r);for(var u=0,c=r.sub(1);c.mod(2).eq(0);)c=c.div(2),u+=1;var l=null;if(r.lt("3317044064679887385961981"))l=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter(v=>v<r);else{var s=Math.min(r.toNumber()-2,Math.floor(2*Math.pow(r.toFixed(0).length*Math.log(10),2)));l=[];for(var f=2;f<=s;f+=1)l.push(s)}for(var p=0;p<l.length;p+=1){var m=l[p],d=a(r.sub(r).add(m),c,r);if(!d.eq(1)){for(var h=0,w=d;!w.eq(r.sub(1));h+=1,w=w.mul(w).mod(r))if(h===u-1)return!1}}return!0},"Array | Matrix":t.referToSelf(r=>n=>Qe(n,r))})}),sM="numeric",uM=["number","?bignumber","?fraction"],cM=U(sM,uM,e=>{var{number:t,bignumber:r,fraction:n}=e,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:o=>t(o),BigNumber:r?o=>r(o):Ml,Fraction:n?o=>n(o):Cy};return function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",c=arguments.length>2?arguments[2]:void 0;if(c!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var l=dt(o);if(!(l in i))throw new TypeError("Cannot convert "+o+' of type "'+l+'"; valid input types are '+Object.keys(i).join(", "));if(!(u in a))throw new TypeError("Cannot convert "+o+' to type "'+u+'"; valid output types are '+Object.keys(a).join(", "));return u===l?o:a[u](o)}}),Vm="divideScalar",lM=["typed","numeric"],fM=U(Vm,lM,e=>{var{typed:t,numeric:r}=e;return t(Vm,{"number, number":function(n,i){return n/i},"Complex, Complex":function(n,i){return n.div(i)},"BigNumber, BigNumber":function(n,i){return n.div(i)},"Fraction, Fraction":function(n,i){return n.div(i)},"Unit, number | Complex | Fraction | BigNumber | Unit":(n,i)=>n.divide(i),"number | Fraction | Complex | BigNumber, Unit":(n,i)=>i.divideInto(n)})}),Um="pow",pM=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],mM=U(Um,pM,e=>{var{typed:t,config:r,identity:n,multiply:i,matrix:a,inv:o,number:u,fraction:c,Complex:l}=e;return t(Um,{"number, number":s,"Complex, Complex":function(m,d){return m.pow(d)},"BigNumber, BigNumber":function(m,d){return d.isInteger()||m>=0||r.predictable?m.pow(d):new l(m.toNumber(),0).pow(d.toNumber(),0)},"Fraction, Fraction":function(m,d){var h=m.pow(d);if(h!=null)return h;if(r.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return s(m.valueOf(),d.valueOf())},"Array, number":f,"Array, BigNumber":function(m,d){return f(m,d.toNumber())},"Matrix, number":p,"Matrix, BigNumber":function(m,d){return p(m,d.toNumber())},"Unit, number | BigNumber":function(m,d){return m.pow(d)}});function s(m,d){if(r.predictable&&!Fe(d)&&m<0)try{var h=c(d),w=u(h);if((d===w||Math.abs((d-w)/d)<1e-14)&&h.d%2===1)return(h.n%2===0?1:-1)*Math.pow(-m,d)}catch{}return r.predictable&&(m<-1&&d===1/0||m>-1&&m<0&&d===-1/0)?NaN:Fe(d)||m>=0||r.predictable?qv(m,d):m*m<1&&d===1/0||m*m>1&&d===-1/0?0:new l(m,0).pow(d,0)}function f(m,d){if(!Fe(d))throw new TypeError("For A^b, b must be an integer (value is "+d+")");var h=Ve(m);if(h.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+h.length+" dimensions)");if(h[0]!==h[1])throw new Error("For A^b, A must be square (size is "+h[0]+"x"+h[1]+")");if(d<0)try{return f(o(m),-d)}catch(x){throw x.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 "+d+")"):x}for(var w=n(h[0]).valueOf(),v=m;d>=1;)(d&1)===1&&(w=i(v,w)),d>>=1,v=i(v,v);return w}function p(m,d){return a(f(m.valueOf(),d))}}),Xi="Number of decimals in function round must be an integer",$m="round",dM=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],hM=U($m,dM,e=>{var{typed:t,config:r,matrix:n,equalScalar:i,zeros:a,BigNumber:o,DenseMatrix:u}=e,c=Jt({typed:t,equalScalar:i}),l=It({typed:t,DenseMatrix:u}),s=Jr({typed:t});function f(p){return Math.abs(wo(p).exponent)}return t($m,{number:function(p){var m=$a(p,f(r.epsilon)),d=sr(p,m,r.epsilon)?m:p;return $a(d)},"number, number":function(p,m){var d=f(r.epsilon);if(m>=d)return $a(p,m);var h=$a(p,d),w=sr(p,h,r.epsilon)?h:p;return $a(w,m)},"number, BigNumber":function(p,m){if(!m.isInteger())throw new TypeError(Xi);return new o(p).toDecimalPlaces(m.toNumber())},Complex:function(p){return p.round()},"Complex, number":function(p,m){if(m%1)throw new TypeError(Xi);return p.round(m)},"Complex, BigNumber":function(p,m){if(!m.isInteger())throw new TypeError(Xi);var d=m.toNumber();return p.round(d)},BigNumber:function(p){var m=new o(p).toDecimalPlaces(f(r.epsilon)),d=Tr(p,m,r.epsilon)?m:p;return d.toDecimalPlaces(0)},"BigNumber, BigNumber":function(p,m){if(!m.isInteger())throw new TypeError(Xi);var d=f(r.epsilon);if(m>=d)return p.toDecimalPlaces(m.toNumber());var h=p.toDecimalPlaces(d),w=Tr(p,h,r.epsilon)?h:p;return w.toDecimalPlaces(m.toNumber())},Fraction:function(p){return p.round()},"Fraction, number":function(p,m){if(m%1)throw new TypeError(Xi);return p.round(m)},"Fraction, BigNumber":function(p,m){if(!m.isInteger())throw new TypeError(Xi);return p.round(m.toNumber())},"Unit, number, Unit":t.referToSelf(p=>function(m,d,h){var w=m.toNumeric(h);return h.multiply(p(w,d))}),"Unit, BigNumber, Unit":t.referToSelf(p=>(m,d,h)=>p(m,d.toNumber(),h)),"Unit, Unit":t.referToSelf(p=>(m,d)=>p(m,0,d)),"Array | Matrix, number, Unit":t.referToSelf(p=>(m,d,h)=>Qe(m,w=>p(w,d,h))),"Array | Matrix, BigNumber, Unit":t.referToSelf(p=>(m,d,h)=>p(m,d.toNumber(),h)),"Array | Matrix, Unit":t.referToSelf(p=>(m,d)=>p(m,0,d)),"Array | Matrix":t.referToSelf(p=>m=>Qe(m,p)),"SparseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>c(m,d,p,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(p=>(m,d)=>s(m,d,p,!1)),"Array, number | BigNumber":t.referToSelf(p=>(m,d)=>s(n(m),d,p,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":t.referToSelf(p=>(m,d)=>i(m,0)?a(d.size(),d.storage()):l(d,m,p,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":t.referToSelf(p=>(m,d)=>i(m,0)?a(d.size(),d.storage()):s(d,m,p,!0)),"number | Complex | BigNumber | Fraction, Array":t.referToSelf(p=>(m,d)=>s(n(d),m,p,!0).valueOf())})}),Hm="log",gM=["config","typed","divideScalar","Complex"],vM=U(Hm,gM,e=>{var{typed:t,config:r,divideScalar:n,Complex:i}=e;return t(Hm,{number:function(a){return a>=0||r.predictable?hD(a):new i(a,0).log()},Complex:function(a){return a.log()},BigNumber:function(a){return!a.isNegative()||r.predictable?a.ln():new i(a.toNumber(),0).log()},"any, any":t.referToSelf(a=>(o,u)=>n(a(o),a(u)))})}),Jm="log1p",yM=["typed","config","divideScalar","log","Complex"],bM=U(Jm,yM,e=>{var{typed:t,config:r,divideScalar:n,log:i,Complex:a}=e;return t(Jm,{number:function(u){return u>=-1||r.predictable?pN(u):o(new a(u,0))},Complex:o,BigNumber:function(u){var c=u.plus(1);return!c.isNegative()||r.predictable?c.ln():o(new a(u.toNumber(),0))},"Array | Matrix":t.referToSelf(u=>c=>Qe(c,u)),"any, any":t.referToSelf(u=>(c,l)=>n(u(c),i(l)))});function o(u){var c=u.re+1;return new a(Math.log(Math.sqrt(c*c+u.im*u.im)),Math.atan2(u.im,c))}}),Gm="nthRoots",xM=["config","typed","divideScalar","Complex"],wM=U(Gm,xM,e=>{var{typed:t,config:r,divideScalar:n,Complex:i}=e,a=[function(u){return new i(u,0)},function(u){return new i(0,u)},function(u){return new i(-u,0)},function(u){return new i(0,-u)}];function o(u,c){if(c<0)throw new Error("Root must be greater than zero");if(c===0)throw new Error("Root must be non-zero");if(c%1!==0)throw new Error("Root must be an integer");if(u===0||u.abs()===0)return[new i(0,0)];var l=typeof u=="number",s;(l||u.re===0||u.im===0)&&(l?s=2*+(u<0):u.im===0?s=2*+(u.re<0):s=2*+(u.im<0)+1);for(var f=u.arg(),p=u.abs(),m=[],d=Math.pow(p,1/c),h=0;h<c;h++){var w=(s+4*h)/c;if(w===Math.round(w)){m.push(a[w%4](d));continue}m.push(new i({r:d,phi:(f+2*Math.PI*h)/c}))}return m}return t(Gm,{Complex:function(u){return o(u,2)},"Complex, number":o})}),Wm="dotPow",NM=["typed","equalScalar","matrix","pow","DenseMatrix","concat"],DM=U(Wm,NM,e=>{var{typed:t,equalScalar:r,matrix:n,pow:i,DenseMatrix:a,concat:o}=e,u=cr({typed:t}),c=cn({typed:t,DenseMatrix:a}),l=Jt({typed:t,equalScalar:r}),s=It({typed:t,DenseMatrix:a}),f=gt({typed:t,matrix:n,concat:o}),p={};for(var m in i.signatures)Object.prototype.hasOwnProperty.call(i.signatures,m)&&!m.includes("Matrix")&&!m.includes("Array")&&(p[m]=i.signatures[m]);var d=t(p);return t(Wm,f({elop:d,SS:c,DS:u,Ss:l,sS:s}))}),Km="dotDivide",EM=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],AM=U(Km,EM,e=>{var{typed:t,matrix:r,equalScalar:n,divideScalar:i,DenseMatrix:a,concat:o}=e,u=Gr({typed:t,equalScalar:n}),c=cr({typed:t}),l=cn({typed:t,DenseMatrix:a}),s=Jt({typed:t,equalScalar:n}),f=It({typed:t,DenseMatrix:a}),p=gt({typed:t,matrix:r,concat:o});return t(Km,p({elop:i,SS:l,DS:c,SD:u,Ss:s,sS:f}))});function Eo(e){var{DenseMatrix:t}=e;return function(r,n,i){var a=r.size();if(a.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+Ge(a)+")");var o=a[0],u=a[1];if(o!==u)throw new RangeError("Matrix must be square (size: "+Ge(a)+")");var c=[];if(ke(n)){var l=n.size(),s=n._data;if(l.length===1){if(l[0]!==o)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var f=0;f<o;f++)c[f]=[s[f]];return new t({data:c,size:[o,1],datatype:n._datatype})}if(l.length===2){if(l[0]!==o||l[1]!==1)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");if(_s(n)){if(i){c=[];for(var p=0;p<o;p++)c[p]=[s[p][0]];return new t({data:c,size:[o,1],datatype:n._datatype})}return n}if(wi(n)){for(var m=0;m<o;m++)c[m]=[0];for(var d=n._values,h=n._index,w=n._ptr,v=w[1],x=w[0];x<v;x++){var g=h[x];c[g][0]=d[x]}return new t({data:c,size:[o,1],datatype:n._datatype})}}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}if(st(n)){var b=Ve(n);if(b.length===1){if(b[0]!==o)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var y=0;y<o;y++)c[y]=[n[y]];return new t({data:c,size:[o,1]})}if(b.length===2){if(b[0]!==o||b[1]!==1)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var N=0;N<o;N++)c[N]=[n[N][0]];return new t({data:c,size:[o,1]})}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}}}var Qm="lsolve",SM=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],CM=U(Qm,SM,e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:u}=e,c=Eo({DenseMatrix:u});return t(Qm,{"SparseMatrix, Array | Matrix":function(f,p){return s(f,p)},"DenseMatrix, Array | Matrix":function(f,p){return l(f,p)},"Array, Array | Matrix":function(f,p){var m=r(f),d=l(m,p);return d.valueOf()}});function l(f,p){p=c(f,p,!0);for(var m=p._data,d=f._size[0],h=f._size[1],w=[],v=f._data,x=0;x<h;x++){var g=m[x][0]||0,b=void 0;if(o(g,0))b=0;else{var y=v[x][x];if(o(y,0))throw new Error("Linear system cannot be solved since matrix is singular");b=n(g,y);for(var N=x+1;N<d;N++)m[N]=[a(m[N][0]||0,i(b,v[N][x]))]}w[x]=[b]}return new u({data:w,size:[d,1]})}function s(f,p){p=c(f,p,!0);for(var m=p._data,d=f._size[0],h=f._size[1],w=f._values,v=f._index,x=f._ptr,g=[],b=0;b<h;b++){var y=m[b][0]||0;if(o(y,0))g[b]=[0];else{for(var N=0,E=[],A=[],D=x[b],S=x[b+1],C=D;C<S;C++){var _=v[C];_===b?N=w[C]:_>b&&(E.push(w[C]),A.push(_))}if(o(N,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var R=n(y,N),P=0,I=A.length;P<I;P++){var O=A[P];m[O]=[a(m[O][0]||0,i(R,E[P]))]}g[b]=[R]}}return new u({data:g,size:[d,1]})}}),Zm="usolve",MM=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],_M=U(Zm,MM,e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:u}=e,c=Eo({DenseMatrix:u});return t(Zm,{"SparseMatrix, Array | Matrix":function(f,p){return s(f,p)},"DenseMatrix, Array | Matrix":function(f,p){return l(f,p)},"Array, Array | Matrix":function(f,p){var m=r(f),d=l(m,p);return d.valueOf()}});function l(f,p){p=c(f,p,!0);for(var m=p._data,d=f._size[0],h=f._size[1],w=[],v=f._data,x=h-1;x>=0;x--){var g=m[x][0]||0,b=void 0;if(o(g,0))b=0;else{var y=v[x][x];if(o(y,0))throw new Error("Linear system cannot be solved since matrix is singular");b=n(g,y);for(var N=x-1;N>=0;N--)m[N]=[a(m[N][0]||0,i(b,v[N][x]))]}w[x]=[b]}return new u({data:w,size:[d,1]})}function s(f,p){p=c(f,p,!0);for(var m=p._data,d=f._size[0],h=f._size[1],w=f._values,v=f._index,x=f._ptr,g=[],b=h-1;b>=0;b--){var y=m[b][0]||0;if(o(y,0))g[b]=[0];else{for(var N=0,E=[],A=[],D=x[b],S=x[b+1],C=S-1;C>=D;C--){var _=v[C];_===b?N=w[C]:_<b&&(E.push(w[C]),A.push(_))}if(o(N,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var R=n(y,N),P=0,I=A.length;P<I;P++){var O=A[P];m[O]=[a(m[O][0],i(R,E[P]))]}g[b]=[R]}}return new u({data:g,size:[d,1]})}}),Xm="lsolveAll",FM=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],TM=U(Xm,FM,e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:u}=e,c=Eo({DenseMatrix:u});return t(Xm,{"SparseMatrix, Array | Matrix":function(f,p){return s(f,p)},"DenseMatrix, Array | Matrix":function(f,p){return l(f,p)},"Array, Array | Matrix":function(f,p){var m=r(f),d=l(m,p);return d.map(h=>h.valueOf())}});function l(f,p){for(var m=[c(f,p,!0)._data.map(A=>A[0])],d=f._data,h=f._size[0],w=f._size[1],v=0;v<w;v++)for(var x=m.length,g=0;g<x;g++){var b=m[g];if(o(d[v][v],0))if(o(b[v],0)){if(g===0){var y=[...b];y[v]=1;for(var N=v+1;N<w;N++)y[N]=a(y[N],d[N][v]);m.push(y)}}else{if(g===0)return[];m.splice(g,1),g-=1,x-=1}else{b[v]=n(b[v],d[v][v]);for(var E=v+1;E<w;E++)b[E]=a(b[E],i(b[v],d[E][v]))}}return m.map(A=>new u({data:A.map(D=>[D]),size:[h,1]}))}function s(f,p){for(var m=[c(f,p,!0)._data.map(se=>se[0])],d=f._size[0],h=f._size[1],w=f._values,v=f._index,x=f._ptr,g=0;g<h;g++)for(var b=m.length,y=0;y<b;y++){for(var N=m[y],E=[],A=[],D=x[g],S=x[g+1],C=0,_=D;_<S;_++){var R=v[_];R===g?C=w[_]:R>g&&(E.push(w[_]),A.push(R))}if(o(C,0))if(o(N[g],0)){if(y===0){var P=[...N];P[g]=1;for(var I=0,O=A.length;I<O;I++){var F=A[I];P[F]=a(P[F],E[I])}m.push(P)}}else{if(y===0)return[];m.splice(y,1),y-=1,b-=1}else{N[g]=n(N[g],C);for(var q=0,k=A.length;q<k;q++){var te=A[q];N[te]=a(N[te],i(N[g],E[q]))}}}return m.map(se=>new u({data:se.map(K=>[K]),size:[d,1]}))}}),Ym="usolveAll",OM=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],BM=U(Ym,OM,e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:u}=e,c=Eo({DenseMatrix:u});return t(Ym,{"SparseMatrix, Array | Matrix":function(f,p){return s(f,p)},"DenseMatrix, Array | Matrix":function(f,p){return l(f,p)},"Array, Array | Matrix":function(f,p){var m=r(f),d=l(m,p);return d.map(h=>h.valueOf())}});function l(f,p){for(var m=[c(f,p,!0)._data.map(A=>A[0])],d=f._data,h=f._size[0],w=f._size[1],v=w-1;v>=0;v--)for(var x=m.length,g=0;g<x;g++){var b=m[g];if(o(d[v][v],0))if(o(b[v],0)){if(g===0){var y=[...b];y[v]=1;for(var N=v-1;N>=0;N--)y[N]=a(y[N],d[N][v]);m.push(y)}}else{if(g===0)return[];m.splice(g,1),g-=1,x-=1}else{b[v]=n(b[v],d[v][v]);for(var E=v-1;E>=0;E--)b[E]=a(b[E],i(b[v],d[E][v]))}}return m.map(A=>new u({data:A.map(D=>[D]),size:[h,1]}))}function s(f,p){for(var m=[c(f,p,!0)._data.map(se=>se[0])],d=f._size[0],h=f._size[1],w=f._values,v=f._index,x=f._ptr,g=h-1;g>=0;g--)for(var b=m.length,y=0;y<b;y++){for(var N=m[y],E=[],A=[],D=x[g],S=x[g+1],C=0,_=S-1;_>=D;_--){var R=v[_];R===g?C=w[_]:R<g&&(E.push(w[_]),A.push(R))}if(o(C,0))if(o(N[g],0)){if(y===0){var P=[...N];P[g]=1;for(var I=0,O=A.length;I<O;I++){var F=A[I];P[F]=a(P[F],E[I])}m.push(P)}}else{if(y===0)return[];m.splice(y,1),y-=1,b-=1}else{N[g]=n(N[g],C);for(var q=0,k=A.length;q<k;q++){var te=A[q];N[te]=a(N[te],i(N[g],E[q]))}}}return m.map(se=>new u({data:se.map(K=>[K]),size:[d,1]}))}}),kM="matAlgo08xS0Sid",IM=["typed","equalScalar"],_l=U(kM,IM,e=>{var{typed:t,equalScalar:r}=e;return function(n,i,a){var o=n._values,u=n._index,c=n._ptr,l=n._size,s=n._datatype||n._data===void 0?n._datatype:n.getDataType(),f=i._values,p=i._index,m=i._ptr,d=i._size,h=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==d.length)throw new Ke(l.length,d.length);if(l[0]!==d[0]||l[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+d+")");if(!o||!f)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var w=l[0],v=l[1],x,g=r,b=0,y=a;typeof s=="string"&&s===h&&s!=="mixed"&&(x=s,g=t.find(r,[x,x]),b=t.convert(0,x),y=t.find(a,[x,x]));for(var N=[],E=[],A=[],D=[],S=[],C,_,R,P,I=0;I<v;I++){A[I]=E.length;var O=I+1;for(_=c[I],R=c[I+1],C=_;C<R;C++)P=u[C],S[P]=O,D[P]=o[C],E.push(P);for(_=m[I],R=m[I+1],C=_;C<R;C++)P=p[C],S[P]===O&&(D[P]=y(D[P],f[C]));for(C=A[I];C<E.length;){P=E[C];var F=D[P];g(F,b)?E.splice(C,1):(N.push(F),C++)}}return A[v]=E.length,n.createSparseMatrix({values:N,index:E,ptr:A,size:[w,v],datatype:s===n._datatype&&h===i._datatype?x:void 0})}}),Fl=U("useMatrixForArrayScalar",["typed","matrix"],e=>{var{typed:t,matrix:r}=e;return{"Array, number":t.referTo("DenseMatrix, number",n=>(i,a)=>n(r(i),a).valueOf()),"Array, BigNumber":t.referTo("DenseMatrix, BigNumber",n=>(i,a)=>n(r(i),a).valueOf()),"number, Array":t.referTo("number, DenseMatrix",n=>(i,a)=>n(i,r(a)).valueOf()),"BigNumber, Array":t.referTo("BigNumber, DenseMatrix",n=>(i,a)=>n(i,r(a)).valueOf())}}),ed="leftShift",RM=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],qM=U(ed,RM,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e,u=ii({typed:t}),c=Gr({typed:t,equalScalar:n}),l=_l({typed:t,equalScalar:n}),s=zi({typed:t,DenseMatrix:a}),f=Jt({typed:t,equalScalar:n}),p=Jr({typed:t}),m=gt({typed:t,matrix:r,concat:o}),d=Fl({typed:t,matrix:r});return t(ed,{"number, number":Vv,"BigNumber, BigNumber":nS,"SparseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():f(w,v,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():p(w,v,h,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):s(v,w,h,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):p(v,w,h,!0))},d,m({SS:l,DS:u,SD:c}))}),td="rightArithShift",zM=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],jM=U(td,zM,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e,u=ii({typed:t}),c=Gr({typed:t,equalScalar:n}),l=_l({typed:t,equalScalar:n}),s=zi({typed:t,DenseMatrix:a}),f=Jt({typed:t,equalScalar:n}),p=Jr({typed:t}),m=gt({typed:t,matrix:r,concat:o}),d=Fl({typed:t,matrix:r});return t(td,{"number, number":Uv,"BigNumber, BigNumber":iS,"SparseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():f(w,v,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():p(w,v,h,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):s(v,w,h,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):p(v,w,h,!0))},d,m({SS:l,DS:u,SD:c}))}),rd="rightLogShift",LM=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],PM=U(rd,LM,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e,u=ii({typed:t}),c=Gr({typed:t,equalScalar:n}),l=_l({typed:t,equalScalar:n}),s=zi({typed:t,DenseMatrix:a}),f=Jt({typed:t,equalScalar:n}),p=Jr({typed:t}),m=gt({typed:t,matrix:r,concat:o}),d=Fl({typed:t,matrix:r});return t(rd,{"number, number":$v,"SparseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():f(w,v,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(w,v)=>n(v,0)?w.clone():p(w,v,h,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):s(v,w,h,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(h=>(w,v)=>n(w,0)?i(v.size(),v.storage()):p(v,w,h,!0))},d,m({SS:l,DS:u,SD:c}))}),nd="and",VM=["typed","matrix","equalScalar","zeros","not","concat"],ky=U(nd,VM,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o}=e,u=Gr({typed:t,equalScalar:n}),c=Du({typed:t,equalScalar:n}),l=Jt({typed:t,equalScalar:n}),s=Jr({typed:t}),f=gt({typed:t,matrix:r,concat:o});return t(nd,{"number, number":Kv,"Complex, Complex":function(p,m){return(p.re!==0||p.im!==0)&&(m.re!==0||m.im!==0)},"BigNumber, BigNumber":function(p,m){return!p.isZero()&&!m.isZero()&&!p.isNaN()&&!m.isNaN()},"Unit, Unit":t.referToSelf(p=>(m,d)=>p(m.value||0,d.value||0)),"SparseMatrix, any":t.referToSelf(p=>(m,d)=>a(d)?i(m.size(),m.storage()):l(m,d,p,!1)),"DenseMatrix, any":t.referToSelf(p=>(m,d)=>a(d)?i(m.size(),m.storage()):s(m,d,p,!1)),"any, SparseMatrix":t.referToSelf(p=>(m,d)=>a(m)?i(m.size(),m.storage()):l(d,m,p,!0)),"any, DenseMatrix":t.referToSelf(p=>(m,d)=>a(m)?i(m.size(),m.storage()):s(d,m,p,!0)),"Array, any":t.referToSelf(p=>(m,d)=>p(r(m),d).valueOf()),"any, Array":t.referToSelf(p=>(m,d)=>p(m,r(d)).valueOf())},f({SS:c,DS:u}))}),Us="compare",UM=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],$M=U(Us,UM,e=>{var{typed:t,config:r,equalScalar:n,matrix:i,BigNumber:a,Fraction:o,DenseMatrix:u,concat:c}=e,l=cr({typed:t}),s=Nu({typed:t,equalScalar:n}),f=It({typed:t,DenseMatrix:u}),p=gt({typed:t,matrix:i,concat:c}),m=Ca({typed:t});return t(Us,HM({typed:t,config:r}),{"boolean, boolean":function(d,h){return d===h?0:d>h?1:-1},"BigNumber, BigNumber":function(d,h){return Tr(d,h,r.epsilon)?new a(0):new a(d.cmp(h))},"Fraction, Fraction":function(d,h){return new o(d.compare(h))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},m,p({SS:s,DS:l,Ss:f}))}),HM=U(Us,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Us,{"number, number":function(n,i){return sr(n,i,r.epsilon)?0:n>i?1:-1}})}),JM=function e(t,r){var n=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,i=/(^[ ]*|[ ]*$)/g,a=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,o=/^0x[0-9a-f]+$/i,u=/^0/,c=function(g){return e.insensitive&&(""+g).toLowerCase()||""+g},l=c(t).replace(i,"")||"",s=c(r).replace(i,"")||"",f=l.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),p=s.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=parseInt(l.match(o),16)||f.length!==1&&l.match(a)&&Date.parse(l),d=parseInt(s.match(o),16)||m&&s.match(a)&&Date.parse(s)||null,h,w;if(d){if(m<d)return-1;if(m>d)return 1}for(var v=0,x=Math.max(f.length,p.length);v<x;v++){if(h=!(f[v]||"").match(u)&&parseFloat(f[v])||f[v]||0,w=!(p[v]||"").match(u)&&parseFloat(p[v])||p[v]||0,isNaN(h)!==isNaN(w))return isNaN(h)?1:-1;if(typeof h!=typeof w&&(h+="",w+=""),h<w)return-1;if(h>w)return 1}return 0};const Yi=No(JM);var id="compareNatural",GM=["typed","compare"],WM=U(id,GM,e=>{var{typed:t,compare:r}=e,n=r.signatures["boolean,boolean"];return t(id,{"any, any":i});function i(c,l){var s=dt(c),f=dt(l),p;if((s==="number"||s==="BigNumber"||s==="Fraction")&&(f==="number"||f==="BigNumber"||f==="Fraction"))return p=r(c,l),p.toString()!=="0"?p>0?1:-1:Yi(s,f);var m=["Array","DenseMatrix","SparseMatrix"];if(m.includes(s)||m.includes(f))return p=a(i,c,l),p!==0?p:Yi(s,f);if(s!==f)return Yi(s,f);if(s==="Complex")return KM(c,l);if(s==="Unit")return c.equalBase(l)?i(c.value,l.value):o(i,c.formatUnits(),l.formatUnits());if(s==="boolean")return n(c,l);if(s==="string")return Yi(c,l);if(s==="Object")return u(i,c,l);if(s==="null"||s==="undefined")return 0;throw new TypeError('Unsupported type of value "'+s+'"')}function a(c,l,s){return wi(l)&&wi(s)?o(c,l.toJSON().values,s.toJSON().values):wi(l)?a(c,l.toArray(),s):wi(s)?a(c,l,s.toArray()):_s(l)?a(c,l.toJSON().data,s):_s(s)?a(c,l,s.toJSON().data):Array.isArray(l)?Array.isArray(s)?o(c,l,s):a(c,l,[s]):a(c,[l],s)}function o(c,l,s){for(var f=0,p=Math.min(l.length,s.length);f<p;f++){var m=c(l[f],s[f]);if(m!==0)return m}return l.length>s.length?1:l.length<s.length?-1:0}function u(c,l,s){var f=Object.keys(l),p=Object.keys(s);f.sort(Yi),p.sort(Yi);var m=o(c,f,p);if(m!==0)return m;for(var d=0;d<f.length;d++){var h=c(l[f[d]],s[p[d]]);if(h!==0)return h}return 0}});function KM(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0}var ad="compareText",QM=["typed","matrix","concat"];Rc.signature="any, any";var ZM=U(ad,QM,e=>{var{typed:t,matrix:r,concat:n}=e,i=gt({typed:t,matrix:r,concat:n});return t(ad,Rc,i({elop:Rc,Ds:!0}))}),$s="equal",XM=["typed","matrix","equalScalar","DenseMatrix","concat"],YM=U($s,XM,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=cn({typed:t,DenseMatrix:i}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:r,concat:a});return t($s,e_({typed:t,equalScalar:n}),l({elop:n,SS:u,DS:o,Ss:c}))}),e_=U($s,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t($s,{"any, any":function(n,i){return n===null?i===null:i===null?n===null:n===void 0?i===void 0:i===void 0?n===void 0:r(n,i)}})}),od="equalText",t_=["typed","compareText","isZero"],r_=U(od,t_,e=>{var{typed:t,compareText:r,isZero:n}=e;return t(od,{"any, any":function(i,a){return n(r(i,a))}})}),Hs="smaller",n_=["typed","config","matrix","DenseMatrix","concat"],i_=U(Hs,n_,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=cn({typed:t,DenseMatrix:i}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:n,concat:a}),s=Ca({typed:t});return t(Hs,a_({typed:t,config:r}),{"boolean, boolean":(f,p)=>f<p,"BigNumber, BigNumber":function(f,p){return f.lt(p)&&!Tr(f,p,r.epsilon)},"Fraction, Fraction":(f,p)=>f.compare(p)===-1,"Complex, Complex":function(f,p){throw new TypeError("No ordering relation is defined for complex numbers")}},s,l({SS:u,DS:o,Ss:c}))}),a_=U(Hs,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Hs,{"number, number":function(n,i){return n<i&&!sr(n,i,r.epsilon)}})}),Js="smallerEq",o_=["typed","config","matrix","DenseMatrix","concat"],s_=U(Js,o_,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=cn({typed:t,DenseMatrix:i}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:n,concat:a}),s=Ca({typed:t});return t(Js,u_({typed:t,config:r}),{"boolean, boolean":(f,p)=>f<=p,"BigNumber, BigNumber":function(f,p){return f.lte(p)||Tr(f,p,r.epsilon)},"Fraction, Fraction":(f,p)=>f.compare(p)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},s,l({SS:u,DS:o,Ss:c}))}),u_=U(Js,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Js,{"number, number":function(n,i){return n<=i||sr(n,i,r.epsilon)}})}),Gs="larger",c_=["typed","config","matrix","DenseMatrix","concat"],l_=U(Gs,c_,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=cn({typed:t,DenseMatrix:i}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:n,concat:a}),s=Ca({typed:t});return t(Gs,f_({typed:t,config:r}),{"boolean, boolean":(f,p)=>f>p,"BigNumber, BigNumber":function(f,p){return f.gt(p)&&!Tr(f,p,r.epsilon)},"Fraction, Fraction":(f,p)=>f.compare(p)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},s,l({SS:u,DS:o,Ss:c}))}),f_=U(Gs,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Gs,{"number, number":function(n,i){return n>i&&!sr(n,i,r.epsilon)}})}),Ws="largerEq",p_=["typed","config","matrix","DenseMatrix","concat"],m_=U(Ws,p_,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:a}=e,o=cr({typed:t}),u=cn({typed:t,DenseMatrix:i}),c=It({typed:t,DenseMatrix:i}),l=gt({typed:t,matrix:n,concat:a}),s=Ca({typed:t});return t(Ws,d_({typed:t,config:r}),{"boolean, boolean":(f,p)=>f>=p,"BigNumber, BigNumber":function(f,p){return f.gte(p)||Tr(f,p,r.epsilon)},"Fraction, Fraction":(f,p)=>f.compare(p)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},s,l({SS:u,DS:o,Ss:c}))}),d_=U(Ws,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Ws,{"number, number":function(n,i){return n>=i||sr(n,i,r.epsilon)}})}),sd="deepEqual",h_=["typed","equal"],g_=U(sd,h_,e=>{var{typed:t,equal:r}=e;return t(sd,{"any, any":function(i,a){return n(i.valueOf(),a.valueOf())}});function n(i,a){if(Array.isArray(i))if(Array.isArray(a)){var o=i.length;if(o!==a.length)return!1;for(var u=0;u<o;u++)if(!n(i[u],a[u]))return!1;return!0}else return!1;else return Array.isArray(a)?!1:r(i,a)}}),Ks="unequal",v_=["typed","config","equalScalar","matrix","DenseMatrix","concat"],y_=U(Ks,v_,e=>{var{typed:t,config:r,equalScalar:n,matrix:i,DenseMatrix:a,concat:o}=e,u=cr({typed:t}),c=cn({typed:t,DenseMatrix:a}),l=It({typed:t,DenseMatrix:a}),s=gt({typed:t,matrix:i,concat:o});return t(Ks,b_({typed:t,equalScalar:n}),s({elop:f,SS:c,DS:u,Ss:l}));function f(p,m){return!n(p,m)}}),b_=U(Ks,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t(Ks,{"any, any":function(n,i){return n===null?i!==null:i===null?n!==null:n===void 0?i!==void 0:i===void 0?n!==void 0:!r(n,i)}})}),ud="partitionSelect",x_=["typed","isNumeric","isNaN","compare"],w_=U(ud,x_,e=>{var{typed:t,isNumeric:r,isNaN:n,compare:i}=e,a=i,o=(l,s)=>-i(l,s);return t(ud,{"Array | Matrix, number":function(l,s){return u(l,s,a)},"Array | Matrix, number, string":function(l,s,f){if(f==="asc")return u(l,s,a);if(f==="desc")return u(l,s,o);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":u});function u(l,s,f){if(!Fe(s)||s<0)throw new Error("k must be a non-negative integer");if(ke(l)){var p=l.size();if(p.length>1)throw new Error("Only one dimensional matrices supported");return c(l.valueOf(),s,f)}if(Array.isArray(l))return c(l,s,f)}function c(l,s,f){if(s>=l.length)throw new Error("k out of bounds");for(var p=0;p<l.length;p++)if(r(l[p])&&n(l[p]))return l[p];for(var m=0,d=l.length-1;m<d;){for(var h=m,w=d,v=l[Math.floor(Math.random()*(d-m+1))+m];h<w;)if(f(l[h],v)>=0){var x=l[w];l[w]=l[h],l[h]=x,--w}else++h;f(l[h],v)>0&&--h,s<=h?d=h:m=h+1}return l[s]}}),cd="sort",N_=["typed","matrix","compare","compareNatural"],D_=U(cd,N_,e=>{var{typed:t,matrix:r,compare:n,compareNatural:i}=e,a=n,o=(s,f)=>-n(s,f);return t(cd,{Array:function(s){return c(s),s.sort(a)},Matrix:function(s){return l(s),r(s.toArray().sort(a),s.storage())},"Array, function":function(s,f){return c(s),s.sort(f)},"Matrix, function":function(s,f){return l(s),r(s.toArray().sort(f),s.storage())},"Array, string":function(s,f){return c(s),s.sort(u(f))},"Matrix, string":function(s,f){return l(s),r(s.toArray().sort(u(f)),s.storage())}});function u(s){if(s==="asc")return a;if(s==="desc")return o;if(s==="natural")return i;throw new Error('String "asc", "desc", or "natural" expected')}function c(s){if(Ve(s).length!==1)throw new Error("One dimensional array expected")}function l(s){if(s.size().length!==1)throw new Error("One dimensional matrix expected")}}),ld="max",E_=["typed","config","numeric","larger"],Iy=U(ld,E_,e=>{var{typed:t,config:r,numeric:n,larger:i}=e;return t(ld,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(u,c){return xu(u,c.valueOf(),a)},"...":function(u){if(Ea(u))throw new TypeError("Scalar values expected in function max");return o(u)}});function a(u,c){try{return i(u,c)?u:c}catch(l){throw ur(l,"max",c)}}function o(u){var c;if(Sn(u,function(l){try{isNaN(l)&&typeof l=="number"?c=NaN:(c===void 0||i(l,c))&&(c=l)}catch(s){throw ur(s,"max",l)}}),c===void 0)throw new Error("Cannot calculate max of an empty array");return typeof c=="string"&&(c=n(c,r.number)),c}}),fd="min",A_=["typed","config","numeric","smaller"],Ry=U(fd,A_,e=>{var{typed:t,config:r,numeric:n,smaller:i}=e;return t(fd,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(u,c){return xu(u,c.valueOf(),a)},"...":function(u){if(Ea(u))throw new TypeError("Scalar values expected in function min");return o(u)}});function a(u,c){try{return i(u,c)?u:c}catch(l){throw ur(l,"min",c)}}function o(u){var c;if(Sn(u,function(l){try{isNaN(l)&&typeof l=="number"?c=NaN:(c===void 0||i(l,c))&&(c=l)}catch(s){throw ur(s,"min",l)}}),c===void 0)throw new Error("Cannot calculate min of an empty array");return typeof c=="string"&&(c=n(c,r.number)),c}}),S_="ImmutableDenseMatrix",C_=["smaller","DenseMatrix"],M_=U(S_,C_,e=>{var{smaller:t,DenseMatrix:r}=e;function n(i,a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(a&&!Qt(a))throw new Error("Invalid datatype: "+a);if(ke(i)||st(i)){var o=new r(i,a);this._data=o._data,this._size=o._size,this._datatype=o._datatype,this._min=null,this._max=null}else if(i&&st(i.data)&&st(i.size))this._data=i.data,this._size=i.size,this._datatype=i.datatype,this._min=typeof i.min<"u"?i.min:null,this._max=typeof i.max<"u"?i.max:null;else{if(i)throw new TypeError("Unsupported type of data ("+dt(i)+")");this._data=[],this._size=[0],this._datatype=a,this._min=null,this._max=null}}return n.prototype=new r,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(i){switch(arguments.length){case 1:{var a=r.prototype.subset.call(this,i);return ke(a)?new n({data:a._data,size:a._size,datatype:a._datatype}):a}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:ze(this._data),size:ze(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(i){return new n(i)},n.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(this._min===null){var i=null;this.forEach(function(a){(i===null||t(a,i))&&(i=a)}),this._min=i!==null?i:void 0}return this._min},n.prototype.max=function(){if(this._max===null){var i=null;this.forEach(function(a){(i===null||t(i,a))&&(i=a)}),this._max=i!==null?i:void 0}return this._max},n},{isClass:!0}),__="Index",F_=["ImmutableDenseMatrix","getMatrixDataType"],T_=U(__,F_,e=>{var{ImmutableDenseMatrix:t,getMatrixDataType:r}=e;function n(a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var o=0,u=arguments.length;o<u;o++){var c=arguments[o],l=st(c),s=ke(c),f=null;if(bl(c))this._dimensions.push(c),this._isScalar=!1;else if(l||s){var p=void 0;r(c)==="boolean"?(l&&(p=i(pd(c).valueOf())),s&&(p=i(pd(c._data).valueOf())),f=c.valueOf().length):p=i(c.valueOf()),this._dimensions.push(p);var m=p.size();(m.length!==1||m[0]!==1||f!==null)&&(this._isScalar=!1)}else if(typeof c=="number")this._dimensions.push(i([c]));else if(typeof c=="string")this._dimensions.push(c);else throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");this._sourceSize.push(f)}}n.prototype.type="Index",n.prototype.isIndex=!0;function i(a){for(var o=0,u=a.length;o<u;o++)if(typeof a[o]!="number"||!Fe(a[o]))throw new TypeError("Index parameters must be positive integer numbers");return new t(a)}return n.prototype.clone=function(){var a=new n;return a._dimensions=ze(this._dimensions),a._isScalar=this._isScalar,a._sourceSize=this._sourceSize,a},n.create=function(a){var o=new n;return n.apply(o,a),o},n.prototype.size=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var c=this._dimensions[o];a[o]=typeof c=="string"?1:c.size()[0]}return a},n.prototype.max=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var c=this._dimensions[o];a[o]=typeof c=="string"?c:c.max()}return a},n.prototype.min=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var c=this._dimensions[o];a[o]=typeof c=="string"?c:c.min()}return a},n.prototype.forEach=function(a){for(var o=0,u=this._dimensions.length;o<u;o++)a(this._dimensions[o],o,this)},n.prototype.dimension=function(a){return this._dimensions[a]||null},n.prototype.isObjectProperty=function(){return this._dimensions.length===1&&typeof this._dimensions[0]=="string"},n.prototype.getObjectProperty=function(){return this.isObjectProperty()?this._dimensions[0]:null},n.prototype.isScalar=function(){return this._isScalar},n.prototype.toArray=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var c=this._dimensions[o];a.push(typeof c=="string"?c:c.toArray())}return a},n.prototype.valueOf=n.prototype.toArray,n.prototype.toString=function(){for(var a=[],o=0,u=this._dimensions.length;o<u;o++){var c=this._dimensions[o];typeof c=="string"?a.push(JSON.stringify(c)):a.push(c.toString())}return"["+a.join(", ")+"]"},n.prototype.toJSON=function(){return{mathjs:"Index",dimensions:this._dimensions}},n.fromJSON=function(a){return n.create(a.dimensions)},n},{isClass:!0});function pd(e){var t=[];return e.forEach((r,n)=>{r&&t.push(n)}),t}var O_="FibonacciHeap",B_=["smaller","larger"],k_=U(O_,B_,e=>{var{smaller:t,larger:r}=e,n=1/Math.log((1+Math.sqrt(5))/2);function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(s,f){var p={key:s,value:f,degree:0};if(this._minimum){var m=this._minimum;p.left=m,p.right=m.right,m.right=p,p.right.left=p,t(s,m.key)&&(this._minimum=p)}else p.left=p,p.right=p,this._minimum=p;return this._size++,p},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return this._size===0},i.prototype.extractMinimum=function(){var s=this._minimum;if(s===null)return s;for(var f=this._minimum,p=s.degree,m=s.child;p>0;){var d=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=d,p--}return s.left.right=s.right,s.right.left=s.left,s===s.right?f=null:(f=s.right,f=l(f,this._size)),this._size--,this._minimum=f,s},i.prototype.remove=function(s){this._minimum=a(this._minimum,s,-1),this.extractMinimum()};function a(s,f,p){f.key=p;var m=f.parent;return m&&t(f.key,m.key)&&(o(s,f,m),u(s,m)),t(f.key,s.key)&&(s=f),s}function o(s,f,p){f.left.right=f.right,f.right.left=f.left,p.degree--,p.child===f&&(p.child=f.right),p.degree===0&&(p.child=null),f.left=s,f.right=s.right,s.right=f,f.right.left=f,f.parent=null,f.mark=!1}function u(s,f){var p=f.parent;p&&(f.mark?(o(s,f,p),u(p)):f.mark=!0)}var c=function(s,f){s.left.right=s.right,s.right.left=s.left,s.parent=f,f.child?(s.left=f.child,s.right=f.child.right,f.child.right=s,s.right.left=s):(f.child=s,s.right=s,s.left=s),f.degree++,s.mark=!1};function l(s,f){var p=Math.floor(Math.log(f)*n)+1,m=new Array(p),d=0,h=s;if(h)for(d++,h=h.right;h!==s;)d++,h=h.right;for(var w;d>0;){for(var v=h.degree,x=h.right;w=m[v],!!w;){if(r(h.key,w.key)){var g=w;w=h,h=g}c(w,h),m[v]=null,v++}m[v]=h,h=x,d--}s=null;for(var b=0;b<p;b++)w=m[b],w&&(s?(w.left.right=w.right,w.right.left=w.left,w.left=s,w.right=s.right,s.right=w,w.right.left=w,t(w.key,s.key)&&(s=w)):s=w);return s}return i},{isClass:!0}),I_="Spa",R_=["addScalar","equalScalar","FibonacciHeap"],q_=U(I_,R_,e=>{var{addScalar:t,equalScalar:r,FibonacciHeap:n}=e;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(a,o){if(this._values[a])this._values[a].value=o;else{var u=this._heap.insert(a,o);this._values[a]=u}},i.prototype.get=function(a){var o=this._values[a];return o?o.value:0},i.prototype.accumulate=function(a,o){var u=this._values[a];u?u.value=t(u.value,o):(u=this._heap.insert(a,o),this._values[a]=u)},i.prototype.forEach=function(a,o,u){var c=this._heap,l=this._values,s=[],f=c.extractMinimum();for(f&&s.push(f);f&&f.key<=o;)f.key>=a&&(r(f.value,0)||u(f.key,f.value,this)),f=c.extractMinimum(),f&&s.push(f);for(var p=0;p<s.length;p++){var m=s[p];f=c.insert(m.key,m.value),l[f.key]=f}},i.prototype.swap=function(a,o){var u=this._values[a],c=this._values[o];if(!u&&c)u=this._heap.insert(a,c.value),this._heap.remove(c),this._values[a]=u,this._values[o]=void 0;else if(u&&!c)c=this._heap.insert(o,u.value),this._heap.remove(u),this._values[o]=c,this._values[a]=void 0;else if(u&&c){var l=u.value;u.value=c.value,c.value=l}},i},{isClass:!0}),z_=Do(function(e){return new e(1).exp()},{hasher:Eu}),j_=Do(function(e){return new e(1).plus(new e(5).sqrt()).div(2)},{hasher:Eu}),Tl=Do(function(e){return e.acos(-1)},{hasher:Eu}),L_=Do(function(e){return Tl(e).times(2)},{hasher:Eu});function Eu(e){return e[0].precision}function md(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function fc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?md(Object(r),!0).forEach(function(n){Bt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):md(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var P_="Unit",V_=["?on","config","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","abs","fix","round","equal","isNumeric","format","number","Complex","BigNumber","Fraction"],U_=U(P_,V_,e=>{var{on:t,config:r,addScalar:n,subtractScalar:i,multiplyScalar:a,divideScalar:o,pow:u,abs:c,fix:l,round:s,equal:f,isNumeric:p,format:m,number:d,Complex:h,BigNumber:w,Fraction:v}=e,x=d;function g(T,z){if(!(this instanceof g))throw new Error("Constructor must be called with the new operator");if(!(T==null||p(T)||wn(T)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,z===void 0)this.units=[],this.dimensions=q.map(L=>0);else if(typeof z=="string"){var J=g.parse(z);this.units=J.units,this.dimensions=J.dimensions}else if(Cr(z)&&z.value===null)this.fixPrefix=z.fixPrefix,this.skipAutomaticSimplification=z.skipAutomaticSimplification,this.dimensions=z.dimensions.slice(0),this.units=z.units.map(L=>Tt({},L));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(T)}Object.defineProperty(g,"name",{value:"Unit"}),g.prototype.constructor=g,g.prototype.type="Unit",g.prototype.isUnit=!0;var b,y,N;function E(){for(;N===" "||N===" ";)S()}function A(T){return T>="0"&&T<="9"||T==="."}function D(T){return T>="0"&&T<="9"}function S(){y++,N=b.charAt(y)}function C(T){y=T,N=b.charAt(y)}function _(){var T="",z=y;if(N==="+"?S():N==="-"&&(T+=N,S()),!A(N))return C(z),null;if(N==="."){if(T+=N,S(),!D(N))return C(z),null}else{for(;D(N);)T+=N,S();N==="."&&(T+=N,S())}for(;D(N);)T+=N,S();if(N==="E"||N==="e"){var J="",L=y;if(J+=N,S(),(N==="+"||N==="-")&&(J+=N,S()),!D(N))return C(L),T;for(T=T+J;D(N);)T+=N,S()}return T}function R(){for(var T="";D(N)||g.isValidAlpha(N);)T+=N,S();var z=T.charAt(0);return g.isValidAlpha(z)?T:null}function P(T){return N===T?(S(),T):null}g.parse=function(T,z){if(z=z||{},b=T,y=-1,N="",typeof b!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var J=new g;J.units=[];var L=1,H=!1;S(),E();var G=_(),Y=null;if(G){if(r.number==="BigNumber")Y=new w(G);else if(r.number==="Fraction")try{Y=new v(G)}catch{Y=parseFloat(G)}else Y=parseFloat(G);E(),P("*")?(L=1,H=!0):P("/")&&(L=-1,H=!0)}for(var ee=[],B=1;;){for(E();N==="(";)ee.push(L),B*=L,L=1,S(),E();var j=void 0;if(N){var Q=N;if(j=R(),j===null)throw new SyntaxError('Unexpected "'+Q+'" in "'+b+'" at index '+y.toString())}else break;var Z=I(j);if(Z===null)throw new SyntaxError('Unit "'+j+'" not found.');var ie=L*B;if(E(),P("^")){E();var oe=_();if(oe===null)throw new SyntaxError('In "'+T+'", "^" must be followed by a floating-point number');ie*=oe}J.units.push({unit:Z.unit,prefix:Z.prefix,power:ie});for(var ye=0;ye<q.length;ye++)J.dimensions[ye]+=(Z.unit.dimensions[ye]||0)*ie;for(E();N===")";){if(ee.length===0)throw new SyntaxError('Unmatched ")" in "'+b+'" at index '+y.toString());B/=ee.pop(),S(),E()}if(H=!1,P("*")?(L=1,H=!0):P("/")?(L=-1,H=!0):L=1,Z.unit.base){var fe=Z.unit.base.key;re.auto[fe]={unit:Z.unit,prefix:Z.prefix}}}if(E(),N)throw new SyntaxError('Could not parse: "'+T+'"');if(H)throw new SyntaxError('Trailing characters: "'+T+'"');if(ee.length!==0)throw new SyntaxError('Unmatched "(" in "'+b+'"');if(J.units.length===0&&!z.allowNoUnits)throw new SyntaxError('"'+T+'" contains no units');return J.value=Y!==void 0?J._normalize(Y):null,J},g.prototype.clone=function(){var T=new g;T.fixPrefix=this.fixPrefix,T.skipAutomaticSimplification=this.skipAutomaticSimplification,T.value=ze(this.value),T.dimensions=this.dimensions.slice(0),T.units=[];for(var z=0;z<this.units.length;z++){T.units[z]={};for(var J in this.units[z])Me(this.units[z],J)&&(T.units[z][J]=this.units[z][J])}return T},g.prototype.valueType=function(){return dt(this.value)},g.prototype._isDerived=function(){return this.units.length===0?!1:this.units.length>1||Math.abs(this.units[0].power-1)>1e-15},g.prototype._normalize=function(T){if(T==null||this.units.length===0)return T;for(var z=T,J=g._getNumberConverter(dt(T)),L=0;L<this.units.length;L++){var H=J(this.units[L].unit.value),G=J(this.units[L].prefix.value),Y=J(this.units[L].power);z=a(z,u(a(H,G),Y))}return z},g.prototype._denormalize=function(T,z){if(T==null||this.units.length===0)return T;for(var J=T,L=g._getNumberConverter(dt(T)),H=0;H<this.units.length;H++){var G=L(this.units[H].unit.value),Y=L(this.units[H].prefix.value),ee=L(this.units[H].power);J=o(J,u(a(G,Y),ee))}return J};var I=Do(T=>{if(Me(V,T)){var z=V[T],J=z.prefixes[""];return{unit:z,prefix:J}}for(var L in V)if(Me(V,L)&&eD(T,L)){var H=V[L],G=T.length-L.length,Y=T.substring(0,G),ee=Me(H.prefixes,Y)?H.prefixes[Y]:void 0;if(ee!==void 0)return{unit:H,prefix:ee}}return null},{hasher:T=>T[0],limit:100});g.isValuelessUnit=function(T){return I(T)!==null},g.prototype.hasBase=function(T){if(typeof T=="string"&&(T=k[T]),!T)return!1;for(var z=0;z<q.length;z++)if(Math.abs((this.dimensions[z]||0)-(T.dimensions[z]||0))>1e-12)return!1;return!0},g.prototype.equalBase=function(T){for(var z=0;z<q.length;z++)if(Math.abs((this.dimensions[z]||0)-(T.dimensions[z]||0))>1e-12)return!1;return!0},g.prototype.equals=function(T){return this.equalBase(T)&&f(this.value,T.value)},g.prototype.multiply=function(T){for(var z=this.clone(),J=Cr(T)?T:new g(T),L=0;L<q.length;L++)z.dimensions[L]=(this.dimensions[L]||0)+(J.dimensions[L]||0);for(var H=0;H<J.units.length;H++){var G=fc({},J.units[H]);z.units.push(G)}if(this.value!==null||J.value!==null){var Y=this.value===null?this._normalize(1):this.value,ee=J.value===null?J._normalize(1):J.value;z.value=a(Y,ee)}else z.value=null;return Cr(T)&&(z.skipAutomaticSimplification=!1),O(z)},g.prototype.divideInto=function(T){return new g(T).divide(this)},g.prototype.divide=function(T){for(var z=this.clone(),J=Cr(T)?T:new g(T),L=0;L<q.length;L++)z.dimensions[L]=(this.dimensions[L]||0)-(J.dimensions[L]||0);for(var H=0;H<J.units.length;H++){var G=fc(fc({},J.units[H]),{},{power:-J.units[H].power});z.units.push(G)}if(this.value!==null||J.value!==null){var Y=this.value===null?this._normalize(1):this.value,ee=J.value===null?J._normalize(1):J.value;z.value=o(Y,ee)}else z.value=null;return Cr(T)&&(z.skipAutomaticSimplification=!1),O(z)},g.prototype.pow=function(T){for(var z=this.clone(),J=0;J<q.length;J++)z.dimensions[J]=(this.dimensions[J]||0)*T;for(var L=0;L<z.units.length;L++)z.units[L].power*=T;return z.value!==null?z.value=u(z.value,T):z.value=null,z.skipAutomaticSimplification=!1,O(z)};function O(T){return T.equalBase(k.NONE)&&T.value!==null&&!r.predictable?T.value:T}g.prototype.abs=function(){var T=this.clone();if(T.value!==null)if(T._isDerived()||T.units.length===0||T.units[0].unit.offset===0)T.value=c(T.value);else{var z=T._numberConverter(),J=z(T.units[0].unit.value),L=z(T.units[0].unit.offset),H=a(J,L);T.value=i(c(n(T.value,H)),H)}for(var G in T.units)(T.units[G].unit.name==="VA"||T.units[G].unit.name==="VAR")&&(T.units[G].unit=V.W);return T},g.prototype.to=function(T){var z=this.value===null?this._normalize(1):this.value,J;if(typeof T=="string")J=g.parse(T);else if(Cr(T))J=T.clone();else throw new Error("String or Unit expected as parameter");if(!this.equalBase(J))throw new Error("Units do not match ('".concat(J.toString(),"' != '").concat(this.toString(),"')"));if(J.value!==null)throw new Error("Cannot convert to a unit with a value");if(this.value===null||this._isDerived()||this.units.length===0||J.units.length===0||this.units[0].unit.offset===J.units[0].unit.offset)J.value=ze(z);else{var L=g._getNumberConverter(dt(z)),H=this.units[0].unit.value,G=this.units[0].unit.offset,Y=a(H,G),ee=J.units[0].unit.value,B=J.units[0].unit.offset,j=a(ee,B);J.value=n(z,L(i(Y,j)))}return J.fixPrefix=!0,J.skipAutomaticSimplification=!0,J},g.prototype.toNumber=function(T){return x(this.toNumeric(T))},g.prototype.toNumeric=function(T){var z;return T?z=this.to(T):z=this.clone(),z._isDerived()||z.units.length===0?z._denormalize(z.value):z._denormalize(z.value,z.units[0].prefix.value)},g.prototype.toString=function(){return this.format()},g.prototype.toJSON=function(){return{mathjs:"Unit",value:this._denormalize(this.value),unit:this.units.length>0?this.formatUnits():null,fixPrefix:this.fixPrefix}},g.fromJSON=function(T){var z,J=new g(T.value,(z=T.unit)!==null&&z!==void 0?z:void 0);return J.fixPrefix=T.fixPrefix||!1,J},g.prototype.valueOf=g.prototype.toString,g.prototype.simplify=function(){var T=this.clone(),z=[],J;for(var L in ae)if(Me(ae,L)&&T.hasBase(k[L])){J=L;break}if(J==="NONE")T.units=[];else{var H;if(J&&Me(ae,J)&&(H=ae[J]),H)T.units=[{unit:H.unit,prefix:H.prefix,power:1}];else{for(var G=!1,Y=0;Y<q.length;Y++){var ee=q[Y];Math.abs(T.dimensions[Y]||0)>1e-12&&(Me(ae,ee)?z.push({unit:ae[ee].unit,prefix:ae[ee].prefix,power:T.dimensions[Y]||0}):G=!0)}z.length<T.units.length&&!G&&(T.units=z)}}return T},g.prototype.toSI=function(){for(var T=this.clone(),z=[],J=0;J<q.length;J++){var L=q[J];if(Math.abs(T.dimensions[J]||0)>1e-12)if(Me(re.si,L))z.push({unit:re.si[L].unit,prefix:re.si[L].prefix,power:T.dimensions[J]||0});else throw new Error("Cannot express custom unit "+L+" in SI units")}return T.units=z,T.fixPrefix=!0,T.skipAutomaticSimplification=!0,this.value!==null?(T.value=null,this.to(T)):T},g.prototype.formatUnits=function(){for(var T="",z="",J=0,L=0,H=0;H<this.units.length;H++)this.units[H].power>0?(J++,T+=" "+this.units[H].prefix.name+this.units[H].unit.name,Math.abs(this.units[H].power-1)>1e-15&&(T+="^"+this.units[H].power)):this.units[H].power<0&&L++;if(L>0)for(var G=0;G<this.units.length;G++)this.units[G].power<0&&(J>0?(z+=" "+this.units[G].prefix.name+this.units[G].unit.name,Math.abs(this.units[G].power+1)>1e-15&&(z+="^"+-this.units[G].power)):(z+=" "+this.units[G].prefix.name+this.units[G].unit.name,z+="^"+this.units[G].power));T=T.substr(1),z=z.substr(1),J>1&&L>0&&(T="("+T+")"),L>1&&J>0&&(z="("+z+")");var Y=T;return J>0&&L>0&&(Y+=" / "),Y+=z,Y},g.prototype.format=function(T){var z=this.skipAutomaticSimplification||this.value===null?this.clone():this.simplify(),J=!1;typeof z.value<"u"&&z.value!==null&&wn(z.value)&&(J=Math.abs(z.value.re)<1e-14);for(var L in z.units)Me(z.units,L)&&z.units[L].unit&&(z.units[L].unit.name==="VA"&&J?z.units[L].unit=V.VAR:z.units[L].unit.name==="VAR"&&!J&&(z.units[L].unit=V.VA));z.units.length===1&&!z.fixPrefix&&Math.abs(z.units[0].power-Math.round(z.units[0].power))<1e-14&&(z.units[0].prefix=z._bestPrefix());var H=z._denormalize(z.value),G=z.value!==null?m(H,T||{}):"",Y=z.formatUnits();return z.value&&wn(z.value)&&(G="("+G+")"),Y.length>0&&G.length>0&&(G+=" "),G+=Y,G},g.prototype._bestPrefix=function(){if(this.units.length!==1)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var T=this.value!==null?c(this.value):0,z=c(this.units[0].unit.value),J=this.units[0].prefix;if(T===0)return J;var L=this.units[0].power,H=Math.log(T/Math.pow(J.value*z,L))/Math.LN10-1.2;if(H>-2.200001&&H<1.800001)return J;H=Math.abs(H);var G=this.units[0].unit.prefixes;for(var Y in G)if(Me(G,Y)){var ee=G[Y];if(ee.scientific){var B=Math.abs(Math.log(T/Math.pow(ee.value*z,L))/Math.LN10-1.2);(B<H||B===H&&ee.name.length<J.name.length)&&(J=ee,H=B)}}return J},g.prototype.splitUnit=function(T){for(var z=this.clone(),J=[],L=0;L<T.length&&(z=z.to(T[L]),L!==T.length-1);L++){var H=z.toNumeric(),G=s(H),Y=void 0,ee=f(G,H);ee?Y=G:Y=l(z.toNumeric());var B=new g(Y,T[L].toString());J.push(B),z=i(z,B)}for(var j=0,Q=0;Q<J.length;Q++)j=n(j,J[Q].value);return f(j,this.value)&&(z.value=0),J.push(z),J};var F={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},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}}};F.SHORTLONG=Tt({},F.SHORT,F.LONG),F.BINARY_SHORT=Tt({},F.BINARY_SHORT_SI,F.BINARY_SHORT_IEC),F.BINARY_LONG=Tt({},F.BINARY_LONG_SI,F.BINARY_LONG_IEC);var q=["MASS","LENGTH","TIME","CURRENT","TEMPERATURE","LUMINOUS_INTENSITY","AMOUNT_OF_SUBSTANCE","ANGLE","BIT"],k={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 te in k)Me(k,te)&&(k[te].key=te);var se={},K={name:"",base:se,value:1,offset:0,dimensions:q.map(T=>0)},V={meter:{name:"meter",base:k.LENGTH,prefixes:F.LONG,value:1,offset:0},inch:{name:"inch",base:k.LENGTH,prefixes:F.NONE,value:.0254,offset:0},foot:{name:"foot",base:k.LENGTH,prefixes:F.NONE,value:.3048,offset:0},yard:{name:"yard",base:k.LENGTH,prefixes:F.NONE,value:.9144,offset:0},mile:{name:"mile",base:k.LENGTH,prefixes:F.NONE,value:1609.344,offset:0},link:{name:"link",base:k.LENGTH,prefixes:F.NONE,value:.201168,offset:0},rod:{name:"rod",base:k.LENGTH,prefixes:F.NONE,value:5.0292,offset:0},chain:{name:"chain",base:k.LENGTH,prefixes:F.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:k.LENGTH,prefixes:F.NONE,value:1e-10,offset:0},m:{name:"m",base:k.LENGTH,prefixes:F.SHORT,value:1,offset:0},in:{name:"in",base:k.LENGTH,prefixes:F.NONE,value:.0254,offset:0},ft:{name:"ft",base:k.LENGTH,prefixes:F.NONE,value:.3048,offset:0},yd:{name:"yd",base:k.LENGTH,prefixes:F.NONE,value:.9144,offset:0},mi:{name:"mi",base:k.LENGTH,prefixes:F.NONE,value:1609.344,offset:0},li:{name:"li",base:k.LENGTH,prefixes:F.NONE,value:.201168,offset:0},rd:{name:"rd",base:k.LENGTH,prefixes:F.NONE,value:5.02921,offset:0},ch:{name:"ch",base:k.LENGTH,prefixes:F.NONE,value:20.1168,offset:0},mil:{name:"mil",base:k.LENGTH,prefixes:F.NONE,value:254e-7,offset:0},m2:{name:"m2",base:k.SURFACE,prefixes:F.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:k.SURFACE,prefixes:F.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:k.SURFACE,prefixes:F.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:k.SURFACE,prefixes:F.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:k.SURFACE,prefixes:F.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:k.SURFACE,prefixes:F.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:k.SURFACE,prefixes:F.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:k.SURFACE,prefixes:F.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:k.SURFACE,prefixes:F.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:k.SURFACE,prefixes:F.NONE,value:1e4,offset:0},m3:{name:"m3",base:k.VOLUME,prefixes:F.CUBIC,value:1,offset:0},L:{name:"L",base:k.VOLUME,prefixes:F.SHORT,value:.001,offset:0},l:{name:"l",base:k.VOLUME,prefixes:F.SHORT,value:.001,offset:0},litre:{name:"litre",base:k.VOLUME,prefixes:F.LONG,value:.001,offset:0},cuin:{name:"cuin",base:k.VOLUME,prefixes:F.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:k.VOLUME,prefixes:F.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:k.VOLUME,prefixes:F.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:k.VOLUME,prefixes:F.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:k.VOLUME,prefixes:F.NONE,value:15e-6,offset:0},drop:{name:"drop",base:k.VOLUME,prefixes:F.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:k.VOLUME,prefixes:F.NONE,value:5e-8,offset:0},minim:{name:"minim",base:k.VOLUME,prefixes:F.NONE,value:6161152e-14,offset:0},fluiddram:{name:"fluiddram",base:k.VOLUME,prefixes:F.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:k.VOLUME,prefixes:F.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:k.VOLUME,prefixes:F.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:k.VOLUME,prefixes:F.NONE,value:1e-6,offset:0},cup:{name:"cup",base:k.VOLUME,prefixes:F.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:k.VOLUME,prefixes:F.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:k.VOLUME,prefixes:F.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:k.VOLUME,prefixes:F.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:k.VOLUME,prefixes:F.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:k.VOLUME,prefixes:F.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:k.VOLUME,prefixes:F.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:k.VOLUME,prefixes:F.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:k.VOLUME,prefixes:F.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:k.VOLUME,prefixes:F.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:k.VOLUME,prefixes:F.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:k.VOLUME,prefixes:F.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:k.VOLUME,prefixes:F.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:k.VOLUME,prefixes:F.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:k.VOLUME,prefixes:F.NONE,value:.1173478,offset:0},obl:{name:"obl",base:k.VOLUME,prefixes:F.NONE,value:.1589873,offset:0},g:{name:"g",base:k.MASS,prefixes:F.SHORT,value:.001,offset:0},gram:{name:"gram",base:k.MASS,prefixes:F.LONG,value:.001,offset:0},ton:{name:"ton",base:k.MASS,prefixes:F.SHORT,value:907.18474,offset:0},t:{name:"t",base:k.MASS,prefixes:F.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:k.MASS,prefixes:F.LONG,value:1e3,offset:0},grain:{name:"grain",base:k.MASS,prefixes:F.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:k.MASS,prefixes:F.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:k.MASS,prefixes:F.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:k.MASS,prefixes:F.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:k.MASS,prefixes:F.NONE,value:45.359237,offset:0},stick:{name:"stick",base:k.MASS,prefixes:F.NONE,value:.115,offset:0},stone:{name:"stone",base:k.MASS,prefixes:F.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:k.MASS,prefixes:F.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:k.MASS,prefixes:F.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:k.MASS,prefixes:F.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:k.MASS,prefixes:F.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:k.MASS,prefixes:F.NONE,value:45.359237,offset:0},s:{name:"s",base:k.TIME,prefixes:F.SHORT,value:1,offset:0},min:{name:"min",base:k.TIME,prefixes:F.NONE,value:60,offset:0},h:{name:"h",base:k.TIME,prefixes:F.NONE,value:3600,offset:0},second:{name:"second",base:k.TIME,prefixes:F.LONG,value:1,offset:0},sec:{name:"sec",base:k.TIME,prefixes:F.LONG,value:1,offset:0},minute:{name:"minute",base:k.TIME,prefixes:F.NONE,value:60,offset:0},hour:{name:"hour",base:k.TIME,prefixes:F.NONE,value:3600,offset:0},day:{name:"day",base:k.TIME,prefixes:F.NONE,value:86400,offset:0},week:{name:"week",base:k.TIME,prefixes:F.NONE,value:7*86400,offset:0},month:{name:"month",base:k.TIME,prefixes:F.NONE,value:2629800,offset:0},year:{name:"year",base:k.TIME,prefixes:F.NONE,value:31557600,offset:0},decade:{name:"decade",base:k.TIME,prefixes:F.NONE,value:315576e3,offset:0},century:{name:"century",base:k.TIME,prefixes:F.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:k.TIME,prefixes:F.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:k.FREQUENCY,prefixes:F.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:k.FREQUENCY,prefixes:F.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:k.ANGLE,prefixes:F.SHORT,value:1,offset:0},radian:{name:"radian",base:k.ANGLE,prefixes:F.LONG,value:1,offset:0},deg:{name:"deg",base:k.ANGLE,prefixes:F.SHORT,value:null,offset:0},degree:{name:"degree",base:k.ANGLE,prefixes:F.LONG,value:null,offset:0},grad:{name:"grad",base:k.ANGLE,prefixes:F.SHORT,value:null,offset:0},gradian:{name:"gradian",base:k.ANGLE,prefixes:F.LONG,value:null,offset:0},cycle:{name:"cycle",base:k.ANGLE,prefixes:F.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:k.ANGLE,prefixes:F.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:k.ANGLE,prefixes:F.NONE,value:null,offset:0},A:{name:"A",base:k.CURRENT,prefixes:F.SHORT,value:1,offset:0},ampere:{name:"ampere",base:k.CURRENT,prefixes:F.LONG,value:1,offset:0},K:{name:"K",base:k.TEMPERATURE,prefixes:F.SHORT,value:1,offset:0},degC:{name:"degC",base:k.TEMPERATURE,prefixes:F.SHORT,value:1,offset:273.15},degF:{name:"degF",base:k.TEMPERATURE,prefixes:F.SHORT,value:new v(5,9),offset:459.67},degR:{name:"degR",base:k.TEMPERATURE,prefixes:F.SHORT,value:new v(5,9),offset:0},kelvin:{name:"kelvin",base:k.TEMPERATURE,prefixes:F.LONG,value:1,offset:0},celsius:{name:"celsius",base:k.TEMPERATURE,prefixes:F.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:k.TEMPERATURE,prefixes:F.LONG,value:new v(5,9),offset:459.67},rankine:{name:"rankine",base:k.TEMPERATURE,prefixes:F.LONG,value:new v(5,9),offset:0},mol:{name:"mol",base:k.AMOUNT_OF_SUBSTANCE,prefixes:F.SHORT,value:1,offset:0},mole:{name:"mole",base:k.AMOUNT_OF_SUBSTANCE,prefixes:F.LONG,value:1,offset:0},cd:{name:"cd",base:k.LUMINOUS_INTENSITY,prefixes:F.SHORT,value:1,offset:0},candela:{name:"candela",base:k.LUMINOUS_INTENSITY,prefixes:F.LONG,value:1,offset:0},N:{name:"N",base:k.FORCE,prefixes:F.SHORT,value:1,offset:0},newton:{name:"newton",base:k.FORCE,prefixes:F.LONG,value:1,offset:0},dyn:{name:"dyn",base:k.FORCE,prefixes:F.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:k.FORCE,prefixes:F.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:k.FORCE,prefixes:F.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:k.FORCE,prefixes:F.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:k.FORCE,prefixes:F.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:k.FORCE,prefixes:F.NONE,value:9.80665,offset:0},J:{name:"J",base:k.ENERGY,prefixes:F.SHORT,value:1,offset:0},joule:{name:"joule",base:k.ENERGY,prefixes:F.LONG,value:1,offset:0},erg:{name:"erg",base:k.ENERGY,prefixes:F.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:k.ENERGY,prefixes:F.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:k.ENERGY,prefixes:F.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:k.ENERGY,prefixes:F.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:k.ENERGY,prefixes:F.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:k.POWER,prefixes:F.SHORT,value:1,offset:0},watt:{name:"watt",base:k.POWER,prefixes:F.LONG,value:1,offset:0},hp:{name:"hp",base:k.POWER,prefixes:F.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:k.POWER,prefixes:F.SHORT,value:h.I,offset:0},VA:{name:"VA",base:k.POWER,prefixes:F.SHORT,value:1,offset:0},Pa:{name:"Pa",base:k.PRESSURE,prefixes:F.SHORT,value:1,offset:0},psi:{name:"psi",base:k.PRESSURE,prefixes:F.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:k.PRESSURE,prefixes:F.NONE,value:101325,offset:0},bar:{name:"bar",base:k.PRESSURE,prefixes:F.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:k.PRESSURE,prefixes:F.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:k.PRESSURE,prefixes:F.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:k.PRESSURE,prefixes:F.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:k.PRESSURE,prefixes:F.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:k.ELECTRIC_CHARGE,prefixes:F.LONG,value:1,offset:0},C:{name:"C",base:k.ELECTRIC_CHARGE,prefixes:F.SHORT,value:1,offset:0},farad:{name:"farad",base:k.ELECTRIC_CAPACITANCE,prefixes:F.LONG,value:1,offset:0},F:{name:"F",base:k.ELECTRIC_CAPACITANCE,prefixes:F.SHORT,value:1,offset:0},volt:{name:"volt",base:k.ELECTRIC_POTENTIAL,prefixes:F.LONG,value:1,offset:0},V:{name:"V",base:k.ELECTRIC_POTENTIAL,prefixes:F.SHORT,value:1,offset:0},ohm:{name:"ohm",base:k.ELECTRIC_RESISTANCE,prefixes:F.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:k.ELECTRIC_INDUCTANCE,prefixes:F.LONG,value:1,offset:0},H:{name:"H",base:k.ELECTRIC_INDUCTANCE,prefixes:F.SHORT,value:1,offset:0},siemens:{name:"siemens",base:k.ELECTRIC_CONDUCTANCE,prefixes:F.LONG,value:1,offset:0},S:{name:"S",base:k.ELECTRIC_CONDUCTANCE,prefixes:F.SHORT,value:1,offset:0},weber:{name:"weber",base:k.MAGNETIC_FLUX,prefixes:F.LONG,value:1,offset:0},Wb:{name:"Wb",base:k.MAGNETIC_FLUX,prefixes:F.SHORT,value:1,offset:0},tesla:{name:"tesla",base:k.MAGNETIC_FLUX_DENSITY,prefixes:F.LONG,value:1,offset:0},T:{name:"T",base:k.MAGNETIC_FLUX_DENSITY,prefixes:F.SHORT,value:1,offset:0},b:{name:"b",base:k.BIT,prefixes:F.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:k.BIT,prefixes:F.BINARY_LONG,value:1,offset:0},B:{name:"B",base:k.BIT,prefixes:F.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:k.BIT,prefixes:F.BINARY_LONG,value:8,offset:0}},ue={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fluiddrams:"fluiddram",fluidounces:"fluidounce",gills:"gill",cups:"cup",pints:"pint",quarts:"quart",gallons:"gallon",beerbarrels:"beerbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function me(T){if(T.number==="BigNumber"){var z=Tl(w);V.rad.value=new w(1),V.deg.value=z.div(180),V.grad.value=z.div(200),V.cycle.value=z.times(2),V.arcsec.value=z.div(648e3),V.arcmin.value=z.div(10800)}else V.rad.value=1,V.deg.value=Math.PI/180,V.grad.value=Math.PI/200,V.cycle.value=Math.PI*2,V.arcsec.value=Math.PI/648e3,V.arcmin.value=Math.PI/10800;V.radian.value=V.rad.value,V.degree.value=V.deg.value,V.gradian.value=V.grad.value}me(r),t&&t("config",function(T,z){T.number!==z.number&&me(T)});var re={si:{NONE:{unit:K,prefix:F.NONE[""]},LENGTH:{unit:V.m,prefix:F.SHORT[""]},MASS:{unit:V.g,prefix:F.SHORT.k},TIME:{unit:V.s,prefix:F.SHORT[""]},CURRENT:{unit:V.A,prefix:F.SHORT[""]},TEMPERATURE:{unit:V.K,prefix:F.SHORT[""]},LUMINOUS_INTENSITY:{unit:V.cd,prefix:F.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:V.mol,prefix:F.SHORT[""]},ANGLE:{unit:V.rad,prefix:F.SHORT[""]},BIT:{unit:V.bits,prefix:F.SHORT[""]},FORCE:{unit:V.N,prefix:F.SHORT[""]},ENERGY:{unit:V.J,prefix:F.SHORT[""]},POWER:{unit:V.W,prefix:F.SHORT[""]},PRESSURE:{unit:V.Pa,prefix:F.SHORT[""]},ELECTRIC_CHARGE:{unit:V.C,prefix:F.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:V.F,prefix:F.SHORT[""]},ELECTRIC_POTENTIAL:{unit:V.V,prefix:F.SHORT[""]},ELECTRIC_RESISTANCE:{unit:V.ohm,prefix:F.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:V.H,prefix:F.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:V.S,prefix:F.SHORT[""]},MAGNETIC_FLUX:{unit:V.Wb,prefix:F.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:V.T,prefix:F.SHORT[""]},FREQUENCY:{unit:V.Hz,prefix:F.SHORT[""]}}};re.cgs=JSON.parse(JSON.stringify(re.si)),re.cgs.LENGTH={unit:V.m,prefix:F.SHORT.c},re.cgs.MASS={unit:V.g,prefix:F.SHORT[""]},re.cgs.FORCE={unit:V.dyn,prefix:F.SHORT[""]},re.cgs.ENERGY={unit:V.erg,prefix:F.NONE[""]},re.us=JSON.parse(JSON.stringify(re.si)),re.us.LENGTH={unit:V.ft,prefix:F.NONE[""]},re.us.MASS={unit:V.lbm,prefix:F.NONE[""]},re.us.TEMPERATURE={unit:V.degF,prefix:F.NONE[""]},re.us.FORCE={unit:V.lbf,prefix:F.NONE[""]},re.us.ENERGY={unit:V.BTU,prefix:F.BTU[""]},re.us.POWER={unit:V.hp,prefix:F.NONE[""]},re.us.PRESSURE={unit:V.psi,prefix:F.NONE[""]},re.auto=JSON.parse(JSON.stringify(re.si));var ae=re.auto;g.setUnitSystem=function(T){if(Me(re,T))ae=re[T];else throw new Error("Unit system "+T+" does not exist. Choices are: "+Object.keys(re).join(", "))},g.getUnitSystem=function(){for(var T in re)if(Me(re,T)&&re[T]===ae)return T},g.typeConverters={BigNumber:function(T){return T!=null&&T.isFraction?new w(T.n).div(T.d).times(T.s):new w(T+"")},Fraction:function(T){return new v(T)},Complex:function(T){return T},number:function(T){return T!=null&&T.isFraction?d(T):T}},g.prototype._numberConverter=function(){var T=g.typeConverters[this.valueType()];if(T)return T;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},g._getNumberConverter=function(T){if(!g.typeConverters[T])throw new TypeError('Unsupported type "'+T+'"');return g.typeConverters[T]};for(var de in V)if(Me(V,de)){var ne=V[de];ne.dimensions=ne.base.dimensions}for(var ce in ue)if(Me(ue,ce)){var le=V[ue[ce]],he={};for(var xe in le)Me(le,xe)&&(he[xe]=le[xe]);he.name=ce,V[ce]=he}g.isValidAlpha=function(T){return/^[a-zA-Z]$/.test(T)};function $(T){for(var z=0;z<T.length;z++){if(N=T.charAt(z),z===0&&!g.isValidAlpha(N))throw new Error('Invalid unit name (must begin with alpha character): "'+T+'"');if(z>0&&!(g.isValidAlpha(N)||D(N)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+T+'"')}}return g.createUnit=function(T,z){if(typeof T!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(z&&z.override){for(var J in T)if(Me(T,J)&&g.deleteUnit(J),T[J].aliases)for(var L=0;L<T[J].aliases.length;L++)g.deleteUnit(T[J].aliases[L])}var H;for(var G in T)Me(T,G)&&(H=g.createUnitSingle(G,T[G]));return H},g.createUnitSingle=function(T,z){if((typeof z>"u"||z===null)&&(z={}),typeof T!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(Me(V,T))throw new Error('Cannot create unit "'+T+'": a unit with that name already exists');$(T);var J=null,L=[],H=0,G,Y,ee;if(z&&z.type==="Unit")J=z.clone();else if(typeof z=="string")z!==""&&(G=z);else if(typeof z=="object")G=z.definition,Y=z.prefixes,H=z.offset,ee=z.baseName,z.aliases&&(L=z.aliases.valueOf());else throw new TypeError('Cannot create unit "'+T+'" from "'+z.toString()+'": expecting "string" or "Unit" or "Object"');if(L){for(var B=0;B<L.length;B++)if(Me(V,L[B]))throw new Error('Cannot create alias "'+L[B]+'": a unit with that name already exists')}if(G&&typeof G=="string"&&!J)try{J=g.parse(G,{allowNoUnits:!0})}catch(M){throw M.message='Could not create unit "'+T+'" from "'+G+'": '+M.message,M}else G&&G.type==="Unit"&&(J=G.clone());L=L||[],H=H||0,Y&&Y.toUpperCase?Y=F[Y.toUpperCase()]||F.NONE:Y=F.NONE;var j={};if(J){j={name:T,value:J.value,dimensions:J.dimensions.slice(0),prefixes:Y,offset:H};var Q=!1;for(var Z in k)if(Me(k,Z)){for(var ie=!0,oe=0;oe<q.length;oe++)if(Math.abs((j.dimensions[oe]||0)-(k[Z].dimensions[oe]||0))>1e-12){ie=!1;break}if(ie){Q=!0,j.base=k[Z];break}}if(!Q){ee=ee||T+"_STUFF";var ye={dimensions:J.dimensions.slice(0)};ye.key=ee,k[ee]=ye,ae[ee]={unit:j,prefix:F.NONE[""]},j.base=k[ee]}}else{if(ee=ee||T+"_STUFF",q.indexOf(ee)>=0)throw new Error('Cannot create new base unit "'+T+'": a base unit with that name already exists (and cannot be overridden)');q.push(ee);for(var fe in k)Me(k,fe)&&(k[fe].dimensions[q.length-1]=0);for(var De={dimensions:[]},Ne=0;Ne<q.length;Ne++)De.dimensions[Ne]=0;De.dimensions[q.length-1]=1,De.key=ee,k[ee]=De,j={name:T,value:1,dimensions:k[ee].dimensions.slice(0),prefixes:Y,offset:H,base:k[ee]},ae[ee]={unit:j,prefix:F.NONE[""]}}g.UNITS[T]=j;for(var je=0;je<L.length;je++){var Ze=L[je],_e={};for(var wt in j)Me(j,wt)&&(_e[wt]=j[wt]);_e.name=Ze,g.UNITS[Ze]=_e}return delete I.cache,new g(null,T)},g.deleteUnit=function(T){delete g.UNITS[T],delete I.cache},g.PREFIXES=F,g.BASE_DIMENSIONS=q,g.BASE_UNITS=k,g.UNIT_SYSTEMS=re,g.UNITS=V,g},{isClass:!0}),dd="unit",$_=["typed","Unit"],H_=U(dd,$_,e=>{var{typed:t,Unit:r}=e;return t(dd,{Unit:function(n){return n.clone()},string:function(n){return r.isValuelessUnit(n)?new r(null,n):r.parse(n,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(n,i){return new r(n,i)},"number | BigNumber | Fraction":function(n){return new r(n)},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))})}),hd="sparse",J_=["typed","SparseMatrix"],G_=U(hd,J_,e=>{var{typed:t,SparseMatrix:r}=e;return t(hd,{"":function(){return new r([])},string:function(n){return new r([],n)},"Array | Matrix":function(n){return new r(n)},"Array | Matrix, string":function(n,i){return new r(n,i)}})}),gd="createUnit",W_=["typed","Unit"],K_=U(gd,W_,e=>{var{typed:t,Unit:r}=e;return t(gd,{"Object, Object":function(n,i){return r.createUnit(n,i)},Object:function(n){return r.createUnit(n,{})},"string, Unit | string | Object, Object":function(n,i,a){var o={};return o[n]=i,r.createUnit(o,a)},"string, Unit | string | Object":function(n,i){var a={};return a[n]=i,r.createUnit(a,{})},string:function(n){var i={};return i[n]={},r.createUnit(i,{})}})}),vd="acos",Q_=["typed","config","Complex"],Z_=U(vd,Q_,e=>{var{typed:t,config:r,Complex:n}=e;return t(vd,{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()}})}),yd="acosh",X_=["typed","config","Complex"],Y_=U(yd,X_,e=>{var{typed:t,config:r,Complex:n}=e;return t(yd,{number:function(i){return i>=1||r.predictable?Xv(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()}})}),bd="acot",e3=["typed","BigNumber"],t3=U(bd,e3,e=>{var{typed:t,BigNumber:r}=e;return t(bd,{number:Yv,Complex:function(n){return n.acot()},BigNumber:function(n){return new r(1).div(n).atan()}})}),xd="acoth",r3=["typed","config","Complex","BigNumber"],n3=U(xd,r3,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(xd,{number:function(a){return a>=1||a<=-1||r.predictable?ey(a):new n(a,0).acoth()},Complex:function(a){return a.acoth()},BigNumber:function(a){return new i(1).div(a).atanh()}})}),wd="acsc",i3=["typed","config","Complex","BigNumber"],a3=U(wd,i3,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(wd,{number:function(a){return a<=-1||a>=1||r.predictable?ty(a):new n(a,0).acsc()},Complex:function(a){return a.acsc()},BigNumber:function(a){return new i(1).div(a).asin()}})}),Nd="acsch",o3=["typed","BigNumber"],s3=U(Nd,o3,e=>{var{typed:t,BigNumber:r}=e;return t(Nd,{number:ry,Complex:function(n){return n.acsch()},BigNumber:function(n){return new r(1).div(n).asinh()}})}),Dd="asec",u3=["typed","config","Complex","BigNumber"],c3=U(Dd,u3,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(Dd,{number:function(a){return a<=-1||a>=1||r.predictable?ny(a):new n(a,0).asec()},Complex:function(a){return a.asec()},BigNumber:function(a){return new i(1).div(a).acos()}})}),Ed="asech",l3=["typed","config","Complex","BigNumber"],f3=U(Ed,l3,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(Ed,{number:function(a){if(a<=1&&a>=-1||r.predictable){var o=1/a;if(o>0||r.predictable)return iy(a);var u=Math.sqrt(o*o-1);return new n(Math.log(u-o),Math.PI)}return new n(a,0).asech()},Complex:function(a){return a.asech()},BigNumber:function(a){return new i(1).div(a).acosh()}})}),Ad="asin",p3=["typed","config","Complex"],m3=U(Ad,p3,e=>{var{typed:t,config:r,Complex:n}=e;return t(Ad,{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()}})}),d3="asinh",h3=["typed"],g3=U(d3,h3,e=>{var{typed:t}=e;return t("asinh",{number:ay,Complex:function(r){return r.asinh()},BigNumber:function(r){return r.asinh()}})}),v3="atan",y3=["typed"],b3=U(v3,y3,e=>{var{typed:t}=e;return t("atan",{number:function(r){return Math.atan(r)},Complex:function(r){return r.atan()},BigNumber:function(r){return r.atan()}})}),Sd="atan2",x3=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],w3=U(Sd,x3,e=>{var{typed:t,matrix:r,equalScalar:n,BigNumber:i,DenseMatrix:a,concat:o}=e,u=Gr({typed:t,equalScalar:n}),c=cr({typed:t}),l=xy({typed:t,equalScalar:n}),s=Jt({typed:t,equalScalar:n}),f=It({typed:t,DenseMatrix:a}),p=gt({typed:t,matrix:r,concat:o});return t(Sd,{"number, number":Math.atan2,"BigNumber, BigNumber":(m,d)=>i.atan2(m,d)},p({scalar:"number | BigNumber",SS:l,DS:c,SD:u,Ss:s,sS:f}))}),Cd="atanh",N3=["typed","config","Complex"],D3=U(Cd,N3,e=>{var{typed:t,config:r,Complex:n}=e;return t(Cd,{number:function(i){return i<=1&&i>=-1||r.predictable?oy(i):new n(i,0).atanh()},Complex:function(i){return i.atanh()},BigNumber:function(i){return i.atanh()}})}),_a=U("trigUnit",["typed"],e=>{var{typed:t}=e;return{Unit:t.referToSelf(r=>n=>{if(!n.hasBase(n.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return t.find(r,n.valueType())(n.value)})}}),Md="cos",E3=["typed"],A3=U(Md,E3,e=>{var{typed:t}=e,r=_a({typed:t});return t(Md,{number:Math.cos,"Complex | BigNumber":n=>n.cos()},r)}),_d="cosh",S3=["typed"],C3=U(_d,S3,e=>{var{typed:t}=e;return t(_d,{number:NN,"Complex | BigNumber":r=>r.cosh()})}),Fd="cot",M3=["typed","BigNumber"],_3=U(Fd,M3,e=>{var{typed:t,BigNumber:r}=e,n=_a({typed:t});return t(Fd,{number:sy,Complex:i=>i.cot(),BigNumber:i=>new r(1).div(i.tan())},n)}),Td="coth",F3=["typed","BigNumber"],T3=U(Td,F3,e=>{var{typed:t,BigNumber:r}=e;return t(Td,{number:uy,Complex:n=>n.coth(),BigNumber:n=>new r(1).div(n.tanh())})}),Od="csc",O3=["typed","BigNumber"],B3=U(Od,O3,e=>{var{typed:t,BigNumber:r}=e,n=_a({typed:t});return t(Od,{number:cy,Complex:i=>i.csc(),BigNumber:i=>new r(1).div(i.sin())},n)}),Bd="csch",k3=["typed","BigNumber"],I3=U(Bd,k3,e=>{var{typed:t,BigNumber:r}=e;return t(Bd,{number:ly,Complex:n=>n.csch(),BigNumber:n=>new r(1).div(n.sinh())})}),kd="sec",R3=["typed","BigNumber"],q3=U(kd,R3,e=>{var{typed:t,BigNumber:r}=e,n=_a({typed:t});return t(kd,{number:fy,Complex:i=>i.sec(),BigNumber:i=>new r(1).div(i.cos())},n)}),Id="sech",z3=["typed","BigNumber"],j3=U(Id,z3,e=>{var{typed:t,BigNumber:r}=e;return t(Id,{number:py,Complex:n=>n.sech(),BigNumber:n=>new r(1).div(n.cosh())})}),Rd="sin",L3=["typed"],P3=U(Rd,L3,e=>{var{typed:t}=e,r=_a({typed:t});return t(Rd,{number:Math.sin,"Complex | BigNumber":n=>n.sin()},r)}),qd="sinh",V3=["typed"],U3=U(qd,V3,e=>{var{typed:t}=e;return t(qd,{number:my,"Complex | BigNumber":r=>r.sinh()})}),zd="tan",$3=["typed"],H3=U(zd,$3,e=>{var{typed:t}=e,r=_a({typed:t});return t(zd,{number:Math.tan,"Complex | BigNumber":n=>n.tan()},r)}),J3="tanh",G3=["typed"],W3=U(J3,G3,e=>{var{typed:t}=e;return t("tanh",{number:EN,"Complex | BigNumber":r=>r.tanh()})}),jd="setCartesian",K3=["typed","size","subset","compareNatural","Index","DenseMatrix"],Q3=U(jd,K3,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(jd,{"Array | Matrix, Array | Matrix":function(u,c){var l=[];if(n(r(u),new a(0))!==0&&n(r(c),new a(0))!==0){var s=ot(Array.isArray(u)?u:u.toArray()).sort(i),f=ot(Array.isArray(c)?c:c.toArray()).sort(i);l=[];for(var p=0;p<s.length;p++)for(var m=0;m<f.length;m++)l.push([s[p],f[m]])}return Array.isArray(u)&&Array.isArray(c)?l:new o(l)}})}),Ld="setDifference",Z3=["typed","size","subset","compareNatural","Index","DenseMatrix"],X3=U(Ld,Z3,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(Ld,{"Array | Matrix, Array | Matrix":function(u,c){var l;if(n(r(u),new a(0))===0)l=[];else{if(n(r(c),new a(0))===0)return ot(u.toArray());var s=ga(ot(Array.isArray(u)?u:u.toArray()).sort(i)),f=ga(ot(Array.isArray(c)?c:c.toArray()).sort(i));l=[];for(var p,m=0;m<s.length;m++){p=!1;for(var d=0;d<f.length;d++)if(i(s[m].value,f[d].value)===0&&s[m].identifier===f[d].identifier){p=!0;break}p||l.push(s[m])}}return Array.isArray(u)&&Array.isArray(c)?Rs(l):new o(Rs(l))}})}),Pd="setDistinct",Y3=["typed","size","subset","compareNatural","Index","DenseMatrix"],e4=U(Pd,Y3,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(Pd,{"Array | Matrix":function(u){var c;if(n(r(u),new a(0))===0)c=[];else{var l=ot(Array.isArray(u)?u:u.toArray()).sort(i);c=[],c.push(l[0]);for(var s=1;s<l.length;s++)i(l[s],l[s-1])!==0&&c.push(l[s])}return Array.isArray(u)?c:new o(c)}})}),Vd="setIntersect",t4=["typed","size","subset","compareNatural","Index","DenseMatrix"],r4=U(Vd,t4,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(Vd,{"Array | Matrix, Array | Matrix":function(u,c){var l;if(n(r(u),new a(0))===0||n(r(c),new a(0))===0)l=[];else{var s=ga(ot(Array.isArray(u)?u:u.toArray()).sort(i)),f=ga(ot(Array.isArray(c)?c:c.toArray()).sort(i));l=[];for(var p=0;p<s.length;p++)for(var m=0;m<f.length;m++)if(i(s[p].value,f[m].value)===0&&s[p].identifier===f[m].identifier){l.push(s[p]);break}}return Array.isArray(u)&&Array.isArray(c)?Rs(l):new o(Rs(l))}})}),Ud="setIsSubset",n4=["typed","size","subset","compareNatural","Index"],i4=U(Ud,n4,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a}=e;return t(Ud,{"Array | Matrix, Array | Matrix":function(o,u){if(n(r(o),new a(0))===0)return!0;if(n(r(u),new a(0))===0)return!1;for(var c=ga(ot(Array.isArray(o)?o:o.toArray()).sort(i)),l=ga(ot(Array.isArray(u)?u:u.toArray()).sort(i)),s,f=0;f<c.length;f++){s=!1;for(var p=0;p<l.length;p++)if(i(c[f].value,l[p].value)===0&&c[f].identifier===l[p].identifier){s=!0;break}if(s===!1)return!1}return!0}})}),$d="setMultiplicity",a4=["typed","size","subset","compareNatural","Index"],o4=U($d,a4,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a}=e;return t($d,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(o,u){if(n(r(u),new a(0))===0)return 0;for(var c=ot(Array.isArray(u)?u:u.toArray()),l=0,s=0;s<c.length;s++)i(c[s],o)===0&&l++;return l}})}),Hd="setPowerset",s4=["typed","size","subset","compareNatural","Index"],u4=U(Hd,s4,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:a}=e;return t(Hd,{"Array | Matrix":function(c){if(n(r(c),new a(0))===0)return[];for(var l=ot(Array.isArray(c)?c:c.toArray()).sort(i),s=[],f=0;f.toString(2).length<=l.length;)s.push(o(l,f.toString(2).split("").reverse())),f++;return u(s)}});function o(c,l){for(var s=[],f=0;f<l.length;f++)l[f]==="1"&&s.push(c[f]);return s}function u(c){for(var l=[],s=c.length-1;s>0;s--)for(var f=0;f<s;f++)c[f].length>c[f+1].length&&(l=c[f],c[f]=c[f+1],c[f+1]=l);return c}}),Jd="setSize",c4=["typed","compareNatural"],l4=U(Jd,c4,e=>{var{typed:t,compareNatural:r}=e;return t(Jd,{"Array | Matrix":function(n){return Array.isArray(n)?ot(n).length:ot(n.toArray()).length},"Array | Matrix, boolean":function(n,i){if(i===!1||n.length===0)return Array.isArray(n)?ot(n).length:ot(n.toArray()).length;for(var a=ot(Array.isArray(n)?n:n.toArray()).sort(r),o=1,u=1;u<a.length;u++)r(a[u],a[u-1])!==0&&o++;return o}})}),Gd="setSymDifference",f4=["typed","size","concat","subset","setDifference","Index"],p4=U(Gd,f4,e=>{var{typed:t,size:r,concat:n,subset:i,setDifference:a,Index:o}=e;return t(Gd,{"Array | Matrix, Array | Matrix":function(u,c){if(i(r(u),new o(0))===0)return ot(c);if(i(r(c),new o(0))===0)return ot(u);var l=ot(u),s=ot(c);return n(a(l,s),a(s,l))}})}),Wd="setUnion",m4=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],d4=U(Wd,m4,e=>{var{typed:t,size:r,concat:n,subset:i,setIntersect:a,setSymDifference:o,Index:u}=e;return t(Wd,{"Array | Matrix, Array | Matrix":function(c,l){if(i(r(c),new u(0))===0)return ot(l);if(i(r(l),new u(0))===0)return ot(c);var s=ot(c),f=ot(l);return n(o(s,f),a(s,f))}})}),Kd="add",h4=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],g4=U(Kd,h4,e=>{var{typed:t,matrix:r,addScalar:n,equalScalar:i,DenseMatrix:a,SparseMatrix:o,concat:u}=e,c=ii({typed:t}),l=Sl({typed:t,equalScalar:i}),s=zi({typed:t,DenseMatrix:a}),f=gt({typed:t,matrix:r,concat:u});return t(Kd,{"any, any":n,"any, any, ...any":t.referToSelf(p=>(m,d,h)=>{for(var w=p(m,d),v=0;v<h.length;v++)w=p(w,h[v]);return w})},f({elop:n,DS:c,SS:l,Ss:s}))}),Qd="hypot",v4=["typed","abs","addScalar","divideScalar","multiplyScalar","sqrt","smaller","isPositive"],y4=U(Qd,v4,e=>{var{typed:t,abs:r,addScalar:n,divideScalar:i,multiplyScalar:a,sqrt:o,smaller:u,isPositive:c}=e;return t(Qd,{"... number | BigNumber":l,Array:l,Matrix:s=>l(ot(s.toArray()))});function l(s){for(var f=0,p=0,m=0;m<s.length;m++){if(wn(s[m]))throw new TypeError("Unexpected type of argument to hypot");var d=r(s[m]);u(p,d)?(f=a(f,a(i(p,d),i(p,d))),f=n(f,1),p=d):f=n(f,c(d)?a(i(d,p),i(d,p)):d)}return a(p,o(f))}}),Zd="norm",b4=["typed","abs","add","pow","conj","sqrt","multiply","equalScalar","larger","smaller","matrix","ctranspose","eigs"],x4=U(Zd,b4,e=>{var{typed:t,abs:r,add:n,pow:i,conj:a,sqrt:o,multiply:u,equalScalar:c,larger:l,smaller:s,matrix:f,ctranspose:p,eigs:m}=e;return t(Zd,{number:Math.abs,Complex:function(E){return E.abs()},BigNumber:function(E){return E.abs()},boolean:function(E){return Math.abs(E)},Array:function(E){return N(f(E),2)},Matrix:function(E){return N(E,2)},"Array, number | BigNumber | string":function(E,A){return N(f(E),A)},"Matrix, number | BigNumber | string":function(E,A){return N(E,A)}});function d(E){var A=0;return E.forEach(function(D){var S=r(D);l(S,A)&&(A=S)},!0),A}function h(E){var A;return E.forEach(function(D){var S=r(D);(!A||s(S,A))&&(A=S)},!0),A||0}function w(E,A){if(A===Number.POSITIVE_INFINITY||A==="inf")return d(E);if(A===Number.NEGATIVE_INFINITY||A==="-inf")return h(E);if(A==="fro")return N(E,2);if(typeof A=="number"&&!isNaN(A)){if(!c(A,0)){var D=0;return E.forEach(function(S){D=n(i(r(S),A),D)},!0),i(D,1/A)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function v(E){var A=0;return E.forEach(function(D,S){A=n(A,u(D,a(D)))}),r(o(A))}function x(E){var A=[],D=0;return E.forEach(function(S,C){var _=C[1],R=n(A[_]||0,r(S));l(R,D)&&(D=R),A[_]=R},!0),D}function g(E){var A=E.size();if(A[0]!==A[1])throw new RangeError("Invalid matrix dimensions");var D=p(E),S=u(D,E),C=m(S).values.toArray(),_=C[C.length-1];return r(o(_))}function b(E){var A=[],D=0;return E.forEach(function(S,C){var _=C[0],R=n(A[_]||0,r(S));l(R,D)&&(D=R),A[_]=R},!0),D}function y(E,A){if(A===1)return x(E);if(A===Number.POSITIVE_INFINITY||A==="inf")return b(E);if(A==="fro")return v(E);if(A===2)return g(E);throw new Error("Unsupported parameter value "+A)}function N(E,A){var D=E.size();if(D.length===1)return w(E,A);if(D.length===2){if(D[0]&&D[1])return y(E,A);throw new RangeError("Invalid matrix dimensions")}}}),Xd="dot",w4=["typed","addScalar","multiplyScalar","conj","size"],N4=U(Xd,w4,e=>{var{typed:t,addScalar:r,multiplyScalar:n,conj:i,size:a}=e;return t(Xd,{"Array | DenseMatrix, Array | DenseMatrix":u,"SparseMatrix, SparseMatrix":c});function o(s,f){var p=l(s),m=l(f),d,h;if(p.length===1)d=p[0];else if(p.length===2&&p[1]===1)d=p[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+p.join(", ")+")");if(m.length===1)h=m[0];else if(m.length===2&&m[1]===1)h=m[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+m.join(", ")+")");if(d!==h)throw new RangeError("Vectors must have equal length ("+d+" != "+h+")");if(d===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return d}function u(s,f){var p=o(s,f),m=ke(s)?s._data:s,d=ke(s)?s._datatype||s.getDataType():void 0,h=ke(f)?f._data:f,w=ke(f)?f._datatype||f.getDataType():void 0,v=l(s).length===2,x=l(f).length===2,g=r,b=n;if(d&&w&&d===w&&typeof d=="string"&&d!=="mixed"){var y=d;g=t.find(r,[y,y]),b=t.find(n,[y,y])}if(!v&&!x){for(var N=b(i(m[0]),h[0]),E=1;E<p;E++)N=g(N,b(i(m[E]),h[E]));return N}if(!v&&x){for(var A=b(i(m[0]),h[0][0]),D=1;D<p;D++)A=g(A,b(i(m[D]),h[D][0]));return A}if(v&&!x){for(var S=b(i(m[0][0]),h[0]),C=1;C<p;C++)S=g(S,b(i(m[C][0]),h[C]));return S}if(v&&x){for(var _=b(i(m[0][0]),h[0][0]),R=1;R<p;R++)_=g(_,b(i(m[R][0]),h[R][0]));return _}}function c(s,f){o(s,f);for(var p=s._index,m=s._values,d=f._index,h=f._values,w=0,v=r,x=n,g=0,b=0;g<p.length&&b<d.length;){var y=p[g],N=d[b];if(y<N){g++;continue}if(y>N){b++;continue}y===N&&(w=v(w,x(m[g],h[b])),g++,b++)}return w}function l(s){return ke(s)?s.size():a(s)}}),D4="trace",E4=["typed","matrix","add"],A4=U(D4,E4,e=>{var{typed:t,matrix:r,add:n}=e;return t("trace",{Array:function(o){return i(r(o))},SparseMatrix:a,DenseMatrix:i,any:ze});function i(o){var u=o._size,c=o._data;switch(u.length){case 1:if(u[0]===1)return ze(c[0]);throw new RangeError("Matrix must be square (size: "+Ge(u)+")");case 2:{var l=u[0],s=u[1];if(l===s){for(var f=0,p=0;p<l;p++)f=n(f,c[p][p]);return f}else throw new RangeError("Matrix must be square (size: "+Ge(u)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ge(u)+")")}}function a(o){var u=o._values,c=o._index,l=o._ptr,s=o._size,f=s[0],p=s[1];if(f===p){var m=0;if(u.length>0)for(var d=0;d<p;d++)for(var h=l[d],w=l[d+1],v=h;v<w;v++){var x=c[v];if(x===d){m=n(m,u[v]);break}if(x>d)break}return m}throw new RangeError("Matrix must be square (size: "+Ge(s)+")")}}),Yd="index",S4=["typed","Index"],C4=U(Yd,S4,e=>{var{typed:t,Index:r}=e;return t(Yd,{"...number | string | BigNumber | Range | Array | Matrix":function(n){var i=n.map(function(o){return $e(o)?o.toNumber():st(o)||ke(o)?o.map(function(u){return $e(u)?u.toNumber():u}):o}),a=new r;return r.apply(a,i),a}})}),qy=new Set(["end"]),M4="Node",_4=["mathWithTransform"],F4=U(M4,_4,e=>{var{mathWithTransform:t}=e;function r(i){for(var a of[...qy])if(i.has(a))throw new Error('Scope contains an illegal symbol, "'+a+'" is a reserved keyword')}class n{get type(){return"Node"}get isNode(){return!0}evaluate(a){return this.compile().evaluate(a)}compile(){var a=this._compile(t,{}),o={},u=null;function c(l){var s=aa(l);return r(s),a(s,o,u)}return{evaluate:c}}_compile(a,o){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(a){throw new Error("Cannot run forEach on a Node interface")}map(a){throw new Error("Cannot run map on a Node interface")}_ifNode(a){if(!ft(a))throw new TypeError("Callback function must return a Node");return a}traverse(a){a(this,null,null);function o(u,c){u.forEach(function(l,s,f){c(l,s,f),o(l,c)})}o(this,a)}transform(a){function o(u,c,l){var s=a(u,c,l);return s!==u?s:u.map(o)}return o(this,null,null)}filter(a){var o=[];return this.traverse(function(u,c,l){a(u,c,l)&&o.push(u)}),o}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(a){return a.cloneDeep()})}equals(a){return a?this.type===a.type&&Oi(this,a):!1}toString(a){var o=this._getCustomString(a);return typeof o<"u"?o:this._toString(a)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(a){var o=this._getCustomString(a);return typeof o<"u"?o:this._toHTML(a)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(a){var o=this._getCustomString(a);return typeof o<"u"?o:this._toTex(a)}_toTex(a){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(a){if(a&&typeof a=="object")switch(typeof a.handler){case"object":case"undefined":return;case"function":return a.handler(this,a);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}return n},{isClass:!0,isNode:!0});function lr(e){return e&&e.isIndexError?new $r(e.index+1,e.min+1,e.max!==void 0?e.max+1:void 0):e}function zy(e){var{subset:t}=e;return function(r,n){try{if(Array.isArray(r))return t(r,n);if(r&&typeof r.subset=="function")return r.subset(n);if(typeof r=="string")return t(r,n);if(typeof r=="object"){if(!n.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return nr(r,n.getObjectProperty())}else throw new TypeError("Cannot apply index: unsupported type of object")}catch(i){throw lr(i)}}}var Ho="AccessorNode",T4=["subset","Node"],O4=U(Ho,T4,e=>{var{subset:t,Node:r}=e,n=zy({subset:t});function i(o){return!(Ti(o)||Sr(o)||nt(o)||Zn(o)||mu(o)||An(o)||zt(o))}class a extends r{constructor(u,c){if(super(),!ft(u))throw new TypeError('Node expected for parameter "object"');if(!Da(c))throw new TypeError('IndexNode expected for parameter "index"');this.object=u,this.index=c}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return Ho}get isAccessorNode(){return!0}_compile(u,c){var l=this.object._compile(u,c),s=this.index._compile(u,c);if(this.index.isObjectProperty()){var f=this.index.getObjectProperty();return function(p,m,d){return nr(l(p,m,d),f)}}else return function(p,m,d){var h=l(p,m,d),w=s(p,m,h);return n(h,w)}}forEach(u){u(this.object,"object",this),u(this.index,"index",this)}map(u){return new a(this._ifNode(u(this.object,"object",this)),this._ifNode(u(this.index,"index",this)))}clone(){return new a(this.object,this.index)}_toString(u){var c=this.object.toString(u);return i(this.object)&&(c="("+c+")"),c+this.index.toString(u)}_toHTML(u){var c=this.object.toHTML(u);return i(this.object)&&(c='<span class="math-parenthesis math-round-parenthesis">(</span>'+c+'<span class="math-parenthesis math-round-parenthesis">)</span>'),c+this.index.toHTML(u)}_toTex(u){var c=this.object.toTex(u);return i(this.object)&&(c="\\left(' + object + '\\right)"),c+this.index.toTex(u)}toJSON(){return{mathjs:Ho,object:this.object,index:this.index}}static fromJSON(u){return new a(u.object,u.index)}}return Bt(a,"name",Ho),a},{isClass:!0,isNode:!0}),Jo="ArrayNode",B4=["Node"],k4=U(Jo,B4,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),this.items=i||[],!Array.isArray(this.items)||!this.items.every(ft))throw new TypeError("Array containing Nodes expected")}get type(){return Jo}get isArrayNode(){return!0}_compile(i,a){var o=Nn(this.items,function(l){return l._compile(i,a)}),u=i.config.matrix!=="Array";if(u){var c=i.matrix;return function(l,s,f){return c(Nn(o,function(p){return p(l,s,f)}))}}else return function(l,s,f){return Nn(o,function(p){return p(l,s,f)})}}forEach(i){for(var a=0;a<this.items.length;a++){var o=this.items[a];i(o,"items["+a+"]",this)}}map(i){for(var a=[],o=0;o<this.items.length;o++)a[o]=this._ifNode(i(this.items[o],"items["+o+"]",this));return new r(a)}clone(){return new r(this.items.slice(0))}_toString(i){var a=this.items.map(function(o){return o.toString(i)});return"["+a.join(", ")+"]"}toJSON(){return{mathjs:Jo,items:this.items}}static fromJSON(i){return new r(i.items)}_toHTML(i){var a=this.items.map(function(o){return o.toHTML(i)});return'<span class="math-parenthesis math-square-parenthesis">[</span>'+a.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'}_toTex(i){function a(o,u){var c=o.some(Sr)&&!o.every(Sr),l=u||c,s=l?"&":"\\\\",f=o.map(function(p){return p.items?a(p.items,!u):p.toTex(i)}).join(s);return c||!l||l&&!u?"\\begin{bmatrix}"+f+"\\end{bmatrix}":f}return a(this.items,!1)}}return Bt(r,"name",Jo),r},{isClass:!0,isNode:!0});function I4(e){var{subset:t,matrix:r}=e;return function(n,i,a){try{if(Array.isArray(n)){var o=r(n).subset(i,a).valueOf();return o.forEach((u,c)=>{n[c]=u}),n}else{if(n&&typeof n.subset=="function")return n.subset(i,a);if(typeof n=="string")return t(n,i,a);if(typeof n=="object"){if(!i.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return pa(n,i.getObjectProperty(),a),n}else throw new TypeError("Cannot apply index: unsupported type of object")}}catch(u){throw lr(u)}}}var Ir=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function Go(e,t){if(!t||t!=="auto")return e;for(var r=e;An(r);)r=r.content;return r}function mt(e,t,r,n){var i=e;t!=="keep"&&(i=e.getContent());for(var a=i.getIdentifier(),o=null,u=0;u<Ir.length;u++)if(a in Ir[u]){o=u;break}if(a==="OperatorNode:multiply"&&i.implicit&&r!=="show"){var c=Go(i.args[0],t);!(nt(c)&&n&&n.getIdentifier()==="OperatorNode:divide"&&Fc(Go(n.args[0],t)))&&!(c.getIdentifier()==="OperatorNode:divide"&&Fc(Go(c.args[0],t))&&nt(Go(c.args[1])))&&(o+=1)}return o}function Ha(e,t){var r=e;t!=="keep"&&(r=e.getContent());var n=r.getIdentifier(),i=mt(r,t);if(i===null)return null;var a=Ir[i][n];if(Me(a,"associativity")){if(a.associativity==="left")return"left";if(a.associativity==="right")return"right";throw Error("'"+n+"' has the invalid associativity '"+a.associativity+"'.")}return null}function pc(e,t,r){var n=r!=="keep"?e.getContent():e,i=r!=="keep"?e.getContent():t,a=n.getIdentifier(),o=i.getIdentifier(),u=mt(n,r);if(u===null)return null;var c=Ir[u][a];if(Me(c,"associativeWith")&&c.associativeWith instanceof Array){for(var l=0;l<c.associativeWith.length;l++)if(c.associativeWith[l]===o)return!0;return!1}return null}function R4(e){var t="OperatorNode:"+e;for(var r of Ir)if(t in r)return r[t].op;return null}var Wo="AssignmentNode",q4=["subset","?matrix","Node"],z4=U(Wo,q4,e=>{var{subset:t,matrix:r,Node:n}=e,i=zy({subset:t}),a=I4({subset:t,matrix:r});function o(c,l,s){l||(l="keep");var f=mt(c,l,s),p=mt(c.value,l,s);return l==="all"||p!==null&&p<=f}class u extends n{constructor(l,s,f){if(super(),this.object=l,this.index=f?s:null,this.value=f||s,!zt(l)&&!Ti(l))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(zt(l)&&l.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!Da(this.index))throw new TypeError('IndexNode expected as "index"');if(!ft(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 Wo}get isAssignmentNode(){return!0}_compile(l,s){var f=this.object._compile(l,s),p=this.index?this.index._compile(l,s):null,m=this.value._compile(l,s),d=this.object.name;if(this.index)if(this.index.isObjectProperty()){var h=this.index.getObjectProperty();return function(g,b,y){var N=f(g,b,y),E=m(g,b,y);return pa(N,h,E),E}}else{if(zt(this.object))return function(g,b,y){var N=f(g,b,y),E=m(g,b,y),A=p(g,b,N);return g.set(d,a(N,A,E)),E};var w=this.object.object._compile(l,s);if(this.object.index.isObjectProperty()){var v=this.object.index.getObjectProperty();return function(g,b,y){var N=w(g,b,y),E=nr(N,v),A=p(g,b,E),D=m(g,b,y);return pa(N,v,a(E,A,D)),D}}else{var x=this.object.index._compile(l,s);return function(g,b,y){var N=w(g,b,y),E=x(g,b,N),A=i(N,E),D=p(g,b,A),S=m(g,b,y);return a(N,E,a(A,D,S)),S}}}else{if(!zt(this.object))throw new TypeError("SymbolNode expected as object");return function(g,b,y){var N=m(g,b,y);return g.set(d,N),N}}}forEach(l){l(this.object,"object",this),this.index&&l(this.index,"index",this),l(this.value,"value",this)}map(l){var s=this._ifNode(l(this.object,"object",this)),f=this.index?this._ifNode(l(this.index,"index",this)):null,p=this._ifNode(l(this.value,"value",this));return new u(s,f,p)}clone(){return new u(this.object,this.index,this.value)}_toString(l){var s=this.object.toString(l),f=this.index?this.index.toString(l):"",p=this.value.toString(l);return o(this,l&&l.parenthesis,l&&l.implicit)&&(p="("+p+")"),s+f+" = "+p}toJSON(){return{mathjs:Wo,object:this.object,index:this.index,value:this.value}}static fromJSON(l){return new u(l.object,l.index,l.value)}_toHTML(l){var s=this.object.toHTML(l),f=this.index?this.index.toHTML(l):"",p=this.value.toHTML(l);return o(this,l&&l.parenthesis,l&&l.implicit)&&(p='<span class="math-paranthesis math-round-parenthesis">(</span>'+p+'<span class="math-paranthesis math-round-parenthesis">)</span>'),s+f+'<span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+p}_toTex(l){var s=this.object.toTex(l),f=this.index?this.index.toTex(l):"",p=this.value.toTex(l);return o(this,l&&l.parenthesis,l&&l.implicit)&&(p="\\left(".concat(p,"\\right)")),s+f+"="+p}}return Bt(u,"name",Wo),u},{isClass:!0,isNode:!0}),Ko="BlockNode",j4=["ResultSet","Node"],L4=U(Ko,j4,e=>{var{ResultSet:t,Node:r}=e;class n extends r{constructor(a){if(super(),!Array.isArray(a))throw new Error("Array expected");this.blocks=a.map(function(o){var u=o&&o.node,c=o&&o.visible!==void 0?o.visible:!0;if(!ft(u))throw new TypeError('Property "node" must be a Node');if(typeof c!="boolean")throw new TypeError('Property "visible" must be a boolean');return{node:u,visible:c}})}get type(){return Ko}get isBlockNode(){return!0}_compile(a,o){var u=Nn(this.blocks,function(c){return{evaluate:c.node._compile(a,o),visible:c.visible}});return function(c,l,s){var f=[];return bu(u,function(p){var m=p.evaluate(c,l,s);p.visible&&f.push(m)}),new t(f)}}forEach(a){for(var o=0;o<this.blocks.length;o++)a(this.blocks[o].node,"blocks["+o+"].node",this)}map(a){for(var o=[],u=0;u<this.blocks.length;u++){var c=this.blocks[u],l=this._ifNode(a(c.node,"blocks["+u+"].node",this));o[u]={node:l,visible:c.visible}}return new n(o)}clone(){var a=this.blocks.map(function(o){return{node:o.node,visible:o.visible}});return new n(a)}_toString(a){return this.blocks.map(function(o){return o.node.toString(a)+(o.visible?"":";")}).join(`
|
|
29
|
+
`)}toJSON(){return{mathjs:Ko,blocks:this.blocks}}static fromJSON(a){return new n(a.blocks)}_toHTML(a){return this.blocks.map(function(o){return o.node.toHTML(a)+(o.visible?"":'<span class="math-separator">;</span>')}).join('<span class="math-separator"><br /></span>')}_toTex(a){return this.blocks.map(function(o){return o.node.toTex(a)+(o.visible?"":";")}).join(`\\;\\;
|
|
30
|
+
`)}}return Bt(n,"name",Ko),n},{isClass:!0,isNode:!0}),Qo="ConditionalNode",P4=["Node"],V4=U(Qo,P4,e=>{var{Node:t}=e;function r(i){if(typeof i=="number"||typeof i=="boolean"||typeof i=="string")return!!i;if(i){if($e(i))return!i.isZero();if(wn(i))return!!(i.re||i.im);if(Cr(i))return!!i.value}if(i==null)return!1;throw new TypeError('Unsupported type of condition "'+dt(i)+'"')}class n extends t{constructor(a,o,u){if(super(),!ft(a))throw new TypeError("Parameter condition must be a Node");if(!ft(o))throw new TypeError("Parameter trueExpr must be a Node");if(!ft(u))throw new TypeError("Parameter falseExpr must be a Node");this.condition=a,this.trueExpr=o,this.falseExpr=u}get type(){return Qo}get isConditionalNode(){return!0}_compile(a,o){var u=this.condition._compile(a,o),c=this.trueExpr._compile(a,o),l=this.falseExpr._compile(a,o);return function(s,f,p){return r(u(s,f,p))?c(s,f,p):l(s,f,p)}}forEach(a){a(this.condition,"condition",this),a(this.trueExpr,"trueExpr",this),a(this.falseExpr,"falseExpr",this)}map(a){return new n(this._ifNode(a(this.condition,"condition",this)),this._ifNode(a(this.trueExpr,"trueExpr",this)),this._ifNode(a(this.falseExpr,"falseExpr",this)))}clone(){return new n(this.condition,this.trueExpr,this.falseExpr)}_toString(a){var o=a&&a.parenthesis?a.parenthesis:"keep",u=mt(this,o,a&&a.implicit),c=this.condition.toString(a),l=mt(this.condition,o,a&&a.implicit);(o==="all"||this.condition.type==="OperatorNode"||l!==null&&l<=u)&&(c="("+c+")");var s=this.trueExpr.toString(a),f=mt(this.trueExpr,o,a&&a.implicit);(o==="all"||this.trueExpr.type==="OperatorNode"||f!==null&&f<=u)&&(s="("+s+")");var p=this.falseExpr.toString(a),m=mt(this.falseExpr,o,a&&a.implicit);return(o==="all"||this.falseExpr.type==="OperatorNode"||m!==null&&m<=u)&&(p="("+p+")"),c+" ? "+s+" : "+p}toJSON(){return{mathjs:Qo,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(a){return new n(a.condition,a.trueExpr,a.falseExpr)}_toHTML(a){var o=a&&a.parenthesis?a.parenthesis:"keep",u=mt(this,o,a&&a.implicit),c=this.condition.toHTML(a),l=mt(this.condition,o,a&&a.implicit);(o==="all"||this.condition.type==="OperatorNode"||l!==null&&l<=u)&&(c='<span class="math-parenthesis math-round-parenthesis">(</span>'+c+'<span class="math-parenthesis math-round-parenthesis">)</span>');var s=this.trueExpr.toHTML(a),f=mt(this.trueExpr,o,a&&a.implicit);(o==="all"||this.trueExpr.type==="OperatorNode"||f!==null&&f<=u)&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>');var p=this.falseExpr.toHTML(a),m=mt(this.falseExpr,o,a&&a.implicit);return(o==="all"||this.falseExpr.type==="OperatorNode"||m!==null&&m<=u)&&(p='<span class="math-parenthesis math-round-parenthesis">(</span>'+p+'<span class="math-parenthesis math-round-parenthesis">)</span>'),c+'<span class="math-operator math-conditional-operator">?</span>'+s+'<span class="math-operator math-conditional-operator">:</span>'+p}_toTex(a){return"\\begin{cases} {"+this.trueExpr.toTex(a)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(a)+"}\\\\{"+this.falseExpr.toTex(a)+"}, &\\quad{\\text{otherwise}}\\end{cases}"}}return Bt(n,"name",Qo),n},{isClass:!0,isNode:!0}),Vc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},U4={"{":"\\{","}":"\\}","\\":"\\textbackslash{}","#":"\\#",$:"\\$","%":"\\%","&":"\\&","^":"\\textasciicircum{}",_:"\\_","~":"\\textasciitilde{}"},$4={"–":"\\--","—":"\\---"," ":"~"," ":"\\qquad{}","\r\n":"\\newline{}","\n":"\\newline{}"},H4=function(e,t){return Vc({},e,t)},J4=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.preserveFormatting,n=r===void 0?!1:r,i=t.escapeMapFn,a=i===void 0?H4:i,o=String(e),u="",c=a(Vc({},U4),n?Vc({},$4):{}),l=Object.keys(c),s=function(){var f=!1;l.forEach(function(p,m){f||o.length>=p.length&&o.slice(0,p.length)===p&&(u+=c[l[m]],o=o.slice(p.length,o.length),f=!0)}),f||(u+=o.slice(0,1),o=o.slice(1,o.length))};o;)s();return u};const G4=No(J4);var Uc={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{?}"},at={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"},eh={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(at.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(at.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(at.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(at.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(at.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},gcd:"\\gcd\\left(${args}\\right)",hypot:"\\hypot\\left(${args}\\right)",log:{1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},log10:{1:"\\log_{10}\\left(${args[0]}\\right)"},log1p:{1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},log2:"\\log_{2}\\left(${args[0]}\\right)",mod:{2:"\\left(${args[0]}".concat(at.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(at.multiply,"${args[1]}\\right)")},norm:{1:"\\left\\|${args[0]}\\right\\|",2:void 0},nthRoot:{2:"\\sqrt[${args[1]}]{${args[0]}}"},nthRoots:{2:"\\{y : $y^{args[1]} = {${args[0]}}\\}"},pow:{2:"\\left(${args[0]}\\right)".concat(at.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(at.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(at.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(at.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(at.bitAnd,"${args[1]}\\right)")},bitNot:{1:at.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(at.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(at.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(at.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(at.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(at.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(at.and,"${args[1]}\\right)")},not:{1:at.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(at.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(at.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(at.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(at.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(at.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(at.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(at.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(at.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(at.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(at.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(at.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(at.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(at.to,"${args[1]}\\right)")},numeric:function(e,t){return e.args[0].toTex()},number:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:"0",1:"\\left(${args[0]}\\right)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(Uc.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)"}},W4="\\mathrm{${name}}\\left(${args}\\right)",th={deg:"^\\circ"};function $c(e){return G4(e,{preserveFormatting:!0})}function jy(e,t){return t=typeof t>"u"?!1:t,t?Me(th,e)?th[e]:"\\mathrm{"+$c(e)+"}":Me(Uc,e)?Uc[e]:$c(e)}var Zo="ConstantNode",K4=["Node"],Q4=U(Zo,K4,e=>{var{Node:t}=e;class r extends t{constructor(i){super(),this.value=i}get type(){return Zo}get isConstantNode(){return!0}_compile(i,a){var o=this.value;return function(){return o}}forEach(i){}map(i){return this.clone()}clone(){return new r(this.value)}_toString(i){return Ge(this.value,i)}_toHTML(i){var a=this._toString(i);switch(dt(this.value)){case"number":case"BigNumber":case"Fraction":return'<span class="math-number">'+a+"</span>";case"string":return'<span class="math-string">'+a+"</span>";case"boolean":return'<span class="math-boolean">'+a+"</span>";case"null":return'<span class="math-null-symbol">'+a+"</span>";case"undefined":return'<span class="math-undefined">'+a+"</span>";default:return'<span class="math-symbol">'+a+"</span>"}}toJSON(){return{mathjs:Zo,value:this.value}}static fromJSON(i){return new r(i.value)}_toTex(i){var a=this._toString(i),o=dt(this.value);switch(o){case"string":return"\\mathtt{"+$c(a)+"}";case"number":case"BigNumber":{var u=o==="BigNumber"?this.value.isFinite():isFinite(this.value);if(!u)return this.value.valueOf()<0?"-\\infty":"\\infty";var c=a.toLowerCase().indexOf("e");return c!==-1?a.substring(0,c)+"\\cdot10^{"+a.substring(c+1)+"}":a}case"Fraction":return this.value.toLatex();default:return a}}}return Bt(r,"name",Zo),r},{isClass:!0,isNode:!0}),Xo="FunctionAssignmentNode",Z4=["typed","Node"],X4=U(Xo,Z4,e=>{var{typed:t,Node:r}=e;function n(a,o,u){var c=mt(a,o,u),l=mt(a.expr,o,u);return o==="all"||l!==null&&l<=c}class i extends r{constructor(o,u,c){if(super(),typeof o!="string")throw new TypeError('String expected for parameter "name"');if(!Array.isArray(u))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!ft(c))throw new TypeError('Node expected for parameter "expr"');if(qy.has(o))throw new Error('Illegal function name, "'+o+'" is a reserved keyword');var l=new Set;for(var s of u){var f=typeof s=="string"?s:s.name;if(l.has(f))throw new Error('Duplicate parameter name "'.concat(f,'"'));l.add(f)}this.name=o,this.params=u.map(function(p){return p&&p.name||p}),this.types=u.map(function(p){return p&&p.type||"any"}),this.expr=c}get type(){return Xo}get isFunctionAssignmentNode(){return!0}_compile(o,u){var c=Object.create(u);bu(this.params,function(d){c[d]=!0});var l=this.expr._compile(o,c),s=this.name,f=this.params,p=tp(this.types,","),m=s+"("+tp(this.params,", ")+")";return function(d,h,w){var v={};v[p]=function(){for(var g=Object.create(h),b=0;b<f.length;b++)g[f[b]]=arguments[b];return l(d,g,w)};var x=t(s,v);return x.syntax=m,d.set(s,x),x}}forEach(o){o(this.expr,"expr",this)}map(o){var u=this._ifNode(o(this.expr,"expr",this));return new i(this.name,this.params.slice(0),u)}clone(){return new i(this.name,this.params.slice(0),this.expr)}_toString(o){var u=o&&o.parenthesis?o.parenthesis:"keep",c=this.expr.toString(o);return n(this,u,o&&o.implicit)&&(c="("+c+")"),this.name+"("+this.params.join(", ")+") = "+c}toJSON(){var o=this.types;return{mathjs:Xo,name:this.name,params:this.params.map(function(u,c){return{name:u,type:o[c]}}),expr:this.expr}}static fromJSON(o){return new i(o.name,o.params,o.expr)}_toHTML(o){for(var u=o&&o.parenthesis?o.parenthesis:"keep",c=[],l=0;l<this.params.length;l++)c.push('<span class="math-symbol math-parameter">'+Mr(this.params[l])+"</span>");var s=this.expr.toHTML(o);return n(this,u,o&&o.implicit)&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),'<span class="math-function">'+Mr(this.name)+'</span><span class="math-parenthesis math-round-parenthesis">(</span>'+c.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>'+s}_toTex(o){var u=o&&o.parenthesis?o.parenthesis:"keep",c=this.expr.toTex(o);return n(this,u,o&&o.implicit)&&(c="\\left(".concat(c,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(jy).join(",")+"\\right)="+c}}return Bt(i,"name",Xo),i},{isClass:!0,isNode:!0}),Yo="IndexNode",Y4=["Node","size"],eF=U(Yo,Y4,e=>{var{Node:t,size:r}=e;class n extends t{constructor(a,o){if(super(),this.dimensions=a,this.dotNotation=o||!1,!Array.isArray(a)||!a.every(ft))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 Yo}get isIndexNode(){return!0}_compile(a,o){var u=Nn(this.dimensions,function(l,s){var f=l.filter(d=>d.isSymbolNode&&d.name==="end").length>0;if(f){var p=Object.create(o);p.end=!0;var m=l._compile(a,p);return function(d,h,w){if(!ke(w)&&!st(w)&&!Qt(w))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+dt(w));var v=r(w).valueOf(),x=Object.create(h);return x.end=v[s],m(d,x,w)}}else return l._compile(a,o)}),c=nr(a,"index");return function(l,s,f){var p=Nn(u,function(m){return m(l,s,f)});return c(...p)}}forEach(a){for(var o=0;o<this.dimensions.length;o++)a(this.dimensions[o],"dimensions["+o+"]",this)}map(a){for(var o=[],u=0;u<this.dimensions.length;u++)o[u]=this._ifNode(a(this.dimensions[u],"dimensions["+u+"]",this));return new n(o,this.dotNotation)}clone(){return new n(this.dimensions.slice(0),this.dotNotation)}isObjectProperty(){return this.dimensions.length===1&&nt(this.dimensions[0])&&typeof this.dimensions[0].value=="string"}getObjectProperty(){return this.isObjectProperty()?this.dimensions[0].value:null}_toString(a){return this.dotNotation?"."+this.getObjectProperty():"["+this.dimensions.join(", ")+"]"}toJSON(){return{mathjs:Yo,dimensions:this.dimensions,dotNotation:this.dotNotation}}static fromJSON(a){return new n(a.dimensions,a.dotNotation)}_toHTML(a){for(var o=[],u=0;u<this.dimensions.length;u++)o[u]=this.dimensions[u].toHTML();return this.dotNotation?'<span class="math-operator math-accessor-operator">.</span><span class="math-symbol math-property">'+Mr(this.getObjectProperty())+"</span>":'<span class="math-parenthesis math-square-parenthesis">[</span>'+o.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'}_toTex(a){var o=this.dimensions.map(function(u){return u.toTex(a)});return this.dotNotation?"."+this.getObjectProperty():"_{"+o.join(",")+"}"}}return Bt(n,"name",Yo),n},{isClass:!0,isNode:!0}),es="ObjectNode",tF=["Node"],rF=U(es,tF,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),this.properties=i||{},i&&(typeof i!="object"||!Object.keys(i).every(function(a){return ft(i[a])})))throw new TypeError("Object containing Nodes expected")}get type(){return es}get isObjectNode(){return!0}_compile(i,a){var o={};for(var u in this.properties)if(Me(this.properties,u)){var c=na(u),l=JSON.parse(c),s=nr(this.properties,u);o[l]=s._compile(i,a)}return function(f,p,m){var d={};for(var h in o)Me(o,h)&&(d[h]=o[h](f,p,m));return d}}forEach(i){for(var a in this.properties)Me(this.properties,a)&&i(this.properties[a],"properties["+na(a)+"]",this)}map(i){var a={};for(var o in this.properties)Me(this.properties,o)&&(a[o]=this._ifNode(i(this.properties[o],"properties["+na(o)+"]",this)));return new r(a)}clone(){var i={};for(var a in this.properties)Me(this.properties,a)&&(i[a]=this.properties[a]);return new r(i)}_toString(i){var a=[];for(var o in this.properties)Me(this.properties,o)&&a.push(na(o)+": "+this.properties[o].toString(i));return"{"+a.join(", ")+"}"}toJSON(){return{mathjs:es,properties:this.properties}}static fromJSON(i){return new r(i.properties)}_toHTML(i){var a=[];for(var o in this.properties)Me(this.properties,o)&&a.push('<span class="math-symbol math-property">'+Mr(o)+'</span><span class="math-operator math-assignment-operator math-property-assignment-operator math-binary-operator">:</span>'+this.properties[o].toHTML(i));return'<span class="math-parenthesis math-curly-parenthesis">{</span>'+a.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-curly-parenthesis">}</span>'}_toTex(i){var a=[];for(var o in this.properties)Me(this.properties,o)&&a.push("\\mathbf{"+o+":} & "+this.properties[o].toTex(i)+"\\\\");var u="\\left\\{\\begin{array}{ll}"+a.join(`
|
|
31
|
+
`)+"\\end{array}\\right\\}";return u}}return Bt(r,"name",es),r},{isClass:!0,isNode:!0});function Xa(e,t){return new Kg(e,new hu(t),new Set(Object.keys(t)))}var ts="OperatorNode",nF=["Node"],iF=U(ts,nF,e=>{var{Node:t}=e;function r(a,o){var u=a;if(o==="auto")for(;An(u);)u=u.content;return nt(u)?!0:Ct(u)?r(u.args[0],o):!1}function n(a,o,u,c,l){var s=mt(a,o,u),f=Ha(a,o);if(o==="all"||c.length>2&&a.getIdentifier()!=="OperatorNode:add"&&a.getIdentifier()!=="OperatorNode:multiply")return c.map(function(S){switch(S.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});var p;switch(c.length){case 0:p=[];break;case 1:{var m=mt(c[0],o,u,a);if(l&&m!==null){var d,h;if(o==="keep"?(d=c[0].getIdentifier(),h=a.getIdentifier()):(d=c[0].getContent().getIdentifier(),h=a.getContent().getIdentifier()),Ir[s][h].latexLeftParens===!1){p=[!1];break}if(Ir[m][d].latexParens===!1){p=[!1];break}}if(m===null){p=[!1];break}if(m<=s){p=[!0];break}p=[!1]}break;case 2:{var w,v=mt(c[0],o,u,a),x=pc(a,c[0],o);v===null?w=!1:v===s&&f==="right"&&!x||v<s?w=!0:w=!1;var g,b=mt(c[1],o,u,a),y=pc(a,c[1],o);if(b===null?g=!1:b===s&&f==="left"&&!y||b<s?g=!0:g=!1,l){var N,E,A;o==="keep"?(N=a.getIdentifier(),E=a.args[0].getIdentifier(),A=a.args[1].getIdentifier()):(N=a.getContent().getIdentifier(),E=a.args[0].getContent().getIdentifier(),A=a.args[1].getContent().getIdentifier()),v!==null&&(Ir[s][N].latexLeftParens===!1&&(w=!1),Ir[v][E].latexParens===!1&&(w=!1)),b!==null&&(Ir[s][N].latexRightParens===!1&&(g=!1),Ir[b][A].latexParens===!1&&(g=!1))}p=[w,g]}break;default:(a.getIdentifier()==="OperatorNode:add"||a.getIdentifier()==="OperatorNode:multiply")&&(p=c.map(function(S){var C=mt(S,o,u,a),_=pc(a,S,o),R=Ha(S,o);return C===null?!1:s===C&&f===R&&!_?!0:C<s}));break}if(c.length>=2&&a.getIdentifier()==="OperatorNode:multiply"&&a.implicit&&o!=="all"&&u==="hide")for(var D=1;D<p.length;++D)r(c[D],o)&&!p[D-1]&&(o!=="keep"||!An(c[D-1]))&&(p[D]=!0);return p}class i extends t{constructor(o,u,c,l,s){if(super(),typeof o!="string")throw new TypeError('string expected for parameter "op"');if(typeof u!="string")throw new TypeError('string expected for parameter "fn"');if(!Array.isArray(c)||!c.every(ft))throw new TypeError('Array containing Nodes expected for parameter "args"');this.implicit=l===!0,this.isPercentage=s===!0,this.op=o,this.fn=u,this.args=c||[]}get type(){return ts}get isOperatorNode(){return!0}_compile(o,u){if(typeof this.fn!="string"||!xl(o,this.fn))throw o[this.fn]?new Error('No access to function "'+this.fn+'"'):new Error("Function "+this.fn+' missing in provided namespace "math"');var c=nr(o,this.fn),l=Nn(this.args,function(d){return d._compile(o,u)});if(typeof c=="function"&&c.rawArgs===!0){var s=this.args;return function(d,h,w){return c(s,o,Xa(d,h))}}else if(l.length===1){var f=l[0];return function(d,h,w){return c(f(d,h,w))}}else if(l.length===2){var p=l[0],m=l[1];return function(d,h,w){return c(p(d,h,w),m(d,h,w))}}else return function(d,h,w){return c.apply(null,Nn(l,function(v){return v(d,h,w)}))}}forEach(o){for(var u=0;u<this.args.length;u++)o(this.args[u],"args["+u+"]",this)}map(o){for(var u=[],c=0;c<this.args.length;c++)u[c]=this._ifNode(o(this.args[c],"args["+c+"]",this));return new i(this.op,this.fn,u,this.implicit,this.isPercentage)}clone(){return new i(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(o){var u=o&&o.parenthesis?o.parenthesis:"keep",c=o&&o.implicit?o.implicit:"hide",l=this.args,s=n(this,u,c,l,!1);if(l.length===1){var f=Ha(this,u),p=l[0].toString(o);s[0]&&(p="("+p+")");var m=/[a-zA-Z]+/.test(this.op);return f==="right"?this.op+(m?" ":"")+p:f==="left"?p+(m?" ":"")+this.op:p+this.op}else if(l.length===2){var d=l[0].toString(o),h=l[1].toString(o);return s[0]&&(d="("+d+")"),s[1]&&(h="("+h+")"),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&c==="hide"?d+" "+h:d+" "+this.op+" "+h}else if(l.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var w=l.map(function(v,x){return v=v.toString(o),s[x]&&(v="("+v+")"),v});return this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&c==="hide"?w.join(" "):w.join(" "+this.op+" ")}else return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:ts,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(o){return new i(o.op,o.fn,o.args,o.implicit,o.isPercentage)}_toHTML(o){var u=o&&o.parenthesis?o.parenthesis:"keep",c=o&&o.implicit?o.implicit:"hide",l=this.args,s=n(this,u,c,l,!1);if(l.length===1){var f=Ha(this,u),p=l[0].toHTML(o);return s[0]&&(p='<span class="math-parenthesis math-round-parenthesis">(</span>'+p+'<span class="math-parenthesis math-round-parenthesis">)</span>'),f==="right"?'<span class="math-operator math-unary-operator math-lefthand-unary-operator">'+Mr(this.op)+"</span>"+p:p+'<span class="math-operator math-unary-operator math-righthand-unary-operator">'+Mr(this.op)+"</span>"}else if(l.length===2){var m=l[0].toHTML(o),d=l[1].toHTML(o);return s[0]&&(m='<span class="math-parenthesis math-round-parenthesis">(</span>'+m+'<span class="math-parenthesis math-round-parenthesis">)</span>'),s[1]&&(d='<span class="math-parenthesis math-round-parenthesis">(</span>'+d+'<span class="math-parenthesis math-round-parenthesis">)</span>'),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&c==="hide"?m+'<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'+d:m+'<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Mr(this.op)+"</span>"+d}else{var h=l.map(function(w,v){return w=w.toHTML(o),s[v]&&(w='<span class="math-parenthesis math-round-parenthesis">(</span>'+w+'<span class="math-parenthesis math-round-parenthesis">)</span>'),w});return l.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")?this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&c==="hide"?h.join('<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'):h.join('<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Mr(this.op)+"</span>"):'<span class="math-function">'+Mr(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+h.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'}}_toTex(o){var u=o&&o.parenthesis?o.parenthesis:"keep",c=o&&o.implicit?o.implicit:"hide",l=this.args,s=n(this,u,c,l,!0),f=at[this.fn];if(f=typeof f>"u"?this.op:f,l.length===1){var p=Ha(this,u),m=l[0].toTex(o);return s[0]&&(m="\\left(".concat(m,"\\right)")),p==="right"?f+m:m+f}else if(l.length===2){var d=l[0],h=d.toTex(o);s[0]&&(h="\\left(".concat(h,"\\right)"));var w=l[1],v=w.toTex(o);s[1]&&(v="\\left(".concat(v,"\\right)"));var x;switch(u==="keep"?x=d.getIdentifier():x=d.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return f+"{"+h+"}{"+v+"}";case"OperatorNode:pow":switch(h="{"+h+"}",v="{"+v+"}",x){case"ConditionalNode":case"OperatorNode:divide":h="\\left(".concat(h,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&c==="hide")return h+"~"+v}return h+f+v}else if(l.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var g=l.map(function(b,y){return b=b.toTex(o),s[y]&&(b="\\left(".concat(b,"\\right)")),b});return this.getIdentifier()==="OperatorNode:multiply"&&this.implicit&&c==="hide"?g.join("~"):g.join(f)}else return"\\mathrm{"+this.fn+"}\\left("+l.map(function(b){return b.toTex(o)}).join(",")+"\\right)"}getIdentifier(){return this.type+":"+this.fn}}return Bt(i,"name",ts),i},{isClass:!0,isNode:!0}),rs="ParenthesisNode",aF=["Node"],oF=U(rs,aF,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),!ft(i))throw new TypeError('Node expected for parameter "content"');this.content=i}get type(){return rs}get isParenthesisNode(){return!0}_compile(i,a){return this.content._compile(i,a)}getContent(){return this.content.getContent()}forEach(i){i(this.content,"content",this)}map(i){var a=i(this.content,"content",this);return new r(a)}clone(){return new r(this.content)}_toString(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"("+this.content.toString(i)+")":this.content.toString(i)}toJSON(){return{mathjs:rs,content:this.content}}static fromJSON(i){return new r(i.content)}_toHTML(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?'<span class="math-parenthesis math-round-parenthesis">(</span>'+this.content.toHTML(i)+'<span class="math-parenthesis math-round-parenthesis">)</span>':this.content.toHTML(i)}_toTex(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"\\left(".concat(this.content.toTex(i),"\\right)"):this.content.toTex(i)}}return Bt(r,"name",rs),r},{isClass:!0,isNode:!0}),ns="RangeNode",sF=["Node"],uF=U(ns,sF,e=>{var{Node:t}=e;function r(i,a,o){var u=mt(i,a,o),c={},l=mt(i.start,a,o);if(c.start=l!==null&&l<=u||a==="all",i.step){var s=mt(i.step,a,o);c.step=s!==null&&s<=u||a==="all"}var f=mt(i.end,a,o);return c.end=f!==null&&f<=u||a==="all",c}class n extends t{constructor(a,o,u){if(super(),!ft(a))throw new TypeError("Node expected");if(!ft(o))throw new TypeError("Node expected");if(u&&!ft(u))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=a,this.end=o,this.step=u||null}get type(){return ns}get isRangeNode(){return!0}needsEnd(){var a=this.filter(function(o){return zt(o)&&o.name==="end"});return a.length>0}_compile(a,o){var u=a.range,c=this.start._compile(a,o),l=this.end._compile(a,o);if(this.step){var s=this.step._compile(a,o);return function(f,p,m){return u(c(f,p,m),l(f,p,m),s(f,p,m))}}else return function(f,p,m){return u(c(f,p,m),l(f,p,m))}}forEach(a){a(this.start,"start",this),a(this.end,"end",this),this.step&&a(this.step,"step",this)}map(a){return new n(this._ifNode(a(this.start,"start",this)),this._ifNode(a(this.end,"end",this)),this.step&&this._ifNode(a(this.step,"step",this)))}clone(){return new n(this.start,this.end,this.step&&this.step)}_toString(a){var o=a&&a.parenthesis?a.parenthesis:"keep",u=r(this,o,a&&a.implicit),c,l=this.start.toString(a);if(u.start&&(l="("+l+")"),c=l,this.step){var s=this.step.toString(a);u.step&&(s="("+s+")"),c+=":"+s}var f=this.end.toString(a);return u.end&&(f="("+f+")"),c+=":"+f,c}toJSON(){return{mathjs:ns,start:this.start,end:this.end,step:this.step}}static fromJSON(a){return new n(a.start,a.end,a.step)}_toHTML(a){var o=a&&a.parenthesis?a.parenthesis:"keep",u=r(this,o,a&&a.implicit),c,l=this.start.toHTML(a);if(u.start&&(l='<span class="math-parenthesis math-round-parenthesis">(</span>'+l+'<span class="math-parenthesis math-round-parenthesis">)</span>'),c=l,this.step){var s=this.step.toHTML(a);u.step&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),c+='<span class="math-operator math-range-operator">:</span>'+s}var f=this.end.toHTML(a);return u.end&&(f='<span class="math-parenthesis math-round-parenthesis">(</span>'+f+'<span class="math-parenthesis math-round-parenthesis">)</span>'),c+='<span class="math-operator math-range-operator">:</span>'+f,c}_toTex(a){var o=a&&a.parenthesis?a.parenthesis:"keep",u=r(this,o,a&&a.implicit),c=this.start.toTex(a);if(u.start&&(c="\\left(".concat(c,"\\right)")),this.step){var l=this.step.toTex(a);u.step&&(l="\\left(".concat(l,"\\right)")),c+=":"+l}var s=this.end.toTex(a);return u.end&&(s="\\left(".concat(s,"\\right)")),c+=":"+s,c}}return Bt(n,"name",ns),n},{isClass:!0,isNode:!0}),is="RelationalNode",cF=["Node"],lF=U(is,cF,e=>{var{Node:t}=e,r={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class n extends t{constructor(a,o){if(super(),!Array.isArray(a))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(o))throw new TypeError("Parameter params must be an array");if(a.length!==o.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=a,this.params=o}get type(){return is}get isRelationalNode(){return!0}_compile(a,o){var u=this,c=this.params.map(l=>l._compile(a,o));return function(l,s,f){for(var p,m=c[0](l,s,f),d=0;d<u.conditionals.length;d++){p=m,m=c[d+1](l,s,f);var h=nr(a,u.conditionals[d]);if(!h(p,m))return!1}return!0}}forEach(a){this.params.forEach((o,u)=>a(o,"params["+u+"]",this),this)}map(a){return new n(this.conditionals.slice(),this.params.map((o,u)=>this._ifNode(a(o,"params["+u+"]",this)),this))}clone(){return new n(this.conditionals,this.params)}_toString(a){for(var o=a&&a.parenthesis?a.parenthesis:"keep",u=mt(this,o,a&&a.implicit),c=this.params.map(function(f,p){var m=mt(f,o,a&&a.implicit);return o==="all"||m!==null&&m<=u?"("+f.toString(a)+")":f.toString(a)}),l=c[0],s=0;s<this.conditionals.length;s++)l+=" "+r[this.conditionals[s]],l+=" "+c[s+1];return l}toJSON(){return{mathjs:is,conditionals:this.conditionals,params:this.params}}static fromJSON(a){return new n(a.conditionals,a.params)}_toHTML(a){for(var o=a&&a.parenthesis?a.parenthesis:"keep",u=mt(this,o,a&&a.implicit),c=this.params.map(function(f,p){var m=mt(f,o,a&&a.implicit);return o==="all"||m!==null&&m<=u?'<span class="math-parenthesis math-round-parenthesis">(</span>'+f.toHTML(a)+'<span class="math-parenthesis math-round-parenthesis">)</span>':f.toHTML(a)}),l=c[0],s=0;s<this.conditionals.length;s++)l+='<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Mr(r[this.conditionals[s]])+"</span>"+c[s+1];return l}_toTex(a){for(var o=a&&a.parenthesis?a.parenthesis:"keep",u=mt(this,o,a&&a.implicit),c=this.params.map(function(f,p){var m=mt(f,o,a&&a.implicit);return o==="all"||m!==null&&m<=u?"\\left("+f.toTex(a)+"\right)":f.toTex(a)}),l=c[0],s=0;s<this.conditionals.length;s++)l+=at[this.conditionals[s]]+c[s+1];return l}}return Bt(n,"name",is),n},{isClass:!0,isNode:!0}),fF="SymbolNode",pF=["math","?Unit","Node"],mF=U(fF,pF,e=>{var{math:t,Unit:r,Node:n}=e;function i(o){return r?r.isValuelessUnit(o):!1}class a 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,c){var l=this.name;if(c[l]===!0)return function(f,p,m){return nr(p,l)};if(l in u)return function(f,p,m){return f.has(l)?f.get(l):nr(u,l)};var s=i(l);return function(f,p,m){return f.has(l)?f.get(l):s?new r(null,l):a.onUndefinedSymbol(l)}}forEach(u){}map(u){return this.clone()}static onUndefinedSymbol(u){throw new Error("Undefined symbol "+u)}clone(){return new a(this.name)}_toString(u){return this.name}_toHTML(u){var c=Mr(this.name);return c==="true"||c==="false"?'<span class="math-symbol math-boolean">'+c+"</span>":c==="i"?'<span class="math-symbol math-imaginary-symbol">'+c+"</span>":c==="Infinity"?'<span class="math-symbol math-infinity-symbol">'+c+"</span>":c==="NaN"?'<span class="math-symbol math-nan-symbol">'+c+"</span>":c==="null"?'<span class="math-symbol math-null-symbol">'+c+"</span>":c==="undefined"?'<span class="math-symbol math-undefined-symbol">'+c+"</span>":'<span class="math-symbol">'+c+"</span>"}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(u){return new a(u.name)}_toTex(u){var c=!1;typeof t[this.name]>"u"&&i(this.name)&&(c=!0);var l=jy(this.name,c);return l[0]==="\\"?l:" "+l}}return a},{isClass:!0,isNode:!0}),as="FunctionNode",dF=["math","Node","SymbolNode"],hF=U(as,dF,e=>{var t,{math:r,Node:n,SymbolNode:i}=e,a=c=>Ge(c,{truncate:78});function o(c,l,s){for(var f="",p=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,m=0,d;(d=p.exec(c))!==null;)if(f+=c.substring(m,d.index),m=d.index,d[0]==="$$")f+="$",m++;else{m+=d[0].length;var h=l[d[1]];if(!h)throw new ReferenceError("Template: Property "+d[1]+" does not exist.");if(d[2]===void 0)switch(typeof h){case"string":f+=h;break;case"object":if(ft(h))f+=h.toTex(s);else if(Array.isArray(h))f+=h.map(function(w,v){if(ft(w))return w.toTex(s);throw new TypeError("Template: "+d[1]+"["+v+"] is not a Node.")}).join(",");else throw new TypeError("Template: "+d[1]+" has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: "+d[1]+" has to be a Node, String or array of Nodes")}else if(ft(h[d[2]]&&h[d[2]]))f+=h[d[2]].toTex(s);else throw new TypeError("Template: "+d[1]+"["+d[2]+"] is not a Node.")}return f+=c.slice(m),f}class u extends n{constructor(l,s){if(super(),typeof l=="string"&&(l=new i(l)),!ft(l))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(s)||!s.every(ft))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=l,this.args=s||[]}get name(){return this.fn.name||""}get type(){return as}get isFunctionNode(){return!0}_compile(l,s){var f=this.args.map(A=>A._compile(l,s));if(zt(this.fn)){var p=this.fn.name;if(s[p]){var m=this.args;return function(A,D,S){var C=nr(D,p);if(typeof C!="function")throw new TypeError("Argument '".concat(p,"' was not a function; received: ").concat(a(C)));if(C.rawArgs)return C(m,l,Xa(A,D));var _=f.map(R=>R(A,D,S));return C.apply(C,_)}}else{var d=p in l?nr(l,p):void 0,h=typeof d=="function"&&d.rawArgs===!0,w=A=>{var D;if(A.has(p))D=A.get(p);else if(p in l)D=nr(l,p);else return u.onUndefinedFunction(p);if(typeof D=="function")return D;throw new TypeError("'".concat(p,`' is not a function; its value is:
|
|
32
|
+
`).concat(a(D)))};if(h){var v=this.args;return function(A,D,S){var C=w(A);return C(v,l,Xa(A,D))}}else switch(f.length){case 0:return function(A,D,S){var C=w(A);return C()};case 1:return function(A,D,S){var C=w(A),_=f[0];return C(_(A,D,S))};case 2:return function(A,D,S){var C=w(A),_=f[0],R=f[1];return C(_(A,D,S),R(A,D,S))};default:return function(A,D,S){var C=w(A),_=f.map(R=>R(A,D,S));return C(..._)}}}}else if(Ti(this.fn)&&Da(this.fn.index)&&this.fn.index.isObjectProperty()){var x=this.fn.object._compile(l,s),g=this.fn.index.getObjectProperty(),b=this.args;return function(A,D,S){var C=x(A,D,S),_=FN(C,g);if(_!=null&&_.rawArgs)return _(b,l,Xa(A,D));var R=f.map(P=>P(A,D,S));return _.apply(C,R)}}else{var y=this.fn.toString(),N=this.fn._compile(l,s),E=this.args;return function(A,D,S){var C=N(A,D,S);if(typeof C!="function")throw new TypeError("Expression '".concat(y,"' did not evaluate to a function; value is:")+`
|
|
33
|
+
`.concat(a(C)));if(C.rawArgs)return C(E,l,Xa(A,D));var _=f.map(R=>R(A,D,S));return C.apply(C,_)}}}forEach(l){l(this.fn,"fn",this);for(var s=0;s<this.args.length;s++)l(this.args[s],"args["+s+"]",this)}map(l){for(var s=this._ifNode(l(this.fn,"fn",this)),f=[],p=0;p<this.args.length;p++)f[p]=this._ifNode(l(this.args[p],"args["+p+"]",this));return new u(s,f)}clone(){return new u(this.fn,this.args.slice(0))}toString(l){var s,f=this.fn.toString(l);return l&&typeof l.handler=="object"&&Me(l.handler,f)&&(s=l.handler[f](this,l)),typeof s<"u"?s:super.toString(l)}_toString(l){var s=this.args.map(function(p){return p.toString(l)}),f=xo(this.fn)?"("+this.fn.toString(l)+")":this.fn.toString(l);return f+"("+s.join(", ")+")"}toJSON(){return{mathjs:as,fn:this.fn,args:this.args}}_toHTML(l){var s=this.args.map(function(f){return f.toHTML(l)});return'<span class="math-function">'+Mr(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+s.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'}toTex(l){var s;return l&&typeof l.handler=="object"&&Me(l.handler,this.name)&&(s=l.handler[this.name](this,l)),typeof s<"u"?s:super.toTex(l)}_toTex(l){var s=this.args.map(function(m){return m.toTex(l)}),f;eh[this.name]&&(f=eh[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 p;switch(typeof f){case"function":p=f(this,l);break;case"string":p=o(f,this,l);break;case"object":switch(typeof f[s.length]){case"function":p=f[s.length](this,l);break;case"string":p=o(f[s.length],this,l);break}}return typeof p<"u"?p:o(W4,this,l)}getIdentifier(){return this.type+":"+this.name}}return t=u,Bt(u,"name",as),Bt(u,"onUndefinedFunction",function(c){throw new Error("Undefined function "+c)}),Bt(u,"fromJSON",function(c){return new t(c.fn,c.args)}),u},{isClass:!0,isNode:!0}),rh="parse",gF=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],vF=U(rh,gF,e=>{var{typed:t,numeric:r,config:n,AccessorNode:i,ArrayNode:a,AssignmentNode:o,BlockNode:u,ConditionalNode:c,ConstantNode:l,FunctionAssignmentNode:s,FunctionNode:f,IndexNode:p,ObjectNode:m,OperatorNode:d,ParenthesisNode:h,RangeNode:w,RelationalNode:v,SymbolNode:x}=e,g=t(rh,{string:function(M){return se(M,{})},"Array | Matrix":function(M){return b(M,{})},"string, Object":function(M,X){var pe=X.nodes!==void 0?X.nodes:{};return se(M,pe)},"Array | Matrix, Object":b});function b(M){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},pe=X.nodes!==void 0?X.nodes:{};return Qe(M,function(Ee){if(typeof Ee!="string")throw new TypeError("String expected");return se(Ee,pe)})}var y={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},N={",":!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},E={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},A={true:!0,false:!1,null:null,undefined:void 0},D=["NaN","Infinity"],S={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
34
34
|
`,r:"\r",t:" "};function C(){return{extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:y.NULL,nestingLevel:0,conditionalLevel:null}}function _(M,X){return M.expression.substr(M.index,X)}function R(M){return _(M,1)}function P(M){M.index++}function I(M){return M.expression.charAt(M.index-1)}function O(M){return M.expression.charAt(M.index+1)}function F(M){for(M.tokenType=y.NULL,M.token="",M.comment="";;){if(R(M)==="#")for(;R(M)!==`
|
|
35
35
|
`&&R(M)!=="";)M.comment+=R(M),P(M);if(g.isWhitespace(R(M),M.nestingLevel))P(M);else break}if(R(M)===""){M.tokenType=y.DELIMITER;return}if(R(M)===`
|
|
36
36
|
`&&!M.nestingLevel){M.tokenType=y.DELIMITER,M.token=R(M),P(M);return}var X=R(M),pe=_(M,2),Ee=_(M,3);if(Ee.length===3&&N[Ee]){M.tokenType=y.DELIMITER,M.token=Ee,P(M),P(M),P(M);return}if(pe.length===2&&N[pe]){M.tokenType=y.DELIMITER,M.token=pe,P(M),P(M);return}if(N[X]){M.tokenType=y.DELIMITER,M.token=X,P(M);return}if(g.isDigitDot(X)){M.tokenType=y.NUMBER;var Re=_(M,2);if(Re==="0b"||Re==="0o"||Re==="0x"){for(M.token+=R(M),P(M),M.token+=R(M),P(M);g.isHexDigit(R(M));)M.token+=R(M),P(M);if(R(M)===".")for(M.token+=".",P(M);g.isHexDigit(R(M));)M.token+=R(M),P(M);else if(R(M)==="i")for(M.token+="i",P(M);g.isDigit(R(M));)M.token+=R(M),P(M);return}if(R(M)==="."){if(M.token+=R(M),P(M),!g.isDigit(R(M))){M.tokenType=y.DELIMITER;return}}else{for(;g.isDigit(R(M));)M.token+=R(M),P(M);g.isDecimalMark(R(M),O(M))&&(M.token+=R(M),P(M))}for(;g.isDigit(R(M));)M.token+=R(M),P(M);if(R(M)==="E"||R(M)==="e"){if(g.isDigit(O(M))||O(M)==="-"||O(M)==="+"){if(M.token+=R(M),P(M),(R(M)==="+"||R(M)==="-")&&(M.token+=R(M),P(M)),!g.isDigit(R(M)))throw _e(M,'Digit expected, got "'+R(M)+'"');for(;g.isDigit(R(M));)M.token+=R(M),P(M);if(g.isDecimalMark(R(M),O(M)))throw _e(M,'Digit expected, got "'+R(M)+'"')}else if(O(M)===".")throw P(M),_e(M,'Digit expected, got "'+R(M)+'"')}return}if(g.isAlpha(R(M),I(M),O(M))){for(;g.isAlpha(R(M),I(M),O(M))||g.isDigit(R(M));)M.token+=R(M),P(M);Me(E,M.token)?M.tokenType=y.DELIMITER:M.tokenType=y.SYMBOL;return}for(M.tokenType=y.UNKNOWN;R(M)!=="";)M.token+=R(M),P(M);throw _e(M,'Syntax error in part "'+M.token+'"')}function q(M){do F(M);while(M.token===`
|
|
@@ -38,16 +38,16 @@ Example:
|
|
|
38
38
|
`&&X>0},g.isDecimalMark=function(M,X){return M==="."&&X!=="/"&&X!=="*"&&X!=="^"},g.isDigitDot=function(M){return M>="0"&&M<="9"||M==="."},g.isDigit=function(M){return M>="0"&&M<="9"},g.isHexDigit=function(M){return M>="0"&&M<="9"||M>="a"&&M<="f"||M>="A"&&M<="F"};function se(M,X){var pe=C();Tt(pe,{expression:M,extraNodes:X}),F(pe);var Ee=K(pe);if(pe.token!=="")throw pe.tokenType===y.DELIMITER?wt(pe,"Unexpected operator "+pe.token):_e(pe,'Unexpected part "'+pe.token+'"');return Ee}function K(M){var X,pe=[],Ee;for(M.token!==""&&M.token!==`
|
|
39
39
|
`&&M.token!==";"&&(X=V(M),M.comment&&(X.comment=M.comment));M.token===`
|
|
40
40
|
`||M.token===";";)pe.length===0&&X&&(Ee=M.token!==";",pe.push({node:X,visible:Ee})),F(M),M.token!==`
|
|
41
|
-
`&&M.token!==";"&&M.token!==""&&(X=V(M),M.comment&&(X.comment=M.comment),Ee=M.token!==";",pe.push({node:X,visible:Ee}));return pe.length>0?new u(pe):(X||(X=new l(void 0),M.comment&&(X.comment=M.comment)),X)}function V(M){var X,pe,Ee,Re,Je=ue(M);if(M.token==="="){if(zt(Je))return X=Je.name,q(M),Ee=V(M),new o(new b(X),Ee);if(Ti(Je))return q(M),Ee=V(M),new o(Je.object,Je.index,Ee);if(Zn(Je)&&zt(Je.fn)&&(Re=!0,pe=[],X=Je.name,Je.args.forEach(function(vr,rc){zt(vr)?pe[rc]=vr.name:Re=!1}),Re))return q(M),Ee=V(M),new s(X,pe,Ee);throw _e(M,"Invalid left hand side of assignment operator =")}return Je}function ue(M){for(var X=me(M);M.token==="?";){var pe=M.conditionalLevel;M.conditionalLevel=M.nestingLevel,q(M);var Ee=X,Re=V(M);if(M.token!==":")throw _e(M,"False part of conditional expression expected");M.conditionalLevel=null,q(M);var Je=V(M);X=new c(Ee,Re,Je),M.conditionalLevel=pe}return X}function me(M){for(var X=re(M);M.token==="or";)q(M),X=new d("or","or",[X,re(M)]);return X}function re(M){for(var X=ae(M);M.token==="xor";)q(M),X=new d("xor","xor",[X,ae(M)]);return X}function ae(M){for(var X=de(M);M.token==="and";)q(M),X=new d("and","and",[X,de(M)]);return X}function de(M){for(var X=ne(M);M.token==="|";)q(M),X=new d("|","bitOr",[X,ne(M)]);return X}function ne(M){for(var X=ce(M);M.token==="^|";)q(M),X=new d("^|","bitXor",[X,ce(M)]);return X}function ce(M){for(var X=le(M);M.token==="&";)q(M),X=new d("&","bitAnd",[X,le(M)]);return X}function le(M){for(var X=[he(M)],pe=[],Ee={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};Me(Ee,M.token);){var Re={name:M.token,fn:Ee[M.token]};pe.push(Re),q(M),X.push(he(M))}return X.length===1?X[0]:X.length===2?new d(pe[0].name,pe[0].fn,X):new v(pe.map(Je=>Je.fn),X)}function he(M){var X,pe,Ee,Re;X=be(M);for(var Je={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};Me(Je,M.token);)pe=M.token,Ee=Je[pe],q(M),Re=[X,be(M)],X=new d(pe,Ee,Re);return X}function be(M){var X,pe,Ee,Re;X=$(M);for(var Je={to:"to",in:"to"};Me(Je,M.token);)pe=M.token,Ee=Je[pe],q(M),pe==="in"&&M.token===""?X=new d("*","multiply",[X,new b("in")],!0):(Re=[X,$(M)],X=new d(pe,Ee,Re));return X}function $(M){var X,pe=[];if(M.token===":"?X=new l(1):X=T(M),M.token===":"&&M.conditionalLevel!==M.nestingLevel){for(pe.push(X);M.token===":"&&pe.length<3;)q(M),M.token===")"||M.token==="]"||M.token===","||M.token===""?pe.push(new b("end")):pe.push(T(M));pe.length===3?X=new w(pe[0],pe[2],pe[1]):X=new w(pe[0],pe[1])}return X}function T(M){var X,pe,Ee,Re;X=z(M);for(var Je={"+":"add","-":"subtract"};Me(Je,M.token);){pe=M.token,Ee=Je[pe],q(M);var vr=z(M);vr.isPercentage?Re=[X,new d("*","multiply",[X,vr])]:Re=[X,vr],X=new d(pe,Ee,Re)}return X}function z(M){var X,pe,Ee,Re;X=J(M),pe=X;for(var Je={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};Me(Je,M.token);)Ee=M.token,Re=Je[Ee],q(M),pe=J(M),X=new d(Ee,Re,[X,pe]);return X}function J(M){var X,pe;for(X=L(M),pe=X;M.tokenType===y.SYMBOL||M.token==="in"&&nt(X)||M.tokenType===y.NUMBER&&!nt(pe)&&(!Ct(pe)||pe.op==="!")||M.token==="(";)pe=L(M),X=new d("*","multiply",[X,pe],!0);return X}function L(M){for(var X=H(M),pe=X,Ee=[];M.token==="/"&&_c(pe);)if(Ee.push(Tt({},M)),q(M),M.tokenType===y.NUMBER)if(Ee.push(Tt({},M)),q(M),M.tokenType===y.SYMBOL||M.token==="(")Tt(M,Ee.pop()),Ee.pop(),pe=H(M),X=new d("/","divide",[X,pe]);else{Ee.pop(),Tt(M,Ee.pop());break}else{Tt(M,Ee.pop());break}return X}function H(M){var X,pe,Ee,Re;X=G(M);for(var Je={"%":"mod",mod:"mod"};Me(Je,M.token);)pe=M.token,Ee=Je[pe],q(M),pe==="%"&&M.tokenType===y.DELIMITER&&M.token!=="("?X=new d("/","divide",[X,new l(100)],!1,!0):(Re=[X,G(M)],X=new d(pe,Ee,Re));return X}function G(M){var X,pe,Ee,Re={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return Me(Re,M.token)?(Ee=Re[M.token],X=M.token,q(M),pe=[G(M)],new d(X,Ee,pe)):Y(M)}function Y(M){var X,pe,Ee,Re;return X=ee(M),(M.token==="^"||M.token===".^")&&(pe=M.token,Ee=pe==="^"?"pow":"dotPow",q(M),Re=[X,G(M)],X=new d(pe,Ee,Re)),X}function ee(M){var X,pe,Ee,Re;X=B(M);for(var Je={"!":"factorial","'":"ctranspose"};Me(Je,M.token);)pe=M.token,Ee=Je[pe],F(M),Re=[X],X=new d(pe,Ee,Re),X=Q(M,X);return X}function B(M){var X=[];if(M.tokenType===y.SYMBOL&&Me(M.extraNodes,M.token)){var pe=M.extraNodes[M.token];if(F(M),M.token==="("){if(X=[],k(M),F(M),M.token!==")")for(X.push(V(M));M.token===",";)F(M),X.push(V(M));if(M.token!==")")throw _e(M,"Parenthesis ) expected");te(M),F(M)}return new pe(X)}return j(M)}function j(M){var X,pe;return M.tokenType===y.SYMBOL||M.tokenType===y.DELIMITER&&M.token in E?(pe=M.token,F(M),Me(A,pe)?X=new l(A[pe]):D.includes(pe)?X=new l(r(pe,"number")):X=new b(pe),X=Q(M,X),X):Z(M)}function Q(M,X,pe){for(var Ee;(M.token==="("||M.token==="["||M.token===".")&&!pe;)if(Ee=[],M.token==="(")if(zt(X)||Ti(X)){if(k(M),F(M),M.token!==")")for(Ee.push(V(M));M.token===",";)F(M),Ee.push(V(M));if(M.token!==")")throw _e(M,"Parenthesis ) expected");te(M),F(M),X=new f(X,Ee)}else return X;else if(M.token==="["){if(k(M),F(M),M.token!=="]")for(Ee.push(V(M));M.token===",";)F(M),Ee.push(V(M));if(M.token!=="]")throw _e(M,"Parenthesis ] expected");te(M),F(M),X=new i(X,new p(Ee))}else{F(M);var Re=M.tokenType===y.SYMBOL||M.tokenType===y.DELIMITER&&M.token in E;if(!Re)throw _e(M,"Property name expected after dot");Ee.push(new l(M.token)),F(M);var Je=!0;X=new i(X,new p(Ee,Je))}return X}function Z(M){var X,pe;return M.token==='"'||M.token==="'"?(pe=ie(M,M.token),X=new l(pe),X=Q(M,X),X):oe(M)}function ie(M,X){for(var pe="";R(M)!==""&&R(M)!==X;)if(R(M)==="\\"){P(M);var Ee=R(M),Re=S[Ee];if(Re!==void 0)pe+=Re,M.index+=1;else if(Ee==="u"){var Je=M.expression.slice(M.index+1,M.index+5);if(/^[0-9A-Fa-f]{4}$/.test(Je))pe+=String.fromCharCode(parseInt(Je,16)),M.index+=5;else throw _e(M,"Invalid unicode character \\u".concat(Je))}else throw _e(M,"Bad escape character \\".concat(Ee))}else pe+=R(M),P(M);if(F(M),M.token!==X)throw _e(M,"End of string ".concat(X," expected"));return F(M),pe}function oe(M){var X,pe,Ee,Re;if(M.token==="["){if(k(M),F(M),M.token!=="]"){var Je=ye(M);if(M.token===";"){for(Ee=1,pe=[Je];M.token===";";)F(M),M.token!=="]"&&(pe[Ee]=ye(M),Ee++);if(M.token!=="]")throw _e(M,"End of matrix ] expected");te(M),F(M),Re=pe[0].items.length;for(var vr=1;vr<Ee;vr++)if(pe[vr].items.length!==Re)throw wt(M,"Column dimensions mismatch ("+pe[vr].items.length+" !== "+Re+")");X=new a(pe)}else{if(M.token!=="]")throw _e(M,"End of matrix ] expected");te(M),F(M),X=Je}}else te(M),F(M),X=new a([]);return Q(M,X)}return fe(M)}function ye(M){for(var X=[V(M)],pe=1;M.token===",";)F(M),M.token!=="]"&&M.token!==";"&&(X[pe]=V(M),pe++);return new a(X)}function fe(M){if(M.token==="{"){k(M);var X,pe={};do if(F(M),M.token!=="}"){if(M.token==='"'||M.token==="'")X=ie(M,M.token);else if(M.tokenType===y.SYMBOL||M.tokenType===y.DELIMITER&&M.token in E)X=M.token,F(M);else throw _e(M,"Symbol or string expected as object key");if(M.token!==":")throw _e(M,"Colon : expected after object key");F(M),pe[X]=V(M)}while(M.token===",");if(M.token!=="}")throw _e(M,"Comma , or bracket } expected after object value");te(M),F(M);var Ee=new m(pe);return Ee=Q(M,Ee),Ee}return De(M)}function De(M){var X;return M.tokenType===y.NUMBER?(X=M.token,F(M),new l(r(X,n.number))):Ne(M)}function Ne(M){var X;if(M.token==="("){if(k(M),F(M),X=V(M),M.token!==")")throw _e(M,"Parenthesis ) expected");return te(M),F(M),X=new h(X),X=Q(M,X),X}return je(M)}function je(M){throw M.token===""?_e(M,"Unexpected end of expression"):_e(M,"Value expected")}function Ze(M){return M.index-M.token.length+1}function _e(M,X){var pe=Ze(M),Ee=new SyntaxError(X+" (char "+pe+")");return Ee.char=pe,Ee}function wt(M,X){var pe=Ze(M),Ee=new SyntaxError(X+" (char "+pe+")");return Ee.char=pe,Ee}return t.addConversion({from:"string",to:"Node",convert:g}),g}),rh="compile",gF=["typed","parse"],vF=U(rh,gF,e=>{var{typed:t,parse:r}=e;return t(rh,{string:function(n){return r(n).compile()},"Array | Matrix":function(n){return Qe(n,function(i){return r(i).compile()})}})}),nh="evaluate",yF=["typed","parse"],xF=U(nh,yF,e=>{var{typed:t,parse:r}=e;return t(nh,{string:function(n){var i=io();return r(n).compile().evaluate(i)},"string, Map | Object":function(n,i){return r(n).compile().evaluate(i)},"Array | Matrix":function(n){var i=io();return Qe(n,function(a){return r(a).compile().evaluate(i)})},"Array | Matrix, Map | Object":function(n,i){return Qe(n,function(a){return r(a).compile().evaluate(i)})}})}),bF="Parser",wF=["evaluate"],NF=U(bF,wF,e=>{var{evaluate:t}=e;function r(){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:io(),writable:!1})}return r.prototype.type="Parser",r.prototype.isParser=!0,r.prototype.evaluate=function(n){return t(n,this.scope)},r.prototype.get=function(n){if(this.scope.has(n))return this.scope.get(n)},r.prototype.getAll=function(){return TN(this.scope)},r.prototype.getAllAsMap=function(){return this.scope},r.prototype.set=function(n,i){return this.scope.set(n,i),i},r.prototype.remove=function(n){this.scope.delete(n)},r.prototype.clear=function(){this.scope.clear()},r},{isClass:!0}),ih="parser",DF=["typed","Parser"],EF=U(ih,DF,e=>{var{typed:t,Parser:r}=e;return t(ih,{"":function(){return new r}})}),ah="lup",AF=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],SF=U(ah,AF,e=>{var{typed:t,matrix:r,abs:n,addScalar:i,divideScalar:a,multiplyScalar:o,subtractScalar:u,larger:c,equalScalar:l,unaryMinus:s,DenseMatrix:f,SparseMatrix:p,Spa:m}=e;return t(ah,{DenseMatrix:function(w){return d(w)},SparseMatrix:function(w){return h(w)},Array:function(w){var v=r(w),b=d(v);return{L:b.L.valueOf(),U:b.U.valueOf(),p:b.p}}});function d(w){var v=w._size[0],b=w._size[1],g=Math.min(v,b),x=ze(w._data),y=[],N=[v,g],E=[],A=[g,b],D,S,C,_=[];for(D=0;D<v;D++)_[D]=D;for(S=0;S<b;S++){if(S>0)for(D=0;D<v;D++){var R=Math.min(D,S),P=0;for(C=0;C<R;C++)P=i(P,o(x[D][C],x[C][S]));x[D][S]=u(x[D][S],P)}var I=S,O=0,F=0;for(D=S;D<v;D++){var q=x[D][S],k=n(q);c(k,O)&&(I=D,O=k,F=q)}if(S!==I&&(_[S]=[_[I],_[I]=_[S]][0],f._swapRows(S,I,x)),S<v)for(D=S+1;D<v;D++){var te=x[D][S];l(te,0)||(x[D][S]=a(x[D][S],F))}}for(S=0;S<b;S++)for(D=0;D<v;D++){if(S===0&&(D<b&&(E[D]=[]),y[D]=[]),D<S){D<b&&(E[D][S]=x[D][S]),S<v&&(y[D][S]=0);continue}if(D===S){D<b&&(E[D][S]=x[D][S]),S<v&&(y[D][S]=1);continue}D<b&&(E[D][S]=0),S<v&&(y[D][S]=x[D][S])}var se=new f({data:y,size:N}),K=new f({data:E,size:A}),V=[];for(D=0,g=_.length;D<g;D++)V[_[D]]=D;return{L:se,U:K,p:V,toString:function(){return"L: "+this.L.toString()+`
|
|
41
|
+
`&&M.token!==";"&&M.token!==""&&(X=V(M),M.comment&&(X.comment=M.comment),Ee=M.token!==";",pe.push({node:X,visible:Ee}));return pe.length>0?new u(pe):(X||(X=new l(void 0),M.comment&&(X.comment=M.comment)),X)}function V(M){var X,pe,Ee,Re,Je=ue(M);if(M.token==="="){if(zt(Je))return X=Je.name,q(M),Ee=V(M),new o(new x(X),Ee);if(Ti(Je))return q(M),Ee=V(M),new o(Je.object,Je.index,Ee);if(Zn(Je)&&zt(Je.fn)&&(Re=!0,pe=[],X=Je.name,Je.args.forEach(function(vr,nc){zt(vr)?pe[nc]=vr.name:Re=!1}),Re))return q(M),Ee=V(M),new s(X,pe,Ee);throw _e(M,"Invalid left hand side of assignment operator =")}return Je}function ue(M){for(var X=me(M);M.token==="?";){var pe=M.conditionalLevel;M.conditionalLevel=M.nestingLevel,q(M);var Ee=X,Re=V(M);if(M.token!==":")throw _e(M,"False part of conditional expression expected");M.conditionalLevel=null,q(M);var Je=V(M);X=new c(Ee,Re,Je),M.conditionalLevel=pe}return X}function me(M){for(var X=re(M);M.token==="or";)q(M),X=new d("or","or",[X,re(M)]);return X}function re(M){for(var X=ae(M);M.token==="xor";)q(M),X=new d("xor","xor",[X,ae(M)]);return X}function ae(M){for(var X=de(M);M.token==="and";)q(M),X=new d("and","and",[X,de(M)]);return X}function de(M){for(var X=ne(M);M.token==="|";)q(M),X=new d("|","bitOr",[X,ne(M)]);return X}function ne(M){for(var X=ce(M);M.token==="^|";)q(M),X=new d("^|","bitXor",[X,ce(M)]);return X}function ce(M){for(var X=le(M);M.token==="&";)q(M),X=new d("&","bitAnd",[X,le(M)]);return X}function le(M){for(var X=[he(M)],pe=[],Ee={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};Me(Ee,M.token);){var Re={name:M.token,fn:Ee[M.token]};pe.push(Re),q(M),X.push(he(M))}return X.length===1?X[0]:X.length===2?new d(pe[0].name,pe[0].fn,X):new v(pe.map(Je=>Je.fn),X)}function he(M){var X,pe,Ee,Re;X=xe(M);for(var Je={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};Me(Je,M.token);)pe=M.token,Ee=Je[pe],q(M),Re=[X,xe(M)],X=new d(pe,Ee,Re);return X}function xe(M){var X,pe,Ee,Re;X=$(M);for(var Je={to:"to",in:"to"};Me(Je,M.token);)pe=M.token,Ee=Je[pe],q(M),pe==="in"&&M.token===""?X=new d("*","multiply",[X,new x("in")],!0):(Re=[X,$(M)],X=new d(pe,Ee,Re));return X}function $(M){var X,pe=[];if(M.token===":"?X=new l(1):X=T(M),M.token===":"&&M.conditionalLevel!==M.nestingLevel){for(pe.push(X);M.token===":"&&pe.length<3;)q(M),M.token===")"||M.token==="]"||M.token===","||M.token===""?pe.push(new x("end")):pe.push(T(M));pe.length===3?X=new w(pe[0],pe[2],pe[1]):X=new w(pe[0],pe[1])}return X}function T(M){var X,pe,Ee,Re;X=z(M);for(var Je={"+":"add","-":"subtract"};Me(Je,M.token);){pe=M.token,Ee=Je[pe],q(M);var vr=z(M);vr.isPercentage?Re=[X,new d("*","multiply",[X,vr])]:Re=[X,vr],X=new d(pe,Ee,Re)}return X}function z(M){var X,pe,Ee,Re;X=J(M),pe=X;for(var Je={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};Me(Je,M.token);)Ee=M.token,Re=Je[Ee],q(M),pe=J(M),X=new d(Ee,Re,[X,pe]);return X}function J(M){var X,pe;for(X=L(M),pe=X;M.tokenType===y.SYMBOL||M.token==="in"&&nt(X)||M.tokenType===y.NUMBER&&!nt(pe)&&(!Ct(pe)||pe.op==="!")||M.token==="(";)pe=L(M),X=new d("*","multiply",[X,pe],!0);return X}function L(M){for(var X=H(M),pe=X,Ee=[];M.token==="/"&&Fc(pe);)if(Ee.push(Tt({},M)),q(M),M.tokenType===y.NUMBER)if(Ee.push(Tt({},M)),q(M),M.tokenType===y.SYMBOL||M.token==="(")Tt(M,Ee.pop()),Ee.pop(),pe=H(M),X=new d("/","divide",[X,pe]);else{Ee.pop(),Tt(M,Ee.pop());break}else{Tt(M,Ee.pop());break}return X}function H(M){var X,pe,Ee,Re;X=G(M);for(var Je={"%":"mod",mod:"mod"};Me(Je,M.token);)pe=M.token,Ee=Je[pe],q(M),pe==="%"&&M.tokenType===y.DELIMITER&&M.token!=="("?X=new d("/","divide",[X,new l(100)],!1,!0):(Re=[X,G(M)],X=new d(pe,Ee,Re));return X}function G(M){var X,pe,Ee,Re={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return Me(Re,M.token)?(Ee=Re[M.token],X=M.token,q(M),pe=[G(M)],new d(X,Ee,pe)):Y(M)}function Y(M){var X,pe,Ee,Re;return X=ee(M),(M.token==="^"||M.token===".^")&&(pe=M.token,Ee=pe==="^"?"pow":"dotPow",q(M),Re=[X,G(M)],X=new d(pe,Ee,Re)),X}function ee(M){var X,pe,Ee,Re;X=B(M);for(var Je={"!":"factorial","'":"ctranspose"};Me(Je,M.token);)pe=M.token,Ee=Je[pe],F(M),Re=[X],X=new d(pe,Ee,Re),X=Q(M,X);return X}function B(M){var X=[];if(M.tokenType===y.SYMBOL&&Me(M.extraNodes,M.token)){var pe=M.extraNodes[M.token];if(F(M),M.token==="("){if(X=[],k(M),F(M),M.token!==")")for(X.push(V(M));M.token===",";)F(M),X.push(V(M));if(M.token!==")")throw _e(M,"Parenthesis ) expected");te(M),F(M)}return new pe(X)}return j(M)}function j(M){var X,pe;return M.tokenType===y.SYMBOL||M.tokenType===y.DELIMITER&&M.token in E?(pe=M.token,F(M),Me(A,pe)?X=new l(A[pe]):D.includes(pe)?X=new l(r(pe,"number")):X=new x(pe),X=Q(M,X),X):Z(M)}function Q(M,X,pe){for(var Ee;(M.token==="("||M.token==="["||M.token===".")&&!pe;)if(Ee=[],M.token==="(")if(zt(X)||Ti(X)){if(k(M),F(M),M.token!==")")for(Ee.push(V(M));M.token===",";)F(M),Ee.push(V(M));if(M.token!==")")throw _e(M,"Parenthesis ) expected");te(M),F(M),X=new f(X,Ee)}else return X;else if(M.token==="["){if(k(M),F(M),M.token!=="]")for(Ee.push(V(M));M.token===",";)F(M),Ee.push(V(M));if(M.token!=="]")throw _e(M,"Parenthesis ] expected");te(M),F(M),X=new i(X,new p(Ee))}else{F(M);var Re=M.tokenType===y.SYMBOL||M.tokenType===y.DELIMITER&&M.token in E;if(!Re)throw _e(M,"Property name expected after dot");Ee.push(new l(M.token)),F(M);var Je=!0;X=new i(X,new p(Ee,Je))}return X}function Z(M){var X,pe;return M.token==='"'||M.token==="'"?(pe=ie(M,M.token),X=new l(pe),X=Q(M,X),X):oe(M)}function ie(M,X){for(var pe="";R(M)!==""&&R(M)!==X;)if(R(M)==="\\"){P(M);var Ee=R(M),Re=S[Ee];if(Re!==void 0)pe+=Re,M.index+=1;else if(Ee==="u"){var Je=M.expression.slice(M.index+1,M.index+5);if(/^[0-9A-Fa-f]{4}$/.test(Je))pe+=String.fromCharCode(parseInt(Je,16)),M.index+=5;else throw _e(M,"Invalid unicode character \\u".concat(Je))}else throw _e(M,"Bad escape character \\".concat(Ee))}else pe+=R(M),P(M);if(F(M),M.token!==X)throw _e(M,"End of string ".concat(X," expected"));return F(M),pe}function oe(M){var X,pe,Ee,Re;if(M.token==="["){if(k(M),F(M),M.token!=="]"){var Je=ye(M);if(M.token===";"){for(Ee=1,pe=[Je];M.token===";";)F(M),M.token!=="]"&&(pe[Ee]=ye(M),Ee++);if(M.token!=="]")throw _e(M,"End of matrix ] expected");te(M),F(M),Re=pe[0].items.length;for(var vr=1;vr<Ee;vr++)if(pe[vr].items.length!==Re)throw wt(M,"Column dimensions mismatch ("+pe[vr].items.length+" !== "+Re+")");X=new a(pe)}else{if(M.token!=="]")throw _e(M,"End of matrix ] expected");te(M),F(M),X=Je}}else te(M),F(M),X=new a([]);return Q(M,X)}return fe(M)}function ye(M){for(var X=[V(M)],pe=1;M.token===",";)F(M),M.token!=="]"&&M.token!==";"&&(X[pe]=V(M),pe++);return new a(X)}function fe(M){if(M.token==="{"){k(M);var X,pe={};do if(F(M),M.token!=="}"){if(M.token==='"'||M.token==="'")X=ie(M,M.token);else if(M.tokenType===y.SYMBOL||M.tokenType===y.DELIMITER&&M.token in E)X=M.token,F(M);else throw _e(M,"Symbol or string expected as object key");if(M.token!==":")throw _e(M,"Colon : expected after object key");F(M),pe[X]=V(M)}while(M.token===",");if(M.token!=="}")throw _e(M,"Comma , or bracket } expected after object value");te(M),F(M);var Ee=new m(pe);return Ee=Q(M,Ee),Ee}return De(M)}function De(M){var X;return M.tokenType===y.NUMBER?(X=M.token,F(M),new l(r(X,n.number))):Ne(M)}function Ne(M){var X;if(M.token==="("){if(k(M),F(M),X=V(M),M.token!==")")throw _e(M,"Parenthesis ) expected");return te(M),F(M),X=new h(X),X=Q(M,X),X}return je(M)}function je(M){throw M.token===""?_e(M,"Unexpected end of expression"):_e(M,"Value expected")}function Ze(M){return M.index-M.token.length+1}function _e(M,X){var pe=Ze(M),Ee=new SyntaxError(X+" (char "+pe+")");return Ee.char=pe,Ee}function wt(M,X){var pe=Ze(M),Ee=new SyntaxError(X+" (char "+pe+")");return Ee.char=pe,Ee}return t.addConversion({from:"string",to:"Node",convert:g}),g}),nh="compile",yF=["typed","parse"],bF=U(nh,yF,e=>{var{typed:t,parse:r}=e;return t(nh,{string:function(n){return r(n).compile()},"Array | Matrix":function(n){return Qe(n,function(i){return r(i).compile()})}})}),ih="evaluate",xF=["typed","parse"],wF=U(ih,xF,e=>{var{typed:t,parse:r}=e;return t(ih,{string:function(n){var i=ao();return r(n).compile().evaluate(i)},"string, Map | Object":function(n,i){return r(n).compile().evaluate(i)},"Array | Matrix":function(n){var i=ao();return Qe(n,function(a){return r(a).compile().evaluate(i)})},"Array | Matrix, Map | Object":function(n,i){return Qe(n,function(a){return r(a).compile().evaluate(i)})}})}),NF="Parser",DF=["evaluate"],EF=U(NF,DF,e=>{var{evaluate:t}=e;function r(){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:ao(),writable:!1})}return r.prototype.type="Parser",r.prototype.isParser=!0,r.prototype.evaluate=function(n){return t(n,this.scope)},r.prototype.get=function(n){if(this.scope.has(n))return this.scope.get(n)},r.prototype.getAll=function(){return BN(this.scope)},r.prototype.getAllAsMap=function(){return this.scope},r.prototype.set=function(n,i){return this.scope.set(n,i),i},r.prototype.remove=function(n){this.scope.delete(n)},r.prototype.clear=function(){this.scope.clear()},r},{isClass:!0}),ah="parser",AF=["typed","Parser"],SF=U(ah,AF,e=>{var{typed:t,Parser:r}=e;return t(ah,{"":function(){return new r}})}),oh="lup",CF=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],MF=U(oh,CF,e=>{var{typed:t,matrix:r,abs:n,addScalar:i,divideScalar:a,multiplyScalar:o,subtractScalar:u,larger:c,equalScalar:l,unaryMinus:s,DenseMatrix:f,SparseMatrix:p,Spa:m}=e;return t(oh,{DenseMatrix:function(w){return d(w)},SparseMatrix:function(w){return h(w)},Array:function(w){var v=r(w),x=d(v);return{L:x.L.valueOf(),U:x.U.valueOf(),p:x.p}}});function d(w){var v=w._size[0],x=w._size[1],g=Math.min(v,x),b=ze(w._data),y=[],N=[v,g],E=[],A=[g,x],D,S,C,_=[];for(D=0;D<v;D++)_[D]=D;for(S=0;S<x;S++){if(S>0)for(D=0;D<v;D++){var R=Math.min(D,S),P=0;for(C=0;C<R;C++)P=i(P,o(b[D][C],b[C][S]));b[D][S]=u(b[D][S],P)}var I=S,O=0,F=0;for(D=S;D<v;D++){var q=b[D][S],k=n(q);c(k,O)&&(I=D,O=k,F=q)}if(S!==I&&(_[S]=[_[I],_[I]=_[S]][0],f._swapRows(S,I,b)),S<v)for(D=S+1;D<v;D++){var te=b[D][S];l(te,0)||(b[D][S]=a(b[D][S],F))}}for(S=0;S<x;S++)for(D=0;D<v;D++){if(S===0&&(D<x&&(E[D]=[]),y[D]=[]),D<S){D<x&&(E[D][S]=b[D][S]),S<v&&(y[D][S]=0);continue}if(D===S){D<x&&(E[D][S]=b[D][S]),S<v&&(y[D][S]=1);continue}D<x&&(E[D][S]=0),S<v&&(y[D][S]=b[D][S])}var se=new f({data:y,size:N}),K=new f({data:E,size:A}),V=[];for(D=0,g=_.length;D<g;D++)V[_[D]]=D;return{L:se,U:K,p:V,toString:function(){return"L: "+this.L.toString()+`
|
|
42
42
|
U: `+this.U.toString()+`
|
|
43
|
-
P: `+this.p}}}function h(w){var v=w._size[0],
|
|
43
|
+
P: `+this.p}}}function h(w){var v=w._size[0],x=w._size[1],g=Math.min(v,x),b=w._values,y=w._index,N=w._ptr,E=[],A=[],D=[],S=[v,g],C=[],_=[],R=[],P=[g,x],I,O,F,q=[],k=[];for(I=0;I<v;I++)q[I]=I,k[I]=I;var te=function(K,V){var ue=k[K],me=k[V];q[ue]=V,q[me]=K,k[K]=me,k[V]=ue},se=function(){var K=new m;O<v&&(D.push(E.length),E.push(1),A.push(O)),R.push(C.length);var V=N[O],ue=N[O+1];for(F=V;F<ue;F++)I=y[F],K.set(q[I],b[F]);O>0&&K.forEach(0,O-1,function(de,ne){p._forEachRow(de,E,A,D,function(ce,le){ce>de&&K.accumulate(ce,s(o(le,ne)))})});var me=O,re=K.get(O),ae=n(re);K.forEach(O+1,v-1,function(de,ne){var ce=n(ne);c(ce,ae)&&(me=de,ae=ce,re=ne)}),O!==me&&(p._swapRows(O,me,S[1],E,A,D),p._swapRows(O,me,P[1],C,_,R),K.swap(O,me),te(O,me)),K.forEach(0,v-1,function(de,ne){de<=O?(C.push(ne),_.push(de)):(ne=a(ne,re),l(ne,0)||(E.push(ne),A.push(de)))})};for(O=0;O<x;O++)se();return R.push(C.length),D.push(E.length),{L:new p({values:E,index:A,ptr:D,size:S}),U:new p({values:C,index:_,ptr:R,size:P}),p:q,toString:function(){return"L: "+this.L.toString()+`
|
|
44
44
|
U: `+this.U.toString()+`
|
|
45
|
-
P: `+this.p}}}}),
|
|
46
|
-
R: `+this.R.toString()}}}function v(g){var
|
|
45
|
+
P: `+this.p}}}}),sh="qr",_F=["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtractScalar","complex"],FF=U(sh,_F,e=>{var{typed:t,matrix:r,zeros:n,identity:i,isZero:a,equal:o,sign:u,sqrt:c,conj:l,unaryMinus:s,addScalar:f,divideScalar:p,multiplyScalar:m,subtractScalar:d,complex:h}=e;return Tt(t(sh,{DenseMatrix:function(g){return v(g)},SparseMatrix:function(g){return x()},Array:function(g){var b=r(g),y=v(b);return{Q:y.Q.valueOf(),R:y.R.valueOf()}}}),{_denseQRimpl:w});function w(g){var b=g._size[0],y=g._size[1],N=i([b],"dense"),E=N._data,A=g.clone(),D=A._data,S,C,_,R=n([b],"");for(_=0;_<Math.min(y,b);++_){var P=D[_][_],I=s(o(P,0)?1:u(P)),O=l(I),F=0;for(S=_;S<b;S++)F=f(F,m(D[S][_],l(D[S][_])));var q=m(I,c(F));if(!a(q)){var k=d(P,q);for(R[_]=1,S=_+1;S<b;S++)R[S]=p(D[S][_],k);var te=s(l(p(k,q))),se=void 0;for(C=_;C<y;C++){for(se=0,S=_;S<b;S++)se=f(se,m(l(R[S]),D[S][C]));for(se=m(se,te),S=_;S<b;S++)D[S][C]=m(d(D[S][C],m(R[S],se)),O)}for(S=0;S<b;S++){for(se=0,C=_;C<b;C++)se=f(se,m(E[S][C],R[C]));for(se=m(se,te),C=_;C<b;++C)E[S][C]=p(d(E[S][C],m(se,l(R[C]))),O)}}}return{Q:N,R:A,toString:function(){return"Q: "+this.Q.toString()+`
|
|
46
|
+
R: `+this.R.toString()}}}function v(g){var b=w(g),y=b.R._data;if(g._data.length>0)for(var N=y[0][0].type==="Complex"?h(0):0,E=0;E<y.length;++E)for(var A=0;A<E&&A<(y[0]||[]).length;++A)y[E][A]=N;return b}function x(g){throw new Error("qr not implemented for sparse matrices yet")}});function TF(e,t,r,n){e._values;for(var i=e._index,a=e._ptr,o=e._size,u=e._datatype,c=o[0],l=o[1],s=null,f=[],p=[],m=0,d=0;d<l;d++){p[d]=m;for(var h=r?r[d]:d,w=a[h],v=a[h+1],x=w;x<v;x++){var g=i[x];f[m]=g,m++}}return p[l]=m,e.createSparseMatrix({values:s,index:f,ptr:p,size:[c,l],datatype:u})}function Ly(e,t,r,n,i,a,o){var u=0;for(r[o]=e;u>=0;){var c=r[o+u],l=r[n+c];l===-1?(u--,a[t++]=c):(r[n+c]=r[i+l],++u,r[o+u]=l)}return t}function OF(e,t){if(!e)return null;var r=0,n,i=[],a=[],o=0,u=t,c=2*t;for(n=0;n<t;n++)a[o+n]=-1;for(n=t-1;n>=0;n--)e[n]!==-1&&(a[u+n]=a[o+e[n]],a[o+e[n]]=n);for(n=0;n<t;n++)e[n]===-1&&(r=Ly(n,r,a,o,u,i,c));return i}function BF(e,t){if(!e)return null;var r=e._index,n=e._ptr,i=e._size,a=i[0],o=i[1],u=[],c=[],l=0,s=o,f,p;for(f=0;f<a;f++)c[s+f]=-1;for(var m=0;m<o;m++){u[m]=-1,c[l+m]=-1;for(var d=n[m],h=n[m+1],w=d;w<h;w++){var v=r[w];for(f=c[s+v];f!==-1&&f<m;f=p)p=c[l+f],c[l+f]=m,p===-1&&(u[f]=m);c[s+v]=m}}return u}function kF(e,t,r){for(var n=e._values,i=e._index,a=e._ptr,o=e._size,u=o[1],c=0,l=0;l<u;l++){var s=a[l];for(a[l]=c;s<a[l+1];s++)t(i[s],l,n?n[s]:1,r)&&(i[c]=i[s],n&&(n[c]=n[s]),c++)}return a[u]=c,i.splice(c,i.length-c),n&&n.splice(c,n.length-c),c}function Vn(e){return-e-2}var IF="csAmd",RF=["add","multiply","transpose"],qF=U(IF,RF,e=>{var{add:t,multiply:r,transpose:n}=e;return function(l,s){if(!s||l<=0||l>3)return null;var f=s._size,p=f[0],m=f[1],d=0,h=Math.max(16,10*Math.sqrt(m));h=Math.min(m-2,h);var w=i(l,s,p,m,h);kF(w,c,null);for(var v=w._index,x=w._ptr,g=x[m],b=[],y=[],N=0,E=m+1,A=2*(m+1),D=3*(m+1),S=4*(m+1),C=5*(m+1),_=6*(m+1),R=7*(m+1),P=b,I=a(m,x,y,N,D,P,A,R,E,_,S,C),O=o(m,x,y,C,S,_,h,E,D,P,A),F=0,q,k,te,se,K,V,ue,me,re,ae,de,ne,ce,le,he,xe;O<m;){for(te=-1;F<m&&(te=y[D+F])===-1;F++);y[A+te]!==-1&&(P[y[A+te]]=-1),y[D+F]=y[A+te];var $=y[S+te],T=y[E+te];O+=T;var z=0;y[E+te]=-T;var J=x[te],L=$===0?J:g,H=L;for(se=1;se<=$+1;se++){for(se>$?(V=te,ue=J,me=y[N+te]-$):(V=v[J++],ue=x[V],me=y[N+V]),K=1;K<=me;K++)q=v[ue++],!((re=y[E+q])<=0)&&(z+=re,y[E+q]=-re,v[H++]=q,y[A+q]!==-1&&(P[y[A+q]]=P[q]),P[q]!==-1?y[A+P[q]]=y[A+q]:y[D+y[C+q]]=y[A+q]);V!==te&&(x[V]=Vn(te),y[_+V]=0)}for($!==0&&(g=H),y[C+te]=z,x[te]=L,y[N+te]=H-L,y[S+te]=-2,I=u(I,d,y,_,m),ae=L;ae<H;ae++)if(q=v[ae],!((de=y[S+q])<=0)){re=-y[E+q];var G=I-re;for(J=x[q],ne=x[q]+de-1;J<=ne;J++)V=v[J],y[_+V]>=I?y[_+V]-=re:y[_+V]!==0&&(y[_+V]=y[C+V]+G)}for(ae=L;ae<H;ae++){for(q=v[ae],ne=x[q],ce=ne+y[S+q]-1,le=ne,he=0,xe=0,J=ne;J<=ce;J++)if(V=v[J],y[_+V]!==0){var Y=y[_+V]-I;Y>0?(xe+=Y,v[le++]=V,he+=V):(x[V]=Vn(te),y[_+V]=0)}y[S+q]=le-ne+1;var ee=le,B=ne+y[N+q];for(J=ce+1;J<B;J++){k=v[J];var j=y[E+k];j<=0||(xe+=j,v[le++]=k,he+=k)}xe===0?(x[q]=Vn(te),re=-y[E+q],z-=re,T+=re,O+=re,y[E+q]=0,y[S+q]=-1):(y[C+q]=Math.min(y[C+q],xe),v[le]=v[ee],v[ee]=v[ne],v[ne]=te,y[N+q]=le-ne+1,he=(he<0?-he:he)%m,y[A+q]=y[R+he],y[R+he]=q,P[q]=he)}for(y[C+te]=z,d=Math.max(d,z),I=u(I+d,d,y,_,m),ae=L;ae<H;ae++)if(q=v[ae],!(y[E+q]>=0))for(he=P[q],q=y[R+he],y[R+he]=-1;q!==-1&&y[A+q]!==-1;q=y[A+q],I++){for(me=y[N+q],de=y[S+q],J=x[q]+1;J<=x[q]+me-1;J++)y[_+v[J]]=I;var Q=q;for(k=y[A+q];k!==-1;){var Z=y[N+k]===me&&y[S+k]===de;for(J=x[k]+1;Z&&J<=x[k]+me-1;J++)y[_+v[J]]!==I&&(Z=0);Z?(x[k]=Vn(q),y[E+q]+=y[E+k],y[E+k]=0,y[S+k]=-1,k=y[A+k],y[A+Q]=k):(Q=k,k=y[A+k])}}for(J=L,ae=L;ae<H;ae++)q=v[ae],!((re=-y[E+q])<=0)&&(y[E+q]=re,xe=y[C+q]+z-re,xe=Math.min(xe,m-O-re),y[D+xe]!==-1&&(P[y[D+xe]]=q),y[A+q]=y[D+xe],P[q]=-1,y[D+xe]=q,F=Math.min(F,xe),y[C+q]=xe,v[J++]=q);y[E+te]=T,(y[N+te]=J-L)===0&&(x[te]=-1,y[_+te]=0),$!==0&&(g=J)}for(q=0;q<m;q++)x[q]=Vn(x[q]);for(k=0;k<=m;k++)y[D+k]=-1;for(k=m;k>=0;k--)y[E+k]>0||(y[A+k]=y[D+x[k]],y[D+x[k]]=k);for(V=m;V>=0;V--)y[E+V]<=0||x[V]!==-1&&(y[A+V]=y[D+x[V]],y[D+x[V]]=V);for(te=0,q=0;q<=m;q++)x[q]===-1&&(te=Ly(q,te,y,D,A,b,_));return b.splice(b.length-1,1),b};function i(l,s,f,p,m){var d=n(s);if(l===1&&p===f)return t(s,d);if(l===2){for(var h=d._index,w=d._ptr,v=0,x=0;x<f;x++){var g=w[x];if(w[x]=v,!(w[x+1]-g>m))for(var b=w[x+1];g<b;g++)h[v++]=h[g]}return w[f]=v,s=n(d),r(d,s)}return r(d,s)}function a(l,s,f,p,m,d,h,w,v,x,g,b){for(var y=0;y<l;y++)f[p+y]=s[y+1]-s[y];f[p+l]=0;for(var N=0;N<=l;N++)f[m+N]=-1,d[N]=-1,f[h+N]=-1,f[w+N]=-1,f[v+N]=1,f[x+N]=1,f[g+N]=0,f[b+N]=f[p+N];var E=u(0,0,f,x,l);return f[g+l]=-2,s[l]=-1,f[x+l]=0,E}function o(l,s,f,p,m,d,h,w,v,x,g){for(var b=0,y=0;y<l;y++){var N=f[p+y];if(N===0)f[m+y]=-2,b++,s[y]=-1,f[d+y]=0;else if(N>h)f[w+y]=0,f[m+y]=-1,b++,s[y]=Vn(l),f[w+l]++;else{var E=f[v+N];E!==-1&&(x[E]=y),f[g+y]=f[v+N],f[v+N]=y}}return b}function u(l,s,f,p,m){if(l<2||l+s<0){for(var d=0;d<m;d++)f[p+d]!==0&&(f[p+d]=1);l=2}return l}function c(l,s){return l!==s}});function zF(e,t,r,n,i,a,o){var u,c,l=0,s;if(e<=t||r[n+t]<=r[i+e])return-1;r[i+e]=r[n+t];var f=r[a+e];if(r[a+e]=t,f===-1)l=1,s=e;else{for(l=2,s=f;s!==r[o+s];s=r[o+s]);for(u=f;u!==s;u=c)c=r[o+u],r[o+u]=s}return{jleaf:l,q:s}}var jF="csCounts",LF=["transpose"],PF=U(jF,LF,e=>{var{transpose:t}=e;return function(r,n,i,a){if(!r||!n||!i)return null;var o=r._size,u=o[0],c=o[1],l,s,f,p,m,d,h,w=4*c+(a?c+u+1:0),v=[],x=0,g=c,b=2*c,y=3*c,N=4*c,E=5*c+1;for(f=0;f<w;f++)v[f]=-1;var A=[],D=t(r),S=D._index,C=D._ptr;for(f=0;f<c;f++)for(s=i[f],A[s]=v[y+s]===-1?1:0;s!==-1&&v[y+s]===-1;s=n[s])v[y+s]=f;if(a){for(f=0;f<c;f++)v[i[f]]=f;for(l=0;l<u;l++){for(f=c,d=C[l],h=C[l+1],m=d;m<h;m++)f=Math.min(f,v[S[m]]);v[E+l]=v[N+f],v[N+f]=l}}for(l=0;l<c;l++)v[x+l]=l;for(f=0;f<c;f++){for(s=i[f],n[s]!==-1&&A[n[s]]--,p=a?v[N+f]:s;p!==-1;p=a?v[E+p]:-1)for(m=C[p];m<C[p+1];m++){l=S[m];var _=zF(l,s,v,y,g,b,x);_.jleaf>=1&&A[s]++,_.jleaf===2&&A[_.q]--}n[s]!==-1&&(v[x+s]=n[s])}for(s=0;s<c;s++)n[s]!==-1&&(A[n[s]]+=A[s]);return A}}),VF="csSqr",UF=["add","multiply","transpose"],$F=U(VF,UF,e=>{var{add:t,multiply:r,transpose:n}=e,i=qF({add:t,multiply:r,transpose:n}),a=PF({transpose:n});return function(u,c,l){var s=c._ptr,f=c._size,p=f[1],m,d={};if(d.q=i(u,c),u&&!d.q)return null;if(l){var h=u?TF(c,null,d.q):c;d.parent=BF(h);var w=OF(d.parent,p);if(d.cp=a(h,d.parent,w,1),h&&d.parent&&d.cp&&o(h,d))for(d.unz=0,m=0;m<p;m++)d.unz+=d.cp[m]}else d.unz=4*s[p]+p,d.lnz=d.unz;return d};function o(u,c){var l=u._ptr,s=u._index,f=u._size,p=f[0],m=f[1];c.pinv=[],c.leftmost=[];var d=c.parent,h=c.pinv,w=c.leftmost,v=[],x=0,g=p,b=p+m,y=p+2*m,N,E,A,D,S;for(E=0;E<m;E++)v[g+E]=-1,v[b+E]=-1,v[y+E]=0;for(N=0;N<p;N++)w[N]=-1;for(E=m-1;E>=0;E--)for(D=l[E],S=l[E+1],A=D;A<S;A++)w[s[A]]=E;for(N=p-1;N>=0;N--)h[N]=-1,E=w[N],E!==-1&&(v[y+E]++===0&&(v[b+E]=N),v[x+N]=v[g+E],v[g+E]=N);for(c.lnz=0,c.m2=p,E=0;E<m;E++)if(N=v[g+E],c.lnz++,N<0&&(N=c.m2++),h[N]=E,!(--y[E]<=0)){c.lnz+=v[y+E];var C=d[E];C!==-1&&(v[y+C]===0&&(v[b+C]=v[b+E]),v[x+v[b+E]]=v[g+C],v[g+C]=v[x+N],v[y+C]+=v[y+E])}for(N=0;N<p;N++)h[N]<0&&(h[N]=E++);return!0}});function Hc(e,t){return e[t]<0}function Py(e,t){e[t]=Vn(e[t])}function uh(e){return e<0?Vn(e):e}function HF(e,t,r,n,i){var a=t._index,o=t._ptr,u=t._size,c=u[1],l,s,f,p=0;for(n[0]=e;p>=0;){e=n[p];var m=i?i[e]:e;Hc(o,e)||(Py(o,e),n[c+p]=m<0?0:uh(o[m]));var d=1;for(s=n[c+p],f=m<0?0:uh(o[m+1]);s<f;s++)if(l=a[s],!Hc(o,l)){n[c+p]=s,n[++p]=l,d=0;break}d&&(p--,n[--r]=e)}return r}function JF(e,t,r,n,i){var a=e._ptr,o=e._size,u=t._index,c=t._ptr,l=o[1],s,f,p,m=l;for(f=c[r],p=c[r+1],s=f;s<p;s++){var d=u[s];Hc(a,d)||(m=HF(d,e,m,n,i))}for(s=m;s<l;s++)Py(a,n[s]);return m}var GF="csSpsolve",WF=["divideScalar","multiply","subtract"],KF=U(GF,WF,e=>{var{divideScalar:t,multiply:r,subtract:n}=e;return function(i,a,o,u,c,l,s){var f=i._values,p=i._index,m=i._ptr,d=i._size,h=d[1],w=a._values,v=a._index,x=a._ptr,g,b,y,N,E=JF(i,a,o,u,l);for(g=E;g<h;g++)c[u[g]]=0;for(b=x[o],y=x[o+1],g=b;g<y;g++)c[v[g]]=w[g];for(var A=E;A<h;A++){var D=u[A],S=l?l[D]:D;if(!(S<0))for(b=m[S],y=m[S+1],c[D]=t(c[D],f[s?b:y-1]),g=s?b+1:b,N=s?y:y-1;g<N;g++){var C=p[g];c[C]=n(c[C],r(f[g],c[D]))}}return E}}),QF="csLu",ZF=["abs","divideScalar","multiply","subtract","larger","largerEq","SparseMatrix"],XF=U(QF,ZF,e=>{var{abs:t,divideScalar:r,multiply:n,subtract:i,larger:a,largerEq:o,SparseMatrix:u}=e,c=KF({divideScalar:r,multiply:n,subtract:i});return function(l,s,f){if(!l)return null;var p=l._size,m=p[1],d,h=100,w=100;s&&(d=s.q,h=s.lnz||h,w=s.unz||w);var v=[],x=[],g=[],b=new u({values:v,index:x,ptr:g,size:[m,m]}),y=[],N=[],E=[],A=new u({values:y,index:N,ptr:E,size:[m,m]}),D=[],S,C,_=[],R=[];for(S=0;S<m;S++)_[S]=0,D[S]=-1,g[S+1]=0;h=0,w=0;for(var P=0;P<m;P++){g[P]=h,E[P]=w;var I=d?d[P]:P,O=c(b,l,I,R,_,D,1),F=-1,q=-1;for(C=O;C<m;C++)if(S=R[C],D[S]<0){var k=t(_[S]);a(k,q)&&(q=k,F=S)}else N[w]=D[S],y[w++]=_[S];if(F===-1||q<=0)return null;D[I]<0&&o(t(_[I]),n(q,f))&&(F=I);var te=_[F];for(N[w]=P,y[w++]=te,D[F]=P,x[h]=F,v[h++]=1,C=O;C<m;C++)S=R[C],D[S]<0&&(x[h]=S,v[h++]=r(_[S],te)),_[S]=0}for(g[m]=h,E[m]=w,C=0;C<h;C++)x[C]=D[x[C]];return v.splice(h,v.length-h),x.splice(h,x.length-h),y.splice(w,y.length-w),N.splice(w,N.length-w),{L:b,U:A,pinv:D}}}),ch="slu",YF=["typed","abs","add","multiply","transpose","divideScalar","subtract","larger","largerEq","SparseMatrix"],eT=U(ch,YF,e=>{var{typed:t,abs:r,add:n,multiply:i,transpose:a,divideScalar:o,subtract:u,larger:c,largerEq:l,SparseMatrix:s}=e,f=$F({add:n,multiply:i,transpose:a}),p=XF({abs:r,divideScalar:o,multiply:i,subtract:u,larger:c,largerEq:l,SparseMatrix:s});return t(ch,{"SparseMatrix, number, number":function(m,d,h){if(!Fe(d)||d<0||d>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(h<0||h>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var w=f(d,m,!1),v=p(m,w,h);return{L:v.L,U:v.U,p:v.pinv,q:w.q,toString:function(){return"L: "+this.L.toString()+`
|
|
47
47
|
U: `+this.U.toString()+`
|
|
48
48
|
p: `+this.p.toString()+(this.q?`
|
|
49
49
|
q: `+this.q.toString():"")+`
|
|
50
|
-
`}}}})});function
|
|
50
|
+
`}}}})});function lh(e,t){var r,n=t.length,i=[];if(e)for(r=0;r<n;r++)i[e[r]]=t[r];else for(r=0;r<n;r++)i[r]=t[r];return i}var fh="lusolve",tT=["typed","matrix","lup","slu","usolve","lsolve","DenseMatrix"],rT=U(fh,tT,e=>{var{typed:t,matrix:r,lup:n,slu:i,usolve:a,lsolve:o,DenseMatrix:u}=e,c=Eo({DenseMatrix:u});return t(fh,{"Array, Array | Matrix":function(f,p){f=r(f);var m=n(f),d=s(m.L,m.U,m.p,null,p);return d.valueOf()},"DenseMatrix, Array | Matrix":function(f,p){var m=n(f);return s(m.L,m.U,m.p,null,p)},"SparseMatrix, Array | Matrix":function(f,p){var m=n(f);return s(m.L,m.U,m.p,null,p)},"SparseMatrix, Array | Matrix, number, number":function(f,p,m,d){var h=i(f,m,d);return s(h.L,h.U,h.p,h.q,p)},"Object, Array | Matrix":function(f,p){return s(f.L,f.U,f.p,f.q,p)}});function l(f){if(ke(f))return f;if(st(f))return r(f);throw new TypeError("Invalid Matrix LU decomposition")}function s(f,p,m,d,h){f=l(f),p=l(p),m&&(h=c(f,h,!0),h._data=lh(m,h._data));var w=o(f,h),v=a(p,w);return d&&(v._data=lh(d,v._data)),v}}),ph="polynomialRoot",nT=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],iT=U(ph,nT,e=>{var{typed:t,isZero:r,equalScalar:n,add:i,subtract:a,multiply:o,divide:u,sqrt:c,unaryMinus:l,cbrt:s,typeOf:f,im:p,re:m}=e;return t(ph,{"number|Complex, ...number|Complex":(d,h)=>{for(var w=[d,...h];w.length>0&&r(w[w.length-1]);)w.pop();if(w.length<2)throw new RangeError("Polynomial [".concat(d,", ").concat(h,"] must have a non-zero non-constant coefficient"));switch(w.length){case 2:return[l(u(w[0],w[1]))];case 3:{var[v,x,g]=w,b=o(2,g),y=o(x,x),N=o(4,g,v);if(n(y,N))return[u(l(x),b)];var E=c(a(y,N));return[u(a(E,x),b),u(a(l(E),x),b)]}case 4:{var[A,D,S,C]=w,_=l(o(3,C)),R=o(S,S),P=o(3,C,D),I=i(o(2,S,S,S),o(27,C,C,A)),O=o(9,C,S,D);if(n(R,P)&&n(I,O))return[u(S,_)];var F=a(R,P),q=a(I,O),k=i(o(18,C,S,D,A),o(S,S,D,D)),te=i(o(4,S,S,S,A),o(4,C,D,D,D),o(27,C,C,A,A));if(n(k,te))return[u(a(o(4,C,S,D),i(o(9,C,C,A),o(S,S,S))),o(C,F)),u(a(o(9,C,A),o(S,D)),o(2,F))];var se;n(R,P)?se=q:se=u(i(q,c(a(o(q,q),o(4,F,F,F)))),2);var K=!0,V=s(se,K).toArray().map(ue=>u(i(S,ue,u(F,ue)),_));return V.map(ue=>f(ue)==="Complex"&&n(m(ue),m(ue)+p(ue))?m(ue):ue)}default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(w))}}})}),aT="Help",oT=["evaluate"],sT=U(aT,oT,e=>{var{evaluate:t}=e;function r(n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!n)throw new Error('Argument "doc" missing');this.doc=n}return r.prototype.type="Help",r.prototype.isHelp=!0,r.prototype.toString=function(){var n=this.doc||{},i=`
|
|
51
51
|
`;if(n.name&&(i+="Name: "+n.name+`
|
|
52
52
|
|
|
53
53
|
`),n.category&&(i+="Category: "+n.category+`
|
|
@@ -61,47 +61,47 @@ q: `+this.q.toString():"")+`
|
|
|
61
61
|
|
|
62
62
|
`),n.examples){i+=`Examples:
|
|
63
63
|
`;for(var a=!1,o=t("config()"),u={config:f=>(a=!0,t("config(newConfig)",{newConfig:f}))},c=0;c<n.examples.length;c++){var l=n.examples[c];i+=" "+l+`
|
|
64
|
-
`;var s=void 0;try{s=t(l,u)}catch(f){s=f}s!==void 0&&!
|
|
64
|
+
`;var s=void 0;try{s=t(l,u)}catch(f){s=f}s!==void 0&&!Lg(s)&&(i+=" "+Ge(s,{precision:14})+`
|
|
65
65
|
`)}i+=`
|
|
66
66
|
`,a&&t("config(originalConfig)",{originalConfig:o})}return n.mayThrow&&n.mayThrow.length&&(i+="Throws: "+n.mayThrow.join(", ")+`
|
|
67
67
|
|
|
68
68
|
`),n.seealso&&n.seealso.length&&(i+="See also: "+n.seealso.join(", ")+`
|
|
69
|
-
`),i},r.prototype.toJSON=function(){var n=ze(this.doc);return n.mathjs="Help",n},r.fromJSON=function(n){var i={};return Object.keys(n).filter(a=>a!=="mathjs").forEach(a=>{i[a]=n[a]}),new r(i)},r.prototype.valueOf=r.prototype.toString,r},{isClass:!0}),oT="Chain",sT=["?on","math","typed"],uT=U(oT,sT,e=>{var{on:t,math:r,typed:n}=e;function i(l){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");Lg(l)?this.value=l.value:this.value=l}i.prototype.type="Chain",i.prototype.isChain=!0,i.prototype.done=function(){return this.value},i.prototype.valueOf=function(){return this.value},i.prototype.toString=function(){return Ge(this.value)},i.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},i.fromJSON=function(l){return new i(l.value)};function a(l,s){typeof s=="function"&&(i.prototype[l]=u(s))}function o(l,s){iN(i.prototype,l,function(){var f=s();if(typeof f=="function")return u(f)})}function u(l){return function(){if(arguments.length===0)return new i(l(this.value));for(var s=[this.value],f=0;f<arguments.length;f++)s[f+1]=arguments[f];if(n.isTypedFunction(l)){var p=n.resolve(l,s);if(p.params.length===1)throw new Error("chain function "+l.name+" cannot match rest parameter between chain value and additional arguments.");return new i(p.implementation.apply(l,s))}return new i(l.apply(l,s))}}i.createProxy=function(l,s){if(typeof l=="string")a(l,s);else{var f=function(m){Me(l,m)&&c[m]===void 0&&o(m,()=>l[m])};for(var p in l)f(p)}};var c={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return i.createProxy(r),t&&t("import",function(l,s,f){f||o(l,s)}),i},{isClass:!0}),ph={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"]},cT={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]},lT={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:[]},fT={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:[]},pT={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]},mT={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]},dT={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:[]},hT={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:[]},gT={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]},vT={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]},yT={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:[]},mh={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"]},xT={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:[]},bT={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]},wT={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"]},NT={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]},DT={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]},ET={name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","complex","fraction","index","matrix","string","unit"]},AT={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"]},ST={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"]},CT={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"]},MT={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,den)","fraction({n: num, d: den})"],description:"Create a fraction from a number or from integer numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)","fraction({n: 333, d: 53})","fraction([sqrt(9), sqrt(10), sqrt(11)])"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]},_T={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"]},FT={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"]},TT={name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","boolean","complex","fraction","index","matrix","string","unit"]},OT={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"]},BT={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"]},kT={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"]},IT={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"]},RT={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:[]},qT={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:[]},zT={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:[]},jT={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"]},LT={name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leafCount("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]},PT={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"]},VT={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"]},UT={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"]},$T={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"]},HT={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"]},JT={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"]},GT={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"]},WT={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"]},KT={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"]},QT={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"]},ZT={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"]},XT={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"]},YT={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"]},e5={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"]},t5={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"]},r5={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]},n5={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"]},i5={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"]},a5={name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)"],seealso:["floor","fix","round"]},o5={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"]},s5={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"]},u5={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"]},c5={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"]},l5={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"]},f5={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"]},p5={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"]},m5={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"]},d5={name:"fix",category:"Arithmetic",syntax:["fix(x)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)"],seealso:["ceil","floor","round"]},h5={name:"floor",category:"Arithmetic",syntax:["floor(x)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)"],seealso:["ceil","fix","round"]},g5={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"]},v5={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenusa of a list with values. ",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]},y5={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"]},x5={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"]},b5={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"]},w5={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"]},N5={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"]},D5={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"]},E5={name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]},A5={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"]},S5={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")']},C5={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"]},M5={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"]},_5={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"]},F5={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"]},T5={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]},O5={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"]},B5={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"]},k5={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"]},I5={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"]},R5={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"]},q5={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"]},z5={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"]},j5={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"]},L5={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]},P5={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"]},V5={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"]},U5={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"]},$5={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"]},H5={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"]},J5={name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]},G5={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"]},W5={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"]},K5={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"]},Q5={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"]},Z5={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"]},X5={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"]},Y5={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"]},eO={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"]},tO={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"]},rO={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"]},nO={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:[]},iO={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]},aO={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:[]},oO={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:[]},sO={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"]},uO={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"]},cO={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"]},lO={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"]},fO={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"]},pO={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"]},mO={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"]},dO={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"]},hO={name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},gO={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"]},vO={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"]},yO={name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicant the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["A = [1, 2, 4, 7, 0]","diff(A)","diff(A, 1)","B = [[1, 2], [3, 4]]","diff(B)","diff(B, 1)","diff(B, 2)","diff(B, bignumber(2))","diff([[1, 2], matrix([3, 4])], 2)"],seealso:["subtract","partitionSelect"]},xO={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"]},bO={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"]},wO={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"]},NO={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"]},DO={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"]},EO={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"]},AO={name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},SO={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"]},CO={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"]},MO={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"]},_O={name:"map",category:"Matrix",syntax:["map(x, callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.",examples:["map([1, 2, 3], square)"],seealso:["filter","forEach"]},FO={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"]},TO={name:"matrixFromFunction",category:"Matrix",syntax:["matrixFromFunction(size, fn)","matrixFromFunction(size, fn, format)","matrixFromFunction(size, fn, format, datatype)","matrixFromFunction(size, format, fn)","matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]},OO={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"]},BO={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"]},kO={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"]},IO={name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"range(1m, 1m, 3m)","a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]},RO={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"]},qO={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"]},zO={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"]},jO={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"]},LO={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"]},PO={name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]},VO={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"]},UO={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"]},$O={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation `l:u`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]","f[[1,2], [1,3]] = [9, 10; 11, 12]","f"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]},HO={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"]},JO={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"]},GO={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"]},WO={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]},KO={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]},QO={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"]},ZO={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"]},XO={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"]},YO={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"]},e8={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"]},t8={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:[]},r8={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"]},n8={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"]},i8={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"]},a8={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"]},o8={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"]},s8={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"]},u8={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"]},c8={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"]},l8={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"]},f8={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"]},p8={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"]},m8={name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]},d8={name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]},h8={name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]},g8={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"]},v8={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"]},y8={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"]},x8={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"]},b8={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"]},w8={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"]},N8={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"]},D8={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"]},E8={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"]},A8={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"]},S8={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"]},C8={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"]},M8={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:[]},_8={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:[]},F8={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:[]},T8={name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemanns Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]},O8={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"]},B8={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]},k8={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"]},I8={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"]},R8={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]},q8={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"]},z8={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"]},j8={name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:`Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber.
|
|
69
|
+
`),i},r.prototype.toJSON=function(){var n=ze(this.doc);return n.mathjs="Help",n},r.fromJSON=function(n){var i={};return Object.keys(n).filter(a=>a!=="mathjs").forEach(a=>{i[a]=n[a]}),new r(i)},r.prototype.valueOf=r.prototype.toString,r},{isClass:!0}),uT="Chain",cT=["?on","math","typed"],lT=U(uT,cT,e=>{var{on:t,math:r,typed:n}=e;function i(l){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");Pg(l)?this.value=l.value:this.value=l}i.prototype.type="Chain",i.prototype.isChain=!0,i.prototype.done=function(){return this.value},i.prototype.valueOf=function(){return this.value},i.prototype.toString=function(){return Ge(this.value)},i.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},i.fromJSON=function(l){return new i(l.value)};function a(l,s){typeof s=="function"&&(i.prototype[l]=u(s))}function o(l,s){oN(i.prototype,l,function(){var f=s();if(typeof f=="function")return u(f)})}function u(l){return function(){if(arguments.length===0)return new i(l(this.value));for(var s=[this.value],f=0;f<arguments.length;f++)s[f+1]=arguments[f];if(n.isTypedFunction(l)){var p=n.resolve(l,s);if(p.params.length===1)throw new Error("chain function "+l.name+" cannot match rest parameter between chain value and additional arguments.");return new i(p.implementation.apply(l,s))}return new i(l.apply(l,s))}}i.createProxy=function(l,s){if(typeof l=="string")a(l,s);else{var f=function(m){Me(l,m)&&c[m]===void 0&&o(m,()=>l[m])};for(var p in l)f(p)}};var c={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return i.createProxy(r),t&&t("import",function(l,s,f){f||o(l,s)}),i},{isClass:!0}),mh={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"]},fT={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]},pT={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:[]},mT={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:[]},dT={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]},hT={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]},gT={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:[]},vT={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:[]},yT={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]},bT={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]},xT={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:[]},dh={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"]},wT={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:[]},NT={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]},DT={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"]},ET={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]},AT={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]},ST={name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","complex","fraction","index","matrix","string","unit"]},CT={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"]},MT={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"]},_T={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"]},FT={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,den)","fraction({n: num, d: den})"],description:"Create a fraction from a number or from integer numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)","fraction({n: 333, d: 53})","fraction([sqrt(9), sqrt(10), sqrt(11)])"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]},TT={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"]},OT={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"]},BT={name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","boolean","complex","fraction","index","matrix","string","unit"]},kT={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"]},IT={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"]},RT={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"]},qT={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"]},zT={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:[]},jT={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:[]},LT={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:[]},PT={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"]},VT={name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leafCount("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]},UT={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"]},$T={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"]},HT={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"]},JT={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"]},GT={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"]},WT={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"]},KT={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"]},QT={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"]},ZT={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"]},XT={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"]},YT={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"]},e5={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"]},t5={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"]},r5={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"]},n5={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"]},i5={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]},a5={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"]},o5={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"]},s5={name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)"],seealso:["floor","fix","round"]},u5={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"]},c5={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"]},l5={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"]},f5={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"]},p5={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"]},m5={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"]},d5={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"]},h5={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"]},g5={name:"fix",category:"Arithmetic",syntax:["fix(x)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)"],seealso:["ceil","floor","round"]},v5={name:"floor",category:"Arithmetic",syntax:["floor(x)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)"],seealso:["ceil","fix","round"]},y5={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"]},b5={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenusa of a list with values. ",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]},x5={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"]},w5={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"]},N5={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"]},D5={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"]},E5={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"]},A5={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"]},S5={name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]},C5={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"]},M5={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")']},_5={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"]},F5={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"]},T5={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"]},O5={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"]},B5={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]},k5={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"]},I5={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"]},R5={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"]},q5={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"]},z5={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"]},j5={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"]},L5={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"]},P5={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"]},V5={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]},U5={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"]},$5={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"]},H5={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"]},J5={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"]},G5={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"]},W5={name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]},K5={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"]},Q5={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"]},Z5={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"]},X5={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"]},Y5={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"]},eO={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"]},tO={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"]},rO={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"]},nO={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"]},iO={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"]},aO={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:[]},oO={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]},sO={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:[]},uO={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:[]},cO={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"]},lO={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"]},fO={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"]},pO={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"]},mO={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"]},dO={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"]},hO={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"]},gO={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"]},vO={name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},yO={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"]},bO={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"]},xO={name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicant the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["A = [1, 2, 4, 7, 0]","diff(A)","diff(A, 1)","B = [[1, 2], [3, 4]]","diff(B)","diff(B, 1)","diff(B, 2)","diff(B, bignumber(2))","diff([[1, 2], matrix([3, 4])], 2)"],seealso:["subtract","partitionSelect"]},wO={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"]},NO={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"]},DO={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"]},EO={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"]},AO={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"]},SO={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"]},CO={name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},MO={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"]},_O={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"]},FO={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"]},TO={name:"map",category:"Matrix",syntax:["map(x, callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.",examples:["map([1, 2, 3], square)"],seealso:["filter","forEach"]},OO={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"]},BO={name:"matrixFromFunction",category:"Matrix",syntax:["matrixFromFunction(size, fn)","matrixFromFunction(size, fn, format)","matrixFromFunction(size, fn, format, datatype)","matrixFromFunction(size, format, fn)","matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]},kO={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"]},IO={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"]},RO={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"]},qO={name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"range(1m, 1m, 3m)","a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]},zO={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"]},jO={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"]},LO={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"]},PO={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"]},VO={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"]},UO={name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]},$O={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"]},HO={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"]},JO={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation `l:u`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]","f[[1,2], [1,3]] = [9, 10; 11, 12]","f"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]},GO={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"]},WO={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"]},KO={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"]},QO={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]},ZO={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]},XO={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"]},YO={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"]},e8={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"]},t8={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"]},r8={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"]},n8={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:[]},i8={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"]},a8={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"]},o8={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"]},s8={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"]},u8={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"]},c8={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"]},l8={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"]},f8={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"]},p8={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"]},m8={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"]},d8={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"]},h8={name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]},g8={name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]},v8={name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]},y8={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"]},b8={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"]},x8={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"]},w8={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"]},N8={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"]},D8={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"]},E8={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"]},A8={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"]},S8={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"]},C8={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"]},M8={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"]},_8={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"]},F8={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:[]},T8={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:[]},O8={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:[]},B8={name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemanns Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]},k8={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"]},I8={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]},R8={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"]},q8={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"]},z8={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]},j8={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"]},L8={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"]},P8={name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:`Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber.
|
|
70
70
|
|
|
71
|
-
In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.`,examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]},L8={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"]},P8={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"]},V8={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]},U8={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"]},$8={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"]},H8={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"]},J8={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"]},G8={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"]},W8={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the hyperbolic arccotangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]},K8={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"]},Q8={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]},Z8={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"]},X8={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]},Y8={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"]},eB={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"]},tB={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"]},rB={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"]},nB={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"]},iB={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"]},aB={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]},oB={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"]},sB={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"]},uB={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"]},cB={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"]},lB={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"]},fB={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"]},pB={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"]},mB={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]},dB={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"]},hB={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"]},gB={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:[]},vB={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]},yB={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:[]},xB={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"]},bB={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"]},wB={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]},NB={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"]},DB={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"]},EB={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"]},AB={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"]},SB={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"]},CB={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"]},MB={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"]},_B={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","fraction","bignumber","string","format"]},FB={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]},TB={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"]},OB={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"]},BB={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"]},kB={bignumber:ET,boolean:AT,complex:ST,createUnit:CT,fraction:MT,index:_T,matrix:FT,number:TT,sparse:OT,splitUnit:BT,string:kT,unit:IT,e:ph,E:ph,false:cT,i:lT,Infinity:fT,LN2:mT,LN10:pT,LOG2E:hT,LOG10E:dT,NaN:gT,null:vT,pi:mh,PI:mh,phi:yT,SQRT1_2:xT,SQRT2:bT,tau:wT,true:NT,version:DT,speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Borh magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Borh radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:jT,lsolve:PT,lsolveAll:VT,lup:UT,lusolve:$T,leafCount:LT,polynomialRoot:HT,resolve:WT,simplify:KT,simplifyConstant:QT,simplifyCore:ZT,symbolicEqual:YT,rationalize:GT,slu:XT,usolve:e5,usolveAll:t5,qr:JT,abs:r5,add:n5,cbrt:i5,ceil:a5,cube:o5,divide:s5,dotDivide:u5,dotMultiply:c5,dotPow:l5,exp:f5,expm:p5,expm1:m5,fix:d5,floor:h5,gcd:g5,hypot:v5,lcm:x5,log:b5,log2:D5,log1p:N5,log10:w5,mod:E5,multiply:A5,norm:S5,nthRoot:C5,nthRoots:M5,pow:_5,round:F5,sign:T5,sqrt:O5,sqrtm:B5,square:q5,subtract:z5,unaryMinus:j5,unaryPlus:L5,xgcd:P5,invmod:y5,bitAnd:V5,bitNot:U5,bitOr:$5,bitXor:H5,leftShift:J5,rightArithShift:G5,rightLogShift:W5,bellNumbers:K5,catalan:Q5,composition:Z5,stirlingS2:X5,config:RT,import:qT,typed:zT,arg:Y5,conj:eO,re:rO,im:tO,evaluate:nO,help:iO,distance:aO,intersect:oO,and:sO,not:uO,or:cO,xor:lO,concat:pO,count:mO,cross:dO,column:fO,ctranspose:hO,det:gO,diag:vO,diff:yO,dot:xO,getMatrixDataType:EO,identity:AO,filter:wO,flatten:NO,forEach:DO,inv:SO,pinv:CO,eigs:bO,kron:MO,matrixFromFunction:TO,matrixFromRows:OO,matrixFromColumns:FO,map:_O,ones:BO,partitionSelect:kO,range:IO,resize:qO,reshape:RO,rotate:zO,rotationMatrix:jO,row:LO,size:PO,sort:VO,squeeze:UO,subset:$O,trace:HO,transpose:JO,zeros:GO,fft:WO,ifft:KO,sylvester:k5,schur:I5,lyap:R5,solveODE:BB,combinations:QO,combinationsWithRep:ZO,factorial:XO,gamma:YO,kldivergence:t8,lgamma:e8,multinomial:r8,permutations:n8,pickRandom:i8,random:a8,randomInt:o8,compare:s8,compareNatural:u8,compareText:c8,deepEqual:l8,equal:f8,equalText:p8,larger:m8,largerEq:d8,smaller:h8,smallerEq:g8,unequal:v8,setCartesian:y8,setDifference:x8,setDistinct:b8,setIntersect:w8,setIsSubset:N8,setMultiplicity:D8,setPowerset:E8,setSize:A8,setSymDifference:S8,setUnion:C8,zpk2tf:M8,freqz:_8,erf:F8,zeta:T8,cumsum:P8,mad:O8,max:B8,mean:k8,median:I8,min:R8,mode:q8,prod:z8,quantileSeq:j8,std:L8,sum:V8,variance:U8,corr:$8,acos:H8,acosh:J8,acot:G8,acoth:W8,acsc:K8,acsch:Q8,asec:Z8,asech:X8,asin:Y8,asinh:eB,atan:tB,atanh:nB,atan2:rB,cos:iB,cosh:aB,cot:oB,coth:sB,csc:uB,csch:cB,sec:lB,sech:fB,sin:pB,sinh:mB,tan:dB,tanh:hB,to:gB,clone:yB,format:xB,bin:vB,oct:FB,hex:wB,isNaN:DB,isInteger:NB,isNegative:EB,isNumeric:AB,hasNumericValue:bB,isPositive:SB,isPrime:CB,isZero:MB,print:TB,typeOf:OB,numeric:_B},dh="help",IB=["typed","mathWithTransform","Help"],RB=U(dh,IB,e=>{var{typed:t,mathWithTransform:r,Help:n}=e;return t(dh,{any:function(i){var a,o=i;if(typeof i!="string"){for(a in r)if(Me(r,a)&&i===r[a]){o=a;break}}var u=nr(kB,o);if(!u){var c=typeof o=="function"?o.name:o;throw new Error('No documentation found on "'+c+'"')}return new n(u)}})}),hh="chain",qB=["typed","Chain"],zB=U(hh,qB,e=>{var{typed:t,Chain:r}=e;return t(hh,{"":function(){return new r},any:function(n){return new r(n)}})}),gh="det",jB=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],LB=U(gh,jB,e=>{var{typed:t,matrix:r,subtractScalar:n,multiply:i,divideScalar:a,isZero:o,unaryMinus:u}=e;return t(gh,{any:function(l){return ze(l)},"Array | Matrix":function(l){var s;switch(ke(l)?s=l.size():Array.isArray(l)?(l=r(l),s=l.size()):s=[],s.length){case 0:return ze(l);case 1:if(s[0]===1)return ze(l.valueOf()[0]);if(s[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+Ge(s)+")");case 2:{var f=s[0],p=s[1];if(f===p)return c(l.clone().valueOf(),f);if(p===0)return 1;throw new RangeError("Matrix must be square (size: "+Ge(s)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ge(s)+")")}}});function c(l,s,f){if(s===1)return ze(l[0][0]);if(s===2)return n(i(l[0][0],l[1][1]),i(l[1][0],l[0][1]));for(var p=!1,m=new Array(s).fill(0).map((E,A)=>A),d=0;d<s;d++){var h=m[d];if(o(l[h][d])){var w=void 0;for(w=d+1;w<s;w++)if(!o(l[m[w]][d])){h=m[w],m[w]=m[d],m[d]=h,p=!p;break}if(w===s)return l[h][d]}for(var v=l[h][d],b=d===0?1:l[m[d-1]][d-1],g=d+1;g<s;g++)for(var x=m[g],y=d+1;y<s;y++)l[x][y]=a(n(i(l[x][y],v),i(l[x][d],l[h][y])),b)}var N=l[m[s-1]][s-1];return p?u(N):N}}),vh="inv",PB=["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],VB=U(vh,PB,e=>{var{typed:t,matrix:r,divideScalar:n,addScalar:i,multiply:a,unaryMinus:o,det:u,identity:c,abs:l}=e;return t(vh,{"Array | Matrix":function(f){var p=ke(f)?f.size():Ve(f);switch(p.length){case 1:if(p[0]===1)return ke(f)?r([n(1,f.valueOf()[0])]):[n(1,f[0])];throw new RangeError("Matrix must be square (size: "+Ge(p)+")");case 2:{var m=p[0],d=p[1];if(m===d)return ke(f)?r(s(f.valueOf(),m,d),f.storage()):s(f,m,d);throw new RangeError("Matrix must be square (size: "+Ge(p)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ge(p)+")")}},any:function(f){return n(1,f)}});function s(f,p,m){var d,h,w,v,b;if(p===1){if(v=f[0][0],v===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,v)]]}else if(p===2){var g=u(f);if(g===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(f[1][1],g),n(o(f[0][1]),g)],[n(o(f[1][0]),g),n(f[0][0],g)]]}else{var x=f.concat();for(d=0;d<p;d++)x[d]=x[d].concat();for(var y=c(p).valueOf(),N=0;N<m;N++){var E=l(x[N][N]),A=N;for(d=N+1;d<p;)l(x[d][N])>E&&(E=l(x[d][N]),A=d),d++;if(E===0)throw Error("Cannot calculate inverse, determinant is zero");d=A,d!==N&&(b=x[N],x[N]=x[d],x[d]=b,b=y[N],y[N]=y[d],y[d]=b);var D=x[N],S=y[N];for(d=0;d<p;d++){var C=x[d],_=y[d];if(d!==N){if(C[N]!==0){for(w=n(o(C[N]),D[N]),h=N;h<m;h++)C[h]=i(C[h],a(w,D[h]));for(h=0;h<m;h++)_[h]=i(_[h],a(w,S[h]))}}else{for(w=D[N],h=N;h<m;h++)C[h]=n(C[h],w);for(h=0;h<m;h++)_[h]=n(_[h],w)}}}return y}}}),yh="pinv",UB=["typed","matrix","inv","deepEqual","equal","dotDivide","dot","ctranspose","divideScalar","multiply","add","Complex"],$B=U(yh,UB,e=>{var{typed:t,matrix:r,inv:n,deepEqual:i,equal:a,dotDivide:o,dot:u,ctranspose:c,divideScalar:l,multiply:s,add:f,Complex:p}=e;return t(yh,{"Array | Matrix":function(b){var g=ke(b)?b.size():Ve(b);switch(g.length){case 1:return v(b)?c(b):g[0]===1?n(b):o(c(b),u(b,b));case 2:{if(v(b))return c(b);var x=g[0],y=g[1];if(x===y)try{return n(b)}catch(N){if(!(N instanceof Error&&N.message.match(/Cannot calculate inverse, determinant is zero/)))throw N}return ke(b)?r(m(b.valueOf(),x,y),b.storage()):m(b,x,y)}default:throw new RangeError("Matrix must be two dimensional (size: "+Ge(g)+")")}},any:function(b){return a(b,0)?ze(b):l(1,b)}});function m(b,g,x){var{C:y,F:N}=h(b,g,x),E=s(n(s(c(y),y)),c(y)),A=s(c(N),n(s(N,c(N))));return s(A,E)}function d(b,g,x){for(var y=ze(b),N=0,E=0;E<g;E++){if(x<=N)return y;for(var A=E;w(y[A][N]);)if(A++,g===A&&(A=E,N++,x===N))return y;[y[A],y[E]]=[y[E],y[A]];for(var D=y[E][N],S=0;S<x;S++)y[E][S]=o(y[E][S],D);for(var C=0;C<g;C++)if(C!==E){D=y[C][N];for(var _=0;_<x;_++)y[C][_]=f(y[C][_],s(-1,s(D,y[E][_])))}N++}return y}function h(b,g,x){var y=d(b,g,x),N=b.map((A,D)=>A.filter((S,C)=>C<g&&!w(u(y[C],y[C])))),E=y.filter((A,D)=>!w(u(y[D],y[D])));return{C:N,F:E}}function w(b){return a(f(b,p(1,1)),f(0,p(1,1)))}function v(b){return i(f(b,p(1,1)),f(s(b,0),p(1,1)))}});function HB(e){var{addScalar:t,subtract:r,flatten:n,multiply:i,multiplyScalar:a,divideScalar:o,sqrt:u,abs:c,bignumber:l,diag:s,size:f,reshape:p,inv:m,qr:d,usolve:h,usolveAll:w,equal:v,complex:b,larger:g,smaller:x,matrixFromColumns:y,dot:N}=e;function E(K,V,ue,me){var re=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,ae=A(K,V,ue,me,re);D(K,V,ue,me,re,ae);var{values:de,C:ne}=S(K,V,ue,me,re);if(re){var ce=C(K,V,ne,ae,de,ue,me);return{values:de,eigenvectors:ce}}return{values:de}}function A(K,V,ue,me,re){var ae=me==="BigNumber",de=me==="Complex",ne=ae?l(0):0,ce=ae?l(1):de?b(1):1,le=ae?l(1):1,he=ae?l(10):2,be=a(he,he),$;re&&($=Array(V).fill(ce));for(var T=!1;!T;){T=!0;for(var z=0;z<V;z++){for(var J=ne,L=ne,H=0;H<V;H++)z!==H&&(J=t(J,c(K[H][z])),L=t(L,c(K[z][H])));if(!v(J,0)&&!v(L,0)){for(var G=le,Y=J,ee=o(L,he),B=a(L,he);x(Y,ee);)Y=a(Y,be),G=a(G,he);for(;g(Y,B);)Y=o(Y,be),G=o(G,he);var j=x(o(t(Y,L),G),a(t(J,L),.95));if(j){T=!1;for(var Q=o(1,G),Z=0;Z<V;Z++)z!==Z&&(K[z][Z]=a(K[z][Z],Q),K[Z][z]=a(K[Z][z],G));re&&($[z]=a($[z],Q))}}}}return re?s($):null}function D(K,V,ue,me,re,ae){var de=me==="BigNumber",ne=me==="Complex",ce=de?l(0):ne?b(0):0;de&&(ue=l(ue));for(var le=0;le<V-2;le++){for(var he=0,be=ce,$=le+1;$<V;$++){var T=K[$][le];x(c(be),c(T))&&(be=T,he=$)}if(!x(c(be),ue)){if(he!==le+1){var z=K[he];K[he]=K[le+1],K[le+1]=z;for(var J=0;J<V;J++){var L=K[J][he];K[J][he]=K[J][le+1],K[J][le+1]=L}if(re){var H=ae[he];ae[he]=ae[le+1],ae[le+1]=H}}for(var G=le+2;G<V;G++){var Y=o(K[G][le],be);if(Y!==0){for(var ee=0;ee<V;ee++)K[G][ee]=r(K[G][ee],a(Y,K[le+1][ee]));for(var B=0;B<V;B++)K[B][le+1]=t(K[B][le+1],a(Y,K[B][G]));if(re)for(var j=0;j<V;j++)ae[G][j]=r(ae[G][j],a(Y,ae[le+1][j]))}}}}return ae}function S(K,V,ue,me,re){var ae=me==="BigNumber",de=me==="Complex",ne=ae?l(1):de?b(1):1;ae&&(ue=l(ue));for(var ce=ze(K),le=[],he=V,be=[],$=re?s(Array(V).fill(ne)):void 0,T=re?s(Array(he).fill(ne)):void 0,z=0;z<=100;){z+=1;for(var J=ce[he-1][he-1],L=0;L<he;L++)ce[L][L]=r(ce[L][L],J);var{Q:H,R:G}=d(ce);ce=i(G,H);for(var Y=0;Y<he;Y++)ce[Y][Y]=t(ce[Y][Y],J);if(re&&(T=i(T,H)),he===1||x(c(ce[he-1][he-2]),ue)){z=0,le.push(ce[he-1][he-1]),re&&(be.unshift([[1]]),P(T,V),$=i($,T),he>1&&(T=s(Array(he-1).fill(ne)))),he-=1,ce.pop();for(var ee=0;ee<he;ee++)ce[ee].pop()}else if(he===2||x(c(ce[he-2][he-3]),ue)){z=0;var B=_(ce[he-2][he-2],ce[he-2][he-1],ce[he-1][he-2],ce[he-1][he-1]);le.push(...B),re&&(be.unshift(R(ce[he-2][he-2],ce[he-2][he-1],ce[he-1][he-2],ce[he-1][he-1],B[0],B[1],ue,me)),P(T,V),$=i($,T),he>2&&(T=s(Array(he-2).fill(ne)))),he-=2,ce.pop(),ce.pop();for(var j=0;j<he;j++)ce[j].pop(),ce[j].pop()}if(he===0)break}if(le.sort((ie,oe)=>+r(c(ie),c(oe))),z>100){var Q=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+le.join(", "));throw Q.values=le,Q.vectors=[],Q}var Z=re?i($,I(be,V)):void 0;return{values:le,C:Z}}function C(K,V,ue,me,re,ae,de){var ne=m(ue),ce=i(ne,K,ue),le=de==="BigNumber",he=de==="Complex",be=le?l(0):he?b(0):0,$=le?l(1):he?b(1):1,T=[],z=[];for(var J of re){var L=O(T,J,v);L===-1?(T.push(J),z.push(1)):z[L]+=1}for(var H=[],G=T.length,Y=Array(V).fill(be),ee=s(Array(V).fill($)),B=function(){var Q=T[j],Z=r(ce,i(Q,ee)),ie=w(Z,Y);for(ie.shift();ie.length<z[j];){var oe=F(Z,V,ie,ae,de);if(oe===null)break;ie.push(oe)}var ye=i(m(me),ue);ie=ie.map(fe=>i(ye,fe)),H.push(...ie.map(fe=>({value:Q,vector:n(fe)})))},j=0;j<G;j++)B();return H}function _(K,V,ue,me){var re=t(K,me),ae=r(a(K,me),a(V,ue)),de=a(re,.5),ne=a(u(r(a(re,re),a(4,ae))),.5);return[t(de,ne),r(de,ne)]}function R(K,V,ue,me,re,ae,de,ne){var ce=ne==="BigNumber",le=ne==="Complex",he=ce?l(0):le?b(0):0,be=ce?l(1):le?b(1):1;if(x(c(ue),de))return[[be,he],[he,be]];if(g(c(r(re,ae)),de))return[[r(re,me),r(ae,me)],[ue,ue]];var $=r(K,re),T=r(me,re);return x(c(V),de)&&x(c(T),de)?[[$,be],[ue,he]]:[[V,he],[T,be]]}function P(K,V){for(var ue=0;ue<K.length;ue++)K[ue].push(...Array(V-K[ue].length).fill(0));for(var me=K.length;me<V;me++)K.push(Array(V).fill(0)),K[me][me]=1;return K}function I(K,V){for(var ue=[],me=0;me<V;me++)ue[me]=Array(V).fill(0);var re=0;for(var ae of K){for(var de=ae.length,ne=0;ne<de;ne++)for(var ce=0;ce<de;ce++)ue[re+ne][re+ce]=ae[ne][ce];re+=de}return ue}function O(K,V,ue){for(var me=0;me<K.length;me++)if(ue(K[me],V))return me;return-1}function F(K,V,ue,me,re){for(var ae=re==="BigNumber"?l(1e3):1e3,de,ne=0;ne<5;++ne){de=q(V,ue,re);try{de=h(K,de)}catch{continue}if(g(te(de),ae))break}if(ne>=5)return null;for(ne=0;;){var ce=h(K,de);if(x(te(k(de,[ce])),me))break;if(++ne>=10)return null;de=se(ce)}return de}function q(K,V,ue){var me=ue==="BigNumber",re=ue==="Complex",ae=Array(K).fill(0).map(de=>2*Math.random()-1);return me&&(ae=ae.map(de=>l(de))),re&&(ae=ae.map(de=>b(de))),ae=k(ae,V),se(ae,ue)}function k(K,V){var ue=f(K);for(var me of V)me=p(me,ue),K=r(K,i(o(N(me,K),N(me,me)),me));return K}function te(K){return c(u(N(K,K)))}function se(K,V){var ue=V==="BigNumber",me=V==="Complex",re=ue?l(1):me?b(1):1;return i(o(re,te(K)),K)}return E}function JB(e){var{config:t,addScalar:r,subtract:n,abs:i,atan:a,cos:o,sin:u,multiplyScalar:c,inv:l,bignumber:s,multiply:f,add:p}=e;function m(D,S){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.epsilon,_=arguments.length>3?arguments[3]:void 0,R=arguments.length>4?arguments[4]:void 0;if(_==="number")return d(D,C,R);if(_==="BigNumber")return h(D,C,R);throw TypeError("Unsupported data type: "+_)}function d(D,S,C){var _=D.length,R=Math.abs(S/_),P,I;if(C){I=new Array(_);for(var O=0;O<_;O++)I[O]=Array(_).fill(0),I[O][O]=1}for(var F=N(D);Math.abs(F[1])>=Math.abs(R);){var q=F[0][0],k=F[0][1];P=w(D[q][q],D[k][k],D[q][k]),D=y(D,P,q,k),C&&(I=b(I,P,q,k)),F=N(D)}for(var te=Array(_).fill(0),se=0;se<_;se++)te[se]=D[se][se];return A(ze(te),I,C)}function h(D,S,C){var _=D.length,R=i(S/_),P,I;if(C){I=new Array(_);for(var O=0;O<_;O++)I[O]=Array(_).fill(0),I[O][O]=1}for(var F=E(D);i(F[1])>=i(R);){var q=F[0][0],k=F[0][1];P=v(D[q][q],D[k][k],D[q][k]),D=x(D,P,q,k),C&&(I=g(I,P,q,k)),F=E(D)}for(var te=Array(_).fill(0),se=0;se<_;se++)te[se]=D[se][se];return A(ze(te),I,C)}function w(D,S,C){var _=S-D;return Math.abs(_)<=t.epsilon?Math.PI/4:.5*Math.atan(2*C/(S-D))}function v(D,S,C){var _=n(S,D);return i(_)<=t.epsilon?s(-1).acos().div(4):c(.5,a(f(2,C,l(_))))}function b(D,S,C,_){for(var R=D.length,P=Math.cos(S),I=Math.sin(S),O=Array(R).fill(0),F=Array(R).fill(0),q=0;q<R;q++)O[q]=P*D[q][C]-I*D[q][_],F[q]=I*D[q][C]+P*D[q][_];for(var k=0;k<R;k++)D[k][C]=O[k],D[k][_]=F[k];return D}function g(D,S,C,_){for(var R=D.length,P=o(S),I=u(S),O=Array(R).fill(s(0)),F=Array(R).fill(s(0)),q=0;q<R;q++)O[q]=n(c(P,D[q][C]),c(I,D[q][_])),F[q]=r(c(I,D[q][C]),c(P,D[q][_]));for(var k=0;k<R;k++)D[k][C]=O[k],D[k][_]=F[k];return D}function x(D,S,C,_){for(var R=D.length,P=s(o(S)),I=s(u(S)),O=c(P,P),F=c(I,I),q=Array(R).fill(s(0)),k=Array(R).fill(s(0)),te=f(s(2),P,I,D[C][_]),se=r(n(c(O,D[C][C]),te),c(F,D[_][_])),K=p(c(F,D[C][C]),te,c(O,D[_][_])),V=0;V<R;V++)q[V]=n(c(P,D[C][V]),c(I,D[_][V])),k[V]=r(c(I,D[C][V]),c(P,D[_][V]));D[C][C]=se,D[_][_]=K,D[C][_]=s(0),D[_][C]=s(0);for(var ue=0;ue<R;ue++)ue!==C&&ue!==_&&(D[C][ue]=q[ue],D[ue][C]=q[ue],D[_][ue]=k[ue],D[ue][_]=k[ue]);return D}function y(D,S,C,_){for(var R=D.length,P=Math.cos(S),I=Math.sin(S),O=P*P,F=I*I,q=Array(R).fill(0),k=Array(R).fill(0),te=O*D[C][C]-2*P*I*D[C][_]+F*D[_][_],se=F*D[C][C]+2*P*I*D[C][_]+O*D[_][_],K=0;K<R;K++)q[K]=P*D[C][K]-I*D[_][K],k[K]=I*D[C][K]+P*D[_][K];D[C][C]=te,D[_][_]=se,D[C][_]=0,D[_][C]=0;for(var V=0;V<R;V++)V!==C&&V!==_&&(D[C][V]=q[V],D[V][C]=q[V],D[_][V]=k[V],D[V][_]=k[V]);return D}function N(D){for(var S=D.length,C=0,_=[0,1],R=0;R<S;R++)for(var P=R+1;P<S;P++)Math.abs(C)<Math.abs(D[R][P])&&(C=Math.abs(D[R][P]),_=[R,P]);return[_,C]}function E(D){for(var S=D.length,C=0,_=[0,1],R=0;R<S;R++)for(var P=R+1;P<S;P++)i(C)<i(D[R][P])&&(C=i(D[R][P]),_=[R,P]);return[_,C]}function A(D,S,C){var _=D.length,R=Array(_),P;if(C){P=Array(_);for(var I=0;I<_;I++)P[I]=Array(_)}for(var O=0;O<_;O++){for(var F=0,q=D[0],k=0;k<D.length;k++)i(D[k])<i(q)&&(F=k,q=D[F]);if(R[O]=D.splice(F,1)[0],C)for(var te=0;te<_;te++)P[O][te]=S[te][F],S[te].splice(F,1)}if(!C)return{values:R};var se=P.map((K,V)=>({value:R[V],vector:K}));return{values:R,eigenvectors:se}}return m}var GB="eigs",WB=["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"],KB=U(GB,WB,e=>{var{config:t,typed:r,matrix:n,addScalar:i,subtract:a,equal:o,abs:u,atan:c,cos:l,sin:s,multiplyScalar:f,divideScalar:p,inv:m,bignumber:d,multiply:h,add:w,larger:v,column:b,flatten:g,number:x,complex:y,sqrt:N,diag:E,size:A,reshape:D,qr:S,usolve:C,usolveAll:_,im:R,re:P,smaller:I,matrixFromColumns:O,dot:F}=e,q=JB({config:t,addScalar:i,subtract:a,column:b,flatten:g,equal:o,abs:u,atan:c,cos:l,sin:s,multiplyScalar:f,inv:m,bignumber:d,complex:y,multiply:h,add:w}),k=HB({config:t,addScalar:i,subtract:a,multiply:h,multiplyScalar:f,flatten:g,divideScalar:p,sqrt:N,abs:u,bignumber:d,diag:E,size:A,reshape:D,qr:S,inv:m,usolve:C,usolveAll:_,equal:o,complex:y,larger:v,smaller:I,matrixFromColumns:O,dot:F});return r("eigs",{Array:function(re){return te(n(re))},"Array, number|BigNumber":function(re,ae){return te(n(re),{precision:ae})},"Array, Object"(re,ae){return te(n(re),ae)},Matrix:function(re){return te(re,{matricize:!0})},"Matrix, number|BigNumber":function(re,ae){return te(re,{precision:ae,matricize:!0})},"Matrix, Object":function(re,ae){var de={matricize:!0};return Tt(de,ae),te(re,de)}});function te(re){var ae,de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ne="eigenvectors"in de?de.eigenvectors:!0,ce=(ae=de.precision)!==null&&ae!==void 0?ae:t.epsilon,le=se(re,ce,ne);return de.matricize&&(le.values=n(le.values),ne&&(le.eigenvectors=le.eigenvectors.map(he=>{var{value:be,vector:$}=he;return{value:be,vector:n($)}}))),ne&&Object.defineProperty(le,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),le}function se(re,ae,de){var ne=re.toArray(),ce=re.size();if(ce.length!==2||ce[0]!==ce[1])throw new RangeError("Matrix must be square (size: ".concat(Ge(ce),")"));var le=ce[0];if(V(ne,le,ae)&&(ue(ne,le),K(ne,le,ae))){var he=me(re,ne,le);return q(ne,le,ae,he,de)}var be=me(re,ne,le);return k(ne,le,ae,be,de)}function K(re,ae,de){for(var ne=0;ne<ae;ne++)for(var ce=ne;ce<ae;ce++)if(v(d(u(a(re[ne][ce],re[ce][ne]))),de))return!1;return!0}function V(re,ae,de){for(var ne=0;ne<ae;ne++)for(var ce=0;ce<ae;ce++)if(v(d(u(R(re[ne][ce]))),de))return!1;return!0}function ue(re,ae){for(var de=0;de<ae;de++)for(var ne=0;ne<ae;ne++)re[de][ne]=P(re[de][ne])}function me(re,ae,de){var ne=re.datatype();if(ne==="number"||ne==="BigNumber"||ne==="Complex")return ne;for(var ce=!1,le=!1,he=!1,be=0;be<de;be++)for(var $=0;$<de;$++){var T=ae[be][$];if(Ue(T)||yo(T))ce=!0;else if($e(T))le=!0;else if(wn(T))he=!0;else throw TypeError("Unsupported type in Matrix: "+dt(T))}if(le&&he&&console.warn("Complex BigNumbers not supported, this operation will lose precission."),he){for(var z=0;z<de;z++)for(var J=0;J<de;J++)ae[z][J]=y(ae[z][J]);return"Complex"}if(le){for(var L=0;L<de;L++)for(var H=0;H<de;H++)ae[L][H]=d(ae[L][H]);return"BigNumber"}if(ce){for(var G=0;G<de;G++)for(var Y=0;Y<de;Y++)ae[G][Y]=x(ae[G][Y]);return"number"}else throw TypeError("Matrix contains unsupported types only.")}}),xh="expm",QB=["typed","abs","add","identity","inv","multiply"],ZB=U(xh,QB,e=>{var{typed:t,abs:r,add:n,identity:i,inv:a,multiply:o}=e;return t(xh,{Matrix:function(s){var f=s.size();if(f.length!==2||f[0]!==f[1])throw new RangeError("Matrix must be square (size: "+Ge(f)+")");for(var p=f[0],m=1e-15,d=u(s),h=c(d,m),w=h.q,v=h.j,b=o(s,Math.pow(2,-v)),g=i(p),x=i(p),y=1,N=b,E=-1,A=1;A<=w;A++)A>1&&(N=o(N,b),E=-E),y=y*(w-A+1)/((2*w-A+1)*A),g=n(g,o(y,N)),x=n(x,o(y*E,N));for(var D=o(a(x),g),S=0;S<v;S++)D=o(D,D);return wi(s)?s.createSparseMatrix(D):D}});function u(s){for(var f=s.size()[0],p=0,m=0;m<f;m++){for(var d=0,h=0;h<f;h++)d+=r(s.get([m,h]));p=Math.max(d,p)}return p}function c(s,f){for(var p=30,m=0;m<p;m++)for(var d=0;d<=m;d++){var h=m-d;if(l(s,d,h)<f)return{q:d,j:h}}throw new Error("Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)")}function l(s,f,p){for(var m=1,d=2;d<=f;d++)m*=d;for(var h=m,w=f+1;w<=2*f;w++)h*=w;var v=h*(2*f+1);return 8*Math.pow(s/Math.pow(2,p),2*f)*m*m/(h*v)}}),bh="sqrtm",XB=["typed","abs","add","multiply","map","sqrt","subtract","inv","size","max","identity"],YB=U(bh,XB,e=>{var{typed:t,abs:r,add:n,multiply:i,map:a,sqrt:o,subtract:u,inv:c,size:l,max:s,identity:f}=e,p=1e3,m=1e-6;function d(h){var w,v=0,b=h,g=f(l(h));do{var x=b;if(b=i(.5,n(x,c(g))),g=i(.5,n(g,c(x))),w=s(r(u(b,x))),w>m&&++v>p)throw new Error("computing square root of matrix: iterative method could not converge")}while(w>m);return b}return t(bh,{"Array | Matrix":function(h){var w=ke(h)?h.size():Ve(h);switch(w.length){case 1:if(w[0]===1)return a(h,o);throw new RangeError("Matrix must be square (size: "+Ge(w)+")");case 2:{var v=w[0],b=w[1];if(v===b)return d(h);throw new RangeError("Matrix must be square (size: "+Ge(w)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+Ge(w)+")")}}})}),wh="sylvester",e6=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],t6=U(wh,e6,e=>{var{typed:t,schur:r,matrixFromColumns:n,matrix:i,multiply:a,range:o,concat:u,transpose:c,index:l,subset:s,add:f,subtract:p,identity:m,lusolve:d,abs:h}=e;return t(wh,{"Matrix, Matrix, Matrix":w,"Array, Matrix, Matrix":function(v,b,g){return w(i(v),b,g)},"Array, Array, Matrix":function(v,b,g){return w(i(v),i(b),g)},"Array, Matrix, Array":function(v,b,g){return w(i(v),b,i(g))},"Matrix, Array, Matrix":function(v,b,g){return w(v,i(b),g)},"Matrix, Array, Array":function(v,b,g){return w(v,i(b),i(g))},"Matrix, Matrix, Array":function(v,b,g){return w(v,b,i(g))},"Array, Array, Array":function(v,b,g){return w(i(v),i(b),i(g)).toArray()}});function w(v,b,g){for(var x=b.size()[0],y=v.size()[0],N=r(v),E=N.T,A=N.U,D=r(a(-1,b)),S=D.T,C=D.U,_=a(a(c(A),g),C),R=o(0,y),P=[],I=(he,be)=>u(he,be,1),O=(he,be)=>u(he,be,0),F=0;F<x;F++)if(F<x-1&&h(s(S,l(F+1,F)))>1e-5){for(var q=O(s(_,l(R,F)),s(_,l(R,F+1))),k=0;k<F;k++)q=f(q,O(a(P[k],s(S,l(k,F))),a(P[k],s(S,l(k,F+1)))));var te=a(m(y),a(-1,s(S,l(F,F)))),se=a(m(y),a(-1,s(S,l(F+1,F)))),K=a(m(y),a(-1,s(S,l(F,F+1)))),V=a(m(y),a(-1,s(S,l(F+1,F+1)))),ue=O(I(f(E,te),se),I(K,f(E,V))),me=d(ue,q);P[F]=me.subset(l(o(0,y),0)),P[F+1]=me.subset(l(o(y,2*y),0)),F++}else{for(var re=s(_,l(R,F)),ae=0;ae<F;ae++)re=f(re,a(P[ae],s(S,l(ae,F))));var de=s(S,l(F,F)),ne=p(E,a(de,m(y)));P[F]=d(ne,re)}var ce=i(n(...P)),le=a(A,a(ce,c(C)));return le}}),Nh="schur",r6=["typed","matrix","identity","multiply","qr","norm","subtract"],n6=U(Nh,r6,e=>{var{typed:t,matrix:r,identity:n,multiply:i,qr:a,norm:o,subtract:u}=e;return t(Nh,{Array:function(l){var s=c(r(l));return{U:s.U.valueOf(),T:s.T.valueOf()}},Matrix:function(l){return c(l)}});function c(l){var s=l.size()[0],f=l,p=n(s),m=0,d;do{d=f;var h=a(f),w=h.Q,v=h.R;if(f=i(v,w),p=i(p,w),m++>100)break}while(o(u(f,d))>1e-4);return{U:p,T:f}}}),Dh="lyap",i6=["typed","matrix","sylvester","multiply","transpose"],a6=U(Dh,i6,e=>{var{typed:t,matrix:r,sylvester:n,multiply:i,transpose:a}=e;return t(Dh,{"Matrix, Matrix":function(o,u){return n(o,a(o),i(-1,u))},"Array, Matrix":function(o,u){return n(r(o),a(r(o)),i(-1,u))},"Matrix, Array":function(o,u){return n(o,a(r(o)),r(i(-1,u)))},"Array, Array":function(o,u){return n(r(o),a(r(o)),r(i(-1,u))).toArray()}})}),o6="divide",s6=["typed","matrix","multiply","equalScalar","divideScalar","inv"],u6=U(o6,s6,e=>{var{typed:t,matrix:r,multiply:n,equalScalar:i,divideScalar:a,inv:o}=e,u=Jt({typed:t,equalScalar:i}),c=Jr({typed:t});return t("divide",Pg({"Array | Matrix, Array | Matrix":function(l,s){return n(l,o(s))},"DenseMatrix, any":function(l,s){return c(l,s,a,!1)},"SparseMatrix, any":function(l,s){return u(l,s,a,!1)},"Array, any":function(l,s){return c(r(l),s,a,!1).valueOf()},"any, Array | Matrix":function(l,s){return n(l,o(s))}},a.signatures))}),Eh="distance",c6=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],l6=U(Eh,c6,e=>{var{typed:t,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:a,deepEqual:o,sqrt:u,abs:c}=e;return t(Eh,{"Array, Array, Array":function(x,y,N){if(x.length===2&&y.length===2&&N.length===2){if(!s(x))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!s(y))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!s(N))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(o(y,N))throw new TypeError("LinePoint1 should not be same with LinePoint2");var E=n(N[1],y[1]),A=n(y[0],N[0]),D=n(i(N[0],y[1]),i(y[0],N[1]));return w(x[0],x[1],E,A,D)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(x,y,N){if(Object.keys(x).length===2&&Object.keys(y).length===2&&Object.keys(N).length===2){if(!s(x))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!s(y))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!s(N))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(o(d(y),d(N)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in x&&"pointY"in x&&"lineOnePtX"in y&&"lineOnePtY"in y&&"lineTwoPtX"in N&&"lineTwoPtY"in N){var E=n(N.lineTwoPtY,y.lineOnePtY),A=n(y.lineOnePtX,N.lineTwoPtX),D=n(i(N.lineTwoPtX,y.lineOnePtY),i(y.lineOnePtX,N.lineTwoPtY));return w(x.pointX,x.pointY,E,A,D)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(x,y){if(x.length===2&&y.length===3){if(!s(x))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!f(y))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return w(x[0],x[1],y[0],y[1],y[2])}else if(x.length===3&&y.length===6){if(!f(x))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!m(y))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return v(x[0],x[1],x[2],y[0],y[1],y[2],y[3],y[4],y[5])}else if(x.length===y.length&&x.length>0){if(!p(x))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!p(y))throw new TypeError("All values of an array should be numbers or BigNumbers");return b(x,y)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(x,y){if(Object.keys(x).length===2&&Object.keys(y).length===3){if(!s(x))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!f(y))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in x&&"pointY"in x&&"xCoeffLine"in y&&"yCoeffLine"in y&&"constant"in y)return w(x.pointX,x.pointY,y.xCoeffLine,y.yCoeffLine,y.constant);throw new TypeError("Key names do not match")}else if(Object.keys(x).length===3&&Object.keys(y).length===6){if(!f(x))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!m(y))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in x&&"pointY"in x&&"x0"in y&&"y0"in y&&"z0"in y&&"a"in y&&"b"in y&&"c"in y)return v(x.pointX,x.pointY,x.pointZ,y.x0,y.y0,y.z0,y.a,y.b,y.c);throw new TypeError("Key names do not match")}else if(Object.keys(x).length===2&&Object.keys(y).length===2){if(!s(x))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!s(y))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in x&&"pointOneY"in x&&"pointTwoX"in y&&"pointTwoY"in y)return b([x.pointOneX,x.pointOneY],[y.pointTwoX,y.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(x).length===3&&Object.keys(y).length===3){if(!f(x))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!f(y))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in x&&"pointOneY"in x&&"pointOneZ"in x&&"pointTwoX"in y&&"pointTwoY"in y&&"pointTwoZ"in y)return b([x.pointOneX,x.pointOneY,x.pointOneZ],[y.pointTwoX,y.pointTwoY,y.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(x){if(!h(x))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return g(x)}});function l(x){return typeof x=="number"||$e(x)}function s(x){return x.constructor!==Array&&(x=d(x)),l(x[0])&&l(x[1])}function f(x){return x.constructor!==Array&&(x=d(x)),l(x[0])&&l(x[1])&&l(x[2])}function p(x){return Array.isArray(x)||(x=d(x)),x.every(l)}function m(x){return x.constructor!==Array&&(x=d(x)),l(x[0])&&l(x[1])&&l(x[2])&&l(x[3])&&l(x[4])&&l(x[5])}function d(x){for(var y=Object.keys(x),N=[],E=0;E<y.length;E++)N.push(x[y[E]]);return N}function h(x){if(x[0].length===2&&l(x[0][0])&&l(x[0][1])){if(x.some(y=>y.length!==2||!l(y[0])||!l(y[1])))return!1}else if(x[0].length===3&&l(x[0][0])&&l(x[0][1])&&l(x[0][2])){if(x.some(y=>y.length!==3||!l(y[0])||!l(y[1])||!l(y[2])))return!1}else return!1;return!0}function w(x,y,N,E,A){var D=c(r(r(i(N,x),i(E,y)),A)),S=u(r(i(N,N),i(E,E)));return a(D,S)}function v(x,y,N,E,A,D,S,C,_){var R=[n(i(n(A,y),_),i(n(D,N),C)),n(i(n(D,N),S),i(n(E,x),_)),n(i(n(E,x),C),i(n(A,y),S))];R=u(r(r(i(R[0],R[0]),i(R[1],R[1])),i(R[2],R[2])));var P=u(r(r(i(S,S),i(C,C)),i(_,_)));return a(R,P)}function b(x,y){for(var N=x.length,E=0,A=0,D=0;D<N;D++)A=n(x[D],y[D]),E=r(i(A,A),E);return u(E)}function g(x){for(var y=[],N=[],E=[],A=0;A<x.length-1;A++)for(var D=A+1;D<x.length;D++)x[0].length===2?(N=[x[A][0],x[A][1]],E=[x[D][0],x[D][1]]):x[0].length===3&&(N=[x[A][0],x[A][1],x[A][2]],E=[x[D][0],x[D][1],x[D][2]]),y.push(b(N,E));return y}}),f6="intersect",p6=["typed","config","abs","add","addScalar","matrix","multiply","multiplyScalar","divideScalar","subtract","smaller","equalScalar","flatten","isZero","isNumeric"],m6=U(f6,p6,e=>{var{typed:t,config:r,abs:n,add:i,addScalar:a,matrix:o,multiply:u,multiplyScalar:c,divideScalar:l,subtract:s,smaller:f,equalScalar:p,flatten:m,isZero:d,isNumeric:h}=e;return t("intersect",{"Array, Array, Array":w,"Array, Array, Array, Array":v,"Matrix, Matrix, Matrix":function(S,C,_){var R=w(S.valueOf(),C.valueOf(),_.valueOf());return R===null?null:o(R)},"Matrix, Matrix, Matrix, Matrix":function(S,C,_,R){var P=v(S.valueOf(),C.valueOf(),_.valueOf(),R.valueOf());return P===null?null:o(P)}});function w(S,C,_){if(S=b(S),C=b(C),_=b(_),!x(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!x(C))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!y(_))throw new TypeError("Array with 4 numbers expected as third argument");return D(S[0],S[1],S[2],C[0],C[1],C[2],_[0],_[1],_[2],_[3])}function v(S,C,_,R){if(S=b(S),C=b(C),_=b(_),R=b(R),S.length===2){if(!g(S))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!g(C))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!g(_))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!g(R))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return N(S,C,_,R)}else if(S.length===3){if(!x(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!x(C))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!x(_))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!x(R))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return A(S[0],S[1],S[2],C[0],C[1],C[2],_[0],_[1],_[2],R[0],R[1],R[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function b(S){return S.length===1?S[0]:S.length>1&&Array.isArray(S[0])&&S.every(C=>Array.isArray(C)&&C.length===1)?m(S):S}function g(S){return S.length===2&&h(S[0])&&h(S[1])}function x(S){return S.length===3&&h(S[0])&&h(S[1])&&h(S[2])}function y(S){return S.length===4&&h(S[0])&&h(S[1])&&h(S[2])&&h(S[3])}function N(S,C,_,R){var P=S,I=_,O=s(P,C),F=s(I,R),q=s(c(O[0],F[1]),c(F[0],O[1]));if(d(q)||f(n(q),r.epsilon))return null;var k=c(F[0],P[1]),te=c(F[1],P[0]),se=c(F[0],I[1]),K=c(F[1],I[0]),V=l(a(s(s(k,te),se),K),q);return i(u(O,V),P)}function E(S,C,_,R,P,I,O,F,q,k,te,se){var K=c(s(S,C),s(_,R)),V=c(s(P,I),s(O,F)),ue=c(s(q,k),s(te,se));return a(a(K,V),ue)}function A(S,C,_,R,P,I,O,F,q,k,te,se){var K=E(S,O,k,O,C,F,te,F,_,q,se,q),V=E(k,O,R,S,te,F,P,C,se,q,I,_),ue=E(S,O,R,S,C,F,P,C,_,q,I,_),me=E(k,O,k,O,te,F,te,F,se,q,se,q),re=E(R,S,R,S,P,C,P,C,I,_,I,_),ae=s(c(K,V),c(ue,me)),de=s(c(re,me),c(V,V));if(d(de))return null;var ne=l(ae,de),ce=l(a(K,c(ne,V)),me),le=a(S,c(ne,s(R,S))),he=a(C,c(ne,s(P,C))),be=a(_,c(ne,s(I,_))),$=a(O,c(ce,s(k,O))),T=a(F,c(ce,s(te,F))),z=a(q,c(ce,s(se,q)));return p(le,$)&&p(he,T)&&p(be,z)?[le,he,be]:null}function D(S,C,_,R,P,I,O,F,q,k){var te=c(S,O),se=c(R,O),K=c(C,F),V=c(P,F),ue=c(_,q),me=c(I,q),re=s(s(s(k,te),K),ue),ae=s(s(s(a(a(se,V),me),te),K),ue),de=l(re,ae),ne=a(S,c(de,s(R,S))),ce=a(C,c(de,s(P,C))),le=a(_,c(de,s(I,_)));return[ne,ce,le]}}),Ah="sum",d6=["typed","config","add","numeric"],Py=U(Ah,d6,e=>{var{typed:t,config:r,add:n,numeric:i}=e;return t(Ah,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":o,"...":function(u){if(Da(u))throw new TypeError("Scalar values expected in function sum");return a(u)}});function a(u){var c;return Sn(u,function(l){try{c=c===void 0?l:n(c,l)}catch(s){throw ur(s,"sum",l)}}),c===void 0&&(c=i(0,r.number)),typeof c=="string"&&(c=i(c,r.number)),c}function o(u,c){try{var l=xu(u,c,n);return l}catch(s){throw ur(s,"sum")}}}),as="cumsum",h6=["typed","add","unaryPlus"],Vy=U(as,h6,e=>{var{typed:t,add:r,unaryPlus:n}=e;return t(as,{Array:i,Matrix:function(c){return c.create(i(c.valueOf()))},"Array, number | BigNumber":o,"Matrix, number | BigNumber":function(c,l){return c.create(o(c.valueOf(),l))},"...":function(c){if(Da(c))throw new TypeError("All values expected to be scalar in function cumsum");return i(c)}});function i(c){try{return a(c)}catch(l){throw ur(l,as)}}function a(c){if(c.length===0)return[];for(var l=[n(c[0])],s=1;s<c.length;++s)l.push(r(l[s-1],c[s]));return l}function o(c,l){var s=Ve(c);if(l<0||l>=s.length)throw new $r(l,s.length);try{return u(c,l)}catch(f){throw ur(f,as)}}function u(c,l){var s,f,p;if(l<=0){var m=c[0][0];if(Array.isArray(m)){for(p=wv(c),f=[],s=0;s<p.length;s++)f[s]=u(p[s],l-1);return f}else return a(c)}else{for(f=[],s=0;s<c.length;s++)f[s]=u(c[s],l-1);return f}}}),Sh="mean",g6=["typed","add","divide"],Uy=U(Sh,g6,e=>{var{typed:t,add:r,divide:n}=e;return t(Sh,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":i,"...":function(o){if(Da(o))throw new TypeError("Scalar values expected in function mean");return a(o)}});function i(o,u){try{var c=xu(o,u,r),l=Array.isArray(o)?Ve(o):o.size();return n(c,l[u])}catch(s){throw ur(s,"mean")}}function a(o){var u,c=0;if(Sn(o,function(l){try{u=u===void 0?l:r(u,l),c++}catch(s){throw ur(s,"mean",l)}}),c===0)throw new Error("Cannot calculate the mean of an empty array");return n(u,c)}}),Ch="median",v6=["typed","add","divide","compare","partitionSelect"],y6=U(Ch,v6,e=>{var{typed:t,add:r,divide:n,compare:i,partitionSelect:a}=e;function o(l){try{l=ot(l.valueOf());var s=l.length;if(s===0)throw new Error("Cannot calculate median of an empty array");if(s%2===0){for(var f=s/2-1,p=a(l,f+1),m=l[f],d=0;d<f;++d)i(l[d],m)>0&&(m=l[d]);return c(m,p)}else{var h=a(l,(s-1)/2);return u(h)}}catch(w){throw ur(w,"median")}}var u=t({"number | BigNumber | Complex | Unit":function(l){return l}}),c=t({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(l,s){return n(r(l,s),2)}});return t(Ch,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(l,s){throw new Error("median(A, dim) is not yet supported")},"...":function(l){if(Da(l))throw new TypeError("Scalar values expected in function median");return o(l)}})}),Mh="mad",x6=["typed","abs","map","median","subtract"],b6=U(Mh,x6,e=>{var{typed:t,abs:r,map:n,median:i,subtract:a}=e;return t(Mh,{"Array | Matrix":o,"...":function(u){return o(u)}});function o(u){if(u=ot(u.valueOf()),u.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var c=i(u);return i(n(u,function(l){return r(a(l,c))}))}catch(l){throw l instanceof TypeError&&l.message.includes("median")?new TypeError(l.message.replace("median","mad")):ur(l,"mad")}}}),pc="unbiased",_h="variance",w6=["typed","add","subtract","multiply","divide","apply","isNaN"],$y=U(_h,w6,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:a,apply:o,isNaN:u}=e;return t(_h,{"Array | Matrix":function(s){return c(s,pc)},"Array | Matrix, string":c,"Array | Matrix, number | BigNumber":function(s,f){return l(s,f,pc)},"Array | Matrix, number | BigNumber, string":l,"...":function(s){return c(s,pc)}});function c(s,f){var p,m=0;if(s.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(Sn(s,function(w){try{p=p===void 0?w:r(p,w),m++}catch(v){throw ur(v,"variance",w)}}),m===0)throw new Error("Cannot calculate variance of an empty array");var d=a(p,m);if(p=void 0,Sn(s,function(w){var v=n(w,d);p=p===void 0?i(v,v):r(p,i(v,v))}),u(p))return p;switch(f){case"uncorrected":return a(p,m);case"biased":return a(p,m+1);case"unbiased":{var h=$e(p)?p.mul(0):0;return m===1?h:a(p,m-1)}default:throw new Error('Unknown normalization "'+f+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function l(s,f,p){try{if(s.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return o(s,f,m=>c(m,p))}catch(m){throw ur(m,"variance")}}}),Fh="quantileSeq",N6=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],Hy=U(Fh,N6,e=>{var{typed:t,bignumber:r,add:n,subtract:i,divide:a,multiply:o,partitionSelect:u,compare:c,isInteger:l,smaller:s,smallerEq:f,larger:p}=e,m=El({typed:t,isInteger:l});return t(Fh,{"Array | Matrix, number | BigNumber":(b,g)=>h(b,g,!1),"Array | Matrix, number | BigNumber, number":(b,g,x)=>d(b,g,!1,x,h),"Array | Matrix, number | BigNumber, boolean":h,"Array | Matrix, number | BigNumber, boolean, number":(b,g,x,y)=>d(b,g,x,y,h),"Array | Matrix, Array | Matrix":(b,g)=>w(b,g,!1),"Array | Matrix, Array | Matrix, number":(b,g,x)=>d(b,g,!1,x,w),"Array | Matrix, Array | Matrix, boolean":w,"Array | Matrix, Array | Matrix, boolean, number":(b,g,x,y)=>d(b,g,x,y,w)});function d(b,g,x,y,N){return m(b,y,E=>N(E,g,x))}function h(b,g,x){var y,N=b.valueOf();if(s(g,0))throw new Error("N/prob must be non-negative");if(f(g,1))return Ue(g)?v(N,g,x):r(v(N,g,x));if(p(g,1)){if(!l(g))throw new Error("N must be a positive integer");if(p(g,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 E=n(g,1);y=[];for(var A=0;s(A,g);A++){var D=a(A+1,E);y.push(v(N,D,x))}return Ue(g)?y:r(y)}}function w(b,g,x){for(var y=b.valueOf(),N=g.valueOf(),E=[],A=0;A<N.length;++A)E.push(v(y,N[A],x));return E}function v(b,g,x){var y=ot(b),N=y.length;if(N===0)throw new Error("Cannot calculate quantile of an empty sequence");var E=Ue(g)?g*(N-1):g.times(N-1),A=Ue(g)?Math.floor(E):E.floor().toNumber(),D=Ue(g)?E%1:E.minus(A);if(l(E))return x?y[E]:u(y,Ue(g)?E:E.valueOf());var S,C;if(x)S=y[A],C=y[A+1];else{C=u(y,A+1),S=y[A];for(var _=0;_<A;++_)c(y[_],S)>0&&(S=y[_])}return n(o(S,i(1,D)),o(C,D))}}),Th="std",D6=["typed","map","sqrt","variance"],Jy=U(Th,D6,e=>{var{typed:t,map:r,sqrt:n,variance:i}=e;return t(Th,{"Array | Matrix":a,"Array | Matrix, string":a,"Array | Matrix, number | BigNumber":a,"Array | Matrix, number | BigNumber, string":a,"...":function(o){return a(o)}});function a(o,u){if(o.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var c=i.apply(null,arguments);return Fr(c)?r(c,n):n(c)}catch(l){throw l instanceof TypeError&&l.message.includes(" variance")?new TypeError(l.message.replace(" variance"," std")):l}}}),Oh="corr",E6=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],A6=U(Oh,E6,e=>{var{typed:t,matrix:r,sqrt:n,sum:i,add:a,subtract:o,multiply:u,pow:c,divide:l}=e;return t(Oh,{"Array, Array":function(p,m){return s(p,m)},"Matrix, Matrix":function(p,m){var d=s(p.toArray(),m.toArray());return Array.isArray(d)?r(d):d}});function s(p,m){var d=[];if(Array.isArray(p[0])&&Array.isArray(m[0])){if(p.length!==m.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var h=0;h<p.length;h++){if(p[h].length!==m[h].length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");d.push(f(p[h],m[h]))}return d}else{if(p.length!==m.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");return f(p,m)}}function f(p,m){var d=p.length,h=i(p),w=i(m),v=p.reduce((N,E,A)=>a(N,u(E,m[A])),0),b=i(p.map(N=>c(N,2))),g=i(m.map(N=>c(N,2))),x=o(u(d,v),u(h,w)),y=n(u(o(u(d,b),c(h,2)),o(u(d,g),c(w,2))));return l(x,y)}}),Bh="combinations",S6=["typed"],C6=U(Bh,S6,e=>{var{typed:t}=e;return t(Bh,{"number, number":$v,"BigNumber, BigNumber":function(r,n){var i=r.constructor,a,o,u=r.minus(n),c=new i(1);if(!kh(r)||!kh(n))throw new TypeError("Positive integer value expected in function combinations");if(n.gt(r))throw new TypeError("k must be less than n in function combinations");if(a=c,n.lt(u))for(o=c;o.lte(u);o=o.plus(c))a=a.times(n.plus(o)).dividedBy(o);else for(o=c;o.lte(n);o=o.plus(c))a=a.times(u.plus(o)).dividedBy(o);return a}})});function kh(e){return e.isInteger()&&e.gte(0)}var Ih="combinationsWithRep",M6=["typed"],_6=U(Ih,M6,e=>{var{typed:t}=e;return t(Ih,{"number, number":function(r,n){if(!Fe(r)||r<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!Fe(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(r<1)throw new TypeError("k must be less than or equal to n + k - 1");if(n<r-1){var i=bn(r,r+n-1);return i/bn(1,n)}var a=bn(n+1,r+n-1);return a/bn(1,r-1)},"BigNumber, BigNumber":function(r,n){var i=r.constructor,a,o,u=new i(1),c=r.minus(u);if(!Rh(r)||!Rh(n))throw new TypeError("Positive integer value expected in function combinationsWithRep");if(r.lt(u))throw new TypeError("k must be less than or equal to n + k - 1 in function combinationsWithRep");if(a=u,n.lt(c))for(o=u;o.lte(c);o=o.plus(u))a=a.times(n.plus(o)).dividedBy(o);else for(o=u;o.lte(n);o=o.plus(u))a=a.times(c.plus(o)).dividedBy(o);return a}})});function Rh(e){return e.isInteger()&&e.gte(0)}var qh="gamma",F6=["typed","config","multiplyScalar","pow","BigNumber","Complex"],T6=U(qh,F6,e=>{var{typed:t,config:r,multiplyScalar:n,pow:i,BigNumber:a,Complex:o}=e;function u(l){if(l.im===0)return zs(l.re);if(l.re<.5){var s=new o(1-l.re,-l.im),f=new o(Math.PI*l.re,Math.PI*l.im);return new o(Math.PI).div(f.sin()).div(u(s))}l=new o(l.re-1,l.im);for(var p=new o(aa[0],0),m=1;m<aa.length;++m){var d=new o(aa[m],0);p=p.add(d.div(l.add(m)))}var h=new o(l.re+Kv+.5,l.im),w=Math.sqrt(2*Math.PI),v=h.pow(l.add(.5)),b=h.neg().exp();return p.mul(w).mul(v).mul(b)}return t(qh,{number:zs,Complex:u,BigNumber:function(l){if(l.isInteger())return l.isNegative()||l.isZero()?new a(1/0):c(l.minus(1));if(!l.isFinite())return new a(l.isNegative()?NaN:1/0);throw new Error("Integer BigNumber expected")}});function c(l){if(l<8)return new a([1,1,2,6,24,120,720,5040][l]);var s=r.precision+(Math.log(l.toNumber())|0),f=a.clone({precision:s});if(l%2===1)return l.times(c(new a(l-1)));for(var p=l,m=new f(l),d=l.toNumber();p>2;)p-=2,d+=p,m=m.times(d);return new a(m.toPrecision(a.precision))}}),zh="lgamma",O6=["Complex","typed"],B6=U(zh,O6,e=>{var{Complex:t,typed:r}=e,n=7,i=7,a=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return r(zh,{number:js,Complex:o,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function o(l){var s=6.283185307179586,f=1.1447298858494002,p=.1;if(l.isNaN())return new t(NaN,NaN);if(l.im===0)return new t(js(l.re),0);if(l.re>=n||Math.abs(l.im)>=i)return u(l);if(l.re<=p){var m=DN(s,l.im)*Math.floor(.5*l.re+.25),d=l.mul(Math.PI).sin().log(),h=o(new t(1-l.re,-l.im));return new t(f,m).sub(d).sub(h)}else return l.im>=0?c(l):c(l.conjugate()).conjugate()}function u(l){for(var s=l.sub(.5).mul(l.log()).sub(l).add(Qv),f=new t(1,0).div(l),p=f.div(l),m=a[0],d=a[1],h=2*p.re,w=p.re*p.re+p.im*p.im,v=2;v<8;v++){var b=d;d=-w*m+a[v],m=h*m+b}var g=f.mul(p.mul(m).add(d));return s.add(g)}function c(l){var s=0,f=0,p=l;for(l=l.add(1);l.re<=n;){p=p.mul(l);var m=p.im<0?1:0;m!==0&&f===0&&s++,f=m,l=l.add(1)}return u(l).sub(p.log()).sub(new t(0,s*2*Math.PI*1))}}),jh="factorial",k6=["typed","gamma"],I6=U(jh,k6,e=>{var{typed:t,gamma:r}=e;return t(jh,{number:function(n){if(n<0)throw new Error("Value must be non-negative");return r(n+1)},BigNumber:function(n){if(n.isNegative())throw new Error("Value must be non-negative");return r(n.plus(1))},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))})}),Lh="kldivergence",R6=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],q6=U(Lh,R6,e=>{var{typed:t,matrix:r,divide:n,sum:i,multiply:a,map:o,dotDivide:u,log:c,isNumeric:l}=e;return t(Lh,{"Array, Array":function(f,p){return s(r(f),r(p))},"Matrix, Array":function(f,p){return s(f,r(p))},"Array, Matrix":function(f,p){return s(r(f),p)},"Matrix, Matrix":function(f,p){return s(f,p)}});function s(f,p){var m=p.size().length,d=f.size().length;if(m>1)throw new Error("first object must be one dimensional");if(d>1)throw new Error("second object must be one dimensional");if(m!==d)throw new Error("Length of two vectors must be equal");var h=i(f);if(h===0)throw new Error("Sum of elements in first object must be non zero");var w=i(p);if(w===0)throw new Error("Sum of elements in second object must be non zero");var v=n(f,i(f)),b=n(p,i(p)),g=i(a(v,o(u(v,b),x=>c(x))));return l(g)?g:Number.NaN}}),Ph="multinomial",z6=["typed","add","divide","multiply","factorial","isInteger","isPositive"],j6=U(Ph,z6,e=>{var{typed:t,add:r,divide:n,multiply:i,factorial:a,isInteger:o,isPositive:u}=e;return t(Ph,{"Array | Matrix":function(c){var l=0,s=1;return Sn(c,function(f){if(!o(f)||!u(f))throw new TypeError("Positive integer value expected in function multinomial");l=r(l,f),s=i(s,a(f))}),n(a(l),s)}})}),Vh="permutations",L6=["typed","factorial"],P6=U(Vh,L6,e=>{var{typed:t,factorial:r}=e;return t(Vh,{"number | BigNumber":r,"number, number":function(n,i){if(!Fe(n)||n<0)throw new TypeError("Positive integer value expected in function permutations");if(!Fe(i)||i<0)throw new TypeError("Positive integer value expected in function permutations");if(i>n)throw new TypeError("second argument k must be less than or equal to first argument n");return bn(n-i+1,n)},"BigNumber, BigNumber":function(n,i){var a,o;if(!Uh(n)||!Uh(i))throw new TypeError("Positive integer value expected in function permutations");if(i.gt(n))throw new TypeError("second argument k must be less than or equal to first argument n");var u=n.mul(0).add(1);for(a=u,o=n.minus(i).plus(1);o.lte(n);o=o.plus(1))a=a.times(o);return a}})});function Uh(e){return e.isInteger()&&e.gte(0)}var Gy={exports:{}};(function(e){(function(t,r,n){function i(c){var l=this,s=u();l.next=function(){var f=2091639*l.s0+l.c*23283064365386963e-26;return l.s0=l.s1,l.s1=l.s2,l.s2=f-(l.c=f|0)},l.c=1,l.s0=s(" "),l.s1=s(" "),l.s2=s(" "),l.s0-=s(c),l.s0<0&&(l.s0+=1),l.s1-=s(c),l.s1<0&&(l.s1+=1),l.s2-=s(c),l.s2<0&&(l.s2+=1),s=null}function a(c,l){return l.c=c.c,l.s0=c.s0,l.s1=c.s1,l.s2=c.s2,l}function o(c,l){var s=new i(c),f=l&&l.state,p=s.next;return p.int32=function(){return s.next()*4294967296|0},p.double=function(){return p()+(p()*2097152|0)*11102230246251565e-32},p.quick=p,f&&(typeof f=="object"&&a(f,s),p.state=function(){return a(s,{})}),p}function u(){var c=4022871197,l=function(s){s=String(s);for(var f=0;f<s.length;f++){c+=s.charCodeAt(f);var p=.02519603282416938*c;c=p>>>0,p-=c,p*=c,c=p>>>0,p-=c,c+=p*4294967296}return(c>>>0)*23283064365386963e-26};return l}r&&r.exports?r.exports=o:this.alea=o})(qi,e)})(Gy);var V6=Gy.exports,Wy={exports:{}};(function(e){(function(t,r,n){function i(u){var c=this,l="";c.x=0,c.y=0,c.z=0,c.w=0,c.next=function(){var f=c.x^c.x<<11;return c.x=c.y,c.y=c.z,c.z=c.w,c.w^=c.w>>>19^f^f>>>8},u===(u|0)?c.x=u:l+=u;for(var s=0;s<l.length+64;s++)c.x^=l.charCodeAt(s)|0,c.next()}function a(u,c){return c.x=u.x,c.y=u.y,c.z=u.z,c.w=u.w,c}function o(u,c){var l=new i(u),s=c&&c.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var p=l.next()>>>11,m=(l.next()>>>0)/4294967296,d=(p+m)/(1<<21);while(d===0);return d},f.int32=l.next,f.quick=f,s&&(typeof s=="object"&&a(s,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=o:this.xor128=o})(qi,e)})(Wy);var U6=Wy.exports,Ky={exports:{}};(function(e){(function(t,r,n){function i(u){var c=this,l="";c.next=function(){var f=c.x^c.x>>>2;return c.x=c.y,c.y=c.z,c.z=c.w,c.w=c.v,(c.d=c.d+362437|0)+(c.v=c.v^c.v<<4^(f^f<<1))|0},c.x=0,c.y=0,c.z=0,c.w=0,c.v=0,u===(u|0)?c.x=u:l+=u;for(var s=0;s<l.length+64;s++)c.x^=l.charCodeAt(s)|0,s==l.length&&(c.d=c.x<<10^c.x>>>4),c.next()}function a(u,c){return c.x=u.x,c.y=u.y,c.z=u.z,c.w=u.w,c.v=u.v,c.d=u.d,c}function o(u,c){var l=new i(u),s=c&&c.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var p=l.next()>>>11,m=(l.next()>>>0)/4294967296,d=(p+m)/(1<<21);while(d===0);return d},f.int32=l.next,f.quick=f,s&&(typeof s=="object"&&a(s,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=o:this.xorwow=o})(qi,e)})(Ky);var $6=Ky.exports,Qy={exports:{}};(function(e){(function(t,r,n){function i(u){var c=this;c.next=function(){var s=c.x,f=c.i,p,m;return p=s[f],p^=p>>>7,m=p^p<<24,p=s[f+1&7],m^=p^p>>>10,p=s[f+3&7],m^=p^p>>>3,p=s[f+4&7],m^=p^p<<7,p=s[f+7&7],p=p^p<<13,m^=p^p<<9,s[f]=m,c.i=f+1&7,m};function l(s,f){var p,m=[];if(f===(f|0))m[0]=f;else for(f=""+f,p=0;p<f.length;++p)m[p&7]=m[p&7]<<15^f.charCodeAt(p)+m[p+1&7]<<13;for(;m.length<8;)m.push(0);for(p=0;p<8&&m[p]===0;++p);for(p==8?m[7]=-1:m[p],s.x=m,s.i=0,p=256;p>0;--p)s.next()}l(c,u)}function a(u,c){return c.x=u.x.slice(),c.i=u.i,c}function o(u,c){u==null&&(u=+new Date);var l=new i(u),s=c&&c.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var p=l.next()>>>11,m=(l.next()>>>0)/4294967296,d=(p+m)/(1<<21);while(d===0);return d},f.int32=l.next,f.quick=f,s&&(s.x&&a(s,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=o:this.xorshift7=o})(qi,e)})(Qy);var H6=Qy.exports,Zy={exports:{}};(function(e){(function(t,r,n){function i(u){var c=this;c.next=function(){var s=c.w,f=c.X,p=c.i,m,d;return c.w=s=s+1640531527|0,d=f[p+34&127],m=f[p=p+1&127],d^=d<<13,m^=m<<17,d^=d>>>15,m^=m>>>12,d=f[p]=d^m,c.i=p,d+(s^s>>>16)|0};function l(s,f){var p,m,d,h,w,v=[],b=128;for(f===(f|0)?(m=f,f=null):(f=f+"\0",m=0,b=Math.max(b,f.length)),d=0,h=-32;h<b;++h)f&&(m^=f.charCodeAt((h+32)%f.length)),h===0&&(w=m),m^=m<<10,m^=m>>>15,m^=m<<4,m^=m>>>13,h>=0&&(w=w+1640531527|0,p=v[h&127]^=m+w,d=p==0?d+1:0);for(d>=128&&(v[(f&&f.length||0)&127]=-1),d=127,h=4*128;h>0;--h)m=v[d+34&127],p=v[d=d+1&127],m^=m<<13,p^=p<<17,m^=m>>>15,p^=p>>>12,v[d]=m^p;s.w=w,s.X=v,s.i=d}l(c,u)}function a(u,c){return c.i=u.i,c.w=u.w,c.X=u.X.slice(),c}function o(u,c){u==null&&(u=+new Date);var l=new i(u),s=c&&c.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var p=l.next()>>>11,m=(l.next()>>>0)/4294967296,d=(p+m)/(1<<21);while(d===0);return d},f.int32=l.next,f.quick=f,s&&(s.X&&a(s,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=o:this.xor4096=o})(qi,e)})(Zy);var J6=Zy.exports,Xy={exports:{}};(function(e){(function(t,r,n){function i(u){var c=this,l="";c.next=function(){var f=c.b,p=c.c,m=c.d,d=c.a;return f=f<<25^f>>>7^p,p=p-m|0,m=m<<24^m>>>8^d,d=d-f|0,c.b=f=f<<20^f>>>12^p,c.c=p=p-m|0,c.d=m<<16^p>>>16^d,c.a=d-f|0},c.a=0,c.b=0,c.c=-1640531527,c.d=1367130551,u===Math.floor(u)?(c.a=u/4294967296|0,c.b=u|0):l+=u;for(var s=0;s<l.length+20;s++)c.b^=l.charCodeAt(s)|0,c.next()}function a(u,c){return c.a=u.a,c.b=u.b,c.c=u.c,c.d=u.d,c}function o(u,c){var l=new i(u),s=c&&c.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var p=l.next()>>>11,m=(l.next()>>>0)/4294967296,d=(p+m)/(1<<21);while(d===0);return d},f.int32=l.next,f.quick=f,s&&(typeof s=="object"&&a(s,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=o:this.tychei=o})(qi,e)})(Xy);var G6=Xy.exports,Yy={exports:{}};const W6={},K6=Object.freeze(Object.defineProperty({__proto__:null,default:W6},Symbol.toStringTag,{value:"Module"})),Q6=k2(K6);(function(e){(function(t,r,n){var i=256,a=6,o=52,u="random",c=n.pow(i,a),l=n.pow(2,o),s=l*2,f=i-1,p;function m(x,y,N){var E=[];y=y==!0?{entropy:!0}:y||{};var A=v(w(y.entropy?[x,g(r)]:x??b(),3),E),D=new d(E),S=function(){for(var C=D.g(a),_=c,R=0;C<l;)C=(C+R)*i,_*=i,R=D.g(1);for(;C>=s;)C/=2,_/=2,R>>>=1;return(C+R)/_};return S.int32=function(){return D.g(4)|0},S.quick=function(){return D.g(4)/4294967296},S.double=S,v(g(D.S),r),(y.pass||N||function(C,_,R,P){return P&&(P.S&&h(P,D),C.state=function(){return h(D,{})}),R?(n[u]=C,_):C})(S,A,"global"in y?y.global:this==n,y.state)}function d(x){var y,N=x.length,E=this,A=0,D=E.i=E.j=0,S=E.S=[];for(N||(x=[N++]);A<i;)S[A]=A++;for(A=0;A<i;A++)S[A]=S[D=f&D+x[A%N]+(y=S[A])],S[D]=y;(E.g=function(C){for(var _,R=0,P=E.i,I=E.j,O=E.S;C--;)_=O[P=f&P+1],R=R*i+O[f&(O[P]=O[I=f&I+_])+(O[I]=_)];return E.i=P,E.j=I,R})(i)}function h(x,y){return y.i=x.i,y.j=x.j,y.S=x.S.slice(),y}function w(x,y){var N=[],E=typeof x,A;if(y&&E=="object")for(A in x)try{N.push(w(x[A],y-1))}catch{}return N.length?N:E=="string"?x:x+"\0"}function v(x,y){for(var N=x+"",E,A=0;A<N.length;)y[f&A]=f&(E^=y[f&A]*19)+N.charCodeAt(A++);return g(y)}function b(){try{var x;return p&&(x=p.randomBytes)?x=x(i):(x=new Uint8Array(i),(t.crypto||t.msCrypto).getRandomValues(x)),g(x)}catch{var y=t.navigator,N=y&&y.plugins;return[+new Date,t,N,t.screen,g(r)]}}function g(x){return String.fromCharCode.apply(0,x)}if(v(n.random(),r),e.exports){e.exports=m;try{p=Q6}catch{}}else n["seed"+u]=m})(typeof self<"u"?self:qi,[],Math)})(Yy);var Z6=Yy.exports,X6=V6,Y6=U6,e9=$6,t9=H6,r9=J6,n9=G6,Li=Z6;Li.alea=X6;Li.xor128=Y6;Li.xorwow=e9;Li.xorshift7=t9;Li.xor4096=r9;Li.tychei=n9;var i9=Li;const e1=wo(i9);var a9=e1(Date.now());function ga(e){var t;function r(i){t=i===null?a9:e1(String(i))}r(e);function n(){return t()}return n}var $h="pickRandom",o9=["typed","config","?on"],s9=U($h,o9,e=>{var{typed:t,config:r,on:n}=e,i=ga(r.randomSeed);return n&&n("config",function(o,u){o.randomSeed!==u.randomSeed&&(i=ga(o.randomSeed))}),t($h,{"Array | Matrix":function(o){return a(o,{})},"Array | Matrix, Object":function(o,u){return a(o,u)},"Array | Matrix, number":function(o,u){return a(o,{number:u})},"Array | Matrix, Array | Matrix":function(o,u){return a(o,{weights:u})},"Array | Matrix, Array | Matrix, number":function(o,u,c){return a(o,{number:c,weights:u})},"Array | Matrix, number, Array | Matrix":function(o,u,c){return a(o,{number:u,weights:c})}});function a(o,u){var{number:c,weights:l,elementWise:s=!0}=u,f=typeof c>"u";f&&(c=1);var p=ke(o)?o.create:ke(l)?l.create:null;o=o.valueOf(),l&&(l=l.valueOf()),s===!0&&(o=ot(o),l=ot(l));var m=0;if(typeof l<"u"){if(l.length!==o.length)throw new Error("Weights must have the same length as possibles");for(var d=0,h=l.length;d<h;d++){if(!Ue(l[d])||l[d]<0)throw new Error("Weights must be an array of positive numbers");m+=l[d]}}for(var w=o.length,v=[],b;v.length<c;){if(typeof l>"u")b=o[Math.floor(i()*w)];else for(var g=i()*m,x=0,y=o.length;x<y;x++)if(g-=l[x],g<0){b=o[x];break}v.push(b)}return f?v[0]:p?p(v):v}});function Tl(e,t){var r=[];if(e=e.slice(0),e.length>1)for(var n=0,i=e.shift();n<i;n++)r.push(Tl(e,t));else for(var a=0,o=e.shift();a<o;a++)r.push(t());return r}var Hh="random",u9=["typed","config","?on"],c9=U(Hh,u9,e=>{var{typed:t,config:r,on:n}=e,i=ga(r.randomSeed);return n&&n("config",function(u,c){u.randomSeed!==c.randomSeed&&(i=ga(u.randomSeed))}),t(Hh,{"":()=>o(0,1),number:u=>o(0,u),"number, number":(u,c)=>o(u,c),"Array | Matrix":u=>a(u,0,1),"Array | Matrix, number":(u,c)=>a(u,0,c),"Array | Matrix, number, number":(u,c,l)=>a(u,c,l)});function a(u,c,l){var s=Tl(u.valueOf(),()=>o(c,l));return ke(u)?u.create(s):s}function o(u,c){return u+i()*(c-u)}}),Jh="randomInt",l9=["typed","config","?on"],f9=U(Jh,l9,e=>{var{typed:t,config:r,on:n}=e,i=ga(r.randomSeed);return n&&n("config",function(u,c){u.randomSeed!==c.randomSeed&&(i=ga(u.randomSeed))}),t(Jh,{"":()=>o(0,1),number:u=>o(0,u),"number, number":(u,c)=>o(u,c),"Array | Matrix":u=>a(u,0,1),"Array | Matrix, number":(u,c)=>a(u,0,c),"Array | Matrix, number, number":(u,c,l)=>a(u,c,l)});function a(u,c,l){var s=Tl(u.valueOf(),()=>o(c,l));return ke(u)?u.create(s):s}function o(u,c){return Math.floor(u+i()*(c-u))}}),Gh="stirlingS2",p9=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],m9=U(Gh,p9,e=>{var{typed:t,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:a,pow:o,factorial:u,combinations:c,isNegative:l,isInteger:s,number:f,bignumber:p,larger:m}=e,d=[],h=[];return t(Gh,{"number | BigNumber, number | BigNumber":function(w,v){if(!s(w)||l(w)||!s(v)||l(v))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(m(v,w))throw new TypeError("k must be less than or equal to n in function stirlingS2");var b=!(Ue(w)&&Ue(v)),g=b?h:d,x=b?p:f,y=f(w),N=f(v);if(g[y]&&g[y].length>N)return g[y][N];for(var E=0;E<=y;++E)if(g[E]||(g[E]=[x(E===0?1:0)]),E!==0)for(var A=g[E],D=g[E-1],S=A.length;S<=E&&S<=N;++S)S===E?A[S]=1:A[S]=r(i(x(S),D[S]),D[S-1]);return g[y][N]}})}),Wh="bellNumbers",d9=["typed","addScalar","isNegative","isInteger","stirlingS2"],h9=U(Wh,d9,e=>{var{typed:t,addScalar:r,isNegative:n,isInteger:i,stirlingS2:a}=e;return t(Wh,{"number | BigNumber":function(o){if(!i(o)||n(o))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var u=0,c=0;c<=o;c++)u=r(u,a(o,c));return u}})}),Kh="catalan",g9=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],v9=U(Kh,g9,e=>{var{typed:t,addScalar:r,divideScalar:n,multiplyScalar:i,combinations:a,isNegative:o,isInteger:u}=e;return t(Kh,{"number | BigNumber":function(c){if(!u(c)||o(c))throw new TypeError("Non-negative integer value expected in function catalan");return n(a(i(c,2),c),r(c,1))}})}),Qh="composition",y9=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],x9=U(Qh,y9,e=>{var{typed:t,addScalar:r,combinations:n,isPositive:i,isNegative:a,isInteger:o,larger:u}=e;return t(Qh,{"number | BigNumber, number | BigNumber":function(c,l){if(!o(c)||!i(c)||!o(l)||!i(l))throw new TypeError("Positive integer value expected in function composition");if(u(l,c))throw new TypeError("k must be less than or equal to n in function composition");return n(r(c,-1),r(l,-1))}})}),Zh="leafCount",b9=["parse","typed"],w9=U(Zh,b9,e=>{var{parse:t,typed:r}=e;function n(i){var a=0;return i.forEach(o=>{a+=n(o)}),a||1}return r(Zh,{Node:function(i){return n(i)}})});function Xh(e){return nt(e)||Ct(e)&&e.isUnary()&&nt(e.args[0])}function Ks(e){return!!(nt(e)||(Zn(e)||Ct(e))&&e.args.every(Ks)||An(e)&&Ks(e.content))}function Yh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function mc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yh(Object(r),!0).forEach(function(n){Bt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var N9="simplifyUtil",D9=["FunctionNode","OperatorNode","SymbolNode"],Ol=U(N9,D9,e=>{var{FunctionNode:t,OperatorNode:r,SymbolNode:n}=e,i=!0,a=!1,o="defaultF",u={add:{trivial:i,total:i,commutative:i,associative:i},unaryPlus:{trivial:i,total:i,commutative:i,associative:i},subtract:{trivial:a,total:i,commutative:a,associative:a},multiply:{trivial:i,total:i,commutative:i,associative:i},divide:{trivial:a,total:i,commutative:a,associative:a},paren:{trivial:i,total:i,commutative:i,associative:a},defaultF:{trivial:a,total:i,commutative:a,associative:a}},c={divide:{total:a},log:{total:a}},l={subtract:{total:a},abs:{trivial:i},log:{total:i}};function s(g,x){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:u,N=o;if(typeof g=="string"?N=g:Ct(g)?N=g.fn.toString():Zn(g)?N=g.name:An(g)&&(N="paren"),Me(y,N)){var E=y[N];if(Me(E,x))return E[x];if(Me(u,N))return u[N][x]}if(Me(y,o)){var A=y[o];return Me(A,x)?A[x]:u[o][x]}if(Me(u,N)){var D=u[N];if(Me(D,x))return D[x]}return u[o][x]}function f(g){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return s(g,"commutative",x)}function p(g){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return s(g,"associative",x)}function m(g,x){var y=mc({},g);for(var N in x)Me(g,N)?y[N]=mc(mc({},x[N]),g[N]):y[N]=x[N];return y}function d(g,x){if(!g.args||g.args.length===0)return g;g.args=h(g,x);for(var y=0;y<g.args.length;y++)d(g.args[y],x)}function h(g,x){var y,N=[],E=function A(D){for(var S=0;S<D.args.length;S++){var C=D.args[S];Ct(C)&&y===C.op?A(C):N.push(C)}};return p(g,x)?(y=g.op,E(g),N):g.args}function w(g,x){if(!(!g.args||g.args.length===0)){for(var y=b(g),N=g.args.length,E=0;E<N;E++)w(g.args[E],x);if(N>2&&p(g,x)){for(var A=g.args.pop();g.args.length>0;)A=y([g.args.pop(),A]);g.args=A.args}}}function v(g,x){if(!(!g.args||g.args.length===0)){for(var y=b(g),N=g.args.length,E=0;E<N;E++)v(g.args[E],x);if(N>2&&p(g,x)){for(var A=g.args.shift();g.args.length>0;)A=y([A,g.args.shift()]);g.args=A.args}}}function b(g){return Ct(g)?function(x){try{return new r(g.op,g.fn,x,g.implicit)}catch(y){return console.error(y),[]}}:function(x){return new t(new n(g.name),x)}}return{createMakeNodeFunction:b,hasProperty:s,isCommutative:f,isAssociative:p,mergeContext:m,flatten:d,allChildren:h,unflattenr:w,unflattenl:v,defaultContext:u,realContext:c,positiveContext:l}}),E9="simplify",A9=["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],S9=U(E9,A9,e=>{var{config:t,typed:r,parse:n,add:i,subtract:a,multiply:o,divide:u,pow:c,isZero:l,equal:s,resolve:f,simplifyConstant:p,simplifyCore:m,fraction:d,bignumber:h,mathWithTransform:w,matrix:v,AccessorNode:b,ArrayNode:g,ConstantNode:x,FunctionNode:y,IndexNode:N,ObjectNode:E,OperatorNode:A,ParenthesisNode:D,SymbolNode:S}=e,{hasProperty:C,isCommutative:_,isAssociative:R,mergeContext:P,flatten:I,unflattenr:O,unflattenl:F,createMakeNodeFunction:q,defaultContext:k,realContext:te,positiveContext:se}=Ol({FunctionNode:y,OperatorNode:A,SymbolNode:S});r.addConversion({from:"Object",to:"Map",convert:ia});var K=r("simplify",{Node:ne,"Node, Map":(L,H)=>ne(L,!1,H),"Node, Map, Object":(L,H,G)=>ne(L,!1,H,G),"Node, Array":ne,"Node, Array, Map":ne,"Node, Array, Map, Object":ne});r.removeConversion({from:"Object",to:"Map",convert:ia}),K.defaultContext=k,K.realContext=te,K.positiveContext=se;function V(L){return L.transform(function(H,G,Y){return An(H)?V(H.content):H})}var ue={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};K.rules=[m,{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}}},p,{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}}},p,{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 me(L,H){var G={};if(L.s){var Y=L.s.split("->");if(Y.length===2)G.l=Y[0],G.r=Y[1];else throw SyntaxError("Could not parse rule: "+L.s)}else G.l=L.l,G.r=L.r;G.l=V(n(G.l)),G.r=V(n(G.r));for(var ee of["imposeContext","repeat","assuming"])ee in L&&(G[ee]=L[ee]);if(L.evaluate&&(G.evaluate=n(L.evaluate)),R(G.l,H)){var B=!_(G.l,H),j;B&&(j=de());var Q=q(G.l),Z=de();G.expanded={},G.expanded.l=Q([G.l,Z]),I(G.expanded.l,H),O(G.expanded.l,H),G.expanded.r=Q([G.r,Z]),B&&(G.expandedNC1={},G.expandedNC1.l=Q([j,G.l]),G.expandedNC1.r=Q([j,G.r]),G.expandedNC2={},G.expandedNC2.l=Q([j,G.expanded.l]),G.expandedNC2.r=Q([j,G.expanded.r]))}return G}function re(L,H){for(var G=[],Y=0;Y<L.length;Y++){var ee=L[Y],B=void 0,j=typeof ee;switch(j){case"string":ee={s:ee};case"object":B=me(ee,H);break;case"function":B=ee;break;default:throw TypeError("Unsupported type of rule: "+j)}G.push(B)}return G}var ae=0;function de(){return new S("_p"+ae++)}function ne(L,H){var G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:io(),Y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},ee=Y.consoleDebug;H=re(H||K.rules,Y.context);var B=f(L,G);B=V(B);for(var j={},Q=B.toString({parenthesis:"all"});!j[Q];){j[Q]=!0,ae=0;var Z=Q;ee&&console.log("Working on: ",Q);for(var ie=0;ie<H.length;ie++){var oe="";if(typeof H[ie]=="function"?(B=H[ie](B,Y),ee&&(oe=H[ie].name)):(I(B,Y.context),B=le(B,H[ie],Y.context),ee&&(oe="".concat(H[ie].l.toString()," -> ").concat(H[ie].r.toString()))),ee){var ye=B.toString({parenthesis:"all"});ye!==Z&&(console.log("Applying",oe,"produced",ye),Z=ye)}F(B,Y.context)}Q=B.toString({parenthesis:"all"})}return B}function ce(L,H,G){var Y=L;if(L)for(var ee=0;ee<L.length;++ee){var B=le(L[ee],H,G);B!==L[ee]&&(Y===L&&(Y=L.slice()),Y[ee]=B)}return Y}function le(L,H,G){if(H.assuming){for(var Y in H.assuming)for(var ee in H.assuming[Y])if(C(Y,ee,G)!==H.assuming[Y][ee])return L}var B=P(H.imposeContext,G),j=L;if(j instanceof A||j instanceof y){var Q=ce(j.args,H,G);Q!==j.args&&(j=j.clone(),j.args=Q)}else if(j instanceof D){if(j.content){var Z=le(j.content,H,G);Z!==j.content&&(j=new D(Z))}}else if(j instanceof g){var ie=ce(j.items,H,G);ie!==j.items&&(j=new g(ie))}else if(j instanceof b){var oe=j.object;j.object&&(oe=le(j.object,H,G));var ye=j.index;j.index&&(ye=le(j.index,H,G)),(oe!==j.object||ye!==j.index)&&(j=new b(oe,ye))}else if(j instanceof N){var fe=ce(j.dimensions,H,G);fe!==j.dimensions&&(j=new N(fe))}else if(j instanceof E){var De=!1,Ne={};for(var je in j.properties)Ne[je]=le(j.properties[je],H,G),Ne[je]!==j.properties[je]&&(De=!0);De&&(j=new E(Ne))}var Ze=H.r,_e=z(H.l,j,B)[0];if(!_e&&H.expanded&&(Ze=H.expanded.r,_e=z(H.expanded.l,j,B)[0]),!_e&&H.expandedNC1&&(Ze=H.expandedNC1.r,_e=z(H.expandedNC1.l,j,B)[0],_e||(Ze=H.expandedNC2.r,_e=z(H.expandedNC2.l,j,B)[0])),_e){var wt=j.implicit;j=Ze.clone(),wt&&"implicit"in Ze&&(j.implicit=!0),j=j.transform(function(M){return M.isSymbolNode&&Me(_e.placeholders,M.name)?_e.placeholders[M.name].clone():M})}return H.repeat&&j!==L&&(j=le(j,H,G)),j}function he(L,H){var G=[],Y,ee,B=q(L);if(_(L,H))for(var j=0;j<L.args.length;j++)ee=L.args.slice(0),ee.splice(j,1),Y=ee.length===1?ee[0]:B(ee),G.push(B([L.args[j],Y]));else for(var Q=1;Q<L.args.length;Q++){var Z=L.args[0];Q>1&&(Z=B(L.args.slice(0,Q))),ee=L.args.slice(Q),Y=ee.length===1?ee[0]:B(ee),G.push(B([Z,Y]))}return G}function be(L,H){var G={placeholders:{}};if(!L.placeholders&&!H.placeholders)return G;if(L.placeholders){if(!H.placeholders)return L}else return H;for(var Y in L.placeholders)if(Me(L.placeholders,Y)&&(G.placeholders[Y]=L.placeholders[Y],Me(H.placeholders,Y)&&!J(L.placeholders[Y],H.placeholders[Y])))return null;for(var ee in H.placeholders)Me(H.placeholders,ee)&&(G.placeholders[ee]=H.placeholders[ee]);return G}function $(L,H){var G=[];if(L.length===0||H.length===0)return G;for(var Y,ee=0;ee<L.length;ee++)for(var B=0;B<H.length;B++)Y=be(L[ee],H[B]),Y&&G.push(Y);return G}function T(L){if(L.length===0)return L;for(var H=L.reduce($),G=[],Y={},ee=0;ee<H.length;ee++){var B=JSON.stringify(H[ee]);Y[B]||(Y[B]=!0,G.push(H[ee]))}return G}function z(L,H,G,Y){var ee=[{placeholders:{}}];if(L instanceof A&&H instanceof A||L instanceof y&&H instanceof y){if(L instanceof A){if(L.op!==H.op||L.fn!==H.fn)return[]}else if(L instanceof y&&L.name!==H.name)return[];if(H.args.length===1&&L.args.length===1||!R(H,G)&&H.args.length===L.args.length||Y){for(var B=[],j=0;j<L.args.length;j++){var Q=z(L.args[j],H.args[j],G);if(Q.length===0)break;B.push(Q)}if(B.length!==L.args.length){if(!_(H,G)||L.args.length===1)return[];if(L.args.length>2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var Z=z(L.args[0],H.args[1],G);if(Z.length===0)return[];var ie=z(L.args[1],H.args[0],G);if(ie.length===0)return[];B=[Z,ie]}ee=T(B)}else if(H.args.length>=2&&L.args.length===2){for(var oe=he(H,G),ye=[],fe=0;fe<oe.length;fe++){var De=z(L,oe[fe],G,!0);ye=ye.concat(De)}return ye}else{if(L.args.length>2)throw Error("Unexpected non-binary associative function: "+L.toString());return[]}}else if(L instanceof S){if(L.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(ue[L.name]){if(L.name!==H.name)return[]}else switch(L.name[1]>="a"&&L.name[1]<="z"?L.name.substring(0,2):L.name[0]){case"n":case"_p":ee[0].placeholders[L.name]=H;break;case"c":case"cl":if(nt(H))ee[0].placeholders[L.name]=H;else return[];break;case"v":if(!nt(H))ee[0].placeholders[L.name]=H;else return[];break;case"vl":if(zt(H))ee[0].placeholders[L.name]=H;else return[];break;case"cd":if(Xh(H))ee[0].placeholders[L.name]=H;else return[];break;case"vd":if(!Xh(H))ee[0].placeholders[L.name]=H;else return[];break;case"ce":if(Ks(H))ee[0].placeholders[L.name]=H;else return[];break;case"ve":if(!Ks(H))ee[0].placeholders[L.name]=H;else return[];break;default:throw new Error("Invalid symbol in rule: "+L.name)}}else if(L instanceof x){if(!s(L.value,H.value))return[]}else return[];return ee}function J(L,H){if(L instanceof x&&H instanceof x){if(!s(L.value,H.value))return!1}else if(L instanceof S&&H instanceof S){if(L.name!==H.name)return!1}else if(L instanceof A&&H instanceof A||L instanceof y&&H instanceof y){if(L instanceof A){if(L.op!==H.op||L.fn!==H.fn)return!1}else if(L instanceof y&&L.name!==H.name)return!1;if(L.args.length!==H.args.length)return!1;for(var G=0;G<L.args.length;G++)if(!J(L.args[G],H.args[G]))return!1}else return!1;return!0}return K}),C9="simplifyConstant",M9=["typed","config","mathWithTransform","matrix","?fraction","?bignumber","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode"],_9=U(C9,M9,e=>{var{typed:t,config:r,mathWithTransform:n,matrix:i,fraction:a,bignumber:o,AccessorNode:u,ArrayNode:c,ConstantNode:l,FunctionNode:s,IndexNode:f,ObjectNode:p,OperatorNode:m,SymbolNode:d}=e,{isCommutative:h,isAssociative:w,allChildren:v,createMakeNodeFunction:b}=Ol({FunctionNode:s,OperatorNode:m,SymbolNode:d}),g=t("simplifyConstant",{Node:I=>E(P(I,{})),"Node, Object":function(I,O){return E(P(I,O))}});function x(I){return yo(I)?I.valueOf():I instanceof Array?I.map(x):ke(I)?i(x(I.valueOf())):I}function y(I,O,F){try{return n[I].apply(null,O)}catch{return O=O.map(x),D(n[I].apply(null,O),F)}}var N=t({Fraction:C,number:function(I){return I<0?S(new l(-I)):new l(I)},BigNumber:function(I){return I<0?S(new l(-I)):new l(I)},Complex:function(I){throw new Error("Cannot convert Complex number to Node")},string:function(I){return new l(I)},Matrix:function(I){return new c(I.valueOf().map(O=>N(O)))}});function E(I){return ft(I)?I:N(I)}function A(I,O){var F=O&&O.exactFractions!==!1;if(F&&isFinite(I)&&a){var q=a(I),k=O&&typeof O.fractionsLimit=="number"?O.fractionsLimit:1/0;if(q.valueOf()===I&&q.n<k&&q.d<k)return q}return I}var D=t({"string, Object":function(I,O){if(r.number==="BigNumber")return o===void 0&&Cl(),o(I);if(r.number==="Fraction")return a===void 0&&Sy(),a(I);var F=parseFloat(I);return A(F,O)},"Fraction, Object":function(I,O){return I},"BigNumber, Object":function(I,O){return I},"number, Object":function(I,O){return A(I,O)},"Complex, Object":function(I,O){return I.im!==0?I:A(I.re,O)},"Matrix, Object":function(I,O){return i(A(I.valueOf()))},"Array, Object":function(I,O){return I.map(A)}});function S(I){return new m("-","unaryMinus",[I])}function C(I){var O,F=I.s*I.n;return F<0?O=new m("-","unaryMinus",[new l(-F)]):O=new l(F),I.d===1?O:new m("/","divide",[O,new l(I.d)])}function _(I,O,F){if(!Na(O))return new u(E(I),E(O));if(Sr(I)||ke(I)){for(var q=Array.from(O.dimensions);q.length>0;)if(nt(q[0])&&typeof q[0].value!="string"){var k=D(q.shift().value,F);Sr(I)?I=I.items[k-1]:(I=I.valueOf()[k-1],I instanceof Array&&(I=i(I)))}else if(q.length>1&&nt(q[1])&&typeof q[1].value!="string"){var te=D(q[1].value,F),se=[],K=Sr(I)?I.items:I.valueOf();for(var V of K)if(Sr(V))se.push(V.items[te-1]);else if(ke(I))se.push(V[te-1]);else break;if(se.length===K.length)Sr(I)?I=new c(se):I=i(se),q.splice(1,1);else break}else break;return q.length===O.dimensions.length?new u(E(I),O):q.length>0?(O=new f(q),new u(E(I),O)):I}if(pu(I)&&O.dimensions.length===1&&nt(O.dimensions[0])){var ue=O.dimensions[0].value;return ue in I.properties?I.properties[ue]:new l}return new u(E(I),O)}function R(I,O,F,q){var k=O.shift(),te=O.reduce((se,K)=>{if(!ft(K)){var V=se.pop();if(ft(V))return[V,K];try{return se.push(y(I,[V,K],q)),se}catch{se.push(V)}}se.push(E(se.pop()));var ue=se.length===1?se[0]:F(se);return[F([ue,E(K)])]},[k]);return te.length===1?te[0]:F([te[0],N(te[1])])}function P(I,O){switch(I.type){case"SymbolNode":return I;case"ConstantNode":switch(typeof I.value){case"number":return D(I.value,O);case"string":return I.value;default:if(!isNaN(I.value))return D(I.value,O)}return I;case"FunctionNode":if(n[I.name]&&n[I.name].rawArgs)return I;{var F=["add","multiply"];if(!F.includes(I.name)){var q=I.args.map(le=>P(le,O));if(!q.some(ft))try{return y(I.name,q,O)}catch{}if(I.name==="size"&&q.length===1&&Sr(q[0])){for(var k=[],te=q[0];Sr(te);)k.push(te.items.length),te=te.items[0];return i(k)}return new s(I.name,q.map(E))}}case"OperatorNode":{var se=I.fn.toString(),K,V,ue=b(I);if(Ct(I)&&I.isUnary())K=[P(I.args[0],O)],ft(K[0])?V=ue(K):V=y(se,K,O);else if(w(I,O.context))if(K=v(I,O.context),K=K.map(le=>P(le,O)),h(se,O.context)){for(var me=[],re=[],ae=0;ae<K.length;ae++)ft(K[ae])?re.push(K[ae]):me.push(K[ae]);me.length>1?(V=R(se,me,ue,O),re.unshift(V),V=R(se,re,ue,O)):V=R(se,K,ue,O)}else V=R(se,K,ue,O);else K=I.args.map(le=>P(le,O)),V=R(se,K,ue,O);return V}case"ParenthesisNode":return P(I.content,O);case"AccessorNode":return _(P(I.object,O),P(I.index,O),O);case"ArrayNode":{var de=I.items.map(le=>P(le,O));return de.some(ft)?new c(de.map(E)):i(de)}case"IndexNode":return new f(I.dimensions.map(le=>g(le,O)));case"ObjectNode":{var ne={};for(var ce in I.properties)ne[ce]=g(I.properties[ce],O);return new p(ne)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(I.type))}}return g}),e0="simplifyCore",F9=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],T9=U(e0,F9,e=>{var{typed:t,parse:r,equal:n,isZero:i,add:a,subtract:o,multiply:u,divide:c,pow:l,AccessorNode:s,ArrayNode:f,ConstantNode:p,FunctionNode:m,IndexNode:d,ObjectNode:h,OperatorNode:w,ParenthesisNode:v,SymbolNode:b}=e,g=new p(0),x=new p(1),y=new p(!0),N=new p(!1);function E(C){return Ct(C)&&["and","not","or"].includes(C.op)}var{hasProperty:A,isCommutative:D}=Ol({FunctionNode:m,OperatorNode:w,SymbolNode:b});function S(C){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},R=_?_.context:void 0;if(A(C,"trivial",R)){if(Zn(C)&&C.args.length===1)return S(C.args[0],_);var P=!1,I=0;if(C.forEach(re=>{++I,I===1&&(P=S(re,_))}),I===1)return P}var O=C;if(Zn(O)){var F=k4(O.name);if(F){if(O.args.length>2&&A(O,"associative",R))for(;O.args.length>2;){var q=O.args.pop(),k=O.args.pop();O.args.push(new w(F,O.name,[q,k]))}O=new w(F,O.name,O.args)}else return new m(S(O.fn),O.args.map(re=>S(re,_)))}if(Ct(O)&&O.isUnary()){var te=S(O.args[0],_);if(O.op==="~"&&Ct(te)&&te.isUnary()&&te.op==="~"||O.op==="not"&&Ct(te)&&te.isUnary()&&te.op==="not"&&E(te.args[0]))return te.args[0];var se=!0;if(O.op==="-"&&Ct(te)&&(te.isBinary()&&te.fn==="subtract"&&(O=new w("-","subtract",[te.args[1],te.args[0]]),se=!1),te.isUnary()&&te.op==="-"))return te.args[0];if(se)return new w(O.op,O.fn,[te])}if(Ct(O)&&O.isBinary()){var K=S(O.args[0],_),V=S(O.args[1],_);if(O.op==="+"){if(nt(K)&&i(K.value))return V;if(nt(V)&&i(V.value))return K;Ct(V)&&V.isUnary()&&V.op==="-"&&(V=V.args[0],O=new w("-","subtract",[K,V]))}if(O.op==="-")return Ct(V)&&V.isUnary()&&V.op==="-"?S(new w("+","add",[K,V.args[0]]),_):nt(K)&&i(K.value)?S(new w("-","unaryMinus",[V])):nt(V)&&i(V.value)?K:new w(O.op,O.fn,[K,V]);if(O.op==="*"){if(nt(K)){if(i(K.value))return g;if(n(K.value,1))return V}if(nt(V)){if(i(V.value))return g;if(n(V.value,1))return K;if(D(O,R))return new w(O.op,O.fn,[V,K],O.implicit)}return new w(O.op,O.fn,[K,V],O.implicit)}if(O.op==="/")return nt(K)&&i(K.value)?g:nt(V)&&n(V.value,1)?K:new w(O.op,O.fn,[K,V]);if(O.op==="^"&&nt(V)){if(i(V.value))return x;if(n(V.value,1))return K}if(O.op==="and"){if(nt(K))if(K.value){if(E(V))return V;if(nt(V))return V.value?y:N}else return N;if(nt(V))if(V.value){if(E(K))return K}else return N}if(O.op==="or"){if(nt(K)){if(K.value)return y;if(E(V))return V}if(nt(V)){if(V.value)return y;if(E(K))return K}}return new w(O.op,O.fn,[K,V])}if(Ct(O))return new w(O.op,O.fn,O.args.map(re=>S(re,_)));if(Sr(O))return new f(O.items.map(re=>S(re,_)));if(Ti(O))return new s(S(O.object,_),S(O.index,_));if(Na(O))return new d(O.dimensions.map(re=>S(re,_)));if(pu(O)){var ue={};for(var me in O.properties)ue[me]=S(O.properties[me],_);return new h(ue)}return O}return t(e0,{Node:S,"Node,Object":S})}),O9="resolve",B9=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],k9=U(O9,B9,e=>{var{typed:t,parse:r,ConstantNode:n,FunctionNode:i,OperatorNode:a,ParenthesisNode:o}=e;function u(c,l){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!l)return c;if(zt(c)){if(s.has(c.name)){var f=Array.from(s).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(f,"}"))}var p=l.get(c.name);if(ft(p)){var m=new Set(s);return m.add(c.name),u(p,l,m)}else return typeof p=="number"?r(String(p)):p!==void 0?new n(p):c}else if(Ct(c)){var d=c.args.map(function(w){return u(w,l,s)});return new a(c.op,c.fn,d,c.implicit)}else{if(An(c))return new o(u(c.content,l,s));if(Zn(c)){var h=c.args.map(function(w){return u(w,l,s)});return new i(c.name,h)}}return c.map(w=>u(w,l,s))}return t("resolve",{Node:u,"Node, Map | null | undefined":u,"Node, Object":(c,l)=>u(c,ia(l)),"Array | Matrix":t.referToSelf(c=>l=>l.map(s=>c(s))),"Array | Matrix, null | undefined":t.referToSelf(c=>l=>l.map(s=>c(s))),"Array, Object":t.referTo("Array,Map",c=>(l,s)=>c(l,ia(s))),"Matrix, Object":t.referTo("Matrix,Map",c=>(l,s)=>c(l,ia(s))),"Array | Matrix, Map":t.referToSelf(c=>(l,s)=>l.map(f=>c(f,s)))})}),t0="symbolicEqual",I9=["parse","simplify","typed","OperatorNode"],R9=U(t0,I9,e=>{var{parse:t,simplify:r,typed:n,OperatorNode:i}=e;function a(o,u){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=new i("-","subtract",[o,u]),s=r(l,{},c);return nt(s)&&!s.value}return n(t0,{"Node, Node":a,"Node, Node, Object":a})}),r0="derivative",q9=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],z9=U(r0,q9,e=>{var{typed:t,config:r,parse:n,simplify:i,equal:a,isZero:o,numeric:u,ConstantNode:c,FunctionNode:l,OperatorNode:s,ParenthesisNode:f,SymbolNode:p}=e;function m(g,x){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},N={};w(N,g,x.name);var E=v(g,N);return y.simplify?i(E):E}t.addConversion({from:"identifier",to:"SymbolNode",convert:n});var d=t(r0,{"Node, SymbolNode":m,"Node, SymbolNode, Object":m});t.removeConversion({from:"identifier",to:"SymbolNode",convert:n}),d._simplify=!0,d.toTex=function(g){return h.apply(null,g.args)};var h=t("_derivTex",{"Node, SymbolNode":function(g,x){return nt(g)&&dt(g.value)==="string"?h(n(g.value).toString(),x.toString(),1):h(g.toTex(),x.toString(),1)},"Node, ConstantNode":function(g,x){if(dt(x.value)==="string")return h(g,n(x.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(g,x,y){return h(g.toString(),x.name,y.value)},"string, string, number":function(g,x,y){var N;return y===1?N="{d\\over d"+x+"}":N="{d^{"+y+"}\\over d"+x+"^{"+y+"}}",N+"\\left[".concat(g,"\\right]")}}),w=t("constTag",{"Object, ConstantNode, string":function(g,x){return g[x]=!0,!0},"Object, SymbolNode, string":function(g,x,y){return x.name!==y?(g[x]=!0,!0):!1},"Object, ParenthesisNode, string":function(g,x,y){return w(g,x.content,y)},"Object, FunctionAssignmentNode, string":function(g,x,y){return x.params.includes(y)?w(g,x.expr,y):(g[x]=!0,!0)},"Object, FunctionNode | OperatorNode, string":function(g,x,y){if(x.args.length>0){for(var N=w(g,x.args[0],y),E=1;E<x.args.length;++E)N=w(g,x.args[E],y)&&N;if(N)return g[x]=!0,!0}return!1}}),v=t("_derivative",{"ConstantNode, Object":function(g){return b(0)},"SymbolNode, Object":function(g,x){return x[g]!==void 0?b(0):b(1)},"ParenthesisNode, Object":function(g,x){return new f(v(g.content,x))},"FunctionAssignmentNode, Object":function(g,x){return x[g]!==void 0?b(0):v(g.expr,x)},"FunctionNode, Object":function(g,x){if(x[g]!==void 0)return b(0);var y=g.args[0],N,E=!1,A=!1,D;switch(g.name){case"cbrt":E=!0,D=new s("*","multiply",[b(3),new s("^","pow",[y,new s("/","divide",[b(2),b(3)])])]);break;case"sqrt":case"nthRoot":if(g.args.length===1)E=!0,D=new s("*","multiply",[b(2),new l("sqrt",[y])]);else if(g.args.length===2)return N=new s("/","divide",[b(1),g.args[1]]),x[N]=x[g.args[1]],v(new s("^","pow",[y,N]),x);break;case"log10":N=b(10);case"log":if(!N&&g.args.length===1)D=y.clone(),E=!0;else if(g.args.length===1&&N||g.args.length===2&&x[g.args[1]]!==void 0)D=new s("*","multiply",[y.clone(),new l("log",[N||g.args[1]])]),E=!0;else if(g.args.length===2)return v(new s("/","divide",[new l("log",[y]),new l("log",[g.args[1]])]),x);break;case"pow":if(g.args.length===2)return x[N]=x[g.args[1]],v(new s("^","pow",[y,g.args[1]]),x);break;case"exp":D=new l("exp",[y.clone()]);break;case"sin":D=new l("cos",[y.clone()]);break;case"cos":D=new s("-","unaryMinus",[new l("sin",[y.clone()])]);break;case"tan":D=new s("^","pow",[new l("sec",[y.clone()]),b(2)]);break;case"sec":D=new s("*","multiply",[g,new l("tan",[y.clone()])]);break;case"csc":A=!0,D=new s("*","multiply",[g,new l("cot",[y.clone()])]);break;case"cot":A=!0,D=new s("^","pow",[new l("csc",[y.clone()]),b(2)]);break;case"asin":E=!0,D=new l("sqrt",[new s("-","subtract",[b(1),new s("^","pow",[y.clone(),b(2)])])]);break;case"acos":E=!0,A=!0,D=new l("sqrt",[new s("-","subtract",[b(1),new s("^","pow",[y.clone(),b(2)])])]);break;case"atan":E=!0,D=new s("+","add",[new s("^","pow",[y.clone(),b(2)]),b(1)]);break;case"asec":E=!0,D=new s("*","multiply",[new l("abs",[y.clone()]),new l("sqrt",[new s("-","subtract",[new s("^","pow",[y.clone(),b(2)]),b(1)])])]);break;case"acsc":E=!0,A=!0,D=new s("*","multiply",[new l("abs",[y.clone()]),new l("sqrt",[new s("-","subtract",[new s("^","pow",[y.clone(),b(2)]),b(1)])])]);break;case"acot":E=!0,A=!0,D=new s("+","add",[new s("^","pow",[y.clone(),b(2)]),b(1)]);break;case"sinh":D=new l("cosh",[y.clone()]);break;case"cosh":D=new l("sinh",[y.clone()]);break;case"tanh":D=new s("^","pow",[new l("sech",[y.clone()]),b(2)]);break;case"sech":A=!0,D=new s("*","multiply",[g,new l("tanh",[y.clone()])]);break;case"csch":A=!0,D=new s("*","multiply",[g,new l("coth",[y.clone()])]);break;case"coth":A=!0,D=new s("^","pow",[new l("csch",[y.clone()]),b(2)]);break;case"asinh":E=!0,D=new l("sqrt",[new s("+","add",[new s("^","pow",[y.clone(),b(2)]),b(1)])]);break;case"acosh":E=!0,D=new l("sqrt",[new s("-","subtract",[new s("^","pow",[y.clone(),b(2)]),b(1)])]);break;case"atanh":E=!0,D=new s("-","subtract",[b(1),new s("^","pow",[y.clone(),b(2)])]);break;case"asech":E=!0,A=!0,D=new s("*","multiply",[y.clone(),new l("sqrt",[new s("-","subtract",[b(1),new s("^","pow",[y.clone(),b(2)])])])]);break;case"acsch":E=!0,A=!0,D=new s("*","multiply",[new l("abs",[y.clone()]),new l("sqrt",[new s("+","add",[new s("^","pow",[y.clone(),b(2)]),b(1)])])]);break;case"acoth":E=!0,A=!0,D=new s("-","subtract",[b(1),new s("^","pow",[y.clone(),b(2)])]);break;case"abs":D=new s("/","divide",[new l(new p("abs"),[y.clone()]),y.clone()]);break;case"gamma":default:throw new Error('Cannot process function "'+g.name+'" in derivative: the function is not supported, undefined, or the number of arguments passed to it are not supported')}var S,C;E?(S="/",C="divide"):(S="*",C="multiply");var _=v(y,x);return A&&(_=new s("-","unaryMinus",[_])),new s(S,C,[_,D])},"OperatorNode, Object":function(g,x){if(x[g]!==void 0)return b(0);if(g.op==="+")return new s(g.op,g.fn,g.args.map(function(P){return v(P,x)}));if(g.op==="-"){if(g.isUnary())return new s(g.op,g.fn,[v(g.args[0],x)]);if(g.isBinary())return new s(g.op,g.fn,[v(g.args[0],x),v(g.args[1],x)])}if(g.op==="*"){var y=g.args.filter(function(P){return x[P]!==void 0});if(y.length>0){var N=g.args.filter(function(P){return x[P]===void 0}),E=N.length===1?N[0]:new s("*","multiply",N),A=y.concat(v(E,x));return new s("*","multiply",A)}return new s("+","add",g.args.map(function(P){return new s("*","multiply",g.args.map(function(I){return I===P?v(I,x):I.clone()}))}))}if(g.op==="/"&&g.isBinary()){var D=g.args[0],S=g.args[1];return x[S]!==void 0?new s("/","divide",[v(D,x),S]):x[D]!==void 0?new s("*","multiply",[new s("-","unaryMinus",[D]),new s("/","divide",[v(S,x),new s("^","pow",[S.clone(),b(2)])])]):new s("/","divide",[new s("-","subtract",[new s("*","multiply",[v(D,x),S.clone()]),new s("*","multiply",[D.clone(),v(S,x)])]),new s("^","pow",[S.clone(),b(2)])])}if(g.op==="^"&&g.isBinary()){var C=g.args[0],_=g.args[1];if(x[C]!==void 0)return nt(C)&&(o(C.value)||a(C.value,1))?b(0):new s("*","multiply",[g,new s("*","multiply",[new l("log",[C.clone()]),v(_.clone(),x)])]);if(x[_]!==void 0){if(nt(_)){if(o(_.value))return b(0);if(a(_.value,1))return v(C,x)}var R=new s("^","pow",[C.clone(),new s("-","subtract",[_,b(1)])]);return new s("*","multiply",[_.clone(),new s("*","multiply",[v(C,x),R])])}return new s("*","multiply",[new s("^","pow",[C.clone(),_.clone()]),new s("+","add",[new s("*","multiply",[v(C,x),new s("/","divide",[_.clone(),C.clone()])]),new s("*","multiply",[v(_,x),new l("log",[C.clone()])])])])}throw new Error('Cannot process operator "'+g.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function b(g,x){return new c(u(g,r.number))}return d}),n0="rationalize",j9=["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"],L9=U(n0,j9,e=>{var{config:t,typed:r,equal:n,isZero:i,add:a,subtract:o,multiply:u,divide:c,pow:l,parse:s,simplifyConstant:f,simplifyCore:p,simplify:m,fraction:d,bignumber:h,mathWithTransform:w,matrix:v,AccessorNode:b,ArrayNode:g,ConstantNode:x,FunctionNode:y,IndexNode:N,ObjectNode:E,OperatorNode:A,SymbolNode:D,ParenthesisNode:S}=e;function C(O){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,k=R(),te=_(O,F,!0,k.firstRules),se=te.variables.length,K={exactFractions:!1},V={exactFractions:!0};if(O=te.expression,se>=1){O=P(O);var ue,me,re=!0,ae=!1;O=m(O,k.firstRules,{},K);for(var de;me=re?k.distrDivRules:k.sucDivRules,O=m(O,me,{},V),re=!re,de=O.toString(),de!==ue;)ae=!0,ue=de;ae&&(O=m(O,k.firstRulesAgain,{},K)),O=m(O,k.finalRules,{},K)}var ne=[],ce={};return O.type==="OperatorNode"&&O.isBinary()&&O.op==="/"?(se===1&&(O.args[0]=I(O.args[0],ne),O.args[1]=I(O.args[1])),q&&(ce.numerator=O.args[0],ce.denominator=O.args[1])):(se===1&&(O=I(O,ne)),q&&(ce.numerator=O,ce.denominator=null)),q?(ce.coefficients=ne,ce.variables=te.variables,ce.expression=O,ce):O}return r(n0,{Node:C,"Node, boolean":(O,F)=>C(O,{},F),"Node, Object":C,"Node, Object, boolean":C});function _(O,F,q,k){var te=[],se=m(O,k,F,{exactFractions:!1});q=!!q;var K="+-*"+(q?"/":"");ue(se);var V={};return V.expression=se,V.variables=te,V;function ue(me){var re=me.type;if(re==="FunctionNode")throw new Error("There is an unsolved function call");if(re==="OperatorNode")if(me.op==="^"){if(me.args[1].type!=="ConstantNode"||!Fe(parseFloat(me.args[1].value)))throw new Error("There is a non-integer exponent");ue(me.args[0])}else{if(!K.includes(me.op))throw new Error("Operator "+me.op+" invalid in polynomial expression");for(var ae=0;ae<me.args.length;ae++)ue(me.args[ae])}else if(re==="SymbolNode"){var de=me.name,ne=te.indexOf(de);ne===-1&&te.push(de)}else if(re==="ParenthesisNode")ue(me.content);else if(re!=="ConstantNode")throw new Error("type "+re+" is not allowed in polynomial expression")}}function R(){var O=[p,{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"}],F=[{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)"}],k=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],te={};return te.firstRules=O.concat(F,k),te.distrDivRules=q,te.sucDivRules=k,te.firstRulesAgain=O.concat(F),te.finalRules=[p,{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))"}],te}function P(O,F,q){var k=O.type,te=arguments.length>1;if(k==="OperatorNode"&&O.isBinary()){var se=!1,K;if(O.op==="^"&&(O.args[0].type==="ParenthesisNode"||O.args[0].type==="OperatorNode")&&O.args[1].type==="ConstantNode"&&(K=parseFloat(O.args[1].value),se=K>=2&&Fe(K)),se){if(K>2){var V=O.args[0],ue=new A("^","pow",[O.args[0].cloneDeep(),new x(K-1)]);O=new A("*","multiply",[V,ue])}else O=new A("*","multiply",[O.args[0],O.args[0].cloneDeep()]);te&&(q==="content"?F.content=O:F.args[q]=O)}}if(k==="ParenthesisNode")P(O.content,O,"content");else if(k!=="ConstantNode"&&k!=="SymbolNode")for(var me=0;me<O.args.length;me++)P(O.args[me],O,me);if(!te)return O}function I(O,F){F===void 0&&(F=[]),F[0]=0;var q={};q.cte=1,q.oper="+",q.fire="";var k=0,te="";de(O,null,q),k=F.length-1;for(var se=!0,K,V=k;V>=0;V--)if(F[V]!==0){var ue=new x(se?F[V]:Math.abs(F[V])),me=F[V]<0?"-":"+";if(V>0){var re=new D(te);if(V>1){var ae=new x(V);re=new A("^","pow",[re,ae])}F[V]===-1&&se?ue=new A("-","unaryMinus",[re]):Math.abs(F[V])===1?ue=re:ue=new A("*","multiply",[ue,re])}se?K=ue:me==="+"?K=new A("+","add",[K,ue]):K=new A("-","subtract",[K,ue]),se=!1}if(se)return new x(0);return K;function de(ne,ce,le){var he=ne.type;if(he==="FunctionNode")throw new Error("There is an unsolved function call");if(he==="OperatorNode"){if(!"+-*^".includes(ne.op))throw new Error("Operator "+ne.op+" invalid");if(ce!==null){if((ne.fn==="unaryMinus"||ne.fn==="pow")&&ce.fn!=="add"&&ce.fn!=="subtract"&&ce.fn!=="multiply")throw new Error("Invalid "+ne.op+" placing");if((ne.fn==="subtract"||ne.fn==="add"||ne.fn==="multiply")&&ce.fn!=="add"&&ce.fn!=="subtract")throw new Error("Invalid "+ne.op+" placing");if((ne.fn==="subtract"||ne.fn==="add"||ne.fn==="unaryMinus")&&le.noFil!==0)throw new Error("Invalid "+ne.op+" placing")}(ne.op==="^"||ne.op==="*")&&(le.fire=ne.op);for(var be=0;be<ne.args.length;be++)ne.fn==="unaryMinus"&&(le.oper="-"),(ne.op==="+"||ne.fn==="subtract")&&(le.fire="",le.cte=1,le.oper=be===0?"+":ne.op),le.noFil=be,de(ne.args[be],ne,le)}else if(he==="SymbolNode"){if(ne.name!==te&&te!=="")throw new Error("There is more than one variable");if(te=ne.name,ce===null){F[1]=1;return}if(ce.op==="^"&&le.noFil!==0)throw new Error("In power the variable should be the first parameter");if(ce.op==="*"&&le.noFil!==1)throw new Error("In multiply the variable should be the second parameter");(le.fire===""||le.fire==="*")&&(k<1&&(F[1]=0),F[1]+=le.cte*(le.oper==="+"?1:-1),k=Math.max(1,k))}else if(he==="ConstantNode"){var $=parseFloat(ne.value);if(ce===null){F[0]=$;return}if(ce.op==="^"){if(le.noFil!==1)throw new Error("Constant cannot be powered");if(!Fe($)||$<=0)throw new Error("Non-integer exponent is not allowed");for(var T=k+1;T<$;T++)F[T]=0;$>k&&(F[$]=0),F[$]+=le.cte*(le.oper==="+"?1:-1),k=Math.max($,k);return}le.cte=$,le.fire===""&&(F[0]+=le.cte*(le.oper==="+"?1:-1))}else throw new Error("Type "+he+" is not allowed")}}}),i0="zpk2tf",P9=["typed","add","multiply","Complex","number"],V9=U(i0,P9,e=>{var{typed:t,add:r,multiply:n,Complex:i,number:a}=e;return t(i0,{"Array,Array,number":function(c,l,s){return o(c,l,s)},"Array,Array":function(c,l){return o(c,l,1)},"Matrix,Matrix,number":function(c,l,s){return o(c.valueOf(),l.valueOf(),s)},"Matrix,Matrix":function(c,l){return o(c.valueOf(),l.valueOf(),1)}});function o(c,l,s){c.some(b=>b.type==="BigNumber")&&(c=c.map(b=>a(b))),l.some(b=>b.type==="BigNumber")&&(l=l.map(b=>a(b)));for(var f=[i(1,0)],p=[i(1,0)],m=0;m<c.length;m++){var d=c[m];typeof d=="number"&&(d=i(d,0)),f=u(f,[i(1,0),i(-d.re,-d.im)])}for(var h=0;h<l.length;h++){var w=l[h];typeof w=="number"&&(w=i(w,0)),p=u(p,[i(1,0),i(-w.re,-w.im)])}for(var v=0;v<f.length;v++)f[v]=n(f[v],s);return[f,p]}function u(c,l){for(var s=[],f=0;f<c.length+l.length-1;f++){s[f]=i(0,0);for(var p=0;p<c.length;p++)f-p>=0&&f-p<l.length&&(s[f]=r(s[f],n(c[p],l[f-p])))}return s}}),a0="freqz",U9=["typed","add","multiply","Complex","divide","matrix"],$9=U(a0,U9,e=>{var{typed:t,add:r,multiply:n,Complex:i,divide:a,matrix:o}=e;return t(a0,{"Array, Array":function(l,s){var f=c(512);return u(l,s,f)},"Array, Array, Array":function(l,s,f){return u(l,s,f)},"Array, Array, number":function(l,s,f){if(f<0)throw new Error("w must be a positive number");var p=c(f);return u(l,s,p)},"Matrix, Matrix":function(l,s){var f=c(512),{w:p,h:m}=u(l.valueOf(),s.valueOf(),f);return{w:o(p),h:o(m)}},"Matrix, Matrix, Matrix":function(l,s,f){var{h:p}=u(l.valueOf(),s.valueOf(),f.valueOf());return{h:o(p),w:o(f)}},"Matrix, Matrix, number":function(l,s,f){if(f<0)throw new Error("w must be a positive number");var p=c(f),{h:m}=u(l.valueOf(),s.valueOf(),p);return{h:o(m),w:o(p)}}});function u(l,s,f){for(var p=[],m=[],d=0;d<f.length;d++){for(var h=i(0,0),w=i(0,0),v=0;v<l.length;v++)h=r(h,n(l[v],i(Math.cos(-v*f[d]),Math.sin(-v*f[d]))));for(var b=0;b<s.length;b++)w=r(w,n(s[b],i(Math.cos(-b*f[d]),Math.sin(-b*f[d]))));p.push(h),m.push(w)}for(var g=[],x=0;x<p.length;x++)g.push(a(p[x],m[x]));return{h:g,w:f}}function c(l){for(var s=[],f=0;f<l;f++)s.push(f/l*Math.PI);return s}}),H9="reviver",J9=["classes"],G9=U(H9,J9,e=>{var{classes:t}=e;return function(r,n){var i=t[n&&n.mathjs];return i&&typeof i.fromJSON=="function"?i.fromJSON(n):n}}),W9="replacer",K9=[],Q9=U(W9,K9,()=>function(e,t){return typeof t=="number"&&(!isFinite(t)||isNaN(t))?{mathjs:"number",value:String(t)}:t}),Z9="12.4.3",X9=U("true",[],()=>!0),Y9=U("false",[],()=>!1),e7=U("null",[],()=>null),t7=Nr("Infinity",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1/0):1/0}),r7=Nr("NaN",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(NaN):NaN}),n7=Nr("pi",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?Fl(r):hD}),i7=Nr("tau",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?z3(r):gD}),a7=Nr("e",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?R3(r):vD}),o7=Nr("phi",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?q3(r):yD}),s7=Nr("LN2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(2).ln():Math.LN2}),u7=Nr("LN10",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(10).ln():Math.LN10}),c7=Nr("LOG2E",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1).div(new r(2).ln()):Math.LOG2E}),l7=Nr("LOG10E",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1).div(new r(10).ln()):Math.LOG10E}),f7=Nr("SQRT1_2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r("0.5").sqrt():Math.SQRT1_2}),p7=Nr("SQRT2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(2).sqrt():Math.SQRT2}),m7=Nr("i",["Complex"],e=>{var{Complex:t}=e;return t.I}),d7=U("version",[],()=>Z9);function Nr(e,t,r){return U(e,t,r,{recreateOnConfigChange:!0})}var h7=Pe("speedOfLight","299792458","m s^-1"),g7=Pe("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),v7=Pe("planckConstant","6.62607015e-34","J s"),y7=Pe("reducedPlanckConstant","1.0545718176461565e-34","J s"),x7=Pe("magneticConstant","1.25663706212e-6","N A^-2"),b7=Pe("electricConstant","8.8541878128e-12","F m^-1"),w7=Pe("vacuumImpedance","376.730313667","ohm"),N7=Pe("coulomb","8.987551792261171e9","N m^2 C^-2"),D7=Pe("elementaryCharge","1.602176634e-19","C"),E7=Pe("bohrMagneton","9.2740100783e-24","J T^-1"),A7=Pe("conductanceQuantum","7.748091729863649e-5","S"),S7=Pe("inverseConductanceQuantum","12906.403729652257","ohm"),C7=Pe("magneticFluxQuantum","2.0678338484619295e-15","Wb"),M7=Pe("nuclearMagneton","5.0507837461e-27","J T^-1"),_7=Pe("klitzing","25812.807459304513","ohm"),F7=Pe("bohrRadius","5.29177210903e-11","m"),T7=Pe("classicalElectronRadius","2.8179403262e-15","m"),O7=Pe("electronMass","9.1093837015e-31","kg"),B7=Pe("fermiCoupling","1.1663787e-5","GeV^-2"),k7=Eu("fineStructure",.0072973525693),I7=Pe("hartreeEnergy","4.3597447222071e-18","J"),R7=Pe("protonMass","1.67262192369e-27","kg"),q7=Pe("deuteronMass","3.3435830926e-27","kg"),z7=Pe("neutronMass","1.6749271613e-27","kg"),j7=Pe("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),L7=Pe("rydberg","10973731.568160","m^-1"),P7=Pe("thomsonCrossSection","6.6524587321e-29","m^2"),V7=Eu("weakMixingAngle",.2229),U7=Eu("efimovFactor",22.7),$7=Pe("atomicMass","1.66053906660e-27","kg"),H7=Pe("avogadro","6.02214076e23","mol^-1"),J7=Pe("boltzmann","1.380649e-23","J K^-1"),G7=Pe("faraday","96485.33212331001","C mol^-1"),W7=Pe("firstRadiation","3.7417718521927573e-16","W m^2"),K7=Pe("loschmidt","2.686780111798444e25","m^-3"),Q7=Pe("gasConstant","8.31446261815324","J K^-1 mol^-1"),Z7=Pe("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),X7=Pe("molarVolume","0.022413969545014137","m^3 mol^-1"),Y7=Eu("sackurTetrode",-1.16487052358),ek=Pe("secondRadiation","0.014387768775039337","m K"),tk=Pe("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),rk=Pe("wienDisplacement","2.897771955e-3","m K"),nk=Pe("molarMass","0.99999999965e-3","kg mol^-1"),ik=Pe("molarMassC12","11.9999999958e-3","kg mol^-1"),ak=Pe("gravity","9.80665","m s^-2"),ok=Pe("planckLength","1.616255e-35","m"),sk=Pe("planckMass","2.176435e-8","kg"),uk=Pe("planckTime","5.391245e-44","s"),ck=Pe("planckCharge","1.87554603778e-18","C"),lk=Pe("planckTemperature","1.416785e+32","K");function Pe(e,t,r){var n=["config","Unit","BigNumber"];return U(e,n,i=>{var{config:a,Unit:o,BigNumber:u}=i,c=a.number==="BigNumber"?new u(t):parseFloat(t),l=new o(c,r);return l.fixPrefix=!0,l})}function Eu(e,t){var r=["config","BigNumber"];return U(e,r,n=>{var{config:i,BigNumber:a}=n;return i.number==="BigNumber"?new a(t):t})}var fk="apply",pk=["typed","isInteger"],mk=U(fk,pk,e=>{var{typed:t,isInteger:r}=e,n=El({typed:t,isInteger:r});return t("apply",{"...any":function(i){var a=i[1];Ue(a)?i[1]=a-1:$e(a)&&(i[1]=a.minus(1));try{return n.apply(null,i)}catch(o){throw lr(o)}}})},{isTransformFunction:!0}),dk="column",hk=["typed","Index","matrix","range"],gk=U(dk,hk,e=>{var{typed:t,Index:r,matrix:n,range:i}=e,a=Ey({typed:t,Index:r,matrix:n,range:i});return t("column",{"...any":function(o){var u=o.length-1,c=o[u];Ue(c)&&(o[u]=c-1);try{return a.apply(null,o)}catch(l){throw lr(l)}}})},{isTransformFunction:!0});function Bl(e,t,r){var n=e.filter(function(c){return zt(c)&&!(c.name in t)&&!r.has(c.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');var i=n.name,a=new Map,o=new Wg(r,a,new Set([i])),u=e.compile();return function(c){return a.set(i,c),u.evaluate(o)}}var vk="filter",yk=["typed"],xk=U(vk,yk,e=>{var{typed:t}=e;function r(i,a,o){var u,c;return i[0]&&(u=i[0].compile().evaluate(o)),i[1]&&(zt(i[1])||xo(i[1])?c=i[1].compile().evaluate(o):c=Bl(i[1],a,o)),n(u,c)}r.rawArgs=!0;var n=t("filter",{"Array, function":o0,"Matrix, function":function(i,a){return i.create(o0(i.toArray(),a))},"Array, RegExp":ks,"Matrix, RegExp":function(i,a){return i.create(ks(i.toArray(),a))}});return r},{isTransformFunction:!0});function o0(e,t){return vv(e,function(r,n,i){return Ca(t,r,[n+1],i,"filter")})}var bk="forEach",wk=["typed"],Nk=U(bk,wk,e=>{var{typed:t}=e;function r(i,a,o){var u,c;return i[0]&&(u=i[0].compile().evaluate(o)),i[1]&&(zt(i[1])||xo(i[1])?c=i[1].compile().evaluate(o):c=Bl(i[1],a,o)),n(u,c)}r.rawArgs=!0;var n=t("forEach",{"Array | Matrix, function":function(i,a){var o=function u(c,l){if(Array.isArray(c))yu(c,function(s,f){u(s,l.concat(f+1))});else return Ca(a,c,l,i,"forEach")};o(i.valueOf(),[])}});return r},{isTransformFunction:!0}),Dk="index",Ek=["Index","getMatrixDataType"],Ak=U(Dk,Ek,e=>{var{Index:t,getMatrixDataType:r}=e;return function(){for(var n=[],i=0,a=arguments.length;i<a;i++){var o=arguments[i];if(yl(o))o.start--,o.end-=o.step>0?0:2;else if(o&&o.isSet===!0)o=o.map(function(c){return c-1});else if(st(o)||ke(o))r(o)!=="boolean"&&(o=o.map(function(c){return c-1}));else if(Ue(o))o--;else if($e(o))o=o.toNumber()-1;else if(typeof o!="string")throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");n[i]=o}var u=new t;return t.apply(u,n),u}},{isTransformFunction:!0}),Sk="map",Ck=["typed"],Mk=U(Sk,Ck,e=>{var{typed:t}=e;function r(i,a,o){var u,c;return i[0]&&(u=i[0].compile().evaluate(o)),i[1]&&(zt(i[1])||xo(i[1])?c=i[1].compile().evaluate(o):c=Bl(i[1],a,o)),n(u,c)}r.rawArgs=!0;var n=t("map",{"Array, function":function(i,a){return s0(i,a,i)},"Matrix, function":function(i,a){return i.create(s0(i.valueOf(),a,i))}});return r},{isTransformFunction:!0});function s0(e,t,r){function n(i,a){return Array.isArray(i)?Nn(i,function(o,u){return n(o,a.concat(u+1))}):Ca(t,i,a,r,"map")}return n(e,[])}function ai(e){if(e.length===2&&Fr(e[0])){e=e.slice();var t=e[1];Ue(t)?e[1]=t-1:$e(t)&&(e[1]=t.minus(1))}return e}var _k="max",Fk=["typed","config","numeric","larger"],Tk=U(_k,Fk,e=>{var{typed:t,config:r,numeric:n,larger:i}=e,a=ky({typed:t,config:r,numeric:n,larger:i});return t("max",{"...any":function(o){o=ai(o);try{return a.apply(null,o)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),Ok="mean",Bk=["typed","add","divide"],kk=U(Ok,Bk,e=>{var{typed:t,add:r,divide:n}=e,i=Uy({typed:t,add:r,divide:n});return t("mean",{"...any":function(a){a=ai(a);try{return i.apply(null,a)}catch(o){throw lr(o)}}})},{isTransformFunction:!0}),Ik="min",Rk=["typed","config","numeric","smaller"],qk=U(Ik,Rk,e=>{var{typed:t,config:r,numeric:n,smaller:i}=e,a=Iy({typed:t,config:r,numeric:n,smaller:i});return t("min",{"...any":function(o){o=ai(o);try{return a.apply(null,o)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),zk="range",jk=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],Lk=U(zk,jk,e=>{var{typed:t,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:u,largerEq:c,add:l,isPositive:s}=e,f=My({typed:t,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:u,largerEq:c,add:l,isPositive:s});return t("range",{"...any":function(p){var m=p.length-1,d=p[m];return typeof d!="boolean"&&p.push(!0),f.apply(null,p)}})},{isTransformFunction:!0}),Pk="row",Vk=["typed","Index","matrix","range"],Uk=U(Pk,Vk,e=>{var{typed:t,Index:r,matrix:n,range:i}=e,a=_y({typed:t,Index:r,matrix:n,range:i});return t("row",{"...any":function(o){var u=o.length-1,c=o[u];Ue(c)&&(o[u]=c-1);try{return a.apply(null,o)}catch(l){throw lr(l)}}})},{isTransformFunction:!0}),$k="subset",Hk=["typed","matrix","zeros","add"],Jk=U($k,Hk,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e,a=Fy({typed:t,matrix:r,zeros:n,add:i});return t("subset",{"...any":function(o){try{return a.apply(null,o)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),Gk="concat",Wk=["typed","matrix","isInteger"],Kk=U(Gk,Wk,e=>{var{typed:t,matrix:r,isInteger:n}=e,i=Dy({typed:t,matrix:r,isInteger:n});return t("concat",{"...any":function(a){var o=a.length-1,u=a[o];Ue(u)?a[o]=u-1:$e(u)&&(a[o]=u.minus(1));try{return i.apply(null,a)}catch(c){throw lr(c)}}})},{isTransformFunction:!0}),u0="diff",Qk=["typed","matrix","subtract","number","bignumber"],Zk=U(u0,Qk,e=>{var{typed:t,matrix:r,subtract:n,number:i,bignumber:a}=e,o=Ay({typed:t,matrix:r,subtract:n,number:i,bignumber:a});return t(u0,{"...any":function(u){u=ai(u);try{return o.apply(null,u)}catch(c){throw lr(c)}}})},{isTransformFunction:!0}),Xk="std",Yk=["typed","map","sqrt","variance"],eI=U(Xk,Yk,e=>{var{typed:t,map:r,sqrt:n,variance:i}=e,a=Jy({typed:t,map:r,sqrt:n,variance:i});return t("std",{"...any":function(o){o=ai(o);try{return a.apply(null,o)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),c0="sum",tI=["typed","config","add","numeric"],rI=U(c0,tI,e=>{var{typed:t,config:r,add:n,numeric:i}=e,a=Py({typed:t,config:r,add:n,numeric:i});return t(c0,{"...any":function(o){o=ai(o);try{return a.apply(null,o)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),nI="quantileSeq",iI=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],aI=U(nI,iI,e=>{var{typed:t,bignumber:r,add:n,subtract:i,divide:a,multiply:o,partitionSelect:u,compare:c,isInteger:l,smaller:s,smallerEq:f,larger:p}=e,m=Hy({typed:t,bignumber:r,add:n,subtract:i,divide:a,multiply:o,partitionSelect:u,compare:c,isInteger:l,smaller:s,smallerEq:f,larger:p});return t("quantileSeq",{"Array | Matrix, number | BigNumber":m,"Array | Matrix, number | BigNumber, number":(h,w,v)=>m(h,w,d(v)),"Array | Matrix, number | BigNumber, boolean":m,"Array | Matrix, number | BigNumber, boolean, number":(h,w,v,b)=>m(h,w,v,d(b)),"Array | Matrix, Array | Matrix":m,"Array | Matrix, Array | Matrix, number":(h,w,v)=>m(h,w,d(v)),"Array | Matrix, Array | Matrix, boolean":m,"Array | Matrix, Array | Matrix, boolean, number":(h,w,v,b)=>m(h,w,v,d(b))});function d(h){return ai([[],h])[1]}},{isTransformFunction:!0}),l0="cumsum",oI=["typed","add","unaryPlus"],sI=U(l0,oI,e=>{var{typed:t,add:r,unaryPlus:n}=e,i=Vy({typed:t,add:r,unaryPlus:n});return t(l0,{"...any":function(a){if(a.length===2&&Fr(a[0])){var o=a[1];Ue(o)?a[1]=o-1:$e(o)&&(a[1]=o.minus(1))}try{return i.apply(null,a)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),f0="variance",uI=["typed","add","subtract","multiply","divide","apply","isNaN"],cI=U(f0,uI,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:a,apply:o,isNaN:u}=e,c=$y({typed:t,add:r,subtract:n,multiply:i,divide:a,apply:o,isNaN:u});return t(f0,{"...any":function(l){l=ai(l);try{return c.apply(null,l)}catch(s){throw lr(s)}}})},{isTransformFunction:!0}),p0="print",lI=["typed","matrix","zeros","add"],fI=U(p0,lI,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e,a=Oy({typed:t,matrix:r,zeros:n,add:i});return t(p0,{"string, Object | Array":function(u,c){return a(o(u),c)},"string, Object | Array, number | Object":function(u,c,l){return a(o(u),c,l)}});function o(u){return u.replace(Ty,c=>{var l=c.slice(1).split("."),s=l.map(function(f){return!isNaN(f)&&f.length>0?parseInt(f)-1:f});return"$"+s.join(".")})}},{isTransformFunction:!0}),pI="and",mI=["typed","matrix","zeros","add","equalScalar","not","concat"],dI=U(pI,mI,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o}=e,u=By({typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o});function c(l,s,f){var p=l[0].compile().evaluate(f);if(!Fr(p)&&!u(p,!0))return!1;var m=l[1].compile().evaluate(f);return u(p,m)}return c.rawArgs=!0,c},{isTransformFunction:!0}),hI="or",gI=["typed","matrix","equalScalar","DenseMatrix","concat"],vI=U(hI,gI,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=Ny({typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a});function u(c,l,s){var f=c[0].compile().evaluate(s);if(!Fr(f)&&o(f,!1))return!0;var p=c[1].compile().evaluate(s);return o(f,p)}return u.rawArgs=!0,u},{isTransformFunction:!0}),yI="bitAnd",xI=["typed","matrix","zeros","add","equalScalar","not","concat"],bI=U(yI,xI,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o}=e,u=by({typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o});function c(l,s,f){var p=l[0].compile().evaluate(f);if(!Fr(p)){if(isNaN(p))return NaN;if(p===0||p===!1)return 0}var m=l[1].compile().evaluate(f);return u(p,m)}return c.rawArgs=!0,c},{isTransformFunction:!0}),wI="bitOr",NI=["typed","matrix","equalScalar","DenseMatrix","concat"],DI=U(wI,NI,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=wy({typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a});function u(c,l,s){var f=c[0].compile().evaluate(s);if(!Fr(f)){if(isNaN(f))return NaN;if(f===-1)return-1;if(f===!0)return 1}var p=c[1].compile().evaluate(s);return o(f,p)}return u.rawArgs=!0,u},{isTransformFunction:!0}),Ae=B2({config:ve}),ht=z2({}),m0=a7({BigNumber:Ae,config:ve}),EI=Y9({}),AI=k7({BigNumber:Ae,config:ve}),Pi=V2({}),t1=m7({Complex:ht}),SI=t7({BigNumber:Ae,config:ve}),CI=u7({BigNumber:Ae,config:ve}),MI=l7({BigNumber:Ae,config:ve}),Au=W2({}),_I=r7({BigNumber:Ae,config:ve}),FI=e7({}),TI=o7({BigNumber:Ae,config:ve}),OI=H2({}),r1=qN({}),BI=f7({BigNumber:Ae,config:ve}),kI=Y7({BigNumber:Ae,config:ve}),n1=i7({BigNumber:Ae,config:ve}),II=X9({}),RI=d7({}),He=uD({Matrix:Au}),qI=U7({BigNumber:Ae,config:ve}),zI=s7({BigNumber:Ae,config:ve}),Hc=n7({BigNumber:Ae,config:ve}),jI=Q9({}),LI=p7({BigNumber:Ae,config:ve}),W=BN({BigNumber:Ae,Complex:ht,DenseMatrix:He,Fraction:Pi}),kl=xE({BigNumber:Ae,config:ve,typed:W}),PI=V7({BigNumber:Ae,config:ve}),fr=wE({typed:W}),VI=K3({Complex:ht,config:ve,typed:W}),UI=Y3({BigNumber:Ae,typed:W}),$I=n_({BigNumber:Ae,Complex:ht,config:ve,typed:W}),Rt=AE({typed:W}),HI=pS({typed:W}),JI=c_({BigNumber:Ae,Complex:ht,config:ve,typed:W}),GI=d_({typed:W}),i1=v_({typed:W}),WI=w_({Complex:ht,config:ve,typed:W}),ir=YD({BigNumber:Ae,typed:W}),KI=aS({typed:W}),QI=QD({typed:W}),ZI=lD({typed:W}),Su=C6({typed:W}),Cu=rE({Complex:ht,typed:W}),Vi=dS({typed:W}),Il=D_({typed:W}),XI=C_({BigNumber:Ae,typed:W}),YI=T_({BigNumber:Ae,typed:W}),eR=LE({typed:W}),Xe=zD({config:ve,typed:W}),tR=RC({typed:W}),a1=VE({typed:W}),rR=$E({Complex:ht,typed:W}),nR=kS({typed:W}),iR=zS({typed:W}),Eo=GC({typed:W}),Rl=PS({typed:W}),aR=YC({format:Eo,typed:W}),ql=gS({typed:W}),dr=pD({typed:W}),oi=DD({typed:W}),Ui=_D({typed:W}),Wr=TD({typed:W}),oR=c7({BigNumber:Ae,config:ve}),sR=B6({Complex:ht,typed:W}),uR=AA({Complex:ht,config:ve,typed:W}),o1=CA({Complex:ht,config:ve,typed:W}),$i=GS({typed:W}),At=FA({typed:W}),Qs=bS({typed:W}),Tn=JD({typed:W}),cR=ZC({format:Eo,typed:W}),lR=s9({config:ve,typed:W}),fR=Oy({typed:W}),pR=c9({config:ve,typed:W}),zl=yS({typed:W}),mR=I_({BigNumber:Ae,typed:W}),s1=RA({BigNumber:Ae,Fraction:Pi,complex:Cu,typed:W}),Mu=j_({typed:W}),On=PD({Matrix:Au,equalScalar:Xe,typed:W}),dR=hE({typed:W}),hR=PA({typed:W}),gR=WD({typed:W}),Or=CE({typed:W}),vR=U_({typed:W}),u1=ID({typed:W}),yR=Z3({Complex:ht,config:ve,typed:W}),xR=a_({BigNumber:Ae,typed:W}),jl=El({isInteger:dr,typed:W}),bR=s_({BigNumber:Ae,Complex:ht,config:ve,typed:W}),wR=KC({format:Eo,typed:W}),NR=_6({typed:W}),DR=A_({typed:W}),ER=B_({BigNumber:Ae,typed:W}),Ao=BD({typed:W}),AR=iM({typed:W}),SR=f9({config:ve,typed:W}),CR=q_({BigNumber:Ae,typed:W}),MR=P_({typed:W}),_R=H3({SparseMatrix:On,typed:W}),Kr=jA({Complex:ht,config:ve,typed:W}),FR=J_({typed:W}),ln=vE({typed:W}),TR=t_({BigNumber:Ae,Complex:ht,config:ve,typed:W}),OR=__({BigNumber:Ae,typed:W}),_a=aE({Fraction:Pi,typed:W}),Hi=AD({typed:W}),we=sE({DenseMatrix:He,Matrix:Au,SparseMatrix:On,typed:W}),BR=cE({isZero:Wr,matrix:we,typed:W}),kR=UC({isNaN:Ao,isNumeric:Hi,typed:W}),Pr=sM({bignumber:ir,fraction:_a,number:Tn}),c1=HC({config:ve,multiplyScalar:At,numeric:Pr,typed:W}),l1=tC({isInteger:dr,matrix:we,typed:W}),Gt=fC({matrix:we,config:ve,typed:W}),IR=mC({matrix:we,typed:W}),So=xC({matrix:we,typed:W}),f1=HA({BigNumber:Ae,config:ve,matrix:we,typed:W}),Ut=DC({BigNumber:Ae,config:ve,matrix:we,typed:W}),RR=f_({Complex:ht,config:ve,typed:W}),p1=_E({BigNumber:Ae,Complex:ht,Fraction:Pi,config:ve,isNegative:oi,matrix:we,typed:W,unaryMinus:ln}),it=Dy({isInteger:dr,matrix:we,typed:W}),qR=CS({prod:c1,size:Gt,typed:W}),Ll=wC({conj:Vi,transpose:So,typed:W}),m1=TS({DenseMatrix:He,SparseMatrix:On,matrix:we,typed:W}),Nt=cM({numeric:Pr,typed:W}),Co=DM({DenseMatrix:He,concat:it,divideScalar:Nt,equalScalar:Xe,matrix:we,typed:W}),Br=ZM({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W}),Mo=RS({matrix:we,typed:W}),zR=CD({isNumeric:Hi,typed:W}),si=US({BigNumber:Ae,DenseMatrix:He,SparseMatrix:On,config:ve,matrix:we,typed:W}),jR=HS({matrix:we,multiplyScalar:At,typed:W}),_u=f3({DenseMatrix:He,concat:it,config:ve,matrix:we,typed:W}),LR=IM({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W,zeros:Ut}),d1=AM({DenseMatrix:He,divideScalar:Nt,equalScalar:Xe,matrix:we,multiplyScalar:At,subtractScalar:Or,typed:W}),Pl=mE({flatten:Mo,matrix:we,size:Gt,typed:W}),PR=kA({BigNumber:Ae,concat:it,equalScalar:Xe,matrix:we,typed:W}),VR=XS({BigNumber:Ae,config:ve,matrix:we,typed:W}),Vl=MF({addScalar:Rt,complex:Cu,conj:Vi,divideScalar:Nt,equal:Br,identity:si,isZero:Wr,matrix:we,multiplyScalar:At,sign:s1,sqrt:Kr,subtractScalar:Or,typed:W,unaryMinus:ln,zeros:Ut}),UR=iC({config:ve,matrix:we}),$R=qM({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W,zeros:Ut}),tn=mM({BigNumber:Ae,DenseMatrix:He,config:ve,equalScalar:Xe,matrix:we,typed:W,zeros:Ut}),ar=r3({DenseMatrix:He,concat:it,config:ve,matrix:we,typed:W}),Dt=UA({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,subtractScalar:Or,typed:W,unaryMinus:ln}),HR=rM({concat:it,matrix:we,typed:W}),JR=g3({DenseMatrix:He,concat:it,config:ve,equalScalar:Xe,matrix:we,typed:W}),Ul=CM({DenseMatrix:He,divideScalar:Nt,equalScalar:Xe,matrix:we,multiplyScalar:At,subtractScalar:Or,typed:W}),GR=DS({DenseMatrix:He,concat:it,matrix:we,typed:W}),rt=d4({DenseMatrix:He,SparseMatrix:On,addScalar:Rt,concat:it,equalScalar:Xe,matrix:we,typed:W}),WR=x_({BigNumber:Ae,DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W}),KR=by({concat:it,equalScalar:Xe,matrix:we,typed:W}),QR=wy({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W}),ZR=lS({DenseMatrix:He,concat:it,matrix:we,typed:W}),XR=v9({addScalar:Rt,combinations:Su,divideScalar:Nt,isInteger:dr,isNegative:oi,multiplyScalar:At,typed:W}),Ji=VM({BigNumber:Ae,DenseMatrix:He,Fraction:Pi,concat:it,config:ve,equalScalar:Xe,matrix:we,typed:W}),h1=KM({concat:it,matrix:we,typed:W}),YR=Vy({add:rt,typed:W,unaryPlus:kl}),$l=d3({equal:Br,typed:W}),eq=Ay({matrix:we,number:Tn,subtract:Dt,typed:W}),tq=l6({abs:fr,addScalar:Rt,deepEqual:$l,divideScalar:Nt,multiplyScalar:At,sqrt:Kr,subtractScalar:Or,typed:W}),Fu=b4({addScalar:Rt,conj:Vi,multiplyScalar:At,size:Gt,typed:W}),rq=e3({compareText:h1,isZero:Wr,typed:W}),g1=vy({DenseMatrix:He,config:ve,equalScalar:Xe,matrix:we,round:tn,typed:W,zeros:Ut}),nq=xA({BigNumber:Ae,DenseMatrix:He,concat:it,config:ve,equalScalar:Xe,matrix:we,round:tn,typed:W,zeros:Ut}),iq=g4({abs:fr,addScalar:Rt,divideScalar:Nt,isPositive:Ui,multiplyScalar:At,smaller:ar,sqrt:Kr,typed:W}),v1=S3({DenseMatrix:He,smaller:ar}),Xt=_3({ImmutableDenseMatrix:v1,getMatrixDataType:Rl}),or=u3({DenseMatrix:He,concat:it,config:ve,matrix:we,typed:W}),Hl=hM({Complex:ht,config:ve,divideScalar:Nt,typed:W}),aq=_M({DenseMatrix:He,divideScalar:Nt,equalScalar:Xe,matrix:we,multiplyScalar:At,subtractScalar:Or,typed:W}),oq=fE({flatten:Mo,matrix:we,size:Gt,typed:W}),sq=Iy({config:ve,numeric:Pr,smaller:ar,typed:W}),y1=yy({DenseMatrix:He,concat:it,config:ve,equalScalar:Xe,matrix:we,round:tn,typed:W,zeros:Ut}),ct=OA({addScalar:Rt,dot:Fu,equalScalar:Xe,matrix:we,multiplyScalar:At,typed:W}),uq=xM({Complex:ht,config:ve,divideScalar:Nt,typed:W}),cq=Ny({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W}),Tu=x3({compare:Ji,isNaN:Ao,isNumeric:Hi,typed:W}),lq=jM({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W,zeros:Ut}),x1=XF({SparseMatrix:On,abs:fr,add:rt,divideScalar:Nt,larger:or,largerEq:_u,multiply:ct,subtract:Dt,transpose:So,typed:W}),Dr=Fy({add:rt,matrix:we,typed:W,zeros:Ut}),Jl=Py({add:rt,config:ve,numeric:Pr,typed:W}),fq=D4({add:rt,matrix:we,typed:W}),b1=TM({DenseMatrix:He,divideScalar:Nt,equalScalar:Xe,matrix:we,multiplyScalar:At,subtractScalar:Or,typed:W}),pq=V9({Complex:ht,add:rt,multiply:ct,number:Tn,typed:W}),Gl=zE({DenseMatrix:He,config:ve,equalScalar:Xe,matrix:we,round:tn,typed:W,zeros:Ut}),fn=JM({compare:Ji,typed:W}),mq=x9({addScalar:Rt,combinations:Su,isInteger:dr,isNegative:oi,isPositive:Ui,larger:or,typed:W}),dq=_S({matrix:we,multiply:ct,subtract:Dt,typed:W}),w1=LB({divideScalar:Nt,isZero:Wr,matrix:we,multiply:ct,subtractScalar:Or,typed:W,unaryMinus:ln}),hq=ZA({concat:it,equalScalar:Xe,matrix:we,multiplyScalar:At,typed:W}),N1=O3({larger:or,smaller:ar}),D1=GE({Complex:ht,DenseMatrix:He,ceil:Gl,equalScalar:Xe,floor:g1,matrix:we,typed:W,zeros:Ut}),E1=A4({Index:Xt,typed:W}),gq=m6({abs:fr,add:rt,addScalar:Rt,config:ve,divideScalar:Nt,equalScalar:Xe,flatten:Mo,isNumeric:Hi,isZero:Wr,matrix:we,multiply:ct,multiplyScalar:At,smaller:ar,subtract:Dt,typed:W}),vq=GA({BigNumber:Ae,add:rt,config:ve,equal:Br,isInteger:dr,mod:y1,smaller:ar,typed:W,xgcd:f1}),yq=DA({concat:it,equalScalar:Xe,matrix:we,typed:W}),xq=vM({Complex:ht,config:ve,divideScalar:Nt,log:Hl,typed:W}),Wl=ky({config:ve,larger:or,numeric:Pr,typed:W}),bq=W_({DenseMatrix:He,Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:W}),wq=X_({DenseMatrix:He,Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:W}),Nq=r4({Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:W}),Dq=o4({Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:W}),va=a3({DenseMatrix:He,concat:it,config:ve,matrix:we,typed:W}),Eq=w3({compare:Ji,compareNatural:fn,matrix:we,typed:W}),Aq=By({concat:it,equalScalar:Xe,matrix:we,not:Qs,typed:W,zeros:Ut}),ya=My({bignumber:ir,matrix:we,add:rt,config:ve,isPositive:Ui,larger:or,largerEq:_u,smaller:ar,smallerEq:va,typed:W}),Sq=_y({Index:Xt,matrix:we,range:ya,typed:W}),A1=Q_({DenseMatrix:He,Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:W}),Cq=i4({Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:W}),S1=l4({Index:Xt,concat:it,setDifference:A1,size:Gt,subset:Dr,typed:W}),C1=I3({FibonacciHeap:N1,addScalar:Rt,equalScalar:Xe}),M1=Ey({Index:Xt,matrix:we,range:ya,typed:W}),Gi=VB({abs:fr,addScalar:Rt,det:w1,divideScalar:Nt,identity:si,matrix:we,multiply:ct,typed:W,unaryMinus:ln}),_1=SF({DenseMatrix:He,Spa:C1,SparseMatrix:On,abs:fr,addScalar:Rt,divideScalar:Nt,equalScalar:Xe,larger:or,matrix:we,multiplyScalar:At,subtractScalar:Or,typed:W,unaryMinus:ln}),Mq=$B({Complex:ht,add:rt,ctranspose:Ll,deepEqual:$l,divideScalar:Nt,dot:Fu,dotDivide:Co,equal:Br,inv:Gi,matrix:we,multiply:ct,typed:W}),kr=fM({Complex:ht,config:ve,fraction:_a,identity:si,inv:Gi,matrix:we,multiply:ct,number:Tn,typed:W}),F1=e4({DenseMatrix:He,Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:W}),_q=p4({Index:Xt,concat:it,setIntersect:F1,setSymDifference:S1,size:Gt,subset:Dr,typed:W}),Fq=YB({abs:fr,add:rt,identity:si,inv:Gi,map:$i,max:Wl,multiply:ct,size:Gt,sqrt:Kr,subtract:Dt,typed:W}),qe=P3({BigNumber:Ae,Complex:ht,Fraction:Pi,abs:fr,addScalar:Rt,config:ve,divideScalar:Nt,equal:Br,fix:D1,format:Eo,isNumeric:Hi,multiplyScalar:At,number:Tn,pow:kr,round:tn,subtractScalar:Or}),Tq=w7({BigNumber:Ae,Unit:qe,config:ve}),Oq=rk({BigNumber:Ae,Unit:qe,config:ve}),Bq=$7({BigNumber:Ae,Unit:qe,config:ve}),kq=E7({BigNumber:Ae,Unit:qe,config:ve}),Iq=J7({BigNumber:Ae,Unit:qe,config:ve}),Rq=A7({BigNumber:Ae,Unit:qe,config:ve}),qq=N7({BigNumber:Ae,Unit:qe,config:ve}),zq=q7({BigNumber:Ae,Unit:qe,config:ve}),jq=wM({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,pow:kr,typed:W}),Lq=b7({BigNumber:Ae,Unit:qe,config:ve}),Pq=D7({BigNumber:Ae,Unit:qe,config:ve}),Vq=ZB({abs:fr,add:rt,identity:si,inv:Gi,multiply:ct,typed:W}),Uq=G7({BigNumber:Ae,Unit:qe,config:ve}),T1=AC({addScalar:Rt,ceil:Gl,conj:Vi,divideScalar:Nt,dotDivide:Co,exp:a1,i:t1,log2:o1,matrix:we,multiplyScalar:At,pow:kr,tau:n1,typed:W}),Kl=T6({BigNumber:Ae,Complex:ht,config:ve,multiplyScalar:At,pow:kr,typed:W}),$q=g7({BigNumber:Ae,Unit:qe,config:ve}),Hq=I7({BigNumber:Ae,Unit:qe,config:ve}),Jq=CC({conj:Vi,dotDivide:Co,fft:T1,typed:W}),Gq=_7({BigNumber:Ae,Unit:qe,config:ve}),Wq=K7({BigNumber:Ae,Unit:qe,config:ve}),Kq=x7({BigNumber:Ae,Unit:qe,config:ve}),Qq=nk({BigNumber:Ae,Unit:qe,config:ve}),Zq=Z7({BigNumber:Ae,Unit:qe,config:ve}),Xq=z7({BigNumber:Ae,Unit:qe,config:ve}),Yq=M7({BigNumber:Ae,Unit:qe,config:ve}),ez=ck({BigNumber:Ae,Unit:qe,config:ve}),tz=ok({BigNumber:Ae,Unit:qe,config:ve}),rz=lk({BigNumber:Ae,Unit:qe,config:ve}),nz=R7({BigNumber:Ae,Unit:qe,config:ve}),iz=j7({BigNumber:Ae,Unit:qe,config:ve}),az=y7({BigNumber:Ae,Unit:qe,config:ve}),oz=L7({BigNumber:Ae,Unit:qe,config:ve}),sz=ek({BigNumber:Ae,Unit:qe,config:ve}),uz=h7({BigNumber:Ae,Unit:qe,config:ve}),cz=tk({BigNumber:Ae,Unit:qe,config:ve}),lz=P7({BigNumber:Ae,Unit:qe,config:ve}),fz=H7({BigNumber:Ae,Unit:qe,config:ve}),pz=F7({BigNumber:Ae,Unit:qe,config:ve}),mz=G3({Unit:qe,typed:W}),jt=u6({divideScalar:Nt,equalScalar:Xe,inv:Gi,matrix:we,multiply:ct,typed:W}),dz=O7({BigNumber:Ae,Unit:qe,config:ve}),_o=I6({gamma:Kl,typed:W}),hz=W7({BigNumber:Ae,Unit:qe,config:ve}),gz=ak({BigNumber:Ae,Unit:qe,config:ve}),vz=S7({BigNumber:Ae,Unit:qe,config:ve}),O1=eT({DenseMatrix:He,lsolve:d1,lup:_1,matrix:we,slu:x1,typed:W,usolve:Ul}),yz=C7({BigNumber:Ae,Unit:qe,config:ve}),xz=ik({BigNumber:Ae,Unit:qe,config:ve}),bz=j6({add:rt,divide:jt,factorial:_o,isInteger:dr,isPositive:Ui,multiply:ct,typed:W}),wz=P6({factorial:_o,typed:W}),Nz=sk({BigNumber:Ae,Unit:qe,config:ve}),Dz=rT({add:rt,cbrt:p1,divide:jt,equalScalar:Xe,im:ql,isZero:Wr,multiply:ct,re:zl,sqrt:Kr,subtract:Dt,typeOf:u1,typed:W,unaryMinus:ln}),Ez=u4({compareNatural:fn,typed:W}),Az=BC({abs:fr,add:rt,bignumber:ir,divide:jt,isNegative:oi,isPositive:Ui,larger:or,map:$i,matrix:we,max:Wl,multiply:ct,smaller:ar,subtract:Dt,typed:W,unaryMinus:ln}),B1=m9({bignumber:ir,addScalar:Rt,combinations:Su,divideScalar:Nt,factorial:_o,isInteger:dr,isNegative:oi,larger:or,multiplyScalar:At,number:Tn,pow:kr,subtractScalar:Or,typed:W}),Sz=U3({Unit:qe,typed:W}),Cz=h9({addScalar:Rt,isInteger:dr,isNegative:oi,stirlingS2:B1,typed:W}),k1=KB({abs:fr,add:rt,addScalar:Rt,atan:i1,bignumber:ir,column:M1,complex:Cu,config:ve,cos:Il,diag:m1,divideScalar:Nt,dot:Fu,equal:Br,flatten:Mo,im:ql,inv:Gi,larger:or,matrix:we,matrixFromColumns:Pl,multiply:ct,multiplyScalar:At,number:Tn,qr:Vl,re:zl,reshape:l1,sin:Mu,size:Gt,smaller:ar,sqrt:Kr,subtract:Dt,typed:W,usolve:Ul,usolveAll:b1}),Mz=B7({BigNumber:Ae,Unit:qe,config:ve}),_z=Q7({BigNumber:Ae,Unit:qe,config:ve}),Fz=q6({divide:jt,dotDivide:Co,isNumeric:Hi,log:Hl,map:$i,matrix:we,multiply:ct,sum:Jl,typed:W}),I1=Uy({add:rt,divide:jt,typed:W}),Tz=X7({BigNumber:Ae,Unit:qe,config:ve}),Oz=v7({BigNumber:Ae,Unit:qe,config:ve}),Bz=Hy({bignumber:ir,add:rt,compare:Ji,divide:jt,isInteger:dr,larger:or,multiply:ct,partitionSelect:Tu,smaller:ar,smallerEq:va,subtract:Dt,typed:W}),Ql=$y({add:rt,apply:jl,divide:jt,isNaN:Ao,multiply:ct,subtract:Dt,typed:W}),kz=T7({BigNumber:Ae,Unit:qe,config:ve}),R1=y6({add:rt,compare:Ji,divide:jt,partitionSelect:Tu,typed:W}),Iz=A6({add:rt,divide:jt,matrix:we,mean:I1,multiply:ct,pow:kr,sqrt:Kr,subtract:Dt,sum:Jl,typed:W}),Rz=$9({Complex:ht,add:rt,divide:jt,matrix:we,multiply:ct,typed:W}),qz=b6({abs:fr,map:$i,median:R1,subtract:Dt,typed:W}),zz=Jy({map:$i,sqrt:Kr,typed:W,variance:Ql}),jz=PC({BigNumber:Ae,Complex:ht,add:rt,config:ve,divide:jt,equal:Br,factorial:_o,gamma:Kl,isNegative:oi,multiply:ct,pi:Hc,pow:kr,sin:Mu,smallerEq:va,subtract:Dt,typed:W}),Zl=y4({abs:fr,add:rt,conj:Vi,ctranspose:Ll,eigs:k1,equalScalar:Xe,larger:or,matrix:we,multiply:ct,pow:kr,smaller:ar,sqrt:Kr,typed:W}),q1=uC({BigNumber:Ae,DenseMatrix:He,SparseMatrix:On,addScalar:Rt,config:ve,cos:Il,matrix:we,multiplyScalar:At,norm:Zl,sin:Mu,typed:W,unaryMinus:ln}),Lz=uk({BigNumber:Ae,Unit:qe,config:ve}),z1=n6({identity:si,matrix:we,multiply:ct,norm:Zl,qr:Vl,subtract:Dt,typed:W}),Pz=oC({multiply:ct,rotationMatrix:q1,typed:W}),j1=t6({abs:fr,add:rt,concat:it,identity:si,index:E1,lusolve:O1,matrix:we,matrixFromColumns:Pl,multiply:ct,range:ya,schur:z1,subset:Dr,subtract:Dt,transpose:So,typed:W}),Vz=a6({matrix:we,multiply:ct,sylvester:j1,transpose:So,typed:W}),Fa={},Ta={},L1={},tr=M4({mathWithTransform:Ta}),Oa=eF({Node:tr}),Bn=rF({Node:tr}),Wi=iF({Node:tr}),P1=uF({Node:tr}),Ba=O4({Node:tr}),V1=z4({Node:tr,ResultSet:r1}),U1=L4({Node:tr}),ui=W4({Node:tr}),$1=oF({Node:tr}),Uz=G9({classes:L1}),Xl=uT({math:Fa,typed:W}),H1=Q4({Node:tr,typed:W}),J1=zB({Chain:Xl,typed:W}),ka=X4({Node:tr,size:Gt}),Ia=F4({Node:tr,subset:Dr}),G1=R4({matrix:we,Node:tr,subset:Dr}),ci=fF({Unit:qe,Node:tr,math:Fa}),li=mF({Node:tr,SymbolNode:ci,math:Fa}),pn=hF({AccessorNode:Ia,ArrayNode:Ba,AssignmentNode:G1,BlockNode:V1,ConditionalNode:U1,ConstantNode:ui,FunctionAssignmentNode:H1,FunctionNode:li,IndexNode:ka,ObjectNode:Oa,OperatorNode:Bn,ParenthesisNode:Wi,RangeNode:$1,RelationalNode:P1,SymbolNode:ci,config:ve,numeric:Pr,typed:W}),W1=k9({ConstantNode:ui,FunctionNode:li,OperatorNode:Bn,ParenthesisNode:Wi,parse:pn,typed:W}),Yl=_9({bignumber:ir,fraction:_a,AccessorNode:Ia,ArrayNode:Ba,ConstantNode:ui,FunctionNode:li,IndexNode:ka,ObjectNode:Oa,OperatorNode:Bn,SymbolNode:ci,config:ve,mathWithTransform:Ta,matrix:we,typed:W}),$z=vF({parse:pn,typed:W}),ef=T9({AccessorNode:Ia,ArrayNode:Ba,ConstantNode:ui,FunctionNode:li,IndexNode:ka,ObjectNode:Oa,OperatorNode:Bn,ParenthesisNode:Wi,SymbolNode:ci,add:rt,divide:jt,equal:Br,isZero:Wr,multiply:ct,parse:pn,pow:kr,subtract:Dt,typed:W}),tf=xF({parse:pn,typed:W}),K1=aT({evaluate:tf}),Q1=NF({evaluate:tf}),Ou=S9({bignumber:ir,fraction:_a,AccessorNode:Ia,ArrayNode:Ba,ConstantNode:ui,FunctionNode:li,IndexNode:ka,ObjectNode:Oa,OperatorNode:Bn,ParenthesisNode:Wi,SymbolNode:ci,add:rt,config:ve,divide:jt,equal:Br,isZero:Wr,mathWithTransform:Ta,matrix:we,multiply:ct,parse:pn,pow:kr,resolve:W1,simplifyConstant:Yl,simplifyCore:ef,subtract:Dt,typed:W}),Hz=R9({OperatorNode:Bn,parse:pn,simplify:Ou,typed:W}),Jz=w9({parse:pn,typed:W}),Gz=EF({Parser:Q1,typed:W}),Wz=L9({bignumber:ir,fraction:_a,AccessorNode:Ia,ArrayNode:Ba,ConstantNode:ui,FunctionNode:li,IndexNode:ka,ObjectNode:Oa,OperatorNode:Bn,ParenthesisNode:Wi,SymbolNode:ci,add:rt,config:ve,divide:jt,equal:Br,isZero:Wr,mathWithTransform:Ta,matrix:we,multiply:ct,parse:pn,pow:kr,simplify:Ou,simplifyConstant:Yl,simplifyCore:ef,subtract:Dt,typed:W}),Kz=z9({ConstantNode:ui,FunctionNode:li,OperatorNode:Bn,ParenthesisNode:Wi,SymbolNode:ci,config:ve,equal:Br,isZero:Wr,numeric:Pr,parse:pn,simplify:Ou,typed:W}),Qz=RB({Help:K1,mathWithTransform:Ta,typed:W});Tt(Fa,{e:m0,false:EI,fineStructure:AI,i:t1,Infinity:SI,LN10:CI,LOG10E:MI,NaN:_I,null:FI,phi:TI,SQRT1_2:BI,sackurTetrode:kI,tau:n1,true:II,E:m0,version:RI,efimovFactor:qI,LN2:zI,pi:Hc,replacer:jI,reviver:Uz,SQRT2:LI,typed:W,unaryPlus:kl,PI:Hc,weakMixingAngle:PI,abs:fr,acos:VI,acot:UI,acsc:$I,addScalar:Rt,arg:HI,asech:JI,asinh:GI,atan:i1,atanh:WI,bignumber:ir,bitNot:KI,boolean:QI,clone:ZI,combinations:Su,complex:Cu,conj:Vi,cos:Il,cot:XI,csc:YI,cube:eR,equalScalar:Xe,erf:tR,exp:a1,expm1:rR,filter:nR,forEach:iR,format:Eo,getMatrixDataType:Rl,hex:aR,im:ql,isInteger:dr,isNegative:oi,isPositive:Ui,isZero:Wr,LOG2E:oR,lgamma:sR,log10:uR,log2:o1,map:$i,multiplyScalar:At,not:Qs,number:Tn,oct:cR,pickRandom:lR,print:fR,random:pR,re:zl,sec:mR,sign:s1,sin:Mu,splitUnit:dR,square:hR,string:gR,subtractScalar:Or,tan:vR,typeOf:u1,acosh:yR,acsch:xR,apply:jl,asec:bR,bin:wR,chain:J1,combinationsWithRep:NR,cosh:DR,csch:ER,isNaN:Ao,isPrime:AR,randomInt:SR,sech:CR,sinh:MR,sparse:_R,sqrt:Kr,tanh:FR,unaryMinus:ln,acoth:TR,coth:OR,fraction:_a,isNumeric:Hi,matrix:we,matrixFromFunction:BR,mode:kR,numeric:Pr,prod:c1,reshape:l1,size:Gt,squeeze:IR,transpose:So,xgcd:f1,zeros:Ut,asin:RR,cbrt:p1,concat:it,count:qR,ctranspose:Ll,diag:m1,divideScalar:Nt,dotDivide:Co,equal:Br,flatten:Mo,hasNumericValue:zR,identity:si,kron:jR,largerEq:_u,leftShift:LR,lsolve:d1,matrixFromColumns:Pl,nthRoot:PR,ones:VR,qr:Vl,resize:UR,rightArithShift:$R,round:tn,smaller:ar,subtract:Dt,to:HR,unequal:JR,usolve:Ul,xor:GR,add:rt,atan2:WR,bitAnd:KR,bitOr:QR,bitXor:ZR,catalan:XR,compare:Ji,compareText:h1,cumsum:YR,deepEqual:$l,diff:eq,distance:tq,dot:Fu,equalText:rq,floor:g1,gcd:nq,hypot:iq,larger:or,log:Hl,lsolveAll:aq,matrixFromRows:oq,min:sq,mod:y1,multiply:ct,nthRoots:uq,or:cq,partitionSelect:Tu,rightLogShift:lq,slu:x1,subset:Dr,sum:Jl,trace:fq,usolveAll:b1,zpk2tf:pq,ceil:Gl,compareNatural:fn,composition:mq,cross:dq,det:w1,dotMultiply:hq,fix:D1,index:E1,intersect:gq,invmod:vq,lcm:yq,log1p:xq,max:Wl,setCartesian:bq,setDistinct:wq,setIsSubset:Nq,setPowerset:Dq,smallerEq:va,sort:Eq,and:Aq,range:ya,row:Sq,setDifference:A1,setMultiplicity:Cq,setSymDifference:S1,column:M1,inv:Gi,lup:_1,pinv:Mq,pow:kr,setIntersect:F1,setUnion:_q,sqrtm:Fq,vacuumImpedance:Tq,wienDisplacement:Oq,atomicMass:Bq,bohrMagneton:kq,boltzmann:Iq,conductanceQuantum:Rq,coulomb:qq,deuteronMass:zq,dotPow:jq,electricConstant:Lq,elementaryCharge:Pq,expm:Vq,faraday:Uq,fft:T1,gamma:Kl,gravitationConstant:$q,hartreeEnergy:Hq,ifft:Jq,klitzing:Gq,loschmidt:Wq,magneticConstant:Kq,molarMass:Qq,molarPlanckConstant:Zq,neutronMass:Xq,nuclearMagneton:Yq,planckCharge:ez,planckLength:tz,planckTemperature:rz,protonMass:nz,quantumOfCirculation:iz,reducedPlanckConstant:az,rydberg:oz,secondRadiation:sz,speedOfLight:uz,stefanBoltzmann:cz,thomsonCrossSection:lz,avogadro:fz,bohrRadius:pz,createUnit:mz,divide:jt,electronMass:dz,factorial:_o,firstRadiation:hz,gravity:gz,inverseConductanceQuantum:vz,lusolve:O1,magneticFluxQuantum:yz,molarMassC12:xz,multinomial:bz,parse:pn,permutations:wz,planckMass:Nz,polynomialRoot:Dz,resolve:W1,setSize:Ez,simplifyConstant:Yl,solveODE:Az,stirlingS2:B1,unit:Sz,bellNumbers:Cz,compile:$z,eigs:k1,fermiCoupling:Mz,gasConstant:_z,kldivergence:Fz,mean:I1,molarVolume:Tz,planckConstant:Oz,quantileSeq:Bz,simplifyCore:ef,variance:Ql,classicalElectronRadius:kz,evaluate:tf,median:R1,simplify:Ou,symbolicEqual:Hz,corr:Iz,freqz:Rz,leafCount:Jz,mad:qz,parser:Gz,rationalize:Wz,std:zz,zeta:jz,derivative:Kz,norm:Zl,rotationMatrix:q1,help:Qz,planckTime:Lz,schur:z1,rotate:Pz,sylvester:j1,lyap:Vz,config:ve});Tt(Ta,Fa,{filter:xk({typed:W}),forEach:Nk({typed:W}),map:Mk({typed:W}),apply:mk({isInteger:dr,typed:W}),or:vI({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W}),and:dI({add:rt,concat:it,equalScalar:Xe,matrix:we,not:Qs,typed:W,zeros:Ut}),concat:Kk({isInteger:dr,matrix:we,typed:W}),max:Tk({config:ve,larger:or,numeric:Pr,typed:W}),print:fI({add:rt,matrix:we,typed:W,zeros:Ut}),bitAnd:bI({add:rt,concat:it,equalScalar:Xe,matrix:we,not:Qs,typed:W,zeros:Ut}),diff:Zk({bignumber:ir,matrix:we,number:Tn,subtract:Dt,typed:W}),min:qk({config:ve,numeric:Pr,smaller:ar,typed:W}),subset:Jk({add:rt,matrix:we,typed:W,zeros:Ut}),bitOr:DI({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W}),cumsum:sI({add:rt,typed:W,unaryPlus:kl}),index:Ak({Index:Xt,getMatrixDataType:Rl}),sum:rI({add:rt,config:ve,numeric:Pr,typed:W}),range:Lk({bignumber:ir,matrix:we,add:rt,config:ve,isPositive:Ui,larger:or,largerEq:_u,smaller:ar,smallerEq:va,typed:W}),row:Uk({Index:Xt,matrix:we,range:ya,typed:W}),column:gk({Index:Xt,matrix:we,range:ya,typed:W}),mean:kk({add:rt,divide:jt,typed:W}),quantileSeq:aI({add:rt,bignumber:ir,compare:Ji,divide:jt,isInteger:dr,larger:or,multiply:ct,partitionSelect:Tu,smaller:ar,smallerEq:va,subtract:Dt,typed:W}),variance:cI({add:rt,apply:jl,divide:jt,isNaN:Ao,multiply:ct,subtract:Dt,typed:W}),std:eI({map:$i,sqrt:Kr,typed:W,variance:Ql})});Tt(L1,{BigNumber:Ae,Complex:ht,Fraction:Pi,Matrix:Au,Node:tr,ObjectNode:Oa,OperatorNode:Bn,ParenthesisNode:Wi,Range:OI,RelationalNode:P1,ResultSet:r1,ArrayNode:Ba,BlockNode:V1,ConditionalNode:U1,ConstantNode:ui,DenseMatrix:He,RangeNode:$1,Chain:Xl,FunctionAssignmentNode:H1,SparseMatrix:On,IndexNode:ka,ImmutableDenseMatrix:v1,Index:Xt,AccessorNode:Ia,AssignmentNode:G1,FibonacciHeap:N1,Spa:C1,Unit:qe,SymbolNode:ci,FunctionNode:li,Help:K1,Parser:Q1});Xl.createProxy(Fa);function Z1(e,t){return function(){return e.apply(t,arguments)}}const{toString:Zz}=Object.prototype,{getPrototypeOf:rf}=Object,Bu=(e=>t=>{const r=Zz.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Qr=e=>(e=e.toLowerCase(),t=>Bu(t)===e),ku=e=>t=>typeof t===e,{isArray:Ra}=Array,co=ku("undefined");function Xz(e){return e!==null&&!co(e)&&e.constructor!==null&&!co(e.constructor)&&br(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const X1=Qr("ArrayBuffer");function Yz(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&X1(e.buffer),t}const ej=ku("string"),br=ku("function"),Y1=ku("number"),Iu=e=>e!==null&&typeof e=="object",tj=e=>e===!0||e===!1,vs=e=>{if(Bu(e)!=="object")return!1;const t=rf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},rj=Qr("Date"),nj=Qr("File"),ij=Qr("Blob"),aj=Qr("FileList"),oj=e=>Iu(e)&&br(e.pipe),sj=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||br(e.append)&&((t=Bu(e))==="formdata"||t==="object"&&br(e.toString)&&e.toString()==="[object FormData]"))},uj=Qr("URLSearchParams"),[cj,lj,fj,pj]=["ReadableStream","Request","Response","Headers"].map(Qr),mj=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Fo(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),Ra(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const a=r?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;let u;for(n=0;n<o;n++)u=a[n],t.call(null,e[u],u,e)}}function ex(e,t){t=t.toLowerCase();const r=Object.keys(e);let n=r.length,i;for(;n-- >0;)if(i=r[n],t===i.toLowerCase())return i;return null}const Ni=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,tx=e=>!co(e)&&e!==Ni;function Jc(){const{caseless:e}=tx(this)&&this||{},t={},r=(n,i)=>{const a=e&&ex(t,i)||i;vs(t[a])&&vs(n)?t[a]=Jc(t[a],n):vs(n)?t[a]=Jc({},n):Ra(n)?t[a]=n.slice():t[a]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&Fo(arguments[n],r);return t}const dj=(e,t,r,{allOwnKeys:n}={})=>(Fo(t,(i,a)=>{r&&br(i)?e[a]=Z1(i,r):e[a]=i},{allOwnKeys:n}),e),hj=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),gj=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},vj=(e,t,r,n)=>{let i,a,o;const u={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!n||n(o,e,t))&&!u[o]&&(t[o]=e[o],u[o]=!0);e=r!==!1&&rf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},yj=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},xj=e=>{if(!e)return null;if(Ra(e))return e;let t=e.length;if(!Y1(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},bj=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&rf(Uint8Array)),wj=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const i=n.value;t.call(e,i[0],i[1])}},Nj=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Dj=Qr("HTMLFormElement"),Ej=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,n){return r.toUpperCase()+n}),d0=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Aj=Qr("RegExp"),rx=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Fo(r,(i,a)=>{let o;(o=t(i,a,e))!==!1&&(n[a]=o||i)}),Object.defineProperties(e,n)},Sj=e=>{rx(e,(t,r)=>{if(br(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(br(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Cj=(e,t)=>{const r={},n=i=>{i.forEach(a=>{r[a]=!0})};return Ra(e)?n(e):n(String(e).split(t)),r},Mj=()=>{},_j=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,dc="abcdefghijklmnopqrstuvwxyz",h0="0123456789",nx={DIGIT:h0,ALPHA:dc,ALPHA_DIGIT:dc+dc.toUpperCase()+h0},Fj=(e=16,t=nx.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r};function Tj(e){return!!(e&&br(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Oj=e=>{const t=new Array(10),r=(n,i)=>{if(Iu(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const a=Ra(n)?[]:{};return Fo(n,(o,u)=>{const c=r(o,i+1);!co(c)&&(a[u]=c)}),t[i]=void 0,a}}return n};return r(e,0)},Bj=Qr("AsyncFunction"),kj=e=>e&&(Iu(e)||br(e))&&br(e.then)&&br(e.catch),ix=((e,t)=>e?setImmediate:t?((r,n)=>(Ni.addEventListener("message",({source:i,data:a})=>{i===Ni&&a===r&&n.length&&n.shift()()},!1),i=>{n.push(i),Ni.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",br(Ni.postMessage)),Ij=typeof queueMicrotask<"u"?queueMicrotask.bind(Ni):typeof process<"u"&&process.nextTick||ix,ge={isArray:Ra,isArrayBuffer:X1,isBuffer:Xz,isFormData:sj,isArrayBufferView:Yz,isString:ej,isNumber:Y1,isBoolean:tj,isObject:Iu,isPlainObject:vs,isReadableStream:cj,isRequest:lj,isResponse:fj,isHeaders:pj,isUndefined:co,isDate:rj,isFile:nj,isBlob:ij,isRegExp:Aj,isFunction:br,isStream:oj,isURLSearchParams:uj,isTypedArray:bj,isFileList:aj,forEach:Fo,merge:Jc,extend:dj,trim:mj,stripBOM:hj,inherits:gj,toFlatObject:vj,kindOf:Bu,kindOfTest:Qr,endsWith:yj,toArray:xj,forEachEntry:wj,matchAll:Nj,isHTMLForm:Dj,hasOwnProperty:d0,hasOwnProp:d0,reduceDescriptors:rx,freezeMethods:Sj,toObjectSet:Cj,toCamelCase:Ej,noop:Mj,toFiniteNumber:_j,findKey:ex,global:Ni,isContextDefined:tx,ALPHABET:nx,generateString:Fj,isSpecCompliantForm:Tj,toJSONObject:Oj,isAsyncFn:Bj,isThenable:kj,setImmediate:ix,asap:Ij};function We(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}ge.inherits(We,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ge.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const ax=We.prototype,ox={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{ox[e]={value:e}});Object.defineProperties(We,ox);Object.defineProperty(ax,"isAxiosError",{value:!0});We.from=(e,t,r,n,i,a)=>{const o=Object.create(ax);return ge.toFlatObject(e,o,function(u){return u!==Error.prototype},u=>u!=="isAxiosError"),We.call(o,e.message,t,r,n,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};const Rj=null;function Gc(e){return ge.isPlainObject(e)||ge.isArray(e)}function sx(e){return ge.endsWith(e,"[]")?e.slice(0,-2):e}function g0(e,t,r){return e?e.concat(t).map(function(n,i){return n=sx(n),!r&&i?"["+n+"]":n}).join(r?".":""):t}function qj(e){return ge.isArray(e)&&!e.some(Gc)}const zj=ge.toFlatObject(ge,{},null,function(e){return/^is[A-Z]/.test(e)});function Ru(e,t,r){if(!ge.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=ge.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,d){return!ge.isUndefined(d[m])});const n=r.metaTokens,i=r.visitor||l,a=r.dots,o=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&ge.isSpecCompliantForm(t);if(!ge.isFunction(i))throw new TypeError("visitor must be a function");function c(m){if(m===null)return"";if(ge.isDate(m))return m.toISOString();if(!u&&ge.isBlob(m))throw new We("Blob is not supported. Use a Buffer instead.");return ge.isArrayBuffer(m)||ge.isTypedArray(m)?u&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function l(m,d,h){let w=m;if(m&&!h&&typeof m=="object"){if(ge.endsWith(d,"{}"))d=n?d:d.slice(0,-2),m=JSON.stringify(m);else if(ge.isArray(m)&&qj(m)||(ge.isFileList(m)||ge.endsWith(d,"[]"))&&(w=ge.toArray(m)))return d=sx(d),w.forEach(function(v,b){!(ge.isUndefined(v)||v===null)&&t.append(o===!0?g0([d],b,a):o===null?d:d+"[]",c(v))}),!1}return Gc(m)?!0:(t.append(g0(h,d,a),c(m)),!1)}const s=[],f=Object.assign(zj,{defaultVisitor:l,convertValue:c,isVisitable:Gc});function p(m,d){if(!ge.isUndefined(m)){if(s.indexOf(m)!==-1)throw Error("Circular reference detected in "+d.join("."));s.push(m),ge.forEach(m,function(h,w){(!(ge.isUndefined(h)||h===null)&&i.call(t,h,ge.isString(w)?w.trim():w,d,f))===!0&&p(h,d?d.concat(w):[w])}),s.pop()}}if(!ge.isObject(e))throw new TypeError("data must be an object");return p(e),t}function v0(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function nf(e,t){this._pairs=[],e&&Ru(e,this,t)}const ux=nf.prototype;ux.append=function(e,t){this._pairs.push([e,t])};ux.toString=function(e){const t=e?function(r){return e.call(this,r,v0)}:v0;return this._pairs.map(function(r){return t(r[0])+"="+t(r[1])},"").join("&")};function jj(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function cx(e,t,r){if(!t)return e;const n=r&&r.encode||jj,i=r&&r.serialize;let a;if(i?a=i(t,r):a=ge.isURLSearchParams(t)?t.toString():new nf(t,r).toString(n),a){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class y0{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ge.forEach(this.handlers,function(r){r!==null&&t(r)})}}const lx={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Lj=typeof URLSearchParams<"u"?URLSearchParams:nf,Pj=typeof FormData<"u"?FormData:null,Vj=typeof Blob<"u"?Blob:null,Uj={isBrowser:!0,classes:{URLSearchParams:Lj,FormData:Pj,Blob:Vj},protocols:["http","https","file","blob","url","data"]},af=typeof window<"u"&&typeof document<"u",$j=(e=>af&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),Hj=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Jj=af&&window.location.href||"http://localhost",Gj=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:af,hasStandardBrowserEnv:$j,hasStandardBrowserWebWorkerEnv:Hj,origin:Jj},Symbol.toStringTag,{value:"Module"})),Vr={...Gj,...Uj};function Wj(e,t){return Ru(e,new Vr.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,a){return Vr.isNode&&ge.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function Kj(e){return ge.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Qj(e){const t={},r=Object.keys(e);let n;const i=r.length;let a;for(n=0;n<i;n++)a=r[n],t[a]=e[a];return t}function fx(e){function t(r,n,i,a){let o=r[a++];if(o==="__proto__")return!0;const u=Number.isFinite(+o),c=a>=r.length;return o=!o&&ge.isArray(i)?i.length:o,c?(ge.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!u):((!i[o]||!ge.isObject(i[o]))&&(i[o]=[]),t(r,n,i[o],a)&&ge.isArray(i[o])&&(i[o]=Qj(i[o])),!u)}if(ge.isFormData(e)&&ge.isFunction(e.entries)){const r={};return ge.forEachEntry(e,(n,i)=>{t(Kj(n),i,r,0)}),r}return null}function Zj(e,t,r){if(ge.isString(e))try{return(t||JSON.parse)(e),ge.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const To={transitional:lx,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=ge.isObject(e);if(i&&ge.isHTMLForm(e)&&(e=new FormData(e)),ge.isFormData(e))return n?JSON.stringify(fx(e)):e;if(ge.isArrayBuffer(e)||ge.isBuffer(e)||ge.isStream(e)||ge.isFile(e)||ge.isBlob(e)||ge.isReadableStream(e))return e;if(ge.isArrayBufferView(e))return e.buffer;if(ge.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Wj(e,this.formSerializer).toString();if((a=ge.isFileList(e))||r.indexOf("multipart/form-data")>-1){const o=this.env&&this.env.FormData;return Ru(a?{"files[]":e}:e,o&&new o,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),Zj(e)):e}],transformResponse:[function(e){const t=this.transitional||To.transitional,r=t&&t.forcedJSONParsing,n=this.responseType==="json";if(ge.isResponse(e)||ge.isReadableStream(e))return e;if(e&&ge.isString(e)&&(r&&!this.responseType||n)){const i=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(a){if(i)throw a.name==="SyntaxError"?We.from(a,We.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Vr.classes.FormData,Blob:Vr.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ge.forEach(["delete","get","head","post","put","patch"],e=>{To.headers[e]={}});const Xj=ge.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Yj=e=>{const t={};let r,n,i;return e&&e.split(`
|
|
72
|
-
`).forEach(function(a){i=a.indexOf(":"),r=a.substring(0,i).trim().toLowerCase(),n=a.substring(i+1).trim(),!(!r||t[r]&&
|
|
73
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){const r=(this[x0]=this[x0]={accessors:{}}).accessors,n=this.prototype;function i(a){const o=Ha(a);r[o]||(nL(n,a),r[o]=!0)}return ge.isArray(t)?t.forEach(i):i(t),this}}hr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ge.reduceDescriptors(hr.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});ge.freezeMethods(hr);function gc(e,t){const r=this||To,n=t||r,i=hr.from(n.headers);let a=n.data;return ge.forEach(e,function(o){a=o.call(r,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function px(e){return!!(e&&e.__CANCEL__)}function qa(e,t,r){We.call(this,e??"canceled",We.ERR_CANCELED,t,r),this.name="CanceledError"}ge.inherits(qa,We,{__CANCEL__:!0});function mx(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new We("Request failed with status code "+r.status,[We.ERR_BAD_REQUEST,We.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function iL(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function aL(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,a=0,o;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),l=n[a];o||(o=c),r[i]=u,n[i]=c;let s=a,f=0;for(;s!==i;)f+=r[s++],s=s%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;const p=l&&c-l;return p?Math.round(f*1e3/p):void 0}}function oL(e,t){let r=0,n=1e3/t,i,a;const o=(u,c=Date.now())=>{r=c,i=null,a&&(clearTimeout(a),a=null),e.apply(null,u)};return[(...u)=>{const c=Date.now(),l=c-r;l>=n?o(u,c):(i=u,a||(a=setTimeout(()=>{a=null,o(i)},n-l)))},()=>i&&o(i)]}const Zs=(e,t,r=3)=>{let n=0;const i=aL(50,250);return oL(a=>{const o=a.loaded,u=a.lengthComputable?a.total:void 0,c=o-n,l=i(c),s=o<=u;n=o;const f={loaded:o,total:u,progress:u?o/u:void 0,bytes:c,rate:l||void 0,estimated:l&&u&&s?(u-o)/l:void 0,event:a,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(f)},r)},b0=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},w0=e=>(...t)=>ge.asap(()=>e(...t)),sL=Vr.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(i){let a=i;return e&&(t.setAttribute("href",a),a=t.href),t.setAttribute("href",a),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(i){const a=ge.isString(i)?n(i):i;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}(),uL=Vr.hasStandardBrowserEnv?{write(e,t,r,n,i,a){const o=[e+"="+encodeURIComponent(t)];ge.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),ge.isString(n)&&o.push("path="+n),ge.isString(i)&&o.push("domain="+i),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function cL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function lL(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function dx(e,t){return e&&!cL(t)?lL(e,t):t}const N0=e=>e instanceof hr?{...e}:e;function Bi(e,t){t=t||{};const r={};function n(l,s,f){return ge.isPlainObject(l)&&ge.isPlainObject(s)?ge.merge.call({caseless:f},l,s):ge.isPlainObject(s)?ge.merge({},s):ge.isArray(s)?s.slice():s}function i(l,s,f){if(ge.isUndefined(s)){if(!ge.isUndefined(l))return n(void 0,l,f)}else return n(l,s,f)}function a(l,s){if(!ge.isUndefined(s))return n(void 0,s)}function o(l,s){if(ge.isUndefined(s)){if(!ge.isUndefined(l))return n(void 0,l)}else return n(void 0,s)}function u(l,s,f){if(f in t)return n(l,s);if(f in e)return n(void 0,l)}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:u,headers:(l,s)=>i(N0(l),N0(s),!0)};return ge.forEach(Object.keys(Object.assign({},e,t)),function(l){const s=c[l]||i,f=s(e[l],t[l],l);ge.isUndefined(f)&&s!==u||(r[l]=f)}),r}const hx=e=>{const t=Bi({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:u}=t;t.headers=o=hr.from(o),t.url=cx(dx(t.baseURL,t.url),e.params,e.paramsSerializer),u&&o.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let c;if(ge.isFormData(r)){if(Vr.hasStandardBrowserEnv||Vr.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[l,...s]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([l||"multipart/form-data",...s].join("; "))}}if(Vr.hasStandardBrowserEnv&&(n&&ge.isFunction(n)&&(n=n(t)),n||n!==!1&&sL(t.url))){const l=i&&a&&uL.read(a);l&&o.set(i,l)}return t},fL=typeof XMLHttpRequest<"u",pL=fL&&function(e){return new Promise(function(t,r){const n=hx(e);let i=n.data;const a=hr.from(n.headers).normalize();let{responseType:o,onUploadProgress:u,onDownloadProgress:c}=n,l,s,f,p,m;function d(){p&&p(),m&&m(),n.cancelToken&&n.cancelToken.unsubscribe(l),n.signal&&n.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(n.method.toUpperCase(),n.url,!0),h.timeout=n.timeout;function w(){if(!h)return;const b=hr.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),g={data:!o||o==="text"||o==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:b,config:e,request:h};mx(function(x){t(x),d()},function(x){r(x),d()},g),h=null}"onloadend"in h?h.onloadend=w:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(w)},h.onabort=function(){h&&(r(new We("Request aborted",We.ECONNABORTED,e,h)),h=null)},h.onerror=function(){r(new We("Network Error",We.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let b=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const g=n.transitional||lx;n.timeoutErrorMessage&&(b=n.timeoutErrorMessage),r(new We(b,g.clarifyTimeoutError?We.ETIMEDOUT:We.ECONNABORTED,e,h)),h=null},i===void 0&&a.setContentType(null),"setRequestHeader"in h&&ge.forEach(a.toJSON(),function(b,g){h.setRequestHeader(g,b)}),ge.isUndefined(n.withCredentials)||(h.withCredentials=!!n.withCredentials),o&&o!=="json"&&(h.responseType=n.responseType),c&&([f,m]=Zs(c,!0),h.addEventListener("progress",f)),u&&h.upload&&([s,p]=Zs(u),h.upload.addEventListener("progress",s),h.upload.addEventListener("loadend",p)),(n.cancelToken||n.signal)&&(l=b=>{h&&(r(!b||b.type?new qa(null,e,h):b),h.abort(),h=null)},n.cancelToken&&n.cancelToken.subscribe(l),n.signal&&(n.signal.aborted?l():n.signal.addEventListener("abort",l)));const v=iL(n.url);if(v&&Vr.protocols.indexOf(v)===-1){r(new We("Unsupported protocol "+v+":",We.ERR_BAD_REQUEST,e));return}h.send(i||null)})},mL=(e,t)=>{let r=new AbortController,n;const i=function(c){if(!n){n=!0,o();const l=c instanceof Error?c:this.reason;r.abort(l instanceof We?l:new qa(l instanceof Error?l.message:l))}};let a=t&&setTimeout(()=>{i(new We(`timeout ${t} of ms exceeded`,We.ETIMEDOUT))},t);const o=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(c=>{c&&(c.removeEventListener?c.removeEventListener("abort",i):c.unsubscribe(i))}),e=null)};e.forEach(c=>c&&c.addEventListener&&c.addEventListener("abort",i));const{signal:u}=r;return u.unsubscribe=o,[u,()=>{a&&clearTimeout(a),a=null}]},dL=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let n=0,i;for(;n<r;)i=n+t,yield e.slice(n,i),n=i},hL=async function*(e,t,r){for await(const n of e)yield*dL(ArrayBuffer.isView(n)?n:await r(String(n)),t)},D0=(e,t,r,n,i)=>{const a=hL(e,t,i);let o=0,u,c=l=>{u||(u=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:s,value:f}=await a.next();if(s){c(),l.close();return}let p=f.byteLength;if(r){let m=o+=p;r(m)}l.enqueue(new Uint8Array(f))}catch(s){throw c(s),s}},cancel(l){return c(l),a.return()}},{highWaterMark:2})},qu=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",gx=qu&&typeof ReadableStream=="function",Wc=qu&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),vx=(e,...t)=>{try{return!!e(...t)}catch{return!1}},gL=gx&&vx(()=>{let e=!1;const t=new Request(Vr.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),E0=64*1024,Kc=gx&&vx(()=>ge.isReadableStream(new Response("").body)),Xs={stream:Kc&&(e=>e.body)};qu&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Xs[t]&&(Xs[t]=ge.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new We(`Response type '${t}' is not supported`,We.ERR_NOT_SUPPORT,n)})})})(new Response);const vL=async e=>{if(e==null)return 0;if(ge.isBlob(e))return e.size;if(ge.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(ge.isArrayBufferView(e)||ge.isArrayBuffer(e))return e.byteLength;if(ge.isURLSearchParams(e)&&(e=e+""),ge.isString(e))return(await Wc(e)).byteLength},yL=async(e,t)=>ge.toFiniteNumber(e.getContentLength())??vL(t),xL=qu&&(async e=>{let{url:t,method:r,data:n,signal:i,cancelToken:a,timeout:o,onDownloadProgress:u,onUploadProgress:c,responseType:l,headers:s,withCredentials:f="same-origin",fetchOptions:p}=hx(e);l=l?(l+"").toLowerCase():"text";let[m,d]=i||a||o?mL([i,a],o):[],h,w;const v=()=>{!h&&setTimeout(()=>{m&&m.unsubscribe()}),h=!0};let b;try{if(c&&gL&&r!=="get"&&r!=="head"&&(b=await yL(s,n))!==0){let N=new Request(t,{method:"POST",body:n,duplex:"half"}),E;if(ge.isFormData(n)&&(E=N.headers.get("content-type"))&&s.setContentType(E),N.body){const[A,D]=b0(b,Zs(w0(c)));n=D0(N.body,E0,A,D,Wc)}}ge.isString(f)||(f=f?"include":"omit"),w=new Request(t,{...p,signal:m,method:r.toUpperCase(),headers:s.normalize().toJSON(),body:n,duplex:"half",credentials:f});let g=await fetch(w);const x=Kc&&(l==="stream"||l==="response");if(Kc&&(u||x)){const N={};["status","statusText","headers"].forEach(S=>{N[S]=g[S]});const E=ge.toFiniteNumber(g.headers.get("content-length")),[A,D]=u&&b0(E,Zs(w0(u),!0))||[];g=new Response(D0(g.body,E0,A,()=>{D&&D(),x&&v()},Wc),N)}l=l||"text";let y=await Xs[ge.findKey(Xs,l)||"text"](g,e);return!x&&v(),d&&d(),await new Promise((N,E)=>{mx(N,E,{data:y,headers:hr.from(g.headers),status:g.status,statusText:g.statusText,config:e,request:w})})}catch(g){throw v(),g&&g.name==="TypeError"&&/fetch/i.test(g.message)?Object.assign(new We("Network Error",We.ERR_NETWORK,e,w),{cause:g.cause||g}):We.from(g,g&&g.code,e,w)}}),Qc={http:Rj,xhr:pL,fetch:xL};ge.forEach(Qc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const A0=e=>`- ${e}`,bL=e=>ge.isFunction(e)||e===null||e===!1,yx={getAdapter:e=>{e=ge.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let a=0;a<t;a++){r=e[a];let o;if(n=r,!bL(r)&&(n=Qc[(o=String(r)).toLowerCase()],n===void 0))throw new We(`Unknown adapter '${o}'`);if(n)break;i[o||"#"+a]=n}if(!n){const a=Object.entries(i).map(([u,c])=>`adapter ${u} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=t?a.length>1?`since :
|
|
74
|
-
`+a.map(
|
|
75
|
-
`):" "+
|
|
76
|
-
`+a):n.stack=a}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Bi(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:a}=r;n!==void 0&&
|
|
71
|
+
In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.`,examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]},V8={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"]},U8={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"]},$8={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]},H8={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"]},J8={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"]},G8={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"]},W8={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"]},K8={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"]},Q8={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the hyperbolic arccotangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]},Z8={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"]},X8={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]},Y8={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"]},eB={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]},tB={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"]},rB={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"]},nB={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"]},iB={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"]},aB={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"]},oB={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"]},sB={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]},uB={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"]},cB={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"]},lB={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"]},fB={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"]},pB={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"]},mB={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"]},dB={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"]},hB={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]},gB={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"]},vB={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"]},yB={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:[]},bB={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]},xB={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:[]},wB={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"]},NB={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"]},DB={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]},EB={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"]},AB={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"]},SB={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"]},CB={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"]},MB={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"]},_B={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"]},FB={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"]},TB={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","fraction","bignumber","string","format"]},OB={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]},BB={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"]},kB={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"]},IB={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"]},RB={bignumber:ST,boolean:CT,complex:MT,createUnit:_T,fraction:FT,index:TT,matrix:OT,number:BT,sparse:kT,splitUnit:IT,string:RT,unit:qT,e:mh,E:mh,false:fT,i:pT,Infinity:mT,LN2:hT,LN10:dT,LOG2E:vT,LOG10E:gT,NaN:yT,null:bT,pi:dh,PI:dh,phi:xT,SQRT1_2:wT,SQRT2:NT,tau:DT,true:ET,version:AT,speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Borh magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Borh radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:PT,lsolve:UT,lsolveAll:$T,lup:HT,lusolve:JT,leafCount:VT,polynomialRoot:GT,resolve:QT,simplify:ZT,simplifyConstant:XT,simplifyCore:YT,symbolicEqual:t5,rationalize:KT,slu:e5,usolve:r5,usolveAll:n5,qr:WT,abs:i5,add:a5,cbrt:o5,ceil:s5,cube:u5,divide:c5,dotDivide:l5,dotMultiply:f5,dotPow:p5,exp:m5,expm:d5,expm1:h5,fix:g5,floor:v5,gcd:y5,hypot:b5,lcm:w5,log:N5,log2:A5,log1p:E5,log10:D5,mod:S5,multiply:C5,norm:M5,nthRoot:_5,nthRoots:F5,pow:T5,round:O5,sign:B5,sqrt:k5,sqrtm:I5,square:j5,subtract:L5,unaryMinus:P5,unaryPlus:V5,xgcd:U5,invmod:x5,bitAnd:$5,bitNot:H5,bitOr:J5,bitXor:G5,leftShift:W5,rightArithShift:K5,rightLogShift:Q5,bellNumbers:Z5,catalan:X5,composition:Y5,stirlingS2:eO,config:zT,import:jT,typed:LT,arg:tO,conj:rO,re:iO,im:nO,evaluate:aO,help:oO,distance:sO,intersect:uO,and:cO,not:lO,or:fO,xor:pO,concat:dO,count:hO,cross:gO,column:mO,ctranspose:vO,det:yO,diag:bO,diff:xO,dot:wO,getMatrixDataType:SO,identity:CO,filter:DO,flatten:EO,forEach:AO,inv:MO,pinv:_O,eigs:NO,kron:FO,matrixFromFunction:BO,matrixFromRows:kO,matrixFromColumns:OO,map:TO,ones:IO,partitionSelect:RO,range:qO,resize:jO,reshape:zO,rotate:LO,rotationMatrix:PO,row:VO,size:UO,sort:$O,squeeze:HO,subset:JO,trace:GO,transpose:WO,zeros:KO,fft:QO,ifft:ZO,sylvester:R5,schur:q5,lyap:z5,solveODE:IB,combinations:XO,combinationsWithRep:YO,factorial:e8,gamma:t8,kldivergence:n8,lgamma:r8,multinomial:i8,permutations:a8,pickRandom:o8,random:s8,randomInt:u8,compare:c8,compareNatural:l8,compareText:f8,deepEqual:p8,equal:m8,equalText:d8,larger:h8,largerEq:g8,smaller:v8,smallerEq:y8,unequal:b8,setCartesian:x8,setDifference:w8,setDistinct:N8,setIntersect:D8,setIsSubset:E8,setMultiplicity:A8,setPowerset:S8,setSize:C8,setSymDifference:M8,setUnion:_8,zpk2tf:F8,freqz:T8,erf:O8,zeta:B8,cumsum:U8,mad:k8,max:I8,mean:R8,median:q8,min:z8,mode:j8,prod:L8,quantileSeq:P8,std:V8,sum:$8,variance:H8,corr:J8,acos:G8,acosh:W8,acot:K8,acoth:Q8,acsc:Z8,acsch:X8,asec:Y8,asech:eB,asin:tB,asinh:rB,atan:nB,atanh:aB,atan2:iB,cos:oB,cosh:sB,cot:uB,coth:cB,csc:lB,csch:fB,sec:pB,sech:mB,sin:dB,sinh:hB,tan:gB,tanh:vB,to:yB,clone:xB,format:wB,bin:bB,oct:OB,hex:DB,isNaN:AB,isInteger:EB,isNegative:SB,isNumeric:CB,hasNumericValue:NB,isPositive:MB,isPrime:_B,isZero:FB,print:BB,typeOf:kB,numeric:TB},hh="help",qB=["typed","mathWithTransform","Help"],zB=U(hh,qB,e=>{var{typed:t,mathWithTransform:r,Help:n}=e;return t(hh,{any:function(i){var a,o=i;if(typeof i!="string"){for(a in r)if(Me(r,a)&&i===r[a]){o=a;break}}var u=nr(RB,o);if(!u){var c=typeof o=="function"?o.name:o;throw new Error('No documentation found on "'+c+'"')}return new n(u)}})}),gh="chain",jB=["typed","Chain"],LB=U(gh,jB,e=>{var{typed:t,Chain:r}=e;return t(gh,{"":function(){return new r},any:function(n){return new r(n)}})}),vh="det",PB=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],VB=U(vh,PB,e=>{var{typed:t,matrix:r,subtractScalar:n,multiply:i,divideScalar:a,isZero:o,unaryMinus:u}=e;return t(vh,{any:function(l){return ze(l)},"Array | Matrix":function(l){var s;switch(ke(l)?s=l.size():Array.isArray(l)?(l=r(l),s=l.size()):s=[],s.length){case 0:return ze(l);case 1:if(s[0]===1)return ze(l.valueOf()[0]);if(s[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+Ge(s)+")");case 2:{var f=s[0],p=s[1];if(f===p)return c(l.clone().valueOf(),f);if(p===0)return 1;throw new RangeError("Matrix must be square (size: "+Ge(s)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ge(s)+")")}}});function c(l,s,f){if(s===1)return ze(l[0][0]);if(s===2)return n(i(l[0][0],l[1][1]),i(l[1][0],l[0][1]));for(var p=!1,m=new Array(s).fill(0).map((E,A)=>A),d=0;d<s;d++){var h=m[d];if(o(l[h][d])){var w=void 0;for(w=d+1;w<s;w++)if(!o(l[m[w]][d])){h=m[w],m[w]=m[d],m[d]=h,p=!p;break}if(w===s)return l[h][d]}for(var v=l[h][d],x=d===0?1:l[m[d-1]][d-1],g=d+1;g<s;g++)for(var b=m[g],y=d+1;y<s;y++)l[b][y]=a(n(i(l[b][y],v),i(l[b][d],l[h][y])),x)}var N=l[m[s-1]][s-1];return p?u(N):N}}),yh="inv",UB=["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],$B=U(yh,UB,e=>{var{typed:t,matrix:r,divideScalar:n,addScalar:i,multiply:a,unaryMinus:o,det:u,identity:c,abs:l}=e;return t(yh,{"Array | Matrix":function(f){var p=ke(f)?f.size():Ve(f);switch(p.length){case 1:if(p[0]===1)return ke(f)?r([n(1,f.valueOf()[0])]):[n(1,f[0])];throw new RangeError("Matrix must be square (size: "+Ge(p)+")");case 2:{var m=p[0],d=p[1];if(m===d)return ke(f)?r(s(f.valueOf(),m,d),f.storage()):s(f,m,d);throw new RangeError("Matrix must be square (size: "+Ge(p)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ge(p)+")")}},any:function(f){return n(1,f)}});function s(f,p,m){var d,h,w,v,x;if(p===1){if(v=f[0][0],v===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,v)]]}else if(p===2){var g=u(f);if(g===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(f[1][1],g),n(o(f[0][1]),g)],[n(o(f[1][0]),g),n(f[0][0],g)]]}else{var b=f.concat();for(d=0;d<p;d++)b[d]=b[d].concat();for(var y=c(p).valueOf(),N=0;N<m;N++){var E=l(b[N][N]),A=N;for(d=N+1;d<p;)l(b[d][N])>E&&(E=l(b[d][N]),A=d),d++;if(E===0)throw Error("Cannot calculate inverse, determinant is zero");d=A,d!==N&&(x=b[N],b[N]=b[d],b[d]=x,x=y[N],y[N]=y[d],y[d]=x);var D=b[N],S=y[N];for(d=0;d<p;d++){var C=b[d],_=y[d];if(d!==N){if(C[N]!==0){for(w=n(o(C[N]),D[N]),h=N;h<m;h++)C[h]=i(C[h],a(w,D[h]));for(h=0;h<m;h++)_[h]=i(_[h],a(w,S[h]))}}else{for(w=D[N],h=N;h<m;h++)C[h]=n(C[h],w);for(h=0;h<m;h++)_[h]=n(_[h],w)}}}return y}}}),bh="pinv",HB=["typed","matrix","inv","deepEqual","equal","dotDivide","dot","ctranspose","divideScalar","multiply","add","Complex"],JB=U(bh,HB,e=>{var{typed:t,matrix:r,inv:n,deepEqual:i,equal:a,dotDivide:o,dot:u,ctranspose:c,divideScalar:l,multiply:s,add:f,Complex:p}=e;return t(bh,{"Array | Matrix":function(x){var g=ke(x)?x.size():Ve(x);switch(g.length){case 1:return v(x)?c(x):g[0]===1?n(x):o(c(x),u(x,x));case 2:{if(v(x))return c(x);var b=g[0],y=g[1];if(b===y)try{return n(x)}catch(N){if(!(N instanceof Error&&N.message.match(/Cannot calculate inverse, determinant is zero/)))throw N}return ke(x)?r(m(x.valueOf(),b,y),x.storage()):m(x,b,y)}default:throw new RangeError("Matrix must be two dimensional (size: "+Ge(g)+")")}},any:function(x){return a(x,0)?ze(x):l(1,x)}});function m(x,g,b){var{C:y,F:N}=h(x,g,b),E=s(n(s(c(y),y)),c(y)),A=s(c(N),n(s(N,c(N))));return s(A,E)}function d(x,g,b){for(var y=ze(x),N=0,E=0;E<g;E++){if(b<=N)return y;for(var A=E;w(y[A][N]);)if(A++,g===A&&(A=E,N++,b===N))return y;[y[A],y[E]]=[y[E],y[A]];for(var D=y[E][N],S=0;S<b;S++)y[E][S]=o(y[E][S],D);for(var C=0;C<g;C++)if(C!==E){D=y[C][N];for(var _=0;_<b;_++)y[C][_]=f(y[C][_],s(-1,s(D,y[E][_])))}N++}return y}function h(x,g,b){var y=d(x,g,b),N=x.map((A,D)=>A.filter((S,C)=>C<g&&!w(u(y[C],y[C])))),E=y.filter((A,D)=>!w(u(y[D],y[D])));return{C:N,F:E}}function w(x){return a(f(x,p(1,1)),f(0,p(1,1)))}function v(x){return i(f(x,p(1,1)),f(s(x,0),p(1,1)))}});function GB(e){var{addScalar:t,subtract:r,flatten:n,multiply:i,multiplyScalar:a,divideScalar:o,sqrt:u,abs:c,bignumber:l,diag:s,size:f,reshape:p,inv:m,qr:d,usolve:h,usolveAll:w,equal:v,complex:x,larger:g,smaller:b,matrixFromColumns:y,dot:N}=e;function E(K,V,ue,me){var re=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,ae=A(K,V,ue,me,re);D(K,V,ue,me,re,ae);var{values:de,C:ne}=S(K,V,ue,me,re);if(re){var ce=C(K,V,ne,ae,de,ue,me);return{values:de,eigenvectors:ce}}return{values:de}}function A(K,V,ue,me,re){var ae=me==="BigNumber",de=me==="Complex",ne=ae?l(0):0,ce=ae?l(1):de?x(1):1,le=ae?l(1):1,he=ae?l(10):2,xe=a(he,he),$;re&&($=Array(V).fill(ce));for(var T=!1;!T;){T=!0;for(var z=0;z<V;z++){for(var J=ne,L=ne,H=0;H<V;H++)z!==H&&(J=t(J,c(K[H][z])),L=t(L,c(K[z][H])));if(!v(J,0)&&!v(L,0)){for(var G=le,Y=J,ee=o(L,he),B=a(L,he);b(Y,ee);)Y=a(Y,xe),G=a(G,he);for(;g(Y,B);)Y=o(Y,xe),G=o(G,he);var j=b(o(t(Y,L),G),a(t(J,L),.95));if(j){T=!1;for(var Q=o(1,G),Z=0;Z<V;Z++)z!==Z&&(K[z][Z]=a(K[z][Z],Q),K[Z][z]=a(K[Z][z],G));re&&($[z]=a($[z],Q))}}}}return re?s($):null}function D(K,V,ue,me,re,ae){var de=me==="BigNumber",ne=me==="Complex",ce=de?l(0):ne?x(0):0;de&&(ue=l(ue));for(var le=0;le<V-2;le++){for(var he=0,xe=ce,$=le+1;$<V;$++){var T=K[$][le];b(c(xe),c(T))&&(xe=T,he=$)}if(!b(c(xe),ue)){if(he!==le+1){var z=K[he];K[he]=K[le+1],K[le+1]=z;for(var J=0;J<V;J++){var L=K[J][he];K[J][he]=K[J][le+1],K[J][le+1]=L}if(re){var H=ae[he];ae[he]=ae[le+1],ae[le+1]=H}}for(var G=le+2;G<V;G++){var Y=o(K[G][le],xe);if(Y!==0){for(var ee=0;ee<V;ee++)K[G][ee]=r(K[G][ee],a(Y,K[le+1][ee]));for(var B=0;B<V;B++)K[B][le+1]=t(K[B][le+1],a(Y,K[B][G]));if(re)for(var j=0;j<V;j++)ae[G][j]=r(ae[G][j],a(Y,ae[le+1][j]))}}}}return ae}function S(K,V,ue,me,re){var ae=me==="BigNumber",de=me==="Complex",ne=ae?l(1):de?x(1):1;ae&&(ue=l(ue));for(var ce=ze(K),le=[],he=V,xe=[],$=re?s(Array(V).fill(ne)):void 0,T=re?s(Array(he).fill(ne)):void 0,z=0;z<=100;){z+=1;for(var J=ce[he-1][he-1],L=0;L<he;L++)ce[L][L]=r(ce[L][L],J);var{Q:H,R:G}=d(ce);ce=i(G,H);for(var Y=0;Y<he;Y++)ce[Y][Y]=t(ce[Y][Y],J);if(re&&(T=i(T,H)),he===1||b(c(ce[he-1][he-2]),ue)){z=0,le.push(ce[he-1][he-1]),re&&(xe.unshift([[1]]),P(T,V),$=i($,T),he>1&&(T=s(Array(he-1).fill(ne)))),he-=1,ce.pop();for(var ee=0;ee<he;ee++)ce[ee].pop()}else if(he===2||b(c(ce[he-2][he-3]),ue)){z=0;var B=_(ce[he-2][he-2],ce[he-2][he-1],ce[he-1][he-2],ce[he-1][he-1]);le.push(...B),re&&(xe.unshift(R(ce[he-2][he-2],ce[he-2][he-1],ce[he-1][he-2],ce[he-1][he-1],B[0],B[1],ue,me)),P(T,V),$=i($,T),he>2&&(T=s(Array(he-2).fill(ne)))),he-=2,ce.pop(),ce.pop();for(var j=0;j<he;j++)ce[j].pop(),ce[j].pop()}if(he===0)break}if(le.sort((ie,oe)=>+r(c(ie),c(oe))),z>100){var Q=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+le.join(", "));throw Q.values=le,Q.vectors=[],Q}var Z=re?i($,I(xe,V)):void 0;return{values:le,C:Z}}function C(K,V,ue,me,re,ae,de){var ne=m(ue),ce=i(ne,K,ue),le=de==="BigNumber",he=de==="Complex",xe=le?l(0):he?x(0):0,$=le?l(1):he?x(1):1,T=[],z=[];for(var J of re){var L=O(T,J,v);L===-1?(T.push(J),z.push(1)):z[L]+=1}for(var H=[],G=T.length,Y=Array(V).fill(xe),ee=s(Array(V).fill($)),B=function(){var Q=T[j],Z=r(ce,i(Q,ee)),ie=w(Z,Y);for(ie.shift();ie.length<z[j];){var oe=F(Z,V,ie,ae,de);if(oe===null)break;ie.push(oe)}var ye=i(m(me),ue);ie=ie.map(fe=>i(ye,fe)),H.push(...ie.map(fe=>({value:Q,vector:n(fe)})))},j=0;j<G;j++)B();return H}function _(K,V,ue,me){var re=t(K,me),ae=r(a(K,me),a(V,ue)),de=a(re,.5),ne=a(u(r(a(re,re),a(4,ae))),.5);return[t(de,ne),r(de,ne)]}function R(K,V,ue,me,re,ae,de,ne){var ce=ne==="BigNumber",le=ne==="Complex",he=ce?l(0):le?x(0):0,xe=ce?l(1):le?x(1):1;if(b(c(ue),de))return[[xe,he],[he,xe]];if(g(c(r(re,ae)),de))return[[r(re,me),r(ae,me)],[ue,ue]];var $=r(K,re),T=r(me,re);return b(c(V),de)&&b(c(T),de)?[[$,xe],[ue,he]]:[[V,he],[T,xe]]}function P(K,V){for(var ue=0;ue<K.length;ue++)K[ue].push(...Array(V-K[ue].length).fill(0));for(var me=K.length;me<V;me++)K.push(Array(V).fill(0)),K[me][me]=1;return K}function I(K,V){for(var ue=[],me=0;me<V;me++)ue[me]=Array(V).fill(0);var re=0;for(var ae of K){for(var de=ae.length,ne=0;ne<de;ne++)for(var ce=0;ce<de;ce++)ue[re+ne][re+ce]=ae[ne][ce];re+=de}return ue}function O(K,V,ue){for(var me=0;me<K.length;me++)if(ue(K[me],V))return me;return-1}function F(K,V,ue,me,re){for(var ae=re==="BigNumber"?l(1e3):1e3,de,ne=0;ne<5;++ne){de=q(V,ue,re);try{de=h(K,de)}catch{continue}if(g(te(de),ae))break}if(ne>=5)return null;for(ne=0;;){var ce=h(K,de);if(b(te(k(de,[ce])),me))break;if(++ne>=10)return null;de=se(ce)}return de}function q(K,V,ue){var me=ue==="BigNumber",re=ue==="Complex",ae=Array(K).fill(0).map(de=>2*Math.random()-1);return me&&(ae=ae.map(de=>l(de))),re&&(ae=ae.map(de=>x(de))),ae=k(ae,V),se(ae,ue)}function k(K,V){var ue=f(K);for(var me of V)me=p(me,ue),K=r(K,i(o(N(me,K),N(me,me)),me));return K}function te(K){return c(u(N(K,K)))}function se(K,V){var ue=V==="BigNumber",me=V==="Complex",re=ue?l(1):me?x(1):1;return i(o(re,te(K)),K)}return E}function WB(e){var{config:t,addScalar:r,subtract:n,abs:i,atan:a,cos:o,sin:u,multiplyScalar:c,inv:l,bignumber:s,multiply:f,add:p}=e;function m(D,S){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.epsilon,_=arguments.length>3?arguments[3]:void 0,R=arguments.length>4?arguments[4]:void 0;if(_==="number")return d(D,C,R);if(_==="BigNumber")return h(D,C,R);throw TypeError("Unsupported data type: "+_)}function d(D,S,C){var _=D.length,R=Math.abs(S/_),P,I;if(C){I=new Array(_);for(var O=0;O<_;O++)I[O]=Array(_).fill(0),I[O][O]=1}for(var F=N(D);Math.abs(F[1])>=Math.abs(R);){var q=F[0][0],k=F[0][1];P=w(D[q][q],D[k][k],D[q][k]),D=y(D,P,q,k),C&&(I=x(I,P,q,k)),F=N(D)}for(var te=Array(_).fill(0),se=0;se<_;se++)te[se]=D[se][se];return A(ze(te),I,C)}function h(D,S,C){var _=D.length,R=i(S/_),P,I;if(C){I=new Array(_);for(var O=0;O<_;O++)I[O]=Array(_).fill(0),I[O][O]=1}for(var F=E(D);i(F[1])>=i(R);){var q=F[0][0],k=F[0][1];P=v(D[q][q],D[k][k],D[q][k]),D=b(D,P,q,k),C&&(I=g(I,P,q,k)),F=E(D)}for(var te=Array(_).fill(0),se=0;se<_;se++)te[se]=D[se][se];return A(ze(te),I,C)}function w(D,S,C){var _=S-D;return Math.abs(_)<=t.epsilon?Math.PI/4:.5*Math.atan(2*C/(S-D))}function v(D,S,C){var _=n(S,D);return i(_)<=t.epsilon?s(-1).acos().div(4):c(.5,a(f(2,C,l(_))))}function x(D,S,C,_){for(var R=D.length,P=Math.cos(S),I=Math.sin(S),O=Array(R).fill(0),F=Array(R).fill(0),q=0;q<R;q++)O[q]=P*D[q][C]-I*D[q][_],F[q]=I*D[q][C]+P*D[q][_];for(var k=0;k<R;k++)D[k][C]=O[k],D[k][_]=F[k];return D}function g(D,S,C,_){for(var R=D.length,P=o(S),I=u(S),O=Array(R).fill(s(0)),F=Array(R).fill(s(0)),q=0;q<R;q++)O[q]=n(c(P,D[q][C]),c(I,D[q][_])),F[q]=r(c(I,D[q][C]),c(P,D[q][_]));for(var k=0;k<R;k++)D[k][C]=O[k],D[k][_]=F[k];return D}function b(D,S,C,_){for(var R=D.length,P=s(o(S)),I=s(u(S)),O=c(P,P),F=c(I,I),q=Array(R).fill(s(0)),k=Array(R).fill(s(0)),te=f(s(2),P,I,D[C][_]),se=r(n(c(O,D[C][C]),te),c(F,D[_][_])),K=p(c(F,D[C][C]),te,c(O,D[_][_])),V=0;V<R;V++)q[V]=n(c(P,D[C][V]),c(I,D[_][V])),k[V]=r(c(I,D[C][V]),c(P,D[_][V]));D[C][C]=se,D[_][_]=K,D[C][_]=s(0),D[_][C]=s(0);for(var ue=0;ue<R;ue++)ue!==C&&ue!==_&&(D[C][ue]=q[ue],D[ue][C]=q[ue],D[_][ue]=k[ue],D[ue][_]=k[ue]);return D}function y(D,S,C,_){for(var R=D.length,P=Math.cos(S),I=Math.sin(S),O=P*P,F=I*I,q=Array(R).fill(0),k=Array(R).fill(0),te=O*D[C][C]-2*P*I*D[C][_]+F*D[_][_],se=F*D[C][C]+2*P*I*D[C][_]+O*D[_][_],K=0;K<R;K++)q[K]=P*D[C][K]-I*D[_][K],k[K]=I*D[C][K]+P*D[_][K];D[C][C]=te,D[_][_]=se,D[C][_]=0,D[_][C]=0;for(var V=0;V<R;V++)V!==C&&V!==_&&(D[C][V]=q[V],D[V][C]=q[V],D[_][V]=k[V],D[V][_]=k[V]);return D}function N(D){for(var S=D.length,C=0,_=[0,1],R=0;R<S;R++)for(var P=R+1;P<S;P++)Math.abs(C)<Math.abs(D[R][P])&&(C=Math.abs(D[R][P]),_=[R,P]);return[_,C]}function E(D){for(var S=D.length,C=0,_=[0,1],R=0;R<S;R++)for(var P=R+1;P<S;P++)i(C)<i(D[R][P])&&(C=i(D[R][P]),_=[R,P]);return[_,C]}function A(D,S,C){var _=D.length,R=Array(_),P;if(C){P=Array(_);for(var I=0;I<_;I++)P[I]=Array(_)}for(var O=0;O<_;O++){for(var F=0,q=D[0],k=0;k<D.length;k++)i(D[k])<i(q)&&(F=k,q=D[F]);if(R[O]=D.splice(F,1)[0],C)for(var te=0;te<_;te++)P[O][te]=S[te][F],S[te].splice(F,1)}if(!C)return{values:R};var se=P.map((K,V)=>({value:R[V],vector:K}));return{values:R,eigenvectors:se}}return m}var KB="eigs",QB=["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"],ZB=U(KB,QB,e=>{var{config:t,typed:r,matrix:n,addScalar:i,subtract:a,equal:o,abs:u,atan:c,cos:l,sin:s,multiplyScalar:f,divideScalar:p,inv:m,bignumber:d,multiply:h,add:w,larger:v,column:x,flatten:g,number:b,complex:y,sqrt:N,diag:E,size:A,reshape:D,qr:S,usolve:C,usolveAll:_,im:R,re:P,smaller:I,matrixFromColumns:O,dot:F}=e,q=WB({config:t,addScalar:i,subtract:a,column:x,flatten:g,equal:o,abs:u,atan:c,cos:l,sin:s,multiplyScalar:f,inv:m,bignumber:d,complex:y,multiply:h,add:w}),k=GB({config:t,addScalar:i,subtract:a,multiply:h,multiplyScalar:f,flatten:g,divideScalar:p,sqrt:N,abs:u,bignumber:d,diag:E,size:A,reshape:D,qr:S,inv:m,usolve:C,usolveAll:_,equal:o,complex:y,larger:v,smaller:I,matrixFromColumns:O,dot:F});return r("eigs",{Array:function(re){return te(n(re))},"Array, number|BigNumber":function(re,ae){return te(n(re),{precision:ae})},"Array, Object"(re,ae){return te(n(re),ae)},Matrix:function(re){return te(re,{matricize:!0})},"Matrix, number|BigNumber":function(re,ae){return te(re,{precision:ae,matricize:!0})},"Matrix, Object":function(re,ae){var de={matricize:!0};return Tt(de,ae),te(re,de)}});function te(re){var ae,de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ne="eigenvectors"in de?de.eigenvectors:!0,ce=(ae=de.precision)!==null&&ae!==void 0?ae:t.epsilon,le=se(re,ce,ne);return de.matricize&&(le.values=n(le.values),ne&&(le.eigenvectors=le.eigenvectors.map(he=>{var{value:xe,vector:$}=he;return{value:xe,vector:n($)}}))),ne&&Object.defineProperty(le,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),le}function se(re,ae,de){var ne=re.toArray(),ce=re.size();if(ce.length!==2||ce[0]!==ce[1])throw new RangeError("Matrix must be square (size: ".concat(Ge(ce),")"));var le=ce[0];if(V(ne,le,ae)&&(ue(ne,le),K(ne,le,ae))){var he=me(re,ne,le);return q(ne,le,ae,he,de)}var xe=me(re,ne,le);return k(ne,le,ae,xe,de)}function K(re,ae,de){for(var ne=0;ne<ae;ne++)for(var ce=ne;ce<ae;ce++)if(v(d(u(a(re[ne][ce],re[ce][ne]))),de))return!1;return!0}function V(re,ae,de){for(var ne=0;ne<ae;ne++)for(var ce=0;ce<ae;ce++)if(v(d(u(R(re[ne][ce]))),de))return!1;return!0}function ue(re,ae){for(var de=0;de<ae;de++)for(var ne=0;ne<ae;ne++)re[de][ne]=P(re[de][ne])}function me(re,ae,de){var ne=re.datatype();if(ne==="number"||ne==="BigNumber"||ne==="Complex")return ne;for(var ce=!1,le=!1,he=!1,xe=0;xe<de;xe++)for(var $=0;$<de;$++){var T=ae[xe][$];if(Ue(T)||bo(T))ce=!0;else if($e(T))le=!0;else if(wn(T))he=!0;else throw TypeError("Unsupported type in Matrix: "+dt(T))}if(le&&he&&console.warn("Complex BigNumbers not supported, this operation will lose precission."),he){for(var z=0;z<de;z++)for(var J=0;J<de;J++)ae[z][J]=y(ae[z][J]);return"Complex"}if(le){for(var L=0;L<de;L++)for(var H=0;H<de;H++)ae[L][H]=d(ae[L][H]);return"BigNumber"}if(ce){for(var G=0;G<de;G++)for(var Y=0;Y<de;Y++)ae[G][Y]=b(ae[G][Y]);return"number"}else throw TypeError("Matrix contains unsupported types only.")}}),xh="expm",XB=["typed","abs","add","identity","inv","multiply"],YB=U(xh,XB,e=>{var{typed:t,abs:r,add:n,identity:i,inv:a,multiply:o}=e;return t(xh,{Matrix:function(s){var f=s.size();if(f.length!==2||f[0]!==f[1])throw new RangeError("Matrix must be square (size: "+Ge(f)+")");for(var p=f[0],m=1e-15,d=u(s),h=c(d,m),w=h.q,v=h.j,x=o(s,Math.pow(2,-v)),g=i(p),b=i(p),y=1,N=x,E=-1,A=1;A<=w;A++)A>1&&(N=o(N,x),E=-E),y=y*(w-A+1)/((2*w-A+1)*A),g=n(g,o(y,N)),b=n(b,o(y*E,N));for(var D=o(a(b),g),S=0;S<v;S++)D=o(D,D);return wi(s)?s.createSparseMatrix(D):D}});function u(s){for(var f=s.size()[0],p=0,m=0;m<f;m++){for(var d=0,h=0;h<f;h++)d+=r(s.get([m,h]));p=Math.max(d,p)}return p}function c(s,f){for(var p=30,m=0;m<p;m++)for(var d=0;d<=m;d++){var h=m-d;if(l(s,d,h)<f)return{q:d,j:h}}throw new Error("Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)")}function l(s,f,p){for(var m=1,d=2;d<=f;d++)m*=d;for(var h=m,w=f+1;w<=2*f;w++)h*=w;var v=h*(2*f+1);return 8*Math.pow(s/Math.pow(2,p),2*f)*m*m/(h*v)}}),wh="sqrtm",e6=["typed","abs","add","multiply","map","sqrt","subtract","inv","size","max","identity"],t6=U(wh,e6,e=>{var{typed:t,abs:r,add:n,multiply:i,map:a,sqrt:o,subtract:u,inv:c,size:l,max:s,identity:f}=e,p=1e3,m=1e-6;function d(h){var w,v=0,x=h,g=f(l(h));do{var b=x;if(x=i(.5,n(b,c(g))),g=i(.5,n(g,c(b))),w=s(r(u(x,b))),w>m&&++v>p)throw new Error("computing square root of matrix: iterative method could not converge")}while(w>m);return x}return t(wh,{"Array | Matrix":function(h){var w=ke(h)?h.size():Ve(h);switch(w.length){case 1:if(w[0]===1)return a(h,o);throw new RangeError("Matrix must be square (size: "+Ge(w)+")");case 2:{var v=w[0],x=w[1];if(v===x)return d(h);throw new RangeError("Matrix must be square (size: "+Ge(w)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+Ge(w)+")")}}})}),Nh="sylvester",r6=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],n6=U(Nh,r6,e=>{var{typed:t,schur:r,matrixFromColumns:n,matrix:i,multiply:a,range:o,concat:u,transpose:c,index:l,subset:s,add:f,subtract:p,identity:m,lusolve:d,abs:h}=e;return t(Nh,{"Matrix, Matrix, Matrix":w,"Array, Matrix, Matrix":function(v,x,g){return w(i(v),x,g)},"Array, Array, Matrix":function(v,x,g){return w(i(v),i(x),g)},"Array, Matrix, Array":function(v,x,g){return w(i(v),x,i(g))},"Matrix, Array, Matrix":function(v,x,g){return w(v,i(x),g)},"Matrix, Array, Array":function(v,x,g){return w(v,i(x),i(g))},"Matrix, Matrix, Array":function(v,x,g){return w(v,x,i(g))},"Array, Array, Array":function(v,x,g){return w(i(v),i(x),i(g)).toArray()}});function w(v,x,g){for(var b=x.size()[0],y=v.size()[0],N=r(v),E=N.T,A=N.U,D=r(a(-1,x)),S=D.T,C=D.U,_=a(a(c(A),g),C),R=o(0,y),P=[],I=(he,xe)=>u(he,xe,1),O=(he,xe)=>u(he,xe,0),F=0;F<b;F++)if(F<b-1&&h(s(S,l(F+1,F)))>1e-5){for(var q=O(s(_,l(R,F)),s(_,l(R,F+1))),k=0;k<F;k++)q=f(q,O(a(P[k],s(S,l(k,F))),a(P[k],s(S,l(k,F+1)))));var te=a(m(y),a(-1,s(S,l(F,F)))),se=a(m(y),a(-1,s(S,l(F+1,F)))),K=a(m(y),a(-1,s(S,l(F,F+1)))),V=a(m(y),a(-1,s(S,l(F+1,F+1)))),ue=O(I(f(E,te),se),I(K,f(E,V))),me=d(ue,q);P[F]=me.subset(l(o(0,y),0)),P[F+1]=me.subset(l(o(y,2*y),0)),F++}else{for(var re=s(_,l(R,F)),ae=0;ae<F;ae++)re=f(re,a(P[ae],s(S,l(ae,F))));var de=s(S,l(F,F)),ne=p(E,a(de,m(y)));P[F]=d(ne,re)}var ce=i(n(...P)),le=a(A,a(ce,c(C)));return le}}),Dh="schur",i6=["typed","matrix","identity","multiply","qr","norm","subtract"],a6=U(Dh,i6,e=>{var{typed:t,matrix:r,identity:n,multiply:i,qr:a,norm:o,subtract:u}=e;return t(Dh,{Array:function(l){var s=c(r(l));return{U:s.U.valueOf(),T:s.T.valueOf()}},Matrix:function(l){return c(l)}});function c(l){var s=l.size()[0],f=l,p=n(s),m=0,d;do{d=f;var h=a(f),w=h.Q,v=h.R;if(f=i(v,w),p=i(p,w),m++>100)break}while(o(u(f,d))>1e-4);return{U:p,T:f}}}),Eh="lyap",o6=["typed","matrix","sylvester","multiply","transpose"],s6=U(Eh,o6,e=>{var{typed:t,matrix:r,sylvester:n,multiply:i,transpose:a}=e;return t(Eh,{"Matrix, Matrix":function(o,u){return n(o,a(o),i(-1,u))},"Array, Matrix":function(o,u){return n(r(o),a(r(o)),i(-1,u))},"Matrix, Array":function(o,u){return n(o,a(r(o)),r(i(-1,u)))},"Array, Array":function(o,u){return n(r(o),a(r(o)),r(i(-1,u))).toArray()}})}),u6="divide",c6=["typed","matrix","multiply","equalScalar","divideScalar","inv"],l6=U(u6,c6,e=>{var{typed:t,matrix:r,multiply:n,equalScalar:i,divideScalar:a,inv:o}=e,u=Jt({typed:t,equalScalar:i}),c=Jr({typed:t});return t("divide",Vg({"Array | Matrix, Array | Matrix":function(l,s){return n(l,o(s))},"DenseMatrix, any":function(l,s){return c(l,s,a,!1)},"SparseMatrix, any":function(l,s){return u(l,s,a,!1)},"Array, any":function(l,s){return c(r(l),s,a,!1).valueOf()},"any, Array | Matrix":function(l,s){return n(l,o(s))}},a.signatures))}),Ah="distance",f6=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],p6=U(Ah,f6,e=>{var{typed:t,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:a,deepEqual:o,sqrt:u,abs:c}=e;return t(Ah,{"Array, Array, Array":function(b,y,N){if(b.length===2&&y.length===2&&N.length===2){if(!s(b))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!s(y))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!s(N))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(o(y,N))throw new TypeError("LinePoint1 should not be same with LinePoint2");var E=n(N[1],y[1]),A=n(y[0],N[0]),D=n(i(N[0],y[1]),i(y[0],N[1]));return w(b[0],b[1],E,A,D)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(b,y,N){if(Object.keys(b).length===2&&Object.keys(y).length===2&&Object.keys(N).length===2){if(!s(b))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!s(y))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!s(N))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(o(d(y),d(N)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in b&&"pointY"in b&&"lineOnePtX"in y&&"lineOnePtY"in y&&"lineTwoPtX"in N&&"lineTwoPtY"in N){var E=n(N.lineTwoPtY,y.lineOnePtY),A=n(y.lineOnePtX,N.lineTwoPtX),D=n(i(N.lineTwoPtX,y.lineOnePtY),i(y.lineOnePtX,N.lineTwoPtY));return w(b.pointX,b.pointY,E,A,D)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(b,y){if(b.length===2&&y.length===3){if(!s(b))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!f(y))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return w(b[0],b[1],y[0],y[1],y[2])}else if(b.length===3&&y.length===6){if(!f(b))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!m(y))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return v(b[0],b[1],b[2],y[0],y[1],y[2],y[3],y[4],y[5])}else if(b.length===y.length&&b.length>0){if(!p(b))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!p(y))throw new TypeError("All values of an array should be numbers or BigNumbers");return x(b,y)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(b,y){if(Object.keys(b).length===2&&Object.keys(y).length===3){if(!s(b))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!f(y))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in b&&"pointY"in b&&"xCoeffLine"in y&&"yCoeffLine"in y&&"constant"in y)return w(b.pointX,b.pointY,y.xCoeffLine,y.yCoeffLine,y.constant);throw new TypeError("Key names do not match")}else if(Object.keys(b).length===3&&Object.keys(y).length===6){if(!f(b))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!m(y))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in b&&"pointY"in b&&"x0"in y&&"y0"in y&&"z0"in y&&"a"in y&&"b"in y&&"c"in y)return v(b.pointX,b.pointY,b.pointZ,y.x0,y.y0,y.z0,y.a,y.b,y.c);throw new TypeError("Key names do not match")}else if(Object.keys(b).length===2&&Object.keys(y).length===2){if(!s(b))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!s(y))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in b&&"pointOneY"in b&&"pointTwoX"in y&&"pointTwoY"in y)return x([b.pointOneX,b.pointOneY],[y.pointTwoX,y.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(b).length===3&&Object.keys(y).length===3){if(!f(b))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!f(y))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in b&&"pointOneY"in b&&"pointOneZ"in b&&"pointTwoX"in y&&"pointTwoY"in y&&"pointTwoZ"in y)return x([b.pointOneX,b.pointOneY,b.pointOneZ],[y.pointTwoX,y.pointTwoY,y.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(b){if(!h(b))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return g(b)}});function l(b){return typeof b=="number"||$e(b)}function s(b){return b.constructor!==Array&&(b=d(b)),l(b[0])&&l(b[1])}function f(b){return b.constructor!==Array&&(b=d(b)),l(b[0])&&l(b[1])&&l(b[2])}function p(b){return Array.isArray(b)||(b=d(b)),b.every(l)}function m(b){return b.constructor!==Array&&(b=d(b)),l(b[0])&&l(b[1])&&l(b[2])&&l(b[3])&&l(b[4])&&l(b[5])}function d(b){for(var y=Object.keys(b),N=[],E=0;E<y.length;E++)N.push(b[y[E]]);return N}function h(b){if(b[0].length===2&&l(b[0][0])&&l(b[0][1])){if(b.some(y=>y.length!==2||!l(y[0])||!l(y[1])))return!1}else if(b[0].length===3&&l(b[0][0])&&l(b[0][1])&&l(b[0][2])){if(b.some(y=>y.length!==3||!l(y[0])||!l(y[1])||!l(y[2])))return!1}else return!1;return!0}function w(b,y,N,E,A){var D=c(r(r(i(N,b),i(E,y)),A)),S=u(r(i(N,N),i(E,E)));return a(D,S)}function v(b,y,N,E,A,D,S,C,_){var R=[n(i(n(A,y),_),i(n(D,N),C)),n(i(n(D,N),S),i(n(E,b),_)),n(i(n(E,b),C),i(n(A,y),S))];R=u(r(r(i(R[0],R[0]),i(R[1],R[1])),i(R[2],R[2])));var P=u(r(r(i(S,S),i(C,C)),i(_,_)));return a(R,P)}function x(b,y){for(var N=b.length,E=0,A=0,D=0;D<N;D++)A=n(b[D],y[D]),E=r(i(A,A),E);return u(E)}function g(b){for(var y=[],N=[],E=[],A=0;A<b.length-1;A++)for(var D=A+1;D<b.length;D++)b[0].length===2?(N=[b[A][0],b[A][1]],E=[b[D][0],b[D][1]]):b[0].length===3&&(N=[b[A][0],b[A][1],b[A][2]],E=[b[D][0],b[D][1],b[D][2]]),y.push(x(N,E));return y}}),m6="intersect",d6=["typed","config","abs","add","addScalar","matrix","multiply","multiplyScalar","divideScalar","subtract","smaller","equalScalar","flatten","isZero","isNumeric"],h6=U(m6,d6,e=>{var{typed:t,config:r,abs:n,add:i,addScalar:a,matrix:o,multiply:u,multiplyScalar:c,divideScalar:l,subtract:s,smaller:f,equalScalar:p,flatten:m,isZero:d,isNumeric:h}=e;return t("intersect",{"Array, Array, Array":w,"Array, Array, Array, Array":v,"Matrix, Matrix, Matrix":function(S,C,_){var R=w(S.valueOf(),C.valueOf(),_.valueOf());return R===null?null:o(R)},"Matrix, Matrix, Matrix, Matrix":function(S,C,_,R){var P=v(S.valueOf(),C.valueOf(),_.valueOf(),R.valueOf());return P===null?null:o(P)}});function w(S,C,_){if(S=x(S),C=x(C),_=x(_),!b(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!b(C))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!y(_))throw new TypeError("Array with 4 numbers expected as third argument");return D(S[0],S[1],S[2],C[0],C[1],C[2],_[0],_[1],_[2],_[3])}function v(S,C,_,R){if(S=x(S),C=x(C),_=x(_),R=x(R),S.length===2){if(!g(S))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!g(C))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!g(_))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!g(R))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return N(S,C,_,R)}else if(S.length===3){if(!b(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!b(C))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!b(_))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!b(R))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return A(S[0],S[1],S[2],C[0],C[1],C[2],_[0],_[1],_[2],R[0],R[1],R[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function x(S){return S.length===1?S[0]:S.length>1&&Array.isArray(S[0])&&S.every(C=>Array.isArray(C)&&C.length===1)?m(S):S}function g(S){return S.length===2&&h(S[0])&&h(S[1])}function b(S){return S.length===3&&h(S[0])&&h(S[1])&&h(S[2])}function y(S){return S.length===4&&h(S[0])&&h(S[1])&&h(S[2])&&h(S[3])}function N(S,C,_,R){var P=S,I=_,O=s(P,C),F=s(I,R),q=s(c(O[0],F[1]),c(F[0],O[1]));if(d(q)||f(n(q),r.epsilon))return null;var k=c(F[0],P[1]),te=c(F[1],P[0]),se=c(F[0],I[1]),K=c(F[1],I[0]),V=l(a(s(s(k,te),se),K),q);return i(u(O,V),P)}function E(S,C,_,R,P,I,O,F,q,k,te,se){var K=c(s(S,C),s(_,R)),V=c(s(P,I),s(O,F)),ue=c(s(q,k),s(te,se));return a(a(K,V),ue)}function A(S,C,_,R,P,I,O,F,q,k,te,se){var K=E(S,O,k,O,C,F,te,F,_,q,se,q),V=E(k,O,R,S,te,F,P,C,se,q,I,_),ue=E(S,O,R,S,C,F,P,C,_,q,I,_),me=E(k,O,k,O,te,F,te,F,se,q,se,q),re=E(R,S,R,S,P,C,P,C,I,_,I,_),ae=s(c(K,V),c(ue,me)),de=s(c(re,me),c(V,V));if(d(de))return null;var ne=l(ae,de),ce=l(a(K,c(ne,V)),me),le=a(S,c(ne,s(R,S))),he=a(C,c(ne,s(P,C))),xe=a(_,c(ne,s(I,_))),$=a(O,c(ce,s(k,O))),T=a(F,c(ce,s(te,F))),z=a(q,c(ce,s(se,q)));return p(le,$)&&p(he,T)&&p(xe,z)?[le,he,xe]:null}function D(S,C,_,R,P,I,O,F,q,k){var te=c(S,O),se=c(R,O),K=c(C,F),V=c(P,F),ue=c(_,q),me=c(I,q),re=s(s(s(k,te),K),ue),ae=s(s(s(a(a(se,V),me),te),K),ue),de=l(re,ae),ne=a(S,c(de,s(R,S))),ce=a(C,c(de,s(P,C))),le=a(_,c(de,s(I,_)));return[ne,ce,le]}}),Sh="sum",g6=["typed","config","add","numeric"],Vy=U(Sh,g6,e=>{var{typed:t,config:r,add:n,numeric:i}=e;return t(Sh,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":o,"...":function(u){if(Ea(u))throw new TypeError("Scalar values expected in function sum");return a(u)}});function a(u){var c;return Sn(u,function(l){try{c=c===void 0?l:n(c,l)}catch(s){throw ur(s,"sum",l)}}),c===void 0&&(c=i(0,r.number)),typeof c=="string"&&(c=i(c,r.number)),c}function o(u,c){try{var l=xu(u,c,n);return l}catch(s){throw ur(s,"sum")}}}),os="cumsum",v6=["typed","add","unaryPlus"],Uy=U(os,v6,e=>{var{typed:t,add:r,unaryPlus:n}=e;return t(os,{Array:i,Matrix:function(c){return c.create(i(c.valueOf()))},"Array, number | BigNumber":o,"Matrix, number | BigNumber":function(c,l){return c.create(o(c.valueOf(),l))},"...":function(c){if(Ea(c))throw new TypeError("All values expected to be scalar in function cumsum");return i(c)}});function i(c){try{return a(c)}catch(l){throw ur(l,os)}}function a(c){if(c.length===0)return[];for(var l=[n(c[0])],s=1;s<c.length;++s)l.push(r(l[s-1],c[s]));return l}function o(c,l){var s=Ve(c);if(l<0||l>=s.length)throw new $r(l,s.length);try{return u(c,l)}catch(f){throw ur(f,os)}}function u(c,l){var s,f,p;if(l<=0){var m=c[0][0];if(Array.isArray(m)){for(p=Nv(c),f=[],s=0;s<p.length;s++)f[s]=u(p[s],l-1);return f}else return a(c)}else{for(f=[],s=0;s<c.length;s++)f[s]=u(c[s],l-1);return f}}}),Ch="mean",y6=["typed","add","divide"],$y=U(Ch,y6,e=>{var{typed:t,add:r,divide:n}=e;return t(Ch,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":i,"...":function(o){if(Ea(o))throw new TypeError("Scalar values expected in function mean");return a(o)}});function i(o,u){try{var c=xu(o,u,r),l=Array.isArray(o)?Ve(o):o.size();return n(c,l[u])}catch(s){throw ur(s,"mean")}}function a(o){var u,c=0;if(Sn(o,function(l){try{u=u===void 0?l:r(u,l),c++}catch(s){throw ur(s,"mean",l)}}),c===0)throw new Error("Cannot calculate the mean of an empty array");return n(u,c)}}),Mh="median",b6=["typed","add","divide","compare","partitionSelect"],x6=U(Mh,b6,e=>{var{typed:t,add:r,divide:n,compare:i,partitionSelect:a}=e;function o(l){try{l=ot(l.valueOf());var s=l.length;if(s===0)throw new Error("Cannot calculate median of an empty array");if(s%2===0){for(var f=s/2-1,p=a(l,f+1),m=l[f],d=0;d<f;++d)i(l[d],m)>0&&(m=l[d]);return c(m,p)}else{var h=a(l,(s-1)/2);return u(h)}}catch(w){throw ur(w,"median")}}var u=t({"number | BigNumber | Complex | Unit":function(l){return l}}),c=t({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(l,s){return n(r(l,s),2)}});return t(Mh,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(l,s){throw new Error("median(A, dim) is not yet supported")},"...":function(l){if(Ea(l))throw new TypeError("Scalar values expected in function median");return o(l)}})}),_h="mad",w6=["typed","abs","map","median","subtract"],N6=U(_h,w6,e=>{var{typed:t,abs:r,map:n,median:i,subtract:a}=e;return t(_h,{"Array | Matrix":o,"...":function(u){return o(u)}});function o(u){if(u=ot(u.valueOf()),u.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var c=i(u);return i(n(u,function(l){return r(a(l,c))}))}catch(l){throw l instanceof TypeError&&l.message.includes("median")?new TypeError(l.message.replace("median","mad")):ur(l,"mad")}}}),mc="unbiased",Fh="variance",D6=["typed","add","subtract","multiply","divide","apply","isNaN"],Hy=U(Fh,D6,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:a,apply:o,isNaN:u}=e;return t(Fh,{"Array | Matrix":function(s){return c(s,mc)},"Array | Matrix, string":c,"Array | Matrix, number | BigNumber":function(s,f){return l(s,f,mc)},"Array | Matrix, number | BigNumber, string":l,"...":function(s){return c(s,mc)}});function c(s,f){var p,m=0;if(s.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(Sn(s,function(w){try{p=p===void 0?w:r(p,w),m++}catch(v){throw ur(v,"variance",w)}}),m===0)throw new Error("Cannot calculate variance of an empty array");var d=a(p,m);if(p=void 0,Sn(s,function(w){var v=n(w,d);p=p===void 0?i(v,v):r(p,i(v,v))}),u(p))return p;switch(f){case"uncorrected":return a(p,m);case"biased":return a(p,m+1);case"unbiased":{var h=$e(p)?p.mul(0):0;return m===1?h:a(p,m-1)}default:throw new Error('Unknown normalization "'+f+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function l(s,f,p){try{if(s.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return o(s,f,m=>c(m,p))}catch(m){throw ur(m,"variance")}}}),Th="quantileSeq",E6=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],Jy=U(Th,E6,e=>{var{typed:t,bignumber:r,add:n,subtract:i,divide:a,multiply:o,partitionSelect:u,compare:c,isInteger:l,smaller:s,smallerEq:f,larger:p}=e,m=Al({typed:t,isInteger:l});return t(Th,{"Array | Matrix, number | BigNumber":(x,g)=>h(x,g,!1),"Array | Matrix, number | BigNumber, number":(x,g,b)=>d(x,g,!1,b,h),"Array | Matrix, number | BigNumber, boolean":h,"Array | Matrix, number | BigNumber, boolean, number":(x,g,b,y)=>d(x,g,b,y,h),"Array | Matrix, Array | Matrix":(x,g)=>w(x,g,!1),"Array | Matrix, Array | Matrix, number":(x,g,b)=>d(x,g,!1,b,w),"Array | Matrix, Array | Matrix, boolean":w,"Array | Matrix, Array | Matrix, boolean, number":(x,g,b,y)=>d(x,g,b,y,w)});function d(x,g,b,y,N){return m(x,y,E=>N(E,g,b))}function h(x,g,b){var y,N=x.valueOf();if(s(g,0))throw new Error("N/prob must be non-negative");if(f(g,1))return Ue(g)?v(N,g,b):r(v(N,g,b));if(p(g,1)){if(!l(g))throw new Error("N must be a positive integer");if(p(g,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 E=n(g,1);y=[];for(var A=0;s(A,g);A++){var D=a(A+1,E);y.push(v(N,D,b))}return Ue(g)?y:r(y)}}function w(x,g,b){for(var y=x.valueOf(),N=g.valueOf(),E=[],A=0;A<N.length;++A)E.push(v(y,N[A],b));return E}function v(x,g,b){var y=ot(x),N=y.length;if(N===0)throw new Error("Cannot calculate quantile of an empty sequence");var E=Ue(g)?g*(N-1):g.times(N-1),A=Ue(g)?Math.floor(E):E.floor().toNumber(),D=Ue(g)?E%1:E.minus(A);if(l(E))return b?y[E]:u(y,Ue(g)?E:E.valueOf());var S,C;if(b)S=y[A],C=y[A+1];else{C=u(y,A+1),S=y[A];for(var _=0;_<A;++_)c(y[_],S)>0&&(S=y[_])}return n(o(S,i(1,D)),o(C,D))}}),Oh="std",A6=["typed","map","sqrt","variance"],Gy=U(Oh,A6,e=>{var{typed:t,map:r,sqrt:n,variance:i}=e;return t(Oh,{"Array | Matrix":a,"Array | Matrix, string":a,"Array | Matrix, number | BigNumber":a,"Array | Matrix, number | BigNumber, string":a,"...":function(o){return a(o)}});function a(o,u){if(o.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var c=i.apply(null,arguments);return Fr(c)?r(c,n):n(c)}catch(l){throw l instanceof TypeError&&l.message.includes(" variance")?new TypeError(l.message.replace(" variance"," std")):l}}}),Bh="corr",S6=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],C6=U(Bh,S6,e=>{var{typed:t,matrix:r,sqrt:n,sum:i,add:a,subtract:o,multiply:u,pow:c,divide:l}=e;return t(Bh,{"Array, Array":function(p,m){return s(p,m)},"Matrix, Matrix":function(p,m){var d=s(p.toArray(),m.toArray());return Array.isArray(d)?r(d):d}});function s(p,m){var d=[];if(Array.isArray(p[0])&&Array.isArray(m[0])){if(p.length!==m.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var h=0;h<p.length;h++){if(p[h].length!==m[h].length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");d.push(f(p[h],m[h]))}return d}else{if(p.length!==m.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");return f(p,m)}}function f(p,m){var d=p.length,h=i(p),w=i(m),v=p.reduce((N,E,A)=>a(N,u(E,m[A])),0),x=i(p.map(N=>c(N,2))),g=i(m.map(N=>c(N,2))),b=o(u(d,v),u(h,w)),y=n(u(o(u(d,x),c(h,2)),o(u(d,g),c(w,2))));return l(b,y)}}),kh="combinations",M6=["typed"],_6=U(kh,M6,e=>{var{typed:t}=e;return t(kh,{"number, number":Hv,"BigNumber, BigNumber":function(r,n){var i=r.constructor,a,o,u=r.minus(n),c=new i(1);if(!Ih(r)||!Ih(n))throw new TypeError("Positive integer value expected in function combinations");if(n.gt(r))throw new TypeError("k must be less than n in function combinations");if(a=c,n.lt(u))for(o=c;o.lte(u);o=o.plus(c))a=a.times(n.plus(o)).dividedBy(o);else for(o=c;o.lte(n);o=o.plus(c))a=a.times(u.plus(o)).dividedBy(o);return a}})});function Ih(e){return e.isInteger()&&e.gte(0)}var Rh="combinationsWithRep",F6=["typed"],T6=U(Rh,F6,e=>{var{typed:t}=e;return t(Rh,{"number, number":function(r,n){if(!Fe(r)||r<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!Fe(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(r<1)throw new TypeError("k must be less than or equal to n + k - 1");if(n<r-1){var i=xn(r,r+n-1);return i/xn(1,n)}var a=xn(n+1,r+n-1);return a/xn(1,r-1)},"BigNumber, BigNumber":function(r,n){var i=r.constructor,a,o,u=new i(1),c=r.minus(u);if(!qh(r)||!qh(n))throw new TypeError("Positive integer value expected in function combinationsWithRep");if(r.lt(u))throw new TypeError("k must be less than or equal to n + k - 1 in function combinationsWithRep");if(a=u,n.lt(c))for(o=u;o.lte(c);o=o.plus(u))a=a.times(n.plus(o)).dividedBy(o);else for(o=u;o.lte(n);o=o.plus(u))a=a.times(c.plus(o)).dividedBy(o);return a}})});function qh(e){return e.isInteger()&&e.gte(0)}var zh="gamma",O6=["typed","config","multiplyScalar","pow","BigNumber","Complex"],B6=U(zh,O6,e=>{var{typed:t,config:r,multiplyScalar:n,pow:i,BigNumber:a,Complex:o}=e;function u(l){if(l.im===0)return js(l.re);if(l.re<.5){var s=new o(1-l.re,-l.im),f=new o(Math.PI*l.re,Math.PI*l.im);return new o(Math.PI).div(f.sin()).div(u(s))}l=new o(l.re-1,l.im);for(var p=new o(oa[0],0),m=1;m<oa.length;++m){var d=new o(oa[m],0);p=p.add(d.div(l.add(m)))}var h=new o(l.re+Qv+.5,l.im),w=Math.sqrt(2*Math.PI),v=h.pow(l.add(.5)),x=h.neg().exp();return p.mul(w).mul(v).mul(x)}return t(zh,{number:js,Complex:u,BigNumber:function(l){if(l.isInteger())return l.isNegative()||l.isZero()?new a(1/0):c(l.minus(1));if(!l.isFinite())return new a(l.isNegative()?NaN:1/0);throw new Error("Integer BigNumber expected")}});function c(l){if(l<8)return new a([1,1,2,6,24,120,720,5040][l]);var s=r.precision+(Math.log(l.toNumber())|0),f=a.clone({precision:s});if(l%2===1)return l.times(c(new a(l-1)));for(var p=l,m=new f(l),d=l.toNumber();p>2;)p-=2,d+=p,m=m.times(d);return new a(m.toPrecision(a.precision))}}),jh="lgamma",k6=["Complex","typed"],I6=U(jh,k6,e=>{var{Complex:t,typed:r}=e,n=7,i=7,a=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return r(jh,{number:Ls,Complex:o,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function o(l){var s=6.283185307179586,f=1.1447298858494002,p=.1;if(l.isNaN())return new t(NaN,NaN);if(l.im===0)return new t(Ls(l.re),0);if(l.re>=n||Math.abs(l.im)>=i)return u(l);if(l.re<=p){var m=AN(s,l.im)*Math.floor(.5*l.re+.25),d=l.mul(Math.PI).sin().log(),h=o(new t(1-l.re,-l.im));return new t(f,m).sub(d).sub(h)}else return l.im>=0?c(l):c(l.conjugate()).conjugate()}function u(l){for(var s=l.sub(.5).mul(l.log()).sub(l).add(Zv),f=new t(1,0).div(l),p=f.div(l),m=a[0],d=a[1],h=2*p.re,w=p.re*p.re+p.im*p.im,v=2;v<8;v++){var x=d;d=-w*m+a[v],m=h*m+x}var g=f.mul(p.mul(m).add(d));return s.add(g)}function c(l){var s=0,f=0,p=l;for(l=l.add(1);l.re<=n;){p=p.mul(l);var m=p.im<0?1:0;m!==0&&f===0&&s++,f=m,l=l.add(1)}return u(l).sub(p.log()).sub(new t(0,s*2*Math.PI*1))}}),Lh="factorial",R6=["typed","gamma"],q6=U(Lh,R6,e=>{var{typed:t,gamma:r}=e;return t(Lh,{number:function(n){if(n<0)throw new Error("Value must be non-negative");return r(n+1)},BigNumber:function(n){if(n.isNegative())throw new Error("Value must be non-negative");return r(n.plus(1))},"Array | Matrix":t.referToSelf(n=>i=>Qe(i,n))})}),Ph="kldivergence",z6=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],j6=U(Ph,z6,e=>{var{typed:t,matrix:r,divide:n,sum:i,multiply:a,map:o,dotDivide:u,log:c,isNumeric:l}=e;return t(Ph,{"Array, Array":function(f,p){return s(r(f),r(p))},"Matrix, Array":function(f,p){return s(f,r(p))},"Array, Matrix":function(f,p){return s(r(f),p)},"Matrix, Matrix":function(f,p){return s(f,p)}});function s(f,p){var m=p.size().length,d=f.size().length;if(m>1)throw new Error("first object must be one dimensional");if(d>1)throw new Error("second object must be one dimensional");if(m!==d)throw new Error("Length of two vectors must be equal");var h=i(f);if(h===0)throw new Error("Sum of elements in first object must be non zero");var w=i(p);if(w===0)throw new Error("Sum of elements in second object must be non zero");var v=n(f,i(f)),x=n(p,i(p)),g=i(a(v,o(u(v,x),b=>c(b))));return l(g)?g:Number.NaN}}),Vh="multinomial",L6=["typed","add","divide","multiply","factorial","isInteger","isPositive"],P6=U(Vh,L6,e=>{var{typed:t,add:r,divide:n,multiply:i,factorial:a,isInteger:o,isPositive:u}=e;return t(Vh,{"Array | Matrix":function(c){var l=0,s=1;return Sn(c,function(f){if(!o(f)||!u(f))throw new TypeError("Positive integer value expected in function multinomial");l=r(l,f),s=i(s,a(f))}),n(a(l),s)}})}),Uh="permutations",V6=["typed","factorial"],U6=U(Uh,V6,e=>{var{typed:t,factorial:r}=e;return t(Uh,{"number | BigNumber":r,"number, number":function(n,i){if(!Fe(n)||n<0)throw new TypeError("Positive integer value expected in function permutations");if(!Fe(i)||i<0)throw new TypeError("Positive integer value expected in function permutations");if(i>n)throw new TypeError("second argument k must be less than or equal to first argument n");return xn(n-i+1,n)},"BigNumber, BigNumber":function(n,i){var a,o;if(!$h(n)||!$h(i))throw new TypeError("Positive integer value expected in function permutations");if(i.gt(n))throw new TypeError("second argument k must be less than or equal to first argument n");var u=n.mul(0).add(1);for(a=u,o=n.minus(i).plus(1);o.lte(n);o=o.plus(1))a=a.times(o);return a}})});function $h(e){return e.isInteger()&&e.gte(0)}var Wy={exports:{}};(function(e){(function(t,r,n){function i(c){var l=this,s=u();l.next=function(){var f=2091639*l.s0+l.c*23283064365386963e-26;return l.s0=l.s1,l.s1=l.s2,l.s2=f-(l.c=f|0)},l.c=1,l.s0=s(" "),l.s1=s(" "),l.s2=s(" "),l.s0-=s(c),l.s0<0&&(l.s0+=1),l.s1-=s(c),l.s1<0&&(l.s1+=1),l.s2-=s(c),l.s2<0&&(l.s2+=1),s=null}function a(c,l){return l.c=c.c,l.s0=c.s0,l.s1=c.s1,l.s2=c.s2,l}function o(c,l){var s=new i(c),f=l&&l.state,p=s.next;return p.int32=function(){return s.next()*4294967296|0},p.double=function(){return p()+(p()*2097152|0)*11102230246251565e-32},p.quick=p,f&&(typeof f=="object"&&a(f,s),p.state=function(){return a(s,{})}),p}function u(){var c=4022871197,l=function(s){s=String(s);for(var f=0;f<s.length;f++){c+=s.charCodeAt(f);var p=.02519603282416938*c;c=p>>>0,p-=c,p*=c,c=p>>>0,p-=c,c+=p*4294967296}return(c>>>0)*23283064365386963e-26};return l}r&&r.exports?r.exports=o:this.alea=o})(qi,e)})(Wy);var $6=Wy.exports,Ky={exports:{}};(function(e){(function(t,r,n){function i(u){var c=this,l="";c.x=0,c.y=0,c.z=0,c.w=0,c.next=function(){var f=c.x^c.x<<11;return c.x=c.y,c.y=c.z,c.z=c.w,c.w^=c.w>>>19^f^f>>>8},u===(u|0)?c.x=u:l+=u;for(var s=0;s<l.length+64;s++)c.x^=l.charCodeAt(s)|0,c.next()}function a(u,c){return c.x=u.x,c.y=u.y,c.z=u.z,c.w=u.w,c}function o(u,c){var l=new i(u),s=c&&c.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var p=l.next()>>>11,m=(l.next()>>>0)/4294967296,d=(p+m)/(1<<21);while(d===0);return d},f.int32=l.next,f.quick=f,s&&(typeof s=="object"&&a(s,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=o:this.xor128=o})(qi,e)})(Ky);var H6=Ky.exports,Qy={exports:{}};(function(e){(function(t,r,n){function i(u){var c=this,l="";c.next=function(){var f=c.x^c.x>>>2;return c.x=c.y,c.y=c.z,c.z=c.w,c.w=c.v,(c.d=c.d+362437|0)+(c.v=c.v^c.v<<4^(f^f<<1))|0},c.x=0,c.y=0,c.z=0,c.w=0,c.v=0,u===(u|0)?c.x=u:l+=u;for(var s=0;s<l.length+64;s++)c.x^=l.charCodeAt(s)|0,s==l.length&&(c.d=c.x<<10^c.x>>>4),c.next()}function a(u,c){return c.x=u.x,c.y=u.y,c.z=u.z,c.w=u.w,c.v=u.v,c.d=u.d,c}function o(u,c){var l=new i(u),s=c&&c.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var p=l.next()>>>11,m=(l.next()>>>0)/4294967296,d=(p+m)/(1<<21);while(d===0);return d},f.int32=l.next,f.quick=f,s&&(typeof s=="object"&&a(s,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=o:this.xorwow=o})(qi,e)})(Qy);var J6=Qy.exports,Zy={exports:{}};(function(e){(function(t,r,n){function i(u){var c=this;c.next=function(){var s=c.x,f=c.i,p,m;return p=s[f],p^=p>>>7,m=p^p<<24,p=s[f+1&7],m^=p^p>>>10,p=s[f+3&7],m^=p^p>>>3,p=s[f+4&7],m^=p^p<<7,p=s[f+7&7],p=p^p<<13,m^=p^p<<9,s[f]=m,c.i=f+1&7,m};function l(s,f){var p,m=[];if(f===(f|0))m[0]=f;else for(f=""+f,p=0;p<f.length;++p)m[p&7]=m[p&7]<<15^f.charCodeAt(p)+m[p+1&7]<<13;for(;m.length<8;)m.push(0);for(p=0;p<8&&m[p]===0;++p);for(p==8?m[7]=-1:m[p],s.x=m,s.i=0,p=256;p>0;--p)s.next()}l(c,u)}function a(u,c){return c.x=u.x.slice(),c.i=u.i,c}function o(u,c){u==null&&(u=+new Date);var l=new i(u),s=c&&c.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var p=l.next()>>>11,m=(l.next()>>>0)/4294967296,d=(p+m)/(1<<21);while(d===0);return d},f.int32=l.next,f.quick=f,s&&(s.x&&a(s,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=o:this.xorshift7=o})(qi,e)})(Zy);var G6=Zy.exports,Xy={exports:{}};(function(e){(function(t,r,n){function i(u){var c=this;c.next=function(){var s=c.w,f=c.X,p=c.i,m,d;return c.w=s=s+1640531527|0,d=f[p+34&127],m=f[p=p+1&127],d^=d<<13,m^=m<<17,d^=d>>>15,m^=m>>>12,d=f[p]=d^m,c.i=p,d+(s^s>>>16)|0};function l(s,f){var p,m,d,h,w,v=[],x=128;for(f===(f|0)?(m=f,f=null):(f=f+"\0",m=0,x=Math.max(x,f.length)),d=0,h=-32;h<x;++h)f&&(m^=f.charCodeAt((h+32)%f.length)),h===0&&(w=m),m^=m<<10,m^=m>>>15,m^=m<<4,m^=m>>>13,h>=0&&(w=w+1640531527|0,p=v[h&127]^=m+w,d=p==0?d+1:0);for(d>=128&&(v[(f&&f.length||0)&127]=-1),d=127,h=4*128;h>0;--h)m=v[d+34&127],p=v[d=d+1&127],m^=m<<13,p^=p<<17,m^=m>>>15,p^=p>>>12,v[d]=m^p;s.w=w,s.X=v,s.i=d}l(c,u)}function a(u,c){return c.i=u.i,c.w=u.w,c.X=u.X.slice(),c}function o(u,c){u==null&&(u=+new Date);var l=new i(u),s=c&&c.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var p=l.next()>>>11,m=(l.next()>>>0)/4294967296,d=(p+m)/(1<<21);while(d===0);return d},f.int32=l.next,f.quick=f,s&&(s.X&&a(s,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=o:this.xor4096=o})(qi,e)})(Xy);var W6=Xy.exports,Yy={exports:{}};(function(e){(function(t,r,n){function i(u){var c=this,l="";c.next=function(){var f=c.b,p=c.c,m=c.d,d=c.a;return f=f<<25^f>>>7^p,p=p-m|0,m=m<<24^m>>>8^d,d=d-f|0,c.b=f=f<<20^f>>>12^p,c.c=p=p-m|0,c.d=m<<16^p>>>16^d,c.a=d-f|0},c.a=0,c.b=0,c.c=-1640531527,c.d=1367130551,u===Math.floor(u)?(c.a=u/4294967296|0,c.b=u|0):l+=u;for(var s=0;s<l.length+20;s++)c.b^=l.charCodeAt(s)|0,c.next()}function a(u,c){return c.a=u.a,c.b=u.b,c.c=u.c,c.d=u.d,c}function o(u,c){var l=new i(u),s=c&&c.state,f=function(){return(l.next()>>>0)/4294967296};return f.double=function(){do var p=l.next()>>>11,m=(l.next()>>>0)/4294967296,d=(p+m)/(1<<21);while(d===0);return d},f.int32=l.next,f.quick=f,s&&(typeof s=="object"&&a(s,l),f.state=function(){return a(l,{})}),f}r&&r.exports?r.exports=o:this.tychei=o})(qi,e)})(Yy);var K6=Yy.exports,e1={exports:{}};const Q6={},Z6=Object.freeze(Object.defineProperty({__proto__:null,default:Q6},Symbol.toStringTag,{value:"Module"})),X6=R2(Z6);(function(e){(function(t,r,n){var i=256,a=6,o=52,u="random",c=n.pow(i,a),l=n.pow(2,o),s=l*2,f=i-1,p;function m(b,y,N){var E=[];y=y==!0?{entropy:!0}:y||{};var A=v(w(y.entropy?[b,g(r)]:b??x(),3),E),D=new d(E),S=function(){for(var C=D.g(a),_=c,R=0;C<l;)C=(C+R)*i,_*=i,R=D.g(1);for(;C>=s;)C/=2,_/=2,R>>>=1;return(C+R)/_};return S.int32=function(){return D.g(4)|0},S.quick=function(){return D.g(4)/4294967296},S.double=S,v(g(D.S),r),(y.pass||N||function(C,_,R,P){return P&&(P.S&&h(P,D),C.state=function(){return h(D,{})}),R?(n[u]=C,_):C})(S,A,"global"in y?y.global:this==n,y.state)}function d(b){var y,N=b.length,E=this,A=0,D=E.i=E.j=0,S=E.S=[];for(N||(b=[N++]);A<i;)S[A]=A++;for(A=0;A<i;A++)S[A]=S[D=f&D+b[A%N]+(y=S[A])],S[D]=y;(E.g=function(C){for(var _,R=0,P=E.i,I=E.j,O=E.S;C--;)_=O[P=f&P+1],R=R*i+O[f&(O[P]=O[I=f&I+_])+(O[I]=_)];return E.i=P,E.j=I,R})(i)}function h(b,y){return y.i=b.i,y.j=b.j,y.S=b.S.slice(),y}function w(b,y){var N=[],E=typeof b,A;if(y&&E=="object")for(A in b)try{N.push(w(b[A],y-1))}catch{}return N.length?N:E=="string"?b:b+"\0"}function v(b,y){for(var N=b+"",E,A=0;A<N.length;)y[f&A]=f&(E^=y[f&A]*19)+N.charCodeAt(A++);return g(y)}function x(){try{var b;return p&&(b=p.randomBytes)?b=b(i):(b=new Uint8Array(i),(t.crypto||t.msCrypto).getRandomValues(b)),g(b)}catch{var y=t.navigator,N=y&&y.plugins;return[+new Date,t,N,t.screen,g(r)]}}function g(b){return String.fromCharCode.apply(0,b)}if(v(n.random(),r),e.exports){e.exports=m;try{p=X6}catch{}}else n["seed"+u]=m})(typeof self<"u"?self:qi,[],Math)})(e1);var Y6=e1.exports,e9=$6,t9=H6,r9=J6,n9=G6,i9=W6,a9=K6,Li=Y6;Li.alea=e9;Li.xor128=t9;Li.xorwow=r9;Li.xorshift7=n9;Li.xor4096=i9;Li.tychei=a9;var o9=Li;const t1=No(o9);var s9=t1(Date.now());function va(e){var t;function r(i){t=i===null?s9:t1(String(i))}r(e);function n(){return t()}return n}var Hh="pickRandom",u9=["typed","config","?on"],c9=U(Hh,u9,e=>{var{typed:t,config:r,on:n}=e,i=va(r.randomSeed);return n&&n("config",function(o,u){o.randomSeed!==u.randomSeed&&(i=va(o.randomSeed))}),t(Hh,{"Array | Matrix":function(o){return a(o,{})},"Array | Matrix, Object":function(o,u){return a(o,u)},"Array | Matrix, number":function(o,u){return a(o,{number:u})},"Array | Matrix, Array | Matrix":function(o,u){return a(o,{weights:u})},"Array | Matrix, Array | Matrix, number":function(o,u,c){return a(o,{number:c,weights:u})},"Array | Matrix, number, Array | Matrix":function(o,u,c){return a(o,{number:u,weights:c})}});function a(o,u){var{number:c,weights:l,elementWise:s=!0}=u,f=typeof c>"u";f&&(c=1);var p=ke(o)?o.create:ke(l)?l.create:null;o=o.valueOf(),l&&(l=l.valueOf()),s===!0&&(o=ot(o),l=ot(l));var m=0;if(typeof l<"u"){if(l.length!==o.length)throw new Error("Weights must have the same length as possibles");for(var d=0,h=l.length;d<h;d++){if(!Ue(l[d])||l[d]<0)throw new Error("Weights must be an array of positive numbers");m+=l[d]}}for(var w=o.length,v=[],x;v.length<c;){if(typeof l>"u")x=o[Math.floor(i()*w)];else for(var g=i()*m,b=0,y=o.length;b<y;b++)if(g-=l[b],g<0){x=o[b];break}v.push(x)}return f?v[0]:p?p(v):v}});function Ol(e,t){var r=[];if(e=e.slice(0),e.length>1)for(var n=0,i=e.shift();n<i;n++)r.push(Ol(e,t));else for(var a=0,o=e.shift();a<o;a++)r.push(t());return r}var Jh="random",l9=["typed","config","?on"],f9=U(Jh,l9,e=>{var{typed:t,config:r,on:n}=e,i=va(r.randomSeed);return n&&n("config",function(u,c){u.randomSeed!==c.randomSeed&&(i=va(u.randomSeed))}),t(Jh,{"":()=>o(0,1),number:u=>o(0,u),"number, number":(u,c)=>o(u,c),"Array | Matrix":u=>a(u,0,1),"Array | Matrix, number":(u,c)=>a(u,0,c),"Array | Matrix, number, number":(u,c,l)=>a(u,c,l)});function a(u,c,l){var s=Ol(u.valueOf(),()=>o(c,l));return ke(u)?u.create(s):s}function o(u,c){return u+i()*(c-u)}}),Gh="randomInt",p9=["typed","config","?on"],m9=U(Gh,p9,e=>{var{typed:t,config:r,on:n}=e,i=va(r.randomSeed);return n&&n("config",function(u,c){u.randomSeed!==c.randomSeed&&(i=va(u.randomSeed))}),t(Gh,{"":()=>o(0,1),number:u=>o(0,u),"number, number":(u,c)=>o(u,c),"Array | Matrix":u=>a(u,0,1),"Array | Matrix, number":(u,c)=>a(u,0,c),"Array | Matrix, number, number":(u,c,l)=>a(u,c,l)});function a(u,c,l){var s=Ol(u.valueOf(),()=>o(c,l));return ke(u)?u.create(s):s}function o(u,c){return Math.floor(u+i()*(c-u))}}),Wh="stirlingS2",d9=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],h9=U(Wh,d9,e=>{var{typed:t,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:a,pow:o,factorial:u,combinations:c,isNegative:l,isInteger:s,number:f,bignumber:p,larger:m}=e,d=[],h=[];return t(Wh,{"number | BigNumber, number | BigNumber":function(w,v){if(!s(w)||l(w)||!s(v)||l(v))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(m(v,w))throw new TypeError("k must be less than or equal to n in function stirlingS2");var x=!(Ue(w)&&Ue(v)),g=x?h:d,b=x?p:f,y=f(w),N=f(v);if(g[y]&&g[y].length>N)return g[y][N];for(var E=0;E<=y;++E)if(g[E]||(g[E]=[b(E===0?1:0)]),E!==0)for(var A=g[E],D=g[E-1],S=A.length;S<=E&&S<=N;++S)S===E?A[S]=1:A[S]=r(i(b(S),D[S]),D[S-1]);return g[y][N]}})}),Kh="bellNumbers",g9=["typed","addScalar","isNegative","isInteger","stirlingS2"],v9=U(Kh,g9,e=>{var{typed:t,addScalar:r,isNegative:n,isInteger:i,stirlingS2:a}=e;return t(Kh,{"number | BigNumber":function(o){if(!i(o)||n(o))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var u=0,c=0;c<=o;c++)u=r(u,a(o,c));return u}})}),Qh="catalan",y9=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],b9=U(Qh,y9,e=>{var{typed:t,addScalar:r,divideScalar:n,multiplyScalar:i,combinations:a,isNegative:o,isInteger:u}=e;return t(Qh,{"number | BigNumber":function(c){if(!u(c)||o(c))throw new TypeError("Non-negative integer value expected in function catalan");return n(a(i(c,2),c),r(c,1))}})}),Zh="composition",x9=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],w9=U(Zh,x9,e=>{var{typed:t,addScalar:r,combinations:n,isPositive:i,isNegative:a,isInteger:o,larger:u}=e;return t(Zh,{"number | BigNumber, number | BigNumber":function(c,l){if(!o(c)||!i(c)||!o(l)||!i(l))throw new TypeError("Positive integer value expected in function composition");if(u(l,c))throw new TypeError("k must be less than or equal to n in function composition");return n(r(c,-1),r(l,-1))}})}),Xh="leafCount",N9=["parse","typed"],D9=U(Xh,N9,e=>{var{parse:t,typed:r}=e;function n(i){var a=0;return i.forEach(o=>{a+=n(o)}),a||1}return r(Xh,{Node:function(i){return n(i)}})});function Yh(e){return nt(e)||Ct(e)&&e.isUnary()&&nt(e.args[0])}function Qs(e){return!!(nt(e)||(Zn(e)||Ct(e))&&e.args.every(Qs)||An(e)&&Qs(e.content))}function e0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function dc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?e0(Object(r),!0).forEach(function(n){Bt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):e0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var E9="simplifyUtil",A9=["FunctionNode","OperatorNode","SymbolNode"],Bl=U(E9,A9,e=>{var{FunctionNode:t,OperatorNode:r,SymbolNode:n}=e,i=!0,a=!1,o="defaultF",u={add:{trivial:i,total:i,commutative:i,associative:i},unaryPlus:{trivial:i,total:i,commutative:i,associative:i},subtract:{trivial:a,total:i,commutative:a,associative:a},multiply:{trivial:i,total:i,commutative:i,associative:i},divide:{trivial:a,total:i,commutative:a,associative:a},paren:{trivial:i,total:i,commutative:i,associative:a},defaultF:{trivial:a,total:i,commutative:a,associative:a}},c={divide:{total:a},log:{total:a}},l={subtract:{total:a},abs:{trivial:i},log:{total:i}};function s(g,b){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:u,N=o;if(typeof g=="string"?N=g:Ct(g)?N=g.fn.toString():Zn(g)?N=g.name:An(g)&&(N="paren"),Me(y,N)){var E=y[N];if(Me(E,b))return E[b];if(Me(u,N))return u[N][b]}if(Me(y,o)){var A=y[o];return Me(A,b)?A[b]:u[o][b]}if(Me(u,N)){var D=u[N];if(Me(D,b))return D[b]}return u[o][b]}function f(g){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return s(g,"commutative",b)}function p(g){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return s(g,"associative",b)}function m(g,b){var y=dc({},g);for(var N in b)Me(g,N)?y[N]=dc(dc({},b[N]),g[N]):y[N]=b[N];return y}function d(g,b){if(!g.args||g.args.length===0)return g;g.args=h(g,b);for(var y=0;y<g.args.length;y++)d(g.args[y],b)}function h(g,b){var y,N=[],E=function A(D){for(var S=0;S<D.args.length;S++){var C=D.args[S];Ct(C)&&y===C.op?A(C):N.push(C)}};return p(g,b)?(y=g.op,E(g),N):g.args}function w(g,b){if(!(!g.args||g.args.length===0)){for(var y=x(g),N=g.args.length,E=0;E<N;E++)w(g.args[E],b);if(N>2&&p(g,b)){for(var A=g.args.pop();g.args.length>0;)A=y([g.args.pop(),A]);g.args=A.args}}}function v(g,b){if(!(!g.args||g.args.length===0)){for(var y=x(g),N=g.args.length,E=0;E<N;E++)v(g.args[E],b);if(N>2&&p(g,b)){for(var A=g.args.shift();g.args.length>0;)A=y([A,g.args.shift()]);g.args=A.args}}}function x(g){return Ct(g)?function(b){try{return new r(g.op,g.fn,b,g.implicit)}catch(y){return console.error(y),[]}}:function(b){return new t(new n(g.name),b)}}return{createMakeNodeFunction:x,hasProperty:s,isCommutative:f,isAssociative:p,mergeContext:m,flatten:d,allChildren:h,unflattenr:w,unflattenl:v,defaultContext:u,realContext:c,positiveContext:l}}),S9="simplify",C9=["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],M9=U(S9,C9,e=>{var{config:t,typed:r,parse:n,add:i,subtract:a,multiply:o,divide:u,pow:c,isZero:l,equal:s,resolve:f,simplifyConstant:p,simplifyCore:m,fraction:d,bignumber:h,mathWithTransform:w,matrix:v,AccessorNode:x,ArrayNode:g,ConstantNode:b,FunctionNode:y,IndexNode:N,ObjectNode:E,OperatorNode:A,ParenthesisNode:D,SymbolNode:S}=e,{hasProperty:C,isCommutative:_,isAssociative:R,mergeContext:P,flatten:I,unflattenr:O,unflattenl:F,createMakeNodeFunction:q,defaultContext:k,realContext:te,positiveContext:se}=Bl({FunctionNode:y,OperatorNode:A,SymbolNode:S});r.addConversion({from:"Object",to:"Map",convert:aa});var K=r("simplify",{Node:ne,"Node, Map":(L,H)=>ne(L,!1,H),"Node, Map, Object":(L,H,G)=>ne(L,!1,H,G),"Node, Array":ne,"Node, Array, Map":ne,"Node, Array, Map, Object":ne});r.removeConversion({from:"Object",to:"Map",convert:aa}),K.defaultContext=k,K.realContext=te,K.positiveContext=se;function V(L){return L.transform(function(H,G,Y){return An(H)?V(H.content):H})}var ue={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};K.rules=[m,{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}}},p,{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}}},p,{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 me(L,H){var G={};if(L.s){var Y=L.s.split("->");if(Y.length===2)G.l=Y[0],G.r=Y[1];else throw SyntaxError("Could not parse rule: "+L.s)}else G.l=L.l,G.r=L.r;G.l=V(n(G.l)),G.r=V(n(G.r));for(var ee of["imposeContext","repeat","assuming"])ee in L&&(G[ee]=L[ee]);if(L.evaluate&&(G.evaluate=n(L.evaluate)),R(G.l,H)){var B=!_(G.l,H),j;B&&(j=de());var Q=q(G.l),Z=de();G.expanded={},G.expanded.l=Q([G.l,Z]),I(G.expanded.l,H),O(G.expanded.l,H),G.expanded.r=Q([G.r,Z]),B&&(G.expandedNC1={},G.expandedNC1.l=Q([j,G.l]),G.expandedNC1.r=Q([j,G.r]),G.expandedNC2={},G.expandedNC2.l=Q([j,G.expanded.l]),G.expandedNC2.r=Q([j,G.expanded.r]))}return G}function re(L,H){for(var G=[],Y=0;Y<L.length;Y++){var ee=L[Y],B=void 0,j=typeof ee;switch(j){case"string":ee={s:ee};case"object":B=me(ee,H);break;case"function":B=ee;break;default:throw TypeError("Unsupported type of rule: "+j)}G.push(B)}return G}var ae=0;function de(){return new S("_p"+ae++)}function ne(L,H){var G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ao(),Y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},ee=Y.consoleDebug;H=re(H||K.rules,Y.context);var B=f(L,G);B=V(B);for(var j={},Q=B.toString({parenthesis:"all"});!j[Q];){j[Q]=!0,ae=0;var Z=Q;ee&&console.log("Working on: ",Q);for(var ie=0;ie<H.length;ie++){var oe="";if(typeof H[ie]=="function"?(B=H[ie](B,Y),ee&&(oe=H[ie].name)):(I(B,Y.context),B=le(B,H[ie],Y.context),ee&&(oe="".concat(H[ie].l.toString()," -> ").concat(H[ie].r.toString()))),ee){var ye=B.toString({parenthesis:"all"});ye!==Z&&(console.log("Applying",oe,"produced",ye),Z=ye)}F(B,Y.context)}Q=B.toString({parenthesis:"all"})}return B}function ce(L,H,G){var Y=L;if(L)for(var ee=0;ee<L.length;++ee){var B=le(L[ee],H,G);B!==L[ee]&&(Y===L&&(Y=L.slice()),Y[ee]=B)}return Y}function le(L,H,G){if(H.assuming){for(var Y in H.assuming)for(var ee in H.assuming[Y])if(C(Y,ee,G)!==H.assuming[Y][ee])return L}var B=P(H.imposeContext,G),j=L;if(j instanceof A||j instanceof y){var Q=ce(j.args,H,G);Q!==j.args&&(j=j.clone(),j.args=Q)}else if(j instanceof D){if(j.content){var Z=le(j.content,H,G);Z!==j.content&&(j=new D(Z))}}else if(j instanceof g){var ie=ce(j.items,H,G);ie!==j.items&&(j=new g(ie))}else if(j instanceof x){var oe=j.object;j.object&&(oe=le(j.object,H,G));var ye=j.index;j.index&&(ye=le(j.index,H,G)),(oe!==j.object||ye!==j.index)&&(j=new x(oe,ye))}else if(j instanceof N){var fe=ce(j.dimensions,H,G);fe!==j.dimensions&&(j=new N(fe))}else if(j instanceof E){var De=!1,Ne={};for(var je in j.properties)Ne[je]=le(j.properties[je],H,G),Ne[je]!==j.properties[je]&&(De=!0);De&&(j=new E(Ne))}var Ze=H.r,_e=z(H.l,j,B)[0];if(!_e&&H.expanded&&(Ze=H.expanded.r,_e=z(H.expanded.l,j,B)[0]),!_e&&H.expandedNC1&&(Ze=H.expandedNC1.r,_e=z(H.expandedNC1.l,j,B)[0],_e||(Ze=H.expandedNC2.r,_e=z(H.expandedNC2.l,j,B)[0])),_e){var wt=j.implicit;j=Ze.clone(),wt&&"implicit"in Ze&&(j.implicit=!0),j=j.transform(function(M){return M.isSymbolNode&&Me(_e.placeholders,M.name)?_e.placeholders[M.name].clone():M})}return H.repeat&&j!==L&&(j=le(j,H,G)),j}function he(L,H){var G=[],Y,ee,B=q(L);if(_(L,H))for(var j=0;j<L.args.length;j++)ee=L.args.slice(0),ee.splice(j,1),Y=ee.length===1?ee[0]:B(ee),G.push(B([L.args[j],Y]));else for(var Q=1;Q<L.args.length;Q++){var Z=L.args[0];Q>1&&(Z=B(L.args.slice(0,Q))),ee=L.args.slice(Q),Y=ee.length===1?ee[0]:B(ee),G.push(B([Z,Y]))}return G}function xe(L,H){var G={placeholders:{}};if(!L.placeholders&&!H.placeholders)return G;if(L.placeholders){if(!H.placeholders)return L}else return H;for(var Y in L.placeholders)if(Me(L.placeholders,Y)&&(G.placeholders[Y]=L.placeholders[Y],Me(H.placeholders,Y)&&!J(L.placeholders[Y],H.placeholders[Y])))return null;for(var ee in H.placeholders)Me(H.placeholders,ee)&&(G.placeholders[ee]=H.placeholders[ee]);return G}function $(L,H){var G=[];if(L.length===0||H.length===0)return G;for(var Y,ee=0;ee<L.length;ee++)for(var B=0;B<H.length;B++)Y=xe(L[ee],H[B]),Y&&G.push(Y);return G}function T(L){if(L.length===0)return L;for(var H=L.reduce($),G=[],Y={},ee=0;ee<H.length;ee++){var B=JSON.stringify(H[ee]);Y[B]||(Y[B]=!0,G.push(H[ee]))}return G}function z(L,H,G,Y){var ee=[{placeholders:{}}];if(L instanceof A&&H instanceof A||L instanceof y&&H instanceof y){if(L instanceof A){if(L.op!==H.op||L.fn!==H.fn)return[]}else if(L instanceof y&&L.name!==H.name)return[];if(H.args.length===1&&L.args.length===1||!R(H,G)&&H.args.length===L.args.length||Y){for(var B=[],j=0;j<L.args.length;j++){var Q=z(L.args[j],H.args[j],G);if(Q.length===0)break;B.push(Q)}if(B.length!==L.args.length){if(!_(H,G)||L.args.length===1)return[];if(L.args.length>2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var Z=z(L.args[0],H.args[1],G);if(Z.length===0)return[];var ie=z(L.args[1],H.args[0],G);if(ie.length===0)return[];B=[Z,ie]}ee=T(B)}else if(H.args.length>=2&&L.args.length===2){for(var oe=he(H,G),ye=[],fe=0;fe<oe.length;fe++){var De=z(L,oe[fe],G,!0);ye=ye.concat(De)}return ye}else{if(L.args.length>2)throw Error("Unexpected non-binary associative function: "+L.toString());return[]}}else if(L instanceof S){if(L.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(ue[L.name]){if(L.name!==H.name)return[]}else switch(L.name[1]>="a"&&L.name[1]<="z"?L.name.substring(0,2):L.name[0]){case"n":case"_p":ee[0].placeholders[L.name]=H;break;case"c":case"cl":if(nt(H))ee[0].placeholders[L.name]=H;else return[];break;case"v":if(!nt(H))ee[0].placeholders[L.name]=H;else return[];break;case"vl":if(zt(H))ee[0].placeholders[L.name]=H;else return[];break;case"cd":if(Yh(H))ee[0].placeholders[L.name]=H;else return[];break;case"vd":if(!Yh(H))ee[0].placeholders[L.name]=H;else return[];break;case"ce":if(Qs(H))ee[0].placeholders[L.name]=H;else return[];break;case"ve":if(!Qs(H))ee[0].placeholders[L.name]=H;else return[];break;default:throw new Error("Invalid symbol in rule: "+L.name)}}else if(L instanceof b){if(!s(L.value,H.value))return[]}else return[];return ee}function J(L,H){if(L instanceof b&&H instanceof b){if(!s(L.value,H.value))return!1}else if(L instanceof S&&H instanceof S){if(L.name!==H.name)return!1}else if(L instanceof A&&H instanceof A||L instanceof y&&H instanceof y){if(L instanceof A){if(L.op!==H.op||L.fn!==H.fn)return!1}else if(L instanceof y&&L.name!==H.name)return!1;if(L.args.length!==H.args.length)return!1;for(var G=0;G<L.args.length;G++)if(!J(L.args[G],H.args[G]))return!1}else return!1;return!0}return K}),_9="simplifyConstant",F9=["typed","config","mathWithTransform","matrix","?fraction","?bignumber","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode"],T9=U(_9,F9,e=>{var{typed:t,config:r,mathWithTransform:n,matrix:i,fraction:a,bignumber:o,AccessorNode:u,ArrayNode:c,ConstantNode:l,FunctionNode:s,IndexNode:f,ObjectNode:p,OperatorNode:m,SymbolNode:d}=e,{isCommutative:h,isAssociative:w,allChildren:v,createMakeNodeFunction:x}=Bl({FunctionNode:s,OperatorNode:m,SymbolNode:d}),g=t("simplifyConstant",{Node:I=>E(P(I,{})),"Node, Object":function(I,O){return E(P(I,O))}});function b(I){return bo(I)?I.valueOf():I instanceof Array?I.map(b):ke(I)?i(b(I.valueOf())):I}function y(I,O,F){try{return n[I].apply(null,O)}catch{return O=O.map(b),D(n[I].apply(null,O),F)}}var N=t({Fraction:C,number:function(I){return I<0?S(new l(-I)):new l(I)},BigNumber:function(I){return I<0?S(new l(-I)):new l(I)},Complex:function(I){throw new Error("Cannot convert Complex number to Node")},string:function(I){return new l(I)},Matrix:function(I){return new c(I.valueOf().map(O=>N(O)))}});function E(I){return ft(I)?I:N(I)}function A(I,O){var F=O&&O.exactFractions!==!1;if(F&&isFinite(I)&&a){var q=a(I),k=O&&typeof O.fractionsLimit=="number"?O.fractionsLimit:1/0;if(q.valueOf()===I&&q.n<k&&q.d<k)return q}return I}var D=t({"string, Object":function(I,O){if(r.number==="BigNumber")return o===void 0&&Ml(),o(I);if(r.number==="Fraction")return a===void 0&&Cy(),a(I);var F=parseFloat(I);return A(F,O)},"Fraction, Object":function(I,O){return I},"BigNumber, Object":function(I,O){return I},"number, Object":function(I,O){return A(I,O)},"Complex, Object":function(I,O){return I.im!==0?I:A(I.re,O)},"Matrix, Object":function(I,O){return i(A(I.valueOf()))},"Array, Object":function(I,O){return I.map(A)}});function S(I){return new m("-","unaryMinus",[I])}function C(I){var O,F=I.s*I.n;return F<0?O=new m("-","unaryMinus",[new l(-F)]):O=new l(F),I.d===1?O:new m("/","divide",[O,new l(I.d)])}function _(I,O,F){if(!Da(O))return new u(E(I),E(O));if(Sr(I)||ke(I)){for(var q=Array.from(O.dimensions);q.length>0;)if(nt(q[0])&&typeof q[0].value!="string"){var k=D(q.shift().value,F);Sr(I)?I=I.items[k-1]:(I=I.valueOf()[k-1],I instanceof Array&&(I=i(I)))}else if(q.length>1&&nt(q[1])&&typeof q[1].value!="string"){var te=D(q[1].value,F),se=[],K=Sr(I)?I.items:I.valueOf();for(var V of K)if(Sr(V))se.push(V.items[te-1]);else if(ke(I))se.push(V[te-1]);else break;if(se.length===K.length)Sr(I)?I=new c(se):I=i(se),q.splice(1,1);else break}else break;return q.length===O.dimensions.length?new u(E(I),O):q.length>0?(O=new f(q),new u(E(I),O)):I}if(mu(I)&&O.dimensions.length===1&&nt(O.dimensions[0])){var ue=O.dimensions[0].value;return ue in I.properties?I.properties[ue]:new l}return new u(E(I),O)}function R(I,O,F,q){var k=O.shift(),te=O.reduce((se,K)=>{if(!ft(K)){var V=se.pop();if(ft(V))return[V,K];try{return se.push(y(I,[V,K],q)),se}catch{se.push(V)}}se.push(E(se.pop()));var ue=se.length===1?se[0]:F(se);return[F([ue,E(K)])]},[k]);return te.length===1?te[0]:F([te[0],N(te[1])])}function P(I,O){switch(I.type){case"SymbolNode":return I;case"ConstantNode":switch(typeof I.value){case"number":return D(I.value,O);case"string":return I.value;default:if(!isNaN(I.value))return D(I.value,O)}return I;case"FunctionNode":if(n[I.name]&&n[I.name].rawArgs)return I;{var F=["add","multiply"];if(!F.includes(I.name)){var q=I.args.map(le=>P(le,O));if(!q.some(ft))try{return y(I.name,q,O)}catch{}if(I.name==="size"&&q.length===1&&Sr(q[0])){for(var k=[],te=q[0];Sr(te);)k.push(te.items.length),te=te.items[0];return i(k)}return new s(I.name,q.map(E))}}case"OperatorNode":{var se=I.fn.toString(),K,V,ue=x(I);if(Ct(I)&&I.isUnary())K=[P(I.args[0],O)],ft(K[0])?V=ue(K):V=y(se,K,O);else if(w(I,O.context))if(K=v(I,O.context),K=K.map(le=>P(le,O)),h(se,O.context)){for(var me=[],re=[],ae=0;ae<K.length;ae++)ft(K[ae])?re.push(K[ae]):me.push(K[ae]);me.length>1?(V=R(se,me,ue,O),re.unshift(V),V=R(se,re,ue,O)):V=R(se,K,ue,O)}else V=R(se,K,ue,O);else K=I.args.map(le=>P(le,O)),V=R(se,K,ue,O);return V}case"ParenthesisNode":return P(I.content,O);case"AccessorNode":return _(P(I.object,O),P(I.index,O),O);case"ArrayNode":{var de=I.items.map(le=>P(le,O));return de.some(ft)?new c(de.map(E)):i(de)}case"IndexNode":return new f(I.dimensions.map(le=>g(le,O)));case"ObjectNode":{var ne={};for(var ce in I.properties)ne[ce]=g(I.properties[ce],O);return new p(ne)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(I.type))}}return g}),t0="simplifyCore",O9=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],B9=U(t0,O9,e=>{var{typed:t,parse:r,equal:n,isZero:i,add:a,subtract:o,multiply:u,divide:c,pow:l,AccessorNode:s,ArrayNode:f,ConstantNode:p,FunctionNode:m,IndexNode:d,ObjectNode:h,OperatorNode:w,ParenthesisNode:v,SymbolNode:x}=e,g=new p(0),b=new p(1),y=new p(!0),N=new p(!1);function E(C){return Ct(C)&&["and","not","or"].includes(C.op)}var{hasProperty:A,isCommutative:D}=Bl({FunctionNode:m,OperatorNode:w,SymbolNode:x});function S(C){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},R=_?_.context:void 0;if(A(C,"trivial",R)){if(Zn(C)&&C.args.length===1)return S(C.args[0],_);var P=!1,I=0;if(C.forEach(re=>{++I,I===1&&(P=S(re,_))}),I===1)return P}var O=C;if(Zn(O)){var F=R4(O.name);if(F){if(O.args.length>2&&A(O,"associative",R))for(;O.args.length>2;){var q=O.args.pop(),k=O.args.pop();O.args.push(new w(F,O.name,[q,k]))}O=new w(F,O.name,O.args)}else return new m(S(O.fn),O.args.map(re=>S(re,_)))}if(Ct(O)&&O.isUnary()){var te=S(O.args[0],_);if(O.op==="~"&&Ct(te)&&te.isUnary()&&te.op==="~"||O.op==="not"&&Ct(te)&&te.isUnary()&&te.op==="not"&&E(te.args[0]))return te.args[0];var se=!0;if(O.op==="-"&&Ct(te)&&(te.isBinary()&&te.fn==="subtract"&&(O=new w("-","subtract",[te.args[1],te.args[0]]),se=!1),te.isUnary()&&te.op==="-"))return te.args[0];if(se)return new w(O.op,O.fn,[te])}if(Ct(O)&&O.isBinary()){var K=S(O.args[0],_),V=S(O.args[1],_);if(O.op==="+"){if(nt(K)&&i(K.value))return V;if(nt(V)&&i(V.value))return K;Ct(V)&&V.isUnary()&&V.op==="-"&&(V=V.args[0],O=new w("-","subtract",[K,V]))}if(O.op==="-")return Ct(V)&&V.isUnary()&&V.op==="-"?S(new w("+","add",[K,V.args[0]]),_):nt(K)&&i(K.value)?S(new w("-","unaryMinus",[V])):nt(V)&&i(V.value)?K:new w(O.op,O.fn,[K,V]);if(O.op==="*"){if(nt(K)){if(i(K.value))return g;if(n(K.value,1))return V}if(nt(V)){if(i(V.value))return g;if(n(V.value,1))return K;if(D(O,R))return new w(O.op,O.fn,[V,K],O.implicit)}return new w(O.op,O.fn,[K,V],O.implicit)}if(O.op==="/")return nt(K)&&i(K.value)?g:nt(V)&&n(V.value,1)?K:new w(O.op,O.fn,[K,V]);if(O.op==="^"&&nt(V)){if(i(V.value))return b;if(n(V.value,1))return K}if(O.op==="and"){if(nt(K))if(K.value){if(E(V))return V;if(nt(V))return V.value?y:N}else return N;if(nt(V))if(V.value){if(E(K))return K}else return N}if(O.op==="or"){if(nt(K)){if(K.value)return y;if(E(V))return V}if(nt(V)){if(V.value)return y;if(E(K))return K}}return new w(O.op,O.fn,[K,V])}if(Ct(O))return new w(O.op,O.fn,O.args.map(re=>S(re,_)));if(Sr(O))return new f(O.items.map(re=>S(re,_)));if(Ti(O))return new s(S(O.object,_),S(O.index,_));if(Da(O))return new d(O.dimensions.map(re=>S(re,_)));if(mu(O)){var ue={};for(var me in O.properties)ue[me]=S(O.properties[me],_);return new h(ue)}return O}return t(t0,{Node:S,"Node,Object":S})}),k9="resolve",I9=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],R9=U(k9,I9,e=>{var{typed:t,parse:r,ConstantNode:n,FunctionNode:i,OperatorNode:a,ParenthesisNode:o}=e;function u(c,l){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!l)return c;if(zt(c)){if(s.has(c.name)){var f=Array.from(s).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(f,"}"))}var p=l.get(c.name);if(ft(p)){var m=new Set(s);return m.add(c.name),u(p,l,m)}else return typeof p=="number"?r(String(p)):p!==void 0?new n(p):c}else if(Ct(c)){var d=c.args.map(function(w){return u(w,l,s)});return new a(c.op,c.fn,d,c.implicit)}else{if(An(c))return new o(u(c.content,l,s));if(Zn(c)){var h=c.args.map(function(w){return u(w,l,s)});return new i(c.name,h)}}return c.map(w=>u(w,l,s))}return t("resolve",{Node:u,"Node, Map | null | undefined":u,"Node, Object":(c,l)=>u(c,aa(l)),"Array | Matrix":t.referToSelf(c=>l=>l.map(s=>c(s))),"Array | Matrix, null | undefined":t.referToSelf(c=>l=>l.map(s=>c(s))),"Array, Object":t.referTo("Array,Map",c=>(l,s)=>c(l,aa(s))),"Matrix, Object":t.referTo("Matrix,Map",c=>(l,s)=>c(l,aa(s))),"Array | Matrix, Map":t.referToSelf(c=>(l,s)=>l.map(f=>c(f,s)))})}),r0="symbolicEqual",q9=["parse","simplify","typed","OperatorNode"],z9=U(r0,q9,e=>{var{parse:t,simplify:r,typed:n,OperatorNode:i}=e;function a(o,u){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=new i("-","subtract",[o,u]),s=r(l,{},c);return nt(s)&&!s.value}return n(r0,{"Node, Node":a,"Node, Node, Object":a})}),n0="derivative",j9=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],L9=U(n0,j9,e=>{var{typed:t,config:r,parse:n,simplify:i,equal:a,isZero:o,numeric:u,ConstantNode:c,FunctionNode:l,OperatorNode:s,ParenthesisNode:f,SymbolNode:p}=e;function m(g,b){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},N={};w(N,g,b.name);var E=v(g,N);return y.simplify?i(E):E}t.addConversion({from:"identifier",to:"SymbolNode",convert:n});var d=t(n0,{"Node, SymbolNode":m,"Node, SymbolNode, Object":m});t.removeConversion({from:"identifier",to:"SymbolNode",convert:n}),d._simplify=!0,d.toTex=function(g){return h.apply(null,g.args)};var h=t("_derivTex",{"Node, SymbolNode":function(g,b){return nt(g)&&dt(g.value)==="string"?h(n(g.value).toString(),b.toString(),1):h(g.toTex(),b.toString(),1)},"Node, ConstantNode":function(g,b){if(dt(b.value)==="string")return h(g,n(b.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(g,b,y){return h(g.toString(),b.name,y.value)},"string, string, number":function(g,b,y){var N;return y===1?N="{d\\over d"+b+"}":N="{d^{"+y+"}\\over d"+b+"^{"+y+"}}",N+"\\left[".concat(g,"\\right]")}}),w=t("constTag",{"Object, ConstantNode, string":function(g,b){return g[b]=!0,!0},"Object, SymbolNode, string":function(g,b,y){return b.name!==y?(g[b]=!0,!0):!1},"Object, ParenthesisNode, string":function(g,b,y){return w(g,b.content,y)},"Object, FunctionAssignmentNode, string":function(g,b,y){return b.params.includes(y)?w(g,b.expr,y):(g[b]=!0,!0)},"Object, FunctionNode | OperatorNode, string":function(g,b,y){if(b.args.length>0){for(var N=w(g,b.args[0],y),E=1;E<b.args.length;++E)N=w(g,b.args[E],y)&&N;if(N)return g[b]=!0,!0}return!1}}),v=t("_derivative",{"ConstantNode, Object":function(g){return x(0)},"SymbolNode, Object":function(g,b){return b[g]!==void 0?x(0):x(1)},"ParenthesisNode, Object":function(g,b){return new f(v(g.content,b))},"FunctionAssignmentNode, Object":function(g,b){return b[g]!==void 0?x(0):v(g.expr,b)},"FunctionNode, Object":function(g,b){if(b[g]!==void 0)return x(0);var y=g.args[0],N,E=!1,A=!1,D;switch(g.name){case"cbrt":E=!0,D=new s("*","multiply",[x(3),new s("^","pow",[y,new s("/","divide",[x(2),x(3)])])]);break;case"sqrt":case"nthRoot":if(g.args.length===1)E=!0,D=new s("*","multiply",[x(2),new l("sqrt",[y])]);else if(g.args.length===2)return N=new s("/","divide",[x(1),g.args[1]]),b[N]=b[g.args[1]],v(new s("^","pow",[y,N]),b);break;case"log10":N=x(10);case"log":if(!N&&g.args.length===1)D=y.clone(),E=!0;else if(g.args.length===1&&N||g.args.length===2&&b[g.args[1]]!==void 0)D=new s("*","multiply",[y.clone(),new l("log",[N||g.args[1]])]),E=!0;else if(g.args.length===2)return v(new s("/","divide",[new l("log",[y]),new l("log",[g.args[1]])]),b);break;case"pow":if(g.args.length===2)return b[N]=b[g.args[1]],v(new s("^","pow",[y,g.args[1]]),b);break;case"exp":D=new l("exp",[y.clone()]);break;case"sin":D=new l("cos",[y.clone()]);break;case"cos":D=new s("-","unaryMinus",[new l("sin",[y.clone()])]);break;case"tan":D=new s("^","pow",[new l("sec",[y.clone()]),x(2)]);break;case"sec":D=new s("*","multiply",[g,new l("tan",[y.clone()])]);break;case"csc":A=!0,D=new s("*","multiply",[g,new l("cot",[y.clone()])]);break;case"cot":A=!0,D=new s("^","pow",[new l("csc",[y.clone()]),x(2)]);break;case"asin":E=!0,D=new l("sqrt",[new s("-","subtract",[x(1),new s("^","pow",[y.clone(),x(2)])])]);break;case"acos":E=!0,A=!0,D=new l("sqrt",[new s("-","subtract",[x(1),new s("^","pow",[y.clone(),x(2)])])]);break;case"atan":E=!0,D=new s("+","add",[new s("^","pow",[y.clone(),x(2)]),x(1)]);break;case"asec":E=!0,D=new s("*","multiply",[new l("abs",[y.clone()]),new l("sqrt",[new s("-","subtract",[new s("^","pow",[y.clone(),x(2)]),x(1)])])]);break;case"acsc":E=!0,A=!0,D=new s("*","multiply",[new l("abs",[y.clone()]),new l("sqrt",[new s("-","subtract",[new s("^","pow",[y.clone(),x(2)]),x(1)])])]);break;case"acot":E=!0,A=!0,D=new s("+","add",[new s("^","pow",[y.clone(),x(2)]),x(1)]);break;case"sinh":D=new l("cosh",[y.clone()]);break;case"cosh":D=new l("sinh",[y.clone()]);break;case"tanh":D=new s("^","pow",[new l("sech",[y.clone()]),x(2)]);break;case"sech":A=!0,D=new s("*","multiply",[g,new l("tanh",[y.clone()])]);break;case"csch":A=!0,D=new s("*","multiply",[g,new l("coth",[y.clone()])]);break;case"coth":A=!0,D=new s("^","pow",[new l("csch",[y.clone()]),x(2)]);break;case"asinh":E=!0,D=new l("sqrt",[new s("+","add",[new s("^","pow",[y.clone(),x(2)]),x(1)])]);break;case"acosh":E=!0,D=new l("sqrt",[new s("-","subtract",[new s("^","pow",[y.clone(),x(2)]),x(1)])]);break;case"atanh":E=!0,D=new s("-","subtract",[x(1),new s("^","pow",[y.clone(),x(2)])]);break;case"asech":E=!0,A=!0,D=new s("*","multiply",[y.clone(),new l("sqrt",[new s("-","subtract",[x(1),new s("^","pow",[y.clone(),x(2)])])])]);break;case"acsch":E=!0,A=!0,D=new s("*","multiply",[new l("abs",[y.clone()]),new l("sqrt",[new s("+","add",[new s("^","pow",[y.clone(),x(2)]),x(1)])])]);break;case"acoth":E=!0,A=!0,D=new s("-","subtract",[x(1),new s("^","pow",[y.clone(),x(2)])]);break;case"abs":D=new s("/","divide",[new l(new p("abs"),[y.clone()]),y.clone()]);break;case"gamma":default:throw new Error('Cannot process function "'+g.name+'" in derivative: the function is not supported, undefined, or the number of arguments passed to it are not supported')}var S,C;E?(S="/",C="divide"):(S="*",C="multiply");var _=v(y,b);return A&&(_=new s("-","unaryMinus",[_])),new s(S,C,[_,D])},"OperatorNode, Object":function(g,b){if(b[g]!==void 0)return x(0);if(g.op==="+")return new s(g.op,g.fn,g.args.map(function(P){return v(P,b)}));if(g.op==="-"){if(g.isUnary())return new s(g.op,g.fn,[v(g.args[0],b)]);if(g.isBinary())return new s(g.op,g.fn,[v(g.args[0],b),v(g.args[1],b)])}if(g.op==="*"){var y=g.args.filter(function(P){return b[P]!==void 0});if(y.length>0){var N=g.args.filter(function(P){return b[P]===void 0}),E=N.length===1?N[0]:new s("*","multiply",N),A=y.concat(v(E,b));return new s("*","multiply",A)}return new s("+","add",g.args.map(function(P){return new s("*","multiply",g.args.map(function(I){return I===P?v(I,b):I.clone()}))}))}if(g.op==="/"&&g.isBinary()){var D=g.args[0],S=g.args[1];return b[S]!==void 0?new s("/","divide",[v(D,b),S]):b[D]!==void 0?new s("*","multiply",[new s("-","unaryMinus",[D]),new s("/","divide",[v(S,b),new s("^","pow",[S.clone(),x(2)])])]):new s("/","divide",[new s("-","subtract",[new s("*","multiply",[v(D,b),S.clone()]),new s("*","multiply",[D.clone(),v(S,b)])]),new s("^","pow",[S.clone(),x(2)])])}if(g.op==="^"&&g.isBinary()){var C=g.args[0],_=g.args[1];if(b[C]!==void 0)return nt(C)&&(o(C.value)||a(C.value,1))?x(0):new s("*","multiply",[g,new s("*","multiply",[new l("log",[C.clone()]),v(_.clone(),b)])]);if(b[_]!==void 0){if(nt(_)){if(o(_.value))return x(0);if(a(_.value,1))return v(C,b)}var R=new s("^","pow",[C.clone(),new s("-","subtract",[_,x(1)])]);return new s("*","multiply",[_.clone(),new s("*","multiply",[v(C,b),R])])}return new s("*","multiply",[new s("^","pow",[C.clone(),_.clone()]),new s("+","add",[new s("*","multiply",[v(C,b),new s("/","divide",[_.clone(),C.clone()])]),new s("*","multiply",[v(_,b),new l("log",[C.clone()])])])])}throw new Error('Cannot process operator "'+g.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function x(g,b){return new c(u(g,r.number))}return d}),i0="rationalize",P9=["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"],V9=U(i0,P9,e=>{var{config:t,typed:r,equal:n,isZero:i,add:a,subtract:o,multiply:u,divide:c,pow:l,parse:s,simplifyConstant:f,simplifyCore:p,simplify:m,fraction:d,bignumber:h,mathWithTransform:w,matrix:v,AccessorNode:x,ArrayNode:g,ConstantNode:b,FunctionNode:y,IndexNode:N,ObjectNode:E,OperatorNode:A,SymbolNode:D,ParenthesisNode:S}=e;function C(O){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,k=R(),te=_(O,F,!0,k.firstRules),se=te.variables.length,K={exactFractions:!1},V={exactFractions:!0};if(O=te.expression,se>=1){O=P(O);var ue,me,re=!0,ae=!1;O=m(O,k.firstRules,{},K);for(var de;me=re?k.distrDivRules:k.sucDivRules,O=m(O,me,{},V),re=!re,de=O.toString(),de!==ue;)ae=!0,ue=de;ae&&(O=m(O,k.firstRulesAgain,{},K)),O=m(O,k.finalRules,{},K)}var ne=[],ce={};return O.type==="OperatorNode"&&O.isBinary()&&O.op==="/"?(se===1&&(O.args[0]=I(O.args[0],ne),O.args[1]=I(O.args[1])),q&&(ce.numerator=O.args[0],ce.denominator=O.args[1])):(se===1&&(O=I(O,ne)),q&&(ce.numerator=O,ce.denominator=null)),q?(ce.coefficients=ne,ce.variables=te.variables,ce.expression=O,ce):O}return r(i0,{Node:C,"Node, boolean":(O,F)=>C(O,{},F),"Node, Object":C,"Node, Object, boolean":C});function _(O,F,q,k){var te=[],se=m(O,k,F,{exactFractions:!1});q=!!q;var K="+-*"+(q?"/":"");ue(se);var V={};return V.expression=se,V.variables=te,V;function ue(me){var re=me.type;if(re==="FunctionNode")throw new Error("There is an unsolved function call");if(re==="OperatorNode")if(me.op==="^"){if(me.args[1].type!=="ConstantNode"||!Fe(parseFloat(me.args[1].value)))throw new Error("There is a non-integer exponent");ue(me.args[0])}else{if(!K.includes(me.op))throw new Error("Operator "+me.op+" invalid in polynomial expression");for(var ae=0;ae<me.args.length;ae++)ue(me.args[ae])}else if(re==="SymbolNode"){var de=me.name,ne=te.indexOf(de);ne===-1&&te.push(de)}else if(re==="ParenthesisNode")ue(me.content);else if(re!=="ConstantNode")throw new Error("type "+re+" is not allowed in polynomial expression")}}function R(){var O=[p,{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"}],F=[{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)"}],k=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],te={};return te.firstRules=O.concat(F,k),te.distrDivRules=q,te.sucDivRules=k,te.firstRulesAgain=O.concat(F),te.finalRules=[p,{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))"}],te}function P(O,F,q){var k=O.type,te=arguments.length>1;if(k==="OperatorNode"&&O.isBinary()){var se=!1,K;if(O.op==="^"&&(O.args[0].type==="ParenthesisNode"||O.args[0].type==="OperatorNode")&&O.args[1].type==="ConstantNode"&&(K=parseFloat(O.args[1].value),se=K>=2&&Fe(K)),se){if(K>2){var V=O.args[0],ue=new A("^","pow",[O.args[0].cloneDeep(),new b(K-1)]);O=new A("*","multiply",[V,ue])}else O=new A("*","multiply",[O.args[0],O.args[0].cloneDeep()]);te&&(q==="content"?F.content=O:F.args[q]=O)}}if(k==="ParenthesisNode")P(O.content,O,"content");else if(k!=="ConstantNode"&&k!=="SymbolNode")for(var me=0;me<O.args.length;me++)P(O.args[me],O,me);if(!te)return O}function I(O,F){F===void 0&&(F=[]),F[0]=0;var q={};q.cte=1,q.oper="+",q.fire="";var k=0,te="";de(O,null,q),k=F.length-1;for(var se=!0,K,V=k;V>=0;V--)if(F[V]!==0){var ue=new b(se?F[V]:Math.abs(F[V])),me=F[V]<0?"-":"+";if(V>0){var re=new D(te);if(V>1){var ae=new b(V);re=new A("^","pow",[re,ae])}F[V]===-1&&se?ue=new A("-","unaryMinus",[re]):Math.abs(F[V])===1?ue=re:ue=new A("*","multiply",[ue,re])}se?K=ue:me==="+"?K=new A("+","add",[K,ue]):K=new A("-","subtract",[K,ue]),se=!1}if(se)return new b(0);return K;function de(ne,ce,le){var he=ne.type;if(he==="FunctionNode")throw new Error("There is an unsolved function call");if(he==="OperatorNode"){if(!"+-*^".includes(ne.op))throw new Error("Operator "+ne.op+" invalid");if(ce!==null){if((ne.fn==="unaryMinus"||ne.fn==="pow")&&ce.fn!=="add"&&ce.fn!=="subtract"&&ce.fn!=="multiply")throw new Error("Invalid "+ne.op+" placing");if((ne.fn==="subtract"||ne.fn==="add"||ne.fn==="multiply")&&ce.fn!=="add"&&ce.fn!=="subtract")throw new Error("Invalid "+ne.op+" placing");if((ne.fn==="subtract"||ne.fn==="add"||ne.fn==="unaryMinus")&&le.noFil!==0)throw new Error("Invalid "+ne.op+" placing")}(ne.op==="^"||ne.op==="*")&&(le.fire=ne.op);for(var xe=0;xe<ne.args.length;xe++)ne.fn==="unaryMinus"&&(le.oper="-"),(ne.op==="+"||ne.fn==="subtract")&&(le.fire="",le.cte=1,le.oper=xe===0?"+":ne.op),le.noFil=xe,de(ne.args[xe],ne,le)}else if(he==="SymbolNode"){if(ne.name!==te&&te!=="")throw new Error("There is more than one variable");if(te=ne.name,ce===null){F[1]=1;return}if(ce.op==="^"&&le.noFil!==0)throw new Error("In power the variable should be the first parameter");if(ce.op==="*"&&le.noFil!==1)throw new Error("In multiply the variable should be the second parameter");(le.fire===""||le.fire==="*")&&(k<1&&(F[1]=0),F[1]+=le.cte*(le.oper==="+"?1:-1),k=Math.max(1,k))}else if(he==="ConstantNode"){var $=parseFloat(ne.value);if(ce===null){F[0]=$;return}if(ce.op==="^"){if(le.noFil!==1)throw new Error("Constant cannot be powered");if(!Fe($)||$<=0)throw new Error("Non-integer exponent is not allowed");for(var T=k+1;T<$;T++)F[T]=0;$>k&&(F[$]=0),F[$]+=le.cte*(le.oper==="+"?1:-1),k=Math.max($,k);return}le.cte=$,le.fire===""&&(F[0]+=le.cte*(le.oper==="+"?1:-1))}else throw new Error("Type "+he+" is not allowed")}}}),a0="zpk2tf",U9=["typed","add","multiply","Complex","number"],$9=U(a0,U9,e=>{var{typed:t,add:r,multiply:n,Complex:i,number:a}=e;return t(a0,{"Array,Array,number":function(c,l,s){return o(c,l,s)},"Array,Array":function(c,l){return o(c,l,1)},"Matrix,Matrix,number":function(c,l,s){return o(c.valueOf(),l.valueOf(),s)},"Matrix,Matrix":function(c,l){return o(c.valueOf(),l.valueOf(),1)}});function o(c,l,s){c.some(x=>x.type==="BigNumber")&&(c=c.map(x=>a(x))),l.some(x=>x.type==="BigNumber")&&(l=l.map(x=>a(x)));for(var f=[i(1,0)],p=[i(1,0)],m=0;m<c.length;m++){var d=c[m];typeof d=="number"&&(d=i(d,0)),f=u(f,[i(1,0),i(-d.re,-d.im)])}for(var h=0;h<l.length;h++){var w=l[h];typeof w=="number"&&(w=i(w,0)),p=u(p,[i(1,0),i(-w.re,-w.im)])}for(var v=0;v<f.length;v++)f[v]=n(f[v],s);return[f,p]}function u(c,l){for(var s=[],f=0;f<c.length+l.length-1;f++){s[f]=i(0,0);for(var p=0;p<c.length;p++)f-p>=0&&f-p<l.length&&(s[f]=r(s[f],n(c[p],l[f-p])))}return s}}),o0="freqz",H9=["typed","add","multiply","Complex","divide","matrix"],J9=U(o0,H9,e=>{var{typed:t,add:r,multiply:n,Complex:i,divide:a,matrix:o}=e;return t(o0,{"Array, Array":function(l,s){var f=c(512);return u(l,s,f)},"Array, Array, Array":function(l,s,f){return u(l,s,f)},"Array, Array, number":function(l,s,f){if(f<0)throw new Error("w must be a positive number");var p=c(f);return u(l,s,p)},"Matrix, Matrix":function(l,s){var f=c(512),{w:p,h:m}=u(l.valueOf(),s.valueOf(),f);return{w:o(p),h:o(m)}},"Matrix, Matrix, Matrix":function(l,s,f){var{h:p}=u(l.valueOf(),s.valueOf(),f.valueOf());return{h:o(p),w:o(f)}},"Matrix, Matrix, number":function(l,s,f){if(f<0)throw new Error("w must be a positive number");var p=c(f),{h:m}=u(l.valueOf(),s.valueOf(),p);return{h:o(m),w:o(p)}}});function u(l,s,f){for(var p=[],m=[],d=0;d<f.length;d++){for(var h=i(0,0),w=i(0,0),v=0;v<l.length;v++)h=r(h,n(l[v],i(Math.cos(-v*f[d]),Math.sin(-v*f[d]))));for(var x=0;x<s.length;x++)w=r(w,n(s[x],i(Math.cos(-x*f[d]),Math.sin(-x*f[d]))));p.push(h),m.push(w)}for(var g=[],b=0;b<p.length;b++)g.push(a(p[b],m[b]));return{h:g,w:f}}function c(l){for(var s=[],f=0;f<l;f++)s.push(f/l*Math.PI);return s}}),G9="reviver",W9=["classes"],K9=U(G9,W9,e=>{var{classes:t}=e;return function(r,n){var i=t[n&&n.mathjs];return i&&typeof i.fromJSON=="function"?i.fromJSON(n):n}}),Q9="replacer",Z9=[],X9=U(Q9,Z9,()=>function(e,t){return typeof t=="number"&&(!isFinite(t)||isNaN(t))?{mathjs:"number",value:String(t)}:t}),Y9="12.4.3",e7=U("true",[],()=>!0),t7=U("false",[],()=>!1),r7=U("null",[],()=>null),n7=Nr("Infinity",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1/0):1/0}),i7=Nr("NaN",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(NaN):NaN}),a7=Nr("pi",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?Tl(r):vD}),o7=Nr("tau",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?L_(r):yD}),s7=Nr("e",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?z_(r):bD}),u7=Nr("phi",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?j_(r):xD}),c7=Nr("LN2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(2).ln():Math.LN2}),l7=Nr("LN10",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(10).ln():Math.LN10}),f7=Nr("LOG2E",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1).div(new r(2).ln()):Math.LOG2E}),p7=Nr("LOG10E",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1).div(new r(10).ln()):Math.LOG10E}),m7=Nr("SQRT1_2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r("0.5").sqrt():Math.SQRT1_2}),d7=Nr("SQRT2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(2).sqrt():Math.SQRT2}),h7=Nr("i",["Complex"],e=>{var{Complex:t}=e;return t.I}),g7=U("version",[],()=>Y9);function Nr(e,t,r){return U(e,t,r,{recreateOnConfigChange:!0})}var v7=Pe("speedOfLight","299792458","m s^-1"),y7=Pe("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),b7=Pe("planckConstant","6.62607015e-34","J s"),x7=Pe("reducedPlanckConstant","1.0545718176461565e-34","J s"),w7=Pe("magneticConstant","1.25663706212e-6","N A^-2"),N7=Pe("electricConstant","8.8541878128e-12","F m^-1"),D7=Pe("vacuumImpedance","376.730313667","ohm"),E7=Pe("coulomb","8.987551792261171e9","N m^2 C^-2"),A7=Pe("elementaryCharge","1.602176634e-19","C"),S7=Pe("bohrMagneton","9.2740100783e-24","J T^-1"),C7=Pe("conductanceQuantum","7.748091729863649e-5","S"),M7=Pe("inverseConductanceQuantum","12906.403729652257","ohm"),_7=Pe("magneticFluxQuantum","2.0678338484619295e-15","Wb"),F7=Pe("nuclearMagneton","5.0507837461e-27","J T^-1"),T7=Pe("klitzing","25812.807459304513","ohm"),O7=Pe("bohrRadius","5.29177210903e-11","m"),B7=Pe("classicalElectronRadius","2.8179403262e-15","m"),k7=Pe("electronMass","9.1093837015e-31","kg"),I7=Pe("fermiCoupling","1.1663787e-5","GeV^-2"),R7=Au("fineStructure",.0072973525693),q7=Pe("hartreeEnergy","4.3597447222071e-18","J"),z7=Pe("protonMass","1.67262192369e-27","kg"),j7=Pe("deuteronMass","3.3435830926e-27","kg"),L7=Pe("neutronMass","1.6749271613e-27","kg"),P7=Pe("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),V7=Pe("rydberg","10973731.568160","m^-1"),U7=Pe("thomsonCrossSection","6.6524587321e-29","m^2"),$7=Au("weakMixingAngle",.2229),H7=Au("efimovFactor",22.7),J7=Pe("atomicMass","1.66053906660e-27","kg"),G7=Pe("avogadro","6.02214076e23","mol^-1"),W7=Pe("boltzmann","1.380649e-23","J K^-1"),K7=Pe("faraday","96485.33212331001","C mol^-1"),Q7=Pe("firstRadiation","3.7417718521927573e-16","W m^2"),Z7=Pe("loschmidt","2.686780111798444e25","m^-3"),X7=Pe("gasConstant","8.31446261815324","J K^-1 mol^-1"),Y7=Pe("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),ek=Pe("molarVolume","0.022413969545014137","m^3 mol^-1"),tk=Au("sackurTetrode",-1.16487052358),rk=Pe("secondRadiation","0.014387768775039337","m K"),nk=Pe("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),ik=Pe("wienDisplacement","2.897771955e-3","m K"),ak=Pe("molarMass","0.99999999965e-3","kg mol^-1"),ok=Pe("molarMassC12","11.9999999958e-3","kg mol^-1"),sk=Pe("gravity","9.80665","m s^-2"),uk=Pe("planckLength","1.616255e-35","m"),ck=Pe("planckMass","2.176435e-8","kg"),lk=Pe("planckTime","5.391245e-44","s"),fk=Pe("planckCharge","1.87554603778e-18","C"),pk=Pe("planckTemperature","1.416785e+32","K");function Pe(e,t,r){var n=["config","Unit","BigNumber"];return U(e,n,i=>{var{config:a,Unit:o,BigNumber:u}=i,c=a.number==="BigNumber"?new u(t):parseFloat(t),l=new o(c,r);return l.fixPrefix=!0,l})}function Au(e,t){var r=["config","BigNumber"];return U(e,r,n=>{var{config:i,BigNumber:a}=n;return i.number==="BigNumber"?new a(t):t})}var mk="apply",dk=["typed","isInteger"],hk=U(mk,dk,e=>{var{typed:t,isInteger:r}=e,n=Al({typed:t,isInteger:r});return t("apply",{"...any":function(i){var a=i[1];Ue(a)?i[1]=a-1:$e(a)&&(i[1]=a.minus(1));try{return n.apply(null,i)}catch(o){throw lr(o)}}})},{isTransformFunction:!0}),gk="column",vk=["typed","Index","matrix","range"],yk=U(gk,vk,e=>{var{typed:t,Index:r,matrix:n,range:i}=e,a=Ay({typed:t,Index:r,matrix:n,range:i});return t("column",{"...any":function(o){var u=o.length-1,c=o[u];Ue(c)&&(o[u]=c-1);try{return a.apply(null,o)}catch(l){throw lr(l)}}})},{isTransformFunction:!0});function kl(e,t,r){var n=e.filter(function(c){return zt(c)&&!(c.name in t)&&!r.has(c.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');var i=n.name,a=new Map,o=new Kg(r,a,new Set([i])),u=e.compile();return function(c){return a.set(i,c),u.evaluate(o)}}var bk="filter",xk=["typed"],wk=U(bk,xk,e=>{var{typed:t}=e;function r(i,a,o){var u,c;return i[0]&&(u=i[0].compile().evaluate(o)),i[1]&&(zt(i[1])||xo(i[1])?c=i[1].compile().evaluate(o):c=kl(i[1],a,o)),n(u,c)}r.rawArgs=!0;var n=t("filter",{"Array, function":s0,"Matrix, function":function(i,a){return i.create(s0(i.toArray(),a))},"Array, RegExp":Is,"Matrix, RegExp":function(i,a){return i.create(Is(i.toArray(),a))}});return r},{isTransformFunction:!0});function s0(e,t){return yv(e,function(r,n,i){return Ma(t,r,[n+1],i,"filter")})}var Nk="forEach",Dk=["typed"],Ek=U(Nk,Dk,e=>{var{typed:t}=e;function r(i,a,o){var u,c;return i[0]&&(u=i[0].compile().evaluate(o)),i[1]&&(zt(i[1])||xo(i[1])?c=i[1].compile().evaluate(o):c=kl(i[1],a,o)),n(u,c)}r.rawArgs=!0;var n=t("forEach",{"Array | Matrix, function":function(i,a){var o=function u(c,l){if(Array.isArray(c))bu(c,function(s,f){u(s,l.concat(f+1))});else return Ma(a,c,l,i,"forEach")};o(i.valueOf(),[])}});return r},{isTransformFunction:!0}),Ak="index",Sk=["Index","getMatrixDataType"],Ck=U(Ak,Sk,e=>{var{Index:t,getMatrixDataType:r}=e;return function(){for(var n=[],i=0,a=arguments.length;i<a;i++){var o=arguments[i];if(bl(o))o.start--,o.end-=o.step>0?0:2;else if(o&&o.isSet===!0)o=o.map(function(c){return c-1});else if(st(o)||ke(o))r(o)!=="boolean"&&(o=o.map(function(c){return c-1}));else if(Ue(o))o--;else if($e(o))o=o.toNumber()-1;else if(typeof o!="string")throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");n[i]=o}var u=new t;return t.apply(u,n),u}},{isTransformFunction:!0}),Mk="map",_k=["typed"],Fk=U(Mk,_k,e=>{var{typed:t}=e;function r(i,a,o){var u,c;return i[0]&&(u=i[0].compile().evaluate(o)),i[1]&&(zt(i[1])||xo(i[1])?c=i[1].compile().evaluate(o):c=kl(i[1],a,o)),n(u,c)}r.rawArgs=!0;var n=t("map",{"Array, function":function(i,a){return u0(i,a,i)},"Matrix, function":function(i,a){return i.create(u0(i.valueOf(),a,i))}});return r},{isTransformFunction:!0});function u0(e,t,r){function n(i,a){return Array.isArray(i)?Nn(i,function(o,u){return n(o,a.concat(u+1))}):Ma(t,i,a,r,"map")}return n(e,[])}function ai(e){if(e.length===2&&Fr(e[0])){e=e.slice();var t=e[1];Ue(t)?e[1]=t-1:$e(t)&&(e[1]=t.minus(1))}return e}var Tk="max",Ok=["typed","config","numeric","larger"],Bk=U(Tk,Ok,e=>{var{typed:t,config:r,numeric:n,larger:i}=e,a=Iy({typed:t,config:r,numeric:n,larger:i});return t("max",{"...any":function(o){o=ai(o);try{return a.apply(null,o)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),kk="mean",Ik=["typed","add","divide"],Rk=U(kk,Ik,e=>{var{typed:t,add:r,divide:n}=e,i=$y({typed:t,add:r,divide:n});return t("mean",{"...any":function(a){a=ai(a);try{return i.apply(null,a)}catch(o){throw lr(o)}}})},{isTransformFunction:!0}),qk="min",zk=["typed","config","numeric","smaller"],jk=U(qk,zk,e=>{var{typed:t,config:r,numeric:n,smaller:i}=e,a=Ry({typed:t,config:r,numeric:n,smaller:i});return t("min",{"...any":function(o){o=ai(o);try{return a.apply(null,o)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),Lk="range",Pk=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],Vk=U(Lk,Pk,e=>{var{typed:t,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:u,largerEq:c,add:l,isPositive:s}=e,f=_y({typed:t,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:u,largerEq:c,add:l,isPositive:s});return t("range",{"...any":function(p){var m=p.length-1,d=p[m];return typeof d!="boolean"&&p.push(!0),f.apply(null,p)}})},{isTransformFunction:!0}),Uk="row",$k=["typed","Index","matrix","range"],Hk=U(Uk,$k,e=>{var{typed:t,Index:r,matrix:n,range:i}=e,a=Fy({typed:t,Index:r,matrix:n,range:i});return t("row",{"...any":function(o){var u=o.length-1,c=o[u];Ue(c)&&(o[u]=c-1);try{return a.apply(null,o)}catch(l){throw lr(l)}}})},{isTransformFunction:!0}),Jk="subset",Gk=["typed","matrix","zeros","add"],Wk=U(Jk,Gk,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e,a=Ty({typed:t,matrix:r,zeros:n,add:i});return t("subset",{"...any":function(o){try{return a.apply(null,o)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),Kk="concat",Qk=["typed","matrix","isInteger"],Zk=U(Kk,Qk,e=>{var{typed:t,matrix:r,isInteger:n}=e,i=Ey({typed:t,matrix:r,isInteger:n});return t("concat",{"...any":function(a){var o=a.length-1,u=a[o];Ue(u)?a[o]=u-1:$e(u)&&(a[o]=u.minus(1));try{return i.apply(null,a)}catch(c){throw lr(c)}}})},{isTransformFunction:!0}),c0="diff",Xk=["typed","matrix","subtract","number","bignumber"],Yk=U(c0,Xk,e=>{var{typed:t,matrix:r,subtract:n,number:i,bignumber:a}=e,o=Sy({typed:t,matrix:r,subtract:n,number:i,bignumber:a});return t(c0,{"...any":function(u){u=ai(u);try{return o.apply(null,u)}catch(c){throw lr(c)}}})},{isTransformFunction:!0}),eI="std",tI=["typed","map","sqrt","variance"],rI=U(eI,tI,e=>{var{typed:t,map:r,sqrt:n,variance:i}=e,a=Gy({typed:t,map:r,sqrt:n,variance:i});return t("std",{"...any":function(o){o=ai(o);try{return a.apply(null,o)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),l0="sum",nI=["typed","config","add","numeric"],iI=U(l0,nI,e=>{var{typed:t,config:r,add:n,numeric:i}=e,a=Vy({typed:t,config:r,add:n,numeric:i});return t(l0,{"...any":function(o){o=ai(o);try{return a.apply(null,o)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),aI="quantileSeq",oI=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],sI=U(aI,oI,e=>{var{typed:t,bignumber:r,add:n,subtract:i,divide:a,multiply:o,partitionSelect:u,compare:c,isInteger:l,smaller:s,smallerEq:f,larger:p}=e,m=Jy({typed:t,bignumber:r,add:n,subtract:i,divide:a,multiply:o,partitionSelect:u,compare:c,isInteger:l,smaller:s,smallerEq:f,larger:p});return t("quantileSeq",{"Array | Matrix, number | BigNumber":m,"Array | Matrix, number | BigNumber, number":(h,w,v)=>m(h,w,d(v)),"Array | Matrix, number | BigNumber, boolean":m,"Array | Matrix, number | BigNumber, boolean, number":(h,w,v,x)=>m(h,w,v,d(x)),"Array | Matrix, Array | Matrix":m,"Array | Matrix, Array | Matrix, number":(h,w,v)=>m(h,w,d(v)),"Array | Matrix, Array | Matrix, boolean":m,"Array | Matrix, Array | Matrix, boolean, number":(h,w,v,x)=>m(h,w,v,d(x))});function d(h){return ai([[],h])[1]}},{isTransformFunction:!0}),f0="cumsum",uI=["typed","add","unaryPlus"],cI=U(f0,uI,e=>{var{typed:t,add:r,unaryPlus:n}=e,i=Uy({typed:t,add:r,unaryPlus:n});return t(f0,{"...any":function(a){if(a.length===2&&Fr(a[0])){var o=a[1];Ue(o)?a[1]=o-1:$e(o)&&(a[1]=o.minus(1))}try{return i.apply(null,a)}catch(u){throw lr(u)}}})},{isTransformFunction:!0}),p0="variance",lI=["typed","add","subtract","multiply","divide","apply","isNaN"],fI=U(p0,lI,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:a,apply:o,isNaN:u}=e,c=Hy({typed:t,add:r,subtract:n,multiply:i,divide:a,apply:o,isNaN:u});return t(p0,{"...any":function(l){l=ai(l);try{return c.apply(null,l)}catch(s){throw lr(s)}}})},{isTransformFunction:!0}),m0="print",pI=["typed","matrix","zeros","add"],mI=U(m0,pI,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e,a=By({typed:t,matrix:r,zeros:n,add:i});return t(m0,{"string, Object | Array":function(u,c){return a(o(u),c)},"string, Object | Array, number | Object":function(u,c,l){return a(o(u),c,l)}});function o(u){return u.replace(Oy,c=>{var l=c.slice(1).split("."),s=l.map(function(f){return!isNaN(f)&&f.length>0?parseInt(f)-1:f});return"$"+s.join(".")})}},{isTransformFunction:!0}),dI="and",hI=["typed","matrix","zeros","add","equalScalar","not","concat"],gI=U(dI,hI,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o}=e,u=ky({typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o});function c(l,s,f){var p=l[0].compile().evaluate(f);if(!Fr(p)&&!u(p,!0))return!1;var m=l[1].compile().evaluate(f);return u(p,m)}return c.rawArgs=!0,c},{isTransformFunction:!0}),vI="or",yI=["typed","matrix","equalScalar","DenseMatrix","concat"],bI=U(vI,yI,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=Dy({typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a});function u(c,l,s){var f=c[0].compile().evaluate(s);if(!Fr(f)&&o(f,!1))return!0;var p=c[1].compile().evaluate(s);return o(f,p)}return u.rawArgs=!0,u},{isTransformFunction:!0}),xI="bitAnd",wI=["typed","matrix","zeros","add","equalScalar","not","concat"],NI=U(xI,wI,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o}=e,u=wy({typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o});function c(l,s,f){var p=l[0].compile().evaluate(f);if(!Fr(p)){if(isNaN(p))return NaN;if(p===0||p===!1)return 0}var m=l[1].compile().evaluate(f);return u(p,m)}return c.rawArgs=!0,c},{isTransformFunction:!0}),DI="bitOr",EI=["typed","matrix","equalScalar","DenseMatrix","concat"],AI=U(DI,EI,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=Ny({typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a});function u(c,l,s){var f=c[0].compile().evaluate(s);if(!Fr(f)){if(isNaN(f))return NaN;if(f===-1)return-1;if(f===!0)return 1}var p=c[1].compile().evaluate(s);return o(f,p)}return u.rawArgs=!0,u},{isTransformFunction:!0}),Ae=I2({config:ve}),ht=L2({}),d0=s7({BigNumber:Ae,config:ve}),SI=t7({}),CI=R7({BigNumber:Ae,config:ve}),Pi=$2({}),r1=h7({Complex:ht}),MI=n7({BigNumber:Ae,config:ve}),_I=l7({BigNumber:Ae,config:ve}),FI=p7({BigNumber:Ae,config:ve}),Su=Q2({}),TI=i7({BigNumber:Ae,config:ve}),OI=r7({}),BI=u7({BigNumber:Ae,config:ve}),kI=G2({}),n1=jN({}),II=m7({BigNumber:Ae,config:ve}),RI=tk({BigNumber:Ae,config:ve}),i1=o7({BigNumber:Ae,config:ve}),qI=e7({}),zI=g7({}),He=lD({Matrix:Su}),jI=H7({BigNumber:Ae,config:ve}),LI=c7({BigNumber:Ae,config:ve}),Jc=a7({BigNumber:Ae,config:ve}),PI=X9({}),VI=d7({BigNumber:Ae,config:ve}),W=IN({BigNumber:Ae,Complex:ht,DenseMatrix:He,Fraction:Pi}),Il=wE({BigNumber:Ae,config:ve,typed:W}),UI=$7({BigNumber:Ae,config:ve}),fr=DE({typed:W}),$I=Z_({Complex:ht,config:ve,typed:W}),HI=t3({BigNumber:Ae,typed:W}),JI=a3({BigNumber:Ae,Complex:ht,config:ve,typed:W}),Rt=CE({typed:W}),GI=dS({typed:W}),WI=f3({BigNumber:Ae,Complex:ht,config:ve,typed:W}),KI=g3({typed:W}),a1=b3({typed:W}),QI=D3({Complex:ht,config:ve,typed:W}),ir=tE({BigNumber:Ae,typed:W}),ZI=sS({typed:W}),XI=XD({typed:W}),YI=pD({typed:W}),Cu=_6({typed:W}),Mu=iE({Complex:ht,typed:W}),Vi=gS({typed:W}),Rl=A3({typed:W}),eR=_3({BigNumber:Ae,typed:W}),tR=B3({BigNumber:Ae,typed:W}),rR=VE({typed:W}),Xe=LD({config:ve,typed:W}),nR=zC({typed:W}),o1=$E({typed:W}),iR=JE({Complex:ht,typed:W}),aR=RS({typed:W}),oR=LS({typed:W}),Ao=KC({typed:W}),ql=US({typed:W}),sR=tM({format:Ao,typed:W}),zl=yS({typed:W}),dr=dD({typed:W}),oi=AD({typed:W}),Ui=TD({typed:W}),Wr=BD({typed:W}),uR=f7({BigNumber:Ae,config:ve}),cR=I6({Complex:ht,typed:W}),lR=CA({Complex:ht,config:ve,typed:W}),s1=_A({Complex:ht,config:ve,typed:W}),$i=KS({typed:W}),At=OA({typed:W}),Zs=NS({typed:W}),Tn=WD({typed:W}),fR=YC({format:Ao,typed:W}),pR=c9({config:ve,typed:W}),mR=By({typed:W}),dR=f9({config:ve,typed:W}),jl=xS({typed:W}),hR=q3({BigNumber:Ae,typed:W}),u1=zA({BigNumber:Ae,Fraction:Pi,complex:Mu,typed:W}),_u=P3({typed:W}),On=UD({Matrix:Su,equalScalar:Xe,typed:W}),gR=vE({typed:W}),vR=UA({typed:W}),yR=QD({typed:W}),Or=_E({typed:W}),bR=H3({typed:W}),c1=qD({typed:W}),xR=Y_({Complex:ht,config:ve,typed:W}),wR=s3({BigNumber:Ae,typed:W}),Ll=Al({isInteger:dr,typed:W}),NR=c3({BigNumber:Ae,Complex:ht,config:ve,typed:W}),DR=ZC({format:Ao,typed:W}),ER=T6({typed:W}),AR=C3({typed:W}),SR=I3({BigNumber:Ae,typed:W}),So=ID({typed:W}),CR=oM({typed:W}),MR=m9({config:ve,typed:W}),_R=j3({BigNumber:Ae,typed:W}),FR=U3({typed:W}),TR=G_({SparseMatrix:On,typed:W}),Kr=PA({Complex:ht,config:ve,typed:W}),OR=W3({typed:W}),ln=bE({typed:W}),BR=n3({BigNumber:Ae,Complex:ht,config:ve,typed:W}),kR=T3({BigNumber:Ae,typed:W}),Fa=sE({Fraction:Pi,typed:W}),Hi=CD({typed:W}),we=cE({DenseMatrix:He,Matrix:Su,SparseMatrix:On,typed:W}),IR=fE({isZero:Wr,matrix:we,typed:W}),RR=HC({isNaN:So,isNumeric:Hi,typed:W}),Pr=cM({bignumber:ir,fraction:Fa,number:Tn}),l1=GC({config:ve,multiplyScalar:At,numeric:Pr,typed:W}),f1=nC({isInteger:dr,matrix:we,typed:W}),Gt=mC({matrix:we,config:ve,typed:W}),qR=hC({matrix:we,typed:W}),Co=wC({matrix:we,typed:W}),p1=GA({BigNumber:Ae,config:ve,matrix:we,typed:W}),Ut=AC({BigNumber:Ae,config:ve,matrix:we,typed:W}),zR=m3({Complex:ht,config:ve,typed:W}),m1=TE({BigNumber:Ae,Complex:ht,Fraction:Pi,config:ve,isNegative:oi,matrix:we,typed:W,unaryMinus:ln}),it=Ey({isInteger:dr,matrix:we,typed:W}),jR=_S({prod:l1,size:Gt,typed:W}),Pl=DC({conj:Vi,transpose:Co,typed:W}),d1=BS({DenseMatrix:He,SparseMatrix:On,matrix:we,typed:W}),Nt=fM({numeric:Pr,typed:W}),Mo=AM({DenseMatrix:He,concat:it,divideScalar:Nt,equalScalar:Xe,matrix:we,typed:W}),Br=YM({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W}),_o=zS({matrix:we,typed:W}),LR=_D({isNumeric:Hi,typed:W}),si=HS({BigNumber:Ae,DenseMatrix:He,SparseMatrix:On,config:ve,matrix:we,typed:W}),PR=GS({matrix:we,multiplyScalar:At,typed:W}),Fu=m_({DenseMatrix:He,concat:it,config:ve,matrix:we,typed:W}),VR=qM({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W,zeros:Ut}),h1=CM({DenseMatrix:He,divideScalar:Nt,equalScalar:Xe,matrix:we,multiplyScalar:At,subtractScalar:Or,typed:W}),Vl=hE({flatten:_o,matrix:we,size:Gt,typed:W}),UR=RA({BigNumber:Ae,concat:it,equalScalar:Xe,matrix:we,typed:W}),$R=eC({BigNumber:Ae,config:ve,matrix:we,typed:W}),Ul=FF({addScalar:Rt,complex:Mu,conj:Vi,divideScalar:Nt,equal:Br,identity:si,isZero:Wr,matrix:we,multiplyScalar:At,sign:u1,sqrt:Kr,subtractScalar:Or,typed:W,unaryMinus:ln,zeros:Ut}),HR=oC({config:ve,matrix:we}),JR=jM({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W,zeros:Ut}),tn=hM({BigNumber:Ae,DenseMatrix:He,config:ve,equalScalar:Xe,matrix:we,typed:W,zeros:Ut}),ar=i_({DenseMatrix:He,concat:it,config:ve,matrix:we,typed:W}),Dt=HA({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,subtractScalar:Or,typed:W,unaryMinus:ln}),GR=iM({concat:it,matrix:we,typed:W}),WR=y_({DenseMatrix:He,concat:it,config:ve,equalScalar:Xe,matrix:we,typed:W}),$l=_M({DenseMatrix:He,divideScalar:Nt,equalScalar:Xe,matrix:we,multiplyScalar:At,subtractScalar:Or,typed:W}),KR=AS({DenseMatrix:He,concat:it,matrix:we,typed:W}),rt=g4({DenseMatrix:He,SparseMatrix:On,addScalar:Rt,concat:it,equalScalar:Xe,matrix:we,typed:W}),QR=w3({BigNumber:Ae,DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W}),ZR=wy({concat:it,equalScalar:Xe,matrix:we,typed:W}),XR=Ny({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W}),YR=pS({DenseMatrix:He,concat:it,matrix:we,typed:W}),eq=b9({addScalar:Rt,combinations:Cu,divideScalar:Nt,isInteger:dr,isNegative:oi,multiplyScalar:At,typed:W}),Ji=$M({BigNumber:Ae,DenseMatrix:He,Fraction:Pi,concat:it,config:ve,equalScalar:Xe,matrix:we,typed:W}),g1=ZM({concat:it,matrix:we,typed:W}),tq=Uy({add:rt,typed:W,unaryPlus:Il}),Hl=g_({equal:Br,typed:W}),rq=Sy({matrix:we,number:Tn,subtract:Dt,typed:W}),nq=p6({abs:fr,addScalar:Rt,deepEqual:Hl,divideScalar:Nt,multiplyScalar:At,sqrt:Kr,subtractScalar:Or,typed:W}),Tu=N4({addScalar:Rt,conj:Vi,multiplyScalar:At,size:Gt,typed:W}),iq=r_({compareText:g1,isZero:Wr,typed:W}),v1=yy({DenseMatrix:He,config:ve,equalScalar:Xe,matrix:we,round:tn,typed:W,zeros:Ut}),aq=wA({BigNumber:Ae,DenseMatrix:He,concat:it,config:ve,equalScalar:Xe,matrix:we,round:tn,typed:W,zeros:Ut}),oq=y4({abs:fr,addScalar:Rt,divideScalar:Nt,isPositive:Ui,multiplyScalar:At,smaller:ar,sqrt:Kr,typed:W}),y1=M_({DenseMatrix:He,smaller:ar}),Xt=T_({ImmutableDenseMatrix:y1,getMatrixDataType:ql}),or=l_({DenseMatrix:He,concat:it,config:ve,matrix:we,typed:W}),Jl=vM({Complex:ht,config:ve,divideScalar:Nt,typed:W}),sq=TM({DenseMatrix:He,divideScalar:Nt,equalScalar:Xe,matrix:we,multiplyScalar:At,subtractScalar:Or,typed:W}),uq=mE({flatten:_o,matrix:we,size:Gt,typed:W}),cq=Ry({config:ve,numeric:Pr,smaller:ar,typed:W}),b1=by({DenseMatrix:He,concat:it,config:ve,equalScalar:Xe,matrix:we,round:tn,typed:W,zeros:Ut}),ct=kA({addScalar:Rt,dot:Tu,equalScalar:Xe,matrix:we,multiplyScalar:At,typed:W}),lq=wM({Complex:ht,config:ve,divideScalar:Nt,typed:W}),fq=Dy({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W}),Ou=w_({compare:Ji,isNaN:So,isNumeric:Hi,typed:W}),pq=PM({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W,zeros:Ut}),x1=eT({SparseMatrix:On,abs:fr,add:rt,divideScalar:Nt,larger:or,largerEq:Fu,multiply:ct,subtract:Dt,transpose:Co,typed:W}),Dr=Ty({add:rt,matrix:we,typed:W,zeros:Ut}),Gl=Vy({add:rt,config:ve,numeric:Pr,typed:W}),mq=A4({add:rt,matrix:we,typed:W}),w1=BM({DenseMatrix:He,divideScalar:Nt,equalScalar:Xe,matrix:we,multiplyScalar:At,subtractScalar:Or,typed:W}),dq=$9({Complex:ht,add:rt,multiply:ct,number:Tn,typed:W}),Wl=LE({DenseMatrix:He,config:ve,equalScalar:Xe,matrix:we,round:tn,typed:W,zeros:Ut}),fn=WM({compare:Ji,typed:W}),hq=w9({addScalar:Rt,combinations:Cu,isInteger:dr,isNegative:oi,isPositive:Ui,larger:or,typed:W}),gq=TS({matrix:we,multiply:ct,subtract:Dt,typed:W}),N1=VB({divideScalar:Nt,isZero:Wr,matrix:we,multiply:ct,subtractScalar:Or,typed:W,unaryMinus:ln}),vq=YA({concat:it,equalScalar:Xe,matrix:we,multiplyScalar:At,typed:W}),D1=k_({larger:or,smaller:ar}),E1=KE({Complex:ht,DenseMatrix:He,ceil:Wl,equalScalar:Xe,floor:v1,matrix:we,typed:W,zeros:Ut}),A1=C4({Index:Xt,typed:W}),yq=h6({abs:fr,add:rt,addScalar:Rt,config:ve,divideScalar:Nt,equalScalar:Xe,flatten:_o,isNumeric:Hi,isZero:Wr,matrix:we,multiply:ct,multiplyScalar:At,smaller:ar,subtract:Dt,typed:W}),bq=KA({BigNumber:Ae,add:rt,config:ve,equal:Br,isInteger:dr,mod:b1,smaller:ar,typed:W,xgcd:p1}),xq=AA({concat:it,equalScalar:Xe,matrix:we,typed:W}),wq=bM({Complex:ht,config:ve,divideScalar:Nt,log:Jl,typed:W}),Kl=Iy({config:ve,larger:or,numeric:Pr,typed:W}),Nq=Q3({DenseMatrix:He,Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:W}),Dq=e4({DenseMatrix:He,Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:W}),Eq=i4({Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:W}),Aq=u4({Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:W}),ya=s_({DenseMatrix:He,concat:it,config:ve,matrix:we,typed:W}),Sq=D_({compare:Ji,compareNatural:fn,matrix:we,typed:W}),Cq=ky({concat:it,equalScalar:Xe,matrix:we,not:Zs,typed:W,zeros:Ut}),ba=_y({bignumber:ir,matrix:we,add:rt,config:ve,isPositive:Ui,larger:or,largerEq:Fu,smaller:ar,smallerEq:ya,typed:W}),Mq=Fy({Index:Xt,matrix:we,range:ba,typed:W}),S1=X3({DenseMatrix:He,Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:W}),_q=o4({Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:W}),C1=p4({Index:Xt,concat:it,setDifference:S1,size:Gt,subset:Dr,typed:W}),M1=q_({FibonacciHeap:D1,addScalar:Rt,equalScalar:Xe}),_1=Ay({Index:Xt,matrix:we,range:ba,typed:W}),Gi=$B({abs:fr,addScalar:Rt,det:N1,divideScalar:Nt,identity:si,matrix:we,multiply:ct,typed:W,unaryMinus:ln}),F1=MF({DenseMatrix:He,Spa:M1,SparseMatrix:On,abs:fr,addScalar:Rt,divideScalar:Nt,equalScalar:Xe,larger:or,matrix:we,multiplyScalar:At,subtractScalar:Or,typed:W,unaryMinus:ln}),Fq=JB({Complex:ht,add:rt,ctranspose:Pl,deepEqual:Hl,divideScalar:Nt,dot:Tu,dotDivide:Mo,equal:Br,inv:Gi,matrix:we,multiply:ct,typed:W}),kr=mM({Complex:ht,config:ve,fraction:Fa,identity:si,inv:Gi,matrix:we,multiply:ct,number:Tn,typed:W}),T1=r4({DenseMatrix:He,Index:Xt,compareNatural:fn,size:Gt,subset:Dr,typed:W}),Tq=d4({Index:Xt,concat:it,setIntersect:T1,setSymDifference:C1,size:Gt,subset:Dr,typed:W}),Oq=t6({abs:fr,add:rt,identity:si,inv:Gi,map:$i,max:Kl,multiply:ct,size:Gt,sqrt:Kr,subtract:Dt,typed:W}),qe=U_({BigNumber:Ae,Complex:ht,Fraction:Pi,abs:fr,addScalar:Rt,config:ve,divideScalar:Nt,equal:Br,fix:E1,format:Ao,isNumeric:Hi,multiplyScalar:At,number:Tn,pow:kr,round:tn,subtractScalar:Or}),Bq=D7({BigNumber:Ae,Unit:qe,config:ve}),kq=ik({BigNumber:Ae,Unit:qe,config:ve}),Iq=J7({BigNumber:Ae,Unit:qe,config:ve}),Rq=S7({BigNumber:Ae,Unit:qe,config:ve}),qq=W7({BigNumber:Ae,Unit:qe,config:ve}),zq=C7({BigNumber:Ae,Unit:qe,config:ve}),jq=E7({BigNumber:Ae,Unit:qe,config:ve}),Lq=j7({BigNumber:Ae,Unit:qe,config:ve}),Pq=DM({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,pow:kr,typed:W}),Vq=N7({BigNumber:Ae,Unit:qe,config:ve}),Uq=A7({BigNumber:Ae,Unit:qe,config:ve}),$q=YB({abs:fr,add:rt,identity:si,inv:Gi,multiply:ct,typed:W}),Hq=K7({BigNumber:Ae,Unit:qe,config:ve}),O1=CC({addScalar:Rt,ceil:Wl,conj:Vi,divideScalar:Nt,dotDivide:Mo,exp:o1,i:r1,log2:s1,matrix:we,multiplyScalar:At,pow:kr,tau:i1,typed:W}),Ql=B6({BigNumber:Ae,Complex:ht,config:ve,multiplyScalar:At,pow:kr,typed:W}),Jq=y7({BigNumber:Ae,Unit:qe,config:ve}),Gq=q7({BigNumber:Ae,Unit:qe,config:ve}),Wq=_C({conj:Vi,dotDivide:Mo,fft:O1,typed:W}),Kq=T7({BigNumber:Ae,Unit:qe,config:ve}),Qq=Z7({BigNumber:Ae,Unit:qe,config:ve}),Zq=w7({BigNumber:Ae,Unit:qe,config:ve}),Xq=ak({BigNumber:Ae,Unit:qe,config:ve}),Yq=Y7({BigNumber:Ae,Unit:qe,config:ve}),ez=L7({BigNumber:Ae,Unit:qe,config:ve}),tz=F7({BigNumber:Ae,Unit:qe,config:ve}),rz=fk({BigNumber:Ae,Unit:qe,config:ve}),nz=uk({BigNumber:Ae,Unit:qe,config:ve}),iz=pk({BigNumber:Ae,Unit:qe,config:ve}),az=z7({BigNumber:Ae,Unit:qe,config:ve}),oz=P7({BigNumber:Ae,Unit:qe,config:ve}),sz=x7({BigNumber:Ae,Unit:qe,config:ve}),uz=V7({BigNumber:Ae,Unit:qe,config:ve}),cz=rk({BigNumber:Ae,Unit:qe,config:ve}),lz=v7({BigNumber:Ae,Unit:qe,config:ve}),fz=nk({BigNumber:Ae,Unit:qe,config:ve}),pz=U7({BigNumber:Ae,Unit:qe,config:ve}),mz=G7({BigNumber:Ae,Unit:qe,config:ve}),dz=O7({BigNumber:Ae,Unit:qe,config:ve}),hz=K_({Unit:qe,typed:W}),jt=l6({divideScalar:Nt,equalScalar:Xe,inv:Gi,matrix:we,multiply:ct,typed:W}),gz=k7({BigNumber:Ae,Unit:qe,config:ve}),Fo=q6({gamma:Ql,typed:W}),vz=Q7({BigNumber:Ae,Unit:qe,config:ve}),yz=sk({BigNumber:Ae,Unit:qe,config:ve}),bz=M7({BigNumber:Ae,Unit:qe,config:ve}),B1=rT({DenseMatrix:He,lsolve:h1,lup:F1,matrix:we,slu:x1,typed:W,usolve:$l}),xz=_7({BigNumber:Ae,Unit:qe,config:ve}),wz=ok({BigNumber:Ae,Unit:qe,config:ve}),Nz=P6({add:rt,divide:jt,factorial:Fo,isInteger:dr,isPositive:Ui,multiply:ct,typed:W}),Dz=U6({factorial:Fo,typed:W}),Ez=ck({BigNumber:Ae,Unit:qe,config:ve}),Az=iT({add:rt,cbrt:m1,divide:jt,equalScalar:Xe,im:zl,isZero:Wr,multiply:ct,re:jl,sqrt:Kr,subtract:Dt,typeOf:c1,typed:W,unaryMinus:ln}),Sz=l4({compareNatural:fn,typed:W}),Cz=IC({abs:fr,add:rt,bignumber:ir,divide:jt,isNegative:oi,isPositive:Ui,larger:or,map:$i,matrix:we,max:Kl,multiply:ct,smaller:ar,subtract:Dt,typed:W,unaryMinus:ln}),k1=h9({bignumber:ir,addScalar:Rt,combinations:Cu,divideScalar:Nt,factorial:Fo,isInteger:dr,isNegative:oi,larger:or,multiplyScalar:At,number:Tn,pow:kr,subtractScalar:Or,typed:W}),Mz=H_({Unit:qe,typed:W}),_z=v9({addScalar:Rt,isInteger:dr,isNegative:oi,stirlingS2:k1,typed:W}),I1=ZB({abs:fr,add:rt,addScalar:Rt,atan:a1,bignumber:ir,column:_1,complex:Mu,config:ve,cos:Rl,diag:d1,divideScalar:Nt,dot:Tu,equal:Br,flatten:_o,im:zl,inv:Gi,larger:or,matrix:we,matrixFromColumns:Vl,multiply:ct,multiplyScalar:At,number:Tn,qr:Ul,re:jl,reshape:f1,sin:_u,size:Gt,smaller:ar,sqrt:Kr,subtract:Dt,typed:W,usolve:$l,usolveAll:w1}),Fz=I7({BigNumber:Ae,Unit:qe,config:ve}),Tz=X7({BigNumber:Ae,Unit:qe,config:ve}),Oz=j6({divide:jt,dotDivide:Mo,isNumeric:Hi,log:Jl,map:$i,matrix:we,multiply:ct,sum:Gl,typed:W}),R1=$y({add:rt,divide:jt,typed:W}),Bz=ek({BigNumber:Ae,Unit:qe,config:ve}),kz=b7({BigNumber:Ae,Unit:qe,config:ve}),Iz=Jy({bignumber:ir,add:rt,compare:Ji,divide:jt,isInteger:dr,larger:or,multiply:ct,partitionSelect:Ou,smaller:ar,smallerEq:ya,subtract:Dt,typed:W}),Zl=Hy({add:rt,apply:Ll,divide:jt,isNaN:So,multiply:ct,subtract:Dt,typed:W}),Rz=B7({BigNumber:Ae,Unit:qe,config:ve}),q1=x6({add:rt,compare:Ji,divide:jt,partitionSelect:Ou,typed:W}),qz=C6({add:rt,divide:jt,matrix:we,mean:R1,multiply:ct,pow:kr,sqrt:Kr,subtract:Dt,sum:Gl,typed:W}),zz=J9({Complex:ht,add:rt,divide:jt,matrix:we,multiply:ct,typed:W}),jz=N6({abs:fr,map:$i,median:q1,subtract:Dt,typed:W}),Lz=Gy({map:$i,sqrt:Kr,typed:W,variance:Zl}),Pz=UC({BigNumber:Ae,Complex:ht,add:rt,config:ve,divide:jt,equal:Br,factorial:Fo,gamma:Ql,isNegative:oi,multiply:ct,pi:Jc,pow:kr,sin:_u,smallerEq:ya,subtract:Dt,typed:W}),Xl=x4({abs:fr,add:rt,conj:Vi,ctranspose:Pl,eigs:I1,equalScalar:Xe,larger:or,matrix:we,multiply:ct,pow:kr,smaller:ar,sqrt:Kr,typed:W}),z1=lC({BigNumber:Ae,DenseMatrix:He,SparseMatrix:On,addScalar:Rt,config:ve,cos:Rl,matrix:we,multiplyScalar:At,norm:Xl,sin:_u,typed:W,unaryMinus:ln}),Vz=lk({BigNumber:Ae,Unit:qe,config:ve}),j1=a6({identity:si,matrix:we,multiply:ct,norm:Xl,qr:Ul,subtract:Dt,typed:W}),Uz=uC({multiply:ct,rotationMatrix:z1,typed:W}),L1=n6({abs:fr,add:rt,concat:it,identity:si,index:A1,lusolve:B1,matrix:we,matrixFromColumns:Vl,multiply:ct,range:ba,schur:j1,subset:Dr,subtract:Dt,transpose:Co,typed:W}),$z=s6({matrix:we,multiply:ct,sylvester:L1,transpose:Co,typed:W}),Ta={},Oa={},P1={},tr=F4({mathWithTransform:Oa}),Ba=rF({Node:tr}),Bn=iF({Node:tr}),Wi=oF({Node:tr}),V1=lF({Node:tr}),ka=k4({Node:tr}),U1=L4({Node:tr,ResultSet:n1}),$1=V4({Node:tr}),ui=Q4({Node:tr}),H1=uF({Node:tr}),Hz=K9({classes:P1}),Yl=lT({math:Ta,typed:W}),J1=X4({Node:tr,typed:W}),G1=LB({Chain:Yl,typed:W}),Ia=eF({Node:tr,size:Gt}),Ra=O4({Node:tr,subset:Dr}),W1=z4({matrix:we,Node:tr,subset:Dr}),ci=mF({Unit:qe,Node:tr,math:Ta}),li=hF({Node:tr,SymbolNode:ci,math:Ta}),pn=vF({AccessorNode:Ra,ArrayNode:ka,AssignmentNode:W1,BlockNode:U1,ConditionalNode:$1,ConstantNode:ui,FunctionAssignmentNode:J1,FunctionNode:li,IndexNode:Ia,ObjectNode:Ba,OperatorNode:Bn,ParenthesisNode:Wi,RangeNode:H1,RelationalNode:V1,SymbolNode:ci,config:ve,numeric:Pr,typed:W}),K1=R9({ConstantNode:ui,FunctionNode:li,OperatorNode:Bn,ParenthesisNode:Wi,parse:pn,typed:W}),ef=T9({bignumber:ir,fraction:Fa,AccessorNode:Ra,ArrayNode:ka,ConstantNode:ui,FunctionNode:li,IndexNode:Ia,ObjectNode:Ba,OperatorNode:Bn,SymbolNode:ci,config:ve,mathWithTransform:Oa,matrix:we,typed:W}),Jz=bF({parse:pn,typed:W}),tf=B9({AccessorNode:Ra,ArrayNode:ka,ConstantNode:ui,FunctionNode:li,IndexNode:Ia,ObjectNode:Ba,OperatorNode:Bn,ParenthesisNode:Wi,SymbolNode:ci,add:rt,divide:jt,equal:Br,isZero:Wr,multiply:ct,parse:pn,pow:kr,subtract:Dt,typed:W}),rf=wF({parse:pn,typed:W}),Q1=sT({evaluate:rf}),Z1=EF({evaluate:rf}),Bu=M9({bignumber:ir,fraction:Fa,AccessorNode:Ra,ArrayNode:ka,ConstantNode:ui,FunctionNode:li,IndexNode:Ia,ObjectNode:Ba,OperatorNode:Bn,ParenthesisNode:Wi,SymbolNode:ci,add:rt,config:ve,divide:jt,equal:Br,isZero:Wr,mathWithTransform:Oa,matrix:we,multiply:ct,parse:pn,pow:kr,resolve:K1,simplifyConstant:ef,simplifyCore:tf,subtract:Dt,typed:W}),Gz=z9({OperatorNode:Bn,parse:pn,simplify:Bu,typed:W}),Wz=D9({parse:pn,typed:W}),Kz=SF({Parser:Z1,typed:W}),Qz=V9({bignumber:ir,fraction:Fa,AccessorNode:Ra,ArrayNode:ka,ConstantNode:ui,FunctionNode:li,IndexNode:Ia,ObjectNode:Ba,OperatorNode:Bn,ParenthesisNode:Wi,SymbolNode:ci,add:rt,config:ve,divide:jt,equal:Br,isZero:Wr,mathWithTransform:Oa,matrix:we,multiply:ct,parse:pn,pow:kr,simplify:Bu,simplifyConstant:ef,simplifyCore:tf,subtract:Dt,typed:W}),Zz=L9({ConstantNode:ui,FunctionNode:li,OperatorNode:Bn,ParenthesisNode:Wi,SymbolNode:ci,config:ve,equal:Br,isZero:Wr,numeric:Pr,parse:pn,simplify:Bu,typed:W}),Xz=zB({Help:Q1,mathWithTransform:Oa,typed:W});Tt(Ta,{e:d0,false:SI,fineStructure:CI,i:r1,Infinity:MI,LN10:_I,LOG10E:FI,NaN:TI,null:OI,phi:BI,SQRT1_2:II,sackurTetrode:RI,tau:i1,true:qI,E:d0,version:zI,efimovFactor:jI,LN2:LI,pi:Jc,replacer:PI,reviver:Hz,SQRT2:VI,typed:W,unaryPlus:Il,PI:Jc,weakMixingAngle:UI,abs:fr,acos:$I,acot:HI,acsc:JI,addScalar:Rt,arg:GI,asech:WI,asinh:KI,atan:a1,atanh:QI,bignumber:ir,bitNot:ZI,boolean:XI,clone:YI,combinations:Cu,complex:Mu,conj:Vi,cos:Rl,cot:eR,csc:tR,cube:rR,equalScalar:Xe,erf:nR,exp:o1,expm1:iR,filter:aR,forEach:oR,format:Ao,getMatrixDataType:ql,hex:sR,im:zl,isInteger:dr,isNegative:oi,isPositive:Ui,isZero:Wr,LOG2E:uR,lgamma:cR,log10:lR,log2:s1,map:$i,multiplyScalar:At,not:Zs,number:Tn,oct:fR,pickRandom:pR,print:mR,random:dR,re:jl,sec:hR,sign:u1,sin:_u,splitUnit:gR,square:vR,string:yR,subtractScalar:Or,tan:bR,typeOf:c1,acosh:xR,acsch:wR,apply:Ll,asec:NR,bin:DR,chain:G1,combinationsWithRep:ER,cosh:AR,csch:SR,isNaN:So,isPrime:CR,randomInt:MR,sech:_R,sinh:FR,sparse:TR,sqrt:Kr,tanh:OR,unaryMinus:ln,acoth:BR,coth:kR,fraction:Fa,isNumeric:Hi,matrix:we,matrixFromFunction:IR,mode:RR,numeric:Pr,prod:l1,reshape:f1,size:Gt,squeeze:qR,transpose:Co,xgcd:p1,zeros:Ut,asin:zR,cbrt:m1,concat:it,count:jR,ctranspose:Pl,diag:d1,divideScalar:Nt,dotDivide:Mo,equal:Br,flatten:_o,hasNumericValue:LR,identity:si,kron:PR,largerEq:Fu,leftShift:VR,lsolve:h1,matrixFromColumns:Vl,nthRoot:UR,ones:$R,qr:Ul,resize:HR,rightArithShift:JR,round:tn,smaller:ar,subtract:Dt,to:GR,unequal:WR,usolve:$l,xor:KR,add:rt,atan2:QR,bitAnd:ZR,bitOr:XR,bitXor:YR,catalan:eq,compare:Ji,compareText:g1,cumsum:tq,deepEqual:Hl,diff:rq,distance:nq,dot:Tu,equalText:iq,floor:v1,gcd:aq,hypot:oq,larger:or,log:Jl,lsolveAll:sq,matrixFromRows:uq,min:cq,mod:b1,multiply:ct,nthRoots:lq,or:fq,partitionSelect:Ou,rightLogShift:pq,slu:x1,subset:Dr,sum:Gl,trace:mq,usolveAll:w1,zpk2tf:dq,ceil:Wl,compareNatural:fn,composition:hq,cross:gq,det:N1,dotMultiply:vq,fix:E1,index:A1,intersect:yq,invmod:bq,lcm:xq,log1p:wq,max:Kl,setCartesian:Nq,setDistinct:Dq,setIsSubset:Eq,setPowerset:Aq,smallerEq:ya,sort:Sq,and:Cq,range:ba,row:Mq,setDifference:S1,setMultiplicity:_q,setSymDifference:C1,column:_1,inv:Gi,lup:F1,pinv:Fq,pow:kr,setIntersect:T1,setUnion:Tq,sqrtm:Oq,vacuumImpedance:Bq,wienDisplacement:kq,atomicMass:Iq,bohrMagneton:Rq,boltzmann:qq,conductanceQuantum:zq,coulomb:jq,deuteronMass:Lq,dotPow:Pq,electricConstant:Vq,elementaryCharge:Uq,expm:$q,faraday:Hq,fft:O1,gamma:Ql,gravitationConstant:Jq,hartreeEnergy:Gq,ifft:Wq,klitzing:Kq,loschmidt:Qq,magneticConstant:Zq,molarMass:Xq,molarPlanckConstant:Yq,neutronMass:ez,nuclearMagneton:tz,planckCharge:rz,planckLength:nz,planckTemperature:iz,protonMass:az,quantumOfCirculation:oz,reducedPlanckConstant:sz,rydberg:uz,secondRadiation:cz,speedOfLight:lz,stefanBoltzmann:fz,thomsonCrossSection:pz,avogadro:mz,bohrRadius:dz,createUnit:hz,divide:jt,electronMass:gz,factorial:Fo,firstRadiation:vz,gravity:yz,inverseConductanceQuantum:bz,lusolve:B1,magneticFluxQuantum:xz,molarMassC12:wz,multinomial:Nz,parse:pn,permutations:Dz,planckMass:Ez,polynomialRoot:Az,resolve:K1,setSize:Sz,simplifyConstant:ef,solveODE:Cz,stirlingS2:k1,unit:Mz,bellNumbers:_z,compile:Jz,eigs:I1,fermiCoupling:Fz,gasConstant:Tz,kldivergence:Oz,mean:R1,molarVolume:Bz,planckConstant:kz,quantileSeq:Iz,simplifyCore:tf,variance:Zl,classicalElectronRadius:Rz,evaluate:rf,median:q1,simplify:Bu,symbolicEqual:Gz,corr:qz,freqz:zz,leafCount:Wz,mad:jz,parser:Kz,rationalize:Qz,std:Lz,zeta:Pz,derivative:Zz,norm:Xl,rotationMatrix:z1,help:Xz,planckTime:Vz,schur:j1,rotate:Uz,sylvester:L1,lyap:$z,config:ve});Tt(Oa,Ta,{filter:wk({typed:W}),forEach:Ek({typed:W}),map:Fk({typed:W}),apply:hk({isInteger:dr,typed:W}),or:bI({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W}),and:gI({add:rt,concat:it,equalScalar:Xe,matrix:we,not:Zs,typed:W,zeros:Ut}),concat:Zk({isInteger:dr,matrix:we,typed:W}),max:Bk({config:ve,larger:or,numeric:Pr,typed:W}),print:mI({add:rt,matrix:we,typed:W,zeros:Ut}),bitAnd:NI({add:rt,concat:it,equalScalar:Xe,matrix:we,not:Zs,typed:W,zeros:Ut}),diff:Yk({bignumber:ir,matrix:we,number:Tn,subtract:Dt,typed:W}),min:jk({config:ve,numeric:Pr,smaller:ar,typed:W}),subset:Wk({add:rt,matrix:we,typed:W,zeros:Ut}),bitOr:AI({DenseMatrix:He,concat:it,equalScalar:Xe,matrix:we,typed:W}),cumsum:cI({add:rt,typed:W,unaryPlus:Il}),index:Ck({Index:Xt,getMatrixDataType:ql}),sum:iI({add:rt,config:ve,numeric:Pr,typed:W}),range:Vk({bignumber:ir,matrix:we,add:rt,config:ve,isPositive:Ui,larger:or,largerEq:Fu,smaller:ar,smallerEq:ya,typed:W}),row:Hk({Index:Xt,matrix:we,range:ba,typed:W}),column:yk({Index:Xt,matrix:we,range:ba,typed:W}),mean:Rk({add:rt,divide:jt,typed:W}),quantileSeq:sI({add:rt,bignumber:ir,compare:Ji,divide:jt,isInteger:dr,larger:or,multiply:ct,partitionSelect:Ou,smaller:ar,smallerEq:ya,subtract:Dt,typed:W}),variance:fI({add:rt,apply:Ll,divide:jt,isNaN:So,multiply:ct,subtract:Dt,typed:W}),std:rI({map:$i,sqrt:Kr,typed:W,variance:Zl})});Tt(P1,{BigNumber:Ae,Complex:ht,Fraction:Pi,Matrix:Su,Node:tr,ObjectNode:Ba,OperatorNode:Bn,ParenthesisNode:Wi,Range:kI,RelationalNode:V1,ResultSet:n1,ArrayNode:ka,BlockNode:U1,ConditionalNode:$1,ConstantNode:ui,DenseMatrix:He,RangeNode:H1,Chain:Yl,FunctionAssignmentNode:J1,SparseMatrix:On,IndexNode:Ia,ImmutableDenseMatrix:y1,Index:Xt,AccessorNode:Ra,AssignmentNode:W1,FibonacciHeap:D1,Spa:M1,Unit:qe,SymbolNode:ci,FunctionNode:li,Help:Q1,Parser:Z1});Yl.createProxy(Ta);function X1(e,t){return function(){return e.apply(t,arguments)}}const{toString:Yz}=Object.prototype,{getPrototypeOf:nf}=Object,ku=(e=>t=>{const r=Yz.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Qr=e=>(e=e.toLowerCase(),t=>ku(t)===e),Iu=e=>t=>typeof t===e,{isArray:qa}=Array,lo=Iu("undefined");function ej(e){return e!==null&&!lo(e)&&e.constructor!==null&&!lo(e.constructor)&&xr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Y1=Qr("ArrayBuffer");function tj(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Y1(e.buffer),t}const rj=Iu("string"),xr=Iu("function"),eb=Iu("number"),Ru=e=>e!==null&&typeof e=="object",nj=e=>e===!0||e===!1,ys=e=>{if(ku(e)!=="object")return!1;const t=nf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},ij=Qr("Date"),aj=Qr("File"),oj=Qr("Blob"),sj=Qr("FileList"),uj=e=>Ru(e)&&xr(e.pipe),cj=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||xr(e.append)&&((t=ku(e))==="formdata"||t==="object"&&xr(e.toString)&&e.toString()==="[object FormData]"))},lj=Qr("URLSearchParams"),[fj,pj,mj,dj]=["ReadableStream","Request","Response","Headers"].map(Qr),hj=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function To(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),qa(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const a=r?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;let u;for(n=0;n<o;n++)u=a[n],t.call(null,e[u],u,e)}}function tb(e,t){t=t.toLowerCase();const r=Object.keys(e);let n=r.length,i;for(;n-- >0;)if(i=r[n],t===i.toLowerCase())return i;return null}const Ni=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,rb=e=>!lo(e)&&e!==Ni;function Gc(){const{caseless:e}=rb(this)&&this||{},t={},r=(n,i)=>{const a=e&&tb(t,i)||i;ys(t[a])&&ys(n)?t[a]=Gc(t[a],n):ys(n)?t[a]=Gc({},n):qa(n)?t[a]=n.slice():t[a]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&To(arguments[n],r);return t}const gj=(e,t,r,{allOwnKeys:n}={})=>(To(t,(i,a)=>{r&&xr(i)?e[a]=X1(i,r):e[a]=i},{allOwnKeys:n}),e),vj=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),yj=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},bj=(e,t,r,n)=>{let i,a,o;const u={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!n||n(o,e,t))&&!u[o]&&(t[o]=e[o],u[o]=!0);e=r!==!1&&nf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},xj=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},wj=e=>{if(!e)return null;if(qa(e))return e;let t=e.length;if(!eb(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Nj=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&nf(Uint8Array)),Dj=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const i=n.value;t.call(e,i[0],i[1])}},Ej=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Aj=Qr("HTMLFormElement"),Sj=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,n){return r.toUpperCase()+n}),h0=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Cj=Qr("RegExp"),nb=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};To(r,(i,a)=>{let o;(o=t(i,a,e))!==!1&&(n[a]=o||i)}),Object.defineProperties(e,n)},Mj=e=>{nb(e,(t,r)=>{if(xr(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(xr(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},_j=(e,t)=>{const r={},n=i=>{i.forEach(a=>{r[a]=!0})};return qa(e)?n(e):n(String(e).split(t)),r},Fj=()=>{},Tj=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,hc="abcdefghijklmnopqrstuvwxyz",g0="0123456789",ib={DIGIT:g0,ALPHA:hc,ALPHA_DIGIT:hc+hc.toUpperCase()+g0},Oj=(e=16,t=ib.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r};function Bj(e){return!!(e&&xr(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const kj=e=>{const t=new Array(10),r=(n,i)=>{if(Ru(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const a=qa(n)?[]:{};return To(n,(o,u)=>{const c=r(o,i+1);!lo(c)&&(a[u]=c)}),t[i]=void 0,a}}return n};return r(e,0)},Ij=Qr("AsyncFunction"),Rj=e=>e&&(Ru(e)||xr(e))&&xr(e.then)&&xr(e.catch),ab=((e,t)=>e?setImmediate:t?((r,n)=>(Ni.addEventListener("message",({source:i,data:a})=>{i===Ni&&a===r&&n.length&&n.shift()()},!1),i=>{n.push(i),Ni.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",xr(Ni.postMessage)),qj=typeof queueMicrotask<"u"?queueMicrotask.bind(Ni):typeof process<"u"&&process.nextTick||ab,ge={isArray:qa,isArrayBuffer:Y1,isBuffer:ej,isFormData:cj,isArrayBufferView:tj,isString:rj,isNumber:eb,isBoolean:nj,isObject:Ru,isPlainObject:ys,isReadableStream:fj,isRequest:pj,isResponse:mj,isHeaders:dj,isUndefined:lo,isDate:ij,isFile:aj,isBlob:oj,isRegExp:Cj,isFunction:xr,isStream:uj,isURLSearchParams:lj,isTypedArray:Nj,isFileList:sj,forEach:To,merge:Gc,extend:gj,trim:hj,stripBOM:vj,inherits:yj,toFlatObject:bj,kindOf:ku,kindOfTest:Qr,endsWith:xj,toArray:wj,forEachEntry:Dj,matchAll:Ej,isHTMLForm:Aj,hasOwnProperty:h0,hasOwnProp:h0,reduceDescriptors:nb,freezeMethods:Mj,toObjectSet:_j,toCamelCase:Sj,noop:Fj,toFiniteNumber:Tj,findKey:tb,global:Ni,isContextDefined:rb,ALPHABET:ib,generateString:Oj,isSpecCompliantForm:Bj,toJSONObject:kj,isAsyncFn:Ij,isThenable:Rj,setImmediate:ab,asap:qj};function We(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}ge.inherits(We,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ge.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const ob=We.prototype,sb={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{sb[e]={value:e}});Object.defineProperties(We,sb);Object.defineProperty(ob,"isAxiosError",{value:!0});We.from=(e,t,r,n,i,a)=>{const o=Object.create(ob);return ge.toFlatObject(e,o,function(u){return u!==Error.prototype},u=>u!=="isAxiosError"),We.call(o,e.message,t,r,n,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};const zj=null;function Wc(e){return ge.isPlainObject(e)||ge.isArray(e)}function ub(e){return ge.endsWith(e,"[]")?e.slice(0,-2):e}function v0(e,t,r){return e?e.concat(t).map(function(n,i){return n=ub(n),!r&&i?"["+n+"]":n}).join(r?".":""):t}function jj(e){return ge.isArray(e)&&!e.some(Wc)}const Lj=ge.toFlatObject(ge,{},null,function(e){return/^is[A-Z]/.test(e)});function qu(e,t,r){if(!ge.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=ge.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,d){return!ge.isUndefined(d[m])});const n=r.metaTokens,i=r.visitor||l,a=r.dots,o=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&ge.isSpecCompliantForm(t);if(!ge.isFunction(i))throw new TypeError("visitor must be a function");function c(m){if(m===null)return"";if(ge.isDate(m))return m.toISOString();if(!u&&ge.isBlob(m))throw new We("Blob is not supported. Use a Buffer instead.");return ge.isArrayBuffer(m)||ge.isTypedArray(m)?u&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function l(m,d,h){let w=m;if(m&&!h&&typeof m=="object"){if(ge.endsWith(d,"{}"))d=n?d:d.slice(0,-2),m=JSON.stringify(m);else if(ge.isArray(m)&&jj(m)||(ge.isFileList(m)||ge.endsWith(d,"[]"))&&(w=ge.toArray(m)))return d=ub(d),w.forEach(function(v,x){!(ge.isUndefined(v)||v===null)&&t.append(o===!0?v0([d],x,a):o===null?d:d+"[]",c(v))}),!1}return Wc(m)?!0:(t.append(v0(h,d,a),c(m)),!1)}const s=[],f=Object.assign(Lj,{defaultVisitor:l,convertValue:c,isVisitable:Wc});function p(m,d){if(!ge.isUndefined(m)){if(s.indexOf(m)!==-1)throw Error("Circular reference detected in "+d.join("."));s.push(m),ge.forEach(m,function(h,w){(!(ge.isUndefined(h)||h===null)&&i.call(t,h,ge.isString(w)?w.trim():w,d,f))===!0&&p(h,d?d.concat(w):[w])}),s.pop()}}if(!ge.isObject(e))throw new TypeError("data must be an object");return p(e),t}function y0(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function af(e,t){this._pairs=[],e&&qu(e,this,t)}const cb=af.prototype;cb.append=function(e,t){this._pairs.push([e,t])};cb.toString=function(e){const t=e?function(r){return e.call(this,r,y0)}:y0;return this._pairs.map(function(r){return t(r[0])+"="+t(r[1])},"").join("&")};function Pj(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function lb(e,t,r){if(!t)return e;const n=r&&r.encode||Pj,i=r&&r.serialize;let a;if(i?a=i(t,r):a=ge.isURLSearchParams(t)?t.toString():new af(t,r).toString(n),a){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class b0{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ge.forEach(this.handlers,function(r){r!==null&&t(r)})}}const fb={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Vj=typeof URLSearchParams<"u"?URLSearchParams:af,Uj=typeof FormData<"u"?FormData:null,$j=typeof Blob<"u"?Blob:null,Hj={isBrowser:!0,classes:{URLSearchParams:Vj,FormData:Uj,Blob:$j},protocols:["http","https","file","blob","url","data"]},of=typeof window<"u"&&typeof document<"u",Jj=(e=>of&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),Gj=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Wj=of&&window.location.href||"http://localhost",Kj=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:of,hasStandardBrowserEnv:Jj,hasStandardBrowserWebWorkerEnv:Gj,origin:Wj},Symbol.toStringTag,{value:"Module"})),Vr={...Kj,...Hj};function Qj(e,t){return qu(e,new Vr.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,a){return Vr.isNode&&ge.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function Zj(e){return ge.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Xj(e){const t={},r=Object.keys(e);let n;const i=r.length;let a;for(n=0;n<i;n++)a=r[n],t[a]=e[a];return t}function pb(e){function t(r,n,i,a){let o=r[a++];if(o==="__proto__")return!0;const u=Number.isFinite(+o),c=a>=r.length;return o=!o&&ge.isArray(i)?i.length:o,c?(ge.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!u):((!i[o]||!ge.isObject(i[o]))&&(i[o]=[]),t(r,n,i[o],a)&&ge.isArray(i[o])&&(i[o]=Xj(i[o])),!u)}if(ge.isFormData(e)&&ge.isFunction(e.entries)){const r={};return ge.forEachEntry(e,(n,i)=>{t(Zj(n),i,r,0)}),r}return null}function Yj(e,t,r){if(ge.isString(e))try{return(t||JSON.parse)(e),ge.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Oo={transitional:fb,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=ge.isObject(e);if(i&&ge.isHTMLForm(e)&&(e=new FormData(e)),ge.isFormData(e))return n?JSON.stringify(pb(e)):e;if(ge.isArrayBuffer(e)||ge.isBuffer(e)||ge.isStream(e)||ge.isFile(e)||ge.isBlob(e)||ge.isReadableStream(e))return e;if(ge.isArrayBufferView(e))return e.buffer;if(ge.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Qj(e,this.formSerializer).toString();if((a=ge.isFileList(e))||r.indexOf("multipart/form-data")>-1){const o=this.env&&this.env.FormData;return qu(a?{"files[]":e}:e,o&&new o,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),Yj(e)):e}],transformResponse:[function(e){const t=this.transitional||Oo.transitional,r=t&&t.forcedJSONParsing,n=this.responseType==="json";if(ge.isResponse(e)||ge.isReadableStream(e))return e;if(e&&ge.isString(e)&&(r&&!this.responseType||n)){const i=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(a){if(i)throw a.name==="SyntaxError"?We.from(a,We.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Vr.classes.FormData,Blob:Vr.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ge.forEach(["delete","get","head","post","put","patch"],e=>{Oo.headers[e]={}});const eL=ge.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),tL=e=>{const t={};let r,n,i;return e&&e.split(`
|
|
72
|
+
`).forEach(function(a){i=a.indexOf(":"),r=a.substring(0,i).trim().toLowerCase(),n=a.substring(i+1).trim(),!(!r||t[r]&&eL[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},x0=Symbol("internals");function Ja(e){return e&&String(e).trim().toLowerCase()}function bs(e){return e===!1||e==null?e:ge.isArray(e)?e.map(bs):String(e)}function rL(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const nL=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function gc(e,t,r,n,i){if(ge.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!ge.isString(t)){if(ge.isString(n))return t.indexOf(n)!==-1;if(ge.isRegExp(n))return n.test(t)}}function iL(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function aL(e,t){const r=ge.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,a,o){return this[n].call(this,t,i,a,o)},configurable:!0})})}class hr{constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function a(u,c,l){const s=Ja(c);if(!s)throw new Error("header name must be a non-empty string");const f=ge.findKey(i,s);(!f||i[f]===void 0||l===!0||l===void 0&&i[f]!==!1)&&(i[f||c]=bs(u))}const o=(u,c)=>ge.forEach(u,(l,s)=>a(l,s,c));if(ge.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if(ge.isString(t)&&(t=t.trim())&&!nL(t))o(tL(t),r);else if(ge.isHeaders(t))for(const[u,c]of t.entries())a(c,u,n);else t!=null&&a(r,t,n);return this}get(t,r){if(t=Ja(t),t){const n=ge.findKey(this,t);if(n){const i=this[n];if(!r)return i;if(r===!0)return rL(i);if(ge.isFunction(r))return r.call(this,i,n);if(ge.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Ja(t),t){const n=ge.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||gc(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let i=!1;function a(o){if(o=Ja(o),o){const u=ge.findKey(n,o);u&&(!r||gc(n,n[u],u,r))&&(delete n[u],i=!0)}}return ge.isArray(t)?t.forEach(a):a(t),i}clear(t){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const a=r[n];(!t||gc(this,this[a],a,t,!0))&&(delete this[a],i=!0)}return i}normalize(t){const r=this,n={};return ge.forEach(this,(i,a)=>{const o=ge.findKey(n,a);if(o){r[o]=bs(i),delete r[a];return}const u=t?iL(a):String(a).trim();u!==a&&delete r[a],r[u]=bs(i),n[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return ge.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&ge.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
|
|
73
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){const r=(this[x0]=this[x0]={accessors:{}}).accessors,n=this.prototype;function i(a){const o=Ja(a);r[o]||(aL(n,a),r[o]=!0)}return ge.isArray(t)?t.forEach(i):i(t),this}}hr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ge.reduceDescriptors(hr.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});ge.freezeMethods(hr);function vc(e,t){const r=this||Oo,n=t||r,i=hr.from(n.headers);let a=n.data;return ge.forEach(e,function(o){a=o.call(r,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function mb(e){return!!(e&&e.__CANCEL__)}function za(e,t,r){We.call(this,e??"canceled",We.ERR_CANCELED,t,r),this.name="CanceledError"}ge.inherits(za,We,{__CANCEL__:!0});function db(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new We("Request failed with status code "+r.status,[We.ERR_BAD_REQUEST,We.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function oL(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function sL(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,a=0,o;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),l=n[a];o||(o=c),r[i]=u,n[i]=c;let s=a,f=0;for(;s!==i;)f+=r[s++],s=s%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;const p=l&&c-l;return p?Math.round(f*1e3/p):void 0}}function uL(e,t){let r=0,n=1e3/t,i,a;const o=(u,c=Date.now())=>{r=c,i=null,a&&(clearTimeout(a),a=null),e.apply(null,u)};return[(...u)=>{const c=Date.now(),l=c-r;l>=n?o(u,c):(i=u,a||(a=setTimeout(()=>{a=null,o(i)},n-l)))},()=>i&&o(i)]}const Xs=(e,t,r=3)=>{let n=0;const i=sL(50,250);return uL(a=>{const o=a.loaded,u=a.lengthComputable?a.total:void 0,c=o-n,l=i(c),s=o<=u;n=o;const f={loaded:o,total:u,progress:u?o/u:void 0,bytes:c,rate:l||void 0,estimated:l&&u&&s?(u-o)/l:void 0,event:a,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(f)},r)},w0=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},N0=e=>(...t)=>ge.asap(()=>e(...t)),cL=Vr.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(i){let a=i;return e&&(t.setAttribute("href",a),a=t.href),t.setAttribute("href",a),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(i){const a=ge.isString(i)?n(i):i;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}(),lL=Vr.hasStandardBrowserEnv?{write(e,t,r,n,i,a){const o=[e+"="+encodeURIComponent(t)];ge.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),ge.isString(n)&&o.push("path="+n),ge.isString(i)&&o.push("domain="+i),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function fL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function pL(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function hb(e,t){return e&&!fL(t)?pL(e,t):t}const D0=e=>e instanceof hr?{...e}:e;function Bi(e,t){t=t||{};const r={};function n(l,s,f){return ge.isPlainObject(l)&&ge.isPlainObject(s)?ge.merge.call({caseless:f},l,s):ge.isPlainObject(s)?ge.merge({},s):ge.isArray(s)?s.slice():s}function i(l,s,f){if(ge.isUndefined(s)){if(!ge.isUndefined(l))return n(void 0,l,f)}else return n(l,s,f)}function a(l,s){if(!ge.isUndefined(s))return n(void 0,s)}function o(l,s){if(ge.isUndefined(s)){if(!ge.isUndefined(l))return n(void 0,l)}else return n(void 0,s)}function u(l,s,f){if(f in t)return n(l,s);if(f in e)return n(void 0,l)}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:u,headers:(l,s)=>i(D0(l),D0(s),!0)};return ge.forEach(Object.keys(Object.assign({},e,t)),function(l){const s=c[l]||i,f=s(e[l],t[l],l);ge.isUndefined(f)&&s!==u||(r[l]=f)}),r}const gb=e=>{const t=Bi({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:u}=t;t.headers=o=hr.from(o),t.url=lb(hb(t.baseURL,t.url),e.params,e.paramsSerializer),u&&o.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let c;if(ge.isFormData(r)){if(Vr.hasStandardBrowserEnv||Vr.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[l,...s]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([l||"multipart/form-data",...s].join("; "))}}if(Vr.hasStandardBrowserEnv&&(n&&ge.isFunction(n)&&(n=n(t)),n||n!==!1&&cL(t.url))){const l=i&&a&&lL.read(a);l&&o.set(i,l)}return t},mL=typeof XMLHttpRequest<"u",dL=mL&&function(e){return new Promise(function(t,r){const n=gb(e);let i=n.data;const a=hr.from(n.headers).normalize();let{responseType:o,onUploadProgress:u,onDownloadProgress:c}=n,l,s,f,p,m;function d(){p&&p(),m&&m(),n.cancelToken&&n.cancelToken.unsubscribe(l),n.signal&&n.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(n.method.toUpperCase(),n.url,!0),h.timeout=n.timeout;function w(){if(!h)return;const x=hr.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),g={data:!o||o==="text"||o==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:x,config:e,request:h};db(function(b){t(b),d()},function(b){r(b),d()},g),h=null}"onloadend"in h?h.onloadend=w:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(w)},h.onabort=function(){h&&(r(new We("Request aborted",We.ECONNABORTED,e,h)),h=null)},h.onerror=function(){r(new We("Network Error",We.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let x=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const g=n.transitional||fb;n.timeoutErrorMessage&&(x=n.timeoutErrorMessage),r(new We(x,g.clarifyTimeoutError?We.ETIMEDOUT:We.ECONNABORTED,e,h)),h=null},i===void 0&&a.setContentType(null),"setRequestHeader"in h&&ge.forEach(a.toJSON(),function(x,g){h.setRequestHeader(g,x)}),ge.isUndefined(n.withCredentials)||(h.withCredentials=!!n.withCredentials),o&&o!=="json"&&(h.responseType=n.responseType),c&&([f,m]=Xs(c,!0),h.addEventListener("progress",f)),u&&h.upload&&([s,p]=Xs(u),h.upload.addEventListener("progress",s),h.upload.addEventListener("loadend",p)),(n.cancelToken||n.signal)&&(l=x=>{h&&(r(!x||x.type?new za(null,e,h):x),h.abort(),h=null)},n.cancelToken&&n.cancelToken.subscribe(l),n.signal&&(n.signal.aborted?l():n.signal.addEventListener("abort",l)));const v=oL(n.url);if(v&&Vr.protocols.indexOf(v)===-1){r(new We("Unsupported protocol "+v+":",We.ERR_BAD_REQUEST,e));return}h.send(i||null)})},hL=(e,t)=>{let r=new AbortController,n;const i=function(c){if(!n){n=!0,o();const l=c instanceof Error?c:this.reason;r.abort(l instanceof We?l:new za(l instanceof Error?l.message:l))}};let a=t&&setTimeout(()=>{i(new We(`timeout ${t} of ms exceeded`,We.ETIMEDOUT))},t);const o=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(c=>{c&&(c.removeEventListener?c.removeEventListener("abort",i):c.unsubscribe(i))}),e=null)};e.forEach(c=>c&&c.addEventListener&&c.addEventListener("abort",i));const{signal:u}=r;return u.unsubscribe=o,[u,()=>{a&&clearTimeout(a),a=null}]},gL=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let n=0,i;for(;n<r;)i=n+t,yield e.slice(n,i),n=i},vL=async function*(e,t,r){for await(const n of e)yield*gL(ArrayBuffer.isView(n)?n:await r(String(n)),t)},E0=(e,t,r,n,i)=>{const a=vL(e,t,i);let o=0,u,c=l=>{u||(u=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:s,value:f}=await a.next();if(s){c(),l.close();return}let p=f.byteLength;if(r){let m=o+=p;r(m)}l.enqueue(new Uint8Array(f))}catch(s){throw c(s),s}},cancel(l){return c(l),a.return()}},{highWaterMark:2})},zu=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",vb=zu&&typeof ReadableStream=="function",Kc=zu&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),yb=(e,...t)=>{try{return!!e(...t)}catch{return!1}},yL=vb&&yb(()=>{let e=!1;const t=new Request(Vr.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),A0=64*1024,Qc=vb&&yb(()=>ge.isReadableStream(new Response("").body)),Ys={stream:Qc&&(e=>e.body)};zu&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Ys[t]&&(Ys[t]=ge.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new We(`Response type '${t}' is not supported`,We.ERR_NOT_SUPPORT,n)})})})(new Response);const bL=async e=>{if(e==null)return 0;if(ge.isBlob(e))return e.size;if(ge.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(ge.isArrayBufferView(e)||ge.isArrayBuffer(e))return e.byteLength;if(ge.isURLSearchParams(e)&&(e=e+""),ge.isString(e))return(await Kc(e)).byteLength},xL=async(e,t)=>ge.toFiniteNumber(e.getContentLength())??bL(t),wL=zu&&(async e=>{let{url:t,method:r,data:n,signal:i,cancelToken:a,timeout:o,onDownloadProgress:u,onUploadProgress:c,responseType:l,headers:s,withCredentials:f="same-origin",fetchOptions:p}=gb(e);l=l?(l+"").toLowerCase():"text";let[m,d]=i||a||o?hL([i,a],o):[],h,w;const v=()=>{!h&&setTimeout(()=>{m&&m.unsubscribe()}),h=!0};let x;try{if(c&&yL&&r!=="get"&&r!=="head"&&(x=await xL(s,n))!==0){let N=new Request(t,{method:"POST",body:n,duplex:"half"}),E;if(ge.isFormData(n)&&(E=N.headers.get("content-type"))&&s.setContentType(E),N.body){const[A,D]=w0(x,Xs(N0(c)));n=E0(N.body,A0,A,D,Kc)}}ge.isString(f)||(f=f?"include":"omit"),w=new Request(t,{...p,signal:m,method:r.toUpperCase(),headers:s.normalize().toJSON(),body:n,duplex:"half",credentials:f});let g=await fetch(w);const b=Qc&&(l==="stream"||l==="response");if(Qc&&(u||b)){const N={};["status","statusText","headers"].forEach(S=>{N[S]=g[S]});const E=ge.toFiniteNumber(g.headers.get("content-length")),[A,D]=u&&w0(E,Xs(N0(u),!0))||[];g=new Response(E0(g.body,A0,A,()=>{D&&D(),b&&v()},Kc),N)}l=l||"text";let y=await Ys[ge.findKey(Ys,l)||"text"](g,e);return!b&&v(),d&&d(),await new Promise((N,E)=>{db(N,E,{data:y,headers:hr.from(g.headers),status:g.status,statusText:g.statusText,config:e,request:w})})}catch(g){throw v(),g&&g.name==="TypeError"&&/fetch/i.test(g.message)?Object.assign(new We("Network Error",We.ERR_NETWORK,e,w),{cause:g.cause||g}):We.from(g,g&&g.code,e,w)}}),Zc={http:zj,xhr:dL,fetch:wL};ge.forEach(Zc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const S0=e=>`- ${e}`,NL=e=>ge.isFunction(e)||e===null||e===!1,bb={getAdapter:e=>{e=ge.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let a=0;a<t;a++){r=e[a];let o;if(n=r,!NL(r)&&(n=Zc[(o=String(r)).toLowerCase()],n===void 0))throw new We(`Unknown adapter '${o}'`);if(n)break;i[o||"#"+a]=n}if(!n){const a=Object.entries(i).map(([u,c])=>`adapter ${u} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=t?a.length>1?`since :
|
|
74
|
+
`+a.map(S0).join(`
|
|
75
|
+
`):" "+S0(a[0]):"as no adapter specified";throw new We("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:Zc};function yc(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new za(null,e)}function C0(e){return yc(e),e.headers=hr.from(e.headers),e.data=vc.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),bb.getAdapter(e.adapter||Oo.adapter)(e).then(function(t){return yc(e),t.data=vc.call(e,e.transformResponse,t),t.headers=hr.from(t.headers),t},function(t){return mb(t)||(yc(e),t&&t.response&&(t.response.data=vc.call(e,e.transformResponse,t.response),t.response.headers=hr.from(t.response.headers))),Promise.reject(t)})}const xb="1.7.4",sf={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{sf[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const M0={};sf.transitional=function(e,t,r){function n(i,a){return"[Axios v"+xb+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,o)=>{if(e===!1)throw new We(n(a," has been removed"+(t?" in "+t:"")),We.ERR_DEPRECATED);return t&&!M0[a]&&(M0[a]=!0,console.warn(n(a," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,a,o):!0}};function DL(e,t,r){if(typeof e!="object")throw new We("options must be an object",We.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const a=n[i],o=t[a];if(o){const u=e[a],c=u===void 0||o(u,a,e);if(c!==!0)throw new We("option "+a+" must be "+c,We.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new We("Unknown option "+a,We.ERR_BAD_OPTION)}}const Xc={assertOptions:DL,validators:sf},qn=Xc.validators;class Ei{constructor(t){this.defaults=t,this.interceptors={request:new b0,response:new b0}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const a=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?a&&!String(n.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
76
|
+
`+a):n.stack=a}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Bi(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:a}=r;n!==void 0&&Xc.assertOptions(n,{silentJSONParsing:qn.transitional(qn.boolean),forcedJSONParsing:qn.transitional(qn.boolean),clarifyTimeoutError:qn.transitional(qn.boolean)},!1),i!=null&&(ge.isFunction(i)?r.paramsSerializer={serialize:i}:Xc.assertOptions(i,{encode:qn.function,serialize:qn.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=a&&ge.merge(a.common,a[r.method]);a&&ge.forEach(["delete","get","head","post","put","patch","common"],d=>{delete a[d]}),r.headers=hr.concat(o,a);const u=[];let c=!0;this.interceptors.request.forEach(function(d){typeof d.runWhen=="function"&&d.runWhen(r)===!1||(c=c&&d.synchronous,u.unshift(d.fulfilled,d.rejected))});const l=[];this.interceptors.response.forEach(function(d){l.push(d.fulfilled,d.rejected)});let s,f=0,p;if(!c){const d=[C0.bind(this),void 0];for(d.unshift.apply(d,u),d.push.apply(d,l),p=d.length,s=Promise.resolve(r);f<p;)s=s.then(d[f++],d[f++]);return s}p=u.length;let m=r;for(f=0;f<p;){const d=u[f++],h=u[f++];try{m=d(m)}catch(w){h.call(this,w);break}}try{s=C0.call(this,m)}catch(d){return Promise.reject(d)}for(f=0,p=l.length;f<p;)s=s.then(l[f++],l[f++]);return s}getUri(t){t=Bi(this.defaults,t);const r=hb(t.baseURL,t.url);return lb(r,t.params,t.paramsSerializer)}}ge.forEach(["delete","get","head","options"],function(e){Ei.prototype[e]=function(t,r){return this.request(Bi(r||{},{method:e,url:t,data:(r||{}).data}))}});ge.forEach(["post","put","patch"],function(e){function t(r){return function(n,i,a){return this.request(Bi(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}Ei.prototype[e]=t(),Ei.prototype[e+"Form"]=t(!0)});class uf{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(i=>{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](i);n._listeners=null}),this.promise.then=i=>{let a;const o=new Promise(u=>{n.subscribe(u),a=u}).then(i);return o.cancel=function(){n.unsubscribe(a)},o},t(function(i,a,o){n.reason||(n.reason=new za(i,a,o),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new uf(function(r){t=r}),cancel:t}}}function EL(e){return function(t){return e.apply(null,t)}}function AL(e){return ge.isObject(e)&&e.isAxiosError===!0}const Yc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Yc).forEach(([e,t])=>{Yc[t]=e});function wb(e){const t=new Ei(e),r=X1(Ei.prototype.request,t);return ge.extend(r,Ei.prototype,t,{allOwnKeys:!0}),ge.extend(r,t,null,{allOwnKeys:!0}),r.create=function(n){return wb(Bi(e,n))},r}const kt=wb(Oo);kt.Axios=Ei;kt.CanceledError=za;kt.CancelToken=uf;kt.isCancel=mb;kt.VERSION=xb;kt.toFormData=qu;kt.AxiosError=We;kt.Cancel=kt.CanceledError;kt.all=function(e){return Promise.all(e)};kt.spread=EL;kt.isAxiosError=AL;kt.mergeConfig=Bi;kt.AxiosHeaders=hr;kt.formToJSON=e=>pb(ge.isHTMLForm(e)?new FormData(e):e);kt.getAdapter=bb.getAdapter;kt.HttpStatusCode=Yc;kt.default=kt;/**
|
|
77
77
|
* @vue/shared v3.4.38
|
|
78
78
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
79
79
|
* @license MIT
|
|
80
|
-
**//*! #__NO_SIDE_EFFECTS__ */function
|
|
80
|
+
**//*! #__NO_SIDE_EFFECTS__ */function ja(e,t){const r=new Set(e.split(","));return n=>r.has(n)}const vt=process.env.NODE_ENV!=="production"?Object.freeze({}):{},sa=process.env.NODE_ENV!=="production"?Object.freeze([]):[],St=()=>{},SL=()=>!1,Bo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),eu=e=>e.startsWith("onUpdate:"),Et=Object.assign,cf=(e,t)=>{const r=e.indexOf(t);r>-1&&e.splice(r,1)},CL=Object.prototype.hasOwnProperty,tt=(e,t)=>CL.call(e,t),Oe=Array.isArray,Ai=e=>ju(e)==="[object Map]",Nb=e=>ju(e)==="[object Set]",Be=e=>typeof e=="function",xt=e=>typeof e=="string",fi=e=>typeof e=="symbol",lt=e=>e!==null&&typeof e=="object",lf=e=>(lt(e)||Be(e))&&Be(e.then)&&Be(e.catch),Db=Object.prototype.toString,ju=e=>Db.call(e),ff=e=>ju(e).slice(8,-1),Eb=e=>ju(e)==="[object Object]",pf=e=>xt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,to=ja(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ML=ja("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),Lu=e=>{const t=Object.create(null);return r=>t[r]||(t[r]=e(r))},_L=/-(\w)/g,wr=Lu(e=>e.replace(_L,(t,r)=>r?r.toUpperCase():"")),FL=/\B([A-Z])/g,Cn=Lu(e=>e.replace(FL,"-$1").toLowerCase()),ki=Lu(e=>e.charAt(0).toUpperCase()+e.slice(1)),vi=Lu(e=>e?`on${ki(e)}`:""),ei=(e,t)=>!Object.is(e,t),Ga=(e,...t)=>{for(let r=0;r<e.length;r++)e[r](...t)},tu=(e,t,r,n=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:r})},TL=e=>{const t=parseFloat(e);return isNaN(t)?e:t},OL=e=>{const t=xt(e)?Number(e):NaN;return isNaN(t)?e:t};let _0;const mf=()=>_0||(_0=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ko(e){if(Oe(e)){const t={};for(let r=0;r<e.length;r++){const n=e[r],i=xt(n)?RL(n):ko(n);if(i)for(const a in i)t[a]=i[a]}return t}else if(xt(e)||lt(e))return e}const BL=/;(?![^(]*\))/g,kL=/:([^]+)/,IL=/\/\*[^]*?\*\//g;function RL(e){const t={};return e.replace(IL,"").split(BL).forEach(r=>{if(r){const n=r.split(kL);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Rr(e){let t="";if(xt(e))t=e;else if(Oe(e))for(let r=0;r<e.length;r++){const n=Rr(e[r]);n&&(t+=n+" ")}else if(lt(e))for(const r in e)e[r]&&(t+=r+" ");return t.trim()}const qL="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",zL=ja(qL);function Ab(e){return!!e||e===""}const Sb=e=>!!(e&&e.__v_isRef===!0),df=e=>xt(e)?e:e==null?"":Oe(e)||lt(e)&&(e.toString===Db||!Be(e.toString))?Sb(e)?df(e.value):JSON.stringify(e,Cb,2):String(e),Cb=(e,t)=>Sb(t)?Cb(e,t.value):Ai(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((r,[n,i],a)=>(r[bc(n,a)+" =>"]=i,r),{})}:Nb(t)?{[`Set(${t.size})`]:[...t.values()].map(r=>bc(r))}:fi(t)?bc(t):lt(t)&&!Oe(t)&&!Eb(t)?String(t):t,bc=(e,t="")=>{var r;return fi(e)?`Symbol(${(r=e.description)!=null?r:t})`:e};/**
|
|
81
81
|
* @vue/reactivity v3.4.38
|
|
82
82
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
83
83
|
* @license MIT
|
|
84
|
-
**/function Mn(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let yr;class qL{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=yr,!t&&yr&&(this.index=(yr.scopes||(yr.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const r=yr;try{return yr=this,t()}finally{yr=r}}else process.env.NODE_ENV!=="production"&&Mn("cannot run an inactive effect scope.")}on(){yr=this}off(){yr=this.parent}stop(t){if(this._active){let r,n;for(r=0,n=this.effects.length;r<n;r++)this.effects[r].stop();for(r=0,n=this.cleanups.length;r<n;r++)this.cleanups[r]();if(this.scopes)for(r=0,n=this.scopes.length;r<n;r++)this.scopes[r].stop(!0);if(!this.detached&&this.parent&&!t){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0,this._active=!1}}}function zL(e,t=yr){t&&t.active&&t.effects.push(e)}function Cx(){return yr}function jL(e){yr?yr.cleanups.push(e):process.env.NODE_ENV!=="production"&&Mn("onScopeDispose() is called when there is no active effect scope to be associated with.")}let Si;class df{constructor(t,r,n,i){this.fn=t,this.trigger=r,this.scheduler=n,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,zL(this,i)}get dirty(){if(this._dirtyLevel===2||this._dirtyLevel===3){this._dirtyLevel=1,kn();for(let t=0;t<this._depsLength;t++){const r=this.deps[t];if(r.computed&&(LL(r.computed),this._dirtyLevel>=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),In()}return this._dirtyLevel>=4}set dirty(t){this._dirtyLevel=t?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=Qn,r=Si;try{return Qn=!0,Si=this,this._runnings++,_0(this),this.fn()}finally{F0(this),this._runnings--,Si=r,Qn=t}}stop(){this.active&&(_0(this),F0(this),this.onStop&&this.onStop(),this.active=!1)}}function LL(e){return e.value}function _0(e){e._trackId++,e._depsLength=0}function F0(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t<e.deps.length;t++)Mx(e.deps[t],e);e.deps.length=e._depsLength}}function Mx(e,t){const r=e.get(t);r!==void 0&&t._trackId!==r&&(e.delete(t),e.size===0&&e.cleanup())}let Qn=!0,Yc=0;const _x=[];function kn(){_x.push(Qn),Qn=!1}function In(){const e=_x.pop();Qn=e===void 0?!0:e}function hf(){Yc++}function gf(){for(Yc--;!Yc&&el.length;)el.shift()()}function Fx(e,t,r){var n;if(t.get(e)!==e._trackId){t.set(e,e._trackId);const i=e.deps[e._depsLength];i!==t?(i&&Mx(i,e),e.deps[e._depsLength++]=t):e._depsLength++,process.env.NODE_ENV!=="production"&&((n=e.onTrack)==null||n.call(e,Et({effect:e},r)))}}const el=[];function Tx(e,t,r){var n;hf();for(const i of e.keys()){let a;i._dirtyLevel<t&&(a??(a=e.get(i)===i._trackId))&&(i._shouldSchedule||(i._shouldSchedule=i._dirtyLevel===0),i._dirtyLevel=t),i._shouldSchedule&&(a??(a=e.get(i)===i._trackId))&&(process.env.NODE_ENV!=="production"&&((n=i.onTrigger)==null||n.call(i,Et({effect:i},r))),i.trigger(),(!i._runnings||i.allowRecurse)&&i._dirtyLevel!==2&&(i._shouldSchedule=!1,i.scheduler&&el.push(i.scheduler)))}gf()}const Ox=(e,t)=>{const r=new Map;return r.cleanup=e,r.computed=t,r},tl=new WeakMap,Ci=Symbol(process.env.NODE_ENV!=="production"?"iterate":""),rl=Symbol(process.env.NODE_ENV!=="production"?"Map key iterate":"");function Ht(e,t,r){if(Qn&&Si){let n=tl.get(e);n||tl.set(e,n=new Map);let i=n.get(r);i||n.set(r,i=Ox(()=>n.delete(r))),Fx(Si,i,process.env.NODE_ENV!=="production"?{target:e,type:t,key:r}:void 0)}}function nn(e,t,r,n,i,a){const o=tl.get(e);if(!o)return;let u=[];if(t==="clear")u=[...o.values()];else if(r==="length"&&Oe(e)){const c=Number(n);o.forEach((l,s)=>{(s==="length"||!fi(s)&&s>=c)&&u.push(l)})}else switch(r!==void 0&&u.push(o.get(r)),t){case"add":Oe(e)?ff(r)&&u.push(o.get("length")):(u.push(o.get(Ci)),Ai(e)&&u.push(o.get(rl)));break;case"delete":Oe(e)||(u.push(o.get(Ci)),Ai(e)&&u.push(o.get(rl)));break;case"set":Ai(e)&&u.push(o.get(Ci));break}hf();for(const c of u)c&&Tx(c,4,process.env.NODE_ENV!=="production"?{target:e,type:t,key:r,newValue:n,oldValue:i,oldTarget:a}:void 0);gf()}const PL=za("__proto__,__v_isRef,__isVue"),Bx=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(fi)),T0=VL();function VL(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...r){const n=Ye(this);for(let a=0,o=this.length;a<o;a++)Ht(n,"get",a+"");const i=n[t](...r);return i===-1||i===!1?n[t](...r.map(Ye)):i}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...r){kn(),hf();const n=Ye(this)[t].apply(this,r);return gf(),In(),n}}),e}function UL(e){fi(e)||(e=String(e));const t=Ye(this);return Ht(t,"has",e),t.hasOwnProperty(e)}class kx{constructor(t=!1,r=!1){this._isReadonly=t,this._isShallow=r}get(t,r,n){const i=this._isReadonly,a=this._isShallow;if(r==="__v_isReactive")return!i;if(r==="__v_isReadonly")return i;if(r==="__v_isShallow")return a;if(r==="__v_raw")return n===(i?a?Px:Lx:a?jx:zx).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const o=Oe(t);if(!i){if(o&&tt(T0,r))return Reflect.get(T0,r,n);if(r==="hasOwnProperty")return UL}const u=Reflect.get(t,r,n);return(fi(r)?Bx.has(r):PL(r))||(i||Ht(t,"get",r),a)?u:Lt(u)?o&&ff(r)?u:u.value:lt(u)?i?xf(u):yf(u):u}}class Ix extends kx{constructor(t=!1){super(!1,t)}set(t,r,n,i){let a=t[r];if(!this._isShallow){const c=_n(a);if(!Dn(n)&&!_n(n)&&(a=Ye(a),n=Ye(n)),!Oe(t)&&Lt(a)&&!Lt(n))return c?!1:(a.value=n,!0)}const o=Oe(t)&&ff(r)?Number(r)<t.length:tt(t,r),u=Reflect.set(t,r,n,i);return t===Ye(i)&&(o?ei(n,a)&&nn(t,"set",r,n,a):nn(t,"add",r,n)),u}deleteProperty(t,r){const n=tt(t,r),i=t[r],a=Reflect.deleteProperty(t,r);return a&&n&&nn(t,"delete",r,void 0,i),a}has(t,r){const n=Reflect.has(t,r);return(!fi(r)||!Bx.has(r))&&Ht(t,"has",r),n}ownKeys(t){return Ht(t,"iterate",Oe(t)?"length":Ci),Reflect.ownKeys(t)}}class Rx extends kx{constructor(t=!1){super(!0,t)}set(t,r){return process.env.NODE_ENV!=="production"&&Mn(`Set operation on key "${String(r)}" failed: target is readonly.`,t),!0}deleteProperty(t,r){return process.env.NODE_ENV!=="production"&&Mn(`Delete operation on key "${String(r)}" failed: target is readonly.`,t),!0}}const $L=new Ix,HL=new Rx,JL=new Ix(!0),GL=new Rx(!0),vf=e=>e,Lu=e=>Reflect.getPrototypeOf(e);function os(e,t,r=!1,n=!1){e=e.__v_raw;const i=Ye(e),a=Ye(t);r||(ei(t,a)&&Ht(i,"get",t),Ht(i,"get",a));const{has:o}=Lu(i),u=n?vf:r?bf:lo;if(o.call(i,t))return u(e.get(t));if(o.call(i,a))return u(e.get(a));e!==i&&e.get(t)}function ss(e,t=!1){const r=this.__v_raw,n=Ye(r),i=Ye(e);return t||(ei(e,i)&&Ht(n,"has",e),Ht(n,"has",i)),e===i?r.has(e):r.has(e)||r.has(i)}function us(e,t=!1){return e=e.__v_raw,!t&&Ht(Ye(e),"iterate",Ci),Reflect.get(e,"size",e)}function O0(e,t=!1){!t&&!Dn(e)&&!_n(e)&&(e=Ye(e));const r=Ye(this);return Lu(r).has.call(r,e)||(r.add(e),nn(r,"add",e,e)),this}function B0(e,t,r=!1){!r&&!Dn(t)&&!_n(t)&&(t=Ye(t));const n=Ye(this),{has:i,get:a}=Lu(n);let o=i.call(n,e);o?process.env.NODE_ENV!=="production"&&qx(n,i,e):(e=Ye(e),o=i.call(n,e));const u=a.call(n,e);return n.set(e,t),o?ei(t,u)&&nn(n,"set",e,t,u):nn(n,"add",e,t),this}function k0(e){const t=Ye(this),{has:r,get:n}=Lu(t);let i=r.call(t,e);i?process.env.NODE_ENV!=="production"&&qx(t,r,e):(e=Ye(e),i=r.call(t,e));const a=n?n.call(t,e):void 0,o=t.delete(e);return i&&nn(t,"delete",e,void 0,a),o}function I0(){const e=Ye(this),t=e.size!==0,r=process.env.NODE_ENV!=="production"?Ai(e)?new Map(e):new Set(e):void 0,n=e.clear();return t&&nn(e,"clear",void 0,void 0,r),n}function cs(e,t){return function(r,n){const i=this,a=i.__v_raw,o=Ye(a),u=t?vf:e?bf:lo;return!e&&Ht(o,"iterate",Ci),a.forEach((c,l)=>r.call(n,u(c),u(l),i))}}function ls(e,t,r){return function(...n){const i=this.__v_raw,a=Ye(i),o=Ai(a),u=e==="entries"||e===Symbol.iterator&&o,c=e==="keys"&&o,l=i[e](...n),s=r?vf:t?bf:lo;return!t&&Ht(a,"iterate",c?rl:Ci),{next(){const{value:f,done:p}=l.next();return p?{value:f,done:p}:{value:u?[s(f[0]),s(f[1])]:s(f),done:p}},[Symbol.iterator](){return this}}}}function zn(e){return function(...t){if(process.env.NODE_ENV!=="production"){const r=t[0]?`on key "${t[0]}" `:"";Mn(`${ki(e)} operation ${r}failed: target is readonly.`,Ye(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function WL(){const e={get(i){return os(this,i)},get size(){return us(this)},has:ss,add:O0,set:B0,delete:k0,clear:I0,forEach:cs(!1,!1)},t={get(i){return os(this,i,!1,!0)},get size(){return us(this)},has:ss,add(i){return O0.call(this,i,!0)},set(i,a){return B0.call(this,i,a,!0)},delete:k0,clear:I0,forEach:cs(!1,!0)},r={get(i){return os(this,i,!0)},get size(){return us(this,!0)},has(i){return ss.call(this,i,!0)},add:zn("add"),set:zn("set"),delete:zn("delete"),clear:zn("clear"),forEach:cs(!0,!1)},n={get(i){return os(this,i,!0,!0)},get size(){return us(this,!0)},has(i){return ss.call(this,i,!0)},add:zn("add"),set:zn("set"),delete:zn("delete"),clear:zn("clear"),forEach:cs(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=ls(i,!1,!1),r[i]=ls(i,!0,!1),t[i]=ls(i,!1,!0),n[i]=ls(i,!0,!0)}),[e,r,t,n]}const[KL,QL,ZL,XL]=WL();function Pu(e,t){const r=t?e?XL:ZL:e?QL:KL;return(n,i,a)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?n:Reflect.get(tt(r,i)&&i in n?r:n,i,a)}const YL={get:Pu(!1,!1)},eP={get:Pu(!1,!0)},tP={get:Pu(!0,!1)},rP={get:Pu(!0,!0)};function qx(e,t,r){const n=Ye(r);if(n!==r&&t.call(e,n)){const i=lf(e);Mn(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const zx=new WeakMap,jx=new WeakMap,Lx=new WeakMap,Px=new WeakMap;function nP(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function iP(e){return e.__v_skip||!Object.isExtensible(e)?0:nP(lf(e))}function yf(e){return _n(e)?e:Vu(e,!1,$L,YL,zx)}function Vx(e){return Vu(e,!1,JL,eP,jx)}function xf(e){return Vu(e,!0,HL,tP,Lx)}function rn(e){return Vu(e,!0,GL,rP,Px)}function Vu(e,t,r,n,i){if(!lt(e))return process.env.NODE_ENV!=="production"&&Mn(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const a=i.get(e);if(a)return a;const o=iP(e);if(o===0)return e;const u=new Proxy(e,o===2?n:r);return i.set(e,u),u}function sa(e){return _n(e)?sa(e.__v_raw):!!(e&&e.__v_isReactive)}function _n(e){return!!(e&&e.__v_isReadonly)}function Dn(e){return!!(e&&e.__v_isShallow)}function nl(e){return e?!!e.__v_raw:!1}function Ye(e){const t=e&&e.__v_raw;return t?Ye(t):e}function aP(e){return Object.isExtensible(e)&&eu(e,"__v_skip",!0),e}const lo=e=>lt(e)?yf(e):e,bf=e=>lt(e)?xf(e):e,oP="Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free";class Ux{constructor(t,r,n,i){this.getter=t,this._setter=r,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new df(()=>t(this._value),()=>xs(this,this.effect._dirtyLevel===2?2:3)),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=n}get value(){const t=Ye(this);return(!t._cacheable||t.effect.dirty)&&ei(t._value,t._value=t.effect.run())&&xs(t,4),$x(t),t.effect._dirtyLevel>=2&&(process.env.NODE_ENV!=="production"&&this._warnRecursive&&Mn(oP,`
|
|
84
|
+
**/function Mn(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let yr;class jL{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=yr,!t&&yr&&(this.index=(yr.scopes||(yr.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const r=yr;try{return yr=this,t()}finally{yr=r}}else process.env.NODE_ENV!=="production"&&Mn("cannot run an inactive effect scope.")}on(){yr=this}off(){yr=this.parent}stop(t){if(this._active){let r,n;for(r=0,n=this.effects.length;r<n;r++)this.effects[r].stop();for(r=0,n=this.cleanups.length;r<n;r++)this.cleanups[r]();if(this.scopes)for(r=0,n=this.scopes.length;r<n;r++)this.scopes[r].stop(!0);if(!this.detached&&this.parent&&!t){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0,this._active=!1}}}function LL(e,t=yr){t&&t.active&&t.effects.push(e)}function Mb(){return yr}function PL(e){yr?yr.cleanups.push(e):process.env.NODE_ENV!=="production"&&Mn("onScopeDispose() is called when there is no active effect scope to be associated with.")}let Si;class hf{constructor(t,r,n,i){this.fn=t,this.trigger=r,this.scheduler=n,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,LL(this,i)}get dirty(){if(this._dirtyLevel===2||this._dirtyLevel===3){this._dirtyLevel=1,kn();for(let t=0;t<this._depsLength;t++){const r=this.deps[t];if(r.computed&&(VL(r.computed),this._dirtyLevel>=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),In()}return this._dirtyLevel>=4}set dirty(t){this._dirtyLevel=t?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=Qn,r=Si;try{return Qn=!0,Si=this,this._runnings++,F0(this),this.fn()}finally{T0(this),this._runnings--,Si=r,Qn=t}}stop(){this.active&&(F0(this),T0(this),this.onStop&&this.onStop(),this.active=!1)}}function VL(e){return e.value}function F0(e){e._trackId++,e._depsLength=0}function T0(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t<e.deps.length;t++)_b(e.deps[t],e);e.deps.length=e._depsLength}}function _b(e,t){const r=e.get(t);r!==void 0&&t._trackId!==r&&(e.delete(t),e.size===0&&e.cleanup())}let Qn=!0,el=0;const Fb=[];function kn(){Fb.push(Qn),Qn=!1}function In(){const e=Fb.pop();Qn=e===void 0?!0:e}function gf(){el++}function vf(){for(el--;!el&&tl.length;)tl.shift()()}function Tb(e,t,r){var n;if(t.get(e)!==e._trackId){t.set(e,e._trackId);const i=e.deps[e._depsLength];i!==t?(i&&_b(i,e),e.deps[e._depsLength++]=t):e._depsLength++,process.env.NODE_ENV!=="production"&&((n=e.onTrack)==null||n.call(e,Et({effect:e},r)))}}const tl=[];function Ob(e,t,r){var n;gf();for(const i of e.keys()){let a;i._dirtyLevel<t&&(a??(a=e.get(i)===i._trackId))&&(i._shouldSchedule||(i._shouldSchedule=i._dirtyLevel===0),i._dirtyLevel=t),i._shouldSchedule&&(a??(a=e.get(i)===i._trackId))&&(process.env.NODE_ENV!=="production"&&((n=i.onTrigger)==null||n.call(i,Et({effect:i},r))),i.trigger(),(!i._runnings||i.allowRecurse)&&i._dirtyLevel!==2&&(i._shouldSchedule=!1,i.scheduler&&tl.push(i.scheduler)))}vf()}const Bb=(e,t)=>{const r=new Map;return r.cleanup=e,r.computed=t,r},rl=new WeakMap,Ci=Symbol(process.env.NODE_ENV!=="production"?"iterate":""),nl=Symbol(process.env.NODE_ENV!=="production"?"Map key iterate":"");function Ht(e,t,r){if(Qn&&Si){let n=rl.get(e);n||rl.set(e,n=new Map);let i=n.get(r);i||n.set(r,i=Bb(()=>n.delete(r))),Tb(Si,i,process.env.NODE_ENV!=="production"?{target:e,type:t,key:r}:void 0)}}function nn(e,t,r,n,i,a){const o=rl.get(e);if(!o)return;let u=[];if(t==="clear")u=[...o.values()];else if(r==="length"&&Oe(e)){const c=Number(n);o.forEach((l,s)=>{(s==="length"||!fi(s)&&s>=c)&&u.push(l)})}else switch(r!==void 0&&u.push(o.get(r)),t){case"add":Oe(e)?pf(r)&&u.push(o.get("length")):(u.push(o.get(Ci)),Ai(e)&&u.push(o.get(nl)));break;case"delete":Oe(e)||(u.push(o.get(Ci)),Ai(e)&&u.push(o.get(nl)));break;case"set":Ai(e)&&u.push(o.get(Ci));break}gf();for(const c of u)c&&Ob(c,4,process.env.NODE_ENV!=="production"?{target:e,type:t,key:r,newValue:n,oldValue:i,oldTarget:a}:void 0);vf()}const UL=ja("__proto__,__v_isRef,__isVue"),kb=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(fi)),O0=$L();function $L(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...r){const n=Ye(this);for(let a=0,o=this.length;a<o;a++)Ht(n,"get",a+"");const i=n[t](...r);return i===-1||i===!1?n[t](...r.map(Ye)):i}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...r){kn(),gf();const n=Ye(this)[t].apply(this,r);return vf(),In(),n}}),e}function HL(e){fi(e)||(e=String(e));const t=Ye(this);return Ht(t,"has",e),t.hasOwnProperty(e)}class Ib{constructor(t=!1,r=!1){this._isReadonly=t,this._isShallow=r}get(t,r,n){const i=this._isReadonly,a=this._isShallow;if(r==="__v_isReactive")return!i;if(r==="__v_isReadonly")return i;if(r==="__v_isShallow")return a;if(r==="__v_raw")return n===(i?a?Vb:Pb:a?Lb:jb).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const o=Oe(t);if(!i){if(o&&tt(O0,r))return Reflect.get(O0,r,n);if(r==="hasOwnProperty")return HL}const u=Reflect.get(t,r,n);return(fi(r)?kb.has(r):UL(r))||(i||Ht(t,"get",r),a)?u:Lt(u)?o&&pf(r)?u:u.value:lt(u)?i?xf(u):bf(u):u}}class Rb extends Ib{constructor(t=!1){super(!1,t)}set(t,r,n,i){let a=t[r];if(!this._isShallow){const c=_n(a);if(!Dn(n)&&!_n(n)&&(a=Ye(a),n=Ye(n)),!Oe(t)&&Lt(a)&&!Lt(n))return c?!1:(a.value=n,!0)}const o=Oe(t)&&pf(r)?Number(r)<t.length:tt(t,r),u=Reflect.set(t,r,n,i);return t===Ye(i)&&(o?ei(n,a)&&nn(t,"set",r,n,a):nn(t,"add",r,n)),u}deleteProperty(t,r){const n=tt(t,r),i=t[r],a=Reflect.deleteProperty(t,r);return a&&n&&nn(t,"delete",r,void 0,i),a}has(t,r){const n=Reflect.has(t,r);return(!fi(r)||!kb.has(r))&&Ht(t,"has",r),n}ownKeys(t){return Ht(t,"iterate",Oe(t)?"length":Ci),Reflect.ownKeys(t)}}class qb extends Ib{constructor(t=!1){super(!0,t)}set(t,r){return process.env.NODE_ENV!=="production"&&Mn(`Set operation on key "${String(r)}" failed: target is readonly.`,t),!0}deleteProperty(t,r){return process.env.NODE_ENV!=="production"&&Mn(`Delete operation on key "${String(r)}" failed: target is readonly.`,t),!0}}const JL=new Rb,GL=new qb,WL=new Rb(!0),KL=new qb(!0),yf=e=>e,Pu=e=>Reflect.getPrototypeOf(e);function ss(e,t,r=!1,n=!1){e=e.__v_raw;const i=Ye(e),a=Ye(t);r||(ei(t,a)&&Ht(i,"get",t),Ht(i,"get",a));const{has:o}=Pu(i),u=n?yf:r?wf:fo;if(o.call(i,t))return u(e.get(t));if(o.call(i,a))return u(e.get(a));e!==i&&e.get(t)}function us(e,t=!1){const r=this.__v_raw,n=Ye(r),i=Ye(e);return t||(ei(e,i)&&Ht(n,"has",e),Ht(n,"has",i)),e===i?r.has(e):r.has(e)||r.has(i)}function cs(e,t=!1){return e=e.__v_raw,!t&&Ht(Ye(e),"iterate",Ci),Reflect.get(e,"size",e)}function B0(e,t=!1){!t&&!Dn(e)&&!_n(e)&&(e=Ye(e));const r=Ye(this);return Pu(r).has.call(r,e)||(r.add(e),nn(r,"add",e,e)),this}function k0(e,t,r=!1){!r&&!Dn(t)&&!_n(t)&&(t=Ye(t));const n=Ye(this),{has:i,get:a}=Pu(n);let o=i.call(n,e);o?process.env.NODE_ENV!=="production"&&zb(n,i,e):(e=Ye(e),o=i.call(n,e));const u=a.call(n,e);return n.set(e,t),o?ei(t,u)&&nn(n,"set",e,t,u):nn(n,"add",e,t),this}function I0(e){const t=Ye(this),{has:r,get:n}=Pu(t);let i=r.call(t,e);i?process.env.NODE_ENV!=="production"&&zb(t,r,e):(e=Ye(e),i=r.call(t,e));const a=n?n.call(t,e):void 0,o=t.delete(e);return i&&nn(t,"delete",e,void 0,a),o}function R0(){const e=Ye(this),t=e.size!==0,r=process.env.NODE_ENV!=="production"?Ai(e)?new Map(e):new Set(e):void 0,n=e.clear();return t&&nn(e,"clear",void 0,void 0,r),n}function ls(e,t){return function(r,n){const i=this,a=i.__v_raw,o=Ye(a),u=t?yf:e?wf:fo;return!e&&Ht(o,"iterate",Ci),a.forEach((c,l)=>r.call(n,u(c),u(l),i))}}function fs(e,t,r){return function(...n){const i=this.__v_raw,a=Ye(i),o=Ai(a),u=e==="entries"||e===Symbol.iterator&&o,c=e==="keys"&&o,l=i[e](...n),s=r?yf:t?wf:fo;return!t&&Ht(a,"iterate",c?nl:Ci),{next(){const{value:f,done:p}=l.next();return p?{value:f,done:p}:{value:u?[s(f[0]),s(f[1])]:s(f),done:p}},[Symbol.iterator](){return this}}}}function zn(e){return function(...t){if(process.env.NODE_ENV!=="production"){const r=t[0]?`on key "${t[0]}" `:"";Mn(`${ki(e)} operation ${r}failed: target is readonly.`,Ye(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function QL(){const e={get(i){return ss(this,i)},get size(){return cs(this)},has:us,add:B0,set:k0,delete:I0,clear:R0,forEach:ls(!1,!1)},t={get(i){return ss(this,i,!1,!0)},get size(){return cs(this)},has:us,add(i){return B0.call(this,i,!0)},set(i,a){return k0.call(this,i,a,!0)},delete:I0,clear:R0,forEach:ls(!1,!0)},r={get(i){return ss(this,i,!0)},get size(){return cs(this,!0)},has(i){return us.call(this,i,!0)},add:zn("add"),set:zn("set"),delete:zn("delete"),clear:zn("clear"),forEach:ls(!0,!1)},n={get(i){return ss(this,i,!0,!0)},get size(){return cs(this,!0)},has(i){return us.call(this,i,!0)},add:zn("add"),set:zn("set"),delete:zn("delete"),clear:zn("clear"),forEach:ls(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=fs(i,!1,!1),r[i]=fs(i,!0,!1),t[i]=fs(i,!1,!0),n[i]=fs(i,!0,!0)}),[e,r,t,n]}const[ZL,XL,YL,eP]=QL();function Vu(e,t){const r=t?e?eP:YL:e?XL:ZL;return(n,i,a)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?n:Reflect.get(tt(r,i)&&i in n?r:n,i,a)}const tP={get:Vu(!1,!1)},rP={get:Vu(!1,!0)},nP={get:Vu(!0,!1)},iP={get:Vu(!0,!0)};function zb(e,t,r){const n=Ye(r);if(n!==r&&t.call(e,n)){const i=ff(e);Mn(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const jb=new WeakMap,Lb=new WeakMap,Pb=new WeakMap,Vb=new WeakMap;function aP(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function oP(e){return e.__v_skip||!Object.isExtensible(e)?0:aP(ff(e))}function bf(e){return _n(e)?e:Uu(e,!1,JL,tP,jb)}function Ub(e){return Uu(e,!1,WL,rP,Lb)}function xf(e){return Uu(e,!0,GL,nP,Pb)}function rn(e){return Uu(e,!0,KL,iP,Vb)}function Uu(e,t,r,n,i){if(!lt(e))return process.env.NODE_ENV!=="production"&&Mn(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const a=i.get(e);if(a)return a;const o=oP(e);if(o===0)return e;const u=new Proxy(e,o===2?n:r);return i.set(e,u),u}function ua(e){return _n(e)?ua(e.__v_raw):!!(e&&e.__v_isReactive)}function _n(e){return!!(e&&e.__v_isReadonly)}function Dn(e){return!!(e&&e.__v_isShallow)}function il(e){return e?!!e.__v_raw:!1}function Ye(e){const t=e&&e.__v_raw;return t?Ye(t):e}function sP(e){return Object.isExtensible(e)&&tu(e,"__v_skip",!0),e}const fo=e=>lt(e)?bf(e):e,wf=e=>lt(e)?xf(e):e,uP="Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free";class $b{constructor(t,r,n,i){this.getter=t,this._setter=r,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new hf(()=>t(this._value),()=>xs(this,this.effect._dirtyLevel===2?2:3)),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=n}get value(){const t=Ye(this);return(!t._cacheable||t.effect.dirty)&&ei(t._value,t._value=t.effect.run())&&xs(t,4),Hb(t),t.effect._dirtyLevel>=2&&(process.env.NODE_ENV!=="production"&&this._warnRecursive&&Mn(uP,`
|
|
85
85
|
|
|
86
|
-
getter: `,this.getter),xs(t,2)),t._value}set value(t){this._setter(t)}get _dirty(){return this.effect.dirty}set _dirty(t){this.effect.dirty=t}}function
|
|
86
|
+
getter: `,this.getter),xs(t,2)),t._value}set value(t){this._setter(t)}get _dirty(){return this.effect.dirty}set _dirty(t){this.effect.dirty=t}}function cP(e,t,r=!1){let n,i;const a=Be(e);a?(n=e,i=process.env.NODE_ENV!=="production"?()=>{Mn("Write operation failed: computed value is readonly")}:St):(n=e.get,i=e.set);const o=new $b(n,i,a||!i,r);return process.env.NODE_ENV!=="production"&&t&&!r&&(o.effect.onTrack=t.onTrack,o.effect.onTrigger=t.onTrigger),o}function Hb(e){var t;Qn&&Si&&(e=Ye(e),Tb(Si,(t=e.dep)!=null?t:e.dep=Bb(()=>e.dep=void 0,e instanceof $b?e:void 0),process.env.NODE_ENV!=="production"?{target:e,type:"get",key:"value"}:void 0))}function xs(e,t=4,r,n){e=Ye(e);const i=e.dep;i&&Ob(i,t,process.env.NODE_ENV!=="production"?{target:e,type:"set",key:"value",newValue:r,oldValue:n}:void 0)}function Lt(e){return!!(e&&e.__v_isRef===!0)}function Ur(e){return lP(e,!1)}function lP(e,t){return Lt(e)?e:new fP(e,t)}class fP{constructor(t,r){this.__v_isShallow=r,this.dep=void 0,this.__v_isRef=!0,this._rawValue=r?t:Ye(t),this._value=r?t:fo(t)}get value(){return Hb(this),this._value}set value(t){const r=this.__v_isShallow||Dn(t)||_n(t);if(t=r?t:Ye(t),ei(t,this._rawValue)){const n=this._rawValue;this._rawValue=t,this._value=r?t:fo(t),xs(this,4,t,n)}}}function et(e){return Lt(e)?e.value:e}const pP={get:(e,t,r)=>et(Reflect.get(e,t,r)),set:(e,t,r,n)=>{const i=e[t];return Lt(i)&&!Lt(r)?(i.value=r,!0):Reflect.set(e,t,r,n)}};function Jb(e){return ua(e)?e:new Proxy(e,pP)}/**
|
|
87
87
|
* @vue/runtime-core v3.4.38
|
|
88
88
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
89
89
|
* @license MIT
|
|
90
|
-
**/const Mi=[];function
|
|
90
|
+
**/const Mi=[];function ws(e){Mi.push(e)}function Ns(){Mi.pop()}let xc=!1;function Se(e,...t){if(xc)return;xc=!0,kn();const r=Mi.length?Mi[Mi.length-1].component:null,n=r&&r.appContext.config.warnHandler,i=mP();if(n)En(n,r,11,[e+t.map(a=>{var o,u;return(u=(o=a.toString)==null?void 0:o.call(a))!=null?u:JSON.stringify(a)}).join(""),r&&r.proxy,i.map(({vnode:a})=>`at <${Qu(r,a.type)}>`).join(`
|
|
91
91
|
`),i]);else{const a=[`[Vue warn]: ${e}`,...t];i.length&&a.push(`
|
|
92
|
-
`,...
|
|
93
|
-
`],...mP(r))}),t}function mP({vnode:e,recurseCount:t}){const r=t>0?`... (${t} recursive calls)`:"",n=e.component?e.component.parent==null:!1,i=` at <${Ku(e.component,e.type,n)}`,a=">"+r;return e.props?[i,...dP(e.props),a]:[i+a]}function dP(e){const t=[],r=Object.keys(e);return r.slice(0,3).forEach(n=>{t.push(...Jx(n,e[n]))}),r.length>3&&t.push(" ..."),t}function Jx(e,t,r){return bt(t)?(t=JSON.stringify(t),r?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?r?t:[`${e}=${t}`]:Lt(t)?(t=Jx(e,Ye(t.value),!0),r?t:[`${e}=Ref<`,t,">"]):Be(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=Ye(t),r?t:[`${e}=`,t])}function hP(e,t){process.env.NODE_ENV!=="production"&&e!==void 0&&(typeof e!="number"?Se(`${t} is not a valid number - got ${JSON.stringify(e)}.`):isNaN(e)&&Se(`${t} is NaN - the duration expression might be incorrect.`))}const wf={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update"};function En(e,t,r,n){try{return n?e(...n):e()}catch(i){ko(i,t,r)}}function _r(e,t,r,n){if(Be(e)){const i=En(e,t,r,n);return i&&cf(i)&&i.catch(a=>{ko(a,t,r)}),i}if(Oe(e)){const i=[];for(let a=0;a<e.length;a++)i.push(_r(e[a],t,r,n));return i}else process.env.NODE_ENV!=="production"&&Se(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function ko(e,t,r,n=!0){const i=t?t.vnode:null;if(t){let a=t.parent;const o=t.proxy,u=process.env.NODE_ENV!=="production"?wf[r]:`https://vuejs.org/error-reference/#runtime-${r}`;for(;a;){const l=a.ec;if(l){for(let s=0;s<l.length;s++)if(l[s](e,o,u)===!1)return}a=a.parent}const c=t.appContext.config.errorHandler;if(c){kn(),En(c,null,10,[e,o,u]),In();return}}gP(e,r,i,n)}function gP(e,t,r,n=!0){if(process.env.NODE_ENV!=="production"){const i=wf[t];if(r&&bs(r),Se(`Unhandled error${i?` during execution of ${i}`:""}`),r&&ws(),n)throw e;console.error(e)}else console.error(e)}let fo=!1,il=!1;const Zt=[];let Yr=0;const ua=[];let Un=null,yi=0;const Gx=Promise.resolve();let Nf=null;const vP=100;function Wx(e){const t=Nf||Gx;return e?t.then(this?e.bind(this):e):t}function yP(e){let t=Yr+1,r=Zt.length;for(;t<r;){const n=t+r>>>1,i=Zt[n],a=po(i);a<e||a===e&&i.pre?t=n+1:r=n}return t}function Uu(e){(!Zt.length||!Zt.includes(e,fo&&e.allowRecurse?Yr+1:Yr))&&(e.id==null?Zt.push(e):Zt.splice(yP(e.id),0,e),Kx())}function Kx(){!fo&&!il&&(il=!0,Nf=Gx.then(Xx))}function xP(e){const t=Zt.indexOf(e);t>Yr&&Zt.splice(t,1)}function Qx(e){Oe(e)?ua.push(...e):(!Un||!Un.includes(e,e.allowRecurse?yi+1:yi))&&ua.push(e),Kx()}function R0(e,t,r=fo?Yr+1:0){for(process.env.NODE_ENV!=="production"&&(t=t||new Map);r<Zt.length;r++){const n=Zt[r];if(n&&n.pre){if(e&&n.id!==e.uid||process.env.NODE_ENV!=="production"&&Df(t,n))continue;Zt.splice(r,1),r--,n()}}}function Zx(e){if(ua.length){const t=[...new Set(ua)].sort((r,n)=>po(r)-po(n));if(ua.length=0,Un){Un.push(...t);return}for(Un=t,process.env.NODE_ENV!=="production"&&(e=e||new Map),yi=0;yi<Un.length;yi++){const r=Un[yi];process.env.NODE_ENV!=="production"&&Df(e,r)||r.active!==!1&&r()}Un=null,yi=0}}const po=e=>e.id==null?1/0:e.id,bP=(e,t)=>{const r=po(e)-po(t);if(r===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return r};function Xx(e){il=!1,fo=!0,process.env.NODE_ENV!=="production"&&(e=e||new Map),Zt.sort(bP);const t=process.env.NODE_ENV!=="production"?r=>Df(e,r):St;try{for(Yr=0;Yr<Zt.length;Yr++){const r=Zt[Yr];if(r&&r.active!==!1){if(process.env.NODE_ENV!=="production"&&t(r))continue;En(r,r.i,r.i?15:14)}}}finally{Yr=0,Zt.length=0,Zx(e),fo=!1,Nf=null,(Zt.length||ua.length)&&Xx(e)}}function Df(e,t){if(!e.has(t))e.set(t,1);else{const r=e.get(t);if(r>vP){const n=t.i,i=n&&Tf(n.type);return ko(`Maximum recursive updates exceeded${i?` in component <${i}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}else e.set(t,r+1)}}let _i=!1;const Ns=new Map;process.env.NODE_ENV!=="production"&&(pf().__VUE_HMR_RUNTIME__={createRecord:bc(Yx),rerender:bc(DP),reload:bc(EP)});const Ii=new Map;function wP(e){const t=e.type.__hmrId;let r=Ii.get(t);r||(Yx(t,e.type),r=Ii.get(t)),r.instances.add(e)}function NP(e){Ii.get(e.type.__hmrId).instances.delete(e)}function Yx(e,t){return Ii.has(e)?!1:(Ii.set(e,{initialDef:tu(t),instances:new Set}),!0)}function tu(e){return Lb(e)?e.__vccOpts:e}function DP(e,t){const r=Ii.get(e);r&&(r.initialDef.render=t,[...r.instances].forEach(n=>{t&&(n.render=t,tu(n.type).render=t),n.renderCache=[],_i=!0,n.effect.dirty=!0,n.update(),_i=!1}))}function EP(e,t){const r=Ii.get(e);if(!r)return;t=tu(t),q0(r.initialDef,t);const n=[...r.instances];for(let i=0;i<n.length;i++){const a=n[i],o=tu(a.type);let u=Ns.get(o);u||(o!==r.initialDef&&q0(o,t),Ns.set(o,u=new Set)),u.add(a),a.appContext.propsCache.delete(a.type),a.appContext.emitsCache.delete(a.type),a.appContext.optionsCache.delete(a.type),a.ceReload?(u.add(a),a.ceReload(t.styles),u.delete(a)):a.parent?(a.parent.effect.dirty=!0,Uu(()=>{a.parent.update(),u.delete(a)})):a.appContext.reload?a.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}Qx(()=>{Ns.clear()})}function q0(e,t){Et(e,t);for(const r in e)r!=="__file"&&!(r in t)&&delete e[r]}function bc(e){return(t,r)=>{try{return e(t,r)}catch(n){console.error(n),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let en,Xa=[],al=!1;function Io(e,...t){en?en.emit(e,...t):al||Xa.push({event:e,args:t})}function eb(e,t){var r,n;en=e,en?(en.enabled=!0,Xa.forEach(({event:i,args:a})=>en.emit(i,...a)),Xa=[]):typeof window<"u"&&window.HTMLElement&&!((n=(r=window.navigator)==null?void 0:r.userAgent)!=null&&n.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{eb(i,t)}),setTimeout(()=>{en||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,al=!0,Xa=[])},3e3)):(al=!0,Xa=[])}function AP(e,t){Io("app:init",e,t,{Fragment:mr,Text:qo,Comment:Mt,Static:Es})}function SP(e){Io("app:unmount",e)}const CP=Ef("component:added"),tb=Ef("component:updated"),MP=Ef("component:removed"),_P=e=>{en&&typeof en.cleanupBuffer=="function"&&!en.cleanupBuffer(e)&&MP(e)};/*! #__NO_SIDE_EFFECTS__ */function Ef(e){return t=>{Io(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}const FP=rb("perf:start"),TP=rb("perf:end");function rb(e){return(t,r,n)=>{Io(e,t.appContext.app,t.uid,t,r,n)}}function OP(e,t,r){Io("component:emit",e.appContext.app,e,t,r)}let _t=null,nb=null;function ru(e){const t=_t;return _t=e,nb=e&&e.type.__scopeId||null,t}function to(e,t=_t,r){if(!t||e._n)return e;const n=(...i)=>{n._d&&Q0(-1);const a=ru(t);let o;try{o=e(...i)}finally{ru(a),n._d&&Q0(1)}return process.env.NODE_ENV!=="production"&&tb(t),o};return n._n=!0,n._c=!0,n._d=!0,n}function ib(e){SL(e)&&Se("Do not use built-in directive ids as custom directive id: "+e)}function ab(e,t){if(_t===null)return process.env.NODE_ENV!=="production"&&Se("withDirectives can only be used inside render functions."),e;const r=Wu(_t),n=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[a,o,u,c=vt]=t[i];a&&(Be(a)&&(a={mounted:a,updated:a}),a.deep&&Gn(o),n.push({dir:a,instance:r,value:o,oldValue:void 0,arg:u,modifiers:c}))}return e}function pi(e,t,r,n){const i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){const u=i[o];a&&(u.oldValue=a[o].value);let c=u.dir[n];c&&(kn(),_r(c,r,8,[e.el,u,e,t]),In())}}const $n=Symbol("_leaveCb"),fs=Symbol("_enterCb");function BP(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Hu(()=>{e.isMounted=!0}),fb(()=>{e.isUnmounting=!0}),e}const Ar=[Function,Array],ob={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ar,onEnter:Ar,onAfterEnter:Ar,onEnterCancelled:Ar,onBeforeLeave:Ar,onLeave:Ar,onAfterLeave:Ar,onLeaveCancelled:Ar,onBeforeAppear:Ar,onAppear:Ar,onAfterAppear:Ar,onAppearCancelled:Ar},sb=e=>{const t=e.subTree;return t.component?sb(t.component):t},kP={name:"BaseTransition",props:ob,setup(e,{slots:t}){const r=ri(),n=BP();return()=>{const i=t.default&&cb(t.default(),!0);if(!i||!i.length)return;let a=i[0];if(i.length>1){let p=!1;for(const m of i)if(m.type!==Mt){if(process.env.NODE_ENV!=="production"&&p){Se("<transition> can only be used on a single element or component. Use <transition-group> for lists.");break}if(a=m,p=!0,process.env.NODE_ENV==="production")break}}const o=Ye(e),{mode:u}=o;if(process.env.NODE_ENV!=="production"&&u&&u!=="in-out"&&u!=="out-in"&&u!=="default"&&Se(`invalid <transition> mode: ${u}`),n.isLeaving)return wc(a);const c=z0(a);if(!c)return wc(a);let l=ol(c,o,n,r,p=>l=p);nu(c,l);const s=r.subTree,f=s&&z0(s);if(f&&f.type!==Mt&&!bi(c,f)&&sb(r).type!==Mt){const p=ol(f,o,n,r);if(nu(f,p),u==="out-in"&&c.type!==Mt)return n.isLeaving=!0,p.afterLeave=()=>{n.isLeaving=!1,r.update.active!==!1&&(r.effect.dirty=!0,r.update())},wc(a);u==="in-out"&&c.type!==Mt&&(p.delayLeave=(m,d,h)=>{const w=ub(n,f);w[String(f.key)]=f,m[$n]=()=>{d(),m[$n]=void 0,delete l.delayedLeave},l.delayedLeave=h})}return a}}},IP=kP;function ub(e,t){const{leavingVNodes:r}=e;let n=r.get(t.type);return n||(n=Object.create(null),r.set(t.type,n)),n}function ol(e,t,r,n,i){const{appear:a,mode:o,persisted:u=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:s,onEnterCancelled:f,onBeforeLeave:p,onLeave:m,onAfterLeave:d,onLeaveCancelled:h,onBeforeAppear:w,onAppear:v,onAfterAppear:b,onAppearCancelled:g}=t,x=String(e.key),y=ub(r,e),N=(D,S)=>{D&&_r(D,n,9,S)},E=(D,S)=>{const C=S[1];N(D,S),Oe(D)?D.every(_=>_.length<=1)&&C():D.length<=1&&C()},A={mode:o,persisted:u,beforeEnter(D){let S=c;if(!r.isMounted)if(a)S=w||c;else return;D[$n]&&D[$n](!0);const C=y[x];C&&bi(e,C)&&C.el[$n]&&C.el[$n](),N(S,[D])},enter(D){let S=l,C=s,_=f;if(!r.isMounted)if(a)S=v||l,C=b||s,_=g||f;else return;let R=!1;const P=D[fs]=I=>{R||(R=!0,I?N(_,[D]):N(C,[D]),A.delayedLeave&&A.delayedLeave(),D[fs]=void 0)};S?E(S,[D,P]):P()},leave(D,S){const C=String(e.key);if(D[fs]&&D[fs](!0),r.isUnmounting)return S();N(p,[D]);let _=!1;const R=D[$n]=P=>{_||(_=!0,S(),P?N(h,[D]):N(d,[D]),D[$n]=void 0,y[C]===e&&delete y[C])};y[C]=e,m?E(m,[D,R]):R()},clone(D){const S=ol(D,t,r,n,i);return i&&i(S),S}};return A}function wc(e){if(Ro(e))return e=un(e),e.children=null,e}function z0(e){if(!Ro(e))return e;if(process.env.NODE_ENV!=="production"&&e.component)return e.component.subTree;const{shapeFlag:t,children:r}=e;if(r){if(t&16)return r[0];if(t&32&&Be(r.default))return r.default()}}function nu(e,t){e.shapeFlag&6&&e.component?nu(e.component.subTree,t):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function cb(e,t=!1,r){let n=[],i=0;for(let a=0;a<e.length;a++){let o=e[a];const u=r==null?o.key:String(r)+String(o.key!=null?o.key:a);o.type===mr?(o.patchFlag&128&&i++,n=n.concat(cb(o.children,t,u))):(t||o.type!==Mt)&&n.push(u!=null?un(o,{key:u}):o)}if(i>1)for(let a=0;a<n.length;a++)n[a].patchFlag=-2;return n}/*! #__NO_SIDE_EFFECTS__ */function Zr(e,t){return Be(e)?Et({name:e.name},t,{setup:e}):e}const ro=e=>!!e.type.__asyncLoader,Ro=e=>e.type.__isKeepAlive;function RP(e,t){lb(e,"a",t)}function qP(e,t){lb(e,"da",t)}function lb(e,t,r=Ot){const n=e.__wdc||(e.__wdc=()=>{let i=r;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if($u(t,n,r),r){let i=r.parent;for(;i&&i.parent;)Ro(i.parent.vnode)&&zP(n,t,r,i),i=i.parent}}function zP(e,t,r,n){const i=$u(t,e,n,!0);pb(()=>{uf(n[t],i)},r)}function $u(e,t,r=Ot,n=!1){if(r){const i=r[e]||(r[e]=[]),a=t.__weh||(t.__weh=(...o)=>{kn();const u=zo(r),c=_r(t,r,e,o);return u(),In(),c});return n?i.unshift(a):i.push(a),a}else if(process.env.NODE_ENV!=="production"){const i=vi(wf[e].replace(/ hook$/,""));Se(`${i} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}}const Rn=e=>(t,r=Ot)=>{(!Gu||e==="sp")&&$u(e,(...n)=>t(...n),r)},jP=Rn("bm"),Hu=Rn("m"),LP=Rn("bu"),PP=Rn("u"),fb=Rn("bum"),pb=Rn("um"),VP=Rn("sp"),UP=Rn("rtg"),$P=Rn("rtc");function HP(e,t=Ot){$u("ec",e,t)}const JP="components",mb=Symbol.for("v-ndc");function GP(e){return bt(e)?WP(JP,e,!1)||e:e||mb}function WP(e,t,r=!0,n=!1){const i=_t||Ot;if(i){const a=i.type;{const u=Tf(a,!1);if(u&&(u===t||u===wr(t)||u===ki(wr(t))))return a}const o=j0(i[e]||a[e],t)||j0(i.appContext[e],t);return!o&&n?a:(process.env.NODE_ENV!=="production"&&r&&!o&&Se(`Failed to resolve ${e.slice(0,-1)}: ${t}
|
|
94
|
-
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`),o)}else process.env.NODE_ENV!=="production"&&Se(`resolve${ki(e.slice(0,-1))} can only be used in render() or setup().`)}function j0(e,t){return e&&(e[t]||e[wr(t)]||e[ki(wr(t))])}function Af(e,t,r={},n,i){if(_t.isCE||_t.parent&&ro(_t.parent)&&_t.parent.isCE)return $t("slot",r,n&&n());let a=e[t];process.env.NODE_ENV!=="production"&&a&&a.length>1&&(Se("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template."),a=()=>[]),a&&a._c&&(a._d=!1),Kt();const o=a&&db(a(r)),u=xi(mr,{key:(r.key||o&&o.key||`_${t}`)+(!o&&n?"_fb":"")},o||(n?n():[]),o&&e._===1?64:-2);return u.scopeId&&(u.slotScopeIds=[u.scopeId+"-s"]),a&&a._c&&(a._d=!0),u}function db(e){return e.some(t=>ti(t)?!(t.type===Mt||t.type===mr&&!db(t.children)):!0)?e:null}const sl=e=>e?zb(e)?Wu(e):sl(e.parent):null,Fi=Et(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>process.env.NODE_ENV!=="production"?rn(e.props):e.props,$attrs:e=>process.env.NODE_ENV!=="production"?rn(e.attrs):e.attrs,$slots:e=>process.env.NODE_ENV!=="production"?rn(e.slots):e.slots,$refs:e=>process.env.NODE_ENV!=="production"?rn(e.refs):e.refs,$parent:e=>sl(e.parent),$root:e=>sl(e.root),$emit:e=>e.emit,$options:e=>Cf(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,Uu(e.update)}),$nextTick:e=>e.n||(e.n=Wx.bind(e.proxy)),$watch:e=>MV.bind(e)}),Sf=e=>e==="_"||e==="$",Nc=(e,t)=>e!==vt&&!e.__isScriptSetup&&tt(e,t),hb={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:r,setupState:n,data:i,props:a,accessCache:o,type:u,appContext:c}=e;if(process.env.NODE_ENV!=="production"&&t==="__isVue")return!0;let l;if(t[0]!=="$"){const m=o[t];if(m!==void 0)switch(m){case 1:return n[t];case 2:return i[t];case 4:return r[t];case 3:return a[t]}else{if(Nc(n,t))return o[t]=1,n[t];if(i!==vt&&tt(i,t))return o[t]=2,i[t];if((l=e.propsOptions[0])&&tt(l,t))return o[t]=3,a[t];if(r!==vt&&tt(r,t))return o[t]=4,r[t];ul&&(o[t]=0)}}const s=Fi[t];let f,p;if(s)return t==="$attrs"?(Ht(e.attrs,"get",""),process.env.NODE_ENV!=="production"&&ou()):process.env.NODE_ENV!=="production"&&t==="$slots"&&Ht(e,"get",t),s(e);if((f=u.__cssModules)&&(f=f[t]))return f;if(r!==vt&&tt(r,t))return o[t]=4,r[t];if(p=c.config.globalProperties,tt(p,t))return p[t];process.env.NODE_ENV!=="production"&&_t&&(!bt(t)||t.indexOf("__v")!==0)&&(i!==vt&&Sf(t[0])&&tt(i,t)?Se(`Property ${JSON.stringify(t)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):e===_t&&Se(`Property ${JSON.stringify(t)} was accessed during render but is not defined on instance.`))},set({_:e},t,r){const{data:n,setupState:i,ctx:a}=e;return Nc(i,t)?(i[t]=r,!0):process.env.NODE_ENV!=="production"&&i.__isScriptSetup&&tt(i,t)?(Se(`Cannot mutate <script setup> binding "${t}" from Options API.`),!1):n!==vt&&tt(n,t)?(n[t]=r,!0):tt(e.props,t)?(process.env.NODE_ENV!=="production"&&Se(`Attempting to mutate prop "${t}". Props are readonly.`),!1):t[0]==="$"&&t.slice(1)in e?(process.env.NODE_ENV!=="production"&&Se(`Attempting to mutate public property "${t}". Properties starting with $ are reserved and readonly.`),!1):(process.env.NODE_ENV!=="production"&&t in e.appContext.config.globalProperties?Object.defineProperty(a,t,{enumerable:!0,configurable:!0,value:r}):a[t]=r,!0)},has({_:{data:e,setupState:t,accessCache:r,ctx:n,appContext:i,propsOptions:a}},o){let u;return!!r[o]||e!==vt&&tt(e,o)||Nc(t,o)||(u=a[0])&&tt(u,o)||tt(n,o)||tt(Fi,o)||tt(i.config.globalProperties,o)},defineProperty(e,t,r){return r.get!=null?e._.accessCache[t]=0:tt(r,"value")&&this.set(e,t,r.value,null),Reflect.defineProperty(e,t,r)}};process.env.NODE_ENV!=="production"&&(hb.ownKeys=e=>(Se("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));function KP(e){const t={};return Object.defineProperty(t,"_",{configurable:!0,enumerable:!1,get:()=>e}),Object.keys(Fi).forEach(r=>{Object.defineProperty(t,r,{configurable:!0,enumerable:!1,get:()=>Fi[r](e),set:St})}),t}function QP(e){const{ctx:t,propsOptions:[r]}=e;r&&Object.keys(r).forEach(n=>{Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>e.props[n],set:St})})}function ZP(e){const{ctx:t,setupState:r}=e;Object.keys(Ye(r)).forEach(n=>{if(!r.__isScriptSetup){if(Sf(n[0])){Se(`setup() return property ${JSON.stringify(n)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`);return}Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r[n],set:St})}})}function L0(e){return Oe(e)?e.reduce((t,r)=>(t[r]=null,t),{}):e}function XP(){const e=Object.create(null);return(t,r)=>{e[r]?Se(`${t} property "${r}" is already defined in ${e[r]}.`):e[r]=t}}let ul=!0;function YP(e){const t=Cf(e),r=e.proxy,n=e.ctx;ul=!1,t.beforeCreate&&P0(t.beforeCreate,e,"bc");const{data:i,computed:a,methods:o,watch:u,provide:c,inject:l,created:s,beforeMount:f,mounted:p,beforeUpdate:m,updated:d,activated:h,deactivated:w,beforeDestroy:v,beforeUnmount:b,destroyed:g,unmounted:x,render:y,renderTracked:N,renderTriggered:E,errorCaptured:A,serverPrefetch:D,expose:S,inheritAttrs:C,components:_,directives:R,filters:P}=t,I=process.env.NODE_ENV!=="production"?XP():null;if(process.env.NODE_ENV!=="production"){const[F]=e.propsOptions;if(F)for(const q in F)I("Props",q)}if(l&&eV(l,n,I),o)for(const F in o){const q=o[F];Be(q)?(process.env.NODE_ENV!=="production"?Object.defineProperty(n,F,{value:q.bind(r),configurable:!0,enumerable:!0,writable:!0}):n[F]=q.bind(r),process.env.NODE_ENV!=="production"&&I("Methods",F)):process.env.NODE_ENV!=="production"&&Se(`Method "${F}" has type "${typeof q}" in the component definition. Did you reference the function correctly?`)}if(i){process.env.NODE_ENV!=="production"&&!Be(i)&&Se("The data option must be a function. Plain object usage is no longer supported.");const F=i.call(r,r);if(process.env.NODE_ENV!=="production"&&cf(F)&&Se("data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>."),!lt(F))process.env.NODE_ENV!=="production"&&Se("data() should return an object.");else if(e.data=yf(F),process.env.NODE_ENV!=="production")for(const q in F)I("Data",q),Sf(q[0])||Object.defineProperty(n,q,{configurable:!0,enumerable:!0,get:()=>F[q],set:St})}if(ul=!0,a)for(const F in a){const q=a[F],k=Be(q)?q.bind(r,r):Be(q.get)?q.get.bind(r,r):St;process.env.NODE_ENV!=="production"&&k===St&&Se(`Computed property "${F}" has no getter.`);const te=!Be(q)&&Be(q.set)?q.set.bind(r):process.env.NODE_ENV!=="production"?()=>{Se(`Write operation failed: computed property "${F}" is readonly.`)}:St,se=yt({get:k,set:te});Object.defineProperty(n,F,{enumerable:!0,configurable:!0,get:()=>se.value,set:K=>se.value=K}),process.env.NODE_ENV!=="production"&&I("Computed",F)}if(u)for(const F in u)gb(u[F],n,r,F);if(c){const F=Be(c)?c.call(r):c;Reflect.ownKeys(F).forEach(q=>{yb(q,F[q])})}s&&P0(s,e,"c");function O(F,q){Oe(q)?q.forEach(k=>F(k.bind(r))):q&&F(q.bind(r))}if(O(jP,f),O(Hu,p),O(LP,m),O(PP,d),O(RP,h),O(qP,w),O(HP,A),O($P,N),O(UP,E),O(fb,b),O(pb,x),O(VP,D),Oe(S))if(S.length){const F=e.exposed||(e.exposed={});S.forEach(q=>{Object.defineProperty(F,q,{get:()=>r[q],set:k=>r[q]=k})})}else e.exposed||(e.exposed={});y&&e.render===St&&(e.render=y),C!=null&&(e.inheritAttrs=C),_&&(e.components=_),R&&(e.directives=R)}function eV(e,t,r=St){Oe(e)&&(e=cl(e));for(const n in e){const i=e[n];let a;lt(i)?"default"in i?a=an(i.from||n,i.default,!0):a=an(i.from||n):a=an(i),Lt(a)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>a.value,set:o=>a.value=o}):t[n]=a,process.env.NODE_ENV!=="production"&&r("Inject",n)}}function P0(e,t,r){_r(Oe(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,r)}function gb(e,t,r,n){const i=n.includes(".")?Fb(r,n):()=>r[n];if(bt(e)){const a=t[e];Be(a)?la(i,a):process.env.NODE_ENV!=="production"&&Se(`Invalid watch handler specified by key "${e}"`,a)}else if(Be(e))la(i,e.bind(r));else if(lt(e))if(Oe(e))e.forEach(a=>gb(a,t,r,n));else{const a=Be(e.handler)?e.handler.bind(r):t[e.handler];Be(a)?la(i,a,e):process.env.NODE_ENV!=="production"&&Se(`Invalid watch handler specified by key "${e.handler}"`,a)}else process.env.NODE_ENV!=="production"&&Se(`Invalid watch option: "${n}"`,e)}function Cf(e){const t=e.type,{mixins:r,extends:n}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,u=a.get(t);let c;return u?c=u:!i.length&&!r&&!n?c=t:(c={},i.length&&i.forEach(l=>iu(c,l,o,!0)),iu(c,t,o)),lt(t)&&a.set(t,c),c}function iu(e,t,r,n=!1){const{mixins:i,extends:a}=t;a&&iu(e,a,r,!0),i&&i.forEach(o=>iu(e,o,r,!0));for(const o in t)if(n&&o==="expose")process.env.NODE_ENV!=="production"&&Se('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const u=tV[o]||r&&r[o];e[o]=u?u(e[o],t[o]):t[o]}return e}const tV={data:V0,props:U0,emits:U0,methods:Ya,computed:Ya,beforeCreate:rr,created:rr,beforeMount:rr,mounted:rr,beforeUpdate:rr,updated:rr,beforeDestroy:rr,beforeUnmount:rr,destroyed:rr,unmounted:rr,activated:rr,deactivated:rr,errorCaptured:rr,serverPrefetch:rr,components:Ya,directives:Ya,watch:nV,provide:V0,inject:rV};function V0(e,t){return t?e?function(){return Et(Be(e)?e.call(this,this):e,Be(t)?t.call(this,this):t)}:t:e}function rV(e,t){return Ya(cl(e),cl(t))}function cl(e){if(Oe(e)){const t={};for(let r=0;r<e.length;r++)t[e[r]]=e[r];return t}return e}function rr(e,t){return e?[...new Set([].concat(e,t))]:t}function Ya(e,t){return e?Et(Object.create(null),e,t):t}function U0(e,t){return e?Oe(e)&&Oe(t)?[...new Set([...e,...t])]:Et(Object.create(null),L0(e),L0(t??{})):t}function nV(e,t){if(!e)return t;if(!t)return e;const r=Et(Object.create(null),e);for(const n in t)r[n]=rr(e[n],t[n]);return r}function vb(){return{app:null,config:{isNativeTag:EL,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let iV=0;function aV(e,t){return function(r,n=null){Be(r)||(r=Et({},r)),n!=null&&!lt(n)&&(process.env.NODE_ENV!=="production"&&Se("root props passed to app.mount() must be an object."),n=null);const i=vb(),a=new WeakSet;let o=!1;const u=i.app={_uid:iV++,_component:r,_props:n,_container:null,_context:i,_instance:null,version:eg,get config(){return i.config},set config(c){process.env.NODE_ENV!=="production"&&Se("app.config cannot be replaced. Modify individual options instead.")},use(c,...l){return a.has(c)?process.env.NODE_ENV!=="production"&&Se("Plugin has already been applied to target app."):c&&Be(c.install)?(a.add(c),c.install(u,...l)):Be(c)?(a.add(c),c(u,...l)):process.env.NODE_ENV!=="production"&&Se('A plugin must either be a function or an object with an "install" function.'),u},mixin(c){return i.mixins.includes(c)?process.env.NODE_ENV!=="production"&&Se("Mixin has already been applied to target app"+(c.name?`: ${c.name}`:"")):i.mixins.push(c),u},component(c,l){return process.env.NODE_ENV!=="production"&&hl(c,i.config),l?(process.env.NODE_ENV!=="production"&&i.components[c]&&Se(`Component "${c}" has already been registered in target app.`),i.components[c]=l,u):i.components[c]},directive(c,l){return process.env.NODE_ENV!=="production"&&ib(c),l?(process.env.NODE_ENV!=="production"&&i.directives[c]&&Se(`Directive "${c}" has already been registered in target app.`),i.directives[c]=l,u):i.directives[c]},mount(c,l,s){if(o)process.env.NODE_ENV!=="production"&&Se("App has already been mounted.\nIf you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. `const createMyApp = () => createApp(App)`");else{process.env.NODE_ENV!=="production"&&c.__vue_app__&&Se("There is already an app instance mounted on the host container.\n If you want to mount another app on the same host container, you need to unmount the previous app by calling `app.unmount()` first.");const f=$t(r,n);return f.appContext=i,s===!0?s="svg":s===!1&&(s=void 0),process.env.NODE_ENV!=="production"&&(i.reload=()=>{e(un(f),c,s)}),l&&t?t(f,c):e(f,c,s),o=!0,u._container=c,c.__vue_app__=u,process.env.NODE_ENV!=="production"&&(u._instance=f.component,AP(u,eg)),Wu(f.component)}},unmount(){o?(e(null,u._container),process.env.NODE_ENV!=="production"&&(u._instance=null,SP(u)),delete u._container.__vue_app__):process.env.NODE_ENV!=="production"&&Se("Cannot unmount an app that is not mounted.")},provide(c,l){return process.env.NODE_ENV!=="production"&&c in i.provides&&Se(`App already provides property with key "${String(c)}". It will be overwritten with the new value.`),i.provides[c]=l,u},runWithContext(c){const l=ca;ca=u;try{return c()}finally{ca=l}}};return u}}let ca=null;function yb(e,t){if(!Ot)process.env.NODE_ENV!=="production"&&Se("provide() can only be used inside setup().");else{let r=Ot.provides;const n=Ot.parent&&Ot.parent.provides;n===r&&(r=Ot.provides=Object.create(n)),r[e]=t}}function an(e,t,r=!1){const n=Ot||_t;if(n||ca){const i=ca?ca._context.provides:n?n.parent==null?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return r&&Be(t)?t.call(n&&n.proxy):t;process.env.NODE_ENV!=="production"&&Se(`injection "${String(e)}" not found.`)}else process.env.NODE_ENV!=="production"&&Se("inject() can only be used inside setup() or functional components.")}const xb={},bb=()=>Object.create(xb),wb=e=>Object.getPrototypeOf(e)===xb;function oV(e,t,r,n=!1){const i={},a=bb();e.propsDefaults=Object.create(null),Nb(e,t,i,a);for(const o in e.propsOptions[0])o in i||(i[o]=void 0);process.env.NODE_ENV!=="production"&&Eb(t||{},i,e),r?e.props=n?i:Vx(i):e.type.props?e.props=i:e.props=a,e.attrs=a}function sV(e){for(;e;){if(e.type.__hmrId)return!0;e=e.parent}}function uV(e,t,r,n){const{props:i,attrs:a,vnode:{patchFlag:o}}=e,u=Ye(i),[c]=e.propsOptions;let l=!1;if(!(process.env.NODE_ENV!=="production"&&sV(e))&&(n||o>0)&&!(o&16)){if(o&8){const s=e.vnode.dynamicProps;for(let f=0;f<s.length;f++){let p=s[f];if(Ju(e.emitsOptions,p))continue;const m=t[p];if(c)if(tt(a,p))m!==a[p]&&(a[p]=m,l=!0);else{const d=wr(p);i[d]=ll(c,u,d,m,e,!1)}else m!==a[p]&&(a[p]=m,l=!0)}}}else{Nb(e,t,i,a)&&(l=!0);let s;for(const f in u)(!t||!tt(t,f)&&((s=Cn(f))===f||!tt(t,s)))&&(c?r&&(r[f]!==void 0||r[s]!==void 0)&&(i[f]=ll(c,u,f,void 0,e,!0)):delete i[f]);if(a!==u)for(const f in a)(!t||!tt(t,f))&&(delete a[f],l=!0)}l&&nn(e.attrs,"set",""),process.env.NODE_ENV!=="production"&&Eb(t||{},i,e)}function Nb(e,t,r,n){const[i,a]=e.propsOptions;let o=!1,u;if(t)for(let c in t){if(eo(c))continue;const l=t[c];let s;i&&tt(i,s=wr(c))?!a||!a.includes(s)?r[s]=l:(u||(u={}))[s]=l:Ju(e.emitsOptions,c)||(!(c in n)||l!==n[c])&&(n[c]=l,o=!0)}if(a){const c=Ye(r),l=u||vt;for(let s=0;s<a.length;s++){const f=a[s];r[f]=ll(i,c,f,l[f],e,!tt(l,f))}}return o}function ll(e,t,r,n,i,a){const o=e[r];if(o!=null){const u=tt(o,"default");if(u&&n===void 0){const c=o.default;if(o.type!==Function&&!o.skipFactory&&Be(c)){const{propsDefaults:l}=i;if(r in l)n=l[r];else{const s=zo(i);n=l[r]=c.call(null,t),s()}}else n=c}o[0]&&(a&&!u?n=!1:o[1]&&(n===""||n===Cn(r))&&(n=!0))}return n}const cV=new WeakMap;function Db(e,t,r=!1){const n=r?cV:t.propsCache,i=n.get(e);if(i)return i;const a=e.props,o={},u=[];let c=!1;if(!Be(e)){const s=f=>{c=!0;const[p,m]=Db(f,t,!0);Et(o,p),m&&u.push(...m)};!r&&t.mixins.length&&t.mixins.forEach(s),e.extends&&s(e.extends),e.mixins&&e.mixins.forEach(s)}if(!a&&!c)return lt(e)&&n.set(e,oa),oa;if(Oe(a))for(let s=0;s<a.length;s++){process.env.NODE_ENV!=="production"&&!bt(a[s])&&Se("props must be strings when using array syntax.",a[s]);const f=wr(a[s]);$0(f)&&(o[f]=vt)}else if(a){process.env.NODE_ENV!=="production"&&!lt(a)&&Se("invalid props options",a);for(const s in a){const f=wr(s);if($0(f)){const p=a[s],m=o[f]=Oe(p)||Be(p)?{type:p}:Et({},p),d=m.type;let h=!1,w=!0;if(Oe(d))for(let v=0;v<d.length;++v){const b=d[v],g=Be(b)&&b.name;if(g==="Boolean"){h=!0;break}else g==="String"&&(w=!1)}else h=Be(d)&&d.name==="Boolean";m[0]=h,m[1]=w,(h||tt(m,"default"))&&u.push(f)}}}const l=[o,u];return lt(e)&&n.set(e,l),l}function $0(e){return e[0]!=="$"&&!eo(e)?!0:(process.env.NODE_ENV!=="production"&&Se(`Invalid prop name: "${e}" is a reserved property.`),!1)}function lV(e){return e===null?"null":typeof e=="function"?e.name||"":typeof e=="object"&&e.constructor&&e.constructor.name||""}function Eb(e,t,r){const n=Ye(t),i=r.propsOptions[0];for(const a in i){let o=i[a];o!=null&&fV(a,n[a],o,process.env.NODE_ENV!=="production"?rn(n):n,!tt(e,a)&&!tt(e,Cn(a)))}}function fV(e,t,r,n,i){const{type:a,required:o,validator:u,skipCheck:c}=r;if(o&&i){Se('Missing required prop: "'+e+'"');return}if(!(t==null&&!o)){if(a!=null&&a!==!0&&!c){let l=!1;const s=Oe(a)?a:[a],f=[];for(let p=0;p<s.length&&!l;p++){const{valid:m,expectedType:d}=mV(t,s[p]);f.push(d||""),l=m}if(!l){Se(dV(e,t,f));return}}u&&!u(t,n)&&Se('Invalid prop: custom validator check failed for prop "'+e+'".')}}const pV=za("String,Number,Boolean,Function,Symbol,BigInt");function mV(e,t){let r;const n=lV(t);if(pV(n)){const i=typeof e;r=i===n.toLowerCase(),!r&&i==="object"&&(r=e instanceof t)}else n==="Object"?r=lt(e):n==="Array"?r=Oe(e):n==="null"?r=e===null:r=e instanceof t;return{valid:r,expectedType:n}}function dV(e,t,r){if(r.length===0)return`Prop type [] for prop "${e}" won't match anything. Did you mean to use type Array instead?`;let n=`Invalid prop: type check failed for prop "${e}". Expected ${r.map(ki).join(" | ")}`;const i=r[0],a=lf(t),o=H0(t,i),u=H0(t,a);return r.length===1&&J0(i)&&!hV(i,a)&&(n+=` with value ${o}`),n+=`, got ${a} `,J0(a)&&(n+=`with value ${u}.`),n}function H0(e,t){return t==="String"?`"${e}"`:t==="Number"?`${Number(e)}`:`${e}`}function J0(e){return["string","number","boolean"].some(t=>e.toLowerCase()===t)}function hV(...e){return e.some(t=>t.toLowerCase()==="boolean")}const Ab=e=>e[0]==="_"||e==="$stable",Mf=e=>Oe(e)?e.map(qr):[qr(e)],gV=(e,t,r)=>{if(t._n)return t;const n=to((...i)=>(process.env.NODE_ENV!=="production"&&Ot&&(!r||r.root===Ot.root)&&Se(`Slot "${e}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`),Mf(t(...i))),r);return n._c=!1,n},Sb=(e,t,r)=>{const n=e._ctx;for(const i in e){if(Ab(i))continue;const a=e[i];if(Be(a))t[i]=gV(i,a,n);else if(a!=null){process.env.NODE_ENV!=="production"&&Se(`Non-function value encountered for slot "${i}". Prefer function slots for better performance.`);const o=Mf(a);t[i]=()=>o}}},Cb=(e,t)=>{process.env.NODE_ENV!=="production"&&!Ro(e.vnode)&&Se("Non-function value encountered for default slot. Prefer function slots for better performance.");const r=Mf(t);e.slots.default=()=>r},fl=(e,t,r)=>{for(const n in t)(r||n!=="_")&&(e[n]=t[n])},vV=(e,t,r)=>{const n=e.slots=bb();if(e.vnode.shapeFlag&32){const i=t._;i?(fl(n,t,r),r&&eu(n,"_",i,!0)):Sb(t,n)}else t&&Cb(e,t)},yV=(e,t,r)=>{const{vnode:n,slots:i}=e;let a=!0,o=vt;if(n.shapeFlag&32){const u=t._;u?process.env.NODE_ENV!=="production"&&_i?(fl(i,t,r),nn(e,"set","$slots")):r&&u===1?a=!1:fl(i,t,r):(a=!t.$stable,Sb(t,i)),o=t}else t&&(Cb(e,t),o={default:1});if(a)for(const u in i)!Ab(u)&&o[u]==null&&delete i[u]};function pl(e,t,r,n,i=!1){if(Oe(e)){e.forEach((p,m)=>pl(p,t&&(Oe(t)?t[m]:t),r,n,i));return}if(ro(n)&&!i)return;const a=n.shapeFlag&4?Wu(n.component):n.el,o=i?null:a,{i:u,r:c}=e;if(process.env.NODE_ENV!=="production"&&!u){Se("Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.");return}const l=t&&t.r,s=u.refs===vt?u.refs={}:u.refs,f=u.setupState;if(l!=null&&l!==c&&(bt(l)?(s[l]=null,tt(f,l)&&(f[l]=null)):Lt(l)&&(l.value=null)),Be(c))En(c,u,12,[o,s]);else{const p=bt(c),m=Lt(c);if(p||m){const d=()=>{if(e.f){const h=p?tt(f,c)?f[c]:s[c]:c.value;i?Oe(h)&&uf(h,a):Oe(h)?h.includes(a)||h.push(a):p?(s[c]=[a],tt(f,c)&&(f[c]=s[c])):(c.value=[a],e.k&&(s[e.k]=c.value))}else p?(s[c]=o,tt(f,c)&&(f[c]=o)):m?(c.value=o,e.k&&(s[e.k]=o)):process.env.NODE_ENV!=="production"&&Se("Invalid template ref type:",c,`(${typeof c})`)};o?(d.id=-1,pr(d,r)):d()}else process.env.NODE_ENV!=="production"&&Se("Invalid template ref type:",c,`(${typeof c})`)}}const xV=Symbol("_vte"),bV=e=>e.__isTeleport;let ps,Jn;function gn(e,t){e.appContext.config.performance&&au()&&Jn.mark(`vue-${t}-${e.uid}`),process.env.NODE_ENV!=="production"&&FP(e,t,au()?Jn.now():Date.now())}function vn(e,t){if(e.appContext.config.performance&&au()){const r=`vue-${t}-${e.uid}`,n=r+":end";Jn.mark(n),Jn.measure(`<${Ku(e,e.type)}> ${t}`,r,n),Jn.clearMarks(r),Jn.clearMarks(n)}process.env.NODE_ENV!=="production"&&TP(e,t,au()?Jn.now():Date.now())}function au(){return ps!==void 0||(typeof window<"u"&&window.performance?(ps=!0,Jn=window.performance):ps=!1),ps}function wV(){const e=[];if(process.env.NODE_ENV!=="production"&&e.length){const t=e.length>1;console.warn(`Feature flag${t?"s":""} ${e.join(", ")} ${t?"are":"is"} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.
|
|
92
|
+
`,...dP(i)),console.warn(...a)}In(),xc=!1}function mP(){let e=Mi[Mi.length-1];if(!e)return[];const t=[];for(;e;){const r=t[0];r&&r.vnode===e?r.recurseCount++:t.push({vnode:e,recurseCount:0});const n=e.component&&e.component.parent;e=n&&n.vnode}return t}function dP(e){const t=[];return e.forEach((r,n)=>{t.push(...n===0?[]:[`
|
|
93
|
+
`],...hP(r))}),t}function hP({vnode:e,recurseCount:t}){const r=t>0?`... (${t} recursive calls)`:"",n=e.component?e.component.parent==null:!1,i=` at <${Qu(e.component,e.type,n)}`,a=">"+r;return e.props?[i,...gP(e.props),a]:[i+a]}function gP(e){const t=[],r=Object.keys(e);return r.slice(0,3).forEach(n=>{t.push(...Gb(n,e[n]))}),r.length>3&&t.push(" ..."),t}function Gb(e,t,r){return xt(t)?(t=JSON.stringify(t),r?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?r?t:[`${e}=${t}`]:Lt(t)?(t=Gb(e,Ye(t.value),!0),r?t:[`${e}=Ref<`,t,">"]):Be(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=Ye(t),r?t:[`${e}=`,t])}function vP(e,t){process.env.NODE_ENV!=="production"&&e!==void 0&&(typeof e!="number"?Se(`${t} is not a valid number - got ${JSON.stringify(e)}.`):isNaN(e)&&Se(`${t} is NaN - the duration expression might be incorrect.`))}const Nf={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update"};function En(e,t,r,n){try{return n?e(...n):e()}catch(i){Io(i,t,r)}}function _r(e,t,r,n){if(Be(e)){const i=En(e,t,r,n);return i&&lf(i)&&i.catch(a=>{Io(a,t,r)}),i}if(Oe(e)){const i=[];for(let a=0;a<e.length;a++)i.push(_r(e[a],t,r,n));return i}else process.env.NODE_ENV!=="production"&&Se(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function Io(e,t,r,n=!0){const i=t?t.vnode:null;if(t){let a=t.parent;const o=t.proxy,u=process.env.NODE_ENV!=="production"?Nf[r]:`https://vuejs.org/error-reference/#runtime-${r}`;for(;a;){const l=a.ec;if(l){for(let s=0;s<l.length;s++)if(l[s](e,o,u)===!1)return}a=a.parent}const c=t.appContext.config.errorHandler;if(c){kn(),En(c,null,10,[e,o,u]),In();return}}yP(e,r,i,n)}function yP(e,t,r,n=!0){if(process.env.NODE_ENV!=="production"){const i=Nf[t];if(r&&ws(r),Se(`Unhandled error${i?` during execution of ${i}`:""}`),r&&Ns(),n)throw e;console.error(e)}else console.error(e)}let po=!1,al=!1;const Zt=[];let Yr=0;const ca=[];let Un=null,yi=0;const Wb=Promise.resolve();let Df=null;const bP=100;function Kb(e){const t=Df||Wb;return e?t.then(this?e.bind(this):e):t}function xP(e){let t=Yr+1,r=Zt.length;for(;t<r;){const n=t+r>>>1,i=Zt[n],a=mo(i);a<e||a===e&&i.pre?t=n+1:r=n}return t}function $u(e){(!Zt.length||!Zt.includes(e,po&&e.allowRecurse?Yr+1:Yr))&&(e.id==null?Zt.push(e):Zt.splice(xP(e.id),0,e),Qb())}function Qb(){!po&&!al&&(al=!0,Df=Wb.then(Yb))}function wP(e){const t=Zt.indexOf(e);t>Yr&&Zt.splice(t,1)}function Zb(e){Oe(e)?ca.push(...e):(!Un||!Un.includes(e,e.allowRecurse?yi+1:yi))&&ca.push(e),Qb()}function q0(e,t,r=po?Yr+1:0){for(process.env.NODE_ENV!=="production"&&(t=t||new Map);r<Zt.length;r++){const n=Zt[r];if(n&&n.pre){if(e&&n.id!==e.uid||process.env.NODE_ENV!=="production"&&Ef(t,n))continue;Zt.splice(r,1),r--,n()}}}function Xb(e){if(ca.length){const t=[...new Set(ca)].sort((r,n)=>mo(r)-mo(n));if(ca.length=0,Un){Un.push(...t);return}for(Un=t,process.env.NODE_ENV!=="production"&&(e=e||new Map),yi=0;yi<Un.length;yi++){const r=Un[yi];process.env.NODE_ENV!=="production"&&Ef(e,r)||r.active!==!1&&r()}Un=null,yi=0}}const mo=e=>e.id==null?1/0:e.id,NP=(e,t)=>{const r=mo(e)-mo(t);if(r===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return r};function Yb(e){al=!1,po=!0,process.env.NODE_ENV!=="production"&&(e=e||new Map),Zt.sort(NP);const t=process.env.NODE_ENV!=="production"?r=>Ef(e,r):St;try{for(Yr=0;Yr<Zt.length;Yr++){const r=Zt[Yr];if(r&&r.active!==!1){if(process.env.NODE_ENV!=="production"&&t(r))continue;En(r,r.i,r.i?15:14)}}}finally{Yr=0,Zt.length=0,Xb(e),po=!1,Df=null,(Zt.length||ca.length)&&Yb(e)}}function Ef(e,t){if(!e.has(t))e.set(t,1);else{const r=e.get(t);if(r>bP){const n=t.i,i=n&&Of(n.type);return Io(`Maximum recursive updates exceeded${i?` in component <${i}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}else e.set(t,r+1)}}let _i=!1;const Ds=new Map;process.env.NODE_ENV!=="production"&&(mf().__VUE_HMR_RUNTIME__={createRecord:wc(ex),rerender:wc(AP),reload:wc(SP)});const Ii=new Map;function DP(e){const t=e.type.__hmrId;let r=Ii.get(t);r||(ex(t,e.type),r=Ii.get(t)),r.instances.add(e)}function EP(e){Ii.get(e.type.__hmrId).instances.delete(e)}function ex(e,t){return Ii.has(e)?!1:(Ii.set(e,{initialDef:ru(t),instances:new Set}),!0)}function ru(e){return Px(e)?e.__vccOpts:e}function AP(e,t){const r=Ii.get(e);r&&(r.initialDef.render=t,[...r.instances].forEach(n=>{t&&(n.render=t,ru(n.type).render=t),n.renderCache=[],_i=!0,n.effect.dirty=!0,n.update(),_i=!1}))}function SP(e,t){const r=Ii.get(e);if(!r)return;t=ru(t),z0(r.initialDef,t);const n=[...r.instances];for(let i=0;i<n.length;i++){const a=n[i],o=ru(a.type);let u=Ds.get(o);u||(o!==r.initialDef&&z0(o,t),Ds.set(o,u=new Set)),u.add(a),a.appContext.propsCache.delete(a.type),a.appContext.emitsCache.delete(a.type),a.appContext.optionsCache.delete(a.type),a.ceReload?(u.add(a),a.ceReload(t.styles),u.delete(a)):a.parent?(a.parent.effect.dirty=!0,$u(()=>{a.parent.update(),u.delete(a)})):a.appContext.reload?a.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}Zb(()=>{Ds.clear()})}function z0(e,t){Et(e,t);for(const r in e)r!=="__file"&&!(r in t)&&delete e[r]}function wc(e){return(t,r)=>{try{return e(t,r)}catch(n){console.error(n),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let en,Ya=[],ol=!1;function Ro(e,...t){en?en.emit(e,...t):ol||Ya.push({event:e,args:t})}function tx(e,t){var r,n;en=e,en?(en.enabled=!0,Ya.forEach(({event:i,args:a})=>en.emit(i,...a)),Ya=[]):typeof window<"u"&&window.HTMLElement&&!((n=(r=window.navigator)==null?void 0:r.userAgent)!=null&&n.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{tx(i,t)}),setTimeout(()=>{en||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,ol=!0,Ya=[])},3e3)):(ol=!0,Ya=[])}function CP(e,t){Ro("app:init",e,t,{Fragment:mr,Text:zo,Comment:Mt,Static:As})}function MP(e){Ro("app:unmount",e)}const _P=Af("component:added"),rx=Af("component:updated"),FP=Af("component:removed"),TP=e=>{en&&typeof en.cleanupBuffer=="function"&&!en.cleanupBuffer(e)&&FP(e)};/*! #__NO_SIDE_EFFECTS__ */function Af(e){return t=>{Ro(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}const OP=nx("perf:start"),BP=nx("perf:end");function nx(e){return(t,r,n)=>{Ro(e,t.appContext.app,t.uid,t,r,n)}}function kP(e,t,r){Ro("component:emit",e.appContext.app,e,t,r)}let _t=null,ix=null;function nu(e){const t=_t;return _t=e,ix=e&&e.type.__scopeId||null,t}function ro(e,t=_t,r){if(!t||e._n)return e;const n=(...i)=>{n._d&&Z0(-1);const a=nu(t);let o;try{o=e(...i)}finally{nu(a),n._d&&Z0(1)}return process.env.NODE_ENV!=="production"&&rx(t),o};return n._n=!0,n._c=!0,n._d=!0,n}function ax(e){ML(e)&&Se("Do not use built-in directive ids as custom directive id: "+e)}function ox(e,t){if(_t===null)return process.env.NODE_ENV!=="production"&&Se("withDirectives can only be used inside render functions."),e;const r=Ku(_t),n=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[a,o,u,c=vt]=t[i];a&&(Be(a)&&(a={mounted:a,updated:a}),a.deep&&Gn(o),n.push({dir:a,instance:r,value:o,oldValue:void 0,arg:u,modifiers:c}))}return e}function pi(e,t,r,n){const i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){const u=i[o];a&&(u.oldValue=a[o].value);let c=u.dir[n];c&&(kn(),_r(c,r,8,[e.el,u,e,t]),In())}}const $n=Symbol("_leaveCb"),ps=Symbol("_enterCb");function IP(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Ju(()=>{e.isMounted=!0}),px(()=>{e.isUnmounting=!0}),e}const Ar=[Function,Array],sx={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ar,onEnter:Ar,onAfterEnter:Ar,onEnterCancelled:Ar,onBeforeLeave:Ar,onLeave:Ar,onAfterLeave:Ar,onLeaveCancelled:Ar,onBeforeAppear:Ar,onAppear:Ar,onAfterAppear:Ar,onAppearCancelled:Ar},ux=e=>{const t=e.subTree;return t.component?ux(t.component):t},RP={name:"BaseTransition",props:sx,setup(e,{slots:t}){const r=ri(),n=IP();return()=>{const i=t.default&&lx(t.default(),!0);if(!i||!i.length)return;let a=i[0];if(i.length>1){let p=!1;for(const m of i)if(m.type!==Mt){if(process.env.NODE_ENV!=="production"&&p){Se("<transition> can only be used on a single element or component. Use <transition-group> for lists.");break}if(a=m,p=!0,process.env.NODE_ENV==="production")break}}const o=Ye(e),{mode:u}=o;if(process.env.NODE_ENV!=="production"&&u&&u!=="in-out"&&u!=="out-in"&&u!=="default"&&Se(`invalid <transition> mode: ${u}`),n.isLeaving)return Nc(a);const c=j0(a);if(!c)return Nc(a);let l=sl(c,o,n,r,p=>l=p);iu(c,l);const s=r.subTree,f=s&&j0(s);if(f&&f.type!==Mt&&!xi(c,f)&&ux(r).type!==Mt){const p=sl(f,o,n,r);if(iu(f,p),u==="out-in"&&c.type!==Mt)return n.isLeaving=!0,p.afterLeave=()=>{n.isLeaving=!1,r.update.active!==!1&&(r.effect.dirty=!0,r.update())},Nc(a);u==="in-out"&&c.type!==Mt&&(p.delayLeave=(m,d,h)=>{const w=cx(n,f);w[String(f.key)]=f,m[$n]=()=>{d(),m[$n]=void 0,delete l.delayedLeave},l.delayedLeave=h})}return a}}},qP=RP;function cx(e,t){const{leavingVNodes:r}=e;let n=r.get(t.type);return n||(n=Object.create(null),r.set(t.type,n)),n}function sl(e,t,r,n,i){const{appear:a,mode:o,persisted:u=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:s,onEnterCancelled:f,onBeforeLeave:p,onLeave:m,onAfterLeave:d,onLeaveCancelled:h,onBeforeAppear:w,onAppear:v,onAfterAppear:x,onAppearCancelled:g}=t,b=String(e.key),y=cx(r,e),N=(D,S)=>{D&&_r(D,n,9,S)},E=(D,S)=>{const C=S[1];N(D,S),Oe(D)?D.every(_=>_.length<=1)&&C():D.length<=1&&C()},A={mode:o,persisted:u,beforeEnter(D){let S=c;if(!r.isMounted)if(a)S=w||c;else return;D[$n]&&D[$n](!0);const C=y[b];C&&xi(e,C)&&C.el[$n]&&C.el[$n](),N(S,[D])},enter(D){let S=l,C=s,_=f;if(!r.isMounted)if(a)S=v||l,C=x||s,_=g||f;else return;let R=!1;const P=D[ps]=I=>{R||(R=!0,I?N(_,[D]):N(C,[D]),A.delayedLeave&&A.delayedLeave(),D[ps]=void 0)};S?E(S,[D,P]):P()},leave(D,S){const C=String(e.key);if(D[ps]&&D[ps](!0),r.isUnmounting)return S();N(p,[D]);let _=!1;const R=D[$n]=P=>{_||(_=!0,S(),P?N(h,[D]):N(d,[D]),D[$n]=void 0,y[C]===e&&delete y[C])};y[C]=e,m?E(m,[D,R]):R()},clone(D){const S=sl(D,t,r,n,i);return i&&i(S),S}};return A}function Nc(e){if(qo(e))return e=un(e),e.children=null,e}function j0(e){if(!qo(e))return e;if(process.env.NODE_ENV!=="production"&&e.component)return e.component.subTree;const{shapeFlag:t,children:r}=e;if(r){if(t&16)return r[0];if(t&32&&Be(r.default))return r.default()}}function iu(e,t){e.shapeFlag&6&&e.component?iu(e.component.subTree,t):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function lx(e,t=!1,r){let n=[],i=0;for(let a=0;a<e.length;a++){let o=e[a];const u=r==null?o.key:String(r)+String(o.key!=null?o.key:a);o.type===mr?(o.patchFlag&128&&i++,n=n.concat(lx(o.children,t,u))):(t||o.type!==Mt)&&n.push(u!=null?un(o,{key:u}):o)}if(i>1)for(let a=0;a<n.length;a++)n[a].patchFlag=-2;return n}/*! #__NO_SIDE_EFFECTS__ */function Zr(e,t){return Be(e)?Et({name:e.name},t,{setup:e}):e}const no=e=>!!e.type.__asyncLoader,qo=e=>e.type.__isKeepAlive;function zP(e,t){fx(e,"a",t)}function jP(e,t){fx(e,"da",t)}function fx(e,t,r=Ot){const n=e.__wdc||(e.__wdc=()=>{let i=r;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(Hu(t,n,r),r){let i=r.parent;for(;i&&i.parent;)qo(i.parent.vnode)&&LP(n,t,r,i),i=i.parent}}function LP(e,t,r,n){const i=Hu(t,e,n,!0);mx(()=>{cf(n[t],i)},r)}function Hu(e,t,r=Ot,n=!1){if(r){const i=r[e]||(r[e]=[]),a=t.__weh||(t.__weh=(...o)=>{kn();const u=jo(r),c=_r(t,r,e,o);return u(),In(),c});return n?i.unshift(a):i.push(a),a}else if(process.env.NODE_ENV!=="production"){const i=vi(Nf[e].replace(/ hook$/,""));Se(`${i} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}}const Rn=e=>(t,r=Ot)=>{(!Wu||e==="sp")&&Hu(e,(...n)=>t(...n),r)},PP=Rn("bm"),Ju=Rn("m"),VP=Rn("bu"),UP=Rn("u"),px=Rn("bum"),mx=Rn("um"),$P=Rn("sp"),HP=Rn("rtg"),JP=Rn("rtc");function GP(e,t=Ot){Hu("ec",e,t)}const WP="components",dx=Symbol.for("v-ndc");function KP(e){return xt(e)?QP(WP,e,!1)||e:e||dx}function QP(e,t,r=!0,n=!1){const i=_t||Ot;if(i){const a=i.type;{const u=Of(a,!1);if(u&&(u===t||u===wr(t)||u===ki(wr(t))))return a}const o=L0(i[e]||a[e],t)||L0(i.appContext[e],t);return!o&&n?a:(process.env.NODE_ENV!=="production"&&r&&!o&&Se(`Failed to resolve ${e.slice(0,-1)}: ${t}
|
|
94
|
+
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`),o)}else process.env.NODE_ENV!=="production"&&Se(`resolve${ki(e.slice(0,-1))} can only be used in render() or setup().`)}function L0(e,t){return e&&(e[t]||e[wr(t)]||e[ki(wr(t))])}function Sf(e,t,r={},n,i){if(_t.isCE||_t.parent&&no(_t.parent)&&_t.parent.isCE)return $t("slot",r,n&&n());let a=e[t];process.env.NODE_ENV!=="production"&&a&&a.length>1&&(Se("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template."),a=()=>[]),a&&a._c&&(a._d=!1),Kt();const o=a&&hx(a(r)),u=bi(mr,{key:(r.key||o&&o.key||`_${t}`)+(!o&&n?"_fb":"")},o||(n?n():[]),o&&e._===1?64:-2);return u.scopeId&&(u.slotScopeIds=[u.scopeId+"-s"]),a&&a._c&&(a._d=!0),u}function hx(e){return e.some(t=>ti(t)?!(t.type===Mt||t.type===mr&&!hx(t.children)):!0)?e:null}const ul=e=>e?jx(e)?Ku(e):ul(e.parent):null,Fi=Et(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>process.env.NODE_ENV!=="production"?rn(e.props):e.props,$attrs:e=>process.env.NODE_ENV!=="production"?rn(e.attrs):e.attrs,$slots:e=>process.env.NODE_ENV!=="production"?rn(e.slots):e.slots,$refs:e=>process.env.NODE_ENV!=="production"?rn(e.refs):e.refs,$parent:e=>ul(e.parent),$root:e=>ul(e.root),$emit:e=>e.emit,$options:e=>Mf(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,$u(e.update)}),$nextTick:e=>e.n||(e.n=Kb.bind(e.proxy)),$watch:e=>FV.bind(e)}),Cf=e=>e==="_"||e==="$",Dc=(e,t)=>e!==vt&&!e.__isScriptSetup&&tt(e,t),gx={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:r,setupState:n,data:i,props:a,accessCache:o,type:u,appContext:c}=e;if(process.env.NODE_ENV!=="production"&&t==="__isVue")return!0;let l;if(t[0]!=="$"){const m=o[t];if(m!==void 0)switch(m){case 1:return n[t];case 2:return i[t];case 4:return r[t];case 3:return a[t]}else{if(Dc(n,t))return o[t]=1,n[t];if(i!==vt&&tt(i,t))return o[t]=2,i[t];if((l=e.propsOptions[0])&&tt(l,t))return o[t]=3,a[t];if(r!==vt&&tt(r,t))return o[t]=4,r[t];cl&&(o[t]=0)}}const s=Fi[t];let f,p;if(s)return t==="$attrs"?(Ht(e.attrs,"get",""),process.env.NODE_ENV!=="production"&&su()):process.env.NODE_ENV!=="production"&&t==="$slots"&&Ht(e,"get",t),s(e);if((f=u.__cssModules)&&(f=f[t]))return f;if(r!==vt&&tt(r,t))return o[t]=4,r[t];if(p=c.config.globalProperties,tt(p,t))return p[t];process.env.NODE_ENV!=="production"&&_t&&(!xt(t)||t.indexOf("__v")!==0)&&(i!==vt&&Cf(t[0])&&tt(i,t)?Se(`Property ${JSON.stringify(t)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):e===_t&&Se(`Property ${JSON.stringify(t)} was accessed during render but is not defined on instance.`))},set({_:e},t,r){const{data:n,setupState:i,ctx:a}=e;return Dc(i,t)?(i[t]=r,!0):process.env.NODE_ENV!=="production"&&i.__isScriptSetup&&tt(i,t)?(Se(`Cannot mutate <script setup> binding "${t}" from Options API.`),!1):n!==vt&&tt(n,t)?(n[t]=r,!0):tt(e.props,t)?(process.env.NODE_ENV!=="production"&&Se(`Attempting to mutate prop "${t}". Props are readonly.`),!1):t[0]==="$"&&t.slice(1)in e?(process.env.NODE_ENV!=="production"&&Se(`Attempting to mutate public property "${t}". Properties starting with $ are reserved and readonly.`),!1):(process.env.NODE_ENV!=="production"&&t in e.appContext.config.globalProperties?Object.defineProperty(a,t,{enumerable:!0,configurable:!0,value:r}):a[t]=r,!0)},has({_:{data:e,setupState:t,accessCache:r,ctx:n,appContext:i,propsOptions:a}},o){let u;return!!r[o]||e!==vt&&tt(e,o)||Dc(t,o)||(u=a[0])&&tt(u,o)||tt(n,o)||tt(Fi,o)||tt(i.config.globalProperties,o)},defineProperty(e,t,r){return r.get!=null?e._.accessCache[t]=0:tt(r,"value")&&this.set(e,t,r.value,null),Reflect.defineProperty(e,t,r)}};process.env.NODE_ENV!=="production"&&(gx.ownKeys=e=>(Se("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));function ZP(e){const t={};return Object.defineProperty(t,"_",{configurable:!0,enumerable:!1,get:()=>e}),Object.keys(Fi).forEach(r=>{Object.defineProperty(t,r,{configurable:!0,enumerable:!1,get:()=>Fi[r](e),set:St})}),t}function XP(e){const{ctx:t,propsOptions:[r]}=e;r&&Object.keys(r).forEach(n=>{Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>e.props[n],set:St})})}function YP(e){const{ctx:t,setupState:r}=e;Object.keys(Ye(r)).forEach(n=>{if(!r.__isScriptSetup){if(Cf(n[0])){Se(`setup() return property ${JSON.stringify(n)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`);return}Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r[n],set:St})}})}function P0(e){return Oe(e)?e.reduce((t,r)=>(t[r]=null,t),{}):e}function eV(){const e=Object.create(null);return(t,r)=>{e[r]?Se(`${t} property "${r}" is already defined in ${e[r]}.`):e[r]=t}}let cl=!0;function tV(e){const t=Mf(e),r=e.proxy,n=e.ctx;cl=!1,t.beforeCreate&&V0(t.beforeCreate,e,"bc");const{data:i,computed:a,methods:o,watch:u,provide:c,inject:l,created:s,beforeMount:f,mounted:p,beforeUpdate:m,updated:d,activated:h,deactivated:w,beforeDestroy:v,beforeUnmount:x,destroyed:g,unmounted:b,render:y,renderTracked:N,renderTriggered:E,errorCaptured:A,serverPrefetch:D,expose:S,inheritAttrs:C,components:_,directives:R,filters:P}=t,I=process.env.NODE_ENV!=="production"?eV():null;if(process.env.NODE_ENV!=="production"){const[F]=e.propsOptions;if(F)for(const q in F)I("Props",q)}if(l&&rV(l,n,I),o)for(const F in o){const q=o[F];Be(q)?(process.env.NODE_ENV!=="production"?Object.defineProperty(n,F,{value:q.bind(r),configurable:!0,enumerable:!0,writable:!0}):n[F]=q.bind(r),process.env.NODE_ENV!=="production"&&I("Methods",F)):process.env.NODE_ENV!=="production"&&Se(`Method "${F}" has type "${typeof q}" in the component definition. Did you reference the function correctly?`)}if(i){process.env.NODE_ENV!=="production"&&!Be(i)&&Se("The data option must be a function. Plain object usage is no longer supported.");const F=i.call(r,r);if(process.env.NODE_ENV!=="production"&&lf(F)&&Se("data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>."),!lt(F))process.env.NODE_ENV!=="production"&&Se("data() should return an object.");else if(e.data=bf(F),process.env.NODE_ENV!=="production")for(const q in F)I("Data",q),Cf(q[0])||Object.defineProperty(n,q,{configurable:!0,enumerable:!0,get:()=>F[q],set:St})}if(cl=!0,a)for(const F in a){const q=a[F],k=Be(q)?q.bind(r,r):Be(q.get)?q.get.bind(r,r):St;process.env.NODE_ENV!=="production"&&k===St&&Se(`Computed property "${F}" has no getter.`);const te=!Be(q)&&Be(q.set)?q.set.bind(r):process.env.NODE_ENV!=="production"?()=>{Se(`Write operation failed: computed property "${F}" is readonly.`)}:St,se=yt({get:k,set:te});Object.defineProperty(n,F,{enumerable:!0,configurable:!0,get:()=>se.value,set:K=>se.value=K}),process.env.NODE_ENV!=="production"&&I("Computed",F)}if(u)for(const F in u)vx(u[F],n,r,F);if(c){const F=Be(c)?c.call(r):c;Reflect.ownKeys(F).forEach(q=>{bx(q,F[q])})}s&&V0(s,e,"c");function O(F,q){Oe(q)?q.forEach(k=>F(k.bind(r))):q&&F(q.bind(r))}if(O(PP,f),O(Ju,p),O(VP,m),O(UP,d),O(zP,h),O(jP,w),O(GP,A),O(JP,N),O(HP,E),O(px,x),O(mx,b),O($P,D),Oe(S))if(S.length){const F=e.exposed||(e.exposed={});S.forEach(q=>{Object.defineProperty(F,q,{get:()=>r[q],set:k=>r[q]=k})})}else e.exposed||(e.exposed={});y&&e.render===St&&(e.render=y),C!=null&&(e.inheritAttrs=C),_&&(e.components=_),R&&(e.directives=R)}function rV(e,t,r=St){Oe(e)&&(e=ll(e));for(const n in e){const i=e[n];let a;lt(i)?"default"in i?a=an(i.from||n,i.default,!0):a=an(i.from||n):a=an(i),Lt(a)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>a.value,set:o=>a.value=o}):t[n]=a,process.env.NODE_ENV!=="production"&&r("Inject",n)}}function V0(e,t,r){_r(Oe(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,r)}function vx(e,t,r,n){const i=n.includes(".")?Tx(r,n):()=>r[n];if(xt(e)){const a=t[e];Be(a)?fa(i,a):process.env.NODE_ENV!=="production"&&Se(`Invalid watch handler specified by key "${e}"`,a)}else if(Be(e))fa(i,e.bind(r));else if(lt(e))if(Oe(e))e.forEach(a=>vx(a,t,r,n));else{const a=Be(e.handler)?e.handler.bind(r):t[e.handler];Be(a)?fa(i,a,e):process.env.NODE_ENV!=="production"&&Se(`Invalid watch handler specified by key "${e.handler}"`,a)}else process.env.NODE_ENV!=="production"&&Se(`Invalid watch option: "${n}"`,e)}function Mf(e){const t=e.type,{mixins:r,extends:n}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,u=a.get(t);let c;return u?c=u:!i.length&&!r&&!n?c=t:(c={},i.length&&i.forEach(l=>au(c,l,o,!0)),au(c,t,o)),lt(t)&&a.set(t,c),c}function au(e,t,r,n=!1){const{mixins:i,extends:a}=t;a&&au(e,a,r,!0),i&&i.forEach(o=>au(e,o,r,!0));for(const o in t)if(n&&o==="expose")process.env.NODE_ENV!=="production"&&Se('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const u=nV[o]||r&&r[o];e[o]=u?u(e[o],t[o]):t[o]}return e}const nV={data:U0,props:$0,emits:$0,methods:eo,computed:eo,beforeCreate:rr,created:rr,beforeMount:rr,mounted:rr,beforeUpdate:rr,updated:rr,beforeDestroy:rr,beforeUnmount:rr,destroyed:rr,unmounted:rr,activated:rr,deactivated:rr,errorCaptured:rr,serverPrefetch:rr,components:eo,directives:eo,watch:aV,provide:U0,inject:iV};function U0(e,t){return t?e?function(){return Et(Be(e)?e.call(this,this):e,Be(t)?t.call(this,this):t)}:t:e}function iV(e,t){return eo(ll(e),ll(t))}function ll(e){if(Oe(e)){const t={};for(let r=0;r<e.length;r++)t[e[r]]=e[r];return t}return e}function rr(e,t){return e?[...new Set([].concat(e,t))]:t}function eo(e,t){return e?Et(Object.create(null),e,t):t}function $0(e,t){return e?Oe(e)&&Oe(t)?[...new Set([...e,...t])]:Et(Object.create(null),P0(e),P0(t??{})):t}function aV(e,t){if(!e)return t;if(!t)return e;const r=Et(Object.create(null),e);for(const n in t)r[n]=rr(e[n],t[n]);return r}function yx(){return{app:null,config:{isNativeTag:SL,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let oV=0;function sV(e,t){return function(r,n=null){Be(r)||(r=Et({},r)),n!=null&&!lt(n)&&(process.env.NODE_ENV!=="production"&&Se("root props passed to app.mount() must be an object."),n=null);const i=yx(),a=new WeakSet;let o=!1;const u=i.app={_uid:oV++,_component:r,_props:n,_container:null,_context:i,_instance:null,version:tg,get config(){return i.config},set config(c){process.env.NODE_ENV!=="production"&&Se("app.config cannot be replaced. Modify individual options instead.")},use(c,...l){return a.has(c)?process.env.NODE_ENV!=="production"&&Se("Plugin has already been applied to target app."):c&&Be(c.install)?(a.add(c),c.install(u,...l)):Be(c)?(a.add(c),c(u,...l)):process.env.NODE_ENV!=="production"&&Se('A plugin must either be a function or an object with an "install" function.'),u},mixin(c){return i.mixins.includes(c)?process.env.NODE_ENV!=="production"&&Se("Mixin has already been applied to target app"+(c.name?`: ${c.name}`:"")):i.mixins.push(c),u},component(c,l){return process.env.NODE_ENV!=="production"&&gl(c,i.config),l?(process.env.NODE_ENV!=="production"&&i.components[c]&&Se(`Component "${c}" has already been registered in target app.`),i.components[c]=l,u):i.components[c]},directive(c,l){return process.env.NODE_ENV!=="production"&&ax(c),l?(process.env.NODE_ENV!=="production"&&i.directives[c]&&Se(`Directive "${c}" has already been registered in target app.`),i.directives[c]=l,u):i.directives[c]},mount(c,l,s){if(o)process.env.NODE_ENV!=="production"&&Se("App has already been mounted.\nIf you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. `const createMyApp = () => createApp(App)`");else{process.env.NODE_ENV!=="production"&&c.__vue_app__&&Se("There is already an app instance mounted on the host container.\n If you want to mount another app on the same host container, you need to unmount the previous app by calling `app.unmount()` first.");const f=$t(r,n);return f.appContext=i,s===!0?s="svg":s===!1&&(s=void 0),process.env.NODE_ENV!=="production"&&(i.reload=()=>{e(un(f),c,s)}),l&&t?t(f,c):e(f,c,s),o=!0,u._container=c,c.__vue_app__=u,process.env.NODE_ENV!=="production"&&(u._instance=f.component,CP(u,tg)),Ku(f.component)}},unmount(){o?(e(null,u._container),process.env.NODE_ENV!=="production"&&(u._instance=null,MP(u)),delete u._container.__vue_app__):process.env.NODE_ENV!=="production"&&Se("Cannot unmount an app that is not mounted.")},provide(c,l){return process.env.NODE_ENV!=="production"&&c in i.provides&&Se(`App already provides property with key "${String(c)}". It will be overwritten with the new value.`),i.provides[c]=l,u},runWithContext(c){const l=la;la=u;try{return c()}finally{la=l}}};return u}}let la=null;function bx(e,t){if(!Ot)process.env.NODE_ENV!=="production"&&Se("provide() can only be used inside setup().");else{let r=Ot.provides;const n=Ot.parent&&Ot.parent.provides;n===r&&(r=Ot.provides=Object.create(n)),r[e]=t}}function an(e,t,r=!1){const n=Ot||_t;if(n||la){const i=la?la._context.provides:n?n.parent==null?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return r&&Be(t)?t.call(n&&n.proxy):t;process.env.NODE_ENV!=="production"&&Se(`injection "${String(e)}" not found.`)}else process.env.NODE_ENV!=="production"&&Se("inject() can only be used inside setup() or functional components.")}const xx={},wx=()=>Object.create(xx),Nx=e=>Object.getPrototypeOf(e)===xx;function uV(e,t,r,n=!1){const i={},a=wx();e.propsDefaults=Object.create(null),Dx(e,t,i,a);for(const o in e.propsOptions[0])o in i||(i[o]=void 0);process.env.NODE_ENV!=="production"&&Ax(t||{},i,e),r?e.props=n?i:Ub(i):e.type.props?e.props=i:e.props=a,e.attrs=a}function cV(e){for(;e;){if(e.type.__hmrId)return!0;e=e.parent}}function lV(e,t,r,n){const{props:i,attrs:a,vnode:{patchFlag:o}}=e,u=Ye(i),[c]=e.propsOptions;let l=!1;if(!(process.env.NODE_ENV!=="production"&&cV(e))&&(n||o>0)&&!(o&16)){if(o&8){const s=e.vnode.dynamicProps;for(let f=0;f<s.length;f++){let p=s[f];if(Gu(e.emitsOptions,p))continue;const m=t[p];if(c)if(tt(a,p))m!==a[p]&&(a[p]=m,l=!0);else{const d=wr(p);i[d]=fl(c,u,d,m,e,!1)}else m!==a[p]&&(a[p]=m,l=!0)}}}else{Dx(e,t,i,a)&&(l=!0);let s;for(const f in u)(!t||!tt(t,f)&&((s=Cn(f))===f||!tt(t,s)))&&(c?r&&(r[f]!==void 0||r[s]!==void 0)&&(i[f]=fl(c,u,f,void 0,e,!0)):delete i[f]);if(a!==u)for(const f in a)(!t||!tt(t,f))&&(delete a[f],l=!0)}l&&nn(e.attrs,"set",""),process.env.NODE_ENV!=="production"&&Ax(t||{},i,e)}function Dx(e,t,r,n){const[i,a]=e.propsOptions;let o=!1,u;if(t)for(let c in t){if(to(c))continue;const l=t[c];let s;i&&tt(i,s=wr(c))?!a||!a.includes(s)?r[s]=l:(u||(u={}))[s]=l:Gu(e.emitsOptions,c)||(!(c in n)||l!==n[c])&&(n[c]=l,o=!0)}if(a){const c=Ye(r),l=u||vt;for(let s=0;s<a.length;s++){const f=a[s];r[f]=fl(i,c,f,l[f],e,!tt(l,f))}}return o}function fl(e,t,r,n,i,a){const o=e[r];if(o!=null){const u=tt(o,"default");if(u&&n===void 0){const c=o.default;if(o.type!==Function&&!o.skipFactory&&Be(c)){const{propsDefaults:l}=i;if(r in l)n=l[r];else{const s=jo(i);n=l[r]=c.call(null,t),s()}}else n=c}o[0]&&(a&&!u?n=!1:o[1]&&(n===""||n===Cn(r))&&(n=!0))}return n}const fV=new WeakMap;function Ex(e,t,r=!1){const n=r?fV:t.propsCache,i=n.get(e);if(i)return i;const a=e.props,o={},u=[];let c=!1;if(!Be(e)){const s=f=>{c=!0;const[p,m]=Ex(f,t,!0);Et(o,p),m&&u.push(...m)};!r&&t.mixins.length&&t.mixins.forEach(s),e.extends&&s(e.extends),e.mixins&&e.mixins.forEach(s)}if(!a&&!c)return lt(e)&&n.set(e,sa),sa;if(Oe(a))for(let s=0;s<a.length;s++){process.env.NODE_ENV!=="production"&&!xt(a[s])&&Se("props must be strings when using array syntax.",a[s]);const f=wr(a[s]);H0(f)&&(o[f]=vt)}else if(a){process.env.NODE_ENV!=="production"&&!lt(a)&&Se("invalid props options",a);for(const s in a){const f=wr(s);if(H0(f)){const p=a[s],m=o[f]=Oe(p)||Be(p)?{type:p}:Et({},p),d=m.type;let h=!1,w=!0;if(Oe(d))for(let v=0;v<d.length;++v){const x=d[v],g=Be(x)&&x.name;if(g==="Boolean"){h=!0;break}else g==="String"&&(w=!1)}else h=Be(d)&&d.name==="Boolean";m[0]=h,m[1]=w,(h||tt(m,"default"))&&u.push(f)}}}const l=[o,u];return lt(e)&&n.set(e,l),l}function H0(e){return e[0]!=="$"&&!to(e)?!0:(process.env.NODE_ENV!=="production"&&Se(`Invalid prop name: "${e}" is a reserved property.`),!1)}function pV(e){return e===null?"null":typeof e=="function"?e.name||"":typeof e=="object"&&e.constructor&&e.constructor.name||""}function Ax(e,t,r){const n=Ye(t),i=r.propsOptions[0];for(const a in i){let o=i[a];o!=null&&mV(a,n[a],o,process.env.NODE_ENV!=="production"?rn(n):n,!tt(e,a)&&!tt(e,Cn(a)))}}function mV(e,t,r,n,i){const{type:a,required:o,validator:u,skipCheck:c}=r;if(o&&i){Se('Missing required prop: "'+e+'"');return}if(!(t==null&&!o)){if(a!=null&&a!==!0&&!c){let l=!1;const s=Oe(a)?a:[a],f=[];for(let p=0;p<s.length&&!l;p++){const{valid:m,expectedType:d}=hV(t,s[p]);f.push(d||""),l=m}if(!l){Se(gV(e,t,f));return}}u&&!u(t,n)&&Se('Invalid prop: custom validator check failed for prop "'+e+'".')}}const dV=ja("String,Number,Boolean,Function,Symbol,BigInt");function hV(e,t){let r;const n=pV(t);if(dV(n)){const i=typeof e;r=i===n.toLowerCase(),!r&&i==="object"&&(r=e instanceof t)}else n==="Object"?r=lt(e):n==="Array"?r=Oe(e):n==="null"?r=e===null:r=e instanceof t;return{valid:r,expectedType:n}}function gV(e,t,r){if(r.length===0)return`Prop type [] for prop "${e}" won't match anything. Did you mean to use type Array instead?`;let n=`Invalid prop: type check failed for prop "${e}". Expected ${r.map(ki).join(" | ")}`;const i=r[0],a=ff(t),o=J0(t,i),u=J0(t,a);return r.length===1&&G0(i)&&!vV(i,a)&&(n+=` with value ${o}`),n+=`, got ${a} `,G0(a)&&(n+=`with value ${u}.`),n}function J0(e,t){return t==="String"?`"${e}"`:t==="Number"?`${Number(e)}`:`${e}`}function G0(e){return["string","number","boolean"].some(t=>e.toLowerCase()===t)}function vV(...e){return e.some(t=>t.toLowerCase()==="boolean")}const Sx=e=>e[0]==="_"||e==="$stable",_f=e=>Oe(e)?e.map(qr):[qr(e)],yV=(e,t,r)=>{if(t._n)return t;const n=ro((...i)=>(process.env.NODE_ENV!=="production"&&Ot&&(!r||r.root===Ot.root)&&Se(`Slot "${e}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`),_f(t(...i))),r);return n._c=!1,n},Cx=(e,t,r)=>{const n=e._ctx;for(const i in e){if(Sx(i))continue;const a=e[i];if(Be(a))t[i]=yV(i,a,n);else if(a!=null){process.env.NODE_ENV!=="production"&&Se(`Non-function value encountered for slot "${i}". Prefer function slots for better performance.`);const o=_f(a);t[i]=()=>o}}},Mx=(e,t)=>{process.env.NODE_ENV!=="production"&&!qo(e.vnode)&&Se("Non-function value encountered for default slot. Prefer function slots for better performance.");const r=_f(t);e.slots.default=()=>r},pl=(e,t,r)=>{for(const n in t)(r||n!=="_")&&(e[n]=t[n])},bV=(e,t,r)=>{const n=e.slots=wx();if(e.vnode.shapeFlag&32){const i=t._;i?(pl(n,t,r),r&&tu(n,"_",i,!0)):Cx(t,n)}else t&&Mx(e,t)},xV=(e,t,r)=>{const{vnode:n,slots:i}=e;let a=!0,o=vt;if(n.shapeFlag&32){const u=t._;u?process.env.NODE_ENV!=="production"&&_i?(pl(i,t,r),nn(e,"set","$slots")):r&&u===1?a=!1:pl(i,t,r):(a=!t.$stable,Cx(t,i)),o=t}else t&&(Mx(e,t),o={default:1});if(a)for(const u in i)!Sx(u)&&o[u]==null&&delete i[u]};function ml(e,t,r,n,i=!1){if(Oe(e)){e.forEach((p,m)=>ml(p,t&&(Oe(t)?t[m]:t),r,n,i));return}if(no(n)&&!i)return;const a=n.shapeFlag&4?Ku(n.component):n.el,o=i?null:a,{i:u,r:c}=e;if(process.env.NODE_ENV!=="production"&&!u){Se("Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.");return}const l=t&&t.r,s=u.refs===vt?u.refs={}:u.refs,f=u.setupState;if(l!=null&&l!==c&&(xt(l)?(s[l]=null,tt(f,l)&&(f[l]=null)):Lt(l)&&(l.value=null)),Be(c))En(c,u,12,[o,s]);else{const p=xt(c),m=Lt(c);if(p||m){const d=()=>{if(e.f){const h=p?tt(f,c)?f[c]:s[c]:c.value;i?Oe(h)&&cf(h,a):Oe(h)?h.includes(a)||h.push(a):p?(s[c]=[a],tt(f,c)&&(f[c]=s[c])):(c.value=[a],e.k&&(s[e.k]=c.value))}else p?(s[c]=o,tt(f,c)&&(f[c]=o)):m?(c.value=o,e.k&&(s[e.k]=o)):process.env.NODE_ENV!=="production"&&Se("Invalid template ref type:",c,`(${typeof c})`)};o?(d.id=-1,pr(d,r)):d()}else process.env.NODE_ENV!=="production"&&Se("Invalid template ref type:",c,`(${typeof c})`)}}const wV=Symbol("_vte"),NV=e=>e.__isTeleport;let ms,Jn;function gn(e,t){e.appContext.config.performance&&ou()&&Jn.mark(`vue-${t}-${e.uid}`),process.env.NODE_ENV!=="production"&&OP(e,t,ou()?Jn.now():Date.now())}function vn(e,t){if(e.appContext.config.performance&&ou()){const r=`vue-${t}-${e.uid}`,n=r+":end";Jn.mark(n),Jn.measure(`<${Qu(e,e.type)}> ${t}`,r,n),Jn.clearMarks(r),Jn.clearMarks(n)}process.env.NODE_ENV!=="production"&&BP(e,t,ou()?Jn.now():Date.now())}function ou(){return ms!==void 0||(typeof window<"u"&&window.performance?(ms=!0,Jn=window.performance):ms=!1),ms}function DV(){const e=[];if(process.env.NODE_ENV!=="production"&&e.length){const t=e.length>1;console.warn(`Feature flag${t?"s":""} ${e.join(", ")} ${t?"are":"is"} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.
|
|
95
95
|
|
|
96
|
-
For more details, see https://link.vuejs.org/feature-flags.`)}}const pr=RV;function NV(e){return DV(e)}function DV(e,t){wV();const r=pf();r.__VUE__=!0,process.env.NODE_ENV!=="production"&&eb(r.__VUE_DEVTOOLS_GLOBAL_HOOK__,r);const{insert:n,remove:i,patchProp:a,createElement:o,createText:u,createComment:c,setText:l,setElementText:s,parentNode:f,nextSibling:p,setScopeId:m=St,insertStaticContent:d}=e,h=($,T,z,J=null,L=null,H=null,G=void 0,Y=null,ee=process.env.NODE_ENV!=="production"&&_i?!1:!!T.dynamicChildren)=>{if($===T)return;$&&!bi($,T)&&(J=de($),V($,L,H,!0),$=null),T.patchFlag===-2&&(ee=!1,T.dynamicChildren=null);const{type:B,ref:j,shapeFlag:Q}=T;switch(B){case qo:w($,T,z,J);break;case Mt:v($,T,z,J);break;case Es:$==null?b(T,z,J,G):process.env.NODE_ENV!=="production"&&g($,T,z,G);break;case mr:R($,T,z,J,L,H,G,Y,ee);break;default:Q&1?N($,T,z,J,L,H,G,Y,ee):Q&6?P($,T,z,J,L,H,G,Y,ee):Q&64||Q&128?B.process($,T,z,J,L,H,G,Y,ee,le):process.env.NODE_ENV!=="production"&&Se("Invalid VNode type:",B,`(${typeof B})`)}j!=null&&L&&pl(j,$&&$.ref,H,T||$,!T)},w=($,T,z,J)=>{if($==null)n(T.el=u(T.children),z,J);else{const L=T.el=$.el;T.children!==$.children&&l(L,T.children)}},v=($,T,z,J)=>{$==null?n(T.el=c(T.children||""),z,J):T.el=$.el},b=($,T,z,J)=>{[$.el,$.anchor]=d($.children,T,z,J,$.el,$.anchor)},g=($,T,z,J)=>{if(T.children!==$.children){const L=p($.anchor);y($),[T.el,T.anchor]=d(T.children,z,L,J)}else T.el=$.el,T.anchor=$.anchor},x=({el:$,anchor:T},z,J)=>{let L;for(;$&&$!==T;)L=p($),n($,z,J),$=L;n(T,z,J)},y=({el:$,anchor:T})=>{let z;for(;$&&$!==T;)z=p($),i($),$=z;i(T)},N=($,T,z,J,L,H,G,Y,ee)=>{T.type==="svg"?G="svg":T.type==="math"&&(G="mathml"),$==null?E(T,z,J,L,H,G,Y,ee):S($,T,L,H,G,Y,ee)},E=($,T,z,J,L,H,G,Y)=>{let ee,B;const{props:j,shapeFlag:Q,transition:Z,dirs:ie}=$;if(ee=$.el=o($.type,H,j&&j.is,j),Q&8?s(ee,$.children):Q&16&&D($.children,ee,null,J,L,Dc($,H),G,Y),ie&&pi($,null,J,"created"),A(ee,$,$.scopeId,G,J),j){for(const ye in j)ye!=="value"&&!eo(ye)&&a(ee,ye,null,j[ye],H,J);"value"in j&&a(ee,"value",null,j.value,H),(B=j.onVnodeBeforeMount)&&Xr(B,J,$)}process.env.NODE_ENV!=="production"&&(eu(ee,"__vnode",$,!0),eu(ee,"__vueParentComponent",J,!0)),ie&&pi($,null,J,"beforeMount");const oe=EV(L,Z);oe&&Z.beforeEnter(ee),n(ee,T,z),((B=j&&j.onVnodeMounted)||oe||ie)&&pr(()=>{B&&Xr(B,J,$),oe&&Z.enter(ee),ie&&pi($,null,J,"mounted")},L)},A=($,T,z,J,L)=>{if(z&&m($,z),J)for(let H=0;H<J.length;H++)m($,J[H]);if(L){let H=L.subTree;if(process.env.NODE_ENV!=="production"&&H.patchFlag>0&&H.patchFlag&2048&&(H=_f(H.children)||H),T===H){const G=L.vnode;A($,G,G.scopeId,G.slotScopeIds,L.parent)}}},D=($,T,z,J,L,H,G,Y,ee=0)=>{for(let B=ee;B<$.length;B++){const j=$[B]=Y?Hn($[B]):qr($[B]);h(null,j,T,z,J,L,H,G,Y)}},S=($,T,z,J,L,H,G)=>{const Y=T.el=$.el;process.env.NODE_ENV!=="production"&&(Y.__vnode=T);let{patchFlag:ee,dynamicChildren:B,dirs:j}=T;ee|=$.patchFlag&16;const Q=$.props||vt,Z=T.props||vt;let ie;if(z&&mi(z,!1),(ie=Z.onVnodeBeforeUpdate)&&Xr(ie,z,T,$),j&&pi(T,$,z,"beforeUpdate"),z&&mi(z,!0),process.env.NODE_ENV!=="production"&&_i&&(ee=0,G=!1,B=null),(Q.innerHTML&&Z.innerHTML==null||Q.textContent&&Z.textContent==null)&&s(Y,""),B?(C($.dynamicChildren,B,Y,z,J,Dc(T,L),H),process.env.NODE_ENV!=="production"&&Ds($,T)):G||k($,T,Y,null,z,J,Dc(T,L),H,!1),ee>0){if(ee&16)_(Y,Q,Z,z,L);else if(ee&2&&Q.class!==Z.class&&a(Y,"class",null,Z.class,L),ee&4&&a(Y,"style",Q.style,Z.style,L),ee&8){const oe=T.dynamicProps;for(let ye=0;ye<oe.length;ye++){const fe=oe[ye],De=Q[fe],Ne=Z[fe];(Ne!==De||fe==="value")&&a(Y,fe,De,Ne,L,z)}}ee&1&&$.children!==T.children&&s(Y,T.children)}else!G&&B==null&&_(Y,Q,Z,z,L);((ie=Z.onVnodeUpdated)||j)&&pr(()=>{ie&&Xr(ie,z,T,$),j&&pi(T,$,z,"updated")},J)},C=($,T,z,J,L,H,G)=>{for(let Y=0;Y<T.length;Y++){const ee=$[Y],B=T[Y],j=ee.el&&(ee.type===mr||!bi(ee,B)||ee.shapeFlag&70)?f(ee.el):z;h(ee,B,j,null,J,L,H,G,!0)}},_=($,T,z,J,L)=>{if(T!==z){if(T!==vt)for(const H in T)!eo(H)&&!(H in z)&&a($,H,T[H],null,L,J);for(const H in z){if(eo(H))continue;const G=z[H],Y=T[H];G!==Y&&H!=="value"&&a($,H,Y,G,L,J)}"value"in z&&a($,"value",T.value,z.value,L)}},R=($,T,z,J,L,H,G,Y,ee)=>{const B=T.el=$?$.el:u(""),j=T.anchor=$?$.anchor:u("");let{patchFlag:Q,dynamicChildren:Z,slotScopeIds:ie}=T;process.env.NODE_ENV!=="production"&&(_i||Q&2048)&&(Q=0,ee=!1,Z=null),ie&&(Y=Y?Y.concat(ie):ie),$==null?(n(B,z,J),n(j,z,J),D(T.children||[],z,j,L,H,G,Y,ee)):Q>0&&Q&64&&Z&&$.dynamicChildren?(C($.dynamicChildren,Z,z,L,H,G,Y),process.env.NODE_ENV!=="production"?Ds($,T):(T.key!=null||L&&T===L.subTree)&&Ds($,T,!0)):k($,T,z,j,L,H,G,Y,ee)},P=($,T,z,J,L,H,G,Y,ee)=>{T.slotScopeIds=Y,$==null?T.shapeFlag&512?L.ctx.activate(T,z,J,G,ee):I(T,z,J,L,H,G,ee):O($,T,ee)},I=($,T,z,J,L,H,G)=>{const Y=$.component=UV($,J,L);if(process.env.NODE_ENV!=="production"&&Y.type.__hmrId&&wP(Y),process.env.NODE_ENV!=="production"&&(bs($),gn(Y,"mount")),Ro($)&&(Y.ctx.renderer=le),process.env.NODE_ENV!=="production"&&gn(Y,"init"),HV(Y,!1,G),process.env.NODE_ENV!=="production"&&vn(Y,"init"),Y.asyncDep){if(L&&L.registerDep(Y,F,G),!$.el){const ee=Y.subTree=$t(Mt);v(null,ee,T,z)}}else F(Y,$,T,z,L,H,G);process.env.NODE_ENV!=="production"&&(ws(),vn(Y,"mount"))},O=($,T,z)=>{const J=T.component=$.component;if(BV($,T,z))if(J.asyncDep&&!J.asyncResolved){process.env.NODE_ENV!=="production"&&bs(T),q(J,T,z),process.env.NODE_ENV!=="production"&&ws();return}else J.next=T,xP(J.update),J.effect.dirty=!0,J.update();else T.el=$.el,J.vnode=T},F=($,T,z,J,L,H,G)=>{const Y=()=>{if($.isMounted){let{next:j,bu:Q,u:Z,parent:ie,vnode:oe}=$;{const je=Mb($);if(je){j&&(j.el=oe.el,q($,j,G)),je.asyncDep.then(()=>{$.isUnmounted||Y()});return}}let ye=j,fe;process.env.NODE_ENV!=="production"&&bs(j||$.vnode),mi($,!1),j?(j.el=oe.el,q($,j,G)):j=oe,Q&&Ja(Q),(fe=j.props&&j.props.onVnodeBeforeUpdate)&&Xr(fe,ie,j,oe),mi($,!0),process.env.NODE_ENV!=="production"&&gn($,"render");const De=Ec($);process.env.NODE_ENV!=="production"&&vn($,"render");const Ne=$.subTree;$.subTree=De,process.env.NODE_ENV!=="production"&&gn($,"patch"),h(Ne,De,f(Ne.el),de(Ne),$,L,H),process.env.NODE_ENV!=="production"&&vn($,"patch"),j.el=De.el,ye===null&&kV($,De.el),Z&&pr(Z,L),(fe=j.props&&j.props.onVnodeUpdated)&&pr(()=>Xr(fe,ie,j,oe),L),process.env.NODE_ENV!=="production"&&tb($),process.env.NODE_ENV!=="production"&&ws()}else{let j;const{el:Q,props:Z}=T,{bm:ie,m:oe,parent:ye}=$,fe=ro(T);if(mi($,!1),ie&&Ja(ie),!fe&&(j=Z&&Z.onVnodeBeforeMount)&&Xr(j,ye,T),mi($,!0),Q&&be){const De=()=>{process.env.NODE_ENV!=="production"&&gn($,"render"),$.subTree=Ec($),process.env.NODE_ENV!=="production"&&vn($,"render"),process.env.NODE_ENV!=="production"&&gn($,"hydrate"),be(Q,$.subTree,$,L,null),process.env.NODE_ENV!=="production"&&vn($,"hydrate")};fe?T.type.__asyncLoader().then(()=>!$.isUnmounted&&De()):De()}else{process.env.NODE_ENV!=="production"&&gn($,"render");const De=$.subTree=Ec($);process.env.NODE_ENV!=="production"&&vn($,"render"),process.env.NODE_ENV!=="production"&&gn($,"patch"),h(null,De,z,J,$,L,H),process.env.NODE_ENV!=="production"&&vn($,"patch"),T.el=De.el}if(oe&&pr(oe,L),!fe&&(j=Z&&Z.onVnodeMounted)){const De=T;pr(()=>Xr(j,ye,De),L)}(T.shapeFlag&256||ye&&ro(ye.vnode)&&ye.vnode.shapeFlag&256)&&$.a&&pr($.a,L),$.isMounted=!0,process.env.NODE_ENV!=="production"&&CP($),T=z=J=null}},ee=$.effect=new df(Y,St,()=>Uu(B),$.scope),B=$.update=()=>{ee.dirty&&ee.run()};B.i=$,B.id=$.uid,mi($,!0),process.env.NODE_ENV!=="production"&&(ee.onTrack=$.rtc?j=>Ja($.rtc,j):void 0,ee.onTrigger=$.rtg?j=>Ja($.rtg,j):void 0),B()},q=($,T,z)=>{T.component=$;const J=$.vnode.props;$.vnode=T,$.next=null,uV($,T.props,J,z),yV($,T.children,z),kn(),R0($),In()},k=($,T,z,J,L,H,G,Y,ee=!1)=>{const B=$&&$.children,j=$?$.shapeFlag:0,Q=T.children,{patchFlag:Z,shapeFlag:ie}=T;if(Z>0){if(Z&128){se(B,Q,z,J,L,H,G,Y,ee);return}else if(Z&256){te(B,Q,z,J,L,H,G,Y,ee);return}}ie&8?(j&16&&ae(B,L,H),Q!==B&&s(z,Q)):j&16?ie&16?se(B,Q,z,J,L,H,G,Y,ee):ae(B,L,H,!0):(j&8&&s(z,""),ie&16&&D(Q,z,J,L,H,G,Y,ee))},te=($,T,z,J,L,H,G,Y,ee)=>{$=$||oa,T=T||oa;const B=$.length,j=T.length,Q=Math.min(B,j);let Z;for(Z=0;Z<Q;Z++){const ie=T[Z]=ee?Hn(T[Z]):qr(T[Z]);h($[Z],ie,z,null,L,H,G,Y,ee)}B>j?ae($,L,H,!0,!1,Q):D(T,z,J,L,H,G,Y,ee,Q)},se=($,T,z,J,L,H,G,Y,ee)=>{let B=0;const j=T.length;let Q=$.length-1,Z=j-1;for(;B<=Q&&B<=Z;){const ie=$[B],oe=T[B]=ee?Hn(T[B]):qr(T[B]);if(bi(ie,oe))h(ie,oe,z,null,L,H,G,Y,ee);else break;B++}for(;B<=Q&&B<=Z;){const ie=$[Q],oe=T[Z]=ee?Hn(T[Z]):qr(T[Z]);if(bi(ie,oe))h(ie,oe,z,null,L,H,G,Y,ee);else break;Q--,Z--}if(B>Q){if(B<=Z){const ie=Z+1,oe=ie<j?T[ie].el:J;for(;B<=Z;)h(null,T[B]=ee?Hn(T[B]):qr(T[B]),z,oe,L,H,G,Y,ee),B++}}else if(B>Z)for(;B<=Q;)V($[B],L,H,!0),B++;else{const ie=B,oe=B,ye=new Map;for(B=oe;B<=Z;B++){const M=T[B]=ee?Hn(T[B]):qr(T[B]);M.key!=null&&(process.env.NODE_ENV!=="production"&&ye.has(M.key)&&Se("Duplicate keys found during update:",JSON.stringify(M.key),"Make sure keys are unique."),ye.set(M.key,B))}let fe,De=0;const Ne=Z-oe+1;let je=!1,Ze=0;const _e=new Array(Ne);for(B=0;B<Ne;B++)_e[B]=0;for(B=ie;B<=Q;B++){const M=$[B];if(De>=Ne){V(M,L,H,!0);continue}let X;if(M.key!=null)X=ye.get(M.key);else for(fe=oe;fe<=Z;fe++)if(_e[fe-oe]===0&&bi(M,T[fe])){X=fe;break}X===void 0?V(M,L,H,!0):(_e[X-oe]=B+1,X>=Ze?Ze=X:je=!0,h(M,T[X],z,null,L,H,G,Y,ee),De++)}const wt=je?AV(_e):oa;for(fe=wt.length-1,B=Ne-1;B>=0;B--){const M=oe+B,X=T[M],pe=M+1<j?T[M+1].el:J;_e[B]===0?h(null,X,z,pe,L,H,G,Y,ee):je&&(fe<0||B!==wt[fe]?K(X,z,pe,2):fe--)}}},K=($,T,z,J,L=null)=>{const{el:H,type:G,transition:Y,children:ee,shapeFlag:B}=$;if(B&6){K($.component.subTree,T,z,J);return}if(B&128){$.suspense.move(T,z,J);return}if(B&64){G.move($,T,z,le);return}if(G===mr){n(H,T,z);for(let j=0;j<ee.length;j++)K(ee[j],T,z,J);n($.anchor,T,z);return}if(G===Es){x($,T,z);return}if(J!==2&&B&1&&Y)if(J===0)Y.beforeEnter(H),n(H,T,z),pr(()=>Y.enter(H),L);else{const{leave:j,delayLeave:Q,afterLeave:Z}=Y,ie=()=>n(H,T,z),oe=()=>{j(H,()=>{ie(),Z&&Z()})};Q?Q(H,ie,oe):oe()}else n(H,T,z)},V=($,T,z,J=!1,L=!1)=>{const{type:H,props:G,ref:Y,children:ee,dynamicChildren:B,shapeFlag:j,patchFlag:Q,dirs:Z,cacheIndex:ie}=$;if(Q===-2&&(L=!1),Y!=null&&pl(Y,null,z,$,!0),ie!=null&&(T.renderCache[ie]=void 0),j&256){T.ctx.deactivate($);return}const oe=j&1&&Z,ye=!ro($);let fe;if(ye&&(fe=G&&G.onVnodeBeforeUnmount)&&Xr(fe,T,$),j&6)re($.component,z,J);else{if(j&128){$.suspense.unmount(z,J);return}oe&&pi($,null,T,"beforeUnmount"),j&64?$.type.remove($,T,z,le,J):B&&!B.hasOnce&&(H!==mr||Q>0&&Q&64)?ae(B,T,z,!1,!0):(H===mr&&Q&384||!L&&j&16)&&ae(ee,T,z),J&&ue($)}(ye&&(fe=G&&G.onVnodeUnmounted)||oe)&&pr(()=>{fe&&Xr(fe,T,$),oe&&pi($,null,T,"unmounted")},z)},ue=$=>{const{type:T,el:z,anchor:J,transition:L}=$;if(T===mr){process.env.NODE_ENV!=="production"&&$.patchFlag>0&&$.patchFlag&2048&&L&&!L.persisted?$.children.forEach(G=>{G.type===Mt?i(G.el):ue(G)}):me(z,J);return}if(T===Es){y($);return}const H=()=>{i(z),L&&!L.persisted&&L.afterLeave&&L.afterLeave()};if($.shapeFlag&1&&L&&!L.persisted){const{leave:G,delayLeave:Y}=L,ee=()=>G(z,H);Y?Y($.el,H,ee):ee()}else H()},me=($,T)=>{let z;for(;$!==T;)z=p($),i($),$=z;i(T)},re=($,T,z)=>{process.env.NODE_ENV!=="production"&&$.type.__hmrId&&NP($);const{bum:J,scope:L,update:H,subTree:G,um:Y,m:ee,a:B}=$;G0(ee),G0(B),J&&Ja(J),L.stop(),H&&(H.active=!1,V(G,$,T,z)),Y&&pr(Y,T),pr(()=>{$.isUnmounted=!0},T),T&&T.pendingBranch&&!T.isUnmounted&&$.asyncDep&&!$.asyncResolved&&$.suspenseId===T.pendingId&&(T.deps--,T.deps===0&&T.resolve()),process.env.NODE_ENV!=="production"&&_P($)},ae=($,T,z,J=!1,L=!1,H=0)=>{for(let G=H;G<$.length;G++)V($[G],T,z,J,L)},de=$=>{if($.shapeFlag&6)return de($.component.subTree);if($.shapeFlag&128)return $.suspense.next();const T=p($.anchor||$.el),z=T&&T[xV];return z?p(z):T};let ne=!1;const ce=($,T,z)=>{$==null?T._vnode&&V(T._vnode,null,null,!0):h(T._vnode||null,$,T,null,null,null,z),T._vnode=$,ne||(ne=!0,R0(),Zx(),ne=!1)},le={p:h,um:V,m:K,r:ue,mt:I,mc:D,pc:k,pbc:C,n:de,o:e};let he,be;return{render:ce,hydrate:he,createApp:aV(ce,he)}}function Dc({type:e,props:t},r){return r==="svg"&&e==="foreignObject"||r==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:r}function mi({effect:e,update:t},r){e.allowRecurse=t.allowRecurse=r}function EV(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ds(e,t,r=!1){const n=e.children,i=t.children;if(Oe(n)&&Oe(i))for(let a=0;a<n.length;a++){const o=n[a];let u=i[a];u.shapeFlag&1&&!u.dynamicChildren&&((u.patchFlag<=0||u.patchFlag===32)&&(u=i[a]=Hn(i[a]),u.el=o.el),!r&&u.patchFlag!==-2&&Ds(o,u)),u.type===qo&&(u.el=o.el),process.env.NODE_ENV!=="production"&&u.type===Mt&&!u.el&&(u.el=o.el)}}function AV(e){const t=e.slice(),r=[0];let n,i,a,o,u;const c=e.length;for(n=0;n<c;n++){const l=e[n];if(l!==0){if(i=r[r.length-1],e[i]<l){t[n]=i,r.push(n);continue}for(a=0,o=r.length-1;a<o;)u=a+o>>1,e[r[u]]<l?a=u+1:o=u;l<e[r[a]]&&(a>0&&(t[n]=r[a-1]),r[a]=n)}}for(a=r.length,o=r[a-1];a-- >0;)r[a]=o,o=t[o];return r}function Mb(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Mb(t)}function G0(e){if(e)for(let t=0;t<e.length;t++)e[t].active=!1}const SV=Symbol.for("v-scx"),CV=()=>{{const e=an(SV);return e||process.env.NODE_ENV!=="production"&&Se("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}},ms={};function la(e,t,r){return process.env.NODE_ENV!=="production"&&!Be(t)&&Se("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),_b(e,t,r)}function _b(e,t,{immediate:r,deep:n,flush:i,once:a,onTrack:o,onTrigger:u}=vt){if(t&&a){const E=t;t=(...A)=>{E(...A),N()}}process.env.NODE_ENV!=="production"&&n!==void 0&&typeof n=="number"&&Se('watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.'),process.env.NODE_ENV!=="production"&&!t&&(r!==void 0&&Se('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),n!==void 0&&Se('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),a!==void 0&&Se('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const c=E=>{Se("Invalid watch source: ",E,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},l=Ot,s=E=>n===!0?E:Gn(E,n===!1?1:void 0);let f,p=!1,m=!1;if(Lt(e)?(f=()=>e.value,p=Dn(e)):sa(e)?(f=()=>s(e),p=!0):Oe(e)?(m=!0,p=e.some(E=>sa(E)||Dn(E)),f=()=>e.map(E=>{if(Lt(E))return E.value;if(sa(E))return s(E);if(Be(E))return En(E,l,2);process.env.NODE_ENV!=="production"&&c(E)})):Be(e)?t?f=()=>En(e,l,2):f=()=>(d&&d(),_r(e,l,3,[h])):(f=St,process.env.NODE_ENV!=="production"&&c(e)),t&&n){const E=f;f=()=>Gn(E())}let d,h=E=>{d=x.onStop=()=>{En(E,l,4),d=x.onStop=void 0}},w;if(Gu)if(h=St,t?r&&_r(t,l,3,[f(),m?[]:void 0,h]):f(),i==="sync"){const E=CV();w=E.__watcherHandles||(E.__watcherHandles=[])}else return St;let v=m?new Array(e.length).fill(ms):ms;const b=()=>{if(!(!x.active||!x.dirty))if(t){const E=x.run();(n||p||(m?E.some((A,D)=>ei(A,v[D])):ei(E,v)))&&(d&&d(),_r(t,l,3,[E,v===ms?void 0:m&&v[0]===ms?[]:v,h]),v=E)}else x.run()};b.allowRecurse=!!t;let g;i==="sync"?g=b:i==="post"?g=()=>pr(b,l&&l.suspense):(b.pre=!0,l&&(b.id=l.uid),g=()=>Uu(b));const x=new df(f,St,g),y=Cx(),N=()=>{x.stop(),y&&uf(y.effects,x)};return process.env.NODE_ENV!=="production"&&(x.onTrack=o,x.onTrigger=u),t?r?b():v=x.run():i==="post"?pr(x.run.bind(x),l&&l.suspense):x.run(),w&&w.push(N),N}function MV(e,t,r){const n=this.proxy,i=bt(e)?e.includes(".")?Fb(n,e):()=>n[e]:e.bind(n,n);let a;Be(t)?a=t:(a=t.handler,r=t);const o=zo(this),u=_b(i,a.bind(n),r);return o(),u}function Fb(e,t){const r=t.split(".");return()=>{let n=e;for(let i=0;i<r.length&&n;i++)n=n[r[i]];return n}}function Gn(e,t=1/0,r){if(t<=0||!lt(e)||e.__v_skip||(r=r||new Set,r.has(e)))return e;if(r.add(e),t--,Lt(e))Gn(e.value,t,r);else if(Oe(e))for(let n=0;n<e.length;n++)Gn(e[n],t,r);else if(wx(e)||Ai(e))e.forEach(n=>{Gn(n,t,r)});else if(Dx(e)){for(const n in e)Gn(e[n],t,r);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&Gn(e[n],t,r)}return e}const _V=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${wr(t)}Modifiers`]||e[`${Cn(t)}Modifiers`];function FV(e,t,...r){if(e.isUnmounted)return;const n=e.vnode.props||vt;if(process.env.NODE_ENV!=="production"){const{emitsOptions:s,propsOptions:[f]}=e;if(s)if(!(t in s))(!f||!(vi(wr(t))in f))&&Se(`Component emitted event "${t}" but it is neither declared in the emits option nor as an "${vi(wr(t))}" prop.`);else{const p=s[t];Be(p)&&(p(...r)||Se(`Invalid event arguments: event validation failed for event "${t}".`))}}let i=r;const a=t.startsWith("update:"),o=a&&_V(n,t.slice(7));if(o&&(o.trim&&(i=r.map(s=>bt(s)?s.trim():s)),o.number&&(i=r.map(_L))),process.env.NODE_ENV!=="production"&&OP(e,t,i),process.env.NODE_ENV!=="production"){const s=t.toLowerCase();s!==t&&n[vi(s)]&&Se(`Event "${s}" is emitted in component ${Ku(e,e.type)} but the handler is registered for "${t}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${Cn(t)}" instead of "${t}".`)}let u,c=n[u=vi(t)]||n[u=vi(wr(t))];!c&&a&&(c=n[u=vi(Cn(t))]),c&&_r(c,e,6,i);const l=n[u+"Once"];if(l){if(!e.emitted)e.emitted={};else if(e.emitted[u])return;e.emitted[u]=!0,_r(l,e,6,i)}}function Tb(e,t,r=!1){const n=t.emitsCache,i=n.get(e);if(i!==void 0)return i;const a=e.emits;let o={},u=!1;if(!Be(e)){const c=l=>{const s=Tb(l,t,!0);s&&(u=!0,Et(o,s))};!r&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!a&&!u?(lt(e)&&n.set(e,null),null):(Oe(a)?a.forEach(c=>o[c]=null):Et(o,a),lt(e)&&n.set(e,o),o)}function Ju(e,t){return!e||!Oo(t)?!1:(t=t.slice(2).replace(/Once$/,""),tt(e,t[0].toLowerCase()+t.slice(1))||tt(e,Cn(t))||tt(e,t))}let ml=!1;function ou(){ml=!0}function Ec(e){const{type:t,vnode:r,proxy:n,withProxy:i,propsOptions:[a],slots:o,attrs:u,emit:c,render:l,renderCache:s,props:f,data:p,setupState:m,ctx:d,inheritAttrs:h}=e,w=ru(e);let v,b;process.env.NODE_ENV!=="production"&&(ml=!1);try{if(r.shapeFlag&4){const y=i||n,N=process.env.NODE_ENV!=="production"&&m.__isScriptSetup?new Proxy(y,{get(E,A,D){return Se(`Property '${String(A)}' was accessed via 'this'. Avoid using 'this' in templates.`),Reflect.get(E,A,D)}}):y;v=qr(l.call(N,y,s,process.env.NODE_ENV!=="production"?rn(f):f,m,p,d)),b=u}else{const y=t;process.env.NODE_ENV!=="production"&&u===f&&ou(),v=qr(y.length>1?y(process.env.NODE_ENV!=="production"?rn(f):f,process.env.NODE_ENV!=="production"?{get attrs(){return ou(),rn(u)},slots:o,emit:c}:{attrs:u,slots:o,emit:c}):y(process.env.NODE_ENV!=="production"?rn(f):f,null)),b=t.props?u:TV(u)}}catch(y){no.length=0,ko(y,e,1),v=$t(Mt)}let g=v,x;if(process.env.NODE_ENV!=="production"&&v.patchFlag>0&&v.patchFlag&2048&&([g,x]=Ob(v)),b&&h!==!1){const y=Object.keys(b),{shapeFlag:N}=g;if(y.length){if(N&7)a&&y.some(Ys)&&(b=OV(b,a)),g=un(g,b,!1,!0);else if(process.env.NODE_ENV!=="production"&&!ml&&g.type!==Mt){const E=Object.keys(u),A=[],D=[];for(let S=0,C=E.length;S<C;S++){const _=E[S];Oo(_)?Ys(_)||A.push(_[2].toLowerCase()+_.slice(3)):D.push(_)}D.length&&Se(`Extraneous non-props attributes (${D.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`),A.length&&Se(`Extraneous non-emits event listeners (${A.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`)}}}return r.dirs&&(process.env.NODE_ENV!=="production"&&!W0(g)&&Se("Runtime directive used on component with non-element root node. The directives will not function as intended."),g=un(g,null,!1,!0),g.dirs=g.dirs?g.dirs.concat(r.dirs):r.dirs),r.transition&&(process.env.NODE_ENV!=="production"&&!W0(g)&&Se("Component inside <Transition> renders non-element root node that cannot be animated."),g.transition=r.transition),process.env.NODE_ENV!=="production"&&x?x(g):v=g,ru(w),v}const Ob=e=>{const t=e.children,r=e.dynamicChildren,n=_f(t,!1);if(n){if(process.env.NODE_ENV!=="production"&&n.patchFlag>0&&n.patchFlag&2048)return Ob(n)}else return[e,void 0];const i=t.indexOf(n),a=r?r.indexOf(n):-1,o=u=>{t[i]=u,r&&(a>-1?r[a]=u:u.patchFlag>0&&(e.dynamicChildren=[...r,u]))};return[qr(n),o]};function _f(e,t=!0){let r;for(let n=0;n<e.length;n++){const i=e[n];if(ti(i)){if(i.type!==Mt||i.children==="v-if"){if(r)return;if(r=i,process.env.NODE_ENV!=="production"&&t&&r.patchFlag>0&&r.patchFlag&2048)return _f(r.children)}}else return}return r}const TV=e=>{let t;for(const r in e)(r==="class"||r==="style"||Oo(r))&&((t||(t={}))[r]=e[r]);return t},OV=(e,t)=>{const r={};for(const n in e)(!Ys(n)||!(n.slice(9)in t))&&(r[n]=e[n]);return r},W0=e=>e.shapeFlag&7||e.type===Mt;function BV(e,t,r){const{props:n,children:i,component:a}=e,{props:o,children:u,patchFlag:c}=t,l=a.emitsOptions;if(process.env.NODE_ENV!=="production"&&(i||u)&&_i||t.dirs||t.transition)return!0;if(r&&c>=0){if(c&1024)return!0;if(c&16)return n?K0(n,o,l):!!o;if(c&8){const s=t.dynamicProps;for(let f=0;f<s.length;f++){const p=s[f];if(o[p]!==n[p]&&!Ju(l,p))return!0}}}else return(i||u)&&(!u||!u.$stable)?!0:n===o?!1:n?o?K0(n,o,l):!0:!!o;return!1}function K0(e,t,r){const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(let i=0;i<n.length;i++){const a=n[i];if(t[a]!==e[a]&&!Ju(r,a))return!0}return!1}function kV({vnode:e,parent:t},r){for(;t;){const n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.el=e.el),n===e)(e=t.vnode).el=r,t=t.parent;else break}}const IV=e=>e.__isSuspense;function RV(e,t){t&&t.pendingBranch?Oe(e)?t.effects.push(...e):t.effects.push(e):Qx(e)}const mr=Symbol.for("v-fgt"),qo=Symbol.for("v-txt"),Mt=Symbol.for("v-cmt"),Es=Symbol.for("v-stc"),no=[];let xr=null;function Kt(e=!1){no.push(xr=e?null:[])}function qV(){no.pop(),xr=no[no.length-1]||null}let mo=1;function Q0(e){mo+=e,e<0&&xr&&(xr.hasOnce=!0)}function Bb(e){return e.dynamicChildren=mo>0?xr||oa:null,qV(),mo>0&&xr&&xr.push(e),e}function Fn(e,t,r,n,i,a){return Bb(sn(e,t,r,n,i,a,!0))}function xi(e,t,r,n,i){return Bb($t(e,t,r,n,i,!0))}function ti(e){return e?e.__v_isVNode===!0:!1}function bi(e,t){if(process.env.NODE_ENV!=="production"&&t.shapeFlag&6&&e.component){const r=Ns.get(t.type);if(r&&r.has(e.component))return e.shapeFlag&=-257,t.shapeFlag&=-513,!1}return e.type===t.type&&e.key===t.key}const zV=(...e)=>Ib(...e),kb=({key:e})=>e??null,As=({ref:e,ref_key:t,ref_for:r})=>(typeof e=="number"&&(e=""+e),e!=null?bt(e)||Lt(e)||Be(e)?{i:_t,r:e,k:t,f:!!r}:e:null);function sn(e,t=null,r=null,n=0,i=null,a=e===mr?0:1,o=!1,u=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&kb(t),ref:t&&As(t),scopeId:nb,slotScopeIds:null,children:r,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:n,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:_t};return u?(Ff(c,r),a&128&&e.normalize(c)):r&&(c.shapeFlag|=bt(r)?8:16),process.env.NODE_ENV!=="production"&&c.key!==c.key&&Se("VNode created with invalid key (NaN). VNode type:",c.type),mo>0&&!o&&xr&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&xr.push(c),c}const $t=process.env.NODE_ENV!=="production"?zV:Ib;function Ib(e,t=null,r=null,n=0,i=null,a=!1){if((!e||e===mb)&&(process.env.NODE_ENV!=="production"&&!e&&Se(`Invalid vnode type when creating vnode: ${e}.`),e=Mt),ti(e)){const u=un(e,t,!0);return r&&Ff(u,r),mo>0&&!a&&xr&&(u.shapeFlag&6?xr[xr.indexOf(e)]=u:xr.push(u)),u.patchFlag=-2,u}if(Lb(e)&&(e=e.__vccOpts),t){t=jV(t);let{class:u,style:c}=t;u&&!bt(u)&&(t.class=Rr(u)),lt(c)&&(nl(c)&&!Oe(c)&&(c=Et({},c)),t.style=Bo(c))}const o=bt(e)?1:IV(e)?128:bV(e)?64:lt(e)?4:Be(e)?2:0;return process.env.NODE_ENV!=="production"&&o&4&&nl(e)&&(e=Ye(e),Se("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
|
|
97
|
-
Component that was made reactive: `,e)),sn(e,t,r,n,i,o,a,!0)}function jV(e){return e?nl(e)||wb(e)?Et({},e):e:null}function un(e,t,r=!1,n=!1){const{props:i,ref:a,patchFlag:o,children:u,transition:c}=e,l=t?qb(i||{},t):i,s={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&kb(l),ref:t&&t.ref?r&&a?Oe(a)?a.concat(As(t)):[a,As(t)]:As(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&o===-1&&Oe(u)?u.map(Rb):u,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==mr?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&un(e.ssContent),ssFallback:e.ssFallback&&un(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&n&&nu(s,c.clone(s)),s}function Rb(e){const t=un(e);return Oe(e.children)&&(t.children=e.children.map(Rb)),t}function LV(e=" ",t=0){return $t(qo,null,e,t)}function ds(e="",t=!1){return t?(Kt(),xi(Mt,null,e)):$t(Mt,null,e)}function qr(e){return e==null||typeof e=="boolean"?$t(Mt):Oe(e)?$t(mr,null,e.slice()):typeof e=="object"?Hn(e):$t(qo,null,String(e))}function Hn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:un(e)}function Ff(e,t){let r=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(Oe(t))r=16;else if(typeof t=="object")if(n&65){const i=t.default;i&&(i._c&&(i._d=!1),Ff(e,i()),i._c&&(i._d=!0));return}else{r=32;const i=t._;!i&&!wb(t)?t._ctx=_t:i===3&&_t&&(_t.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Be(t)?(t={default:t,_ctx:_t},r=32):(t=String(t),n&64?(r=16,t=[LV(t)]):r=8);e.children=t,e.shapeFlag|=r}function qb(...e){const t={};for(let r=0;r<e.length;r++){const n=e[r];for(const i in n)if(i==="class")t.class!==n.class&&(t.class=Rr([t.class,n.class]));else if(i==="style")t.style=Bo([t.style,n.style]);else if(Oo(i)){const a=t[i],o=n[i];o&&a!==o&&!(Oe(a)&&a.includes(o))&&(t[i]=a?[].concat(a,o):o)}else i!==""&&(t[i]=n[i])}return t}function Xr(e,t,r,n=null){_r(e,t,7,[r,n])}const PV=vb();let VV=0;function UV(e,t,r){const n=e.type,i=(t?t.appContext:e.appContext)||PV,a={uid:VV++,vnode:e,type:n,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,scope:new qL(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Db(n,i),emitsOptions:Tb(n,i),emit:null,emitted:null,propsDefaults:vt,inheritAttrs:n.inheritAttrs,ctx:vt,data:vt,props:vt,attrs:vt,slots:vt,refs:vt,setupState:vt,setupContext:null,suspense:r,suspenseId:r?r.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return process.env.NODE_ENV!=="production"?a.ctx=KP(a):a.ctx={_:a},a.root=t?t.root:a,a.emit=FV.bind(null,a),e.ce&&e.ce(a),a}let Ot=null;const ri=()=>Ot||_t;let su,dl;{const e=pf(),t=(r,n)=>{let i;return(i=e[r])||(i=e[r]=[]),i.push(n),a=>{i.length>1?i.forEach(o=>o(a)):i[0](a)}};su=t("__VUE_INSTANCE_SETTERS__",r=>Ot=r),dl=t("__VUE_SSR_SETTERS__",r=>Gu=r)}const zo=e=>{const t=Ot;return su(e),e.scope.on(),()=>{e.scope.off(),su(t)}},Z0=()=>{Ot&&Ot.scope.off(),su(null)},$V=za("slot,component");function hl(e,{isNativeTag:t}){($V(e)||t(e))&&Se("Do not use built-in or reserved HTML elements as component id: "+e)}function zb(e){return e.vnode.shapeFlag&4}let Gu=!1;function HV(e,t=!1,r=!1){t&&dl(t);const{props:n,children:i}=e.vnode,a=zb(e);oV(e,n,a,t),vV(e,i,r);const o=a?JV(e,t):void 0;return t&&dl(!1),o}function JV(e,t){var r;const n=e.type;if(process.env.NODE_ENV!=="production"){if(n.name&&hl(n.name,e.appContext.config),n.components){const a=Object.keys(n.components);for(let o=0;o<a.length;o++)hl(a[o],e.appContext.config)}if(n.directives){const a=Object.keys(n.directives);for(let o=0;o<a.length;o++)ib(a[o])}n.compilerOptions&&GV()&&Se('"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.')}e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,hb),process.env.NODE_ENV!=="production"&&QP(e);const{setup:i}=n;if(i){const a=e.setupContext=i.length>1?KV(e):null,o=zo(e);kn();const u=En(i,e,0,[process.env.NODE_ENV!=="production"?rn(e.props):e.props,a]);if(In(),o(),cf(u)){if(u.then(Z0,Z0),t)return u.then(c=>{X0(e,c,t)}).catch(c=>{ko(c,e,0)});if(e.asyncDep=u,process.env.NODE_ENV!=="production"&&!e.suspense){const c=(r=n.name)!=null?r:"Anonymous";Se(`Component <${c}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`)}}else X0(e,u,t)}else jb(e,t)}function X0(e,t,r){Be(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:lt(t)?(process.env.NODE_ENV!=="production"&&ti(t)&&Se("setup() should not return VNodes directly - return a render function instead."),process.env.NODE_ENV!=="production"&&(e.devtoolsRawSetupState=t),e.setupState=Hx(t),process.env.NODE_ENV!=="production"&&ZP(e)):process.env.NODE_ENV!=="production"&&t!==void 0&&Se(`setup() should return an object. Received: ${t===null?"null":typeof t}`),jb(e,r)}let gl;const GV=()=>!gl;function jb(e,t,r){const n=e.type;if(!e.render){if(!t&&gl&&!n.render){const i=n.template||Cf(e).template;if(i){process.env.NODE_ENV!=="production"&&gn(e,"compile");const{isCustomElement:a,compilerOptions:o}=e.appContext.config,{delimiters:u,compilerOptions:c}=n,l=Et(Et({isCustomElement:a,delimiters:u},o),c);n.render=gl(i,l),process.env.NODE_ENV!=="production"&&vn(e,"compile")}}e.render=n.render||St}{const i=zo(e);kn();try{YP(e)}finally{In(),i()}}process.env.NODE_ENV!=="production"&&!n.render&&e.render===St&&!t&&(n.template?Se('Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".'):Se("Component is missing template or render function: ",n))}const Y0=process.env.NODE_ENV!=="production"?{get(e,t){return ou(),Ht(e,"get",""),e[t]},set(){return Se("setupContext.attrs is readonly."),!1},deleteProperty(){return Se("setupContext.attrs is readonly."),!1}}:{get(e,t){return Ht(e,"get",""),e[t]}};function WV(e){return new Proxy(e.slots,{get(t,r){return Ht(e,"get","$slots"),t[r]}})}function KV(e){const t=r=>{if(process.env.NODE_ENV!=="production"&&(e.exposed&&Se("expose() should be called only once per setup()."),r!=null)){let n=typeof r;n==="object"&&(Oe(r)?n="array":Lt(r)&&(n="ref")),n!=="object"&&Se(`expose() should be passed a plain object, received ${n}.`)}e.exposed=r||{}};if(process.env.NODE_ENV!=="production"){let r,n;return Object.freeze({get attrs(){return r||(r=new Proxy(e.attrs,Y0))},get slots(){return n||(n=WV(e))},get emit(){return(i,...a)=>e.emit(i,...a)},expose:t})}else return{attrs:new Proxy(e.attrs,Y0),slots:e.slots,emit:e.emit,expose:t}}function Wu(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Hx(aP(e.exposed)),{get(t,r){if(r in t)return t[r];if(r in Fi)return Fi[r](e)},has(t,r){return r in t||r in Fi}})):e.proxy}const QV=/(?:^|[-_])(\w)/g,ZV=e=>e.replace(QV,t=>t.toUpperCase()).replace(/[-_]/g,"");function Tf(e,t=!0){return Be(e)?e.displayName||e.name:e.name||t&&e.__name}function Ku(e,t,r=!1){let n=Tf(t);if(!n&&t.__file){const i=t.__file.match(/([^/\\]+)\.\w+$/);i&&(n=i[1])}if(!n&&e&&e.parent){const i=a=>{for(const o in a)if(a[o]===t)return o};n=i(e.components||e.parent.type.components)||i(e.appContext.components)}return n?ZV(n):r?"App":"Anonymous"}function Lb(e){return Be(e)&&"__vccOpts"in e}const yt=(e,t)=>{const r=sP(e,t,Gu);if(process.env.NODE_ENV!=="production"){const n=ri();n&&n.appContext.config.warnRecursiveComputed&&(r._warnRecursive=!0)}return r};function XV(e,t,r){const n=arguments.length;return n===2?lt(t)&&!Oe(t)?ti(t)?$t(e,null,[t]):$t(e,t):$t(e,null,t):(n>3?r=Array.prototype.slice.call(arguments,2):n===3&&ti(r)&&(r=[r]),$t(e,t,r))}function YV(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},r={style:"color:#f5222d"},n={style:"color:#eb2f96"},i={__vue_custom_formatter:!0,header(f){return lt(f)?f.__isVue?["div",e,"VueInstance"]:Lt(f)?["div",{},["span",e,s(f)],"<",u(f.value),">"]:sa(f)?["div",{},["span",e,Dn(f)?"ShallowReactive":"Reactive"],"<",u(f),`>${_n(f)?" (readonly)":""}`]:_n(f)?["div",{},["span",e,Dn(f)?"ShallowReadonly":"Readonly"],"<",u(f),">"]:null:null},hasBody(f){return f&&f.__isVue},body(f){if(f&&f.__isVue)return["div",{},...a(f.$)]}};function a(f){const p=[];f.type.props&&f.props&&p.push(o("props",Ye(f.props))),f.setupState!==vt&&p.push(o("setup",f.setupState)),f.data!==vt&&p.push(o("data",Ye(f.data)));const m=c(f,"computed");m&&p.push(o("computed",m));const d=c(f,"inject");return d&&p.push(o("injected",d)),p.push(["div",{},["span",{style:n.style+";opacity:0.66"},"$ (internal): "],["object",{object:f}]]),p}function o(f,p){return p=Et({},p),Object.keys(p).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},f],["div",{style:"padding-left:1.25em"},...Object.keys(p).map(m=>["div",{},["span",n,m+": "],u(p[m],!1)])]]:["span",{}]}function u(f,p=!0){return typeof f=="number"?["span",t,f]:typeof f=="string"?["span",r,JSON.stringify(f)]:typeof f=="boolean"?["span",n,f]:lt(f)?["object",{object:p?Ye(f):f}]:["span",r,String(f)]}function c(f,p){const m=f.type;if(Be(m))return;const d={};for(const h in f.ctx)l(m,h,p)&&(d[h]=f.ctx[h]);return d}function l(f,p,m){const d=f[m];if(Oe(d)&&d.includes(p)||lt(d)&&p in d||f.extends&&l(f.extends,p,m)||f.mixins&&f.mixins.some(h=>l(h,p,m)))return!0}function s(f){return Dn(f)?"ShallowRef":f.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(i):window.devtoolsFormatters=[i]}const eg="3.4.38",Qu=process.env.NODE_ENV!=="production"?Se:St;process.env.NODE_ENV;process.env.NODE_ENV;/**
|
|
96
|
+
For more details, see https://link.vuejs.org/feature-flags.`)}}const pr=zV;function EV(e){return AV(e)}function AV(e,t){DV();const r=mf();r.__VUE__=!0,process.env.NODE_ENV!=="production"&&tx(r.__VUE_DEVTOOLS_GLOBAL_HOOK__,r);const{insert:n,remove:i,patchProp:a,createElement:o,createText:u,createComment:c,setText:l,setElementText:s,parentNode:f,nextSibling:p,setScopeId:m=St,insertStaticContent:d}=e,h=($,T,z,J=null,L=null,H=null,G=void 0,Y=null,ee=process.env.NODE_ENV!=="production"&&_i?!1:!!T.dynamicChildren)=>{if($===T)return;$&&!xi($,T)&&(J=de($),V($,L,H,!0),$=null),T.patchFlag===-2&&(ee=!1,T.dynamicChildren=null);const{type:B,ref:j,shapeFlag:Q}=T;switch(B){case zo:w($,T,z,J);break;case Mt:v($,T,z,J);break;case As:$==null?x(T,z,J,G):process.env.NODE_ENV!=="production"&&g($,T,z,G);break;case mr:R($,T,z,J,L,H,G,Y,ee);break;default:Q&1?N($,T,z,J,L,H,G,Y,ee):Q&6?P($,T,z,J,L,H,G,Y,ee):Q&64||Q&128?B.process($,T,z,J,L,H,G,Y,ee,le):process.env.NODE_ENV!=="production"&&Se("Invalid VNode type:",B,`(${typeof B})`)}j!=null&&L&&ml(j,$&&$.ref,H,T||$,!T)},w=($,T,z,J)=>{if($==null)n(T.el=u(T.children),z,J);else{const L=T.el=$.el;T.children!==$.children&&l(L,T.children)}},v=($,T,z,J)=>{$==null?n(T.el=c(T.children||""),z,J):T.el=$.el},x=($,T,z,J)=>{[$.el,$.anchor]=d($.children,T,z,J,$.el,$.anchor)},g=($,T,z,J)=>{if(T.children!==$.children){const L=p($.anchor);y($),[T.el,T.anchor]=d(T.children,z,L,J)}else T.el=$.el,T.anchor=$.anchor},b=({el:$,anchor:T},z,J)=>{let L;for(;$&&$!==T;)L=p($),n($,z,J),$=L;n(T,z,J)},y=({el:$,anchor:T})=>{let z;for(;$&&$!==T;)z=p($),i($),$=z;i(T)},N=($,T,z,J,L,H,G,Y,ee)=>{T.type==="svg"?G="svg":T.type==="math"&&(G="mathml"),$==null?E(T,z,J,L,H,G,Y,ee):S($,T,L,H,G,Y,ee)},E=($,T,z,J,L,H,G,Y)=>{let ee,B;const{props:j,shapeFlag:Q,transition:Z,dirs:ie}=$;if(ee=$.el=o($.type,H,j&&j.is,j),Q&8?s(ee,$.children):Q&16&&D($.children,ee,null,J,L,Ec($,H),G,Y),ie&&pi($,null,J,"created"),A(ee,$,$.scopeId,G,J),j){for(const ye in j)ye!=="value"&&!to(ye)&&a(ee,ye,null,j[ye],H,J);"value"in j&&a(ee,"value",null,j.value,H),(B=j.onVnodeBeforeMount)&&Xr(B,J,$)}process.env.NODE_ENV!=="production"&&(tu(ee,"__vnode",$,!0),tu(ee,"__vueParentComponent",J,!0)),ie&&pi($,null,J,"beforeMount");const oe=SV(L,Z);oe&&Z.beforeEnter(ee),n(ee,T,z),((B=j&&j.onVnodeMounted)||oe||ie)&&pr(()=>{B&&Xr(B,J,$),oe&&Z.enter(ee),ie&&pi($,null,J,"mounted")},L)},A=($,T,z,J,L)=>{if(z&&m($,z),J)for(let H=0;H<J.length;H++)m($,J[H]);if(L){let H=L.subTree;if(process.env.NODE_ENV!=="production"&&H.patchFlag>0&&H.patchFlag&2048&&(H=Ff(H.children)||H),T===H){const G=L.vnode;A($,G,G.scopeId,G.slotScopeIds,L.parent)}}},D=($,T,z,J,L,H,G,Y,ee=0)=>{for(let B=ee;B<$.length;B++){const j=$[B]=Y?Hn($[B]):qr($[B]);h(null,j,T,z,J,L,H,G,Y)}},S=($,T,z,J,L,H,G)=>{const Y=T.el=$.el;process.env.NODE_ENV!=="production"&&(Y.__vnode=T);let{patchFlag:ee,dynamicChildren:B,dirs:j}=T;ee|=$.patchFlag&16;const Q=$.props||vt,Z=T.props||vt;let ie;if(z&&mi(z,!1),(ie=Z.onVnodeBeforeUpdate)&&Xr(ie,z,T,$),j&&pi(T,$,z,"beforeUpdate"),z&&mi(z,!0),process.env.NODE_ENV!=="production"&&_i&&(ee=0,G=!1,B=null),(Q.innerHTML&&Z.innerHTML==null||Q.textContent&&Z.textContent==null)&&s(Y,""),B?(C($.dynamicChildren,B,Y,z,J,Ec(T,L),H),process.env.NODE_ENV!=="production"&&Es($,T)):G||k($,T,Y,null,z,J,Ec(T,L),H,!1),ee>0){if(ee&16)_(Y,Q,Z,z,L);else if(ee&2&&Q.class!==Z.class&&a(Y,"class",null,Z.class,L),ee&4&&a(Y,"style",Q.style,Z.style,L),ee&8){const oe=T.dynamicProps;for(let ye=0;ye<oe.length;ye++){const fe=oe[ye],De=Q[fe],Ne=Z[fe];(Ne!==De||fe==="value")&&a(Y,fe,De,Ne,L,z)}}ee&1&&$.children!==T.children&&s(Y,T.children)}else!G&&B==null&&_(Y,Q,Z,z,L);((ie=Z.onVnodeUpdated)||j)&&pr(()=>{ie&&Xr(ie,z,T,$),j&&pi(T,$,z,"updated")},J)},C=($,T,z,J,L,H,G)=>{for(let Y=0;Y<T.length;Y++){const ee=$[Y],B=T[Y],j=ee.el&&(ee.type===mr||!xi(ee,B)||ee.shapeFlag&70)?f(ee.el):z;h(ee,B,j,null,J,L,H,G,!0)}},_=($,T,z,J,L)=>{if(T!==z){if(T!==vt)for(const H in T)!to(H)&&!(H in z)&&a($,H,T[H],null,L,J);for(const H in z){if(to(H))continue;const G=z[H],Y=T[H];G!==Y&&H!=="value"&&a($,H,Y,G,L,J)}"value"in z&&a($,"value",T.value,z.value,L)}},R=($,T,z,J,L,H,G,Y,ee)=>{const B=T.el=$?$.el:u(""),j=T.anchor=$?$.anchor:u("");let{patchFlag:Q,dynamicChildren:Z,slotScopeIds:ie}=T;process.env.NODE_ENV!=="production"&&(_i||Q&2048)&&(Q=0,ee=!1,Z=null),ie&&(Y=Y?Y.concat(ie):ie),$==null?(n(B,z,J),n(j,z,J),D(T.children||[],z,j,L,H,G,Y,ee)):Q>0&&Q&64&&Z&&$.dynamicChildren?(C($.dynamicChildren,Z,z,L,H,G,Y),process.env.NODE_ENV!=="production"?Es($,T):(T.key!=null||L&&T===L.subTree)&&Es($,T,!0)):k($,T,z,j,L,H,G,Y,ee)},P=($,T,z,J,L,H,G,Y,ee)=>{T.slotScopeIds=Y,$==null?T.shapeFlag&512?L.ctx.activate(T,z,J,G,ee):I(T,z,J,L,H,G,ee):O($,T,ee)},I=($,T,z,J,L,H,G)=>{const Y=$.component=HV($,J,L);if(process.env.NODE_ENV!=="production"&&Y.type.__hmrId&&DP(Y),process.env.NODE_ENV!=="production"&&(ws($),gn(Y,"mount")),qo($)&&(Y.ctx.renderer=le),process.env.NODE_ENV!=="production"&&gn(Y,"init"),GV(Y,!1,G),process.env.NODE_ENV!=="production"&&vn(Y,"init"),Y.asyncDep){if(L&&L.registerDep(Y,F,G),!$.el){const ee=Y.subTree=$t(Mt);v(null,ee,T,z)}}else F(Y,$,T,z,L,H,G);process.env.NODE_ENV!=="production"&&(Ns(),vn(Y,"mount"))},O=($,T,z)=>{const J=T.component=$.component;if(IV($,T,z))if(J.asyncDep&&!J.asyncResolved){process.env.NODE_ENV!=="production"&&ws(T),q(J,T,z),process.env.NODE_ENV!=="production"&&Ns();return}else J.next=T,wP(J.update),J.effect.dirty=!0,J.update();else T.el=$.el,J.vnode=T},F=($,T,z,J,L,H,G)=>{const Y=()=>{if($.isMounted){let{next:j,bu:Q,u:Z,parent:ie,vnode:oe}=$;{const je=_x($);if(je){j&&(j.el=oe.el,q($,j,G)),je.asyncDep.then(()=>{$.isUnmounted||Y()});return}}let ye=j,fe;process.env.NODE_ENV!=="production"&&ws(j||$.vnode),mi($,!1),j?(j.el=oe.el,q($,j,G)):j=oe,Q&&Ga(Q),(fe=j.props&&j.props.onVnodeBeforeUpdate)&&Xr(fe,ie,j,oe),mi($,!0),process.env.NODE_ENV!=="production"&&gn($,"render");const De=Ac($);process.env.NODE_ENV!=="production"&&vn($,"render");const Ne=$.subTree;$.subTree=De,process.env.NODE_ENV!=="production"&&gn($,"patch"),h(Ne,De,f(Ne.el),de(Ne),$,L,H),process.env.NODE_ENV!=="production"&&vn($,"patch"),j.el=De.el,ye===null&&RV($,De.el),Z&&pr(Z,L),(fe=j.props&&j.props.onVnodeUpdated)&&pr(()=>Xr(fe,ie,j,oe),L),process.env.NODE_ENV!=="production"&&rx($),process.env.NODE_ENV!=="production"&&Ns()}else{let j;const{el:Q,props:Z}=T,{bm:ie,m:oe,parent:ye}=$,fe=no(T);if(mi($,!1),ie&&Ga(ie),!fe&&(j=Z&&Z.onVnodeBeforeMount)&&Xr(j,ye,T),mi($,!0),Q&&xe){const De=()=>{process.env.NODE_ENV!=="production"&&gn($,"render"),$.subTree=Ac($),process.env.NODE_ENV!=="production"&&vn($,"render"),process.env.NODE_ENV!=="production"&&gn($,"hydrate"),xe(Q,$.subTree,$,L,null),process.env.NODE_ENV!=="production"&&vn($,"hydrate")};fe?T.type.__asyncLoader().then(()=>!$.isUnmounted&&De()):De()}else{process.env.NODE_ENV!=="production"&&gn($,"render");const De=$.subTree=Ac($);process.env.NODE_ENV!=="production"&&vn($,"render"),process.env.NODE_ENV!=="production"&&gn($,"patch"),h(null,De,z,J,$,L,H),process.env.NODE_ENV!=="production"&&vn($,"patch"),T.el=De.el}if(oe&&pr(oe,L),!fe&&(j=Z&&Z.onVnodeMounted)){const De=T;pr(()=>Xr(j,ye,De),L)}(T.shapeFlag&256||ye&&no(ye.vnode)&&ye.vnode.shapeFlag&256)&&$.a&&pr($.a,L),$.isMounted=!0,process.env.NODE_ENV!=="production"&&_P($),T=z=J=null}},ee=$.effect=new hf(Y,St,()=>$u(B),$.scope),B=$.update=()=>{ee.dirty&&ee.run()};B.i=$,B.id=$.uid,mi($,!0),process.env.NODE_ENV!=="production"&&(ee.onTrack=$.rtc?j=>Ga($.rtc,j):void 0,ee.onTrigger=$.rtg?j=>Ga($.rtg,j):void 0),B()},q=($,T,z)=>{T.component=$;const J=$.vnode.props;$.vnode=T,$.next=null,lV($,T.props,J,z),xV($,T.children,z),kn(),q0($),In()},k=($,T,z,J,L,H,G,Y,ee=!1)=>{const B=$&&$.children,j=$?$.shapeFlag:0,Q=T.children,{patchFlag:Z,shapeFlag:ie}=T;if(Z>0){if(Z&128){se(B,Q,z,J,L,H,G,Y,ee);return}else if(Z&256){te(B,Q,z,J,L,H,G,Y,ee);return}}ie&8?(j&16&&ae(B,L,H),Q!==B&&s(z,Q)):j&16?ie&16?se(B,Q,z,J,L,H,G,Y,ee):ae(B,L,H,!0):(j&8&&s(z,""),ie&16&&D(Q,z,J,L,H,G,Y,ee))},te=($,T,z,J,L,H,G,Y,ee)=>{$=$||sa,T=T||sa;const B=$.length,j=T.length,Q=Math.min(B,j);let Z;for(Z=0;Z<Q;Z++){const ie=T[Z]=ee?Hn(T[Z]):qr(T[Z]);h($[Z],ie,z,null,L,H,G,Y,ee)}B>j?ae($,L,H,!0,!1,Q):D(T,z,J,L,H,G,Y,ee,Q)},se=($,T,z,J,L,H,G,Y,ee)=>{let B=0;const j=T.length;let Q=$.length-1,Z=j-1;for(;B<=Q&&B<=Z;){const ie=$[B],oe=T[B]=ee?Hn(T[B]):qr(T[B]);if(xi(ie,oe))h(ie,oe,z,null,L,H,G,Y,ee);else break;B++}for(;B<=Q&&B<=Z;){const ie=$[Q],oe=T[Z]=ee?Hn(T[Z]):qr(T[Z]);if(xi(ie,oe))h(ie,oe,z,null,L,H,G,Y,ee);else break;Q--,Z--}if(B>Q){if(B<=Z){const ie=Z+1,oe=ie<j?T[ie].el:J;for(;B<=Z;)h(null,T[B]=ee?Hn(T[B]):qr(T[B]),z,oe,L,H,G,Y,ee),B++}}else if(B>Z)for(;B<=Q;)V($[B],L,H,!0),B++;else{const ie=B,oe=B,ye=new Map;for(B=oe;B<=Z;B++){const M=T[B]=ee?Hn(T[B]):qr(T[B]);M.key!=null&&(process.env.NODE_ENV!=="production"&&ye.has(M.key)&&Se("Duplicate keys found during update:",JSON.stringify(M.key),"Make sure keys are unique."),ye.set(M.key,B))}let fe,De=0;const Ne=Z-oe+1;let je=!1,Ze=0;const _e=new Array(Ne);for(B=0;B<Ne;B++)_e[B]=0;for(B=ie;B<=Q;B++){const M=$[B];if(De>=Ne){V(M,L,H,!0);continue}let X;if(M.key!=null)X=ye.get(M.key);else for(fe=oe;fe<=Z;fe++)if(_e[fe-oe]===0&&xi(M,T[fe])){X=fe;break}X===void 0?V(M,L,H,!0):(_e[X-oe]=B+1,X>=Ze?Ze=X:je=!0,h(M,T[X],z,null,L,H,G,Y,ee),De++)}const wt=je?CV(_e):sa;for(fe=wt.length-1,B=Ne-1;B>=0;B--){const M=oe+B,X=T[M],pe=M+1<j?T[M+1].el:J;_e[B]===0?h(null,X,z,pe,L,H,G,Y,ee):je&&(fe<0||B!==wt[fe]?K(X,z,pe,2):fe--)}}},K=($,T,z,J,L=null)=>{const{el:H,type:G,transition:Y,children:ee,shapeFlag:B}=$;if(B&6){K($.component.subTree,T,z,J);return}if(B&128){$.suspense.move(T,z,J);return}if(B&64){G.move($,T,z,le);return}if(G===mr){n(H,T,z);for(let j=0;j<ee.length;j++)K(ee[j],T,z,J);n($.anchor,T,z);return}if(G===As){b($,T,z);return}if(J!==2&&B&1&&Y)if(J===0)Y.beforeEnter(H),n(H,T,z),pr(()=>Y.enter(H),L);else{const{leave:j,delayLeave:Q,afterLeave:Z}=Y,ie=()=>n(H,T,z),oe=()=>{j(H,()=>{ie(),Z&&Z()})};Q?Q(H,ie,oe):oe()}else n(H,T,z)},V=($,T,z,J=!1,L=!1)=>{const{type:H,props:G,ref:Y,children:ee,dynamicChildren:B,shapeFlag:j,patchFlag:Q,dirs:Z,cacheIndex:ie}=$;if(Q===-2&&(L=!1),Y!=null&&ml(Y,null,z,$,!0),ie!=null&&(T.renderCache[ie]=void 0),j&256){T.ctx.deactivate($);return}const oe=j&1&&Z,ye=!no($);let fe;if(ye&&(fe=G&&G.onVnodeBeforeUnmount)&&Xr(fe,T,$),j&6)re($.component,z,J);else{if(j&128){$.suspense.unmount(z,J);return}oe&&pi($,null,T,"beforeUnmount"),j&64?$.type.remove($,T,z,le,J):B&&!B.hasOnce&&(H!==mr||Q>0&&Q&64)?ae(B,T,z,!1,!0):(H===mr&&Q&384||!L&&j&16)&&ae(ee,T,z),J&&ue($)}(ye&&(fe=G&&G.onVnodeUnmounted)||oe)&&pr(()=>{fe&&Xr(fe,T,$),oe&&pi($,null,T,"unmounted")},z)},ue=$=>{const{type:T,el:z,anchor:J,transition:L}=$;if(T===mr){process.env.NODE_ENV!=="production"&&$.patchFlag>0&&$.patchFlag&2048&&L&&!L.persisted?$.children.forEach(G=>{G.type===Mt?i(G.el):ue(G)}):me(z,J);return}if(T===As){y($);return}const H=()=>{i(z),L&&!L.persisted&&L.afterLeave&&L.afterLeave()};if($.shapeFlag&1&&L&&!L.persisted){const{leave:G,delayLeave:Y}=L,ee=()=>G(z,H);Y?Y($.el,H,ee):ee()}else H()},me=($,T)=>{let z;for(;$!==T;)z=p($),i($),$=z;i(T)},re=($,T,z)=>{process.env.NODE_ENV!=="production"&&$.type.__hmrId&&EP($);const{bum:J,scope:L,update:H,subTree:G,um:Y,m:ee,a:B}=$;W0(ee),W0(B),J&&Ga(J),L.stop(),H&&(H.active=!1,V(G,$,T,z)),Y&&pr(Y,T),pr(()=>{$.isUnmounted=!0},T),T&&T.pendingBranch&&!T.isUnmounted&&$.asyncDep&&!$.asyncResolved&&$.suspenseId===T.pendingId&&(T.deps--,T.deps===0&&T.resolve()),process.env.NODE_ENV!=="production"&&TP($)},ae=($,T,z,J=!1,L=!1,H=0)=>{for(let G=H;G<$.length;G++)V($[G],T,z,J,L)},de=$=>{if($.shapeFlag&6)return de($.component.subTree);if($.shapeFlag&128)return $.suspense.next();const T=p($.anchor||$.el),z=T&&T[wV];return z?p(z):T};let ne=!1;const ce=($,T,z)=>{$==null?T._vnode&&V(T._vnode,null,null,!0):h(T._vnode||null,$,T,null,null,null,z),T._vnode=$,ne||(ne=!0,q0(),Xb(),ne=!1)},le={p:h,um:V,m:K,r:ue,mt:I,mc:D,pc:k,pbc:C,n:de,o:e};let he,xe;return{render:ce,hydrate:he,createApp:sV(ce,he)}}function Ec({type:e,props:t},r){return r==="svg"&&e==="foreignObject"||r==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:r}function mi({effect:e,update:t},r){e.allowRecurse=t.allowRecurse=r}function SV(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Es(e,t,r=!1){const n=e.children,i=t.children;if(Oe(n)&&Oe(i))for(let a=0;a<n.length;a++){const o=n[a];let u=i[a];u.shapeFlag&1&&!u.dynamicChildren&&((u.patchFlag<=0||u.patchFlag===32)&&(u=i[a]=Hn(i[a]),u.el=o.el),!r&&u.patchFlag!==-2&&Es(o,u)),u.type===zo&&(u.el=o.el),process.env.NODE_ENV!=="production"&&u.type===Mt&&!u.el&&(u.el=o.el)}}function CV(e){const t=e.slice(),r=[0];let n,i,a,o,u;const c=e.length;for(n=0;n<c;n++){const l=e[n];if(l!==0){if(i=r[r.length-1],e[i]<l){t[n]=i,r.push(n);continue}for(a=0,o=r.length-1;a<o;)u=a+o>>1,e[r[u]]<l?a=u+1:o=u;l<e[r[a]]&&(a>0&&(t[n]=r[a-1]),r[a]=n)}}for(a=r.length,o=r[a-1];a-- >0;)r[a]=o,o=t[o];return r}function _x(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:_x(t)}function W0(e){if(e)for(let t=0;t<e.length;t++)e[t].active=!1}const MV=Symbol.for("v-scx"),_V=()=>{{const e=an(MV);return e||process.env.NODE_ENV!=="production"&&Se("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}},ds={};function fa(e,t,r){return process.env.NODE_ENV!=="production"&&!Be(t)&&Se("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),Fx(e,t,r)}function Fx(e,t,{immediate:r,deep:n,flush:i,once:a,onTrack:o,onTrigger:u}=vt){if(t&&a){const E=t;t=(...A)=>{E(...A),N()}}process.env.NODE_ENV!=="production"&&n!==void 0&&typeof n=="number"&&Se('watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.'),process.env.NODE_ENV!=="production"&&!t&&(r!==void 0&&Se('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),n!==void 0&&Se('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),a!==void 0&&Se('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const c=E=>{Se("Invalid watch source: ",E,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},l=Ot,s=E=>n===!0?E:Gn(E,n===!1?1:void 0);let f,p=!1,m=!1;if(Lt(e)?(f=()=>e.value,p=Dn(e)):ua(e)?(f=()=>s(e),p=!0):Oe(e)?(m=!0,p=e.some(E=>ua(E)||Dn(E)),f=()=>e.map(E=>{if(Lt(E))return E.value;if(ua(E))return s(E);if(Be(E))return En(E,l,2);process.env.NODE_ENV!=="production"&&c(E)})):Be(e)?t?f=()=>En(e,l,2):f=()=>(d&&d(),_r(e,l,3,[h])):(f=St,process.env.NODE_ENV!=="production"&&c(e)),t&&n){const E=f;f=()=>Gn(E())}let d,h=E=>{d=b.onStop=()=>{En(E,l,4),d=b.onStop=void 0}},w;if(Wu)if(h=St,t?r&&_r(t,l,3,[f(),m?[]:void 0,h]):f(),i==="sync"){const E=_V();w=E.__watcherHandles||(E.__watcherHandles=[])}else return St;let v=m?new Array(e.length).fill(ds):ds;const x=()=>{if(!(!b.active||!b.dirty))if(t){const E=b.run();(n||p||(m?E.some((A,D)=>ei(A,v[D])):ei(E,v)))&&(d&&d(),_r(t,l,3,[E,v===ds?void 0:m&&v[0]===ds?[]:v,h]),v=E)}else b.run()};x.allowRecurse=!!t;let g;i==="sync"?g=x:i==="post"?g=()=>pr(x,l&&l.suspense):(x.pre=!0,l&&(x.id=l.uid),g=()=>$u(x));const b=new hf(f,St,g),y=Mb(),N=()=>{b.stop(),y&&cf(y.effects,b)};return process.env.NODE_ENV!=="production"&&(b.onTrack=o,b.onTrigger=u),t?r?x():v=b.run():i==="post"?pr(b.run.bind(b),l&&l.suspense):b.run(),w&&w.push(N),N}function FV(e,t,r){const n=this.proxy,i=xt(e)?e.includes(".")?Tx(n,e):()=>n[e]:e.bind(n,n);let a;Be(t)?a=t:(a=t.handler,r=t);const o=jo(this),u=Fx(i,a.bind(n),r);return o(),u}function Tx(e,t){const r=t.split(".");return()=>{let n=e;for(let i=0;i<r.length&&n;i++)n=n[r[i]];return n}}function Gn(e,t=1/0,r){if(t<=0||!lt(e)||e.__v_skip||(r=r||new Set,r.has(e)))return e;if(r.add(e),t--,Lt(e))Gn(e.value,t,r);else if(Oe(e))for(let n=0;n<e.length;n++)Gn(e[n],t,r);else if(Nb(e)||Ai(e))e.forEach(n=>{Gn(n,t,r)});else if(Eb(e)){for(const n in e)Gn(e[n],t,r);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&Gn(e[n],t,r)}return e}const TV=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${wr(t)}Modifiers`]||e[`${Cn(t)}Modifiers`];function OV(e,t,...r){if(e.isUnmounted)return;const n=e.vnode.props||vt;if(process.env.NODE_ENV!=="production"){const{emitsOptions:s,propsOptions:[f]}=e;if(s)if(!(t in s))(!f||!(vi(wr(t))in f))&&Se(`Component emitted event "${t}" but it is neither declared in the emits option nor as an "${vi(wr(t))}" prop.`);else{const p=s[t];Be(p)&&(p(...r)||Se(`Invalid event arguments: event validation failed for event "${t}".`))}}let i=r;const a=t.startsWith("update:"),o=a&&TV(n,t.slice(7));if(o&&(o.trim&&(i=r.map(s=>xt(s)?s.trim():s)),o.number&&(i=r.map(TL))),process.env.NODE_ENV!=="production"&&kP(e,t,i),process.env.NODE_ENV!=="production"){const s=t.toLowerCase();s!==t&&n[vi(s)]&&Se(`Event "${s}" is emitted in component ${Qu(e,e.type)} but the handler is registered for "${t}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${Cn(t)}" instead of "${t}".`)}let u,c=n[u=vi(t)]||n[u=vi(wr(t))];!c&&a&&(c=n[u=vi(Cn(t))]),c&&_r(c,e,6,i);const l=n[u+"Once"];if(l){if(!e.emitted)e.emitted={};else if(e.emitted[u])return;e.emitted[u]=!0,_r(l,e,6,i)}}function Ox(e,t,r=!1){const n=t.emitsCache,i=n.get(e);if(i!==void 0)return i;const a=e.emits;let o={},u=!1;if(!Be(e)){const c=l=>{const s=Ox(l,t,!0);s&&(u=!0,Et(o,s))};!r&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!a&&!u?(lt(e)&&n.set(e,null),null):(Oe(a)?a.forEach(c=>o[c]=null):Et(o,a),lt(e)&&n.set(e,o),o)}function Gu(e,t){return!e||!Bo(t)?!1:(t=t.slice(2).replace(/Once$/,""),tt(e,t[0].toLowerCase()+t.slice(1))||tt(e,Cn(t))||tt(e,t))}let dl=!1;function su(){dl=!0}function Ac(e){const{type:t,vnode:r,proxy:n,withProxy:i,propsOptions:[a],slots:o,attrs:u,emit:c,render:l,renderCache:s,props:f,data:p,setupState:m,ctx:d,inheritAttrs:h}=e,w=nu(e);let v,x;process.env.NODE_ENV!=="production"&&(dl=!1);try{if(r.shapeFlag&4){const y=i||n,N=process.env.NODE_ENV!=="production"&&m.__isScriptSetup?new Proxy(y,{get(E,A,D){return Se(`Property '${String(A)}' was accessed via 'this'. Avoid using 'this' in templates.`),Reflect.get(E,A,D)}}):y;v=qr(l.call(N,y,s,process.env.NODE_ENV!=="production"?rn(f):f,m,p,d)),x=u}else{const y=t;process.env.NODE_ENV!=="production"&&u===f&&su(),v=qr(y.length>1?y(process.env.NODE_ENV!=="production"?rn(f):f,process.env.NODE_ENV!=="production"?{get attrs(){return su(),rn(u)},slots:o,emit:c}:{attrs:u,slots:o,emit:c}):y(process.env.NODE_ENV!=="production"?rn(f):f,null)),x=t.props?u:BV(u)}}catch(y){io.length=0,Io(y,e,1),v=$t(Mt)}let g=v,b;if(process.env.NODE_ENV!=="production"&&v.patchFlag>0&&v.patchFlag&2048&&([g,b]=Bx(v)),x&&h!==!1){const y=Object.keys(x),{shapeFlag:N}=g;if(y.length){if(N&7)a&&y.some(eu)&&(x=kV(x,a)),g=un(g,x,!1,!0);else if(process.env.NODE_ENV!=="production"&&!dl&&g.type!==Mt){const E=Object.keys(u),A=[],D=[];for(let S=0,C=E.length;S<C;S++){const _=E[S];Bo(_)?eu(_)||A.push(_[2].toLowerCase()+_.slice(3)):D.push(_)}D.length&&Se(`Extraneous non-props attributes (${D.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`),A.length&&Se(`Extraneous non-emits event listeners (${A.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`)}}}return r.dirs&&(process.env.NODE_ENV!=="production"&&!K0(g)&&Se("Runtime directive used on component with non-element root node. The directives will not function as intended."),g=un(g,null,!1,!0),g.dirs=g.dirs?g.dirs.concat(r.dirs):r.dirs),r.transition&&(process.env.NODE_ENV!=="production"&&!K0(g)&&Se("Component inside <Transition> renders non-element root node that cannot be animated."),g.transition=r.transition),process.env.NODE_ENV!=="production"&&b?b(g):v=g,nu(w),v}const Bx=e=>{const t=e.children,r=e.dynamicChildren,n=Ff(t,!1);if(n){if(process.env.NODE_ENV!=="production"&&n.patchFlag>0&&n.patchFlag&2048)return Bx(n)}else return[e,void 0];const i=t.indexOf(n),a=r?r.indexOf(n):-1,o=u=>{t[i]=u,r&&(a>-1?r[a]=u:u.patchFlag>0&&(e.dynamicChildren=[...r,u]))};return[qr(n),o]};function Ff(e,t=!0){let r;for(let n=0;n<e.length;n++){const i=e[n];if(ti(i)){if(i.type!==Mt||i.children==="v-if"){if(r)return;if(r=i,process.env.NODE_ENV!=="production"&&t&&r.patchFlag>0&&r.patchFlag&2048)return Ff(r.children)}}else return}return r}const BV=e=>{let t;for(const r in e)(r==="class"||r==="style"||Bo(r))&&((t||(t={}))[r]=e[r]);return t},kV=(e,t)=>{const r={};for(const n in e)(!eu(n)||!(n.slice(9)in t))&&(r[n]=e[n]);return r},K0=e=>e.shapeFlag&7||e.type===Mt;function IV(e,t,r){const{props:n,children:i,component:a}=e,{props:o,children:u,patchFlag:c}=t,l=a.emitsOptions;if(process.env.NODE_ENV!=="production"&&(i||u)&&_i||t.dirs||t.transition)return!0;if(r&&c>=0){if(c&1024)return!0;if(c&16)return n?Q0(n,o,l):!!o;if(c&8){const s=t.dynamicProps;for(let f=0;f<s.length;f++){const p=s[f];if(o[p]!==n[p]&&!Gu(l,p))return!0}}}else return(i||u)&&(!u||!u.$stable)?!0:n===o?!1:n?o?Q0(n,o,l):!0:!!o;return!1}function Q0(e,t,r){const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(let i=0;i<n.length;i++){const a=n[i];if(t[a]!==e[a]&&!Gu(r,a))return!0}return!1}function RV({vnode:e,parent:t},r){for(;t;){const n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.el=e.el),n===e)(e=t.vnode).el=r,t=t.parent;else break}}const qV=e=>e.__isSuspense;function zV(e,t){t&&t.pendingBranch?Oe(e)?t.effects.push(...e):t.effects.push(e):Zb(e)}const mr=Symbol.for("v-fgt"),zo=Symbol.for("v-txt"),Mt=Symbol.for("v-cmt"),As=Symbol.for("v-stc"),io=[];let br=null;function Kt(e=!1){io.push(br=e?null:[])}function jV(){io.pop(),br=io[io.length-1]||null}let ho=1;function Z0(e){ho+=e,e<0&&br&&(br.hasOnce=!0)}function kx(e){return e.dynamicChildren=ho>0?br||sa:null,jV(),ho>0&&br&&br.push(e),e}function Fn(e,t,r,n,i,a){return kx(sn(e,t,r,n,i,a,!0))}function bi(e,t,r,n,i){return kx($t(e,t,r,n,i,!0))}function ti(e){return e?e.__v_isVNode===!0:!1}function xi(e,t){if(process.env.NODE_ENV!=="production"&&t.shapeFlag&6&&e.component){const r=Ds.get(t.type);if(r&&r.has(e.component))return e.shapeFlag&=-257,t.shapeFlag&=-513,!1}return e.type===t.type&&e.key===t.key}const LV=(...e)=>Rx(...e),Ix=({key:e})=>e??null,Ss=({ref:e,ref_key:t,ref_for:r})=>(typeof e=="number"&&(e=""+e),e!=null?xt(e)||Lt(e)||Be(e)?{i:_t,r:e,k:t,f:!!r}:e:null);function sn(e,t=null,r=null,n=0,i=null,a=e===mr?0:1,o=!1,u=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ix(t),ref:t&&Ss(t),scopeId:ix,slotScopeIds:null,children:r,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:n,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:_t};return u?(Tf(c,r),a&128&&e.normalize(c)):r&&(c.shapeFlag|=xt(r)?8:16),process.env.NODE_ENV!=="production"&&c.key!==c.key&&Se("VNode created with invalid key (NaN). VNode type:",c.type),ho>0&&!o&&br&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&br.push(c),c}const $t=process.env.NODE_ENV!=="production"?LV:Rx;function Rx(e,t=null,r=null,n=0,i=null,a=!1){if((!e||e===dx)&&(process.env.NODE_ENV!=="production"&&!e&&Se(`Invalid vnode type when creating vnode: ${e}.`),e=Mt),ti(e)){const u=un(e,t,!0);return r&&Tf(u,r),ho>0&&!a&&br&&(u.shapeFlag&6?br[br.indexOf(e)]=u:br.push(u)),u.patchFlag=-2,u}if(Px(e)&&(e=e.__vccOpts),t){t=PV(t);let{class:u,style:c}=t;u&&!xt(u)&&(t.class=Rr(u)),lt(c)&&(il(c)&&!Oe(c)&&(c=Et({},c)),t.style=ko(c))}const o=xt(e)?1:qV(e)?128:NV(e)?64:lt(e)?4:Be(e)?2:0;return process.env.NODE_ENV!=="production"&&o&4&&il(e)&&(e=Ye(e),Se("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
|
|
97
|
+
Component that was made reactive: `,e)),sn(e,t,r,n,i,o,a,!0)}function PV(e){return e?il(e)||Nx(e)?Et({},e):e:null}function un(e,t,r=!1,n=!1){const{props:i,ref:a,patchFlag:o,children:u,transition:c}=e,l=t?zx(i||{},t):i,s={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&Ix(l),ref:t&&t.ref?r&&a?Oe(a)?a.concat(Ss(t)):[a,Ss(t)]:Ss(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&o===-1&&Oe(u)?u.map(qx):u,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==mr?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&un(e.ssContent),ssFallback:e.ssFallback&&un(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&n&&iu(s,c.clone(s)),s}function qx(e){const t=un(e);return Oe(e.children)&&(t.children=e.children.map(qx)),t}function VV(e=" ",t=0){return $t(zo,null,e,t)}function hs(e="",t=!1){return t?(Kt(),bi(Mt,null,e)):$t(Mt,null,e)}function qr(e){return e==null||typeof e=="boolean"?$t(Mt):Oe(e)?$t(mr,null,e.slice()):typeof e=="object"?Hn(e):$t(zo,null,String(e))}function Hn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:un(e)}function Tf(e,t){let r=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(Oe(t))r=16;else if(typeof t=="object")if(n&65){const i=t.default;i&&(i._c&&(i._d=!1),Tf(e,i()),i._c&&(i._d=!0));return}else{r=32;const i=t._;!i&&!Nx(t)?t._ctx=_t:i===3&&_t&&(_t.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Be(t)?(t={default:t,_ctx:_t},r=32):(t=String(t),n&64?(r=16,t=[VV(t)]):r=8);e.children=t,e.shapeFlag|=r}function zx(...e){const t={};for(let r=0;r<e.length;r++){const n=e[r];for(const i in n)if(i==="class")t.class!==n.class&&(t.class=Rr([t.class,n.class]));else if(i==="style")t.style=ko([t.style,n.style]);else if(Bo(i)){const a=t[i],o=n[i];o&&a!==o&&!(Oe(a)&&a.includes(o))&&(t[i]=a?[].concat(a,o):o)}else i!==""&&(t[i]=n[i])}return t}function Xr(e,t,r,n=null){_r(e,t,7,[r,n])}const UV=yx();let $V=0;function HV(e,t,r){const n=e.type,i=(t?t.appContext:e.appContext)||UV,a={uid:$V++,vnode:e,type:n,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,scope:new jL(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Ex(n,i),emitsOptions:Ox(n,i),emit:null,emitted:null,propsDefaults:vt,inheritAttrs:n.inheritAttrs,ctx:vt,data:vt,props:vt,attrs:vt,slots:vt,refs:vt,setupState:vt,setupContext:null,suspense:r,suspenseId:r?r.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return process.env.NODE_ENV!=="production"?a.ctx=ZP(a):a.ctx={_:a},a.root=t?t.root:a,a.emit=OV.bind(null,a),e.ce&&e.ce(a),a}let Ot=null;const ri=()=>Ot||_t;let uu,hl;{const e=mf(),t=(r,n)=>{let i;return(i=e[r])||(i=e[r]=[]),i.push(n),a=>{i.length>1?i.forEach(o=>o(a)):i[0](a)}};uu=t("__VUE_INSTANCE_SETTERS__",r=>Ot=r),hl=t("__VUE_SSR_SETTERS__",r=>Wu=r)}const jo=e=>{const t=Ot;return uu(e),e.scope.on(),()=>{e.scope.off(),uu(t)}},X0=()=>{Ot&&Ot.scope.off(),uu(null)},JV=ja("slot,component");function gl(e,{isNativeTag:t}){(JV(e)||t(e))&&Se("Do not use built-in or reserved HTML elements as component id: "+e)}function jx(e){return e.vnode.shapeFlag&4}let Wu=!1;function GV(e,t=!1,r=!1){t&&hl(t);const{props:n,children:i}=e.vnode,a=jx(e);uV(e,n,a,t),bV(e,i,r);const o=a?WV(e,t):void 0;return t&&hl(!1),o}function WV(e,t){var r;const n=e.type;if(process.env.NODE_ENV!=="production"){if(n.name&&gl(n.name,e.appContext.config),n.components){const a=Object.keys(n.components);for(let o=0;o<a.length;o++)gl(a[o],e.appContext.config)}if(n.directives){const a=Object.keys(n.directives);for(let o=0;o<a.length;o++)ax(a[o])}n.compilerOptions&&KV()&&Se('"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.')}e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,gx),process.env.NODE_ENV!=="production"&&XP(e);const{setup:i}=n;if(i){const a=e.setupContext=i.length>1?ZV(e):null,o=jo(e);kn();const u=En(i,e,0,[process.env.NODE_ENV!=="production"?rn(e.props):e.props,a]);if(In(),o(),lf(u)){if(u.then(X0,X0),t)return u.then(c=>{Y0(e,c,t)}).catch(c=>{Io(c,e,0)});if(e.asyncDep=u,process.env.NODE_ENV!=="production"&&!e.suspense){const c=(r=n.name)!=null?r:"Anonymous";Se(`Component <${c}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`)}}else Y0(e,u,t)}else Lx(e,t)}function Y0(e,t,r){Be(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:lt(t)?(process.env.NODE_ENV!=="production"&&ti(t)&&Se("setup() should not return VNodes directly - return a render function instead."),process.env.NODE_ENV!=="production"&&(e.devtoolsRawSetupState=t),e.setupState=Jb(t),process.env.NODE_ENV!=="production"&&YP(e)):process.env.NODE_ENV!=="production"&&t!==void 0&&Se(`setup() should return an object. Received: ${t===null?"null":typeof t}`),Lx(e,r)}let vl;const KV=()=>!vl;function Lx(e,t,r){const n=e.type;if(!e.render){if(!t&&vl&&!n.render){const i=n.template||Mf(e).template;if(i){process.env.NODE_ENV!=="production"&&gn(e,"compile");const{isCustomElement:a,compilerOptions:o}=e.appContext.config,{delimiters:u,compilerOptions:c}=n,l=Et(Et({isCustomElement:a,delimiters:u},o),c);n.render=vl(i,l),process.env.NODE_ENV!=="production"&&vn(e,"compile")}}e.render=n.render||St}{const i=jo(e);kn();try{tV(e)}finally{In(),i()}}process.env.NODE_ENV!=="production"&&!n.render&&e.render===St&&!t&&(n.template?Se('Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".'):Se("Component is missing template or render function: ",n))}const eg=process.env.NODE_ENV!=="production"?{get(e,t){return su(),Ht(e,"get",""),e[t]},set(){return Se("setupContext.attrs is readonly."),!1},deleteProperty(){return Se("setupContext.attrs is readonly."),!1}}:{get(e,t){return Ht(e,"get",""),e[t]}};function QV(e){return new Proxy(e.slots,{get(t,r){return Ht(e,"get","$slots"),t[r]}})}function ZV(e){const t=r=>{if(process.env.NODE_ENV!=="production"&&(e.exposed&&Se("expose() should be called only once per setup()."),r!=null)){let n=typeof r;n==="object"&&(Oe(r)?n="array":Lt(r)&&(n="ref")),n!=="object"&&Se(`expose() should be passed a plain object, received ${n}.`)}e.exposed=r||{}};if(process.env.NODE_ENV!=="production"){let r,n;return Object.freeze({get attrs(){return r||(r=new Proxy(e.attrs,eg))},get slots(){return n||(n=QV(e))},get emit(){return(i,...a)=>e.emit(i,...a)},expose:t})}else return{attrs:new Proxy(e.attrs,eg),slots:e.slots,emit:e.emit,expose:t}}function Ku(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Jb(sP(e.exposed)),{get(t,r){if(r in t)return t[r];if(r in Fi)return Fi[r](e)},has(t,r){return r in t||r in Fi}})):e.proxy}const XV=/(?:^|[-_])(\w)/g,YV=e=>e.replace(XV,t=>t.toUpperCase()).replace(/[-_]/g,"");function Of(e,t=!0){return Be(e)?e.displayName||e.name:e.name||t&&e.__name}function Qu(e,t,r=!1){let n=Of(t);if(!n&&t.__file){const i=t.__file.match(/([^/\\]+)\.\w+$/);i&&(n=i[1])}if(!n&&e&&e.parent){const i=a=>{for(const o in a)if(a[o]===t)return o};n=i(e.components||e.parent.type.components)||i(e.appContext.components)}return n?YV(n):r?"App":"Anonymous"}function Px(e){return Be(e)&&"__vccOpts"in e}const yt=(e,t)=>{const r=cP(e,t,Wu);if(process.env.NODE_ENV!=="production"){const n=ri();n&&n.appContext.config.warnRecursiveComputed&&(r._warnRecursive=!0)}return r};function eU(e,t,r){const n=arguments.length;return n===2?lt(t)&&!Oe(t)?ti(t)?$t(e,null,[t]):$t(e,t):$t(e,null,t):(n>3?r=Array.prototype.slice.call(arguments,2):n===3&&ti(r)&&(r=[r]),$t(e,t,r))}function tU(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},r={style:"color:#f5222d"},n={style:"color:#eb2f96"},i={__vue_custom_formatter:!0,header(f){return lt(f)?f.__isVue?["div",e,"VueInstance"]:Lt(f)?["div",{},["span",e,s(f)],"<",u(f.value),">"]:ua(f)?["div",{},["span",e,Dn(f)?"ShallowReactive":"Reactive"],"<",u(f),`>${_n(f)?" (readonly)":""}`]:_n(f)?["div",{},["span",e,Dn(f)?"ShallowReadonly":"Readonly"],"<",u(f),">"]:null:null},hasBody(f){return f&&f.__isVue},body(f){if(f&&f.__isVue)return["div",{},...a(f.$)]}};function a(f){const p=[];f.type.props&&f.props&&p.push(o("props",Ye(f.props))),f.setupState!==vt&&p.push(o("setup",f.setupState)),f.data!==vt&&p.push(o("data",Ye(f.data)));const m=c(f,"computed");m&&p.push(o("computed",m));const d=c(f,"inject");return d&&p.push(o("injected",d)),p.push(["div",{},["span",{style:n.style+";opacity:0.66"},"$ (internal): "],["object",{object:f}]]),p}function o(f,p){return p=Et({},p),Object.keys(p).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},f],["div",{style:"padding-left:1.25em"},...Object.keys(p).map(m=>["div",{},["span",n,m+": "],u(p[m],!1)])]]:["span",{}]}function u(f,p=!0){return typeof f=="number"?["span",t,f]:typeof f=="string"?["span",r,JSON.stringify(f)]:typeof f=="boolean"?["span",n,f]:lt(f)?["object",{object:p?Ye(f):f}]:["span",r,String(f)]}function c(f,p){const m=f.type;if(Be(m))return;const d={};for(const h in f.ctx)l(m,h,p)&&(d[h]=f.ctx[h]);return d}function l(f,p,m){const d=f[m];if(Oe(d)&&d.includes(p)||lt(d)&&p in d||f.extends&&l(f.extends,p,m)||f.mixins&&f.mixins.some(h=>l(h,p,m)))return!0}function s(f){return Dn(f)?"ShallowRef":f.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(i):window.devtoolsFormatters=[i]}const tg="3.4.38",Zu=process.env.NODE_ENV!=="production"?Se:St;process.env.NODE_ENV;process.env.NODE_ENV;/**
|
|
98
98
|
* @vue/runtime-dom v3.4.38
|
|
99
99
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
100
100
|
* @license MIT
|
|
101
|
-
**/const
|
|
102
|
-
Expected function or array of functions, received type ${typeof e}.`),St)}function
|
|
101
|
+
**/const rU="http://www.w3.org/2000/svg",nU="http://www.w3.org/1998/Math/MathML",yn=typeof document<"u"?document:null,rg=yn&&yn.createElement("template"),iU={insert:(e,t,r)=>{t.insertBefore(e,r||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,r,n)=>{const i=t==="svg"?yn.createElementNS(rU,e):t==="mathml"?yn.createElementNS(nU,e):r?yn.createElement(e,{is:r}):yn.createElement(e);return e==="select"&&n&&n.multiple!=null&&i.setAttribute("multiple",n.multiple),i},createText:e=>yn.createTextNode(e),createComment:e=>yn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>yn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,r,n,i,a){const o=r?r.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),r),!(i===a||!(i=i.nextSibling)););else{rg.innerHTML=n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e;const u=rg.content;if(n==="svg"||n==="mathml"){const c=u.firstChild;for(;c.firstChild;)u.appendChild(c.firstChild);u.removeChild(c)}t.insertBefore(u,r)}return[o?o.nextSibling:t.firstChild,r?r.previousSibling:t.lastChild]}},jn="transition",Wa="animation",go=Symbol("_vtc"),Xu=(e,{slots:t})=>eU(qP,aU(e),t);Xu.displayName="Transition";const Vx={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};Xu.props=Et({},sx,Vx);const di=(e,t=[])=>{Oe(e)?e.forEach(r=>r(...t)):e&&e(...t)},ng=e=>e?Oe(e)?e.some(t=>t.length>1):e.length>1:!1;function aU(e){const t={};for(const _ in e)_ in Vx||(t[_]=e[_]);if(e.css===!1)return t;const{name:r="v",type:n,duration:i,enterFromClass:a=`${r}-enter-from`,enterActiveClass:o=`${r}-enter-active`,enterToClass:u=`${r}-enter-to`,appearFromClass:c=a,appearActiveClass:l=o,appearToClass:s=u,leaveFromClass:f=`${r}-leave-from`,leaveActiveClass:p=`${r}-leave-active`,leaveToClass:m=`${r}-leave-to`}=e,d=oU(i),h=d&&d[0],w=d&&d[1],{onBeforeEnter:v,onEnter:x,onEnterCancelled:g,onLeave:b,onLeaveCancelled:y,onBeforeAppear:N=v,onAppear:E=x,onAppearCancelled:A=g}=t,D=(_,R,P)=>{hi(_,R?s:u),hi(_,R?l:o),P&&P()},S=(_,R)=>{_._isLeaving=!1,hi(_,f),hi(_,m),hi(_,p),R&&R()},C=_=>(R,P)=>{const I=_?E:x,O=()=>D(R,_,P);di(I,[R,O]),ig(()=>{hi(R,_?c:a),Ln(R,_?s:u),ng(I)||ag(R,n,h,O)})};return Et(t,{onBeforeEnter(_){di(v,[_]),Ln(_,a),Ln(_,o)},onBeforeAppear(_){di(N,[_]),Ln(_,c),Ln(_,l)},onEnter:C(!1),onAppear:C(!0),onLeave(_,R){_._isLeaving=!0;const P=()=>S(_,R);Ln(_,f),Ln(_,p),cU(),ig(()=>{_._isLeaving&&(hi(_,f),Ln(_,m),ng(b)||ag(_,n,w,P))}),di(b,[_,P])},onEnterCancelled(_){D(_,!1),di(g,[_])},onAppearCancelled(_){D(_,!0),di(A,[_])},onLeaveCancelled(_){S(_),di(y,[_])}})}function oU(e){if(e==null)return null;if(lt(e))return[Sc(e.enter),Sc(e.leave)];{const t=Sc(e);return[t,t]}}function Sc(e){const t=OL(e);return process.env.NODE_ENV!=="production"&&vP(t,"<transition> explicit duration"),t}function Ln(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.add(r)),(e[go]||(e[go]=new Set)).add(t)}function hi(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.remove(n));const r=e[go];r&&(r.delete(t),r.size||(e[go]=void 0))}function ig(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let sU=0;function ag(e,t,r,n){const i=e._endId=++sU,a=()=>{i===e._endId&&n()};if(r)return setTimeout(a,r);const{type:o,timeout:u,propCount:c}=uU(e,t);if(!o)return n();const l=o+"end";let s=0;const f=()=>{e.removeEventListener(l,p),a()},p=m=>{m.target===e&&++s>=c&&f()};setTimeout(()=>{s<c&&f()},u+1),e.addEventListener(l,p)}function uU(e,t){const r=window.getComputedStyle(e),n=d=>(r[d]||"").split(", "),i=n(`${jn}Delay`),a=n(`${jn}Duration`),o=og(i,a),u=n(`${Wa}Delay`),c=n(`${Wa}Duration`),l=og(u,c);let s=null,f=0,p=0;t===jn?o>0&&(s=jn,f=o,p=a.length):t===Wa?l>0&&(s=Wa,f=l,p=c.length):(f=Math.max(o,l),s=f>0?o>l?jn:Wa:null,p=s?s===jn?a.length:c.length:0);const m=s===jn&&/\b(transform|all)(,|$)/.test(n(`${jn}Property`).toString());return{type:s,timeout:f,propCount:p,hasTransform:m}}function og(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((r,n)=>sg(r)+sg(e[n])))}function sg(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function cU(){return document.body.offsetHeight}function lU(e,t,r){const n=e[go];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):r?e.setAttribute("class",t):e.className=t}const cu=Symbol("_vod"),Ux=Symbol("_vsh"),Bf={beforeMount(e,{value:t},{transition:r}){e[cu]=e.style.display==="none"?"":e.style.display,r&&t?r.beforeEnter(e):Ka(e,t)},mounted(e,{value:t},{transition:r}){r&&t&&r.enter(e)},updated(e,{value:t,oldValue:r},{transition:n}){!t!=!r&&(n?t?(n.beforeEnter(e),Ka(e,!0),n.enter(e)):n.leave(e,()=>{Ka(e,!1)}):Ka(e,t))},beforeUnmount(e,{value:t}){Ka(e,t)}};process.env.NODE_ENV!=="production"&&(Bf.name="show");function Ka(e,t){e.style.display=t?e[cu]:"none",e[Ux]=!t}const fU=Symbol(process.env.NODE_ENV!=="production"?"CSS_VAR_TEXT":""),pU=/(^|;)\s*display\s*:/;function mU(e,t,r){const n=e.style,i=xt(r);let a=!1;if(r&&!i){if(t)if(xt(t))for(const o of t.split(";")){const u=o.slice(0,o.indexOf(":")).trim();r[u]==null&&Cs(n,u,"")}else for(const o in t)r[o]==null&&Cs(n,o,"");for(const o in r)o==="display"&&(a=!0),Cs(n,o,r[o])}else if(i){if(t!==r){const o=n[fU];o&&(r+=";"+o),n.cssText=r,a=pU.test(r)}}else t&&e.removeAttribute("style");cu in e&&(e[cu]=a?n.display:"",e[Ux]&&(n.display="none"))}const dU=/[^\\];\s*$/,ug=/\s*!important$/;function Cs(e,t,r){if(Oe(r))r.forEach(n=>Cs(e,t,n));else if(r==null&&(r=""),process.env.NODE_ENV!=="production"&&dU.test(r)&&Zu(`Unexpected semicolon at the end of '${t}' style value: '${r}'`),t.startsWith("--"))e.setProperty(t,r);else{const n=hU(e,t);ug.test(r)?e.setProperty(Cn(n),r.replace(ug,""),"important"):e[n]=r}}const cg=["Webkit","Moz","ms"],Cc={};function hU(e,t){const r=Cc[t];if(r)return r;let n=wr(t);if(n!=="filter"&&n in e)return Cc[t]=n;n=ki(n);for(let i=0;i<cg.length;i++){const a=cg[i]+n;if(a in e)return Cc[t]=a}return t}const lg="http://www.w3.org/1999/xlink";function fg(e,t,r,n,i,a=zL(t)){n&&t.startsWith("xlink:")?r==null?e.removeAttributeNS(lg,t.slice(6,t.length)):e.setAttributeNS(lg,t,r):r==null||a&&!Ab(r)?e.removeAttribute(t):e.setAttribute(t,a?"":fi(r)?String(r):r)}function gU(e,t,r,n){if(t==="innerHTML"||t==="textContent"){if(r==null)return;e[t]=r;return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const o=i==="OPTION"?e.getAttribute("value")||"":e.value,u=r==null?"":String(r);(o!==u||!("_value"in e))&&(e.value=u),r==null&&e.removeAttribute(t),e._value=r;return}let a=!1;if(r===""||r==null){const o=typeof e[t];o==="boolean"?r=Ab(r):r==null&&o==="string"?(r="",a=!0):o==="number"&&(r=0,a=!0)}try{e[t]=r}catch(o){process.env.NODE_ENV!=="production"&&!a&&Zu(`Failed setting prop "${t}" on <${i.toLowerCase()}>: value ${r} is invalid.`,o)}a&&e.removeAttribute(t)}function vU(e,t,r,n){e.addEventListener(t,r,n)}function yU(e,t,r,n){e.removeEventListener(t,r,n)}const pg=Symbol("_vei");function bU(e,t,r,n,i=null){const a=e[pg]||(e[pg]={}),o=a[t];if(n&&o)o.value=process.env.NODE_ENV!=="production"?dg(n,t):n;else{const[u,c]=xU(t);if(n){const l=a[t]=DU(process.env.NODE_ENV!=="production"?dg(n,t):n,i);vU(e,u,l,c)}else o&&(yU(e,u,o,c),a[t]=void 0)}}const mg=/(?:Once|Passive|Capture)$/;function xU(e){let t;if(mg.test(e)){t={};let r;for(;r=e.match(mg);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Cn(e.slice(2)),t]}let Mc=0;const wU=Promise.resolve(),NU=()=>Mc||(wU.then(()=>Mc=0),Mc=Date.now());function DU(e,t){const r=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=r.attached)return;_r(EU(n,r.value),t,5,[n])};return r.value=e,r.attached=NU(),r}function dg(e,t){return Be(e)||Oe(e)?e:(Zu(`Wrong type passed as event handler to ${t} - did you forget @ or : in front of your prop?
|
|
102
|
+
Expected function or array of functions, received type ${typeof e}.`),St)}function EU(e,t){if(Oe(t)){const r=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{r.call(e),e._stopped=!0},t.map(n=>i=>!i._stopped&&n&&n(i))}else return t}const hg=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,AU=(e,t,r,n,i,a)=>{const o=i==="svg";t==="class"?lU(e,n,o):t==="style"?mU(e,r,n):Bo(t)?eu(t)||bU(e,t,r,n,a):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):SU(e,t,n,o))?(gU(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&fg(e,t,n,o,a,t!=="value")):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),fg(e,t,n,o))};function SU(e,t,r,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&hg(t)&&Be(r));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return hg(t)&&xt(r)?!1:t in e}const CU=["ctrl","shift","alt","meta"],MU={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>CU.some(r=>e[`${r}Key`]&&!t.includes(r))},_U=(e,t)=>{const r=e._withMods||(e._withMods={}),n=t.join(".");return r[n]||(r[n]=(i,...a)=>{for(let o=0;o<t.length;o++){const u=MU[t[o]];if(u&&u(i,t))return}return e(i,...a)})},FU=Et({patchProp:AU},iU);let gg;function TU(){return gg||(gg=EV(FU))}const vg=(...e)=>{TU().render(...e)};/**
|
|
103
103
|
* vue v3.4.38
|
|
104
104
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
105
105
|
* @license MIT
|
|
106
|
-
**/function FU(){YV()}process.env.NODE_ENV!=="production"&&FU();var vg;const ja=typeof window<"u",TU=e=>typeof e=="string",OU=()=>{};ja&&(vg=window==null?void 0:window.navigator)!=null&&vg.userAgent&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Bf(e){return typeof e=="function"?e():et(e)}function BU(e){return e}function kf(e){return Cx()?(jL(e),!0):!1}function kU(e,t=!0){ri()?Hu(e):t?e():Wx(e)}function IU(e,t,r={}){const{immediate:n=!0}=r,i=Ur(!1);let a=null;function o(){a&&(clearTimeout(a),a=null)}function u(){i.value=!1,o()}function c(...l){o(),i.value=!0,a=setTimeout(()=>{i.value=!1,a=null,e(...l)},Bf(t))}return n&&(i.value=!0,ja&&c()),kf(u),{isPending:xf(i),start:c,stop:u}}function Ub(e){var t;const r=Bf(e);return(t=r==null?void 0:r.$el)!=null?t:r}const $b=ja?window:void 0;function RU(...e){let t,r,n,i;if(TU(e[0])||Array.isArray(e[0])?([r,n,i]=e,t=$b):[t,r,n,i]=e,!t)return OU;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const a=[],o=()=>{a.forEach(s=>s()),a.length=0},u=(s,f,p,m)=>(s.addEventListener(f,p,m),()=>s.removeEventListener(f,p,m)),c=la(()=>[Ub(t),Bf(i)],([s,f])=>{o(),s&&a.push(...r.flatMap(p=>n.map(m=>u(s,p,m,f))))},{immediate:!0,flush:"post"}),l=()=>{c(),o()};return kf(l),l}function qU(e,t=!1){const r=Ur(),n=()=>r.value=!!e();return n(),kU(n,t),r}const yg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},xg="__vueuse_ssr_handlers__";yg[xg]=yg[xg]||{};var bg=Object.getOwnPropertySymbols,zU=Object.prototype.hasOwnProperty,jU=Object.prototype.propertyIsEnumerable,LU=(e,t)=>{var r={};for(var n in e)zU.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&bg)for(var n of bg(e))t.indexOf(n)<0&&jU.call(e,n)&&(r[n]=e[n]);return r};function PU(e,t,r={}){const n=r,{window:i=$b}=n,a=LU(n,["window"]);let o;const u=qU(()=>i&&"ResizeObserver"in i),c=()=>{o&&(o.disconnect(),o=void 0)},l=la(()=>Ub(e),f=>{c(),u.value&&i&&f&&(o=new ResizeObserver(t),o.observe(f,a))},{immediate:!0,flush:"post"}),s=()=>{c(),l()};return kf(s),{isSupported:u,stop:s}}var wg;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(wg||(wg={}));var VU=Object.defineProperty,Ng=Object.getOwnPropertySymbols,UU=Object.prototype.hasOwnProperty,$U=Object.prototype.propertyIsEnumerable,Dg=(e,t,r)=>t in e?VU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,HU=(e,t)=>{for(var r in t||(t={}))UU.call(t,r)&&Dg(e,r,t[r]);if(Ng)for(var r of Ng(t))$U.call(t,r)&&Dg(e,r,t[r]);return e};const JU={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};HU({linear:BU},JU);var GU=typeof global=="object"&&global&&global.Object===Object&&global,WU=typeof self=="object"&&self&&self.Object===Object&&self,If=GU||WU||Function("return this")(),xa=If.Symbol,Hb=Object.prototype,KU=Hb.hasOwnProperty,QU=Hb.toString,Ka=xa?xa.toStringTag:void 0;function ZU(e){var t=KU.call(e,Ka),r=e[Ka];try{e[Ka]=void 0;var n=!0}catch{}var i=QU.call(e);return n&&(t?e[Ka]=r:delete e[Ka]),i}var XU=Object.prototype,YU=XU.toString;function e$(e){return YU.call(e)}var t$="[object Null]",r$="[object Undefined]",Eg=xa?xa.toStringTag:void 0;function Jb(e){return e==null?e===void 0?r$:t$:Eg&&Eg in Object(e)?ZU(e):e$(e)}function n$(e){return e!=null&&typeof e=="object"}var i$="[object Symbol]";function Rf(e){return typeof e=="symbol"||n$(e)&&Jb(e)==i$}function a$(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var qf=Array.isArray,o$=1/0,Ag=xa?xa.prototype:void 0,Sg=Ag?Ag.toString:void 0;function Gb(e){if(typeof e=="string")return e;if(qf(e))return a$(e,Gb)+"";if(Rf(e))return Sg?Sg.call(e):"";var t=e+"";return t=="0"&&1/e==-o$?"-0":t}function Wb(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var s$="[object AsyncFunction]",u$="[object Function]",c$="[object GeneratorFunction]",l$="[object Proxy]";function f$(e){if(!Wb(e))return!1;var t=Jb(e);return t==u$||t==c$||t==s$||t==l$}var Mc=If["__core-js_shared__"],Cg=function(){var e=/[^.]+$/.exec(Mc&&Mc.keys&&Mc.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function p$(e){return!!Cg&&Cg in e}var m$=Function.prototype,d$=m$.toString;function h$(e){if(e!=null){try{return d$.call(e)}catch{}try{return e+""}catch{}}return""}var g$=/[\\^$.*+?()[\]{}|]/g,v$=/^\[object .+?Constructor\]$/,y$=Function.prototype,x$=Object.prototype,b$=y$.toString,w$=x$.hasOwnProperty,N$=RegExp("^"+b$.call(w$).replace(g$,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function D$(e){if(!Wb(e)||p$(e))return!1;var t=f$(e)?N$:v$;return t.test(h$(e))}function E$(e,t){return e==null?void 0:e[t]}function Kb(e,t){var r=E$(e,t);return D$(r)?r:void 0}function A$(e,t){return e===t||e!==e&&t!==t}var S$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,C$=/^\w*$/;function M$(e,t){if(qf(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Rf(e)?!0:C$.test(e)||!S$.test(e)||t!=null&&e in Object(t)}var go=Kb(Object,"create");function _$(){this.__data__=go?go(null):{},this.size=0}function F$(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var T$="__lodash_hash_undefined__",O$=Object.prototype,B$=O$.hasOwnProperty;function k$(e){var t=this.__data__;if(go){var r=t[e];return r===T$?void 0:r}return B$.call(t,e)?t[e]:void 0}var I$=Object.prototype,R$=I$.hasOwnProperty;function q$(e){var t=this.__data__;return go?t[e]!==void 0:R$.call(t,e)}var z$="__lodash_hash_undefined__";function j$(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=go&&t===void 0?z$:t,this}function Ri(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ri.prototype.clear=_$;Ri.prototype.delete=F$;Ri.prototype.get=k$;Ri.prototype.has=q$;Ri.prototype.set=j$;function L$(){this.__data__=[],this.size=0}function Xu(e,t){for(var r=e.length;r--;)if(A$(e[r][0],t))return r;return-1}var P$=Array.prototype,V$=P$.splice;function U$(e){var t=this.__data__,r=Xu(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():V$.call(t,r,1),--this.size,!0}function $$(e){var t=this.__data__,r=Xu(t,e);return r<0?void 0:t[r][1]}function H$(e){return Xu(this.__data__,e)>-1}function J$(e,t){var r=this.__data__,n=Xu(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function La(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}La.prototype.clear=L$;La.prototype.delete=U$;La.prototype.get=$$;La.prototype.has=H$;La.prototype.set=J$;var G$=Kb(If,"Map");function W$(){this.size=0,this.__data__={hash:new Ri,map:new(G$||La),string:new Ri}}function K$(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Yu(e,t){var r=e.__data__;return K$(t)?r[typeof t=="string"?"string":"hash"]:r.map}function Q$(e){var t=Yu(this,e).delete(e);return this.size-=t?1:0,t}function Z$(e){return Yu(this,e).get(e)}function X$(e){return Yu(this,e).has(e)}function Y$(e,t){var r=Yu(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function Ki(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ki.prototype.clear=W$;Ki.prototype.delete=Q$;Ki.prototype.get=Z$;Ki.prototype.has=X$;Ki.prototype.set=Y$;var eH="Expected a function";function zf(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(eH);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(zf.Cache||Ki),r}zf.Cache=Ki;var tH=500;function rH(e){var t=zf(e,function(n){return r.size===tH&&r.clear(),n}),r=t.cache;return t}var nH=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,iH=/\\(\\)?/g,aH=rH(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(nH,function(r,n,i,a){t.push(i?a.replace(iH,"$1"):n||r)}),t});function oH(e){return e==null?"":Gb(e)}function sH(e,t){return qf(e)?e:M$(e,t)?[e]:aH(oH(e))}var uH=1/0;function cH(e){if(typeof e=="string"||Rf(e))return e;var t=e+"";return t=="0"&&1/e==-uH?"-0":t}function lH(e,t){t=sH(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[cH(t[r++])];return r&&r==n?e:void 0}function fH(e,t,r){var n=e==null?void 0:lH(e,t);return n===void 0?r:n}function pH(e){for(var t=-1,r=e==null?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n}const mH=e=>e===void 0,vo=e=>typeof e=="number",dH=e=>typeof Element>"u"?!1:e instanceof Element,hH=e=>bt(e)?!Number.isNaN(Number(e)):!1,Mg=e=>Object.keys(e);class gH extends Error{constructor(t){super(t),this.name="ElementPlusError"}}function ec(e,t){if(process.env.NODE_ENV!=="production"){const r=bt(e)?new gH(`[${e}] ${t}`):e;console.warn(r)}}const vH="utils/dom/style";function vl(e,t="px"){if(!e)return"";if(vo(e)||hH(e))return`${e}${t}`;if(bt(e))return e;ec(vH,"binding value must be a string or number")}/*! Element Plus Icons Vue v2.3.1 */var yH=Zr({name:"CircleCloseFilled",__name:"circle-close-filled",setup(e){return(t,r)=>(Kt(),Fn("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[sn("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}}),Qb=yH,xH=Zr({name:"Close",__name:"close",setup(e){return(t,r)=>(Kt(),Fn("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[sn("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),bH=xH,wH=Zr({name:"InfoFilled",__name:"info-filled",setup(e){return(t,r)=>(Kt(),Fn("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[sn("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.992 12.992 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}}),Zb=wH,NH=Zr({name:"SuccessFilled",__name:"success-filled",setup(e){return(t,r)=>(Kt(),Fn("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[sn("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.272 38.272 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}}),Xb=NH,DH=Zr({name:"WarningFilled",__name:"warning-filled",setup(e){return(t,r)=>(Kt(),Fn("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[sn("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}}),Yb=DH;const ew="__epPropKey",ba=e=>e,EH=e=>lt(e)&&!!e[ew],tw=(e,t)=>{if(!lt(e)||EH(e))return e;const{values:r,required:n,default:i,type:a,validator:o}=e,u={type:a,required:!!n,validator:r||o?c=>{let l=!1,s=[];if(r&&(s=Array.from(r),tt(e,"default")&&s.push(i),l||(l=s.includes(c))),o&&(l||(l=o(c))),!l&&s.length>0){const f=[...new Set(s)].map(p=>JSON.stringify(p)).join(", ");Qu(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${f}], got value ${JSON.stringify(c)}.`)}return l}:void 0,[ew]:!0};return tt(e,"default")&&(u.default=i),u},tc=e=>pH(Object.entries(e).map(([t,r])=>[t,tw(r,t)])),AH=ba([String,Object,Function]),SH={Close:bH,SuccessFilled:Xb,InfoFilled:Zb,WarningFilled:Yb,CircleCloseFilled:Qb},_g={success:Xb,warning:Yb,error:Qb,info:Zb},rw=(e,t)=>(e.install=r=>{for(const n of[e,...Object.values({})])r.component(n.name,n)},e),CH=(e,t)=>(e.install=r=>{e._context=r._context,r.config.globalProperties[t]=e},e),MH={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},_H=["","default","small","large"],FH=e=>e;var TH={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const OH=e=>(t,r)=>BH(t,r,et(e)),BH=(e,t,r)=>fH(r,e,e).replace(/\{(\w+)\}/g,(n,i)=>{var a;return`${(a=t==null?void 0:t[i])!=null?a:`{${i}}`}`}),kH=e=>{const t=yt(()=>et(e).name),r=Lt(e)?e:Ur(e);return{lang:t,locale:r,t:OH(e)}},nw=Symbol("localeContextKey"),IH=e=>{const t=e||an(nw,Ur());return kH(yt(()=>t.value||TH))},Cs="el",RH="is-",gi=(e,t,r,n,i)=>{let a=`${e}-${t}`;return r&&(a+=`-${r}`),n&&(a+=`__${n}`),i&&(a+=`--${i}`),a},iw=Symbol("namespaceContextKey"),qH=e=>{const t=e||(ri()?an(iw,Ur(Cs)):Ur(Cs));return yt(()=>et(t)||Cs)},jf=(e,t)=>{const r=qH(t);return{namespace:r,b:(n="")=>gi(r.value,e,n,"",""),e:n=>n?gi(r.value,e,"",n,""):"",m:n=>n?gi(r.value,e,"","",n):"",be:(n,i)=>n&&i?gi(r.value,e,n,i,""):"",em:(n,i)=>n&&i?gi(r.value,e,"",n,i):"",bm:(n,i)=>n&&i?gi(r.value,e,n,"",i):"",bem:(n,i,a)=>n&&i&&a?gi(r.value,e,n,i,a):"",is:(n,...i)=>{const a=i.length>=1?i[0]:!0;return n&&a?`${RH}${n}`:""},cssVar:n=>{const i={};for(const a in n)n[a]&&(i[`--${r.value}-${a}`]=n[a]);return i},cssVarName:n=>`--${r.value}-${n}`,cssVarBlock:n=>{const i={};for(const a in n)n[a]&&(i[`--${r.value}-${e}-${a}`]=n[a]);return i},cssVarBlockName:n=>`--${r.value}-${e}-${n}`}},Fg={current:0},Tg=Ur(0),aw=2e3,Og=Symbol("elZIndexContextKey"),ow=Symbol("zIndexContextKey"),zH=e=>{const t=ri()?an(Og,Fg):Fg,r=e||(ri()?an(ow,void 0):void 0),n=yt(()=>{const o=et(r);return vo(o)?o:aw}),i=yt(()=>n.value+Tg.value),a=()=>(t.current++,Tg.value=t.current,i.value);return!ja&&!an(Og)&&ec("ZIndexInjection",`Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
|
|
107
|
-
usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:n,currentZIndex:i,nextZIndex:a}};tw({type:String,values:_H,required:!1});const jH=Symbol("size"),LH=Symbol("emptyValuesContextKey");tc({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:e=>Be(e)?!e():!e}});const sw=Symbol(),cu=Ur();function uw(e,t=void 0){return ri()?an(sw,cu):cu}function PH(e,t){const r=uw(),n=jf(e,yt(()=>{var u;return((u=r.value)==null?void 0:u.namespace)||Cs})),i=IH(yt(()=>{var u;return(u=r.value)==null?void 0:u.locale})),a=zH(yt(()=>{var u;return((u=r.value)==null?void 0:u.zIndex)||aw})),o=yt(()=>{var u;return et(t)||((u=r.value)==null?void 0:u.size)||""});return VH(yt(()=>et(r)||{})),{ns:n,locale:i,zIndex:a,size:o}}const VH=(e,t,r=!1)=>{var n;const i=!!ri(),a=i?uw():void 0,o=(n=void 0)!=null?n:i?yb:void 0;if(!o){ec("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const u=yt(()=>{const c=et(e);return a!=null&&a.value?UH(a.value,c):c});return o(sw,u),o(nw,yt(()=>u.value.locale)),o(iw,yt(()=>u.value.namespace)),o(ow,yt(()=>u.value.zIndex)),o(jH,{size:yt(()=>u.value.size||"")}),o(LH,yt(()=>({emptyValues:u.value.emptyValues,valueOnClear:u.value.valueOnClear}))),(r||!cu.value)&&(cu.value=u.value),u},UH=(e,t)=>{const r=[...new Set([...Mg(e),...Mg(t)])],n={};for(const i of r)n[i]=t[i]!==void 0?t[i]:e[i];return n},Bg={};var Lf=(e,t)=>{const r=e.__vccOpts||e;for(const[n,i]of t)r[n]=i;return r};const $H=tc({size:{type:ba([Number,String])},color:{type:String}}),HH=Zr({name:"ElIcon",inheritAttrs:!1}),JH=Zr({...HH,props:$H,setup(e){const t=e,r=jf("icon"),n=yt(()=>{const{size:i,color:a}=t;return!i&&!a?{}:{fontSize:mH(i)?void 0:vl(i),"--color":a}});return(i,a)=>(Kt(),Fn("i",qb({class:et(r).b(),style:et(n)},i.$attrs),[Af(i.$slots,"default")],16))}});var GH=Lf(JH,[["__file","icon.vue"]]);const kg=rw(GH),WH=tc({value:{type:[String,Number],default:""},max:{type:Number,default:99},isDot:Boolean,hidden:Boolean,type:{type:String,values:["primary","success","warning","info","danger"],default:"danger"},showZero:{type:Boolean,default:!0},color:String,badgeStyle:{type:ba([String,Object,Array])},offset:{type:ba(Array),default:[0,0]},badgeClass:{type:String}}),KH=Zr({name:"ElBadge"}),QH=Zr({...KH,props:WH,setup(e,{expose:t}){const r=e,n=jf("badge"),i=yt(()=>r.isDot?"":vo(r.value)&&vo(r.max)?r.max<r.value?`${r.max}+`:r.value===0&&!r.showZero?"":`${r.value}`:`${r.value}`),a=yt(()=>{var o,u,c,l,s;return[{backgroundColor:r.color,marginRight:vl(-((u=(o=r.offset)==null?void 0:o[0])!=null?u:0)),marginTop:vl((l=(c=r.offset)==null?void 0:c[1])!=null?l:0)},(s=r.badgeStyle)!=null?s:{}]});return t({content:i}),(o,u)=>(Kt(),Fn("div",{class:Rr(et(n).b())},[Af(o.$slots,"default"),$t(Zu,{name:`${et(n).namespace.value}-zoom-in-center`,persisted:""},{default:to(()=>[ab(sn("sup",{class:Rr([et(n).e("content"),et(n).em("content",o.type),et(n).is("fixed",!!o.$slots.default),et(n).is("dot",o.isDot),o.badgeClass]),style:Bo(et(a)),textContent:mf(et(i))},null,14,["textContent"]),[[Of,!o.hidden&&(et(i)||o.isDot)]])]),_:1},8,["name"])],2))}});var ZH=Lf(QH,[["__file","badge.vue"]]);const XH=rw(ZH),cw=["success","info","warning","error"],Wt=FH({customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:ja?document.body:void 0}),YH=tc({customClass:{type:String,default:Wt.customClass},center:{type:Boolean,default:Wt.center},dangerouslyUseHTMLString:{type:Boolean,default:Wt.dangerouslyUseHTMLString},duration:{type:Number,default:Wt.duration},icon:{type:AH,default:Wt.icon},id:{type:String,default:Wt.id},message:{type:ba([String,Object,Function]),default:Wt.message},onClose:{type:ba(Function),default:Wt.onClose},showClose:{type:Boolean,default:Wt.showClose},type:{type:String,values:cw,default:Wt.type},plain:{type:Boolean,default:Wt.plain},offset:{type:Number,default:Wt.offset},zIndex:{type:Number,default:Wt.zIndex},grouping:{type:Boolean,default:Wt.grouping},repeatNum:{type:Number,default:Wt.repeatNum}}),eJ={destroy:()=>!0},jr=Vx([]),tJ=e=>{const t=jr.findIndex(i=>i.id===e),r=jr[t];let n;return t>0&&(n=jr[t-1]),{current:r,prev:n}},rJ=e=>{const{prev:t}=tJ(e);return t?t.vm.exposed.bottom.value:0},nJ=(e,t)=>jr.findIndex(r=>r.id===e)>0?16:t,iJ=Zr({name:"ElMessage"}),aJ=Zr({...iJ,props:YH,emits:eJ,setup(e,{expose:t}){const r=e,{Close:n}=SH,{ns:i,zIndex:a}=PH("message"),{currentZIndex:o,nextZIndex:u}=a,c=Ur(),l=Ur(!1),s=Ur(0);let f;const p=yt(()=>r.type?r.type==="error"?"danger":r.type:"info"),m=yt(()=>{const E=r.type;return{[i.bm("icon",E)]:E&&_g[E]}}),d=yt(()=>r.icon||_g[r.type]||""),h=yt(()=>rJ(r.id)),w=yt(()=>nJ(r.id,r.offset)+h.value),v=yt(()=>s.value+w.value),b=yt(()=>({top:`${w.value}px`,zIndex:o.value}));function g(){r.duration!==0&&({stop:f}=IU(()=>{y()},r.duration))}function x(){f==null||f()}function y(){l.value=!1}function N({code:E}){E===MH.esc&&y()}return Hu(()=>{g(),u(),l.value=!0}),la(()=>r.repeatNum,()=>{x(),g()}),RU(document,"keydown",N),PU(c,()=>{s.value=c.value.getBoundingClientRect().height}),t({visible:l,bottom:v,close:y}),(E,A)=>(Kt(),xi(Zu,{name:et(i).b("fade"),onBeforeLeave:E.onClose,onAfterLeave:D=>E.$emit("destroy"),persisted:""},{default:to(()=>[ab(sn("div",{id:E.id,ref_key:"messageRef",ref:c,class:Rr([et(i).b(),{[et(i).m(E.type)]:E.type},et(i).is("center",E.center),et(i).is("closable",E.showClose),et(i).is("plain",E.plain),E.customClass]),style:Bo(et(b)),role:"alert",onMouseenter:x,onMouseleave:g},[E.repeatNum>1?(Kt(),xi(et(XH),{key:0,value:E.repeatNum,type:et(p),class:Rr(et(i).e("badge"))},null,8,["value","type","class"])):ds("v-if",!0),et(d)?(Kt(),xi(et(kg),{key:1,class:Rr([et(i).e("icon"),et(m)])},{default:to(()=>[(Kt(),xi(GP(et(d))))]),_:1},8,["class"])):ds("v-if",!0),Af(E.$slots,"default",{},()=>[E.dangerouslyUseHTMLString?(Kt(),Fn(mr,{key:1},[ds(" Caution here, message could've been compromised, never use user's input as message "),sn("p",{class:Rr(et(i).e("content")),innerHTML:E.message},null,10,["innerHTML"])],2112)):(Kt(),Fn("p",{key:0,class:Rr(et(i).e("content"))},mf(E.message),3))]),E.showClose?(Kt(),xi(et(kg),{key:2,class:Rr(et(i).e("closeBtn")),onClick:CU(y,["stop"])},{default:to(()=>[$t(et(n))]),_:1},8,["class","onClick"])):ds("v-if",!0)],46,["id"]),[[Of,l.value]])]),_:3},8,["name","onBeforeLeave","onAfterLeave"]))}});var oJ=Lf(aJ,[["__file","message.vue"]]);let sJ=1;const lw=e=>{const t=!e||bt(e)||ti(e)||Be(e)?{message:e}:e,r={...Wt,...t};if(!r.appendTo)r.appendTo=document.body;else if(bt(r.appendTo)){let n=document.querySelector(r.appendTo);dH(n)||(ec("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),n=document.body),r.appendTo=n}return r},uJ=e=>{const t=jr.indexOf(e);if(t===-1)return;jr.splice(t,1);const{handler:r}=e;r.close()},cJ=({appendTo:e,...t},r)=>{const n=`message_${sJ++}`,i=t.onClose,a=document.createElement("div"),o={...t,id:n,onClose:()=>{i==null||i(),uJ(l)},onDestroy:()=>{gg(null,a)}},u=$t(oJ,o,Be(o.message)||ti(o.message)?{default:Be(o.message)?o.message:()=>o.message}:null);u.appContext=r||wa._context,gg(u,a),e.appendChild(a.firstElementChild);const c=u.component,l={id:n,vnode:u,vm:c,handler:{close:()=>{c.exposed.visible.value=!1}},props:u.component.props};return l},wa=(e={},t)=>{if(!ja)return{close:()=>{}};if(vo(Bg.max)&&jr.length>=Bg.max)return{close:()=>{}};const r=lw(e);if(r.grouping&&jr.length){const i=jr.find(({vnode:a})=>{var o;return((o=a.props)==null?void 0:o.message)===r.message});if(i)return i.props.repeatNum+=1,i.props.type=r.type,i.handler}const n=cJ(r,t);return jr.push(n),n.handler};cw.forEach(e=>{wa[e]=(t={},r)=>{const n=lw(t);return wa({...n,type:e},r)}});function lJ(e){for(const t of jr)(!e||e===t.props.type)&&t.handler.close()}wa.closeAll=lJ;wa._context=null;CH(wa,"$message");const hs=(e,t)=>{let r=J1(ir(t[0]));for(let n=1;n<t.length;n++){let i=Number(t[n]);i.toString()==="NaN"&&(i=0),r=r[e](ir(i))}return parseFloat(r.done())},Ig=e=>e==null||e==="",fJ={round:(e,t=2)=>Ig(e)?"-":tn(Number(e),t),add:function(...e){return hs("add",e)},subtract:function(...e){return hs("subtract",e)},multiply:function(...e){return hs("multiply",e)},divide:function(...e){return hs("divide",e)},formatValue:(e,t=2)=>{if(Ig(e))return"-";const r=Number(e);return r>=1e8||r<=-1e8?`${tn(r/1e8,t)}亿`:r>=1e4||r<=-1e4?`${tn(r/1e4,t)}万`:tn(r,t)}};`${new Date().getTime()}${Math.floor(Math.random()*1e9)}`;const pJ=e=>{e?Rg("token",e):console.error("token不能为空")},mJ=e=>{e?Rg("userData",e):console.error("用户数据不能为空")},fw=()=>qg("token"),pw=()=>qg("userData"),dJ=()=>!!fw(),hJ=()=>{const e=pw();return(e==null?void 0:e.username)==="admin"},mw=(e="")=>location.href=`${location.origin}/login/index.html?url=${encodeURIComponent(e||location.href)}`,gJ=(e=!0,t)=>{if(Vf("token"),Vf("userData"),e){mw();return}t&&(location.href=t)},vJ=Object.freeze(Object.defineProperty({__proto__:null,getToken:fw,getUserData:pw,isAdmin:hJ,isLogin:dJ,login:mw,loginout:gJ,setToken:pJ,setUserData:mJ},Symbol.toStringTag,{value:"Module"})),yJ=fJ,{setToken:DJ,setUserData:EJ,getToken:AJ,getUserData:xJ,isLogin:SJ,isAdmin:CJ,login:bJ,loginout:wJ}=vJ,NJ=(e,t=500,r=!1)=>{let n=null;return function(...i){if(clearTimeout(n),r){const a=!n;n=setTimeout(()=>{n=null},t),a&&e.apply(this,i)}else n=setTimeout(()=>{e.apply(this,i)},t)}};exports.A=bJ;exports.G=NJ;exports.K=wJ;exports.V=xJ;exports.x=yJ;
|
|
106
|
+
**/function OU(){tU()}process.env.NODE_ENV!=="production"&&OU();var yg;const La=typeof window<"u",BU=e=>typeof e=="string",kU=()=>{};La&&(yg=window==null?void 0:window.navigator)!=null&&yg.userAgent&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function kf(e){return typeof e=="function"?e():et(e)}function IU(e){return e}function If(e){return Mb()?(PL(e),!0):!1}function RU(e,t=!0){ri()?Ju(e):t?e():Kb(e)}function qU(e,t,r={}){const{immediate:n=!0}=r,i=Ur(!1);let a=null;function o(){a&&(clearTimeout(a),a=null)}function u(){i.value=!1,o()}function c(...l){o(),i.value=!0,a=setTimeout(()=>{i.value=!1,a=null,e(...l)},kf(t))}return n&&(i.value=!0,La&&c()),If(u),{isPending:xf(i),start:c,stop:u}}function $x(e){var t;const r=kf(e);return(t=r==null?void 0:r.$el)!=null?t:r}const Hx=La?window:void 0;function zU(...e){let t,r,n,i;if(BU(e[0])||Array.isArray(e[0])?([r,n,i]=e,t=Hx):[t,r,n,i]=e,!t)return kU;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const a=[],o=()=>{a.forEach(s=>s()),a.length=0},u=(s,f,p,m)=>(s.addEventListener(f,p,m),()=>s.removeEventListener(f,p,m)),c=fa(()=>[$x(t),kf(i)],([s,f])=>{o(),s&&a.push(...r.flatMap(p=>n.map(m=>u(s,p,m,f))))},{immediate:!0,flush:"post"}),l=()=>{c(),o()};return If(l),l}function jU(e,t=!1){const r=Ur(),n=()=>r.value=!!e();return n(),RU(n,t),r}const bg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},xg="__vueuse_ssr_handlers__";bg[xg]=bg[xg]||{};var wg=Object.getOwnPropertySymbols,LU=Object.prototype.hasOwnProperty,PU=Object.prototype.propertyIsEnumerable,VU=(e,t)=>{var r={};for(var n in e)LU.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&wg)for(var n of wg(e))t.indexOf(n)<0&&PU.call(e,n)&&(r[n]=e[n]);return r};function UU(e,t,r={}){const n=r,{window:i=Hx}=n,a=VU(n,["window"]);let o;const u=jU(()=>i&&"ResizeObserver"in i),c=()=>{o&&(o.disconnect(),o=void 0)},l=fa(()=>$x(e),f=>{c(),u.value&&i&&f&&(o=new ResizeObserver(t),o.observe(f,a))},{immediate:!0,flush:"post"}),s=()=>{c(),l()};return If(s),{isSupported:u,stop:s}}var Ng;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(Ng||(Ng={}));var $U=Object.defineProperty,Dg=Object.getOwnPropertySymbols,HU=Object.prototype.hasOwnProperty,JU=Object.prototype.propertyIsEnumerable,Eg=(e,t,r)=>t in e?$U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,GU=(e,t)=>{for(var r in t||(t={}))HU.call(t,r)&&Eg(e,r,t[r]);if(Dg)for(var r of Dg(t))JU.call(t,r)&&Eg(e,r,t[r]);return e};const WU={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};GU({linear:IU},WU);var KU=typeof global=="object"&&global&&global.Object===Object&&global,QU=typeof self=="object"&&self&&self.Object===Object&&self,Rf=KU||QU||Function("return this")(),xa=Rf.Symbol,Jx=Object.prototype,ZU=Jx.hasOwnProperty,XU=Jx.toString,Qa=xa?xa.toStringTag:void 0;function YU(e){var t=ZU.call(e,Qa),r=e[Qa];try{e[Qa]=void 0;var n=!0}catch{}var i=XU.call(e);return n&&(t?e[Qa]=r:delete e[Qa]),i}var e$=Object.prototype,t$=e$.toString;function r$(e){return t$.call(e)}var n$="[object Null]",i$="[object Undefined]",Ag=xa?xa.toStringTag:void 0;function Gx(e){return e==null?e===void 0?i$:n$:Ag&&Ag in Object(e)?YU(e):r$(e)}function a$(e){return e!=null&&typeof e=="object"}var o$="[object Symbol]";function qf(e){return typeof e=="symbol"||a$(e)&&Gx(e)==o$}function s$(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var zf=Array.isArray,u$=1/0,Sg=xa?xa.prototype:void 0,Cg=Sg?Sg.toString:void 0;function Wx(e){if(typeof e=="string")return e;if(zf(e))return s$(e,Wx)+"";if(qf(e))return Cg?Cg.call(e):"";var t=e+"";return t=="0"&&1/e==-u$?"-0":t}function Kx(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var c$="[object AsyncFunction]",l$="[object Function]",f$="[object GeneratorFunction]",p$="[object Proxy]";function m$(e){if(!Kx(e))return!1;var t=Gx(e);return t==l$||t==f$||t==c$||t==p$}var _c=Rf["__core-js_shared__"],Mg=function(){var e=/[^.]+$/.exec(_c&&_c.keys&&_c.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function d$(e){return!!Mg&&Mg in e}var h$=Function.prototype,g$=h$.toString;function v$(e){if(e!=null){try{return g$.call(e)}catch{}try{return e+""}catch{}}return""}var y$=/[\\^$.*+?()[\]{}|]/g,b$=/^\[object .+?Constructor\]$/,x$=Function.prototype,w$=Object.prototype,N$=x$.toString,D$=w$.hasOwnProperty,E$=RegExp("^"+N$.call(D$).replace(y$,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function A$(e){if(!Kx(e)||d$(e))return!1;var t=m$(e)?E$:b$;return t.test(v$(e))}function S$(e,t){return e==null?void 0:e[t]}function Qx(e,t){var r=S$(e,t);return A$(r)?r:void 0}function C$(e,t){return e===t||e!==e&&t!==t}var M$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_$=/^\w*$/;function F$(e,t){if(zf(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||qf(e)?!0:_$.test(e)||!M$.test(e)||t!=null&&e in Object(t)}var vo=Qx(Object,"create");function T$(){this.__data__=vo?vo(null):{},this.size=0}function O$(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var B$="__lodash_hash_undefined__",k$=Object.prototype,I$=k$.hasOwnProperty;function R$(e){var t=this.__data__;if(vo){var r=t[e];return r===B$?void 0:r}return I$.call(t,e)?t[e]:void 0}var q$=Object.prototype,z$=q$.hasOwnProperty;function j$(e){var t=this.__data__;return vo?t[e]!==void 0:z$.call(t,e)}var L$="__lodash_hash_undefined__";function P$(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=vo&&t===void 0?L$:t,this}function Ri(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ri.prototype.clear=T$;Ri.prototype.delete=O$;Ri.prototype.get=R$;Ri.prototype.has=j$;Ri.prototype.set=P$;function V$(){this.__data__=[],this.size=0}function Yu(e,t){for(var r=e.length;r--;)if(C$(e[r][0],t))return r;return-1}var U$=Array.prototype,$$=U$.splice;function H$(e){var t=this.__data__,r=Yu(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():$$.call(t,r,1),--this.size,!0}function J$(e){var t=this.__data__,r=Yu(t,e);return r<0?void 0:t[r][1]}function G$(e){return Yu(this.__data__,e)>-1}function W$(e,t){var r=this.__data__,n=Yu(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function Pa(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Pa.prototype.clear=V$;Pa.prototype.delete=H$;Pa.prototype.get=J$;Pa.prototype.has=G$;Pa.prototype.set=W$;var K$=Qx(Rf,"Map");function Q$(){this.size=0,this.__data__={hash:new Ri,map:new(K$||Pa),string:new Ri}}function Z$(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ec(e,t){var r=e.__data__;return Z$(t)?r[typeof t=="string"?"string":"hash"]:r.map}function X$(e){var t=ec(this,e).delete(e);return this.size-=t?1:0,t}function Y$(e){return ec(this,e).get(e)}function eH(e){return ec(this,e).has(e)}function tH(e,t){var r=ec(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function Ki(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ki.prototype.clear=Q$;Ki.prototype.delete=X$;Ki.prototype.get=Y$;Ki.prototype.has=eH;Ki.prototype.set=tH;var rH="Expected a function";function jf(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(rH);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(jf.Cache||Ki),r}jf.Cache=Ki;var nH=500;function iH(e){var t=jf(e,function(n){return r.size===nH&&r.clear(),n}),r=t.cache;return t}var aH=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oH=/\\(\\)?/g,sH=iH(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(aH,function(r,n,i,a){t.push(i?a.replace(oH,"$1"):n||r)}),t});function uH(e){return e==null?"":Wx(e)}function cH(e,t){return zf(e)?e:F$(e,t)?[e]:sH(uH(e))}var lH=1/0;function fH(e){if(typeof e=="string"||qf(e))return e;var t=e+"";return t=="0"&&1/e==-lH?"-0":t}function pH(e,t){t=cH(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[fH(t[r++])];return r&&r==n?e:void 0}function mH(e,t,r){var n=e==null?void 0:pH(e,t);return n===void 0?r:n}function dH(e){for(var t=-1,r=e==null?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n}const hH=e=>e===void 0,yo=e=>typeof e=="number",gH=e=>typeof Element>"u"?!1:e instanceof Element,vH=e=>xt(e)?!Number.isNaN(Number(e)):!1,_g=e=>Object.keys(e);class yH extends Error{constructor(t){super(t),this.name="ElementPlusError"}}function tc(e,t){if(process.env.NODE_ENV!=="production"){const r=xt(e)?new yH(`[${e}] ${t}`):e;console.warn(r)}}const bH="utils/dom/style";function yl(e,t="px"){if(!e)return"";if(yo(e)||vH(e))return`${e}${t}`;if(xt(e))return e;tc(bH,"binding value must be a string or number")}/*! Element Plus Icons Vue v2.3.1 */var xH=Zr({name:"CircleCloseFilled",__name:"circle-close-filled",setup(e){return(t,r)=>(Kt(),Fn("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[sn("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}}),Zx=xH,wH=Zr({name:"Close",__name:"close",setup(e){return(t,r)=>(Kt(),Fn("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[sn("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),NH=wH,DH=Zr({name:"InfoFilled",__name:"info-filled",setup(e){return(t,r)=>(Kt(),Fn("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[sn("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.992 12.992 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}}),Xx=DH,EH=Zr({name:"SuccessFilled",__name:"success-filled",setup(e){return(t,r)=>(Kt(),Fn("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[sn("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.272 38.272 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}}),Yx=EH,AH=Zr({name:"WarningFilled",__name:"warning-filled",setup(e){return(t,r)=>(Kt(),Fn("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[sn("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}}),ew=AH;const tw="__epPropKey",wa=e=>e,SH=e=>lt(e)&&!!e[tw],rw=(e,t)=>{if(!lt(e)||SH(e))return e;const{values:r,required:n,default:i,type:a,validator:o}=e,u={type:a,required:!!n,validator:r||o?c=>{let l=!1,s=[];if(r&&(s=Array.from(r),tt(e,"default")&&s.push(i),l||(l=s.includes(c))),o&&(l||(l=o(c))),!l&&s.length>0){const f=[...new Set(s)].map(p=>JSON.stringify(p)).join(", ");Zu(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${f}], got value ${JSON.stringify(c)}.`)}return l}:void 0,[tw]:!0};return tt(e,"default")&&(u.default=i),u},rc=e=>dH(Object.entries(e).map(([t,r])=>[t,rw(r,t)])),CH=wa([String,Object,Function]),MH={Close:NH,SuccessFilled:Yx,InfoFilled:Xx,WarningFilled:ew,CircleCloseFilled:Zx},Fg={success:Yx,warning:ew,error:Zx,info:Xx},nw=(e,t)=>(e.install=r=>{for(const n of[e,...Object.values({})])r.component(n.name,n)},e),_H=(e,t)=>(e.install=r=>{e._context=r._context,r.config.globalProperties[t]=e},e),FH={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},TH=["","default","small","large"],OH=e=>e;var BH={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const kH=e=>(t,r)=>IH(t,r,et(e)),IH=(e,t,r)=>mH(r,e,e).replace(/\{(\w+)\}/g,(n,i)=>{var a;return`${(a=t==null?void 0:t[i])!=null?a:`{${i}}`}`}),RH=e=>{const t=yt(()=>et(e).name),r=Lt(e)?e:Ur(e);return{lang:t,locale:r,t:kH(e)}},iw=Symbol("localeContextKey"),qH=e=>{const t=e||an(iw,Ur());return RH(yt(()=>t.value||BH))},Ms="el",zH="is-",gi=(e,t,r,n,i)=>{let a=`${e}-${t}`;return r&&(a+=`-${r}`),n&&(a+=`__${n}`),i&&(a+=`--${i}`),a},aw=Symbol("namespaceContextKey"),jH=e=>{const t=e||(ri()?an(aw,Ur(Ms)):Ur(Ms));return yt(()=>et(t)||Ms)},Lf=(e,t)=>{const r=jH(t);return{namespace:r,b:(n="")=>gi(r.value,e,n,"",""),e:n=>n?gi(r.value,e,"",n,""):"",m:n=>n?gi(r.value,e,"","",n):"",be:(n,i)=>n&&i?gi(r.value,e,n,i,""):"",em:(n,i)=>n&&i?gi(r.value,e,"",n,i):"",bm:(n,i)=>n&&i?gi(r.value,e,n,"",i):"",bem:(n,i,a)=>n&&i&&a?gi(r.value,e,n,i,a):"",is:(n,...i)=>{const a=i.length>=1?i[0]:!0;return n&&a?`${zH}${n}`:""},cssVar:n=>{const i={};for(const a in n)n[a]&&(i[`--${r.value}-${a}`]=n[a]);return i},cssVarName:n=>`--${r.value}-${n}`,cssVarBlock:n=>{const i={};for(const a in n)n[a]&&(i[`--${r.value}-${e}-${a}`]=n[a]);return i},cssVarBlockName:n=>`--${r.value}-${e}-${n}`}},Tg={current:0},Og=Ur(0),ow=2e3,Bg=Symbol("elZIndexContextKey"),sw=Symbol("zIndexContextKey"),LH=e=>{const t=ri()?an(Bg,Tg):Tg,r=e||(ri()?an(sw,void 0):void 0),n=yt(()=>{const o=et(r);return yo(o)?o:ow}),i=yt(()=>n.value+Og.value),a=()=>(t.current++,Og.value=t.current,i.value);return!La&&!an(Bg)&&tc("ZIndexInjection",`Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
|
|
107
|
+
usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:n,currentZIndex:i,nextZIndex:a}};rw({type:String,values:TH,required:!1});const PH=Symbol("size"),VH=Symbol("emptyValuesContextKey");rc({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:e=>Be(e)?!e():!e}});const uw=Symbol(),lu=Ur();function cw(e,t=void 0){return ri()?an(uw,lu):lu}function UH(e,t){const r=cw(),n=Lf(e,yt(()=>{var u;return((u=r.value)==null?void 0:u.namespace)||Ms})),i=qH(yt(()=>{var u;return(u=r.value)==null?void 0:u.locale})),a=LH(yt(()=>{var u;return((u=r.value)==null?void 0:u.zIndex)||ow})),o=yt(()=>{var u;return et(t)||((u=r.value)==null?void 0:u.size)||""});return $H(yt(()=>et(r)||{})),{ns:n,locale:i,zIndex:a,size:o}}const $H=(e,t,r=!1)=>{var n;const i=!!ri(),a=i?cw():void 0,o=(n=void 0)!=null?n:i?bx:void 0;if(!o){tc("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const u=yt(()=>{const c=et(e);return a!=null&&a.value?HH(a.value,c):c});return o(uw,u),o(iw,yt(()=>u.value.locale)),o(aw,yt(()=>u.value.namespace)),o(sw,yt(()=>u.value.zIndex)),o(PH,{size:yt(()=>u.value.size||"")}),o(VH,yt(()=>({emptyValues:u.value.emptyValues,valueOnClear:u.value.valueOnClear}))),(r||!lu.value)&&(lu.value=u.value),u},HH=(e,t)=>{const r=[...new Set([..._g(e),..._g(t)])],n={};for(const i of r)n[i]=t[i]!==void 0?t[i]:e[i];return n},kg={};var Pf=(e,t)=>{const r=e.__vccOpts||e;for(const[n,i]of t)r[n]=i;return r};const JH=rc({size:{type:wa([Number,String])},color:{type:String}}),GH=Zr({name:"ElIcon",inheritAttrs:!1}),WH=Zr({...GH,props:JH,setup(e){const t=e,r=Lf("icon"),n=yt(()=>{const{size:i,color:a}=t;return!i&&!a?{}:{fontSize:hH(i)?void 0:yl(i),"--color":a}});return(i,a)=>(Kt(),Fn("i",zx({class:et(r).b(),style:et(n)},i.$attrs),[Sf(i.$slots,"default")],16))}});var KH=Pf(WH,[["__file","icon.vue"]]);const Ig=nw(KH),QH=rc({value:{type:[String,Number],default:""},max:{type:Number,default:99},isDot:Boolean,hidden:Boolean,type:{type:String,values:["primary","success","warning","info","danger"],default:"danger"},showZero:{type:Boolean,default:!0},color:String,badgeStyle:{type:wa([String,Object,Array])},offset:{type:wa(Array),default:[0,0]},badgeClass:{type:String}}),ZH=Zr({name:"ElBadge"}),XH=Zr({...ZH,props:QH,setup(e,{expose:t}){const r=e,n=Lf("badge"),i=yt(()=>r.isDot?"":yo(r.value)&&yo(r.max)?r.max<r.value?`${r.max}+`:r.value===0&&!r.showZero?"":`${r.value}`:`${r.value}`),a=yt(()=>{var o,u,c,l,s;return[{backgroundColor:r.color,marginRight:yl(-((u=(o=r.offset)==null?void 0:o[0])!=null?u:0)),marginTop:yl((l=(c=r.offset)==null?void 0:c[1])!=null?l:0)},(s=r.badgeStyle)!=null?s:{}]});return t({content:i}),(o,u)=>(Kt(),Fn("div",{class:Rr(et(n).b())},[Sf(o.$slots,"default"),$t(Xu,{name:`${et(n).namespace.value}-zoom-in-center`,persisted:""},{default:ro(()=>[ox(sn("sup",{class:Rr([et(n).e("content"),et(n).em("content",o.type),et(n).is("fixed",!!o.$slots.default),et(n).is("dot",o.isDot),o.badgeClass]),style:ko(et(a)),textContent:df(et(i))},null,14,["textContent"]),[[Bf,!o.hidden&&(et(i)||o.isDot)]])]),_:1},8,["name"])],2))}});var YH=Pf(XH,[["__file","badge.vue"]]);const eJ=nw(YH),lw=["success","info","warning","error"],Wt=OH({customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:La?document.body:void 0}),tJ=rc({customClass:{type:String,default:Wt.customClass},center:{type:Boolean,default:Wt.center},dangerouslyUseHTMLString:{type:Boolean,default:Wt.dangerouslyUseHTMLString},duration:{type:Number,default:Wt.duration},icon:{type:CH,default:Wt.icon},id:{type:String,default:Wt.id},message:{type:wa([String,Object,Function]),default:Wt.message},onClose:{type:wa(Function),default:Wt.onClose},showClose:{type:Boolean,default:Wt.showClose},type:{type:String,values:lw,default:Wt.type},plain:{type:Boolean,default:Wt.plain},offset:{type:Number,default:Wt.offset},zIndex:{type:Number,default:Wt.zIndex},grouping:{type:Boolean,default:Wt.grouping},repeatNum:{type:Number,default:Wt.repeatNum}}),rJ={destroy:()=>!0},jr=Ub([]),nJ=e=>{const t=jr.findIndex(i=>i.id===e),r=jr[t];let n;return t>0&&(n=jr[t-1]),{current:r,prev:n}},iJ=e=>{const{prev:t}=nJ(e);return t?t.vm.exposed.bottom.value:0},aJ=(e,t)=>jr.findIndex(r=>r.id===e)>0?16:t,oJ=Zr({name:"ElMessage"}),sJ=Zr({...oJ,props:tJ,emits:rJ,setup(e,{expose:t}){const r=e,{Close:n}=MH,{ns:i,zIndex:a}=UH("message"),{currentZIndex:o,nextZIndex:u}=a,c=Ur(),l=Ur(!1),s=Ur(0);let f;const p=yt(()=>r.type?r.type==="error"?"danger":r.type:"info"),m=yt(()=>{const E=r.type;return{[i.bm("icon",E)]:E&&Fg[E]}}),d=yt(()=>r.icon||Fg[r.type]||""),h=yt(()=>iJ(r.id)),w=yt(()=>aJ(r.id,r.offset)+h.value),v=yt(()=>s.value+w.value),x=yt(()=>({top:`${w.value}px`,zIndex:o.value}));function g(){r.duration!==0&&({stop:f}=qU(()=>{y()},r.duration))}function b(){f==null||f()}function y(){l.value=!1}function N({code:E}){E===FH.esc&&y()}return Ju(()=>{g(),u(),l.value=!0}),fa(()=>r.repeatNum,()=>{b(),g()}),zU(document,"keydown",N),UU(c,()=>{s.value=c.value.getBoundingClientRect().height}),t({visible:l,bottom:v,close:y}),(E,A)=>(Kt(),bi(Xu,{name:et(i).b("fade"),onBeforeLeave:E.onClose,onAfterLeave:D=>E.$emit("destroy"),persisted:""},{default:ro(()=>[ox(sn("div",{id:E.id,ref_key:"messageRef",ref:c,class:Rr([et(i).b(),{[et(i).m(E.type)]:E.type},et(i).is("center",E.center),et(i).is("closable",E.showClose),et(i).is("plain",E.plain),E.customClass]),style:ko(et(x)),role:"alert",onMouseenter:b,onMouseleave:g},[E.repeatNum>1?(Kt(),bi(et(eJ),{key:0,value:E.repeatNum,type:et(p),class:Rr(et(i).e("badge"))},null,8,["value","type","class"])):hs("v-if",!0),et(d)?(Kt(),bi(et(Ig),{key:1,class:Rr([et(i).e("icon"),et(m)])},{default:ro(()=>[(Kt(),bi(KP(et(d))))]),_:1},8,["class"])):hs("v-if",!0),Sf(E.$slots,"default",{},()=>[E.dangerouslyUseHTMLString?(Kt(),Fn(mr,{key:1},[hs(" Caution here, message could've been compromised, never use user's input as message "),sn("p",{class:Rr(et(i).e("content")),innerHTML:E.message},null,10,["innerHTML"])],2112)):(Kt(),Fn("p",{key:0,class:Rr(et(i).e("content"))},df(E.message),3))]),E.showClose?(Kt(),bi(et(Ig),{key:2,class:Rr(et(i).e("closeBtn")),onClick:_U(y,["stop"])},{default:ro(()=>[$t(et(n))]),_:1},8,["class","onClick"])):hs("v-if",!0)],46,["id"]),[[Bf,l.value]])]),_:3},8,["name","onBeforeLeave","onAfterLeave"]))}});var uJ=Pf(sJ,[["__file","message.vue"]]);let cJ=1;const fw=e=>{const t=!e||xt(e)||ti(e)||Be(e)?{message:e}:e,r={...Wt,...t};if(!r.appendTo)r.appendTo=document.body;else if(xt(r.appendTo)){let n=document.querySelector(r.appendTo);gH(n)||(tc("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),n=document.body),r.appendTo=n}return r},lJ=e=>{const t=jr.indexOf(e);if(t===-1)return;jr.splice(t,1);const{handler:r}=e;r.close()},fJ=({appendTo:e,...t},r)=>{const n=`message_${cJ++}`,i=t.onClose,a=document.createElement("div"),o={...t,id:n,onClose:()=>{i==null||i(),lJ(l)},onDestroy:()=>{vg(null,a)}},u=$t(uJ,o,Be(o.message)||ti(o.message)?{default:Be(o.message)?o.message:()=>o.message}:null);u.appContext=r||Na._context,vg(u,a),e.appendChild(a.firstElementChild);const c=u.component,l={id:n,vnode:u,vm:c,handler:{close:()=>{c.exposed.visible.value=!1}},props:u.component.props};return l},Na=(e={},t)=>{if(!La)return{close:()=>{}};if(yo(kg.max)&&jr.length>=kg.max)return{close:()=>{}};const r=fw(e);if(r.grouping&&jr.length){const i=jr.find(({vnode:a})=>{var o;return((o=a.props)==null?void 0:o.message)===r.message});if(i)return i.props.repeatNum+=1,i.props.type=r.type,i.handler}const n=fJ(r,t);return jr.push(n),n.handler};lw.forEach(e=>{Na[e]=(t={},r)=>{const n=fw(t);return Na({...n,type:e},r)}});function pJ(e){for(const t of jr)(!e||e===t.props.type)&&t.handler.close()}Na.closeAll=pJ;Na._context=null;_H(Na,"$message");const gs=(e,t)=>{let r=G1(ir(t[0]));for(let n=1;n<t.length;n++){let i=Number(t[n]);i.toString()==="NaN"&&(i=0),r=r[e](ir(i))}return parseFloat(r.done())},Rg=e=>e==null||e==="",mJ={round:(e,t=2)=>Rg(e)?"-":tn(Number(e),t),add:function(...e){return gs("add",e)},subtract:function(...e){return gs("subtract",e)},multiply:function(...e){return gs("multiply",e)},divide:function(...e){return gs("divide",e)},formatValue:(e,t=2)=>{if(Rg(e))return"-";const r=Number(e);return r>=1e8||r<=-1e8?`${tn(r/1e8,t)}亿`:r>=1e4||r<=-1e4?`${tn(r/1e4,t)}万`:tn(r,t)}};var dJ=Object.defineProperty,hJ=(e,t,r)=>t in e?dJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ea=(e,t,r)=>hJ(e,typeof t!="symbol"?t+"":t,r);class pw{constructor(t,r={}){ea(this,"dom"),ea(this,"resizeRo"),ea(this,"callback"),ea(this,"visibilitychangeFn"),ea(this,"timer"),ea(this,"config",{debounce:50}),this.dom=t,this.config={...this.config,...r}}listen(t){this.callback=t;let r=!0;this.resizeRo=new ResizeObserver(()=>{if(r){r=!1;return}clearTimeout(this.timer),this.timer=setTimeout(()=>{this.callback&&this.callback(),clearTimeout(this.timer)},this.config.debounce)}),this.resizeRo.observe(this.dom),this.visibilitychangeFn=()=>{(document.visibilityState==="visible"||!document.hidden)&&this.callback&&this.callback()},document.addEventListener("visibilitychange",this.visibilitychangeFn)}dispose(){var t;(t=this.resizeRo)==null||t.disconnect(),document.removeEventListener("visibilitychange",this.visibilitychangeFn)}}const gJ=e=>new pw(e),vJ=Object.freeze(Object.defineProperty({__proto__:null,ResizeListener:pw,addResizeListener:gJ},Symbol.toStringTag,{value:"Module"}));`${new Date().getTime()}${Math.floor(Math.random()*1e9)}`;const yJ=e=>{e?qg("token",e):console.error("token不能为空")},bJ=e=>{e?qg("userData",e):console.error("用户数据不能为空")},mw=()=>zg("token"),dw=e=>{const t=zg("userData");return e?t==null?void 0:t[e]:t},xJ=()=>!!mw(),wJ=()=>{const e=dw();return(e==null?void 0:e.username)==="admin"},hw=(e="")=>location.href=`${location.origin}/login/index.html?url=${encodeURIComponent(e||location.href)}`,NJ=(e=!0,t)=>{if(Uf("token"),Uf("userData"),e){hw();return}t&&(location.href=t)},DJ=Object.freeze(Object.defineProperty({__proto__:null,getToken:mw,getUserData:dw,isAdmin:wJ,isLogin:xJ,login:hw,loginout:NJ,setToken:yJ,setUserData:bJ},Symbol.toStringTag,{value:"Module"})),EJ=mJ,{addResizeListener:AJ}=vJ,{setToken:TJ,setUserData:OJ,getToken:SJ,getUserData:CJ,isLogin:BJ,isAdmin:kJ,login:MJ,loginout:_J}=DJ,FJ=(e,t=500,r=!1)=>{let n=null;return function(...i){if(clearTimeout(n),r){const a=!n;n=setTimeout(()=>{n=null},t),a&&e.apply(this,i)}else n=setTimeout(()=>{e.apply(this,i)},t)}};exports.A=MJ;exports.D=AJ;exports.G=FJ;exports.K=_J;exports.U=SJ;exports.V=CJ;exports.x=EJ;
|